query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Permission not linked with this profile
public function permissionsAvailable($filter = null) { $permissions = Permission::whereNotIn('permissions.id', function($query) { $query->select('permission_role.permission_id'); $query->from('permission_role'); $query->whereRaw("permission_role.role_id={$this->id}"); }) ->where(function ($queryFilter) use ($filter) { if ($filter) $queryFilter->where('permissions.name', 'LIKE', "%{$filter}%"); }) ->paginate(); return $permissions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function permissions() {\r\n\t\treturn false;\r\n\t}", "protected function getCurrentPermission() {}", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "protected function fixPermission() {}", "protected function isPermissionCorrect() {}", "public function NoPermission()\n\t\t{\n\t\t\t$GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR);\n\t\t}", "public function testNoPermission(){\n $noAccessUser = $this->drupalCreateUser([]);\n $this->drupalLogin($noAccessUser);\n $this->drupalGet('connect-four');\n $this->assertSession()->statusCodeEquals(403);\n }", "public function getDontAutograntPermissions()\n {\n return $this->dont_autogrant_permissions;\n }", "public static function uses_permissions(): bool;", "function hook_permission_check($data) {\n\t\treturn false;\n\t}", "public function hasUsageRights() {}", "public function testManagerNotAccessProfileUser()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "protected function getTargetPermission() {}", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "protected function handlePrivacy() : void // public visibility\n {\n if (!User::$id || empty($this->_get['id'][0]))\n {\n trigger_error('AjaxProfile::handlePrivacy - profileId empty or user not logged in', E_USER_ERROR);\n return;\n }\n\n $uid = User::$id;\n if ($this->_get['user'] && User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU))\n {\n if (!($uid = DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE user = ?', $this->_get['user'])))\n {\n trigger_error('AjaxProfile::handlePrivacy - user \"'.$this->_get['user'].'\" does not exist', E_USER_ERROR);\n return;\n }\n }\n\n if ($this->undo)\n {\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags & ?d WHERE profileId IN (?a) AND accountId = ?d', ~PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n DB::Aowow()->query('UPDATE ?_profiler_profiles SET cuFlags = cuFlags & ?d WHERE id IN (?a) AND user = ?d', ~PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n }\n else\n {\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags | ?d WHERE profileId IN (?a) AND accountId = ?d', PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n DB::Aowow()->query('UPDATE ?_profiler_profiles SET cuFlags = cuFlags | ?d WHERE id IN (?a) AND user = ?d', PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n }\n }", "public function checkPermissions();", "public function denyLink()\n {\n }", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "public function permission(): string;", "public function getPermDenied()\n {\n return $this->getProperty('pd');\n }", "static function denied()\n {\n\n }", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "private function filterByPermission(){\n\n }", "public function getFilePermissionsReturnsCorrectPermissionsForFilesNotOwnedByCurrentUser_dataProvider() {}", "abstract public function permission(): string;", "public function getPermission()\n {\n return $this->permission ?: 'everyone';\n }", "public function rol_conductor_not_access()\n {\n if ($this->rol != 1 && $this->rol != 2) {\n exit($this->httpResponse(\"error\", \"forbbiden\", \"Your role do not have permission\", 403)->json());\n }\n }", "public function & GetPermissions ();", "public function isAlwaysGranted(): bool;", "public function hasOtherAccess() {\n return $this->_has(17);\n }", "protected function check_permission()\n {\n return true;\n }", "public function noPermission()\n {\n // dd(Auth::guard('admin')->user());\n return view('admin.noPermission');\n }", "public function getPermission()\n {\n return $this->permission ?: null;\n }", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function isForbidden();", "public function getPermission(){\n\t\tif (Yii::$app->getUserOpt->Modul_akses('11')){\n\t\t\treturn Yii::$app->getUserOpt->Modul_akses('11');\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getPermissions() {}", "public function getPermissions() {}", "function check_has_permissions() {\n $details = $this->get_user_details('1');\n\t\treturn 0 != strcmp(strtoupper($details['StatusInfo']), '\"ACCESS DENIED\"');\n\t}", "public function getIgnoreAccess() {\n\t\treturn elgg_get_ignore_access();\n\t}", "public function checkPermission(App\\Request $request)\n\t{\n\t\t$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$currentUserPriviligesModel->hasModulePermission($request->getModule())) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('LBL_PERMISSION_DENIED', 406);\n\t\t}\n\t}", "public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }", "public function isPermissible()\n {\n return !$this->invisible && (\n [] === $this->permissions || Wa::panel()->isAccessible(\n $this->module, $this->panel, $this->permissions));\n }", "public function denyAccess(): AccessResultInterface;", "public function testAccessDeleteNoPermission()\n {\n $user = \\App\\User::where('permission', 0)->first();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 2,\n ]);\n $response->assertStatus(403);\n }", "public function checkAccess()\n {\n // need to be modified for security\n }", "function deny($message = null) {\n // Ignore soft 403 for ajax requests as redirections is transparent.\n if (config\\SOFT_403 != false && !\\melt\\request\\is_ajax()) {\n $user = get_user();\n if ($user === null) {\n if (config\\LAST_DENY_AUTOREDIRECT)\n $_SESSION['userx\\LAST_DENY_PATH'] = APP_ROOT_URL . \\substr(REQ_URL, 1);\n if ($message === null)\n $message = _(\"Access denied. You are not logged in.\");\n \\melt\\messenger\\redirect_message(config\\SOFT_403, $message, \"bad\");\n } else {\n if ($message === null)\n $message = _(\"Access denied. Insufficient permissions.\");\n \\melt\\messenger\\redirect_message(config\\SOFT_403, $message, \"bad\");\n }\n } else\n \\melt\\request\\show_xyz(403);\n exit;\n}", "public function checkPermission(\\App\\Request $request)\n\t{\n\t\tif (!\\App\\User::getCurrentUserModel()->isAdmin() || !$request->has('record')) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermittedForAdmin('LBL_PERMISSION_DENIED');\n\t\t}\n\t}", "public function checkPermission(\\App\\Request $request)\n\t{\n\t\t$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif (!$currentUserPriviligesModel->hasModulePermission($request->getModule())) {\n\t\t\tthrow new \\App\\Exceptions\\NoPermitted('ERR_NOT_ACCESSIBLE', 406);\n\t\t}\n\t}", "public function livreurDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_LIVREUR');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_LIVREUR', null, 'User tried to access a page without having ROLE_LIVREUR');\n}", "public function shouldReturnForbiddenWhenUserDoesNotHavePermissions()\n {\n $this->user->permissions()->delete();\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint), [])->assertForbidden();\n }", "public function shouldReturnForbiddenWhenUserDoesNotHavePermissions()\n {\n $this->user->permissions()->delete();\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint), [])->assertForbidden();\n }", "function get_permissions($profile_id) \n{\n\t\n\tglobal $db_raid, $phpraid_config;\n\n\t//clear first\n\tclear_session_permissions();\n\t\t\n\t$sql = sprintf(\t\"SELECT priv \".\n\t\t\t\t\t\"\tFROM \" . $phpraid_config['db_prefix'] . \"profile\" .\n\t\t\t\t\t\"\tWHERE profile_id=%s\", quote_smart($profile_id));\n\t$result = $db_raid->sql_query($sql) or print_error($sql, $db_raid->sql_error(),1);\n\t$data = $db_raid->sql_fetchrow($result, true);\n\t\n\t// check all permissions\n\t$sql_priv = sprintf(\"SELECT * \".\n\t\t\t\t\t\t\"\tFROM \" . $phpraid_config['db_prefix'] . \"permissions\".\n\t\t\t\t\t\t\"\tWHERE permission_id=%s\", quote_smart($data['priv']));\n//\techo \"sql:\".$sql.\"<br>sql_priv:\".$sql_priv;\n\t$result_priv = $db_raid->sql_query($sql_priv) or print_error($sql_priv, $db_raid->sql_error(),1);\n\t$data_priv = $db_raid->sql_fetchrow($result_priv, true);\n\t\n/*\t$data_priv['announcements'] ? $_SESSION['priv_announcements'] = 1 : $_SESSION['priv_announcements'] = 0;\t\n\t$data_priv['configuration'] ? $_SESSION['priv_configuration'] = 1 :\t$_SESSION['priv_configuration'] = 0;\n\t$data_priv['profile'] ? $_SESSION['priv_profile'] = 1 : $_SESSION['priv_profile'] = 0;\n\t$data_priv['guilds'] ? $_SESSION['priv_guilds'] = 1 : $_SESSION['priv_guilds'] = 0;\n\t$data_priv['locations'] ? $_SESSION['priv_locations'] = 1 : $_SESSION['priv_locations'] = 0;\n\t$data_priv['raids'] ? $_SESSION['priv_raids'] = 1 : $_SESSION['priv_raids'] = 0;\n*/\t\n\tif ($data_priv['announcements']==1) $_SESSION['priv_announcements'] = 1; else $_SESSION['priv_announcements'] = 0;\t\n\tif ($data_priv['configuration']==1) $_SESSION['priv_configuration'] = 1; else\t$_SESSION['priv_configuration'] = 0;\n\tif ($data_priv['profile']==1) $_SESSION['priv_profile'] = 1; else $_SESSION['priv_profile'] = 0;\n\tif ($data_priv['guilds']==1) $_SESSION['priv_guilds'] = 1; else $_SESSION['priv_guilds'] = 0;\n\tif ($data_priv['locations']==1) $_SESSION['priv_locations'] = 1; else $_SESSION['priv_locations'] = 0;\n\tif ($data_priv['raids']==1) $_SESSION['priv_raids'] = 1; else $_SESSION['priv_raids'] = 0;\n}", "public function noPermissions($message = 'No Permissions')\n {\n throw new Zend_Controller_Action_Exception($message, 403);\n }", "abstract public function getPermissions();", "function check_permission()\r\n {\r\n // Ensure the user logs in\r\n require_login($this->course->id);\r\n if (isguestuser()) error(get_string('noguestaccess', 'sloodle'));\r\n add_to_log($this->course->id, 'course', 'view sloodle data', '', \"{$this->course->id}\");\r\n\r\n // Ensure the user is allowed to update information on this course\r\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\r\n require_capability('moodle/course:update', $this->course_context);\r\n }", "abstract protected function canAccess();", "public function getPossiblePermissions();", "static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }", "private function userNotPermit(){\n throw new \\Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException('Bad user',null, 403);\n }", "public function isAccess();", "public function hasAccess(): bool;", "function check_permission()\n {\n // Make sure the user is logged-in\n require_course_login($this->course, true, $this->cm);\n\n add_to_log($this->course->id, 'sloodle', 'view sloodle module', \"view.php?id={$this->cm->id}\", \"{$this->sloodle->id}\", $this->cm->id);\n \n // Check for permissions\n $this->module_context = get_context_instance(CONTEXT_MODULE, $this->cm->id);\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\n if (has_capability('moodle/course:manageactivities', $this->module_context)) $this->canedit = true;\n\n // If the module is hidden, then can the user still view it?\n if (empty($this->cm->visible) && !has_capability('moodle/course:viewhiddenactivities', $this->module_context)) notice(get_string('activityiscurrentlyhidden'));\n }", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "public function testErrorIsReturnedIfAssigningPermissionsNotAssignedToSelf()\n {\n [$user, $server] = $this->generateTestAccount([\n Permission::ACTION_USER_CREATE,\n Permission::ACTION_USER_READ,\n Permission::ACTION_CONTROL_CONSOLE,\n ]);\n\n $response = $this->actingAs($user)->postJson($this->link($server) . '/users', [\n 'email' => $email = $this->faker->email,\n 'permissions' => [\n Permission::ACTION_USER_CREATE,\n Permission::ACTION_USER_UPDATE, // This permission is not assigned to the subuser.\n ],\n ]);\n\n $response->assertForbidden();\n $response->assertJsonPath('errors.0.code', 'HttpForbiddenException');\n $response->assertJsonPath('errors.0.detail', 'Cannot assign permissions to a subuser that your account does not actively possess.');\n }", "function hasWriteAccess() {\r\n\t\treturn (\r\n\t\t\t\t$this->annonce->associationID == $this->extendedProfile->userID ||\r\n\t\t\t\t$this->extendedProfile instanceof ProfileNiceBenevolat);\r\n\t}", "public function needsPermission()\n {\n // an error will be thrown\n\n foreach ($this->model as $element) {\n\n $controller = ucfirst($element) . 'Controller';\n $method = 'execute' . ucfirst($this->action);\n\n if (isset($this->app->config()->get()->Backend->Authentication->noPermission->$controller)) {\n\n $noPermissionMethods = $this->app->config()->get()->Backend->Authentication->noPermission->$controller;\n\n // echo \"$method : \";\n // print_r($noPermissionMethods);\n if (in_array($method, $noPermissionMethods)) {\n continue;\n }\n }\n // echo \"$element ...\";\n //if the user is not authentified, this command will throw an error\n $this->auth();\n $this->permission($element);\n }\n }", "public function initialize()\n {\n if (!$this->modx->hasPermission($this->permission)) {\n return $this->modx->lexicon('access_denied');\n }\n\n return parent::initialize();\n }", "public function forbiddenAction() {\n }", "public function viewableByOwnerOnly();", "public function permission($permission);", "public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}", "public function doesCheckModifyAccessListHookModifyAccessAllowed() {}", "public function hasPermission($action = \"\");", "function check_import_new_users($permission)\n {\n }", "public function testMeetupAccessWillCheckPermission()\n {\n list($responseCodeForUser1, $responseBody) = sendGetRequest($this->endpoint .'/5003e8bc757df2020d0f0033', array(), $this->user1Headers);\n list($responseCodeForUser2, $responseBody) = sendGetRequest($this->endpoint .'/5003e8bc757df2020d0f0033', array(), $this->user3Headers);\n\n $this->assertEquals(200, $responseCodeForUser1);\n $this->assertEquals(403, $responseCodeForUser2);\n }", "public function forbidden() {\n\t\treturn [\n\t\t\t'errors' => [\n\t\t\t\t[\n\t\t\t\t\t'message' => \"You don't have permission to access this.\",\n\t\t\t\t\t'extensions' => [ 'code' => 'FORBIDDEN' ],\n\t\t\t\t],\n\t\t\t]\n\t\t];\n\t}", "public function getPageAccessFailureReasons() {}", "function checkAccess() ;", "public function responsableDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_RESPONSABLE');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_RESPONSABLE', null, 'User tried to access a page without having ROLE_RESPONSABLE');\n}", "public static function getUserNoProfile()\n {\n $user = static::get();\n if (isset($user->noPerfil)) {\n return $user->noPerfil;\n }\n }", "function VerificarOfflinePermFb()\n\t{\n\t\t$valido = false;\n\t\ttry\n\t\t{\n\t\t\t$amigos = $this->ApiAuth(\"/$this->IdFacebook/friends\");\n\t\t\tif(is_array($amigos) && count($amigos) >= 1)\n\t\t\t$valido = true;\n\t\t}\n\t\tcatch(Exception $e) {}\n\t\treturn $valido;\n\t}", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "function have_profile(){\n\treturn ( get_profile('enabled') === true && get_profile() !== -1 );\n}", "public function permissionedControlled() {\r\n return [\r\n '#markup' => $this->t('This menu entry will not show and the page will not be accessible without the \"access protected menu example\" permission to current user.'),\r\n ];\r\n }", "public function canModifyVisibilityOfUsers();", "final public function isNobody():bool\n {\n return $this->permission() <= 1;\n }", "private static function notAllowed() : array\n\t{\n\t\t$return = [];\n\n\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\n\t\t$return['count'] = 0;\n\t\t$return['status'] = 0;\n\t\t$return['message'] = $aeSettings->getText('not_authenticated');\n\n\t\t/*<!-- build:debug -->*/\n\t\tif ($aeSettings->getDebugMode()) {\n\t\t\t$return['debug'] = 'The show_login settings is set to ' .\n\t\t\t\t'1 and the user isn\\'t yet connected. In that case, ' .\n\t\t\t\t'the list of files should be keept hidden';\n\t\t}\n\t\t/*<!-- endbuild -->*/\n\n\t\treturn $return;\n\t}", "function require_permission($required)\n{\n require_login();\n\n // owners have full access\n if ($_SESSION['permission'] == OWN) {\n return;\n }\n\n if ($required != $_SESSION['permission']) {\n redirect_to(url_for(\"/index.php\"));\n }\n}", "function checkUserPermissions( $cid, $actionName, $allowActionToMyself = false ) {\r\n\tglobal $database, $my;\r\n\t$msg = null;\r\n\t$iuser = ggo($cid[0], \"#__users\");\r\n\tif ( $my->gid < $iuser->gid ) {\r\n\t\t$msg .= 'Вы не можете '. $actionName .' '.$iuser->name.' Это могут делать только пользователи с более высоким уровнем доступа. ';\r\n\t}\r\n\treturn $msg;\r\n}" ]
[ "0.66033596", "0.6342334", "0.631757", "0.631757", "0.631757", "0.631757", "0.631757", "0.63036233", "0.6260023", "0.6201802", "0.6152378", "0.61147827", "0.6084393", "0.6023199", "0.5998642", "0.5976748", "0.58997715", "0.589125", "0.5869823", "0.58655125", "0.5861333", "0.5838634", "0.5836416", "0.58333284", "0.5820737", "0.5791296", "0.5788537", "0.5781877", "0.5778674", "0.5750051", "0.574301", "0.5722836", "0.5675502", "0.5672036", "0.5662758", "0.5656897", "0.5627746", "0.56259024", "0.56259024", "0.56259024", "0.5625829", "0.5625829", "0.56244093", "0.56244093", "0.56244093", "0.5622845", "0.56218827", "0.5617468", "0.5617468", "0.56156856", "0.56112826", "0.56007046", "0.5593462", "0.55778545", "0.55690926", "0.5559798", "0.55560726", "0.55520725", "0.55421466", "0.5535682", "0.55324745", "0.5527932", "0.5527932", "0.55245996", "0.5524345", "0.55197597", "0.55099905", "0.5506242", "0.5501844", "0.5495306", "0.54891336", "0.5484265", "0.5481334", "0.54785746", "0.5472389", "0.5466527", "0.5463131", "0.5463111", "0.54604053", "0.54527205", "0.5452459", "0.5440063", "0.5438033", "0.5431695", "0.5428908", "0.5423206", "0.54176575", "0.541605", "0.5414524", "0.5414349", "0.540875", "0.54066455", "0.5404894", "0.5397788", "0.539516", "0.5389737", "0.538767", "0.5384675", "0.53834647", "0.538341", "0.5381088" ]
0.0
-1
Getters and Setters Get the representative
function &getRepresentative() { return $this->_representative; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "public function get_superficie(){ return $this->_superficie;}", "abstract public function get() ;", "public function Name(){ return $this->Name;}", "public function __toString()\n {\n \treturn $this->get();\n }", "public function getNom()\n{\nreturn $this->Nom;\n}", "public function __toString(){\n\t\treturn $this->value;\n\t}", "abstract function get();", "public function get()\n {\n // TODO: Implement get() method.\n }", "public function getNom() {\n return $this->nom;\n}", "public function get() {\n \n }", "public function get()\n {\n \n return $this->value;\n \n }", "public function nom_alien()\r\n{\r\n return $this->_nom_alien;\r\n}", "public function __toString() {\n\t\t\treturn $this->value;\n\t\t}", "function getId(){ return $this->toString(); }", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function __toString()\n\t{\n\t\treturn $this->get();\n\t}", "public static function getters();", "public function get_name(){ return $this->_name;}", "protected function value()\n {\n }", "public function __toString()\n\t{\n\t\treturn $this->value();\n\t}", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function get_nom(){ return $this->_nom;}", "public function get_nom(){ return $this->_nom;}", "function getTitre() { return $this->titre; }", "public function get_description(){ return $this->_description;}", "function get_value() {return $this->get();}", "abstract protected function getDirectGetters();", "public function value() { }", "public function value() { }", "public function value()\n {\n }", "public function value()\n {\n }", "public function value()\n {\n }", "public function value()\n {\n }", "public function __get($strName) {\n\t\t\tswitch ($strName) {\n\t\t\t\t///////////////////\n\t\t\t\t// Member Variables\n\t\t\t\t///////////////////\n\t\t\t\tcase 'Idcharacteristic':\n\t\t\t\t\t// Gets the value for intIdcharacteristic (Read-Only PK)\n\t\t\t\t\t// @return integer\n\t\t\t\t\treturn $this->intIdcharacteristic;\n\n\t\t\t\tcase 'SpeciesIdspecies':\n\t\t\t\t\t// Gets the value for intSpeciesIdspecies (Not Null)\n\t\t\t\t\t// @return integer\n\t\t\t\t\treturn $this->intSpeciesIdspecies;\n\n\t\t\t\tcase 'Title':\n\t\t\t\t\t// Gets the value for strTitle \n\t\t\t\t\t// @return string\n\t\t\t\t\treturn $this->strTitle;\n\n\t\t\t\tcase 'Description':\n\t\t\t\t\t// Gets the value for strDescription \n\t\t\t\t\t// @return string\n\t\t\t\t\treturn $this->strDescription;\n\n\t\t\t\tcase 'PicturesPath':\n\t\t\t\t\t// Gets the value for strPicturesPath \n\t\t\t\t\t// @return string\n\t\t\t\t\treturn $this->strPicturesPath;\n\n\t\t\t\tcase 'CharacteristicIdcharacteristic':\n\t\t\t\t\t// Gets the value for intCharacteristicIdcharacteristic \n\t\t\t\t\t// @return integer\n\t\t\t\t\treturn $this->intCharacteristicIdcharacteristic;\n\n\t\t\t\tcase 'Identifier':\n\t\t\t\t\t// Gets the value for strIdentifier \n\t\t\t\t\t// @return string\n\t\t\t\t\treturn $this->strIdentifier;\n\n\n\t\t\t\t///////////////////\n\t\t\t\t// Member Objects\n\t\t\t\t///////////////////\n\t\t\t\tcase 'SpeciesIdspeciesObject':\n\t\t\t\t\t// Gets the value for the Species object referenced by intSpeciesIdspecies (Not Null)\n\t\t\t\t\t// @return Species\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif ((!$this->objSpeciesIdspeciesObject) && (!is_null($this->intSpeciesIdspecies)))\n\t\t\t\t\t\t\t$this->objSpeciesIdspeciesObject = Species::Load($this->intSpeciesIdspecies);\n\t\t\t\t\t\treturn $this->objSpeciesIdspeciesObject;\n\t\t\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\t\t\tthrow $objExc;\n\t\t\t\t\t}\n\n\t\t\t\tcase 'CharacteristicIdcharacteristicObject':\n\t\t\t\t\t// Gets the value for the Characteristic object referenced by intCharacteristicIdcharacteristic \n\t\t\t\t\t// @return Characteristic\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif ((!$this->objCharacteristicIdcharacteristicObject) && (!is_null($this->intCharacteristicIdcharacteristic)))\n\t\t\t\t\t\t\t$this->objCharacteristicIdcharacteristicObject = Characteristic::Load($this->intCharacteristicIdcharacteristic);\n\t\t\t\t\t\treturn $this->objCharacteristicIdcharacteristicObject;\n\t\t\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\t\t\tthrow $objExc;\n\t\t\t\t\t}\n\n\n\t\t\t\t////////////////////////////\n\t\t\t\t// Virtual Object References (Many to Many and Reverse References)\n\t\t\t\t// (If restored via a \"Many-to\" expansion)\n\t\t\t\t////////////////////////////\n\n\t\t\t\tcase '_CharacteristicAsId':\n\t\t\t\t\t// Gets the value for the private _objCharacteristicAsId (Read-Only)\n\t\t\t\t\t// if set due to an expansion on the characteristic.characteristic_idcharacteristic reverse relationship\n\t\t\t\t\t// @return Characteristic\n\t\t\t\t\treturn $this->_objCharacteristicAsId;\n\n\t\t\t\tcase '_CharacteristicAsIdArray':\n\t\t\t\t\t// Gets the value for the private _objCharacteristicAsIdArray (Read-Only)\n\t\t\t\t\t// if set due to an ExpandAsArray on the characteristic.characteristic_idcharacteristic reverse relationship\n\t\t\t\t\t// @return Characteristic[]\n\t\t\t\t\treturn (array) $this->_objCharacteristicAsIdArray;\n\n\n\t\t\t\tcase '__Restored':\n\t\t\t\t\treturn $this->__blnRestored;\n\n\t\t\t\tdefault:\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn parent::__get($strName);\n\t\t\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\t\t\tthrow $objExc;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "public function getValue(){ }", "public function description(){ return $this->name . \" [\" . $this->ID . \"]\"; }", "function getType()\t { return $this->type;\t }", "function __toString()\n\t{\n\t\treturn $this->getTitle();\n\t}", "function __toString () {\n \n \n \n }", "public function getDescription()\n{\nreturn $this->Description;\n}", "public function getNom():string{\r\n\r\n\r\n\r\n return $this->nom;\r\n\r\n\r\n\r\n\r\n \t\t\t}", "public function getNome()\n {\n return $this->nome;\n }", "public function __get($atributo){\n\t\treturn $this->$atributo;\n\t}", "abstract protected function getValue();", "abstract public function getValue();", "abstract public function getValue();", "abstract public function getValue();", "function __toString()\n {\n return $this->name;\n }", "function __toString()\n {\n return $this->name;\n }", "function __toString()\n {\n return $this->name;\n }", "function __toString()\n {\n return $this->name;\n }", "public function GetName() \n {\n return $this->name;\n }", "function getNombre(){\n\t\treturn $this->nombre;\n\t}", "public function __toString(){\n return $this->name;\n \n }", "public function getValue() {\n\n }", "public function get()\n {\n return $this->value;\n }", "public function get()\n {\n return $this->value;\n }", "public function get()\n {\n return $this->value;\n }", "public function get()\n {\n return $this->value;\n }", "function __toString(){\n\t\treturn $this->toString();\n\t}", "public function getName(){\n return $this->name;\n }", "public function get()\n\t{\n\t\treturn static::__toString();\n\t}", "function __toString()\r\n {\r\n return $this->ime .\" \". $this->prezime .\" (\". $this->korisnickoIme .\")\";\r\n }", "public function getObjet()\n {\n return $this->objet;\n }", "function __toString()\n {\n return $this->getValue() ? $this->getValue() : 'new';\n }", "abstract public function getResultObjectProperty();", "function __toString() {\n return $this->name;\n }", "function getValue() {\n return $this->value;\n }", "public function __toString(){\n return $this->nom;\n // to show the id in the select\n // return $this->id;\n }" ]
[ "0.6536918", "0.6536918", "0.6536918", "0.6536918", "0.6536918", "0.6536918", "0.6421507", "0.6376491", "0.62641203", "0.62633926", "0.6224822", "0.6180357", "0.6159016", "0.6148007", "0.6108451", "0.6107597", "0.60961473", "0.60827214", "0.6051411", "0.604969", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.604443", "0.6036139", "0.6028955", "0.6015496", "0.6005251", "0.5996709", "0.5977675", "0.5977675", "0.5977675", "0.5977675", "0.5977675", "0.5977675", "0.5977675", "0.59770006", "0.59770006", "0.5974023", "0.5965987", "0.5965363", "0.59499305", "0.594748", "0.594748", "0.59285986", "0.59285986", "0.59285986", "0.5928155", "0.5891412", "0.58808446", "0.58808446", "0.5865071", "0.58611596", "0.584631", "0.58446795", "0.5841966", "0.584167", "0.5838424", "0.5832344", "0.58283985", "0.5822997", "0.5822711", "0.5822711", "0.5820881", "0.5816434", "0.5816434", "0.5816434", "0.5816434", "0.5813525", "0.5808188", "0.58077025", "0.58011264", "0.58005774", "0.58005774", "0.58005774", "0.58005774", "0.57941467", "0.5786269", "0.57856625", "0.57835704", "0.57792425", "0.5775075", "0.57705355", "0.57701993", "0.57679325", "0.57593495" ]
0.68535274
0
Overridden template methods Initialize form data from the representative entry.
function initData() { $representative =& $this->getRepresentative(); if ($representative) { $this->_data = array( 'representativeId' => $representative->getId(), 'role' => $representative->getRole(), 'representativeIdType' => $representative->getRepresentativeIdType(), 'representativeIdValue' => $representative->getRepresentativeIdValue(), 'name' => $representative->getName(), 'phone' => $representative->getPhone(), 'fax' => $representative->getFax(), 'email' => $representative->getEmail(), 'url' =>$representative->getUrl(), 'isSupplier' => $representative->getIsSupplier(), ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function populateForm() {}", "function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n $this->set_element_value(\"Meet End\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n\r\n // If the config is set to US only, initialize the country\r\n\r\n if (FT_US_ONLY)\r\n $this->set_element_value(\"Meet Country\",\r\n FT_SDIF_COUNTRY_CODE_UNITED_STATES_OF_AMERICA_VALUE) ;\r\n\r\n $this->set_element_value(\"Pool Altitude\", \"0\") ;\r\n }", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "abstract function setupform();", "function populate() {\n // @todo We inject client input directly into the form. What about\n // security issues?\n if (isset($this->form->request['raw_input'][$this->attributes['name']])) {\n // Disabled input elements do not accept new input.\n if (!$this->disabled) {\n $this->value = $this->form->request['raw_input'][$this->attributes['name']];\n }\n }\n }", "function form_init_data() \r\n {\r\n //$this->set_hidden_element_value(\"id\", \"logon\");\r\n $dataForm = $this->getViewVariable('courseDataForm');\r\n\r\n $this->set_element_value(\"courseName\", $dataForm['c_name'] );\r\n $this->set_element_value(\"courseLanguage\", $dataForm['c_language'] );\r\n //$this->set_element_value(\"coursedescription\", $dataForm['c_description'] );\r\n $this->set_element_value(\"courseActive\", $dataForm['c_active'] );\r\n $this->set_element_value(\"courseAccess\", $dataForm['c_access'] );\r\n $this->set_element_value(\"coursedataDescripcion\", $dataForm['cd_descripcion'] );\r\n $this->set_element_value(\"coursedataVersion\", $dataForm['cd_version'] );\r\n $this->set_element_value(\"coursedataPalabrasClaves\", $dataForm['cd_claves'] );\r\n $this->set_element_value(\"coursedataDestinatarios\", $dataForm['cd_destinatarios'] );\r\n $this->set_element_value(\"coursedataConocimientosPrevios\", $dataForm['cd_conocimientos'] );\r\n $this->set_element_value(\"coursedataMetodologia\", $dataForm['cd_metodologia'] );\r\n\r\n }", "private function _populateEntryModel(Entry $entry)\n {\n $request = Craft::$app->getRequest();\n\n // Set the entry attributes, defaulting to the existing values for whatever is missing from the post data\n $entry->typeId = $request->getBodyParam('typeId', $entry->typeId);\n $entry->slug = $request->getBodyParam('slug', $entry->slug);\n if (($postDate = $request->getBodyParam('postDate')) !== null) {\n $entry->postDate = DateTimeHelper::toDateTime($postDate) ?: null;\n }\n if (($expiryDate = $request->getBodyParam('expiryDate')) !== null) {\n $entry->expiryDate = DateTimeHelper::toDateTime($expiryDate) ?: null;\n }\n $entry->enabled = (bool)$request->getBodyParam('enabled', $entry->enabled);\n $entry->enabledForSite = $entry->getSection()->getHasMultiSiteEntries()\n ? (bool)$request->getBodyParam('enabledForSite', $entry->enabledForSite)\n : true;\n $entry->title = $request->getBodyParam('title', $entry->title);\n\n if (!$entry->typeId) {\n // Default to the section's first entry type\n $entry->typeId = $entry->getSection()->getEntryTypes()[0]->id;\n }\n\n // Prevent the last entry type's field layout from being used\n $entry->fieldLayoutId = null;\n\n $fieldsLocation = $request->getParam('fieldsLocation', 'fields');\n $entry->setFieldValuesFromRequest($fieldsLocation);\n\n // Author\n $authorId = $request->getBodyParam('author', ($entry->authorId ?: Craft::$app->getUser()->getIdentity()->id));\n\n if (is_array($authorId)) {\n $authorId = $authorId[0] ?? null;\n }\n\n $entry->authorId = $authorId;\n\n // Parent\n if (($parentId = $request->getBodyParam('parentId')) !== null) {\n if (is_array($parentId)) {\n $parentId = reset($parentId) ?: '';\n }\n\n $entry->newParentId = $parentId ?: '';\n }\n\n // Revision notes\n $entry->revisionNotes = $request->getBodyParam('revisionNotes');\n }", "public function init_form_fields() {\n\t\t$this->form_fields = include( 'data/data-settings.php' );\n\t}", "public function initialize()\n {\n $this->setEntity($this);\n\n // full name\n $key = new Text(\n \t'key',\n \t[\n \t\t\"required\"=>true,\n \t\t\"class\"=>\"form-control\",\n \t\t\"id\"=>\"key\",\n \t]\n );\n\n $key->addFilter('string');\n\n // full name\n $value = new Text(\n \t'val',\n \t[\n \t\t\"required\"=>true,\n \t\t\"class\"=>\"form-control\",\n \t\t\"id\"=>\"value\",\n \t]\n );\n\n $value->addFilter('string');\n \n\n \n \n\n $this->add($key);\n $this->add($value);\n\n // Add a text element to put a hidden CSRF\n $this->add(\n new Hidden(\n 'csrf'\n )\n );\n }", "public function init() {\n $this->add([\n 'name' => 'id',\n 'type' => 'hidden'\n ]);\n\n $this->add([\n 'name' => 'title',\n 'type' => 'text'\n ]);\n\n $this->add([\n 'name' => 'text',\n 'type' => 'textarea'\n ]);\n }", "public function initContactDataForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\n\t\t// name\n\t\t$ti = new ilTextInputGUI($lng->txt(\"name\"), \"inst_name\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$ti->setRequired(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// description\n\t\t$ti = new ilTextInputGUI($lng->txt(\"client_info\"), \"inst_info\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$this->form->addItem($ti);\n\n\t\t// institution\n\t\t$ti = new ilTextInputGUI($lng->txt(\"client_institution\"), \"inst_institution\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$this->form->addItem($ti);\n\n\t\t// contact data\n\t\t$sh = new ilFormSectionHeaderGUI();\n\t\t$sh->setTitle($lng->txt(\"contact_data\"));\n\t\t$this->form->addItem($sh);\n\n\t\t// first name\n\t\t$ti = new ilTextInputGUI($lng->txt(\"firstname\"), \"admin_firstname\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$ti->setRequired(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// last name\n\t\t$ti = new ilTextInputGUI($lng->txt(\"lastname\"), \"admin_lastname\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$ti->setRequired(true);\n\t\t$this->form->addItem($ti);\n\n\t\t$fs = array (\n\t\t\t\"title\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"position\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"institution\" => array(\"max\" => 200, \"size\" => 30),\n\t\t\t\"street\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"zipcode\" => array(\"max\" => 10, \"size\" => 5),\n\t\t\t\"city\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"country\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"phone\" => array(\"max\" => 64, \"size\" => 30)\n\t\t\t);\n\t\tforeach ($fs as $f => $op)\n\t\t{\n\t\t\t// field\n\t\t\t$ti = new ilTextInputGUI($lng->txt($f), \"admin_\".$f);\n\t\t\t$ti->setMaxLength($op[\"max\"]);\n\t\t\t$ti->setSize($op[\"size\"]);\n\t\t\t$ti->setInfo($lng->txt(\"\"));\n\t\t\t$this->form->addItem($ti);\n\t\t}\n\n\t\t// email\n\t\t$ti = new ilEmailInputGUI($lng->txt(\"email\"), \"admin_email\");\n\t\t$ti->setRequired(true);\n\t\t$ti->allowRFC822(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// feedback recipient\n\t\t$ti = new ilEmailInputGUI($lng->txt(\"feedback_recipient\"), \"feedback_recipient\");\n\t\t$ti->setInfo($lng->txt(\"feedback_recipient_info\"));\n\t\t$ti->setRequired(true);\n\t\t$ti->allowRFC822(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// error recipient\n\t\t$ti = new ilEmailInputGUI($lng->txt(\"error_recipient\"), \"error_recipient\");\n\t\t$ti->allowRFC822(true);\n\t\t$this->form->addItem($ti);\n\n\t\t$this->form->addCommandButton(\"saveContact\", $lng->txt(\"save\"));\n\n\t\t$this->form->setTitle($lng->txt(\"client_data\"));\n\t\t$this->form->setFormAction(\"setup.php?cmd=gateway\");\n\t}", "public function WidgetSubmissionForm()\n {\n $formSectionData = new DataObject();\n $formSectionData->Form = $this->AddForm($this->extensionType);\n $formSectionData->Content = $this->dataRecord->AddContent;\n return $formSectionData;\n }", "public function init()\n {\n $this->addSubForm(new LandlordsInsuranceQuote_Form_Subforms_PersonalDetails(), 'subform_personaldetails');\n \t$this->addSubForm(new LandlordsInsuranceQuote_Form_Subforms_DataProtection(), 'subform_dataprotection');\n $this->addSubForm(new LandlordsInsuranceQuote_Form_Subforms_CorrespondenceDetails(), 'subform_correspondencedetails');\n $this->addSubForm(new LandlordsInsuranceQuote_Form_Subforms_InsuredAddress(), 'subform_insuredaddress');\n $this->addSubForm(new LandlordsInsuranceQuote_Form_Subforms_PolicyDetails(), 'subform_policydetails');\n $this->addSubForm(new LandlordsInsuranceQuote_Form_Subforms_IDD(), 'subform_idd');\n }", "protected function _prepareForm()\n\t{\n\n\t\t$intId = $this->getRequest()->getParam(SDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_ID);\n\n\t\t$objEntity = new SDZeCOM_Aurednik_Model_Cms_Home_Entity ();\n\n\t\t$objEntity->load($intId);\n\n\t\t$objAttribute = new SDZeCOM_Aurednik_Model_Cms_Home_Entity_Attribute ();\n\n\t\t$objAttributeValue = new SDZeCOM_Aurednik_Model_Cms_Home_Entity_Attribute_Values ();\n\n\t\t$objEntityType = new SDZeCOM_Aurednik_Model_Cms_Home_Entity_Type ();\n\n\t\t$objForm = new Varien_Data_Form (\n\t\t\tarray(\n\t\t\t\t'id' => SDZeCOM_Aurednik_Block_Adminhtml_Cms_Home_Edit_Form_Container :: FORM_NAME,\n\t\t\t\t'action' => $this->getUrl('*/*/save'),\n\t\t\t\t'method' => 'post',\n\t\t\t\t'enctype' => 'multipart/form-data',\n\t\t\t\t'name' => SDZeCOM_Aurednik_Block_Adminhtml_Cms_Home_Edit_Form_Container :: FORM_NAME\n\t\t\t)\n\t\t);\n\n\t\t$this->setForm($objForm);\n\n\t\t$objForm->setUseContainer(true);\n\n\t\t//Set Enitty\n\t\t$objFieldset =\n\t\t\t$objForm->addFieldset('aurednik_cms_home_entity',\n\t\t\t\tarray(\n\t\t\t\t\t'legend' => Mage:: helper('admin')->__('entity')));\n\n\t\t$objType = $objFieldset->addField(\n\t\t\tSDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_ID,\n\t\t\t'text',\n\t\t\tarray(\n\t\t\t\t'name' => self :: POST_ENTITY_DATA . '[' . SDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_ID . ']',\n\t\t\t\t'label' => Mage:: helper('admin')->__('Id'),\n\t\t\t\t'title' => Mage:: helper('admin')->__('Id'),\n\t\t\t\t'required' => true,\n\t\t\t\t'value' => $objEntity->getId(),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'class' => 'required-entry'\n\n\t\t\t));\n\n\t\t$objType = $objFieldset->addField(\n\t\t\tSDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_NAME,\n\t\t\t'text',\n\t\t\tarray(\n\t\t\t\t'name' => self :: POST_ENTITY_DATA . '[' . SDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_NAME . ']',\n\t\t\t\t'label' => Mage:: helper('admin')->__('Name'),\n\t\t\t\t'title' => Mage:: helper('admin')->__('Name'),\n\t\t\t\t'required' => false,\n\t\t\t\t'value' => $objEntity->getEntity_name(),\n\t\t\t\t'class' => 'required-entry'\n\n\t\t\t));\n\n\t\t$field = $objFieldset->addField(SDZeCOM_Aurednik_Model_Cms_Home_Entity_Store::TABLE_COLUMN_STORE_ID, 'multiselect', array(\n\t\t\t'name' => self :: POST_ENTITY_DATA . '[' . SDZeCOM_Aurednik_Model_Cms_Home_Entity_Store :: TABLE_COLUMN_STORE_ID . ']',\n\t\t\t'label' => Mage::helper('cms')->__('Store View'),\n\t\t\t'title' => Mage::helper('cms')->__('Store View'),\n\t\t\t'required' => true,\n\t\t\t'value' => $objEntity->getStore_id(),\n\t\t\t'values' => Mage:: getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),\n\t\t));\n\n\t\t$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');\n\t\t$field->setRenderer($renderer);\n\n\n\t\t$objType = $objFieldset->addField(\n\t\t\tSDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_TYPE,\n\t\t\t'select',\n\t\t\tarray(\n\t\t\t\t'name' => self :: POST_ENTITY_DATA . '[' . SDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_TYPE . ']',\n\t\t\t\t'label' => Mage:: helper('admin')->__('Type'),\n\t\t\t\t'title' => Mage:: helper('admin')->__('Type'),\n\t\t\t\t'required' => true,\n\t\t\t\t'disabled' => true,\n\t\t\t\t'options' => $objEntityType->toOptionArray(),\n\t\t\t\t'readonly' => true,\n\t\t\t\t'value' => $objEntity->getType_id()\n\t\t\t));\n\n\t\t$objFieldset->addField(\n\t\t\tSDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_ACTIVE,\n\t\t\t'select',\n\t\t\tarray(\n\t\t\t\t'name' => self :: POST_ENTITY_DATA . '[' . SDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_ACTIVE . ']',\n\t\t\t\t'label' => Mage:: helper('admin')->__('Active'),\n\t\t\t\t'title' => Mage:: helper('admin')->__('Active'),\n\t\t\t\t'required' => true,\n\t\t\t\t'disabled' => false,\n\t\t\t\t'options' => array(0 => Mage:: helper('admin')->__('No'), 1 => Mage:: helper('admin')->__('Yes')),\n\t\t\t\t'value' => $objEntity->getActive()\n\n\t\t\t));\n\n\t\t$objFieldset->addField(\n\t\t\tSDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_SORT,\n\t\t\t'text',\n\t\t\tarray(\n\t\t\t\t'name' => self :: POST_ENTITY_DATA . '[' . SDZeCOM_Aurednik_Model_Cms_Home_Entity :: TABLE_COLUMN_SORT . ']',\n\t\t\t\t'label' => Mage:: helper('admin')->__('Sort'),\n\t\t\t\t'title' => Mage:: helper('admin')->__('Sort'),\n\t\t\t\t'required' => false,\n\t\t\t\t'value' => $objEntity->getSort(),\n\t\t\t\t'class' => 'required-entry',\n\t\t\t\t'required' => true,\n\t\t\t));\n\n\t\t$objAttrCollection = $objAttribute->getCollection()->getByEntityTypeId($objEntity->getType_id());\n\n\t\tif ($objAttrCollection->count() == 0)\n\t\t{\n\t\t\tMage:: getSingleton('core/session')->addError(Mage:: helper('aurednik')->__('Error no attributes'));\n\t\t\t$this->getResponse()->sendResponse();\n\t\t}\n\n\t\t$objFieldset =\n\t\t\t$objForm->addFieldset(\n\t\t\t\t'aurednik_cms_home_entity_data',\n\t\t\t\tarray(\n\t\t\t\t\t'legend' => Mage:: helper('admin')->__('entity attribute data')\n\t\t\t\t)\n\t\t\t);\n\n\t\tforeach ($objAttrCollection as $objCurrentAttr)\n\t\t{\n\n\t\t\t$objEntityAttrValuesCollection = $objAttributeValue->getCollection()->getByEntityIdAndAttributeId($objEntity->getId(), $objCurrentAttr->getId());\n\n\t\t\tif ($objEntityAttrValuesCollection->count() > 0)\n\t\t\t{\n\n\t\t\t\tforeach ($objEntityAttrValuesCollection as $objCurrentAttrValue)\n\t\t\t\t{\n\n\t\t\t\t\t$objFieldset->addField(\n\t\t\t\t\t\t$objCurrentAttrValue->getId(),\n\t\t\t\t\t\t$objCurrentAttr->getInput_type(),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name' => self :: POST_ENTITY_ATTRIBUTE_DATA . '[' . $objCurrentAttr->getId() . ']',\n\t\t\t\t\t\t\t'label' => Mage:: helper('aurednik')->__($objCurrentAttr->getTitle()),\n\t\t\t\t\t\t\t'title' => Mage:: helper('aurednik')->__($objCurrentAttr->getTitle()),\n\t\t\t\t\t\t\t'required' => $objEntity->getRequired() == 1 ? true : false,\n\t\t\t\t\t\t\t'value' => $objCurrentAttrValue->getAttribute_value(),\n\t\t\t\t\t\t\t'class' => 'required-entry'\n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t$objFieldset->addField(\n\t\t\t\t\t$objEntity->getId() . \"_\" . $objCurrentAttr->getId(),\n\t\t\t\t\t$objCurrentAttr->getInput_type(),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => self :: POST_ENTITY_ATTRIBUTE_DATA . '[' . $objCurrentAttr->getId() . ']',\n\t\t\t\t\t\t'label' => Mage:: helper('aurednik')->__($objCurrentAttr->getTitle()),\n\t\t\t\t\t\t'title' => Mage:: helper('aurednik')->__($objCurrentAttr->getTitle()),\n\t\t\t\t\t\t'required' => $objEntity->getRequired() == 1 ? true : false,\n\t\t\t\t\t\t'class' => 'required-entry'\n\t\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\treturn parent:: _prepareForm();\n\t}", "protected function _prepareForm() {\r\n\t $form = new Varien_Data_Form();\r\n\t $this->setForm($form);\r\n\t $fieldset = $form->addFieldset(\"reason_form\", array(\"legend\" => Mage::helper(\"mprmasystem\")->__(\"RMA Reason\")));\r\n\r\n\t\t\t$fieldset->addField(\"reason\", \"textarea\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Reason Provided\"),\r\n\t\t\t\t\"name\" => \"reason\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$fieldset->addField(\"status\", \"select\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Status\"),\r\n\t\t\t\t\"name\" \t\t=> \"status\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true,\r\n\t\t\t\t\"values\"\t=> array(\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Please Select\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"1\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Enable\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"0\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Disable\"))\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t));\r\n\t\t\t\r\n\t if(Mage::registry(\"mprmareason_data\"))\r\n\t $form->setValues(Mage::registry(\"mprmareason_data\")->getData());\t\t\t\r\n\t return parent::_prepareForm();\r\n\t }", "public function init()\n {\n $this->add(array(\n 'name' => 'name',\n 'options' => array(\n 'label' => __('Name*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n\n $this->add(array(\n 'name' => 'title',\n 'options' => array(\n 'label' => __('Title*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'company',\n 'options' => array(\n 'label' => __('Company*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'email',\n 'options' => array(\n 'label' => __('Email*'),\n ),\n 'attributes' => array(\n\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'phone',\n 'options' => array(\n 'label' => __('Phone*'),\n ),\n 'attributes' => array(\n 'type' => 'text',\n ),\n ));\n $this->add(array(\n 'name' => 'submit',\n 'attributes' => array(\n 'value' => __('Freetrial'),\n ),\n 'type' => 'submit',\n ));\n }", "public function init()\n {\n\n $this->setMethod('post');\n\n // Add the name element\n $this->addElement('text','name', array(\n 'label' => 'Sub-Section Name'\n , 'size' => 50\n , 'required' => true\n , 'filters' => array('StringTrim')\n ));\n\n My_Plugin_Form::setDefaultLayout($this->getElement('name'));\n\n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Save Changes',\n 'disableLoadDefaultDecorators' => true,\n ));\n\n $label = $this->getElement('submit');\n $label->addDecorators(array(\n array('ViewHelper'),\n array('HtmlTag')\n ));\n\n // Add a hidden field to handle the application id\n $this->addElement('hidden','application_id');\n\n // Add a hidden field to handle the sub-section id\n $this->addElement('hidden','id');\n\n // And finally, add some CSRF protection\n $this->addElement('hash','csrf', array(\n 'ignore' => 'true',\n ));\n\n }", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n\n // Adding default value to the list\n\n // Setting the lists in $data array\n $data = [\n ];\n\n //dd($data);\n\n return $data;\n }", "public function form()\n {\n $this->setData();\n }", "protected function _prepareForm()\n {\n //instantiate the form\n $_form = new Varien_Data_Form(\n array(\n 'id' => 'edit_form',\n 'action' => $this->getData('action'),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n )\n );\n \n //the artist\n $_consumer = Mage::registry('current_consumer');\n\n if ($_consumer->getId()) {\n $_form->addField(\n 'consumer_id', \n 'hidden', \n array(\n 'name' => 'consumer_id',\n )\n );\n $_form->setValues($_consumer->getData());\n }\n\n $_form->setUseContainer(true);\n $this->setForm($_form);\n return parent::_prepareForm();\n }", "function initData($args, &$request) {\n\t\tAppLocale::requireComponents(\n\t\t\tLOCALE_COMPONENT_APPLICATION_COMMON,\n\t\t\tLOCALE_COMPONENT_PKP_SUBMISSION,\n\t\t\tLOCALE_COMPONENT_OMP_SUBMISSION\n\t\t);\n\n\t\t$this->_metadataFormImplem->initData($this->getMonograph());\n\t}", "protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n [\n 'data' => [\n 'id' => 'edit_form',\n 'action' => $this->getUrl('reverbsync/reverbsync_field/save'),\n 'method' => 'post',\n\t\t\t\t\t'enctype' => 'multipart/form-data',\n ],\n ]\n );\n $form->setUseContainer(true);\n\t\t$model = $this->_coreRegistry->registry('reverbsync_field_mapping');\n\t\t$fieldset = $form->addFieldset(\n 'base_fieldset',\n array('legend' => __('Magento-Reverb Field Mapping'), 'class'=>'fieldset-wide')\n );\n\t\t\n\t\tif ($model->getMappingId()) {\n $fieldset->addField(\n\t\t\t\t'mapping_id',\n\t\t\t\t'hidden', \n\t\t\t\t['name' => 'mapping_id']\n\t\t\t);\n }\n\t\t$fieldset->addField(\n 'magento_attribute_code',\n 'select',\n [\n\t\t\t\t'name' => 'magento_attribute_code', \n\t\t\t\t'label' => __('Magento Attribute'), \n\t\t\t\t'title' => __('Magento Attribute Code'),\n\t\t\t\t'values' => $this->_productAttribute->toOptionArray(),\n\t\t\t\t'required' => true\n\t\t\t]\n );\n\t\t$fieldset->addField(\n 'reverb_api_field',\n 'text',\n [\n\t\t\t\t'name' => 'reverb_api_field', \n\t\t\t\t'label' => __('Reverb API Field'), \n\t\t\t\t'title' => __('Reverb API Field'), \n\t\t\t\t'required' => true\n\t\t\t]\n );\n\t\t$form->setValues($model->getData());\n $this->setForm($form);\n return parent::_prepareForm();\n }", "protected function _construct()\r\n {\r\n parent::_construct();\r\n $this->setTemplate('placetopay/form.phtml');\r\n }", "public function form( $instance ) {\n\n $title = !empty($instance['title']) ? $instance['title'] : 'Related content';\n $limit = isset($instance['limit']) ? $instance['limit'] : -1;\n $type = isset($instance['type']) ? $instance['type'] : 'dataset';\n\t\t$template = isset($instance['template']) ? $instance['template'] : 'default';\n $max_height = isset($instance['max_height']) ? $instance['max_height'] : '200';\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id('title');?>\"><?php _e('Title:');?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('title');?>\" name=\"<?php echo $this->get_field_name('title');?>\" type=\"text\" value=\"<?php _e($title,'odm');?>\">\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'type' ); ?>\"><?php _e( 'Select content type:' ); ?></label>\n\t\t\t<select class='widefat type' id=\"<?php echo $this->get_field_id('type'); ?>\" name=\"<?php echo $this->get_field_name('type'); ?>\" type=\"text\">\n\t\t\t\t<?php foreach ( $this->types as $key => $available_type ): ?>\n\t\t\t\t\t<option <?php if ($type == $available_type[\"label\"]) { echo \" selected\"; } ?> value=\"<?php echo $key ?>\"><?php echo $available_type[\"label\"] ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'template' ); ?>\"><?php _e( 'Select layout:' ); ?></label>\n\t\t\t<select class='widefat template' id=\"<?php echo $this->get_field_id('template'); ?>\" name=\"<?php echo $this->get_field_name('template'); ?>\" type=\"text\">\n\t\t\t\t<?php\n $current_type = $this->types[$type];\n foreach ( $current_type[\"templates\"] as $key => $available_template ): ?>\n\t\t\t\t\t<option <?php if ($template == $available_template) { echo \" selected\"; } ?> value=\"<?php echo $available_template ?>\"><?php echo $available_template ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<?php $limit = !empty($instance['limit']) ? $instance['limit'] : -1 ?>\n\t\t<p class=\"<?php echo $this->get_field_id('limit');?>\">\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'limit' ); ?>\"><?php _e( 'Select max number of posts to list (-1 to show all):' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('limit');?>\" name=\"<?php echo $this->get_field_name('limit');?>\" type=\"number\" value=\"<?php echo $limit;?>\">\n\t\t</p>\n\t\t\t<?php $max_height = !empty($instance['max_height']) ? $instance['max_height'] : '200' ?>\n\t\t<p class=\"<?php echo $this->get_field_id('max_height');?>\">\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'max_height' ); ?>\"><?php _e( 'Define the max height of container:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('max_height');?>\" name=\"<?php echo $this->get_field_name('max_height');?>\" type=\"number\" value=\"<?php echo $max_height;?>\">\n\t\t</p>\n\n\t\t<script type=\"text/javascript\">\n\t\t\tjQuery(function($) {\n\t\t\t\tvar $select_template = \"<?php echo $this->get_field_id('template'); ?>\";\n\t\t\t\tdisplay_max_height();\n\t\t\t\t$('#'+$select_template).change(function(){\n\t\t\t\t\tdisplay_max_height();\n\t\t\t\t});\n\n\t\t\t\tfunction display_max_height (){\n\t\t\t\t\tvar $p_limit = \"<?php echo $this->get_field_id('limit');?>\";\n\t\t\t\t\tvar $p_max_height = \"<?php echo $this->get_field_id('max_height');?>\";\n\t\t\t\t\tif($('#'+$select_template).val() == \"html\"){\n\t\t\t\t\t\t$('.'+$p_limit).hide();\n\t\t\t\t\t\t$('.'+$p_max_height).show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$('.'+$p_limit).show();\n\t\t\t\t\t\t$('.'+$p_max_height).hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t </script>\n\n\t\t<?php\n\t}", "public function Populate() {\r\n\t\t$form_instance = $this->form_instance;\r\n\t\t// Retrieve the field data\r\n\t\t$_els = vcff_parse_container_data($form_instance->form_content);\r\n\t\t// If an error has been detected, return out\r\n\t\tif (!$_els || !is_array($_els)) { return; }\r\n\t\t// Retrieve the form instance\r\n\t\t$form_instance = $this->form_instance; \r\n\t\t// Loop through each of the containers\r\n\t\tforeach ($_els as $k => $_el) {\r\n\t\t\t// Retrieve the container instance\r\n\t\t\t$container_instance = $this->_Get_Container_Instance($_el);\r\n\t\t\t// Add the container to the form instance\r\n\t\t\t$form_instance->Add_Container($container_instance);\r\n\t\t}\r\n\t}", "protected function _readFormFields() {}", "function load_from_form ($allowSensibleFields = false) {\n if (array_key_exists('title', $_POST)) {\n $this->title = $_POST['title'];\n }\n\n if ($allowSensibleFields) {\n if (array_key_exists('path', $_POST)) {\n $this->path = $_POST['path'];\n }\n if (array_key_exists('user_id', $_POST)) {\n $this->user_id = $_POST['user_id'];\n }\n if (array_key_exists('perso_id', $_POST)) {\n $this->perso_id = $_POST['perso_id'];\n }\n }\n }", "public function init_form_fields() {\n\t\t$this->form_fields = include( 'settings-xendit.php' );\n\t}", "public function init()\n {\n // set class to identify as p4cms-ui component\n $this->setAttrib('class', 'p4cms-ui')\n ->setAttrib('dojoType', 'p4cms.ui.grid.Form');\n\n // turn off CSRF protection - its not useful here (form data are\n // used for filtering the data grid and may be exposed in the URL)\n $this->setCsrfProtection(false);\n\n // call parent to publish the form.\n parent::init();\n }", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n $client = new Client();\n $street_type = new StreetType();\n $state = new State();\n\n // Adding default value to the list\n $clients = $client->getSelectList();\n $street_types = $street_type->getSelectList();\n $states = $state->getSelectList();\n\n // Setting the lists in $data array\n $data = [\n 'clients' => $clients,\n 'street_types' => $street_types,\n 'states' => $states,\n ];\n\n //dd($data);\n\n return $data;\n }", "public function MetadataEntryForm()\n {\n // NIWA are worried about parameter case and would like it case insensitive so convert all get vars to lower\n // I think this is because they are not 100% what case the parameters from oracle will be in.\n $params = array_change_key_case($this->getRequest()->getVars(), CASE_LOWER);\n\n // Check in the parameters sent to this page if there are certian fields needed to power the\n // functionality which emails project coordinators and if so get them as we will need to add\n // them to the bottom of the form as hidden fields, this way we can access them in the form\n // processing and send the email.\n $hiddenFields = array();\n\n // These 2 fields can be populated either by Project_Coordinator or Project_Administrator as Oracle actually\n // sends Project_Administrator. NIWA want to keep the field here called coordinator.\n if (!empty($params['project_coordinator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_coordinator'];\n } else if (!empty($params['project_administrator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_administrator'];\n }\n\n if (!empty($params['project_coordinator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_coordinator_email'];\n } else if (!empty($params['project_administrator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_administrator_email'];\n }\n\n if (!empty($params['project_manager'])) {\n $hiddenFields['_Project_Manager'] = $params['project_manager'];\n }\n\n if (!empty($params['project_code'])) {\n $hiddenFields['_Project_Code'] = $params['project_code'];\n }\n\n // Get the fields defined for this page, exclude the placeholder fields as they are not displayed to the user.\n $metadataFields = $this->Fields()->where(\"FieldType != 'PLACEHOLDER'\")->Sort('SortOrder', 'asc');\n\n // Create fieldfield for the form fields.\n $formFields = FieldList::create();\n $actions = FieldList::create();\n $requiredFields = array();\n\n // Push the required fields message as a literal field at the top.\n $formFields->push(\n LiteralField::create('required', '<p>* Required fields</p>')\n );\n\n if ($metadataFields->count()) {\n foreach($metadataFields as $field) {\n // Create a version of the label with spaces replaced with underscores as that is how\n // any paraemters in the URL will come (plus we can use it for the field name)\n $fieldName = str_replace(' ', '_', $field->Label);\n $fieldLabel = $field->Label;\n\n // If the field is required then add it to the required fields and also add an\n // asterix to the end of the field label.\n if ($field->Required) {\n $requiredFields[] = $fieldName;\n $fieldLabel .= ' *';\n }\n\n // Check if there is a parameter in the GET vars with the corresponding name.\n $fieldValue = null;\n\n if (isset($params[strtolower($fieldName)])) {\n $fieldValue = $params[strtolower($fieldName)];\n }\n\n // Define a var for the new field, means no matter the type created\n // later on in the code we can apply common things like the value.\n $newField = null;\n\n // Single line text field creation.\n if ($field->FieldType == 'TEXTBOX') {\n $formFields->push($newField = TextField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'TEXTAREA') {\n $formFields->push($newField = TextareaField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'KEYWORDS') {\n // If keywords then output 2 fields the textbox for the keywords and then also a\n // literal read only list of those already specified by the admin below.\n $formFields->push($newField = TextAreaField::create($fieldName, $fieldLabel));\n $formFields->push(LiteralField::create(\n $fieldName . '_adminKeywords',\n \"<div class='control-group' style='margin-top: -12px'>Already specified : \" . $field->KeywordsValue . \"</div>\"\n ));\n } else if ($field->FieldType == 'DROPDOWN') {\n // Some dropdowns have an 'other' option so must add the 'other' to the entries\n // and also have a conditionally displayed text field for when other is chosen.\n $entries = $field->DropdownEntries()->sort('SortOrder', 'Asc')->map('Key', 'Label');\n\n if ($field->DropdownOtherOption == true) {\n $entries->push('other', 'Other');\n }\n\n $formFields->push(\n $newField = DropdownField::create(\n $fieldName,\n $fieldLabel,\n $entries\n )->setEmptyString('Select')\n );\n\n if ($field->DropdownOtherOption == true) {\n $formFields->push(\n TextField::create(\n \"${fieldName}_other\",\n \"Please specify the 'other'\"\n )->hideUnless($fieldName)->isEqualTo(\"other\")->end()\n );\n\n //++ @TODO\n // Ideally if the dropdown is required then if other is selected the other field\n // should also be required. Unfortunatley the conditional validation logic of ZEN\n // does not work in the front end - so need to figure out how to do this.\n }\n }\n\n // If a new field was created then set some things on it which are common no matter the type.\n if ($newField) {\n // Set help text for the field if defined.\n if (!empty($field->HelpText)) {\n $newField->setRightTitle($field->HelpText);\n }\n\n // Field must only be made readonly if the admin specified that they should be\n // provided that a value was specified in the URL for it.\n if ($field->Readonly && $fieldValue) {\n $newField->setReadonly(true);\n }\n\n // Set the value of the field one was plucked from the URL params.\n if ($fieldValue) {\n $newField->setValue($fieldValue);\n }\n }\n }\n\n // Add fields to the bottom of the form for the user to include a message in the email sent to curators\n // this is entirely optional and will not be used in most cases so is hidden until a checkbox is ticked.\n $formFields->push(\n CheckboxField::create('AdditionalMessage', 'Include a message from me to the curators')\n );\n\n // For the email address, because its project managers filling out the form, check if the Project_Manager_email\n // has been specified in the URL params and if so pre-populate the field with that value.\n $formFields->push(\n $emailField = EmailField::create('AdditionalMessageEmail', 'My email address')\n ->setRightTitle('Please enter your email address so the curator knows who the message below is from.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n if (isset($params['project_manager_email'])) {\n $emailField->setValue($params['project_manager_email']);\n }\n\n $formFields->push(\n TextareaField::create('AdditionalMessageText', 'My message')\n ->setRightTitle('You can enter a message here which is appended to the email sent the curator after the record has successfully been pushed to the catalogue.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n // If there are any hidden fields then loop though and add them as hidden fields to the bottom of the form.\n if ($hiddenFields) {\n foreach($hiddenFields as $key => $val) {\n $formFields->push(\n HiddenField::create($key, '', $val)\n );\n }\n }\n\n // We have at least one field so set the action for the form to submit the entry to the catalogue.\n $actions = FieldList::create(FormAction::create('sendMetadataForm', 'Send'));\n } else {\n $formFields->push(\n ErrorMessage::create('No metadata entry fields have been specified for this page.')\n );\n }\n\n // Set up the required fields validation.\n $validator = ZenValidator::create();\n $validator->addRequiredFields($requiredFields);\n\n // Create form.\n $form = Form::create($this, 'MetadataEntryForm', $formFields, $actions, $validator);\n\n // Check if the data for the form has been saved in the session, if so then populate\n // the form with this data, if not then just return the default form.\n $data = Session::get(\"FormData.{$form->getName()}.data\");\n\n return $data ? $form->loadDataFrom($data) : $form;\n }", "public function get_submitted_edit_form_data()\n\t{\n\t\t$this->credits = $_POST['credits'];\n\t\t$this->levelID = $_POST['level'];\t\n\t}", "function form_init_data()\r\n {\r\n $this->set_hidden_element_value('_action', FT_ACTION_UPDATE) ;\r\n $this->set_hidden_element_value('swimmeetid', $this->getSwimMeetId()) ;\r\n\r\n $swimmeet = new SwimMeet() ;\r\n $swimmeet->LoadSwimMeetById($this->getSwimMeetId()) ;\r\n\r\n $this->set_element_value('Organization', $swimmeet->getOrgCode()) ;\r\n $this->set_element_value('Meet Name', $swimmeet->getMeetName()) ;\r\n $this->set_element_value('Meet Address 1', $swimmeet->getMeetAddress1()) ;\r\n $this->set_element_value('Meet Address 2', $swimmeet->getMeetAddress2()) ;\r\n $this->set_element_value('Meet State', $swimmeet->getMeetState()) ;\r\n $this->set_element_value('Meet Postal Code', $swimmeet->getMeetPostalCode()) ;\r\n $this->set_element_value('Meet Country', $swimmeet->getMeetCountryCode()) ;\r\n $this->set_element_value('Meet Code', $swimmeet->getMeetCode()) ;\r\n $this->set_element_value('Pool Altitude', $swimmeet->getPoolAltitude()) ;\r\n $this->set_element_value('Course Code', $swimmeet->getCourseCode()) ;\r\n\r\n $date = $swimmeet->getMeetStart(false) ;\r\n $this->set_element_value('Meet Start', array('year' => substr($date, 4, 4),\r\n 'month' => substr($date, 0, 2), 'day' => substr($date, 2, 2))) ;\r\n\r\n $date = $swimmeet->getMeetEnd(false) ;\r\n $this->set_element_value('Meet End', array('year' => substr($date, 4, 4),\r\n 'month' => substr($date, 0, 2), 'day' => substr($date, 2, 2))) ;\r\n }", "public function init() {\n $this->setMethod('post');\n $this->setAction($this->getView()->url());\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/collapsiblefields.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/toggledetails.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/erga/paketaergasias/paradotea.js', 'text/javascript'));\n\n $subform = new Dnna_Form_SubFormBase();\n $subform->setLegend('Στοιχεία Παραδοτέου');\n // Recordid\n $subform->addElement('hidden', 'recordid', array());\n // Κωδικός Παραδοτέου\n $subform->addElement('text', 'codename', array(\n 'label' => 'Κωδικός Παραδοτέου:',\n 'validators' => array(\n array('validator' => 'StringLength', 'options' => array(0, 15))\n ),\n 'required' => true,\n 'placeholder' => 'πχ. Π.1.1',\n )\n );\n // Τίτλος Παραδοτέου\n $subform->addElement('textarea', 'title', array(\n 'label' => 'Τίτλος Παραδοτέου:',\n 'validators' => array(\n array('validator' => 'StringLength', 'options' => array(0, $this->_textareaMaxLength))\n ),\n 'rows' => 1,\n 'cols' => $this->_textareaCols,\n 'required' => true,\n )\n );\n // Ποσό\n $subform->addElement('text', 'amount', array(\n 'label' => 'Ποσό:',\n 'validators' => array(\n array('validator' => 'Float')\n ),\n 'class' => 'formatFloat',\n 'required' => true,\n ));\n // Όρια ανα Κατηγορία Προσωπικού\n $project = $this->_view->getProject();\n if(isset($project) && $project->get_personnelcategories()->count() > 0) {\n $limitsform = new Dnna_Form_SubFormBase($this->_view);\n $i = 1;\n foreach($project->get_personnelcategories() as $curCategory) {\n $curlimitform = new Dnna_Form_SubFormBase($this->_view);\n // Recordid\n $curlimitform->addElement('hidden', 'recordid', array());\n // Id κατηγορίας\n $curlimitcategoryform = new Dnna_Form_SubFormBase($this->_view);\n $curlimitcategoryform->addElement('hidden', 'recordid', array(\n 'value' => $curCategory->get_recordid(),\n ));\n $curlimitform->addSubForm($curlimitcategoryform, 'personnelcategory', false);\n // Limit\n $curlimitform->addElement('text', 'limit', array(\n 'label' => 'Όριο ωρών για '.$curCategory->get_name().':',\n 'validators' => array(\n array('validator' => 'Float')\n ),\n 'required' => false,\n ));\n $curlimitform->set_empty(false);\n $limitsform->addSubForm($curlimitform, $i, false, 'default-limits');\n $i++;\n }\n $subform->addSubForm($limitsform, 'limits', false);\n }\n // Έναρξη\n $subform->addElement('text', 'startdate', array(\n 'label' => 'Ημερομηνία Έναρξης:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n 'required' => false,\n ));\n // Λήξη\n $subform->addElement('text', 'enddate', array(\n 'label' => 'Ημερομηνία Λήξης:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n 'required' => false,\n ));\n // Εγκριση αναθεσης απο επιτροπη ερευνων\n $subform->addElement('text', 'assignmentapprovaldate', array(\n 'label' => 'Έγκριση Ανάθεσης από Επιτροπή Ερευνών:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n ));\n // Εγκριση ολοκλήρωσης απο Επιτροπή Ερευνών\n $subform->addElement('text', 'completionapprovaldate', array(\n 'label' => 'Εγκριση Ολοκλήρωσης απο Επιτροπή Ερευνών:',\n 'validators' => array(\n array('validator' => 'Date')\n ),\n 'class' => 'usedatepicker',\n ));\n\n // Σχόλια\n $subform->addElement('textarea', 'comments', array(\n 'label' => 'Γενικές Πληροφορίες:',\n 'validators' => array(\n array('validator' => 'StringLength', 'options' => array(0, $this->_textareaMaxLength))\n ),\n 'rows' => $this->_textareaRows,\n 'cols' => $this->_textareaCols,\n ));\n\n $subsubform = new Dnna_Form_SubFormBase();\n if($this->_view->getSubProject()->get_subprojectdirectlabor() == \"1\") {\n $subsubform->setLegend('Συντάκτες');\n if(($this->_view->getSubProject()->get_employees() != null && count($this->_view->getSubProject()->get_employees()) > 0) ||\n ($this->_view->getProject() != null && $this->_view->getProject()->get_thisprojectemployees() != null && count($this->_view->getProject()->get_thisprojectemployees()) > 0)) {\n $this->addAuthorFields($subsubform, false);\n } else {\n $element = new Application_Form_Element_Note('noauthorsnote', array(\n 'value' => 'Δεν έχουν οριστεί απασχολούμενοι'\n ));\n $subsubform->addElement($element);\n }\n $subform->addSubForm($subsubform, 'authors');\n } else {\n $subsubform->setLegend('Ανάδοχος');\n if($this->_view->getSubProject()->get_contractors() != null && $this->_view->getSubProject()->get_contractors()->count() > 0) {\n $this->addContractorFields($subsubform, false);\n } else {\n $element = new Application_Form_Element_Note('noauthorsnote', array(\n 'value' => 'Δεν έχουν οριστεί ανάδοχοι'\n ));\n $subsubform->addElement($element);\n }\n $subform->addSubForm($subsubform, 'contractor');\n }\n $this->addSubForm($subform, 'default');\n $this->addSubmitFields();\n }", "protected function createFormFields() {\n\t}", "protected function _prepareForm()\n {\n /**\n * @var $value \\Amasty\\Finder\\Model\\Value\n */\n $value = $this->_coreRegistry->registry('current_amasty_finder_value');\n $finder = $this->_coreRegistry->registry('current_amasty_finder_finder');\n $settingData = [];\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n [\n 'data' => [\n 'id' => 'edit_form',\n 'action' => $this->getUrl('amasty_finder/value/save', ['id' => $this->getRequest()->getParam('id'), 'finder_id'=>$finder->getId()]),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data',\n ],\n ]\n );\n $form->setUseContainer(true);\n $this->setForm($form);\n\n $fieldset = $form->addFieldset('set', array('legend'=> __('General')));\n $fieldset->addField('sku', 'text', [\n 'label' => __('SKU'),\n 'title' => __('SKU'),\n 'name' => 'sku',\n ]);\n\n if($value->getId()) {\n $settingData['sku'] = $value->getSkuById($this->getRequest()->getParam('id'), $value->getId());\n }\n $currentId = $value->getId();\n\n\n $fields = [];\n while($currentId) {\n $alias_name = 'name_' . $currentId;\n $alias_label = 'label_'.$currentId;\n\n $model = clone $value;\n $model->load($currentId);\n $currentId = $model->getParentId();\n $dropdownId = $model->getDropdownId();\n $dropdown = $this->_objectManager->create('Amasty\\Finder\\Model\\Dropdown')->load($dropdownId);\n $dropdownName = $dropdown->getName();\n $settingData[$alias_name] = $model->getName();\n $fields[$alias_name] = [\n 'label' => __($dropdownName),\n 'title' => __($dropdownName),\n 'name' => $alias_label\n ];\n }\n\n $fields = array_reverse($fields);\n\n foreach($fields as $alias_name=>$fieldData) {\n $fieldset->addField($alias_name, 'text', $fieldData);\n }\n\n if(!$value->getId()) {\n $finder = $value->getFinder();\n\n foreach ($finder->getDropdowns() as $drop){\n $alias_name = 'name_'.$drop->getId();\n $alias_label = 'label_'.$drop->getId();\n $fieldset->addField($alias_name, 'text', [\n 'label' => __($drop->getName()),\n 'title' => __($drop->getName()),\n 'name' => $alias_label\n ]);\n }\n\n $fieldset->addField('new_finder', 'hidden', ['name' => 'new_finder']);\n $settingData['new_finder'] = 1;\n }\n\n\n //set form values\n $form->setValues($settingData);\n\n return parent::_prepareForm();\n }", "protected function _prepareForm() {\n\t\t$form =\n\t\t\tnew Varien_Data_Form(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'edit_form'\n\t\t\t\t\t,'action' => $this->_getData('action')\n\t\t\t\t\t,'method' => 'post'\n\t\t\t\t)\n\t\t\t)\n\t\t;\n\t\t$form->setUseContainer(true);\n\t\t$this->setForm($form);\n\t\treturn parent::_prepareForm();\n\t}", "public function init() {\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_phone',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Phone Number', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_email',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Email Address', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_budget',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Desired Budget', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextArea( [\n\t\t\t'name' => DWSLGF_PREFIX . '_message',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Message', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_submission_datetime',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Posted Date/Time', $this->post_type );\n\t}", "protected function _prepareForm()\n {\n $model = Mage::registry('maduranga_wall');\n\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ));\n\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => $this->__('Visualizer Background Information'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', array(\n 'name' => 'id',\n ));\n }\n\n $fieldset->addField('name', 'text', array(\n 'name' => 'name',\n 'label' => $this->__('Name'),\n 'title' => $this->__('Name'),\n 'required' => true,\n ));\n\n $fieldset->addField('image', 'file', array(\n 'name' => 'image',\n 'label' => $this->__('Background Image'),\n 'title' => $this->__('Background Image'),\n 'required' => true,\n ));\n\n $fieldset->addField('status', 'select', array(\n 'label' => $this->__('Status'),\n 'name' => 'status',\n 'required' => true,\n 'values' => array(\n array(\n 'value' => 1,\n 'label' => $this->__('Enable'),\n ),\n\n array(\n 'value' => 0,\n 'label' => $this->__('Disable'),\n ),\n ),\n ));\n\n $form->setValues($model->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n\n return parent::_prepareForm();\n }", "function prepare() {\n $this->addChild(new fapitng_FormHidden('form_build_id', array(\n 'value' => $this->build_id,\n )));\n $this->addChild(new fapitng_FormHidden('form_id', array(\n 'value' => $this->id,\n )));\n if ($this->token) {\n $this->addChild(new fapitng_FormHidden('form_token', array(\n 'value' => $this->token,\n )));\n }\n }", "function __construct($field = array(), $value ='', $parent){\r\n\t\t\r\n\t\tparent::__construct($parent->sections, $parent->args, $parent->extra_tabs);\r\n\t\t$this->field = $field;\r\n\t\t$this->value = $value;\r\n\t\t//$this->render();\r\n\t\t\r\n\t}", "function init()\n {\n\n $elements = array(\n 'page_id' => array('hidden')\n , 'name' => array('text', array('label' => 'Name', 'options' => array('StringLength' => array(false, array(1, 50)),), 'filters' => array('StringTrim'), 'required' => true))\n , 'title' => array('text', array('label' => 'Title', 'options' => array('StringLength' => array(false, array(4, 255)),),'filters' => array('StringTrim'), 'required' => true))\n , 'meta' => array('text', array('label' => 'meta', 'options' => array('StringLength' => array(false, array(4, 255))), 'filters' => array('StringTrim'),))\n , 'description' => array('textarea',array('label' => 'description', 'attribs' => array('rows' => 2), 'filters' => array('StringTrim'), 'required' => true))\n , 'body' => array('textarea',array('label' => 'body', 'attribs' => array('rows' => 7), 'filters' => array('StringTrim'), 'required' => true))\n );\n $this->addElements($elements);\n\n // --- Groups ----------------------------------------------\n $this->addDisplayGroup(array('name','title', 'meta'), 'display-head', array('legend'=>'display-head'));\n $this->addDisplayGroup(array('description', 'body'), 'display-body', array('legend'=>'display-body'));\n parent::init();\n }", "function create() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->createElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "public function add_entry_form() {\n\n\t\t$entry = new_cmb2_box( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix,\n\t\t\t'title'\t\t\t\t\t\t\t=> __( 'Entries', 'nsa-entries-2016' ),\n\t\t\t'object_types'\t\t\t=> array( 'tm-events-entries' ),\n\t\t\t'context'\t\t\t\t\t\t=> 'normal',\n\t\t\t'priority'\t\t\t\t\t=> 'high',\n\t\t\t'show_names'\t\t\t\t=> 'true',\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> 'submitted_post_title',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Nominee&rsquo;s Name', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'text',\n\t\t\t'default'\t\t\t\t\t\t=> array( $this, 'set_title' ),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'placeholder'\t\t\t\t=> __( 'eg, Jane Bloggs', 'nsa-entries-2016' ),\n\t\t\t'required'\t\t\t\t\t=> 'required',\n\t\t\t),\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'nominee_email',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Nominee&rsquo;s Email', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'text_email',\n\t\t\t'default'\t\t\t\t\t\t=> array( $this, 'set_default' ),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'placeholder'\t\t\t\t=> __( 'eg, [email protected]', 'nsa-entries-2016' ),\n\t\t\t'required'\t\t\t\t\t=> 'required',\n\t\t\t),\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'nominee_phone',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Nominee&rsquo;s Phone Number', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'text',\n\t\t\t'default'\t\t\t\t\t\t=> array( $this, 'set_default' ),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'placeholder'\t\t\t\t=> __( 'eg, 0121 123 4567', 'nsa-entries-2016' ),\n\t\t\t'required'\t\t\t\t\t=> 'required',\n\t\t\t),\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'nominee_award',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Awards Category', 'nsa-entries-2016' ),\n\t\t\t'desc'\t\t\t\t\t\t\t=> __( 'Choose the award(s) to enter.', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'multicheck',\n\t\t\t'select_all_button'\t=> false,\n\t\t\t'attributes'\t\t\t\t=> array(),\n\t\t\t'options_cb'\t\t\t\t=> array( $this, 'get_awards' ),\n\t\t));\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'nominee_reason',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'I would like to nominate the nominee for this award because&hellip;', 'nsa-entries-2016' ),\n\t\t\t'description'\t\t\t\t=> __( 'Maximum of 250 words.', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'textarea',\n\t\t\t'default'\t\t\t\t\t\t=> array( $this, 'set_default' ),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'placeholder'\t\t\t\t=> __( 'I would like to nominate the nominee for this award because&hellip;', 'nsa-entries-2016' ),\n\t\t\t'required'\t\t\t\t\t=> 'required',\n\t\t\t'maxlength'\t\t\t\t\t\t\t\t=> 2000,\n\t\t\t),\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'nominator_name',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Your Name', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'text',\n\t\t\t'default'\t\t\t\t\t\t=> array( $this, 'set_default' ),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'placeholder'\t\t\t\t=> __( 'eg, Jane Bloggs', 'nsa-entries-2016' ),\n\t\t\t'required'\t\t\t\t\t=> 'required',\n\t\t\t),\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'nominator_email',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Your Email', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'text_email',\n\t\t\t'default'\t\t\t\t\t\t=> array( $this, 'set_default' ),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'placeholder'\t\t\t\t=> __( 'eg, [email protected]', 'nsa-entries-2016' ),\n\t\t\t'required'\t\t\t\t\t=> 'required',\n\t\t\t),\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'nominator_phone',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Your Phone Number', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'text',\n\t\t\t'default'\t\t\t\t\t\t=> array( $this, 'set_default' ),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'placeholder'\t\t\t\t=> __( 'eg, 0121 123 4567', 'nsa-entries-2016' ),\n\t\t\t),\n\t\t) );\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'data_protection',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Communication', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'multicheck',\n\t\t\t'select_all_button'\t=> false,\n\t\t\t'attributes'\t\t\t\t=> array(),\n\t\t\t'options'\t\t\t\t\t\t=> array(\n\t\t\t'third_parties'\t\t\t=> __( 'Trinity Mirror would like to allow selected third parties to contact you. If you object to receiving third party communications please tick the checkbox.', 'nsa-entries-2016' ),\n\t\t\t'publish-nomination'\t=> __( 'If you would prefer that your nomination is not featured in the manner described above. please tick the checkbox.', 'nsa-entries-2016' ),\n\t\t\t),\n\t\t));\n\n\t\t$entry->add_field( array(\n\t\t\t'id'\t\t\t\t\t\t\t\t=> $this->meta_prefix . 'hidden_check',\n\t\t\t'name'\t\t\t\t\t\t\t=> __( 'Please do not check this box', 'nsa-entries-2016' ),\n\t\t\t'type'\t\t\t\t\t\t\t=> 'checkbox',\n\t\t\t'select_all_button'\t=> false,\n\t\t\t'row_classes'\t\t\t\t=> 'hidden',\n\t\t\t'options'\t\t\t\t\t\t=> array(\n\t\t\ttrue\t\t\t\t\t\t\t\t=> 'check',\n\t\t\t),\n\t\t\t'attributes'\t\t\t\t=> array(\n\t\t\t'hidden'\t\t\t\t\t=> 'hidden',\n\t\t\t'class'\t\t\t\t\t\t=> 'hidden',\n\t\t\t),\n\t\t) );\n\n\t}", "public function prepareForm() {\n $fieldFactory = FieldFactory::getInstance();\n $translator = I18n::getInstance()->getTranslator();\n\n $profileList = array();\n $profiles = $this->wizard->getInstaller()->getProfiles();\n foreach ($profiles as $profileName => $profile) {\n $profileList[$profileName] = $profile->getName($translator) . '<span>' . $profile->getDescription($translator) . '</span>';\n }\n\n $profile = $this->wizard->getProfile();\n\n $profileField = $fieldFactory->createField(FieldFactory::TYPE_OPTION, self::FIELD_PROFILE, $profile);\n $profileField->setOptions($profileList);\n $profileField->addValidator(new RequiredValidator());\n\n $this->wizard->addField($profileField);\n }", "public function buildForm()\n {\n }", "public function init_form_fields(){\n \n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => 'Enable/Disable',\n\t\t\t\t'label' => 'Enable Vortex Gateway',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'description' => '',\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title' => 'Title',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => 'This controls the title which the user sees during checkout.',\n\t\t\t\t'default' => 'Vortex Payment',\n\t\t\t\t'desc_tip' => true,\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title' => 'Description',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'description' => 'This controls the description which the user sees during checkout.',\n\t\t\t\t'default' => 'Paga con Vortex Payment.',\n\t\t\t),\n\t\t\t'BID' => array(\n\t\t\t\t'title' => 'Business ID',\n\t\t\t\t'type' => 'text'\n\t\t\t)\n\n\t\t\t);\n \n\t \t}", "public function page_init()\n {\n register_setting(\n 'mj_groups_fields', // group name\n 'mj_option_theme',\n array($this, 'sanitize') // sanitize\n );\n\n add_settings_section(\n 'section_default',\n '',\n '',\n 'config-theme-options'\n );\n\n foreach ($this->formRenderInputs as $key => $value) {\n add_settings_field(\n $value['args']['atributos']['name'],\n $value['titulo'],\n array($this, 'render_field_input'),\n 'config-theme-options',\n 'section_default',\n array('valores' => $value)\n );\n }\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "function initialize () {\n $this->set_openingtag ( \"<LABEL>\" );\n\t$this->set_closingtag ( \"</LABEL><INPUT TYPE=\\\"text\\\"[attributes]>\" );\n\t$this->set_type (\"text\");\n }", "protected function _prepareForm() {\n /**\n * Set save form action.\n */\n $form = new Varien_Data_Form ( array (\n 'id' => 'edit_form',\n 'action' => $this->getUrl ( '*/*/save', array (\n 'id' => $this->getRequest ()->getParam ( 'id' ) \n ) ),\n 'enctype' => 'multipart/form-data',\n 'method' => 'post',\n \n ) );\n /**\n * Set calues to form.\n */\n $form->setUseContainer ( true ); \n /**\n * Set form data \n */\n $this->setForm ( $form ); \n $fieldset = $form->addFieldset ( 'base_fieldset', array (\n 'legend' => Mage::helper ( 'airhotels' )->__ ( 'Bank details' ) \n ) );\n /**\n * Get collection from country list.\n *\n * @var $countryList\n */\n $countryList = Mage::getModel ( 'directory/country' )->getResourceCollection ()->loadByStore ()->toOptionArray ( false );\n /**\n * Display country code.\n * Field type 'multi select'.\n * Required entry true.\n */\n $fieldset->addField ( 'country_code', 'multiselect', array (\n 'name' => 'country_code[]',\n 'label' => Mage::helper ( 'airhotels' )->__ ( 'Countries' ),\n 'title' => Mage::helper ( 'airhotels' )->__ ( 'Countries' ),\n 'required' => true,\n 'values' => $countryList \n ) );\n /**\n * Get currency collection.\n */\n $allCurrency = Mage::getModel ( 'airhotels/allcurrency' )->getCollection ()->addFieldToSelect ( 'value' )->addFieldToSelect ( 'label' )->getData ();\n /**\n * Display currency.\n * Field Name 'currency'.\n * Fields type 'multiselect'\n * Requird entry true.\n */\n $fieldset->addField ( 'currency_code', 'multiselect', array (\n 'name' => 'currency_code[]',\n 'label' => Mage::helper ( 'airhotels' )->__ ( 'Curreny' ),\n 'title' => Mage::helper ( 'airhotels' )->__ ( 'Currency' ),\n 'required' => true,\n 'values' => $allCurrency \n ) );\n /**\n * Display note message.\n */\n $note = Mage::helper ( 'airhotels' )->__ ( 'Example: bank_name, account_number, ifsc_code, payee etc..' );\n /**\n * Display fields name.\n * Field name 'field_name'\n * Field type 'text'\n * Required entry true.\n */\n $fieldset->addField ( 'field_name', 'text', array (\n 'label' => Mage::helper ( 'airhotels' )->__ ( 'Field Name' ),\n 'title' => Mage::helper ( \"airhotels\" )->__ ( 'Field Name' ),\n 'class' => 'required-entry',\n 'required' => true,\n 'name' => 'field_name',\n 'note' => $note \n ) );\n /**\n * Display field title.\n * Field name 'field_title'\n * Field type 'text'\n * Required entry true.\n */\n $fieldset->addField ( 'field_title', 'text', array (\n 'label' => Mage::helper ( 'airhotels' )->__ ( 'Field Title' ),\n 'title' => Mage::helper ( \"airhotels\" )->__ ( 'Field Title' ),\n 'class' => 'required-entry',\n 'required' => true,\n 'name' => 'field_title' \n ) );\n /**\n * Display managebankdetails.\n * Field name 'managebankdetails_data'\n * Field type 'checkbox'\n * Required entry false.\n */\n $bankDataInfo = Mage::registry ( 'managebankdetails_data' )->getData ();\n $fieldset->addField ( 'field_required', 'checkbox', array (\n 'name' => 'field_required',\n 'label' => Mage::helper ( 'airhotels' )->__ ( 'This Field Is Required' ),\n 'title' => Mage::helper ( \"airhotels\" )->__ ( 'This Fieldd Is Required' ),\n 'required' => false,\n 'value' => 1,\n 'checked' => ($bankDataInfo ['field_required'] == 1) ? 'true' : '',\n 'onclick' => 'this.value = this.checked ? 1 : 0;',\n 'disabled' => false,\n 'readonly' => false \n ) );\n if (Mage::registry ( 'managebankdetails_data' )) {\n /**\n * Get managebank details.\n */\n $bankDataInfo = Mage::registry ( 'managebankdetails_data' )->getData ();\n }\n /**\n * Set bank data info.\n */\n $form->setValues ( $bankDataInfo );\n /**\n * Set value to form.\n */\n $this->setForm ( $form );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareForm ();\n }", "protected function _init()\n {\n $this->_fields += array(\n 'id' => new Sprig_Field_Auto,\n 'name' => new Sprig_Field_Char,\n 'brief' => new Sprig_Field_Char,\n 'content' => new Sprig_Field_Char,\n 'module_id' => new Sprig_Field_Integer,\n 'url' => new Sprig_Field_Char,\n 'meta_title' => new Sprig_Field_Char,\n 'meta_keywords' => new Sprig_Field_Char,\n 'meta_description' => new Sprig_Field_Char,\n 'ord' => new Sprig_Field_Integer(array(\n 'default' => 10,\n )),\n 'status' => new Sprig_Field_Integer(array(\n 'default' => 0,\n )),\n );\n }", "protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix(self::HTML_ID_PREFIX);\n $integrationData = $this->_coreRegistry->registry(\n Integration::REGISTRY_KEY_CURRENT_INTEGRATION\n );\n $this->_addGeneralFieldset($form, $integrationData);\n if (isset($integrationData['integration_id'])) {\n $integrationStores = $this->integrationStoresRepository->getListByIntegration(\n $integrationData['integration_id']\n );\n $integrationData['integration_stores'] = $integrationStores;\n }\n $form->addValues($integrationData);\n $this->setForm($form);\n return $this;\n }", "protected function _prepareForm()\n {\n /** @var DataForm $form */\n /** @noinspection PhpUnhandledExceptionInspection */\n $form = $this->_formFactory->create();\n\n // define field set\n $fieldSet = $form->addFieldset('base_fieldset', ['legend' => __('Widget')]);\n\n // retrieve widget key\n $widgetKey = $this->widgetInstance->getWidgetKey();\n\n // add new field\n $fieldSet->addField(\n 'select_widget_type_' . $widgetKey,\n 'select',\n [\n 'label' => __('Widget Type'),\n 'title' => __('Widget Type'),\n 'name' => 'widget_type',\n 'required' => true,\n 'onchange' => \"$widgetKey.validateField()\",\n 'options' => $this->_getWidgetSelectOptions(),\n 'after_element_html' => $this->_getWidgetSelectAfterHtml()\n ]\n );\n\n // set form information\n /** @noinspection PhpUndefinedMethodInspection */\n $form->setUseContainer(true);\n /** @noinspection PhpUndefinedMethodInspection */\n $form->setId('widget_options_form' . '_' . $widgetKey);\n /** @noinspection PhpUndefinedMethodInspection */\n $form->setMethod('post');\n /** @noinspection PhpUndefinedMethodInspection */\n $form->setAction($this->getUrl('adminhtml/*/buildWidget'));\n $this->setForm($form);\n }", "public function init(){\n\t\t//Additional information.\n\t\t$this->addElement('textarea', 'additional_information', array(\n\t\t\t\t'label' => 'Additional information',\n\t\t\t\t'required' => false,\n\t\t\t\t'filters' => array('StringTrim'),\n\t\t\t\t'validators' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'NotEmpty', true, array(\n\t\t\t\t\t\t\t\t\t\t'messages' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'isEmpty' => 'Please enter additional information',\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t));\n\n\t\t// Add declaration statement agree element\n\t\t$this->addElement('checkbox', 'confirmation_statement', array(\n\t\t\t\t'label' => '',\n\t\t\t\t'required' => true,\n\t\t\t\t'checkedValue' => '1',\n\t\t\t\t'uncheckedValue' => null, // Must be used to override default of '0' and force an error when left unchecked\n\t\t\t\t'validators' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'NotEmpty', true, array(\n\t\t\t\t\t\t\t\t\t\t'messages' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'isEmpty' => 'You must agree to confirmation statement to continue'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t));\n\n\t\t// Set custom subform decorator\n\t\t$this->setDecorators(array(\n\t\t\t\tarray('ViewScript', array('viewScript' => 'insurance/subforms/quote-my-additionaldetail.phtml'))\n\t\t));\n\n\t\t// Strip all tags to prevent XSS errors\n\t\t$this->setElementFilters(array('StripTags'));\n\n\n\t\t$this->setElementDecorators(array(\n\t\t\t\tarray('ViewHelper', array('escape' => false)),\n\t\t\t\tarray('Label', array('escape' => false))\n\t\t));\n\t}", "public function loadForm() {\n foreach ($this->Fields as $key => $item) {\n if($item['function'] && $this->FormMode == \"add\") {\n $fn = str_replace('$1', $_POST[$key], $item['function']);\n $this->$key = eval($fn);\n } else\n if($_POST[$key] !== null) {\n $this->$key = $_POST[$key];\n }\n }\n }", "protected function init_saved_value( $entry ) {\n\t\tif ( $this->field->type === 'html' ) {\n\t\t\t$this->saved_value = $this->field->description;\n\t\t} elseif ( isset( $entry->metas[ $this->field->id ] ) ) {\n\t\t\t$this->saved_value = $entry->metas[ $this->field->id ];\n\t\t} else {\n\t\t\t$this->saved_value = '';\n\t\t}\n\n\t\t$this->clean_saved_value();\n\t}", "protected function _prepareForm()\n {\n $model = $this->getModel();\n \n\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n ['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]\n );\n\n $fieldset = $form->addFieldset(\n 'base_fieldset',\n ['legend' => __('Template Information'), 'class' => 'fieldset-wide']\n );\n $fieldset->addType('background', 'Sample\\Gridpart2\\Block\\Adminhtml\\Template\\Helper\\Background');\n \n \n if ($model->getGridpart2templateId()) {\n $fieldset->addField('id', 'hidden', ['name' => 'id', 'value' => $model->getGridpart2templateId()]);\n }\n\n $fieldset->addField(\n 'name',\n 'text',\n [\n 'name' => 'name',\n 'label' => __('Template Name'),\n 'title' => __('Template Name'),\n 'required' => true,\n 'value' => $model->getName()\n ]\n );\n $fieldset->addField(\n 'pid',\n 'hidden',\n [\n 'name' => 'pid',\n 'value' => $model->getId()\n ]\n );\n\n $fieldset->addField(\n 'status',\n 'select',\n [\n 'label' => __('Status'),\n 'required' => true,\n 'name' => 'status',\n 'values' => $this->_statusOption->getStatusesOptionArray()\n ]\n );\n\n $form->setAction($this->getUrl('*/*/save'));\n $form->setUseContainer(true);\n $this->setForm($form);\n\n return parent::_prepareForm();\n }", "function form( $instance ) {\n\t\t$defaults = array( 'title' => '', 'quote' => 'Lorum ipsum dolor sit amet, consectetur adipscing elit. nullam dapi-bus venenatis lacus, eget viverra mauris.', 'name' => 'John Smith', 'company' => 'RD Managing Director' );\n\t\t$instance = wp_parse_args( (array) $instance, $defaults ); ?>\n\t\t\n\t\t<!--<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\">Title:</label>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo $instance['title']; ?>\" style=\"width:100%;\" />\n\t\t</p>-->\n\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'quote' ); ?>\">Testimonial:</label>\n\t\t\t<textarea id=\"<?php echo $this->get_field_id( 'quote' ); ?>\" name=\"<?php echo $this->get_field_name( 'quote' ); ?>\" style=\"width:100%;\"><?php echo $instance['quote']; ?></textarea>\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'name' ); ?>\">Name:</label>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'name' ); ?>\" name=\"<?php echo $this->get_field_name( 'name' ); ?>\" value=\"<?php echo $instance['name']; ?>\" style=\"width:100%;\" />\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'company' ); ?>\">Company:</label>\n\t\t\t<input id=\"<?php echo $this->get_field_id( 'company' ); ?>\" name=\"<?php echo $this->get_field_name( 'company' ); ?>\" value=\"<?php echo $instance['company']; ?>\" style=\"width:100%;\" />\n\t\t</p>\n\n<?php\n\t}", "function form( $instance ) {\n\n \t$title = esc_attr($instance['title']);\n \t$display_image = esc_attr($instance['display_image']);\n \t$num_articles = esc_attr($instance['num_articles']);\n\n \t$options = get_option('pgnyt_articles');\n \t$pgnyt_results = $options['pgnyt_results'];\n\n \trequire ('inc/widget-fields.php');\n\n }", "function initialize () {\n $this->set_openingtag ( \"<INPUT value=\\\"\" );\n\t$this->set_closingtag ( \"\\\"[attributes]>\" );\n\t$this->set_type (\"input\");\n }", "public function form($instance) {\r\n\t\t$title = $instance['title'];\r\n\t\t$first_name = $instance['first_name'];\r\n\t\t$last_name = $instance['last_name'];\r\n\t\t$business_name = $instance['business_name'];\r\n\t\t$position_title = $instance['position_title'];\r\n\t\t$mailbox_num = $instance['mailbox_num'];\r\n\t\t$apt_suite = $instance['apt_suite'];\r\n\t\t$street = $instance['street'];\r\n\t\t$city = $instance['city'];\r\n\t\t$state = $instance['state'];\r\n\t\t$zip = $instance['zip'];\r\n\t\t$email_address = $instance['email_address'];\r\n\t\t$telephone = $instance['telephone']; ?>\r\n\r\n\t\t\t<p><?php esc_html__( 'Please provide at least one name field (first or last) for hcard validity. The remaining fields are optional. Output based on provided data.', 'mbhcardwidget' ); ?></p>\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('title'); ?>\">Widget Title: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('title'); ?>\" name=\"<?php echo $this->get_field_name('title'); ?>\" placeholder=\"Title of the widget\" type=\"text\" value=\"<?php echo $title; ?>\" /></label></p><!--Widget title-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('first_name'); ?>\">First Name: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('first_name'); ?>\" name=\"<?php echo $this->get_field_name('first_name'); ?>\" placeholder=\"First name please...\" type=\"text\" value=\"<?php echo $first_name; ?>\" /></label></p><!--First name field-->\r\n <p><label for=\"<?php echo $this->get_field_id('last_name'); ?>\">Last Name: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('last_name'); ?>\" name=\"<?php echo $this->get_field_name('last_name'); ?>\" placeholder=\"...and then your last name.\" type=\"text\" value=\"<?php echo $last_name; ?>\" /></label></p><!--Last name field-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('business_name'); ?>\">Business Name: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('business_name'); ?>\" name=\"<?php echo $this->get_field_name('business_name'); ?>\" placeholder=\"What is your business' name?\" type=\"text\" value=\"<?php echo $business_name; ?>\" /></label></p><!--Business Name-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('position_title'); ?>\">Position Title: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('position_title'); ?>\" name=\"<?php echo $this->get_field_name('position_title'); ?>\" placeholder=\"Ooh, what's your job title?\" type=\"text\" value=\"<?php echo $position_title; ?>\" /></label></p><!--Position-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('mailbox_num'); ?>\">P.O. Box: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('mailbox_num'); ?>\" name=\"<?php echo $this->get_field_name('mailbox_num'); ?>\" placeholder=\"What is your P.O. Box?\" type=\"text\" value=\"<?php echo $mailbox_num; ?>\" /></label></p><!--PO Box-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('apt_suite'); ?>\">Apt or Suite #: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('apt_suite'); ?>\" name=\"<?php echo $this->get_field_name('apt_suite'); ?>\" placeholder=\"Which Apt/Suite in the building are you at?\" type=\"text\" value=\"<?php echo $apt_suite; ?>\" /></label></p><!--Apt #-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('street'); ?>\">Street Address: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('street'); ?>\" name=\"<?php echo $this->get_field_name('street'); ?>\" placeholder=\"What's your street address?\" type=\"text\" value=\"<?php echo $street; ?>\" /></label></p><!--Street Addy-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('city'); ?>\">City: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('city'); ?>\" name=\"<?php echo $this->get_field_name('city'); ?>\" placeholder=\"You live in a city/town right?\" type=\"text\" value=\"<?php echo $city; ?>\" /></label></p><!--City-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('state'); ?>\">State: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('state'); ?>\" name=\"<?php echo $this->get_field_name('state'); ?>\" placeholder=\"Remember, madness is not a valid state\" type=\"text\" value=\"<?php echo $state; ?>\" /></label></p><!--State-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('zip'); ?>\">Zip code: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('zip'); ?>\" name=\"<?php echo $this->get_field_name('zip'); ?>\" placeholder=\"What's the zip code?\" type=\"text\" value=\"<?php echo $zip; ?>\" /></label></p><!--Zip-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('email_address'); ?>\">Email: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('email_address'); ?>\" name=\"<?php echo $this->get_field_name('email_address'); ?>\" placeholder=\"What email should people use?\" type=\"email\" value=\"<?php echo $email_address; ?>\" /></label></p><!--Email-->\r\n\t\t\t<p><label for=\"<?php echo $this->get_field_id('telephone'); ?>\">Telephone: <input class=\"widefat\" id=\"<?php echo $this->get_field_id('telephone'); ?>\" name=\"<?php echo $this->get_field_name('telephone'); ?>\" placeholder=\"What numbers should people dial?\" type=\"text\" value=\"<?php echo $telephone; ?>\" /></label></p><!--Telephone-->\r\n\r\n\t<?php }", "protected function _construct()\n {\n $this->_init(\\AddictedToMagento\\DynamicForms\\Model\\ResourceModel\\Form::class);\n }", "protected function _prepareForm()\n {\n\n $form = new Varien_Data_Form();\n $this->setForm($form);\n $fieldset = $form->addFieldset('cron_form', array(\n 'legend' =>Mage::helper('aoe_scheduler')->__('Settings')\n ));\n\n $fieldset->addField('model', 'select', array(\n 'label' => Mage::helper('aoe_scheduler')->__('Model'),\n 'title' => Mage::helper('aoe_scheduler')->__('Model'),\n 'class' \t=> 'input-select',\n 'required' => true,\n 'name' => 'model',\n 'options' => Mage::helper('aoe_scheduler')->getModelOptions(),\n ));\n $continueButton = $this->getLayout()\n ->createBlock('adminhtml/widget_button')\n ->setData(array(\n 'label' => Mage::helper('aoe_scheduler')->__('Continue'),\n 'onclick' => \"setSettings('\".$this->getContinueUrl().\"', 'model')\",\n 'class' => 'save'\n ));\n $fieldset->addField('continue_button', 'note', array(\n 'text' => $continueButton->toHtml(),\n ));\n \n return parent::_prepareForm();\n }", "public function init()\n {\n parent::init();\n\n // Retrieving a field from the controller container and layout into this view.\n $this->add($this->fieldCtrl->getField('label'));\n }", "public function get_data() {\n $data = parent::get_data();\n\n if (!empty($data)) {\n $data->settings = $this->tool->form_build_settings($data);\n }\n\n return $data;\n }", "public function valiteForm();", "public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}", "protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'add_form',\n 'action' => $this->getUrl('*/faq/save', array(\n 'ret' => Mage::registry('ret'),\n 'id' => $this->getRequest()->getParam('id')\n )\n ),\n 'method' => 'post'\n ));\n\n $fieldset = $form->addFieldset('faq_new_question', array(\n 'legend' => $this->__('New Question'),\n 'class' => 'fieldset-wide'\n ));\n\n $fieldset->addField('new_question', 'text', array(\n 'label' => Mage::helper('inchoo_faq')->__('New Question'),\n 'required' => true,\n 'name' => 'question'\n ));\n\n $fieldset->addField('new_answer', 'textarea', array(\n 'label' => Mage::helper('inchoo_faq')->__('Answer'),\n 'required' => false,\n 'name' => 'answer',\n 'style' => 'height:12em;',\n ));\n\n $form->setUseContainer(true);\n// $form->setValues();\n $this->setForm($form);\n\n// echo \"_prepareForm()\";\n\n return parent::_prepareForm();\n\n\n }", "protected function buildMainFields()\n {\n $this->meta[static::FIELD_CARRIER_NAME] = [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'componentType' => Fieldset::NAME,\n 'label' => __('%1', 'Carrier Settings'),\n 'collapsible' => true,\n 'opened' => true,\n 'dataScope' => self::DATA_SCOPE_CARRIER,\n 'sortOrder' => 10,\n ],\n ],\n ],\n 'children' => [\n static::FIELD_ENTITY_ID_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Id'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_ENTITY_ID_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 0,\n ],\n ],\n ],\n ],\n static::FIELD_TITLE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Default Title'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_TITLE_NAME,\n 'dataType' => Text::NAME,\n 'sortOrder' => 10,\n 'validation' => [\n 'required-entry' => true,\n ],\n ],\n ],\n ],\n ],\n static::FIELD_IS_ACTIVE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Is Active'),\n 'componentType' => Field::NAME,\n 'formElement' => Checkbox::NAME,\n 'dataScope' => static::FIELD_IS_ACTIVE_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 20,\n 'prefer' => 'toggle',\n 'valueMap' => [\n 'true' => '1',\n 'false' => '0',\n ],\n ],\n ],\n ],\n ],\n static::FIELD_NAME_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('System Name'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_NAME_NAME,\n 'dataType' => Text::NAME,\n 'validation' => [\n 'required-entry' => true,\n ],\n 'sortOrder' => 30,\n ],\n ],\n ],\n ],\n static::FIELD_CARRIER_CODE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Carrier Code'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_CARRIER_CODE_NAME,\n 'dataType' => Text::NAME,\n 'validation' => [\n 'required-entry' => true,\n 'validate-code' => true,\n 'min_text_len‌​gth' => 1,\n 'max_text_length' => 19\n ],\n 'sortOrder' => 40,\n ],\n ],\n ],\n ],\n static::FIELD_PRICE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Price'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_PRICE_NAME,\n 'dataType' => Number::NAME,\n 'addbefore' => $this->getBaseCurrencySymbol(),\n 'sortOrder' => 50,\n ],\n ],\n ],\n ],\n ],\n ];\n\n return $this->meta;\n }", "public function buildForm()\n {\n $this->add('organization_identifier_code', 'text', ['label' => trans('elementForm.organisation_identifier_code')])\n ->add('provider_activity_id', 'text', ['label' => trans('elementForm.provider_activity_id')])\n ->addSelect('type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->addNarrative('provider_org_narrative')\n ->addAddMoreButton('add_provider_org_narrative', 'provider_org_narrative');\n }", "public function init()\n {\n parent::init();\n\n //customize the form\n $this->getElement('passwd')->setRequired(false);\n $this->getElement('passwdVerify')->setRequired(false);\n $this->getElement('submit')->setLabel('Save User');\n }", "function loadFromForm() \r\n {\t \t\r\n\t parent::loadFromForm();\r\n\t \r\n// \t $this->formName = $_REQUEST['form_name']; \t \r\n// \t \r\n// // \t echo 'Inside load_from_form of main page: <pre>'.print_r($this->formValues,true).'</pre><br>';\t \r\n// \t \r\n// \t\tswitch($this->formName) {\r\n// \t\t\t\r\n// \t\t\tcase 'basicStaffForm':\r\n// \t\t\t\t \r\n// \t\t\t\t$this->active_subPage = $this->basic_form;\t\r\n// \t\t\t\tbreak;\r\n// \t\t\tcase 'scheduledActivityForm':\r\n\r\n// \t\t\t\t$this->active_subPage = $this->optional_sheduled_activity_form;\t \r\n// \t\t\t\tbreak;\t\t\t\r\n// \t\t\tdefault:\r\n// \t\t\t\tdie('VALID FORM NAME **NOT** FOUND; name = '.$this->formName);\r\n// \t\t} \r\n// \t\t$this->active_subPage->loadFromForm(); \r\n// \t\t$this->form_submitted = true; \r\n \r\n }", "protected function _prepareForm()\r\n {\r\n $form = new Varien_Data_Form(array(\r\n 'id' => 'edit_form',\r\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\r\n 'method' => 'post',\r\n 'enctype' => 'multipart/form-data',\r\n )\r\n );\r\n\r\n $fieldSet = $form->addFieldset('magento_form', array('legend' => $this->helper->__('Webhook information')));\r\n\r\n $fieldSet->addField('code', 'select', array(\r\n 'label' => $this->helper->__('Code'),\r\n 'class' => 'required-entry',\r\n 'name' => 'code',\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getAvailableHooks()\r\n ));\r\n\r\n $fieldSet->addField('url', 'text', array(\r\n 'label' => $this->helper->__('Callback URL'),\r\n 'class' => 'required-entry',\r\n 'name' => 'url',\r\n ));\r\n\r\n $fieldSet->addField('description', 'textarea', array(\r\n 'label' => $this->helper->__('Description'),\r\n 'name' => 'description',\r\n ));\r\n\r\n $fieldSet->addField('data', 'textarea', array(\r\n 'label' => $this->helper->__('Data'),\r\n 'name' => 'data',\r\n ));\r\n\r\n $fieldSet->addField('token', 'text', array(\r\n 'label' => $this->helper->__('Token'),\r\n 'name' => 'token',\r\n ));\r\n\r\n $fieldSet->addField('active', 'select', array(\r\n 'label' => $this->helper->__('Active'),\r\n 'values' => ApiExtension_Magento_Block_Adminhtml_Webhooks_Grid::getOptionsForActive(),\r\n 'name' => 'active',\r\n ));\r\n\r\n if ($this->session->getWebhooksData()) {\r\n $form->setValues($this->session->getWebhooksData());\r\n $this->session->setWebhooksData(null);\r\n } elseif (Mage::registry('webhooks_data')) {\r\n $form->setValues(Mage::registry('webhooks_data')->getData());\r\n }\r\n\r\n $form->setUseContainer(true);\r\n $this->setForm($form);\r\n return parent::_prepareForm();\r\n }", "function initialize () {\n $this->set_openingtag ( \"<FORM[attributes]>\" );\n\t$this->set_closingtag ( \"</FORM>\" );\n }", "public function init_fields() {\r\n\r\n\t\tif ( $this->fields ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$scale = get_option( 'scale', 'sq ft' );\r\n\t\t$currency = get_option('listeo_currency');\r\n\t\t\r\n\t\t$this->fields = array(\r\n\t\t\t'basic_info' => array(\r\n\t\t\t\t'title' \t=> __('Basic Information','listeo_core'),\r\n\t\t\t\t'class' \t=> '',\r\n\t\t\t\t'icon' \t\t=> 'sl sl-icon-doc',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'listing_title' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Listing Title', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'name' => 'listing_title',\r\n\t\t\t\t\t\t\t'tooltip'\t => __( 'Type title that will also contains an unique feature of your listing (e.g. renovated, air contidioned)', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'required' => true,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'listing_category' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Category', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'term-select',\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => 'listing_category',\r\n\t\t\t\t\t\t\t'taxonomy'\t => 'listing_category',\r\n\t\t\t\t\t\t\t'tooltip'\t => __( 'This is main listings category', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t'default'\t => '',\r\n\t\t\t\t\t\t\t'render_row_col' => '4',\r\n\t\t\t\t\t\t\t'multi' \t => true,\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t// 'event_category' => array(\r\n\t\t\t\t\t\t// \t'label' => __( 'Event Category', 'listeo_core' ),\r\n\t\t\t\t\t\t// \t'type' => 'term-select',\r\n\t\t\t\t\t\t// \t'placeholder' => '',\r\n\t\t\t\t\t\t// \t'name' => 'event_category',\r\n\t\t\t\t\t\t// \t'taxonomy'\t => 'event_category',\r\n\t\t\t\t\t\t// \t'tooltip'\t => __( 'Those are categories related to your listing type', 'listeo_core' ),\r\n\t\t\t\t\t\t// \t'priority' => 10,\r\n\t\t\t\t\t\t// \t'before_row' => '',\r\n\t\t\t\t\t\t// \t'after_row' => '',\r\n\t\t\t\t\t\t// \t'default'\t => '',\r\n\t\t\t\t\t\t// \t'render_row_col' => '4',\r\n\t\t\t\t\t\t// \t'required' => false,\r\n\t\t\t\t\t\t// ),\r\n\t\t\t\t\t\t'service_category' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Service Category', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'term-select',\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => 'service_category',\r\n\t\t\t\t\t\t\t'taxonomy'\t => 'service_category',\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t'before_row' => '',\r\n\t\t\t\t\t\t\t'after_row' => '',\r\n\t\t\t\t\t\t\t'default'\t => '',\r\n\t\t\t\t\t\t\t'render_row_col' => '4',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t// 'rental_category' => array(\r\n\t\t\t\t\t\t// \t'label' => __( 'Rental Category', 'listeo_core' ),\r\n\t\t\t\t\t\t// \t'type' => 'term-select',\r\n\t\t\t\t\t\t// \t'placeholder' => '',\r\n\t\t\t\t\t\t// \t'name' => 'rental_category',\r\n\t\t\t\t\t\t// \t'taxonomy'\t => 'rental_category',\r\n\t\t\t\t\t\t// \t'priority' => 10,\r\n\t\t\t\t\t\t// \t'before_row' => '',\r\n\t\t\t\t\t\t// \t'after_row' => '',\r\n\t\t\t\t\t\t// \t'default'\t => '',\r\n\t\t\t\t\t\t// \t'render_row_col' => '4',\r\n\t\t\t\t\t\t// \t'required' => false,\r\n\t\t\t\t\t\t// ),\r\n\t\t\t\t\t\t'keywords' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Keywords', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'tooltip'\t => __( 'Maximum of 15 keywords related with your business, separated by coma' , 'listeo_core' ),\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => 'keywords',\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'default'\t => '',\r\n\t\t\t\t\t\t\t'render_row_col' => '4',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'listing_feature' => array(\r\n\t\t\t\t\t\t\t'label' \t=> __( 'Other Features', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' \t=> 'term-checkboxes',\r\n\t\t\t\t\t\t\t'taxonomy'\t\t=> 'listing_feature',\r\n\t\t\t\t\t\t\t'name'\t\t\t=> 'listing_feature',\r\n\t\t\t\t\t\t\t'class'\t\t \t => 'chosen-select-no-single',\r\n\t\t\t\t\t\t\t'default' \t => '',\r\n\t\t\t\t\t\t\t'priority' \t => 2,\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t/*'cancellation_policy' => array(\r\n\t\t\t\t'title' \t=> __('Cancellation policy','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t'icon' \t\t=> 'sl sl-icon-docs',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'cancellation_policy_description' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Description', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'name' => 'cancellation_policy_description',\r\n\t\t\t\t\t\t\t'type' => 'wp-editor',\r\n\t\t\t\t\t\t\t'description' => __( 'Add Cancellation Policy Description .', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => false,\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\t\t\r\n\t\t\t'location' => array(\r\n\t\t\t\t'title' \t=> __('Location','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t'icon' \t\t=> 'sl sl-icon-location',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\r\n\t\t\t\t\t'_address' => array(\r\n\t\t\t\t\t\t'label' => __( 'Address', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => '_address',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'priority' => 7,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t),\t\t\t\t\r\n\t\t\t\t\t'_friendly_address' => array(\r\n\t\t\t\t\t\t'label' => __( 'Friendly Address', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => '_friendly_address',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'tooltip'\t => __('Human readable address, if not set, the Google address will be used', 'listeo_core'),\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'priority' => 8,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t),\t\r\n\t\t\t\t\t'region' => array(\r\n\t\t\t\t\t\t'label' => __( 'Region', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'term-select',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => 'region',\r\n\t\t\t\t\t\t'taxonomy' => 'region',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'priority' => 8,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t),\t\t\t\t\r\n\t\t\t\t\t'_geolocation_long' => array(\r\n\t\t\t\t\t\t'label' => __( 'Longitude', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'name' => '_geolocation_long',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t),\t\t\t\t\r\n\t\t\t\t\t'_geolocation_lat' => array(\r\n\t\t\t\t\t\t'label' => __( 'Latitude', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'name' => '_geolocation_lat',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t'gallery' => array(\r\n\t\t\t\t'title' \t=> __('Gallery','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t'icon' \t\t=> 'sl sl-icon-picture',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'_gallery' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Gallery', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'name' => '_gallery',\r\n\t\t\t\t\t\t\t'type' => 'files',\r\n\t\t\t\t\t\t\t'description' => __( 'By selecting (clicking on a photo) one of the uploaded photos you will set it as Featured Image for this listing (marked by icon with star). Drag and drop thumbnails to re-order images in gallery.', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'placeholder' => 'Upload images',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => false,\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),\r\n\t\t\t),\r\n\t\t\t'details' => array(\r\n\t\t\t\t'title' \t=> __('Details','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t'icon' \t\t=> 'sl sl-icon-docs',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'listing_description' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Description', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'name' => 'listing_description',\r\n\t\t\t\t\t\t\t'type' => 'wp-editor',\r\n\t\t\t\t\t\t\t'description' => __( 'By selecting (clicking on a photo) one of the uploaded photos you will set it as Featured Image for this listing (marked by icon with star). Drag and drop thumbnails to re-order images in gallery.', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'placeholder' => 'Upload images',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => true,\r\n\t\t\t\t\t\t),\t\t\t\t\r\n\t\t\t\t\t\t'_video' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Video', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'name' => '_video',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => __( 'URL to oEmbed supported service', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 5,\r\n\t\t\t\t\t\t),\r\n\r\n\t\t\t\t\t\t'_phone' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Phone', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_phone',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t\t),\t\t\r\n\t\t\t\t\t\t'_website' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Website', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_website',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_email' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'E-mail', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_email',\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_email_contact_widget' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Enable Contact Widget', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'checkbox',\r\n\t\t\t\t\t\t\t'tooltip'\t => __('With 12 this option enabled listing will display Contact Form Widget that will send emails to this address', 'listeo_core'),\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_email_contact_widget',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '3'\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\t'_facebook' => array(\r\n\t\t\t\t\t\t\t'label' => __( '<i class=\"fa fa-facebook-square\"></i> Facebook', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_facebook',\r\n\t\t\t\t\t\t\t'class'\t\t => 'fb-input',\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\t\r\n\t\t\t\t\t\t'_twitter' => array(\r\n\t\t\t\t\t\t\t'label' => __( '<i class=\"fa fa-twitter-square\"></i> Twitter', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_twitter',\r\n\t\t\t\t\t\t\t'class'\t\t => 'twitter-input',\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_youtube' => array(\r\n\t\t\t\t\t\t\t'label' => __( '<i class=\"fa fa-youtube-square\"></i> YouTube', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_youtube',\r\n\t\t\t\t\t\t\t'class'\t\t => 'youtube-input',\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\t\t\t\t\r\n\t\t\t\t\t\t'_instagram' => array(\r\n\t\t\t\t\t\t\t'label' => __( '<i class=\"fa fa-instagram\"></i> Instagram', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_instagram',\r\n\t\t\t\t\t\t\t'class'\t\t => 'instagram-input',\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_whatsapp' => array(\r\n\t\t\t\t\t\t\t'label' => __( '<i class=\"fa fa-whatsapp\"></i> WhatsApp', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_whatsapp',\r\n\t\t\t\t\t\t\t'class'\t\t => 'whatsapp-input',\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_skype' => array(\r\n\t\t\t\t\t\t\t'label' => __( '<i class=\"fa fa-skype\"></i> Skype', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_skype',\r\n\t\t\t\t\t\t\t'class'\t\t => 'skype-input',\r\n\t\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'_price_min' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Minimum Price Range', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'name' => '_price_min',\r\n\t\t\t\t\t\t\t'tooltip'\t => __('Set only minimum price to show \"Prices starts from \" instead of range', 'listeo_core'),\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '6',\r\n\t\t\t\t\t\t\t'atts' => array(\r\n\t\t\t\t\t\t\t\t'step' => 0.1,\r\n\t\t\t\t\t\t\t\t'min' => 0,\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_price_max' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Maximum Price Range', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'tooltip'\t => __('Set the maximum price for your service, used on filters in search form', 'listeo_core'),\r\n\t\t\t\t\t\t\t'name' => '_price_max',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '6',\r\n\t\t\t\t\t\t\t'atts' => array(\r\n\t\t\t\t\t\t\t\t'step' => 0.1,\r\n\t\t\t\t\t\t\t\t'min' => 0,\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t),\r\n\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t\r\n\t\t\t'opening_hours' => array(\r\n\t\t\t\t'title' \t=> __('Opening Hours','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t'onoff'\t\t=> true,\r\n\t\t\t\t'icon' \t\t=> 'sl sl-icon-clock',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'_opening_hours_status' => array(\r\n\t\t\t\t\t\t\t\t'label' => __( 'Opening Hours status', 'listeo_core' ),\r\n\t\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t\t'name' => '_opening_hours_status',\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_opening_hours' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Opening Hours', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'name' => '_opening_hours',\r\n\t\t\t\t\t\t\t'type' => 'hours',\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t),\t\r\n\t\t\t\t\t\t'_monday_opening_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Monday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_monday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_monday_closing_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Monday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_monday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\t\r\n\t\t\t\t\t\t'_tuesday_opening_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Tuesday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_tuesday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_tuesday_closing_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Monday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_tuesday_closing_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\r\n\t\t\t\t\t\t'_wednesday_opening_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Wednesday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_wednesday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_wednesday_closing_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Wednesday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_wednesday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\t\t\r\n\t\t\t\t\t\t'_thursday_opening_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Thursday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_thursday_opening_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_thursday_closing_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Thursday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_thursday_closing_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\t\t\t\t\t\t\r\n\t\t\t\t\t\t'_friday_opening_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Friday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_friday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_friday_closing_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Friday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_friday_closing_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t'_saturday_opening_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'saturday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_saturday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_saturday_closing_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'saturday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_saturday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t'_sunday_opening_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'sunday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_sunday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_sunday_closing_hour' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'sunday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_sunday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\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),\r\n\t\t\t),\r\n\t\t\t'event' => array(\r\n\t\t\t\t'title'\t\t=> __( 'Event Date', 'listeo_core' ),\r\n\t\t\t\t//'class'\t\t=> 'margin-top-40',\r\n\t\t\t\t'icon'\t\t=> 'fa fa-money',\r\n\t\t\t\t'fields'\t=> array(\r\n\t\t\t\t\t'_event_date' => array(\r\n\t\t\t\t\t\t'label' => __( 'Event Date', 'listeo_core' ),\r\n\t\t\t\t\t\t'tooltip'\t => __('Select date when even will start', 'listeo_core'),\r\n\t\t\t\t\t\t'type' => 'text',\t\t\t\t\t\t\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => '_event_date',\r\n\t\t\t\t\t\t'class'\t\t => 'input-datetime',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'_event_date_end' => array(\r\n\t\t\t\t\t\t'label' => __( 'Event Date End', 'listeo_core' ),\r\n\t\t\t\t\t\t'tooltip'\t => __('Select date when even will end', 'listeo_core'),\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => '_event_date_end',\r\n\t\t\t\t\t\t'class'\t\t => 'input-datetime',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\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'menu' => array(\r\n\t\t\t\t'title' \t=> __('Pricing & Bookable Services','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t'onoff'\t\t=> true,\r\n\t\t\t\t'icon' \t\t=> 'sl sl-icon-book-open',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'_menu_status' => array(\r\n\t\t\t\t\t\t\t\t'label' => __( 'Menu status', 'listeo_core' ),\r\n\t\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t\t'name' => '_menu_status',\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_menu' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Pricing', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'name' => '_menu',\r\n\t\t\t\t\t\t\t'type' => 'pricing',\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t),\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t'booking' => array(\r\n\t\t\t\t'title' \t=> __('Booking','listeo_core'),\r\n\t\t\t\t'class' \t=> 'margin-top-40 booking-enable',\r\n\t\t\t\t'onoff'\t\t=> true,\r\n\t\t\t\t//'onoff_state' => 'on',\r\n\t\t\t\t'icon' \t\t=> 'fa fa-calendar-check-o',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t'_booking_status' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Booking status', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_booking_status',\r\n\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\t'slots' => array(\r\n\t\t\t\t'title' \t=> __('Availability','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t'onoff'\t\t=> true,\r\n\t\t\t\t'icon' \t\t=> 'fa fa-calendar-check-o',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'_slots_status' => array(\r\n\t\t\t\t\t\t\t\t'label' => __( 'Booking status', 'listeo_core' ),\r\n\t\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t\t'name' => '_slots_status',\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'_slots' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Availability Slots', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'name' => '_slots',\r\n\t\t\t\t\t\t\t'type' => 'slots',\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => false,\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),\r\n\t\t\t),\r\n\t\t\t\r\n\r\n\t\t\t'basic_prices' => array(\r\n\t\t\t\t'title'\t\t=> __('Booking prices and settings','listeo_core'),\r\n\t\t\t\t//'class'\t\t=> 'margin-top-40',\r\n\t\t\t\t'icon'\t\t=> 'fa fa-money',\r\n\t\t\t\t'fields'\t=> array(\r\n\t\t\t\t\t\r\n\t\t\t\t\t'_event_tickets' => array(\r\n\t\t\t\t\t\t'label' => __( 'Available Tickets', 'listeo_core' ),\r\n\t\t\t\t\t\t'tooltip'\t => __('How many ticekts you have to offer', 'listeo_core'),\r\n\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => '_event_tickets',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t),\r\n\r\n\t\t\t\t\t'_normal_price' => array(\r\n\t\t\t\t\t\t'label' => __( 'Regular Price', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t'tooltip'\t => __('Default price for booking on Monday - Friday', 'listeo_core'),\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'default' => '0',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'unit'\t\t => $currency,\r\n\t\t\t\t\t\t'name' => '_normal_price',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t),\t\r\n\r\n\t\t\t\t\t'_weekday_price' => array(\r\n\t\t\t\t\t\t'label' => __( 'Weekend Price', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'tooltip'\t => __('Default price for booking on weekend', 'listeo_core'),\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'name' => '_weekday_price',\r\n\t\t\t\t\t\t'unit'\t\t => $currency,\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t),\t\r\n\t\t\t\t\t'_reservation_price' => array(\r\n\t\t\t\t\t\t'label' => __( 'Reservation Fee', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => '_reservation_price',\r\n\t\t\t\t\t\t'tooltip'\t => __('One time fee for booking', 'listeo_core'),\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'unit'\t\t => $currency,\r\n\t\t\t\t\t\t'default' => '0',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t),\t\t\t\t\r\n\t\t\t\t\t'_expired_after' => array(\r\n\t\t\t\t\t\t'label' => __( 'Reservation expires after', 'listeo_core' ),\r\n\t\t\t\t\t\t'tooltip'\t => __('How many hours you can wait for clients payment', 'listeo_core'),\r\n\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t'default' => '48',\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'name' => '_expired_after',\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'unit'\t\t => 'hours',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '6'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t'_instant_booking' => array(\r\n\t\t\t\t\t\t'label' => __( 'Enable Instant Booking', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'checkbox',\r\n\t\t\t\t\t\t'tooltip'\t => __('With this option enabled booking request will be immediately approved ', 'listeo_core'),\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'name' => '_instant_booking',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'_count_per_guest' => array(\r\n\t\t\t\t\t\t'label' => __( 'Enable Price per Guest', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'checkbox',\r\n\t\t\t\t\t\t'tooltip'\t => __('With this option enabled regular price and weekend price will be multiplied by number of guests to estimate total cost', 'listeo_core'),\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'name' => '_count_per_guest',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t),\t\r\n\t\t\t\t\t'_min_days' => array(\r\n\t\t\t\t\t\t'label' => __( 'Minimum stay', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t'tooltip'\t => __('Set minimum number of days for reservation', 'listeo_core'),\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'name' => '_min_days',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '3',\r\n\t\t\t\t\t\t'for_type'\t => 'rental'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'_max_guests' => array(\r\n\t\t\t\t\t\t'label' => __( 'Maximum number of guests', 'listeo_core' ),\r\n\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t'tooltip'\t => __('Set maximum number of guests per reservation', 'listeo_core'),\r\n\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t'name' => '_max_guests',\r\n\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t'priority' => 10,\r\n\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t'render_row_col' => '3'\r\n\t\t\t\t\t),\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t),\r\n\r\n\t\t\t'availability_calendar' => array(\r\n\t\t\t\t'title' \t=> __('Availability Calendar','listeo_core'),\r\n\t\t\t\t//'class' \t=> 'margin-top-40',\r\n\t\t\t\t//'onoff'\t\t=> true,\r\n\t\t\t\t'icon' \t\t=> 'fa fa-calendar-check-o',\r\n\t\t\t\t'fields' \t=> array(\r\n\t\t\t\t\t\t'_availability' => array(\r\n\t\t\t\t\t\t\t'label' => __( 'Click day in calendar to mark it as unavailable', 'listeo_core' ),\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'name' => '_availability_calendar',\r\n\t\t\t\t\t\t\t'type' => 'calendar',\r\n\t\t\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => false,\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),\r\n\t\t\t),\r\n\r\n\t\t);\r\n\r\n\t\t$this->fields = apply_filters('submit_listing_form_fields', $this->fields);\r\n\t\t// get listing type\r\n\t\tif ( ! $this->listing_type)\r\n\t\t{\r\n\t\t\t$listing_type_array = get_post_meta( $this->listing_id, '_listing_type' );\r\n\t\t\t$this->listing_type = $listing_type_array[0];\r\n\t\t}\r\n\t\t\r\n\t\t// disable opening hours everywhere outside services\r\n\t\tif ( $this->listing_type != 'service' && apply_filters('disable_opening_hours', true) ) \r\n\t\t\tunset( $this->fields['opening_hours'] );\r\n\r\n\t\t// disable slots everywhere outside services\r\n\t\tif ( $this->listing_type != 'service' && apply_filters('disable_slots', true) ) \r\n\t\t\tunset( $this->fields['slots'] );\r\n\r\n\t\t// disable availability calendar outside rent\r\n\t\tif ( $this->listing_type == 'event' && apply_filters('disable_availability_calendar', true) ) \r\n\t\t\tunset( $this->fields['availability_calendar'] );\r\n\r\n\t\t// disable event date calendar outside events\r\n\t\tif ( $this->listing_type != 'event' ) \r\n\t\t{\r\n\t\t\tunset( $this->fields['event']);\r\n\t\t\tunset( $this->fields['basic_prices']['fields']['_event_tickets'] );\r\n\t\t} else {\r\n\t\t\t// disable fields for events\r\n\t\t\t//unset( $this->fields['basic_prices']['fields']['_normal_price'] );\r\n\t\t\tunset( $this->fields['basic_prices']['fields']['_weekday_price'] );\r\n\t\t\tunset( $this->fields['basic_prices']['fields']['_count_per_guest'] );\r\n\t\t\tunset( $this->fields['basic_prices']['fields']['_max_guests'] );\r\n\r\n\t\t\t$this->fields['basic_prices']['fields']['_event_tickets']['render_row_col'] = 3;\r\n\t\t\t$this->fields['basic_prices']['fields']['_normal_price']['render_row_col'] = 3;\r\n\t\t\t$this->fields['basic_prices']['fields']['_normal_price']['label'] = esc_html__('Ticket Price','listeo_core');\r\n\t\t\t$this->fields['basic_prices']['fields']['_reservation_price']['render_row_col'] = 3;\r\n\t\t\t$this->fields['basic_prices']['fields']['_expired_after']['render_row_col'] = 3;\r\n\t\t}\r\n\r\n\t\t//\r\n\t\tif(isset( $this->fields['menu']['fields']['_menu'])){\r\n\t\t\t $this->fields['menu']['fields']['_hide_pricing_if_bookable'] = array(\r\n\t\t\t\t\t'type' => 'checkboxes',\r\n\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t'name' => '_hide_pricing_if_bookable',\r\n\t\t\t\t\t'label' => '',\r\n\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t'options'\t=> array(\r\n\t\t\t\t\t\t'hide' => __('Hide pricing table on listing page but show bookable services in booking widget', 'listeo_core' )\r\n\t\t\t\t\t),\r\n\t\t\t);\t\r\n\t\t}\r\n\r\n\t\tif(isset( $this->fields['opening_hours']['fields']['_opening_hours'])){\r\n\t\t\t $this->fields['opening_hours']['fields']['_monday_opening_hour'] = array(\r\n\t\t\t\t\t\t\t'label' => __( 'Monday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_monday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t $this->fields['opening_hours']['fields']['_monday_closing_hour'] = array(\r\n\t\t\t\t\t\t\t'label' => __( 'Monday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_monday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\t\r\n\t\t\t$this->fields['opening_hours']['fields']['_tuesday_opening_hour'] = array(\r\n\t\t\t\t\t\t\t'label' => __( 'Tuesday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_tuesday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_tuesday_closing_hour'] = array(\r\n\t\t\t\t\t\t\t'label' => __( 'Monday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_tuesday_closing_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_wednesday_opening_hour'] = array(\r\n\t\t\t\t\t\t\t'label' => __( 'Wednesday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_wednesday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_wednesday_closing_hour'] = array(\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'Wednesday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_wednesday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_thursday_opening_hour'] = array(\t\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'Thursday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_thursday_opening_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_thursday_closing_hour'] = array(\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'Thursday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_thursday_closing_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\t\r\n\t\t\t$this->fields['opening_hours']['fields']['_friday_opening_hour'] = array(\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'Friday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_friday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_friday_closing_hour'] = array(\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'Friday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_friday_closing_hour',\r\n\t\t\t\t\t\t\t'before_row' \t => '',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_saturday_opening_hour'] = array(\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'saturday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_saturday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_saturday_closing_hour'] = array(\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'saturday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_saturday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_sunday_opening_hour'] = array(\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'sunday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_sunday_opening_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t\t$this->fields['opening_hours']['fields']['_sunday_closing_hour'] = array(\t\t\t\r\n\t\t\t\t\t\t\t'label' => __( 'sunday Opening Hour', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'skipped',\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t\t'name' => '_sunday_closing_hour',\r\n\t\t\t\t\t\t\t'priority' => 9,\r\n\t\t\t\t\t\t\t'render_row_col' => '4'\r\n\t\t\t\t\t\t);\r\n\t\t}\r\n\r\n\t\t$this->fields['basic_info']['fields']['product_id'] = array(\r\n\t\t\t\t\t\t\t'name' => 'product_id',\r\n\t\t\t\t\t\t\t'type' => 'hidden',\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t);\r\n\r\n\t\t$this->fields['gallery']['fields']['_thumbnail_id'] = array(\r\n\t\t\t\t\t\t\t'label' => __( 'Thumbnail ID', 'listeo_core' ),\r\n\t\t\t\t\t\t\t'type' => 'hidden',\r\n\t\t\t\t\t\t\t'name' => '_thumbnail_id',\r\n\t\t\t\t\t\t\t'class'\t\t => '',\r\n\t\t\t\t\t\t\t'priority' => 1,\r\n\t\t\t\t\t\t\t'required' => false,\r\n\t\t\t\t\t\t);\r\n\r\n\t\tswitch ( $this->listing_type) {\r\n\t\t\tcase 'event':\r\n\t\t\t\tforeach ( $this->fields as $group_key => $group_fields ) {\r\n\t\t\t\t\tforeach ( $group_fields['fields'] as $key => $field ) {\r\n\t\t\t\t\t\tif ( !empty($field['for_type']) && in_array($field['for_type'],array('rental','service') ) ) {\r\n\t\t\t\t\t\t\tunset( $this->fields[$group_key]['fields'][$key] );\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\t//unset( $this->fields['fields']['event_category']);\r\n\t\t// \t\tunset( $this->fields['basic_info']['fields']['service_category']);\r\n\t\t// \t\tunset( $this->fields['basic_info']['fields']['rental_category']);\r\n\t\t\tbreak;\r\n\t\t\tcase 'service':\r\n\t\t\t\tforeach ( $this->fields as $group_key => $group_fields ) {\r\n\t\t\t\t\tforeach ( $group_fields['fields'] as $key => $field ) {\r\n\t\t\t\t\t\tif ( !empty($field['for_type']) && in_array($field['for_type'],array('rental','event') ) ) {\r\n\t\t\t\t\t\t\tunset($this->fields[$group_key]['fields'][$key]);\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\tunset( $this->fields['basic_info']['fields']['event_category']);\r\n\t\t// \t\t//unset( $this->fields['fields']['service_category']);\r\n\t\t// \t\tunset( $this->fields['basic_info']['fields']['rental_category']);\r\n\t\t\tbreak;\r\n\t\t\tcase 'rental':\r\n\t\t\t\tforeach ( $this->fields as $group_key => $group_fields ) {\r\n\t\t\t\t\tforeach ( $group_fields['fields'] as $key => $field ) {\r\n\t\t\t\t\t\tif ( !empty($field['for_type']) && in_array($field['for_type'],array('event','service') ) ) {\r\n\t\t\t\t\t\t\tunset($this->fields[$group_key]['fields'][$key]);\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\tunset( $this->fields['basic_info']['fields']['event_category']);\r\n\t\t// \t\tunset( $this->fields['basic_info']['fields']['service_category']);\r\n\t\t// \t\t//unset( $this->fields['fields']['rental_category']);\r\n\t\t \tbreak;\r\n\t\t\t\r\n\t\t \tdefault:\r\n\t\t// \t\tunset( $this->fields['basic_info']['fields']['event_category']);\r\n\t\t// \t\tunset( $this->fields['basic_info']['fields']['service_category']);\r\n\t\t// \t\tunset( $this->fields['basic_info']['fields']['rental_category']);\r\n\t\t \t\tbreak;\r\n\t\t }\r\n\t\tif(get_option('listeo_bookings_disabled')){\r\n\t\t\tunset( $this->fields['booking'] );\r\n\t\t\tunset( $this->fields['slots'] );\r\n\t\t\tunset( $this->fields['basic_prices'] );\r\n\t\t\tunset( $this->fields['availability_calendar'] );\r\n\t\t}\r\n\t\t\r\n\t}", "public function init()\n {\n\n //association\n $this->add(\n array(\n 'name' => 'seasonInfo',\n 'type' => 'Zend\\Form\\Element\\Text',\n 'options' => array('label' => $this->translate('Season') . ':'),\n 'attributes' => array(\n 'readonly' => 'readonly',\n )\n )\n );\n\n //rounds\n $this->add(\n array(\n 'name' => 'round',\n 'type' => 'Zend\\Form\\Element\\Text',\n 'options' => array(\n 'label' => $this->translate('Round') . ':',\n ),\n 'attributes' => array(\n 'readonly' => 'readonly',\n ),\n )\n );\n\n //start date\n $this->add(\n array(\n 'name' => 'date',\n 'type' => 'Zend\\Form\\Element\\Date',\n 'options' => array(\n 'label' => $this->translate('Date'),\n 'format' => 'Y-m-d',\n ),\n 'attributes' => array(\n 'min' => $this->getMinDate(),\n 'step' => '1',\n 'max' => $this->getMaxDate()\n ),\n )\n );\n\n //time\n $this->add(\n array(\n 'type' => 'Zend\\Form\\Element\\Time',\n 'name' => 'time',\n 'options' => array('label' => $this->translate('Time') . ':'),\n 'attributes' => array(\n 'step' => '900'\n )\n )\n );\n\n\n $this->add($this->getButtonFieldSet());\n }", "protected function fieldData()\n {\n if ($this->field_data_fetched === false) {\n $this->field_data = array(\n 'label' => 'Your date of birth',\n 'description' => 'Please enter your date of birth',\n 'placeholder' => 'dd/mm/yyyy',\n 'size' => 50,\n 'maxlength' => 10\n );\n\n $this->field_data_fetched = true;\n }\n }", "abstract protected function _setNewForm();", "public function __construct()\n {\n parent::__construct();\n parent::setSize(640, null);\n parent::setTitle('AgendaEntry');\n parent::removePadding();\n \n // creates the form\n $this->form = new BootstrapFormBuilder('form_Entry');\n $this->form->setProperty('style', 'margin-bottom:0');\n \n $hours = array();\n $durations = array();\n for ($n=0; $n<24; $n++)\n {\n $hours[$n] = \"$n:00\";\n $durations[$n+1] = $n+1 . ' h';\n }\n array_pop($durations);\n // create the form fields\n $id = new TEntry('id');\n $entry_date = new TDate('entry_date');\n $start_hour = new TCombo('start_hour');\n $duration = new TCombo('duration');\n $title = new TEntry('title');\n $description = new TText('description');\n \n $start_hour->addItems($hours);\n $duration->addItems($durations);\n $id->setEditable(FALSE);\n \n // define the sizes\n $id->setSize(40);\n $entry_date->setSize(100);\n $start_hour->setSize(100);\n $duration->setSize(100);\n $title->setSize(400);\n $description->setSize(400, 50);\n \n // add one row for each form field\n $this->form->addFields( [new TLabel('ID:')], [$id] );\n $this->form->addFields( [new TLabel('Entry Date:')], [$entry_date] );\n $this->form->addFields( [new TLabel('Start Hour:')], [$start_hour] );\n $this->form->addFields( [new TLabel('Duration:')], [$duration] );\n $this->form->addFields( [new TLabel('Title:')], [$title] );\n $this->form->addFields( [new TLabel('Description:')], [$description] );\n\n $this->form->addAction( _t('Save'), new TAction(array($this, 'onSave')), 'fa:save green');\n $this->form->addAction( _t('Clear'), new TAction(array($this, 'onEdit')), 'fa:eraser red');\n \n parent::add($this->form);\n }", "function ooForm( ) {\n\n $this->templateobj = new ooFormTemplate(); // $this->templateobj = new ooFormTemplate('templates'); this has to be changed to pass generic options to template engine as required by the engine, each is different, you can't put 'template' in here, you've got to pass an array of options meaningful to the engine.\n\n$this->params_list = $_REQUEST;\n\n//if( $this->debug ) {\n//\tprint \"<pre>\";\n//\tprint \"Dumping Constructor\\n\";\n//\tprint \"Field List\\n\";\n//\tprint_r( $this->fields_list );\n//\tprint \"CGI Parameters\\n\";\n//\tprint_r( $this->params_list );\n// \tprint \"</pre>\";\n//}\n\n }", "private function init()\n\t{\n\t\tif(! $this->authUser = $this->auth->check_login()){\n\t\t\t$this->authUser->logged = false;\n\t\t}\n\t\t// Fill user object in view \n\t\t$this->data['authUser'] = $this->authUser;\n\n\t\t$this->data['menugang'] = $this->recipesModel->menugang();\n\t\t$this->data['hoofdgroup'] = $this->recipesModel->hoofdgroup();\n\t\t$this->data['technique'] = $this->recipesModel->technique();\n\t\t$this->data['kitchen'] = $this->recipesModel->kitchen();\n\t\t$this->data['opening'] = $this->recipesModel->opening();\n\t\t$this->data['dieten'] = $this->recipesModel->dieten();\n\t}", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "public function init_form_fields() {\n $this->form_fields = require( dirname(__FILE__) . '/../class/midtrans-admin-settings.php' );\n // Currency conversion rate if currency is not IDR\n if (get_woocommerce_currency() != 'IDR') {\n $this->form_fields['to_idr_rate'] = array(\n 'title' => __(\"Current Currency to IDR Rate\", 'midtrans-woocommerce'),\n 'type' => 'text',\n 'description' => 'The current currency to IDR rate',\n 'default' => '10000',\n );\n }\n }", "public function ArtistForm() {\n $URLParams = Director::urlParams();\n if ($URLParams['ID']){\n $formAction = new FieldSet (\n new FormAction('doSubmit', _t('Artist','Edit Artist'))\n );\n } else {\n $formAction = new FieldSet (\n new FormAction('doSubmit', _t('Artist','Create New Artist'))\n );\n }\n $form = new Form (\n $this,\n \"ArtistForm\",\n new FieldSet (\n $ImageLink = new TextField('ImageLink', _t('Artist.ImageLink','Image Link')),\n $NameField = new TextField('Name', _t('Artist.Name','Name')),\n $YoutubeSingle1Field = new TextField('YoutubeSingle1', _t('Artist.YoutubeSingle1','YoutubeSingle1')),\n $YoutubeSingle2Field = new TextField('YoutubeSingle2', _t('Artist.YoutubeSingle2','YoutubeSingle2')),\n $YoutubeSingle3Field = new TextField('YoutubeSingle3', _t('Artist.YoutubeSingle3','YoutubeSingle3')),\n $OfficialWebpageField = new TextField('OfficialWebpage', _t('Artist.OfficialWebpage','OfficialWebpage')),\n $SoundcloudField = new TextField('Soundcloud', _t('Artist.Soundcloud','Soundcloud')),\n $FacebookField = new TextField('Facebook', _t('Artist.Facebook','Facebook')),\n $TwitterField = new TextField('Twitter', _t('Artist.Twitter','Twitter')),\n $MyspaceField = new TextField('Myspace', _t('Artist.Myspace','Myspace')),\n $OfficialYoutubeField = new TextField('OfficialYoutube', _t('Artist.OfficialYoutube','OfficialYoutube')),\n $GenreListField = new TextField('GenreList', _t('Artist.GenreList','GenreList')),\n $IDField = new HiddenField('ID','', '')\n ),\n $formAction,\n // new RequiredFields('Name','Date','Address','City')\n new RequiredFields('Name', 'Date', 'Venue')\n );\n\n // Grab previous data if editing an existing DataObject\n // URLParams can be visited at artist/edit/#\n if ($URLParams['ID']){\n $thisID = Convert::raw2sql($URLParams['ID']);\n $artist = DataObject::get_by_id('Artist', $thisID);\n\n $FlyerLinkField->value = $artist->ImageLink;\n $NameField->value = $artist->Name;\n $YoutubeSingle1Field->value = $artist->YoutubeSingle1;\n $YoutubeSingle2Field->value = $artist->YoutubeSingle2;\n $YoutubeSingle3Field->value = $artist->YoutubeSingle3;\n $OfficialWebpageField->value = $artist->OfficialWebpage;\n $SoundcloudField->value = $artist->Soundcloud;\n $FacebookField->value = $artist->Facebook;\n $TwitterField->value = $artist->Twitter;\n $MyspaceField->value = $artist->Myspace;\n $OfficialYoutubeField->value = $artist->OfficialYoutube;\n $GenreListField->value = $artist->GenreList;\n $IDField->value = $thisID;\n }\n return $form;\n }", "protected function _setUniversalData()\n {\n $service = $this->getService();\n $object = $this->getObject();\n $entry = $this->getEntry();\n $attributeValues = $this->getAttributeValues();\n\n $this->_setAttribute('id', $object->getId() . '_' . $this->getStoreId(), 'text');\n\n if (isset($attributeValues['title']['value'])) {\n $titleText = $attributeValues['title']['value'];\n unset($attributeValues['title']); // to prevent \"Reason: Duplicate title\" error\n } elseif ($object->getName()) {\n $titleText = $object->getName();\n } else {\n $titleText = 'no title';\n }\n $entry->setTitle($service->newTitle()->setText($this->_cleanAtomAttribute($titleText)));\n\n if ($object->getUrl()) {\n $links = $entry->getLink();\n if (!is_array($links)) {\n $links = array();\n }\n $link = $service->newLink();\n $link->setHref($object->getUrl());\n $link->setRel('alternate');\n $link->setType('text/html');\n if ($object->getName()) {\n $link->setTitle($object->getName());\n }\n $links[0] = $link;\n $entry->setLink($links);\n }\n\n if (isset($attributeValues['description']['value'])) {\n $descrText = $attributeValues['description']['value'];\n unset($attributeValues['description']); // to prevent \"Reason: Duplicate description\" error\n } elseif ($object->getDescription()) {\n $descrText = $object->getDescription();\n } else {\n $descrText = 'no description';\n }\n $entry->setContent($service->newContent()->setText($this->_cleanAtomAttribute($descrText)));\n\n if (isset($attributeValues['price']['value']) && floatval($attributeValues['price']['value']) > 0) {\n $price = $attributeValues['price']['value'];\n } else {\n $price = $object->getPrice();\n }\n\n $this->_setAttributePrice(false, $price);\n\n if ($object->getQuantity()) {\n $quantity = $object->getQuantity() ? max(1, (int)$object->getQuantity()) : 1;\n $this->_setAttribute('quantity', $quantity, 'int');\n }\n\n $targetCountry = $this->getConfig()->getTargetCountry($this->getStoreId());\n\n if ($object->getData('image_url')) {\n $this->_setAttribute('image_link', $object->getData('image_url'), 'url');\n }\n\n $this->_setAttribute('condition', 'new', 'text');\n $this->_setAttribute('target_country', $targetCountry, 'text');\n $this->_setAttribute('item_language', $this->getConfig()->getCountryInfo($targetCountry, 'language'), 'text');\n // set new 'attribute_values' with removed 'title' and/or 'description' keys to avoid 'duplicate' errors\n $this->setAttributeValues($attributeValues);\n\n return $this;\n }", "function buildSettingsForm() {}", "private function renderTherapyForm(){\n\t\t$default_values=array();\n\t\t$id=(int)$this->site->printGetVariable('id');\n\t\tif($id){\n\t\t\t$model_person=$this->loader->getModel('person');\n\t\t\t$person_data=$model_person->printPerson($id);\n\t\t\t$default_values=array(\n\t\t\t\t\t'person:id'=>$person_data->id,\n\t\t\t\t\t'person:name'=>$person_data->name,\n\t\t\t\t\t'person:surname'=>$person_data->surname,\n\t\t\t\t\t'person:birth_date'=>$person_data->birth_date,\n\t\t\t\t\t'person:personal_identification_number'=>$person_data->personal_identification_number,\n\t\t\t\t\t'person:insurance'=>$person_data->insurance,\n\t\t\t\t\t'bigarea'=>'lorem ipsum dolor sit amet... SUPER!!!',\n\t\t\t);\n\t\t}\n\t\t$this->site->data['content']=$this->loader->getController('Form')\n\t\t\t\t\t\t->setSnippetName('therapy_form')\n\t\t\t\t\t\t->process()\n\t\t\t\t\t\t->setValues($default_values)\n\t\t\t\t\t\t->render();\n\t\treturn $this;\n\t}", "public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "protected function _prepareForm()\r\n\t{\r\n\t\t$model = Mage::helper('slider')->getBannerItemInstance();\r\n\t\t\r\n\t\t/**\r\n\t\t * Checking if users have permission to save information\r\n\t\t */\r\n\t\tif (Mage::helper('slider/admin')->isActionAllowed('save')) {\r\n\t\t\t$isElementDisabled = false;\r\n\t\t} else {\r\n\t\t\t$isElementDisabled = true;\r\n\t\t}\r\n\t\t\r\n\t\t$form = new Varien_Data_Form();\r\n\t\t\r\n\t\t$form->setHtmlIdPrefix('banner_main_');\r\n\t\t\r\n\t\t$fieldset = $form->addFieldset('base_fieldset', array(\r\n\t\t\t'legend' => Mage::helper('slider')->__('Banner Item Info')\r\n\t\t));\r\n\t\t\r\n\t\tif ($model->getId()) {\r\n\t\t\t$fieldset->addField('banner_id', 'hidden', array(\r\n\t\t\t\t'name' => 'banner_id'\r\n\t\t\t));\r\n\t\t}\r\n\t\t\r\n\t\t$fieldset->addField('title', 'text', array(\r\n\t\t\t'name'\t\t=> 'title',\r\n\t\t\t'label'\t\t=> Mage::helper('slider')->__('Banner Title'),\r\n\t\t\t'title'\t\t=> Mage::helper('slider')->__('Banner Title'),\r\n\t\t\t'required'\t=> true,\r\n\t\t\t'disabled'\t=> $isElementDisabled\r\n\t\t));\r\n\t\t\r\n\t\t$fieldset->addField('link', 'text', array(\r\n\t\t\t'name'\t\t=> 'link',\r\n\t\t\t'label'\t\t=> Mage::helper('slider')->__('Link'),\r\n\t\t\t'title'\t\t=> Mage::helper('slider')->__('Link'),\r\n\t\t\t'required'\t=> false,\r\n\t\t\t'disabled'\t=> $isElementDisabled\r\n\t\t));\r\n\t\t\r\n\t\tMage::dispatchEvent('adminhtml_banner_edit_tab_main_prepare_form',\r\n\t\t\t\tarray('form' => $form));\r\n\t\t\r\n\t\t$form->setValues($model->getData());\r\n\t\t$this->setForm($form);\r\n\t\t\r\n\t\treturn parent::_prepareForm();\r\n\t}", "private function build()\n {\n $this->form->addText(\n 'name',\n $this->teamMember === null ? null : $this->teamMember->getName(),\n null,\n 'inputText title',\n 'inputTextError title'\n );\n\n $this->form->addEditor(\n 'description',\n $this->teamMember === null ? null : $this->teamMember->getDescription()\n );\n\n $this->meta = new Meta(\n $this->form,\n $this->teamMember === null ? null : $this->teamMember->getMetaId(),\n 'name',\n true\n );\n }", "protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('item_');\n $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Select order')]);\n $fieldset->addField(\n 'direction',\n 'select',\n [\n 'name' => 'direction',\n 'label' => __('Direction'),\n 'title' => __('Direction'),\n 'required' => true,\n 'options' => ['shipment' => 'Store -> Customer', 'invert' => 'Customer -> Store', 'refund' => 'RMA (return)']\n ]\n );\n $fieldset->addField(\n 'order_id',\n 'text',\n [\n 'name' => 'order_id',\n 'label' => __('Order #'),\n 'title' => __('Order #'),\n 'required' => true\n ]\n );\n $this->setForm($form);\n return parent::_prepareForm();\n }", "function form( $instance ) {\n\n\t\t$title = esc_attr($instance['title']);\n\n\t\trequire( 'inc/widget-fields.php' );\n\n\t}", "protected function loadForm(): void\n {\n $rbtHiddenValues = [\n ['label' => BL::lbl('Hidden'), 'value' => 1],\n ['label' => BL::lbl('Published'), 'value' => 0],\n ];\n $internalLinks = BackendSpotlightsModel::getInternalLinks();\n\n // create form\n $this->form = new BackendForm('add');\n\n $this->form->addText('title', null, null, 'form-control title', 'form-control danger title');\n $this->form->addEditor('text');\n $this->form->addText('link', null, null);\n $this->form->addDropdown('categories', $this->categories);\n $this->form->addImage('image');\n $this->form->addRadiobutton('hidden', $rbtHiddenValues, 0);\n $this->form->addText('link_title');\n $this->form->addCheckbox('external_link');\n $this->form->addText('external_url');\n $this->form->addDropdown('internal_url', $internalLinks, '',\n false,\n 'chzn-select'\n )->setDefaultElement('');\n\n // meta\n $this->meta = new BackendMeta($this->form, null, 'title', true);\n\n }", "public function form( $instance ) {\n\n \t\t$defaults = array(\n \t\t\t'title' => esc_html__('Recipe List', 'yongqi'),\n \t\t\t'datasource' => '0',\n 'password' => ''\n \t\t);\n\n \t\t$instance = wp_parse_args((array) $instance, $defaults); //wp_parse_args - merge arrays\n\n\t\t // get_field_id - create id for attribute\n\t\t // get_field_name - create name for attribute\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php echo esc_html__( 'Title:', 'yongqi' ); ?></label> \n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr($instance['title']); ?>\" /> <!-- value populate the input box with saved value -->\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'datasource' ); ?>\"><?php echo esc_html__( 'Data Source (0 for postman, 1 for edam):', 'yongqi' ); ?></label> \n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'datasource' ); ?>\" name=\"<?php echo $this->get_field_name( 'datasource' ); ?>\" type=\"text\" value=\"<?php echo $instance['datasource']; ?>\" size=\"3\" />\n\t\t</p>\n <p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'password' ); ?>\"><?php echo esc_html__( 'Password:', 'yongqi' ); ?></label> \n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'password' ); ?>\" name=\"<?php echo $this->get_field_name( 'password' ); ?>\" type=\"text\" value=\"\" /> <!-- value populate the input box with saved value -->\n\t\t</p>\n\t\t<?php\n\t}", "function _prepareForm() {\n\t\t\t$this->getFieldset( );\n\t\t\t$fieldset = parent::_prepareForm( );\n\n\t\t\tif ($fieldset) {\n\t\t\t\t$this->getTextHelper( );\n\t\t\t\t$model = $helper = $this->getModel( );\n\t\t\t\t$isElementDisabled = !$this->isSaveAllowed( );\n\t\t\t\t$fieldset->addField( 'country_id', 'select', array( 'name' => 'country_id', 'label' => $helper->__( 'Country' ), 'title' => $helper->__( 'Country' ), 'required' => false, 'value' => $model->getCountryId( ), 'default' => '0', 'values' => $this->getCountryValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'region_id', 'select', array( 'name' => 'region_id', 'label' => $helper->__( 'Region/State' ), 'title' => $helper->__( 'Region/State' ), 'required' => false, 'value' => $model->getRegionId( ), 'default' => '0', 'values' => $this->getRegionValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'zip', 'text', array( 'name' => 'zip', 'label' => $helper->__( 'Zip/Postal Code' ), 'title' => $helper->__( 'Zip/Postal Code' ), 'note' => $helper->__( '* or blank - matches any' ), 'required' => false, 'value' => $this->getZipValue( ), 'default' => '', 'disabled' => $isElementDisabled ) );\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "function __construct() {\n\t\t$this->render();//llamamos a la función render donde se mostrará el formulario SEARCH con los campos correspondientes\n\t}" ]
[ "0.699834", "0.6687139", "0.6514736", "0.6486754", "0.6485428", "0.6310033", "0.6254733", "0.6198665", "0.61752015", "0.6124816", "0.61114603", "0.6106294", "0.6097164", "0.6070012", "0.6039383", "0.60147935", "0.59728515", "0.5940988", "0.5937115", "0.59309214", "0.5920533", "0.59170973", "0.59150094", "0.5888024", "0.5885181", "0.5882691", "0.5882039", "0.58711195", "0.58559054", "0.5853286", "0.5844515", "0.5841168", "0.583664", "0.5831443", "0.583135", "0.5826744", "0.57919693", "0.57887423", "0.57835215", "0.5776447", "0.5775471", "0.57639164", "0.576007", "0.5750557", "0.5748663", "0.5748653", "0.5746083", "0.57444954", "0.57381654", "0.5732745", "0.57260346", "0.5723656", "0.5722659", "0.5715892", "0.5714098", "0.57100636", "0.5709266", "0.5702485", "0.5702044", "0.5697424", "0.56955296", "0.5691106", "0.5670448", "0.5664103", "0.5659204", "0.56535864", "0.56489456", "0.5648381", "0.5647594", "0.56367064", "0.56360656", "0.56319034", "0.5631465", "0.5630495", "0.56269926", "0.56257683", "0.5622959", "0.5622943", "0.56221145", "0.56210023", "0.5617181", "0.56156665", "0.56132936", "0.560957", "0.56040496", "0.5602089", "0.5599061", "0.5597419", "0.55943215", "0.55848926", "0.5584063", "0.55823666", "0.55768347", "0.55661213", "0.5561416", "0.5560542", "0.5560514", "0.5554537", "0.5551001", "0.5548421" ]
0.609098
13
Assign form data to usersubmitted data.
function readInputData() { $this->readUserVars(array( 'representativeId', 'agentRole', 'supplierRole', 'representativeIdType', 'representativeIdValue', 'name', 'phone', 'fax', 'email', 'url', 'isSupplier', )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setSubmittedValues()\n {\n if ( $this->setFundraiserId() ) {\n $this->setFundraiserProfile(); \n }\n\n $this->setAmount();\n \n $this->setFirstName();\n $this->setLastName();\n $this->setEmail();\n $this->setTelephone();\n \n $this->setAddress();\n $this->setCity();\n $this->setCountry();\n $this->setRegion();\n $this->setPostalCode();\n \n $this->setAnonymity();\n $this->setHideAmount();\n }", "public function setFormSessionData(): void\n {\n $session = (array) $this->request->getSession()->get(config('form.session_key'));\n\n $formId = $this->form->getID();\n if (array_key_exists($formId, $session)) {\n $data = $session[$formId];\n\n $this->data = array_key('data', $data, []);\n $this->errors = array_key('messages', $data, []);\n }\n array_map(\n function ($name, $message) {\n $this->form->getField($name)->setErrorMessage($message);\n },\n array_keys($this->errors),\n $this->errors\n );\n \n array_key_unset(config('form.csrf_field_name'), $this->data);\n \n $this->form->setValues($this->data);\n $this->removeSessionData();\n }", "public function cleanFormData()\n {\n parent::cleanFormData();\n\n // You can only save data for the current user\n $this->formData['gsf_id_user'] = $this->currentUser->getUserId();\n }", "private function setPostDataToDataArray()\n\t{\n\t\ttry\n\t\t{\n\t\t\t# Set the Database instance to a variable.\n\t\t\t$db=DB::get_instance();\n\n\t\t\t# Check if the form has been submitted.\n\t\t\tif(array_key_exists('_submit_check', $_POST) && (isset($_POST['register']) && ($_POST['register']==='Register')))\n\t\t\t{\n\t\t\t\t# Set the Validator instance to a variable.\n\t\t\t\t$validator=Validator::getInstance();\n\t\t\t\t# Set the data array to a local variable.\n\t\t\t\t$data=$this->getData();\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['email']))\n\t\t\t\t{\n\t\t\t\t\t# Clean it up and set it to the data array index.\n\t\t\t\t\t$data['Email']=$db->sanitize($_POST['email'], 2);\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['email_conf']))\n\t\t\t\t{\n\t\t\t\t\t# Clean it up and set it to the data array index.\n\t\t\t\t\t$data['EmailConf']=$db->sanitize($_POST['email_conf'], 2);\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['password']) && !empty($_POST['password']))\n\t\t\t\t{\n\t\t\t\t\t# If WordPress is installed add the user the the WordPress users table.\n\t\t\t\t\tif(WP_INSTALLED===TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['WPPassword']=trim($_POST['password']);\n\t\t\t\t\t}\n\t\t\t\t\t$data['Password']=trim($_POST['password']);\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['password_conf']) && !empty($_POST['password_conf']))\n\t\t\t\t{\n\t\t\t\t\t$data['PasswordConf']=$_POST['password_conf'];\n\t\t\t\t}\n\n\t\t\t\t# Check if there was POST data sent.\n\t\t\t\tif(isset($_POST['username']))\n\t\t\t\t{\n\t\t\t\t\t# Clean it up and set it to the data array index.\n\t\t\t\t\t$data['Username']=$db->sanitize($_POST['username'], 2);\n\t\t\t\t}\n\n\t\t\t\t# Reset the data array to the data member.\n\t\t\t\t$this->setData($data);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function get_submitted_edit_form_data()\n\t{\n\t\t$this->credits = $_POST['credits'];\n\t\t$this->levelID = $_POST['level'];\t\n\t}", "public function form()\n {\n $this->setData();\n }", "public function doForm($data, $form){\r\n\r\n\t\tif (isset($data['ID']) && $data['ID'] > 0){\r\n\t\t\t$member = Entry::get()->byID($data['ID']);\r\n\t\t} else {\r\n\t\t\t$member = Entry::create();\r\n\t\t}\r\n\r\n\t\t$form->saveInto($member);\r\n\t\t$member->write();\r\n\r\n\t\t$this->redirect($member->Link());\r\n\t}", "public function populateForm() {}", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "function _submit_data()\n {\n\t$data = $this->_get_data_from_post();\n\t//$this->debug($_FILES);\n\tif (isset($_FILES['photo']) && $_FILES['photo']['name'] != NULL) {\n\t $data['image'] = Modules::run('upload_manager/upload', 'photo', 'profile');\n\t}\n\n\t$id = $this->uri->segment(3) == 'edit' ? $this->session->user_id : '';\n\tif (is_numeric($id)) {\n\t $this->_update($id, $data);\n\t Modules::run('auth/create_session', $this->session->user_id);\n\t redirect($this->uri->segment(3) == 'edit' ? 'users/profile' : 'users');\n\t} else {\n\t $this->_insert($data);\n\t redirect('login');\n\t}\n }", "private function saveData()\n { \n // Save form data in session\n if (count($this->post) > 0) {\n $_SESSION['gentlesource_voting_configuration'] = $this->post;\n $this->data = $this->post;\n $this->votingOptions = $this->post['votingOptions'];\n } else {\n if (isset($_SESSION['gentlesource_voting_configuration'])) {\n $this->data = $_SESSION['gentlesource_voting_configuration'];\n $this->votingOptions = $this->data['votingOptions'];\n }\n }\n }", "public function setDetails(){\n $this->user_id=$this->clearInputs($_POST['user_id']);\n $this->user_type=$this->clearInputs(substr($_POST['user_id'],0,3));\n $this->name=$this->clearInputs($_POST['name']);\n $this->office_id=$this->clearInputs($_POST['office_id']);\n $this->designation=$this->clearInputs($_POST['designation']);\n $this->nic=$this->clearInputs($_POST['nic']);\n $this->contact_no=$this->clearInputs($_POST['contact_no']);\n $this->email=$this->clearInputs($_POST['email']);\n $this->hashed_password=password_hash($this->generateRandomPassword(8),PASSWORD_DEFAULT);\n \n }", "function _submit_data()\n {\n\t$data = $this->get_data_from_post();\n\t\n\t//$data['photo'] = Modules::run('upload_manager/upload','image');\n\t$id = $this->uri->segment( 3 );\n\tif ( is_numeric( $id ) ) {\n\t $this->_update( $id, $data );\n\t redirect( 'auth/profile/' . $id );\n\t} else {\n\t $this->_insert( $data );\n\t redirect( 'auth/add_lecturer' );\n\t}\n }", "public function handleDataSubmission() {}", "public function setFormData($data)\n {}", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "function populate() {\n // @todo We inject client input directly into the form. What about\n // security issues?\n if (isset($this->form->request['raw_input'][$this->attributes['name']])) {\n // Disabled input elements do not accept new input.\n if (!$this->disabled) {\n $this->value = $this->form->request['raw_input'][$this->attributes['name']];\n }\n }\n }", "protected function _setForm()\n\t{\t\n\t\t$controller = $this->getActionController();\n\t\t\n\t\t$this->_setViewFormData($controller)\n\t\t\t ->_setViewErrors($controller)\n\t\t\t ->_setViewWarnings($controller);\n\t\t\t\n\t}", "public function onPreSetData(FormEvent $event)\n {\n $this->form = $event->getForm();\n $user = $event->getData();\n\n if ($user && $user->getId() !== null) {\n\n // username field rebuilding\n $username = $this->getField(self::USERNAME);\n $usernameOptions = $username->getOptions();\n $usernameOptions['attr']['readonly'] = '';\n $this->rebuildField($username, $usernameOptions);\n\n // password field rebuilding\n $password = $this->getField(self::PASSWORD);\n $passwordOptions = $password->getOptions();\n $passwordOptions['required'] = false;\n $this->rebuildField($password, $passwordOptions);\n\n //$this->buildErrorInputs();\n }\n }", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "function definition_after_data($newmsform) {\n $mform = $newmsform->_form;\n\t\t\n if ($mform->isSubmitted()) {\n $someelem = $mform->getElement('salt');\n $value = $someelem->getValue();\n\t\t\techo $value & 'Hello world';\n // Do whatever checking you need\n //$someelem->setValue($someothervalue);\n // etc.\n // add some new elements...\n }\n\t\n\t}", "private function __setProfileFormData() {\n\t\t$adminUser = $this->Auth->user();\n\n\t\t$this->request->data['User'] = $adminUser;\n\t\t$this->request->data['User']['old_email'] = $adminUser['email'];\n\n\t\t$dob = $adminUser['date_of_birth'];\n\t\tif (!is_null($dob) && ($dob !== '')) {\n\t\t\tlist($dobYear, $dobMonth, $dobDay) = explode('-', $dob);\n\t\t\t$formattedDob = sprintf('%s-%s-%s', $dobMonth, $dobDay, $dobYear);\n\t\t\t$this->request->data['User']['date_of_birth'] = $formattedDob;\n\t\t}\n\n\t\t$gender = $adminUser['gender'];\n\n\t\t$profileImg = Common::getUserThumb($adminUser['id'], $adminUser['type'], 'medium', 'user_pic');\n\n\t\t$superAdminStatus = __('No');\n\t\tif (intval($adminUser['type']) === User::ROLE_SUPER_ADMIN) {\n\t\t\t$superAdminStatus = __('Yes');\n\t\t}\n\n\t\t$timezoneList = $this->Timezone->get_timezone_list();\n\n\t\t// form details\n\t\t$formId = 'AdminProfileEditForm';\n\t\t$changePasswordFormId = 'AdminChangePasswordForm';\n\t\t$changePasswordFields = $this->__listAdminUserChangePasswordFormFields();\n\t\t$inputDefaults = array(\n\t\t\t'label' => false,\n\t\t\t'div' => false\n\t\t);\n\n\t\t// validation\n\t\t$modelName = 'User';\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminChangePasswordForm->validate, $changePasswordFormId);\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminProfileForm->validate, $formId);\n\n\t\t$title_for_layout = 'Edit Profile';\n\n\t\t$this->set(compact('title_for_layout', 'modelName', 'changePasswordFields', 'formId', 'changePasswordFormId', 'timezoneList', 'inputDefaults', 'gender', 'profileImg', 'superAdminStatus'));\n\t}", "public function setSessionData(): void\n {\n $this->response->getSession()->set(\n config('form.session_key'),\n [\n $this->form->getID() => [\n 'data' => $this->body,\n 'messages' => $this->errors\n ]\n ]\n );\n }", "function process($data, $form) {\n\t\t// submitted form object\n\t\t$submittedForm = new SubmittedForm();\n\t\t$submittedForm->SubmittedByID = ($id = Member::currentUserID()) ? $id : 0;\n\t\t$submittedForm->ParentID = $this->ID;\n\t\t$submittedForm->Recipient = $this->EmailTo;\n\t\tif(!$this->DisableSaveSubmissions) $submittedForm->write();\n\t\t\n\t\t// email values\n\t\t$values = array();\n\t\t$recipientAddresses = array();\n\t\t$sendCopy = false;\n $attachments = array();\n\n\t\t$submittedFields = new DataObjectSet();\n\t\t\n\t\tforeach($this->Fields() as $field) {\n\t\t\t// don't show fields that shouldn't be shown\n\t\t\tif(!$field->showInReports()) continue;\n\t\t\t\n\t\t\t$submittedField = $field->getSubmittedFormField();\n\t\t\t$submittedField->ParentID = $submittedForm->ID;\n\t\t\t$submittedField->Name = $field->Name;\n\t\t\t$submittedField->Title = $field->Title;\n\t\t\t\t\t\n\t\t\tif($field->hasMethod('getValueFromData')) {\n\t\t\t\t$submittedField->Value = $field->getValueFromData($data);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(isset($data[$field->Name])) $submittedField->Value = $data[$field->Name];\n\t\t\t}\n\n\t\t\tif(!empty($data[$field->Name])){\n\t\t\t\tif(in_array(\"EditableFileField\", $field->getClassAncestry())) {\n\t\t\t\t\tif(isset($_FILES[$field->Name])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// create the file from post data\n\t\t\t\t\t\t$upload = new Upload();\n\t\t\t\t\t\t$file = new File();\n\t\t\t\t\t\t$upload->loadIntoFile($_FILES[$field->Name], $file);\n\n\t\t\t\t\t\t// write file to form field\n\t\t\t\t\t\t$submittedField->UploadedFileID = $file->ID;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Attach the file if its less than 1MB, provide a link if its over.\n\t\t\t\t\t\tif($file->getAbsoluteSize() < 1024*1024*1){\n\t\t\t\t\t\t\t$attachments[] = $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!$this->DisableSaveSubmissions) $submittedField->write();\n\t\t\t\n\t\t\t$submittedFields->push($submittedField);\n\t\t}\t\n\t\t$emailData = array(\n\t\t\t\"Sender\" => Member::currentUser(),\n\t\t\t\"Fields\" => $submittedFields\n\t\t);\n\n\t\t// email users on submit. All have their own custom options. \n\t\tif($this->EmailRecipients()) {\n\t\t\t$email = new UserDefinedForm_SubmittedFormEmail($submittedFields); \n\t\t\t$email->populateTemplate($emailData);\n\t\t\tif($attachments){\n\t\t\t\tforeach($attachments as $file){\n\t\t\t\t\t// bug with double decorated fields, valid ones should have an ID.\n\t\t\t\t\tif($file->ID != 0) {\n\t\t\t\t\t\t$email->attachFile($file->Filename,$file->Filename, $file->getFileType());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->EmailRecipients() as $recipient) {\n\t\t\t\t$email->populateTemplate($recipient);\n\t\t\t\t$email->populateTemplate($emailData);\n\t\t\t\t$email->setFrom($recipient->EmailFrom);\n\t\t\t\t$email->setBody($recipient->EmailBody);\n\t\t\t\t$email->setSubject($recipient->EmailSubject);\n\t\t\t\t$email->setTo($recipient->EmailAddress);\n\t\t\t\t\n\t\t\t\t// check to see if they are a dynamic sender. eg based on a email field a user selected\n\t\t\t\tif($recipient->SendEmailFromField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailFromField()->Name);\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setFrom($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// check to see if they are a dynamic reciever eg based on a dropdown field a user selected\n\t\t\t\tif($recipient->SendEmailToField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailToField()->Name);\n\t\t\t\t\t\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setTo($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($recipient->SendPlain) {\n\t\t\t\t\t$body = strip_tags($recipient->EmailBody) . \"\\n \";\n\t\t\t\t\tif(isset($emailData['Fields']) && !$recipient->HideFormData) {\n\t\t\t\t\t\tforeach($emailData['Fields'] as $Field) {\n\t\t\t\t\t\t\t$body .= $Field->Title .' - '. $Field->Value .' \\n';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$email->setBody($body);\n\t\t\t\t\t$email->sendPlain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$email->send();\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn Director::redirect($this->Link() . 'finished?referrer=' . urlencode($data['Referrer']));\n\t}", "public function populate_application_from_leadform($data) {\n $app_user['txtFName'] = $data['first_name'];\n $app_user['txtLName'] = $data['last_name'];\n $app_user['txtEmailPer'] = $data['email'];\n $app_user['radGender'] = (isset($data['gender'])) ? $data['gender'] : '';\n $app_user['txtPermAdd'] = (isset($data['address'])) ? $data['address'] : '';\n $app_user['txtPhone'] = $data['phone'];\n $app_user['txtPermCity'] = (isset($data['city'])) ? $data['city'] : '';\n $app_user['ddlpermstate'] = (isset($data['state'])) ? $data['state'] : '';\n $app_user['txtPermZip'] = (isset($data['zip'])) ? $data['zip'] : '';\n $app_user['uid'] = $data['uid'];\n $app_user['ddlCountry'] = (isset($data['country'])) ? $data['country'] : '';\n\n if(isset($data['country']) && (($data['country'] == \"United States\") || ($data['country'] == \"US\"))) {\n $app_user['ddlCountry'] = \"US\";\n }\n else if(isset($data['country']) && $data['country'] == \"Canada\") {\n $app_user['ddlCountry'] = \"CA\";\n }\n\n $this->CI->Application_model->add($app_user['uid'], $app_user);\n }", "public function process()\n\t{\n\t\tif(isset($_POST[$this->input_name()])) {\n\t\t\t$this->value = $_POST[$this->input_name()];\n\t\t}\n\t\telse {\n\t\t\t$this->value = false;\n\t\t}\n\t}", "public function gatherData(FormEvent $event)\n {\n $this->data = $event->getData();\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }", "public function saveData(): void\n {\n studentLoader::saveStudent(new student($_POST['lastName'], $_POST['firstName'], $_POST['email'], new group($_POST['className']), $_POST['id']), $this->pdo);\n }", "private function resetFormData()\r\n {\r\n $_charset = $this->config->getModuleVar('common', 'charset');\r\n\r\n $this->viewVar['cauthor'] = htmlentities($this->strip($this->cauthor), ENT_COMPAT, $_charset);\r\n $this->viewVar['cemail'] = htmlentities($this->strip($this->cemail), ENT_COMPAT, $_charset);\r\n $this->viewVar['cbody'] = htmlentities($this->strip($this->cbody), ENT_COMPAT, $_charset);\r\n }", "function add_assignment_form_submit_handler ($form, &$form_state) {\n $selected = eto_user_load($form_state['values']['selected_uid']);\n $user = eto_user_load($form_state['values']['uid']);\n\n $form_state['values']['selected_uid'] = $selected->uid;\n sb_assignment_insert ( (object) $form_state['values'] );\n\n\n drupal_set_message(ucwords($form_state['values']['type']) . \" '\" \n\t\t . l($selected->name, \"users/\" . $selected->uid) \n\t\t . \"' added to \" \n\t\t . l($user->name, \"users/\" . $user->uid),\n\t\t \"success\");\n $form_state['redirect'] = 'eto/admin/assignments';\n}", "function form_init_data() \r\n {\r\n //$this->set_hidden_element_value(\"id\", \"logon\");\r\n $dataForm = $this->getViewVariable('courseDataForm');\r\n\r\n $this->set_element_value(\"courseName\", $dataForm['c_name'] );\r\n $this->set_element_value(\"courseLanguage\", $dataForm['c_language'] );\r\n //$this->set_element_value(\"coursedescription\", $dataForm['c_description'] );\r\n $this->set_element_value(\"courseActive\", $dataForm['c_active'] );\r\n $this->set_element_value(\"courseAccess\", $dataForm['c_access'] );\r\n $this->set_element_value(\"coursedataDescripcion\", $dataForm['cd_descripcion'] );\r\n $this->set_element_value(\"coursedataVersion\", $dataForm['cd_version'] );\r\n $this->set_element_value(\"coursedataPalabrasClaves\", $dataForm['cd_claves'] );\r\n $this->set_element_value(\"coursedataDestinatarios\", $dataForm['cd_destinatarios'] );\r\n $this->set_element_value(\"coursedataConocimientosPrevios\", $dataForm['cd_conocimientos'] );\r\n $this->set_element_value(\"coursedataMetodologia\", $dataForm['cd_metodologia'] );\r\n\r\n }", "public function afterSubmit() {\n\t\t$this->setValue($this->serializeData($this->getValue()));\n\t}", "private function collectData() {\n $this->Name = $this->sanitize($_POST['Name']);\n $this->Street1 = $this->sanitize($_POST['Street1']);\n $this->Street2 = $this->sanitize($_POST['Street2']);\n $this->CityName = $this->sanitize($_POST['CityName']);\n $this->StateOrProvince = $this->sanitize($_POST['StateOrProvince']);\n $this->Country = $this->sanitize($_POST['Country']);\n $this->PostalCode = $this->sanitize($_POST['PostalCode']);\n }", "function memberSetFormInSession($formName){\n\t\tforeach($this->post as $key => $value){\n\t\t\t$_SESSION[$formName][$key]=$value;\n\t\t}\n\t}", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "function copyFormData()\n {\n $SessionPost = modApiFunc(\"Session\", \"get\", \"SessionPost\");\n $this->ViewState = $SessionPost[\"ViewState\"];\n\n //Remove some data, that should not be sent to action one more time, from ViewState.\n if(isset($this->ViewState[\"ErrorsArray\"]) &&\n count($this->ViewState[\"ErrorsArray\"]) > 0)\n {\n $this->ErrorsArray = $this->ViewState[\"ErrorsArray\"];\n unset($this->ViewState[\"ErrorsArray\"]);\n }\n $this->POST =\n array(\n \"Id\" => isset($SessionPost[\"Id\"])? $SessionPost[\"Id\"]:\"\"\n ,\"CountryId\" => isset($SessionPost[\"CountryId\"])? $SessionPost[\"CountryId\"]:\"0\"\n ,\"StateId\" => isset($SessionPost[\"StateId\"])? $SessionPost[\"StateId\"]:\"-1\"\n ,\"ProductTaxClassId\" => isset($SessionPost[\"ProductTaxClassId\"])? $SessionPost[\"ProductTaxClassId\"]:\"1\"\n ,\"ProductTaxClassName\" => isset($SessionPost[\"ProductTaxClassName\"])? $SessionPost[\"ProductTaxClassName\"]:\"\"\n ,\"TaxNameId\" => isset($SessionPost[\"TaxNameId\"])? $SessionPost[\"TaxNameId\"]:\"1\"\n ,\"Rate\" => isset($SessionPost[\"Rate\"])? $SessionPost[\"Rate\"]:\"\"\n ,\"FormulaView\" => isset($SessionPost[\"FormulaView\"])? $SessionPost[\"FormulaView\"]:\"&nbsp;\"\n ,\"Formula\" => isset($SessionPost[\"Formula\"])? $SessionPost[\"Formula\"]:\"\"\n ,\"Applicable\" => isset($SessionPost[\"NotApplicable\"])? \"false\":\"true\"\n ,\"TaxRateByZipSet\" => isset($SessionPost[\"TaxRateByZipSet\"]) ? $SessionPost[\"TaxRateByZipSet\"] : 0\n );\n }", "protected function loadFormData()\n\t{\n\t\t// get data which the user previously entered into the form\n\t\t// the context 'com_u3abooking.edit.booking.data' is set in FormController\n\t\t$data = Factory::getApplication()->getUserState(\n\t\t\t'com_u3abooking.edit.booking.data',\n\t\t\tarray()\n\t\t);\n\t\tif (empty($data))\n\t\t{\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "function form_init_data()\r\n {\r\n $this->set_hidden_element_value('_action', FT_ACTION_UPDATE) ;\r\n $this->set_hidden_element_value('swimmeetid', $this->getSwimMeetId()) ;\r\n\r\n $swimmeet = new SwimMeet() ;\r\n $swimmeet->LoadSwimMeetById($this->getSwimMeetId()) ;\r\n\r\n $this->set_element_value('Organization', $swimmeet->getOrgCode()) ;\r\n $this->set_element_value('Meet Name', $swimmeet->getMeetName()) ;\r\n $this->set_element_value('Meet Address 1', $swimmeet->getMeetAddress1()) ;\r\n $this->set_element_value('Meet Address 2', $swimmeet->getMeetAddress2()) ;\r\n $this->set_element_value('Meet State', $swimmeet->getMeetState()) ;\r\n $this->set_element_value('Meet Postal Code', $swimmeet->getMeetPostalCode()) ;\r\n $this->set_element_value('Meet Country', $swimmeet->getMeetCountryCode()) ;\r\n $this->set_element_value('Meet Code', $swimmeet->getMeetCode()) ;\r\n $this->set_element_value('Pool Altitude', $swimmeet->getPoolAltitude()) ;\r\n $this->set_element_value('Course Code', $swimmeet->getCourseCode()) ;\r\n\r\n $date = $swimmeet->getMeetStart(false) ;\r\n $this->set_element_value('Meet Start', array('year' => substr($date, 4, 4),\r\n 'month' => substr($date, 0, 2), 'day' => substr($date, 2, 2))) ;\r\n\r\n $date = $swimmeet->getMeetEnd(false) ;\r\n $this->set_element_value('Meet End', array('year' => substr($date, 4, 4),\r\n 'month' => substr($date, 0, 2), 'day' => substr($date, 2, 2))) ;\r\n }", "public function setValue() {\n if (isset($_POST['email'], $_POST['password'])) {\n $this->email = $this->mysqli->real_escape_string($_POST['email']);\n $this->password = md5($this->mysqli->real_escape_string($_POST['password']));\n }\n }", "function saveDataToSession(){\n\t\t$data = $this->getData();\n\t\tunset($data[\"AccountInfo\"]);\n\t\tunset($data[\"LoginDetails\"]);\n\t\tunset($data[\"LoggedInAsNote\"]);\n\t\tunset($data[\"PasswordCheck1\"]);\n\t\tunset($data[\"PasswordCheck2\"]);\n\t\tSession::set(\"FormInfo.{$this->FormName()}.data\", $data);\n\t}", "public function setPostFields($data){\n\t\t$this->post = array();\n\t\t$this->addPostFields($data);\n\t}", "public function setData($formData) {\n $this->form->setData($formData);\n return;\n }", "function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}", "public static function formstore($data){\n\t\t//\n\t\t//var_dump($data);\n \t$fname=Input::get('fname');\n\t\t$username=Input::get('username');\n\t\t$password=Hash::make(Input::get('password'));\n\t\t$email=Input::get('email');\n\t\t$usertype=Input::get('usertype');\n\t\t$company=Input::get('company');\n\t\t$address=Input::get('address');\n\t\t$state=Input::get('state');\n\t\t$country=Input::get('country');\n\t\t$zip=Input::get('zip');\n\t\t$phonenum=Input::get('phonenum');\n\t\t//$remember_token=Input::get('remember_token');\n\n\n\t\t$users= new Registered_user(); //create new user model\n\n\t\t$users->fname=$fname;\n\t\t$users->username=$username;\n\t\t$users->password=$password;\n\t\t$users->email=$email;\n\t\t$users->usertype=$usertype;\n\t\t$users->company=$company;\n\t\t$users->address=$address;\n\t\t$users->state=$state;\n\t\t$users->country=$country;\n\t\t$users->zip=$zip;\n\t\t$users->phonenum=$phonenum;\n\t\t//$users->remember_token=$remember_token;\n\n\t\t // convert data format\n\t\n\t\t$users->save(); //save to 'registered_users' table\n\n }", "function wyz_ajax_claim_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\n\tupdate_option( 'wyz_claim_registration_form_data', $form_data );\n\twp_die();\n}", "protected function loadFormData()\r\n {\r\n // Check the session for previously entered form data.\r\n $app = JFactory::getApplication();\r\n $data = $app->getUserState('com_data.edit.email.data', array());\r\n\r\n if (empty($data))\r\n {\r\n $data = $this->getItem();\r\n\r\n // Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles\r\n if ($this->getState('email.id') == 0)\r\n {\r\n $filters = (array) $app->getUserState('com_data.emails.filter');\r\n $data->set(\r\n 'state',\r\n $app->input->getInt(\r\n 'state',\r\n ((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)\r\n )\r\n );\r\n\r\n $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));\r\n $data->set('access',\r\n $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))\r\n );\r\n }\r\n }\r\n\r\n // If there are params fieldsets in the form it will fail with a registry object\r\n if (isset($data->params) && $data->params instanceof Registry)\r\n {\r\n $data->params = $data->params->toArray();\r\n }\r\n\r\n $this->preprocessData('com_data.email', $data);\r\n\r\n return $data;\r\n }", "public function populateRegisterForm($data=array())\n\t{\n\t\t# Get the User class.\n\t\trequire_once Utility::locateFile(MODULES.'User'.DS.'User.php');\n\t\t# Instantiate a new User object.\n\t\t$user=new User();\n\t\t# Set the Login object to the data member.\n\t\t$this->setUserObject($user);\n\n\t\ttry\n\t\t{\n\t\t\t# Set the passed data array to the data member.\n\t\t\t$this->setData($data);\n\n\t\t\t# Process any Login data held in SESSION and set it to the data data member. This overwrites any passed data.\n\t\t\t$this->setSessionDataToDataArray('register');\n\t\t\t# Remove any \"account\" sessions.\n\t\t\tunset($_SESSION['form']['account']);\n\t\t\t# Remove any \"audio\" sessions.\n\t\t\tunset($_SESSION['form']['audio']);\n\t\t\t# Remove any \"category\" sessions.\n\t\t\tunset($_SESSION['form']['category']);\n\t\t\t# Remove any \"content\" sessions.\n\t\t\tunset($_SESSION['form']['content']);\n\t\t\t# Remove any \"file\" sessions.\n\t\t\tunset($_SESSION['form']['file']);\n\t\t\t# Remove any \"image\" sessions.\n\t\t\tunset($_SESSION['form']['image']);\n\t\t\t# Remove any \"institution\" sessions.\n\t\t\tunset($_SESSION['form']['institution']);\n\t\t\t# Remove any \"language\" sessions.\n\t\t\tunset($_SESSION['form']['language']);\n\t\t\t# Remove any \"login\" sessions.\n\t\t\tunset($_SESSION['form']['login']);\n\t\t\t# Remove any \"post\" sessions.\n\t\t\tunset($_SESSION['form']['post']);\n\t\t\t# Remove any \"product\" sessions.\n\t\t\tunset($_SESSION['form']['product']);\n\t\t\t# Remove any \"publisher\" sessions.\n\t\t\tunset($_SESSION['form']['publisher']);\n\t\t\t# Remove any \"register\" sessions.\n\t\t\tunset($_SESSION['form']['register']);\n\t\t\t# Remove any \"search\" sessions.\n\t\t\tunset($_SESSION['form']['search']);\n\t\t\t# Remove any \"staff\" sessions.\n\t\t\tunset($_SESSION['form']['staff']);\n\t\t\t# Remove any \"video\" sessions.\n\t\t\tunset($_SESSION['form']['video']);\n\n\t\t\t# Set any POST values to the appropriate data array indexes.\n\t\t\t$this->setPostDataToDataArray();\n\n\t\t\t# Populate the data members with defaults, passed values, or data saved in SESSION.\n\t\t\t$this->setDataToDataMembers($user);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "protected function setPutData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "public function generaldataformAction(){\n\t\t$form = new Bel_Forms_Builder('registration_form','/usermanagement/profile/save');\n\t\t$form->removeElement('user_password')\n\t\t\t ->removeElement('password2')\n\t\t\t ->removeElement('captcha');\n\t\t\n\t\t$form->populateForm($this->_auth->toArray());\n\t\t\n\t\t/*if($this->_request->getParam('error')){\n\t\t\t$this->view->assign('messages',$this->_messages->getMessages());\n\t\t}*/\n\t\t\n\t\t$this->view->assign('form',$form);\n\t\t$this->view->display('forms/ajax.tpl');\n\t}", "public function input($_data){\n\t\t$this->data=$_data;\n\t}", "protected function loadFormData(){\n // Check the session for previously entered form data.\n $data = JFactory::getApplication()->getUserState($this->option.'.edit.profile.data', array());\n \n if(empty($data)){\n $data = $this->getItem();\n }\n \n return $data;\n }", "private function processPostData() {\n\n if (isset($this->postDataArray['week']) && isset($this->postDataArray['year']))\n {\n\n $this->weekSelected = $this->cleanse_input($this->postDataArray['week']);\n $this->yearSelected = $this->cleanse_input($this->postDataArray['year']);\n }\n else\n {\n $this->weekSelected = $this->weeks[0];\n $this->yearSelected = $this->years[0];\n }\n }", "function performDataAction()\n{\n\tglobal $ajax;\n\n\t// XXX Set one and delete the other. This directly ties into\n\t// what HTTP method is being used: POST or GET.\n\t$key = getPostValue('assignment');\n\t$step = getPostValue('assignstep');\n\n\t// Render page.\n\t$html = formPage($key, $step);\t\n\t$ajax->sendCommand(ajaxClass::CMD_WMAINPANEL, $html);\n}", "public function postData()\n\t{\n\t\t$this->setCustomerName($_POST['frmcname']);\n\t\t$this->setCustomerAddress1($_POST['frmcaddy1']);\n\t\t$this->setCustomerAddress2($_POST['frmcaddy2']);\n\t\t$this->setCustomerCity($_POST['frmccity']);\n\t\t$this->setCustomerZipcode($_POST['frmczipcode']);\n\t\t$this->setCustomerState($_POST['frmcstate']);\n\t\t$this->setCustomerPhone( $_POST['frmcpnumber']);\n\t\t$this->setCustomerExt($_POST['frmcext']);\n\t\t$this->setCustomerFax($_POST['frmcfnumber']);\n\t\t$this->setCustomerEmail($_POST['frmcemail']);\n\t\t$this->setCustomerRdp($_POST['frmcrdp']);\n\t\t$this->setCustomerNotes($_POST['frmcnotes']);\n\t\t$this->setFlag($_POST['frmflaggedq']);\n\t\t$this->setFlagReason($_POST['frmflagreason']);\n\t}", "function assign($data) {\n\t\tunset($this->valid);\n\n\t\tforeach ($data as $field => $value) {\n\n\t\t\tif ($field == $this->id_field) {\n\t\t\t\t$this->id = $value;\n\t\t\t\t//continue;\n\t\t\t}\n\n\t\t\tif (!in_array($field, $this->protected_attributes()) && $this->field_exists($field) ) {\n\t\t\t\t$value = $this->cast($field, $value);\n\n\t\t\t\tif (method_exists($this, 'set_'.$field)) {\n\t\t\t\t\tcall_user_func(array(& $this, 'set_'.$field), $value);\n\t\t\t\t} else if (!$this->set_associated($field, $value)) {\n\t\t\t\t\t$this->data[$field] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function processAction() {\n $post = $this->request->getPost();\n $userTable = $this->getServiceLocator()->get('UserTable');\n// Load User entity\n $user = $userTable->getUser($post->id);\n// Bind User entity to Form\n $form = $this->getServiceLocator()->get('UserEditForm');\n $form->bind($user);\n $form->setData($post);\n// Save user\n $this->getServiceLocator()->get('UserTable')->saveUser($user);\n }", "public function pass(array $data) {\n foreach ($this->fields as $field) {\n $field->setValue($data[$field->getName()]);\n }\n }", "function adminSetFormInSession($formName){\n\t\tforeach($this->post as $key => $value){\n\t\t\t$_SESSION[$formName][$key]=$value;\n\t\t}\n\t}", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "function vc_infusion_settings_form_submit($form, $form_state) {\n $v = &$form_state['values'];\n variable_set('vc_infusion_appkey', $v['appkey']);\n variable_set('vc_infusion_appname', $v['appname']);\n variable_set('vc_infusion_template_firstname', $v['firstname']);\n variable_set('vc_infusion_template_lastname', $v['lastname']);\n variable_set('vc_infusion_template_email', $v['email']);\n}", "public function controller_processReceivedData() {\n // validate received form data\n // update data model\n }", "protected function loadFormData() {\r\n\t\t// Check the session for previously entered form data.\r\n\t\t$data = JFactory::getApplication()->getUserState('com_flexicontent.edit.'.$this->getName().'.data', array());\r\n\r\n\t\tif (empty($data)) {\r\n\t\t\t$data = $this->getItem();\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "public static function saveFormData($data)\n {\n DB::table('users')->insert($data);\n }", "function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n $this->set_element_value(\"Meet End\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n\r\n // If the config is set to US only, initialize the country\r\n\r\n if (FT_US_ONLY)\r\n $this->set_element_value(\"Meet Country\",\r\n FT_SDIF_COUNTRY_CODE_UNITED_STATES_OF_AMERICA_VALUE) ;\r\n\r\n $this->set_element_value(\"Pool Altitude\", \"0\") ;\r\n }", "function pickup_submit()\n\t{\n\t\t$name = '_f_'.$this->name;\n\t\t$this->value = $GLOBALS[$name];\n\t}", "function wyz_ajax_registration_form_builder_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_registration_form_data', $form_data );\n\twp_die();\n}", "public function store(): void\r\n {\r\n if (empty($this->errors[$this->artribute])) {\r\n $this->data[$this->artribute] = $this->value;\r\n }\r\n }", "protected function loadFormData()\n\t\t{\n\t\t\t\t// Check the session for previously entered form data.\n\t\t\t\t$data = JFactory::getApplication()->getUserState('com_helloworld.edit.' . $this->context . '.data', array());\n\t\t\t\tif (empty($data))\n\t\t\t\t{\n\t\t\t\t\t\t$data = $this->getItem();\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t}", "public function refreshFormData(){\r\n\t\t\t$data[\"campus\"] = $this->input->post(\"campus\");\r\n\t\t\t$this->load->view('gs_admission/issuance/IssueAdmissionForm2',$data);\r\n\t\t}", "private function _get_edit_data(&$data, $user) {\n\t\t$data['edit_form']['username'] = array(\n\t\t\t'type' => 'text',\n\t\t\t'value' => $user->username,\n\t\t\t'autocomplete' => 'off',\n\t\t\t'name' => 'username',\n\t\t\t'id' => 'edit_username'\n\t\t);\n\t\t$data['edit_form']['ingame_name'] = array(\n\t\t\t'type' => 'text',\n\t\t\t'value' => $user->ingame_name,\n\t\t\t'autocomplete' => 'off',\n\t\t\t'name' => 'ingame_name',\n\t\t\t'id' => 'edit_ingame_name'\n\t\t);\n\t\t$data['edit_form']['email'] = array(\n\t\t\t'type' => 'email',\n\t\t\t'value' => $user->email,\n\t\t\t'autocomplete' => 'off',\n\t\t\t'name' => 'email',\n\t\t\t'id' => 'edit_email'\n\t\t);\n\t\t$data['edit_form']['password'] = array(\n\t\t\t'type' => 'password',\n\t\t\t'autocomplete' => 'off',\n\t\t\t'name' => 'password',\n\t\t\t'id' => 'password'\n\t\t);\n\t\t$data['edit_form']['password_verification'] = array(\n\t\t\t'type' => 'password',\n\t\t\t'autocomplete' => 'off',\n\t\t\t'name' => 'password_verification',\n\t\t\t'id' => 'password_verification',\n\t\t\t'placeholder' => 'Verification'\n\t\t);\n\t\t$data['edit_form']['old_password'] = array(\n\t\t\t'type' => 'password',\n\t\t\t'autocomplete' => 'off',\n\t\t\t'name' => 'old_password',\n\t\t\t'id' => 'old_password'\n\t\t);\n\t\t$data['edit_form']['about'] = array(\n\t\t\t'value' => $user->about,\n\t\t\t'autocomplete' => 'off',\n\t\t\t'name' => 'about',\n\t\t\t'id' => 'edit_about',\n\t\t\t'class' => 'about'\n\t\t\t);\n\t\t$data['edit_form']['submit'] = array(\n\t\t\t'value' => \"Update information\",\n\t\t\t'name' => 'submit',\n\t\t\t'type' => 'submit'\n\t\t\t);\n\t\t$data['change_picture']['profile']['upload'] = array(\n\t\t\t'type' => 'file',\n\t\t\t'name' => 'picture',\n\t\t\t);\n\t\t$data['change_picture']['profile']['submit'] = array(\n\t\t\t'type' => 'submit',\n\t\t\t'name' => 'submit',\n\t\t\t'value' => 'Change profile-picture'\n\t\t\t);\n\t\t$data['change_picture']['profile']['delete'] = array(\n\t\t\t'type' => 'submit',\n\t\t\t'name' => 'delete',\n\t\t\t'value' => 'Delete profile-picture'\n\t\t\t);\n\t\t$data['change_picture']['background']['upload'] = array(\n\t\t\t'type' => 'file',\n\t\t\t'name' => 'picture',\n\t\t\t);\n\t\t$data['change_picture']['background']['submit'] = array(\n\t\t\t'type' => 'submit',\n\t\t\t'name' => 'submit',\n\t\t\t'value' => 'Change background-picture'\n\t\t\t);\n\t\t$data['change_picture']['background']['delete'] = array(\n\t\t\t'type' => 'submit',\n\t\t\t'name' => 'delete',\n\t\t\t'value' => 'Delete background-picture'\n\t\t);\n\t}", "public function processRequest($data) {\n $this->select_user($data);\n }", "protected function setData()\n {\n $user = Auth::getUser();\n $cart = Cart::byUser($user);\n if ( ! $cart->payment_method_id) {\n $cart->setPaymentMethod(PaymentMethod::getDefault());\n }\n $this->setVar('cart', $cart);\n $this->setVar('paymentMethod', PaymentMethod::find($cart->payment_method_id) ?? PaymentMethod::getDefault());\n $this->setVar('step', $this->property('step'));\n $this->setVar('accountPage', GeneralSettings::get('account_page'));\n\n if ($orderId = request()->get('order')) {\n $orderId = $this->decode($orderId);\n $this->setVar('order', Order::byCustomer($user->customer)->find($orderId));\n }\n }", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "public function set_user_info($data){\n\t\t\treturn $result=$this->save($data);\n\t\t}", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$app = JFactory::getApplication();\n\t\t$data = $app->getUserState('com_cooltouraman.edit.course.data', array());\n\n\t\tif (empty($data))\n\t\t{\n\t\t\t$data = $this->getItem();\n\n\t\t\t// Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles\n\t\t\tif ($this->getState('course.id') == 0)\n\t\t\t{\n\t\t\t\t$filters = (array) $app->getUserState('com_cooltouraman.course.filter');\n\t\t\t\t$data->set(\n\t\t\t\t\t'state',\n\t\t\t\t\t$app->input->getInt(\n\t\t\t\t\t\t'state',\n\t\t\t\t\t\t((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$data->set('catid', $app->input->getInt('catid', (!empty($filters['category_id']) ? $filters['category_id'] : null)));\n\t\t\t\t$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));\n\t\t\t\t$data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))));\n\t\t\t}\n\t\t}\n\n\t\t// If there are params fieldsets in the form it will fail with a registry object\n\t\tif (isset($data->params) && $data->params instanceof Registry)\n\t\t{\n\t\t\t$data->params = $data->params->toArray();\n\t\t}\n\n\t\t$this->preprocessData('com_cooltouraman.course', $data);\n\n\t\treturn $data;\n\t}", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n\n // Adding default value to the list\n\n // Setting the lists in $data array\n $data = [\n ];\n\n //dd($data);\n\n return $data;\n }", "public function valiteForm();", "public function postProcess() {\n\t\t//\t\t$this->setSubmittedValue(strtoupper($this->getSubmittedValue()));\n\t}", "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 meta_boxes_save() {\r\n\t\t\r\n\t\t// Only process if the form has actually been submitted\r\n\t\tif (\r\n\t\t\tisset( $_POST['_wpnonce'] ) &&\r\n\t\t\tisset( $_POST['post_ID'] )\r\n\t\t) {\r\n\t\t\t\r\n\t\t\t// Do nonce security check\r\n\t\t\twp_verify_nonce( '_wpnonce', $_POST['_wpnonce'] );\r\n\t\t\t\r\n\t\t\t// Grab post ID\r\n\t\t\t$post_ID = (int) $_POST['post_ID'];\r\n\t\t\t\r\n\t\t\t// Iterate through each possible piece of meta data\r\n\t\t\tforeach( $this->post_meta as $key => $value ) {\r\n\t\t\t\tif ( isset( $_POST['_' . $key] ) ) {\r\n\t\t\t\t\t$data = esc_html( $_POST['_' . $key] ); // Sanitise data input\r\n\t\t\t\t\tupdate_post_meta( $post_ID, '_' . $key, $data ); // Store the data\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "protected function loadFormData() \r\n\t{\r\n\t\t// Check the session for previously entered form data.\r\n\t\t$data = JFactory::getApplication()->getUserState('com_ktbtracker.edit.' . $this->getName() . '.data', array());\r\n\t\t\r\n\t\t// Attempt to get the record from the database\r\n\t\tif (empty($data)) {\r\n\t\t\t$data = $this->getItem();\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "abstract function setupform();", "public function processPrivateForm($data)\n {\n return;\n }", "public function setData($_data)\n {\n $this->_data = $_data;\n }", "function setFormData($data) {\r\n\t\t$data['why_use'] = $this->load->view('common/why_use_view', $data, TRUE);\r\n\t\t\r\n\t\t// load search block\r\n\t\t$data = buildTourSearchCriteria($data);\r\n\t\t\r\n\t\t$data['inc_css'] = get_static_resources('ads.min.css');\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "protected function loadFormData(){\n\t\t\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_egoi.edit.egoi.data', array());\n\t\tif (empty($data)) {\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "public function processUser(){\n \n $this->setCurrentUser();\n $this->setUsersAttributes();\n }", "public function storeFormValues( $params ) {\r\n \r\n // store the parameters\r\n $this->__construct( $params );\r\n \r\n }", "function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->role = $_POST['role'];\n $this->firstname = trimStrip($_POST['firstname']);\n $this->surname = trimStrip($_POST['surname']);\n $this->email = trimStrip($_POST['email']);\n $this->login = trimStrip($_POST['login']);\n $this->password = trimStrip($_POST['pass1']);\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function handleUserEntry()\n {\n $sessionClass = ReporticoSession();\n\n // First look for a parameter beginning \"submit_\". This will identify\n // What the user wanted to do.\n\n $hide_area = false;\n $show_area = false;\n $maintain_sql = false;\n $xmlsavefile = false;\n $xmldeletefile = false;\n if (($k = $this->getMatchingPostItem(\"/^submit_/\"))) {\n // Strip off \"_submit\"\n preg_match(\"/^submit_(.*)/\", $k, $match);\n\n // Now we should be left with a field element and an action\n // Lets strip the two\n $match1 = preg_split('/_/', $match[0]);\n $fld = $match1[1];\n $action = $match1[2];\n\n switch ($action) {\n case \"ADD\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->addMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"DELETE\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->deleteMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEUP\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->moveupMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEDOWN\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->movedownMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"SET\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->updateMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"REPORTLINK\":\n case \"REPORTLINKITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"link\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"REPORTIMPORT\":\n case \"REPORTIMPORTITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"import\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"SAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n if (!$xmlsavefile) {\n trigger_error(ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\"), E_USER_ERROR);\n }\n\n break;\n\n case \"PREPARESAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n $sessionClass::setReporticoSessionParam(\"execute_mode\", \"PREPARE\");\n\n if (!$xmlsavefile) {\n header(\"HTTP/1.0 404 Not Found\", true);\n echo '<div class=\"reportico-error-box\">' . ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\") . \"</div>\";\n die;\n }\n\n break;\n\n case \"DELETEREPORT\":\n $xmldeletefile = $this->query->xmloutfile;\n break;\n\n case \"HIDE\":\n $hide_area = $fld;\n break;\n\n case \"SHOW\":\n $show_area = $fld;\n break;\n\n case \"SQL\":\n $show_area = $fld;\n if ($fld == \"mainquerqury\") {\n // Main Query SQL Generation.\n $sql = stripslashes($_REQUEST[\"mainquerqury_SQL\"]);\n\n $maintain_sql = $sql;\n if (Authenticator::login()) {\n $p = new SqlParser($sql);\n if ($p->parse()) {\n $p->importIntoQuery($qr);\n if ($this->query->datasource->connect()) {\n $p->testQuery($this->query, $sql);\n }\n\n }\n }\n } else {\n // It's a lookup\n if (preg_match(\"/mainquercrit(.*)qury/\", $fld, $match1)) {\n $lookup = (int) $match1[1];\n $lookup_char = $match1[1];\n\n // Access the relevant crtieria item ..\n $qc = false;\n $ak = array_keys($this->query->lookup_queries);\n if (array_key_exists($lookup, $ak)) {\n $q = $this->query->lookup_queries[$ak[$lookup]]->lookup_query;\n } else {\n $q = new Reportico();\n }\n\n // Parse the entered SQL\n $sqlparm = $fld . \"_SQL\";\n $sql = $_REQUEST[$sqlparm];\n $q->maintain_sql = $sql;\n $q = new Reportico();\n $p = new SqlParser($sql);\n if ($p->parse()) {\n if ($p->testQuery($this->query, $sql)) {\n $p->importIntoQuery($q);\n $this->query->setCriteriaLookup($ak[$lookup], $q, \"WHAT\", \"NOW\");\n }\n }\n }\n }\n\n break;\n\n }\n }\n\n // Now work out what the maintainance screen should be showing by analysing\n // whether user pressed a SHOW button a HIDE button or keeps a maintenance item\n // show by presence of a shown value\n if (!$show_area) {\n // User has not pressed SHOW_ button - this would have been picked up in previous submit\n // So look for longest shown item - this will allow us to draw the maintenace screen with\n // the correct item maximised\n foreach ($_REQUEST as $k => $req) {\n if (preg_match(\"/^shown_(.*)/\", $k, $match)) {\n $containee = \"/^\" . $hide_area . \"/\";\n $container = $match[1];\n if (!preg_match($containee, $container)) {\n if (strlen($match[1]) > strlen($show_area)) {\n $show_area = $match[1];\n }\n }\n }\n }\n\n }\n\n if (!$show_area) {\n $show_area = \"mainquer\";\n }\n\n $xmlout = new XmlWriter($this->query);\n $xmlout->prepareXmlData();\n\n // If Save option has been used then write data to the named file and\n // use this file as the defalt input for future queries\n if ($xmlsavefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->writeFile($xmlsavefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", $xmlsavefile);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENOSAVE\"), E_USER_ERROR);\n }\n\n }\n\n // If Delete Report option has been used then remove the file\n // use this file as the defalt input for future queries\n if ($xmldeletefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->removeFile($xmldeletefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", false);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENODEL\"), E_USER_ERROR);\n }\n\n }\n\n $xml = $xmlout->getXmldata();\n $this->query->xmlintext = $xml;\n\n $this->query->xmlin = new XmlReader($this->query, false, $xml);\n $this->query->xmlin->show_area = $show_area;\n $this->query->maintain_sql = false;\n }", "protected function process()\n {\n $this->setSubmittedValues();\n \n if ( $this->error ) {\n $this->data['error']['form'] = 'Please check for errors.';\n return;\n }\n \n $this->addPaymentToDatabase();\n }", "public function setPostData($data) {\n\t\t$this->postData = $data;\n\t}", "function __data() {\n\t\tif ($data = $this->Session->read('data')) {\n\t\t\tforeach ($data as $k => $i) {\n\t\t\t\t$obj = ClassRegistry::init($k);\n\t\t\t\t$this->data[$k] = $i;\n\t\t\t}\n\t\t\t$this->Session->write('data', null);\n\t\t}\n\t\t// attempts to remember identity of commentor and prefill fields\n\t\tif (empty($this->data['Comment']) && $data = $this->Cookie->read('CommentUser')) {\n\t\t\t$this->data['Comment'] = $data;\n\t\t}\n\t}", "function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}" ]
[ "0.6879008", "0.67440283", "0.6742243", "0.67021453", "0.66969603", "0.666315", "0.6487733", "0.6458788", "0.63520545", "0.63301873", "0.63288194", "0.62586707", "0.6256629", "0.62461996", "0.624598", "0.6236322", "0.6232091", "0.61999315", "0.6168742", "0.616817", "0.61649", "0.615528", "0.60619694", "0.60577935", "0.6051193", "0.6000006", "0.5987426", "0.5972771", "0.5972385", "0.5971855", "0.5971681", "0.59602034", "0.59375966", "0.5931197", "0.59244215", "0.5917168", "0.590413", "0.59031177", "0.5902491", "0.5886181", "0.5879257", "0.58623827", "0.58477086", "0.584754", "0.58427525", "0.584213", "0.5838395", "0.5834567", "0.58302504", "0.58279854", "0.5825964", "0.58216727", "0.58121115", "0.5806436", "0.57919925", "0.5783576", "0.5783478", "0.57802624", "0.5779001", "0.57693034", "0.5755235", "0.57444537", "0.5740767", "0.5739272", "0.573806", "0.5731078", "0.5729005", "0.5721493", "0.57186544", "0.5715956", "0.5704653", "0.57040226", "0.57021624", "0.57019657", "0.56997633", "0.5696361", "0.56898826", "0.56740123", "0.56685054", "0.5665055", "0.56577545", "0.56443685", "0.56314576", "0.56254554", "0.56229335", "0.56201756", "0.561974", "0.5614312", "0.5613535", "0.5611275", "0.5602502", "0.5601736", "0.5599856", "0.55986404", "0.5593536", "0.5582063", "0.5580622", "0.5578783", "0.55777395", "0.5571746", "0.55683017" ]
0.0
-1
The followings are the available columns in table 'tbl_audit_trail':
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WriteAuditTrailOnAdd(&$rs) {\n\t\tglobal $mst_vendor;\n\t\t$table = 'mst_vendor';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\") $key .= EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$key .= $rs['kode'];\n\n\t\t// Write Audit Trail\n\t\t$filePfx = \"log\";\n\t\t$curDate = date(\"Y/m/d\");\n\t\t$curTime = date(\"H:i:s\");\n\t\t$id = ew_ScriptName();\n\t $curUser = CurrentUserName();\n\t\t$action = \"A\";\n\t\t$oldvalue = \"\";\n\t\tforeach (array_keys($rs) as $fldname) {\n\t\t\tif ($mst_vendor->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore Blob Field\n\t\t\t\t$newvalue = ($mst_vendor->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) ? \"<MEMO>\" : $rs[$fldname]; // Memo Field\n\t\t\t\tew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $curUser, $action, $table, $fldname, $key, $oldvalue, $newvalue);\n\t\t\t}\n\t\t}\n\t}", "public function getAudits(){\n\t\t$query = $this->db->query('SELECT * FROM `user_audit_trails`');\n\t\treturn $query->result();\n\t}", "public function getLastAudit();", "function WriteAuditTrailOnDelete(&$rs) {\n\t\tglobal $tbl_profile;\n\t\t$table = 'tbl_profile';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\")\n\t\t\t$key .= UP_COMPOSITE_KEY_SEPARATOR;\n\t\t$key .= $rs['facultyprofile_ID'];\n\n\t\t// Write Audit Trail\n\t\t$dt = up_StdCurrentDateTime();\n\t\t$id = up_ScriptName();\n\t $curUser = CurrentUserID();\n\t\tforeach (array_keys($rs) as $fldname) {\n\t\t\tif (array_key_exists($fldname, $tbl_profile->fields) && $tbl_profile->fields[$fldname]->FldDataType <> UP_DATATYPE_BLOB) { // Ignore BLOB fields\n\t\t\t\tif ($tbl_profile->fields[$fldname]->FldDataType == UP_DATATYPE_MEMO) {\n\t\t\t\t\tif (UP_AUDIT_TRAIL_TO_DATABASE)\n\t\t\t\t\t\t$oldvalue = $rs[$fldname];\n\t\t\t\t\telse\n\t\t\t\t\t\t$oldvalue = \"[MEMO]\"; // Memo field\n\t\t\t\t} elseif ($tbl_profile->fields[$fldname]->FldDataType == UP_DATATYPE_XML) {\n\t\t\t\t\t$oldvalue = \"[XML]\"; // XML field\n\t\t\t\t} else {\n\t\t\t\t\t$oldvalue = $rs[$fldname];\n\t\t\t\t}\n\t\t\t\tup_WriteAuditTrail(\"log\", $dt, $id, $curUser, \"D\", $table, $fldname, $key, $oldvalue, \"\");\n\t\t\t}\n\t\t}\n\t}", "function WriteAuditTrailOnAdd(&$rs) {\n\t\tglobal $Language;\n\t\tif (!$this->AuditTrailOnAdd) return;\n\t\t$table = 't_gaji_detail';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\") $key .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t$key .= $rs['gjd_id'];\n\n\t\t// Write Audit Trail\n\t\t$dt = ew_StdCurrentDateTime();\n\t\t$id = ew_ScriptName();\n\t\t$usr = CurrentUserName();\n\t\tforeach (array_keys($rs) as $fldname) {\n\t\t\tif (array_key_exists($fldname, $this->fields) && $this->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore BLOB fields\n\t\t\t\tif ($this->fields[$fldname]->FldHtmlTag == \"PASSWORD\") {\n\t\t\t\t\t$newvalue = $Language->Phrase(\"PasswordMask\"); // Password Field\n\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) {\n\t\t\t\t\tif (EW_AUDIT_TRAIL_TO_DATABASE)\n\t\t\t\t\t\t$newvalue = $rs[$fldname];\n\t\t\t\t\telse\n\t\t\t\t\t\t$newvalue = \"[MEMO]\"; // Memo Field\n\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_XML) {\n\t\t\t\t\t$newvalue = \"[XML]\"; // XML Field\n\t\t\t\t} else {\n\t\t\t\t\t$newvalue = $rs[$fldname];\n\t\t\t\t}\n\t\t\t\tew_WriteAuditTrail(\"log\", $dt, $id, $usr, \"A\", $table, $fldname, $key, \"\", $newvalue);\n\t\t\t}\n\t\t}\n\t}", "function insert_audit_trail()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::insert('siis', $parameter_array);\n }", "function WriteAuditTrailOnDelete(&$rs) {\n\t\tglobal $Language;\n\t\tif (!$this->AuditTrailOnDelete) return;\n\t\t$table = 't_gaji_detail';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\")\n\t\t\t$key .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t$key .= $rs['gjd_id'];\n\n\t\t// Write Audit Trail\n\t\t$dt = ew_StdCurrentDateTime();\n\t\t$id = ew_ScriptName();\n\t\t$curUser = CurrentUserName();\n\t\tforeach (array_keys($rs) as $fldname) {\n\t\t\tif (array_key_exists($fldname, $this->fields) && $this->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore BLOB fields\n\t\t\t\tif ($this->fields[$fldname]->FldHtmlTag == \"PASSWORD\") {\n\t\t\t\t\t$oldvalue = $Language->Phrase(\"PasswordMask\"); // Password Field\n\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) {\n\t\t\t\t\tif (EW_AUDIT_TRAIL_TO_DATABASE)\n\t\t\t\t\t\t$oldvalue = $rs[$fldname];\n\t\t\t\t\telse\n\t\t\t\t\t\t$oldvalue = \"[MEMO]\"; // Memo field\n\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_XML) {\n\t\t\t\t\t$oldvalue = \"[XML]\"; // XML field\n\t\t\t\t} else {\n\t\t\t\t\t$oldvalue = $rs[$fldname];\n\t\t\t\t}\n\t\t\t\tew_WriteAuditTrail(\"log\", $dt, $id, $curUser, \"D\", $table, $fldname, $key, $oldvalue, \"\");\n\t\t\t}\n\t\t}\n\t}", "function update_audit_trail()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::update($this->id, 'siis', $parameter_array);\n }", "protected static function getHasAuditColumnModelEvents()\n {\n if (isset(static::$auditColumnEvents)) {\n return static::$auditColumnEvents;\n }\n\n return collect([\n 'creating',\n 'updating',\n 'deleting',\n ]);\n }", "public function getModificationDateColumnName() {}", "public function getLogTable() {}", "public function getForAudit()\n\t{\n##if @BUILDER.AuditTrailSettings.strLogTableConnectionID.len##\n\t\treturn $this->byId( \"##@BUILDER.AuditTrailSettings.strLogTableConnectionID s##\" );\n##else##\t\t\n\t\treturn $this->getDefault();\n##endif##\n\t}", "public static function laratablesAdditionalColumns()\n {\n return ['status', 'id_card_verified'];\n }", "function WriteAuditTrailOnEdit(&$rsold, &$rsnew) {\n\t\tglobal $Language;\n\t\tif (!$this->AuditTrailOnEdit) return;\n\t\t$table = 't_gaji_detail';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\") $key .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t$key .= $rsold['gjd_id'];\n\n\t\t// Write Audit Trail\n\t\t$dt = ew_StdCurrentDateTime();\n\t\t$id = ew_ScriptName();\n\t\t$usr = CurrentUserName();\n\t\tforeach (array_keys($rsnew) as $fldname) {\n\t\t\tif (array_key_exists($fldname, $this->fields) && array_key_exists($fldname, $rsold) && $this->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore BLOB fields\n\t\t\t\tif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_DATE) { // DateTime field\n\t\t\t\t\t$modified = (ew_FormatDateTime($rsold[$fldname], 0) <> ew_FormatDateTime($rsnew[$fldname], 0));\n\t\t\t\t} else {\n\t\t\t\t\t$modified = !ew_CompareValue($rsold[$fldname], $rsnew[$fldname]);\n\t\t\t\t}\n\t\t\t\tif ($modified) {\n\t\t\t\t\tif ($this->fields[$fldname]->FldHtmlTag == \"PASSWORD\") { // Password Field\n\t\t\t\t\t\t$oldvalue = $Language->Phrase(\"PasswordMask\");\n\t\t\t\t\t\t$newvalue = $Language->Phrase(\"PasswordMask\");\n\t\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) { // Memo field\n\t\t\t\t\t\tif (EW_AUDIT_TRAIL_TO_DATABASE) {\n\t\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\n\t\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$oldvalue = \"[MEMO]\";\n\t\t\t\t\t\t\t$newvalue = \"[MEMO]\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_XML) { // XML field\n\t\t\t\t\t\t$oldvalue = \"[XML]\";\n\t\t\t\t\t\t$newvalue = \"[XML]\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\n\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\n\t\t\t\t\t}\n\t\t\t\t\tew_WriteAuditTrail(\"log\", $dt, $id, $usr, \"U\", $table, $fldname, $key, $oldvalue, $newvalue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function WriteAuditTrailOnEdit(&$rsold, &$rsnew) {\r\n\t\tglobal $Language;\r\n\t\tif (!$this->AuditTrailOnEdit) return;\r\n\t\t$table = 'pase_establecimiento';\r\n\r\n\t\t// Get key value\r\n\t\t$key = \"\";\r\n\t\tif ($key <> \"\") $key .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t$key .= $rsold['Id_Pase'];\r\n\r\n\t\t// Write Audit Trail\r\n\t\t$dt = ew_StdCurrentDateTime();\r\n\t\t$id = ew_ScriptName();\r\n\t\t$usr = CurrentUserID();\r\n\t\tforeach (array_keys($rsnew) as $fldname) {\r\n\t\t\tif ($this->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore BLOB fields\r\n\t\t\t\tif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_DATE) { // DateTime field\r\n\t\t\t\t\t$modified = (ew_FormatDateTime($rsold[$fldname], 0) <> ew_FormatDateTime($rsnew[$fldname], 0));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$modified = !ew_CompareValue($rsold[$fldname], $rsnew[$fldname]);\r\n\t\t\t\t}\r\n\t\t\t\tif ($modified) {\r\n\t\t\t\t\tif ($this->fields[$fldname]->FldHtmlTag == \"PASSWORD\") { // Password Field\r\n\t\t\t\t\t\t$oldvalue = $Language->Phrase(\"PasswordMask\");\r\n\t\t\t\t\t\t$newvalue = $Language->Phrase(\"PasswordMask\");\r\n\t\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) { // Memo field\r\n\t\t\t\t\t\tif (EW_AUDIT_TRAIL_TO_DATABASE) {\r\n\t\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\r\n\t\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$oldvalue = \"[MEMO]\";\r\n\t\t\t\t\t\t\t$newvalue = \"[MEMO]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_XML) { // XML field\r\n\t\t\t\t\t\t$oldvalue = \"[XML]\";\r\n\t\t\t\t\t\t$newvalue = \"[XML]\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\r\n\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tew_WriteAuditTrail(\"log\", $dt, $id, $usr, \"U\", $table, $fldname, $key, $oldvalue, $newvalue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function WriteAuditTrailOnEdit(&$rsold, &$rsnew) {\r\n\t\tglobal $Language;\r\n\t\tif (!$this->AuditTrailOnEdit) return;\r\n\t\t$table = 'servidor_escolar';\r\n\r\n\t\t// Get key value\r\n\t\t$key = \"\";\r\n\t\tif ($key <> \"\") $key .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t$key .= $rsold['Cue'];\r\n\r\n\t\t// Write Audit Trail\r\n\t\t$dt = ew_StdCurrentDateTime();\r\n\t\t$id = ew_ScriptName();\r\n\t\t$usr = CurrentUserID();\r\n\t\tforeach (array_keys($rsnew) as $fldname) {\r\n\t\t\tif ($this->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore BLOB fields\r\n\t\t\t\tif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_DATE) { // DateTime field\r\n\t\t\t\t\t$modified = (ew_FormatDateTime($rsold[$fldname], 0) <> ew_FormatDateTime($rsnew[$fldname], 0));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$modified = !ew_CompareValue($rsold[$fldname], $rsnew[$fldname]);\r\n\t\t\t\t}\r\n\t\t\t\tif ($modified) {\r\n\t\t\t\t\tif ($this->fields[$fldname]->FldHtmlTag == \"PASSWORD\") { // Password Field\r\n\t\t\t\t\t\t$oldvalue = $Language->Phrase(\"PasswordMask\");\r\n\t\t\t\t\t\t$newvalue = $Language->Phrase(\"PasswordMask\");\r\n\t\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) { // Memo field\r\n\t\t\t\t\t\tif (EW_AUDIT_TRAIL_TO_DATABASE) {\r\n\t\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\r\n\t\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$oldvalue = \"[MEMO]\";\r\n\t\t\t\t\t\t\t$newvalue = \"[MEMO]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_XML) { // XML field\r\n\t\t\t\t\t\t$oldvalue = \"[XML]\";\r\n\t\t\t\t\t\t$newvalue = \"[XML]\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\r\n\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tew_WriteAuditTrail(\"log\", $dt, $id, $usr, \"U\", $table, $fldname, $key, $oldvalue, $newvalue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getLastModifiedAudit();", "public function getAccessibleColumn(){\n return [\n 'ref'=>'Ref',\n 'productName'=>'Supply For',\n 'admission_price'=>'Admission Price',\n 'quantity' => 'quantity',\n 'status'=>'Status',\n 'supply_date' => 'Supply Date',\n 'started_at' => 'Started At',\n 'ended_at' => 'Ended At',\n 'other'=>''\n ];\n }", "function WriteAuditTrailOnEdit(&$rsold, &$rsnew) {\n\t\tif (!$this->AuditTrailOnEdit) return;\n\t\t$table = 'user';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\") $key .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t$key .= $rsold['id'];\n\n\t\t// Write Audit Trail\n\t\t$dt = ew_StdCurrentDateTime();\n\t\t$id = ew_ScriptName();\n\t $usr = CurrentUserName();\n\t\tforeach (array_keys($rsnew) as $fldname) {\n\t\t\tif ($this->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore BLOB fields\n\t\t\t\tif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_DATE) { // DateTime field\n\t\t\t\t\t$modified = (ew_FormatDateTime($rsold[$fldname], 0) <> ew_FormatDateTime($rsnew[$fldname], 0));\n\t\t\t\t} else {\n\t\t\t\t\t$modified = !ew_CompareValue($rsold[$fldname], $rsnew[$fldname]);\n\t\t\t\t}\n\t\t\t\tif ($modified) {\n\t\t\t\t\tif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) { // Memo field\n\t\t\t\t\t\tif (EW_AUDIT_TRAIL_TO_DATABASE) {\n\t\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\n\t\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$oldvalue = \"[MEMO]\";\n\t\t\t\t\t\t\t$newvalue = \"[MEMO]\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($this->fields[$fldname]->FldDataType == EW_DATATYPE_XML) { // XML field\n\t\t\t\t\t\t$oldvalue = \"[XML]\";\n\t\t\t\t\t\t$newvalue = \"[XML]\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$oldvalue = $rsold[$fldname];\n\t\t\t\t\t\t$newvalue = $rsnew[$fldname];\n\t\t\t\t\t}\n\t\t\t\t\tew_WriteAuditTrail(\"log\", $dt, $id, $usr, \"U\", $table, $fldname, $key, $oldvalue, $newvalue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function dataRevisionsTable();", "function get_audit_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"audit\",\"id,name,from_date,to_date,created_datetime\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public function getCreationAudit();", "function get_audit_trail_by_Id($log_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $log_id\n ));\n \n $output = $this->result('i', $parameter_array);\n $row = mysqli_fetch_assoc($output);\n \n return $row;\n }", "public static function auditAccess() {\n\t\t\t$memberid = getLoggedOnMemberID();\n\t\t\t$auditid = $_SESSION['SESS_LOGIN_AUDIT'];\n\n\t\t\t$sql = \"UPDATE {$_SESSION['DB_PREFIX']}members SET \n\t\t\t\t\tlastaccessdate = NOW(), \n\t\t\t\t\tmetamodifieddate = NOW(), \n\t\t\t\t\tmetamodifieduserid = $memberid\n\t\t\t\t\tWHERE member_id = $memberid\";\n\t\t\t$result = mysql_query($sql);\n\t\t\t\n\t\t\t$sql = \"UPDATE {$_SESSION['DB_PREFIX']}loginaudit SET \n\t\t\t\t\ttimeoff = NOW(), \n\t\t\t\t\tmetamodifieddate = NOW(), \n\t\t\t\t\tmetamodifieduserid = $memberid\n\t\t\t\t\tWHERE id = $auditid\";\n\t\t\t$result = mysql_query($sql);\n\t\t}", "public function getLoggableAttributes(): array\n {\n return [];\n }", "function insert_audit_trail($params=array()) {\n\t\tif (empty($params)) return false;\n\t\t$required_params = array('asset', 'asset_id', 'action_taken');\n\t\tforeach ($required_params as $param) {\n\t\t\tif (!isset($params[$param])) return false;\n\t\t}\n\t\t$model = &NModel::factory($this->name);\n\t\t// apply fields in the model\n\t\t$fields = $model->fields();\n\t\tforeach ($fields as $field) {\n\t\t\t$model->$field = isset($params[$field])?$params[$field]:null;\n\t\t}\n\t\t$model->user_id = $this->website_user_id;\n\t\t$model->ip = NServer::env('REMOTE_ADDR');\n\t\tif (in_array('cms_created', $fields)) {\n\t\t\t$model->cms_created = $model->now();\n\t\t}\n\t\tif (in_array('cms_modified', $fields)) {\n\t\t\t$model->cms_modified = $model->now();\n\t\t}\n\t\t// set the user id if it's applicable and available\n\t\tif (in_array('cms_modified_by_user', $fields)) {\n\t\t\t$model->cms_modified_by_user = $this->website_user_id;\n\t\t}\n\t\t$model->insert();\n\t}", "public function table_attributes() {\n return static::find_by_sql(\"SHOW COLUMNS FROM \".static::$table_name);\n }", "public function change()\n {\n $table = $this->table('m_access_log', ['engine'=>'InnoDB']);\n $table->addColumn('ip', 'string', ['limit'=>32,'default'=>'','comment'=>'ip地址'])\n ->addColumn('area', 'string', ['limit'=>32])\n ->addColumn('country', 'string', ['limit'=>32])\n ->addColumn('region', 'string', ['limit'=>32])\n ->addColumn('city', 'string', ['limit'=>32])\n ->addColumn('isp', 'string', ['limit'=>16])\n ->addColumn('create_at', 'integer', ['limit'=>10])\n ->create();\n }", "public function getAuditLog()\n\t\t{\n\t\t\tif ($this->audit_log === NULL)\n\t\t\t{\n\t\t\t\t$this->audit_log = new ECash_Application_AuditLog($this->db, $this->application_id, $this->getCompanyId());\n\t\t\t}\n\n\t\t\treturn $this->audit_log;\n\t\t}", "public function actionTrail()\n {\n $searchModel = new AuditTrailSearch;\n $dataProvider = $searchModel->search(Yii::$app->request->get());\n\n return $this->render('trail', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "public function change()\n {\n $userVideoLogs = $this->table('student_video_logs');\n $userVideoLogs\n ->addColumn('lesson_topic_video_id', 'integer')\n ->addColumn('student_id', 'integer')\n ->addColumn('event', 'string', [ 'null' => false ])\n ->addColumn('context', 'text', [ 'null' => true, 'default' => null ])\n ->addColumn('created', 'datetime')\n ->create();\n }", "private function record_transaction_columns() {\n\t\t$columns = array( \n\t\t\t'payment_date',\n\t\t\t'receiver_email',\n\t\t\t'item_name',\n\t\t\t'item_number',\n\t\t\t'payment_status',\n\t\t\t'pending_reason',\n\t\t\t'mc_gross',\n\t\t\t'mc_fee',\n\t\t\t'tax',\n\t\t\t'mc_currency',\n\t\t\t'txn_id',\n\t\t\t'txn_type',\n\t\t\t'transaction_subject',\n\t\t\t'first_name',\n\t\t\t'last_name',\n\t\t\t'address_name',\n\t\t\t'address_street',\n\t\t\t'address_city',\n\t\t\t'address_state',\n\t\t\t'address_zip',\n\t\t\t'address_country',\n\t\t\t'address_country_code',\n\t\t\t'residence_country',\n\t\t\t'address_status',\n\t\t\t'payer_email',\n\t\t\t'payer_status',\n\t\t\t'payment_type',\n\t\t\t'payment_gross',\n\t\t\t'payment_fee',\n\t\t\t'notify_version',\n\t\t\t'verify_sign',\n\t\t\t'referrer_id',\n\t\t\t'business',\n\t\t\t'ipn_track_id',\n\t\t);\n\t\treturn $columns;\n\t}", "public function lead_log_list($lead_id)\n {\n $result = common_select_values('lg.*, (select name from users where user_id = lg.created_by) as log_created_by', 'lead_history_log lg', ' lg.lead_id = \"'.$lead_id.'\"', 'result');\n return $result; \n }", "function get_recent_audit_trail($limit, $user_type_id =\"\", $user_id = \"\")\n {\n $sql = 'select * from audit_trail order by action_date_time desc limit ' .$limit. ';'; \n \n if($user_type_id != \"2\")\n {\n $sql = 'select * from audit_trail where audit_trail.user_id = '.$user_id.' order by action_date_time desc limit ' .$limit. ';'; \n }\n \n $row = parent::getPreparedStatement($sql, NULL);\n \n return $row;\n }", "public function invoice_audit_trail() {\n //$this->output->enable_profiler(true);\n $data['sideMenuData'] = fetch_non_main_page_content();\n\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n\n $company_id = $this->input->get('company_id');\n\n if ($invoice_id != '' || $company_id != '' || ($start_date != '' && $end_date != '')) {\n //Build required values to display invoice audit report in table format\n $records_per_page = RECORDS_PER_PAGE;\n $baseurl = base_url() . 'reports_finance/invoice_audit_trail/';\n $pageno = ($this->uri->segment(3)) ? $this->uri->segment(3) : 1;\n $offset = (($pageno - 1) * $records_per_page);\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_invoice_audit_trail($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n $totalrows = $this->reportsModel->get_invoice_audit_trail_rows($tenant_id, $records_per_page, $offset, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n\n //echo $totalrows;exit;\n $data['tabledata'] = $tabledata;\n $data['sort_order'] = $order_by;\n $data['controllerurl'] = 'reports_finance/invoice_audit_trail/';\n $this->load->helper('pagination');\n $data['sort_link'] = $sort_link = \"start_date=\" . $this->input->get('start_date') . \"&end_date=\" . $this->input->get('end_date') . \"&invoice_id=\" . $this->input->get('invoice_id');\n $data['pagination'] = get_pagination($records_per_page, $pageno, $baseurl, $totalrows, $field, $order_by . '&' . $sort_link);\n }\n //Render audit trail page\n $data['page_title'] = 'Accounting Reports - Invoice Audit Trail';\n $data['main_content'] = 'reports/invoice_audit_trail';\n $this->load->view('layout', $data);\n }", "function History($table, $key, $id)\n{\n global $mysqli, $userid;\n // Add Audit Record\n $hsql = \"Insert into \".$table.\"_history\n select 0,\".$table.\".*,'\".$userid.\"',null\n from \".$table.\" where \".$key.\" = \".$id.\";\";\n $result = $mysqli->query($hsql);\n return $hsql;\n}", "function logs_tbl()\n {\n // SELECT \n }", "function WriteAuditTrailDummy($typ) {\n\t\t$table = 'mst_vendor';\n\n\t\t// Write Audit Trail\n\t\t$filePfx = \"log\";\n\t\t$curDate = date(\"Y/m/d\");\n\t\t$curTime = date(\"H:i:s\");\n\t\t$id = ew_ScriptName();\n\t $curUser = CurrentUserName();\n\t\t$action = $typ;\n\t\tew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $curUser, $action, $table, \"\", \"\", \"\", \"\");\n\t}", "public function totalAudits()\r\n {\r\n $sql='SELECT * FROM `audit`';\r\n $dbOps=new DBOperations();\r\n return $dbOps->fetchData($sql);\r\n }", "function audit_log()\n\t{\n\t\tif($this->session->userdata('logged_in')==\"\")\n\t\t\theader(\"Location: \".$this->config->base_url().\"Login\");\n\t\t\t$this->cache_update();\n\t\t\t$this->check_privilege(14);\n\t\t//mandatory\n\t\t$this->load->driver('cache',array('adapter' => 'file'));\n\t\t$u_type = array('var'=>$this->cache->get('Active_status'.$this->session->userdata('loginid'))['user_type_id_fk']);\n\t\t$this->load->model('profile_model');\n\t\t$noti = array('meeting'=>$this->profile_model->meeting_notification());\n\t\t$u_type['notification'] = $noti;\n\t\t$u_type['noti1']=$this->profile_model->custom_notification();\n\t\t$this->load->view('dashboard/navbar',$u_type);\n\t\t$da = $this->profile_model->get_profile_info($this->session->userdata('uid'));\n\t\t$this->load->view('dashboard/sidebar',$da);\n\t// ends here\n\t\t$this->load->model('Sup_Admin');\n\t\t$this->load->model('Crud_model');\n\t\t$data['audit']=$this->Sup_Admin->get_user_details();\n\t\t$data['login_as']=array();\n\t\tforeach ($data['audit'] as $key) \n\t\t{\n\t\t\tarray_push($data['login_as'],$this->Sup_Admin->get_log_id($key['login_id_fk']));\n\t\t}\n\t\t$this->load->view('audit_view',$data);\n\t\t$this->db->trans_off();\n\t \t$this->db->trans_strict(FALSE);\n\t\t$this->db->trans_start();\n\t\t$this->Crud_model->audit_upload($this->session->userdata('loginid'),\n\t\t\t\t\t\t\t current_url(),\n\t\t\t\t\t\t\t 'Audit Log Page Visited',\n\t\t\t\t\t\t\t 'Custom message here');\n\t\t$this->db->trans_complete();\n\t\t$this->load->view('dashboard/footer');\n\n\t}", "function edithistory_info()\n{\n\treturn array(\n\t\t\"name\"\t\t\t\t=> \"Edit History Log\",\n\t\t\"description\"\t\t=> \"Allows you to log all edits made to posts.\",\n\t\t\"website\"\t\t\t=> \"http://galaxiesrealm.com/index.php\",\n\t\t\"author\"\t\t\t=> \"Starpaul20\",\n\t\t\"authorsite\"\t\t=> \"http://galaxiesrealm.com/index.php\",\n\t\t\"version\"\t\t\t=> \"1.2.2\",\n\t\t\"guid\"\t\t\t\t=> \"b8223bbc5a67bc02ea405bcc4101a56c\",\n\t\t\"compatibility\"\t\t=> \"16*\"\n\t);\n}", "function WriteAuditTrailDummy($typ) {\r\n\t\t$table = 'servidor_escolar';\r\n\t\t$usr = CurrentUserID();\r\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\r\n\t}", "public function change()\n {\n $this->table('change_history')\n ->setComment('数据修改记录')\n ->setEngine('InnoDB')\n ->addColumn('model_type','string', ['comment' => '数据模型类名'])\n ->addColumn('model_id', 'integer', ['comment' => '数据ID'])\n ->addColumn('before', 'text', ['comment' => '修改前内容'])\n ->addColumn('after', 'text', ['comment' => '修改后内容'])\n ->addColumn('method', 'string', ['comment' => '请求方式'])\n ->addColumn('url', 'text', ['comment' => '请求url'])\n ->addColumn('param', 'text', ['comment' => '请求参数'])\n ->addFingerPrint()\n ->create();\n }", "public static function canDisplayAuditTrailMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AUDIT_TRAIL);\n\t}", "function fetchAllAudit()\n\t\t{\n\t\t$db = DB::getInstance();\n\t\t$stmt = $db->query(\"SELECT\n\t\t\t\tid,\n\t\t\t\tusername,\n\t\t\t\taudit_id,\n\t\t\t\taudit_userid,\n\t\t\t\taudit_userip,\n\t\t\t\taudit_othus,\n\t\t\t\taudit_eventcode,\n\t\t\t\taudit_action,\n\t\t\t\taudit_itemid,\n\t\t\t\taudit_timestamp\n\t\t\tFROM audit LEFT JOIN users ON audit_userid = id ORDER BY audit_id DESC\");\n\t\t\t$results = $stmt->results();\n\t\t\t$count = $stmt->count();\n\t\t\treturn $results;\n\t\t\treturn $count;\n\t\t}", "function erp_get_audit_log_modules() {\n return \\WeDevs\\ERP\\Admin\\Models\\Audit_Log::select( 'component' )->distinct()->get()->toArray();\n}", "public function getAuditEvents(): array\n {\n return DB::table('audits')\n ->select('event')\n ->distinct('event')\n ->pluck('event')\n ->transform(function($item) {\n return [\n 'key' => $item,\n 'value' => array_key_exists($item, trans('tags')) ? trans('tags.'.$item) : $item,\n ];\n\n })\n ->toArray();\n }", "function get_audit($id){\n $result = $this->db->get_where('audit',array('id'=>$id))->row_array();\n\t\t$db_error = $this->db->error();\n\t\tif (!empty($db_error['code'])){\n\t\t\techo 'Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message'];\n\t\t\texit;\n\t\t}\n\t\treturn $result;\n }", "function set_audit_trail_by_Id($log_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $log_id\n ));\n \n $output = $this->result('i', $parameter_array);\n $row = mysqli_fetch_assoc($output);\n \n $this->id = $row['id'];\n $this->form_type = $row['form_type'];\n $this->target_id = $row['target_id'];\n $this->user_id = $row['user_id'];\n $this->action = $row['action'];\n $this->action_date_time = $row['action_date_time'];\n }", "function get_activity_log()\n {\n\n $aColumns = array('nome', 'cpf', 'date_time');\n $aColumnsWhere = array('nome', 'cpf', 'log_atividade.ultimo_acesso');\n $aColumnsJoin = array('nome', 'cpf', 'log_atividade.ultimo_acesso as date_time');\n\n // DB table to use\n $sTable = 'log_atividade';\n\n $iDisplayStart = $this->input->get_post('iDisplayStart', true);\n $iDisplayLength = $this->input->get_post('iDisplayLength', true);\n $iSortCol_0 = $this->input->get_post('iSortCol_0', true);\n $iSortingCols = $this->input->get_post('iSortingCols', true);\n $sSearch = $this->input->get_post('sSearch', true);\n $sEcho = $this->input->get_post('sEcho', true);\n\n // Paging\n if(isset($iDisplayStart) && $iDisplayLength != '-1')\n {\n $this->db->limit($this->db->escape_str($iDisplayLength), $this->db->escape_str($iDisplayStart));\n }\n\n // Ordering\n if(isset($iSortCol_0))\n {\n for($i=0; $i<intval($iSortingCols); $i++)\n {\n $iSortCol = $this->input->get_post('iSortCol_'.$i, true);\n $bSortable = $this->input->get_post('bSortable_'.intval($iSortCol), true);\n $sSortDir = $this->input->get_post('sSortDir_'.$i, true);\n\n if($bSortable == 'true')\n {\n\n $this->db->order_by($aColumns[intval($this->db->escape_str($iSortCol))], $this->db->escape_str($sSortDir));\n\n }\n }\n }\n\n /*\n * Filtering\n * NOTE this does not match the built-in DataTables filtering which does it\n * word by word on any field. It's possible to do here, but concerned about efficiency\n * on very large tables, and MySQL's regex functionality is very limited\n */\n if(isset($sSearch) && !empty($sSearch))\n {\n for($i=0; $i<count($aColumns); $i++)\n {\n $bSearchable = $this->input->get_post('bSearchable_'.$i, true);\n\n // Individual column filtering\n if(isset($bSearchable) && $bSearchable == 'true')\n {\n $this->db->or_like($aColumnsWhere[$i], $this->db->escape_like_str($sSearch));\n\n }\n }\n }\n\n // Select Data\n $this->db->join('funcionario', 'log_atividade.fk_funcionario_id = funcionario.funcionario_id', 'left');\n $this->db->select('SQL_CALC_FOUND_ROWS '.str_replace(' , ', ' ', implode(', ', $aColumnsJoin)), false);\n $rResult = $this->db->get($sTable);\n\n // Data set length after filtering\n $this->db->select('FOUND_ROWS() AS found_rows');\n $iFilteredTotal = $this->db->get()->row()->found_rows;\n\n // Total data set length\n $iTotal = $this->db->count_all($sTable);\n\n // Output\n $output = array(\n 'sEcho' => intval($sEcho),\n 'iTotalRecords' => $iTotal,\n 'iTotalDisplayRecords' => $iFilteredTotal,\n 'aaData' => array()\n );\n\n foreach($rResult->result_array() as $aRow)\n {\n $row = array();\n\n foreach($aColumns as $col)\n {\n if($col == 'date_time') $aRow[$col] = preg_replace('/\\s/','<br />',$aRow[$col]);\n $row[] = $aRow[$col];\n }\n\n $output['aaData'][] = $row;\n }\n\n return $output;\n }", "public function history()\n {\n return $this->hasMany('App\\legalEntityHistory','legal_entity_id','id');\n }", "protected function getChangesForLog(): array\n {\n $params = Logbook::getObfuscator()->obfuscate(\n $this->getChanges(),\n $this->getAttributesToObfuscate()\n );\n\n return Logbook::getObfuscator()->hide(\n $params,\n $this->getAttributesToHide()\n );\n }", "public function getAccessibleColumn(){\n return [\n 'name'=>'Name',\n 'price'=>'Price',\n 'updated_price_at'=>'Updated Price At',\n 'copy_number'=>'Quantity',\n // 'view'=>'View',\n 'categoryName'=>'Category',\n\n 'columnCount' => '',\n // 'brands' => 'Brands',\n\n // 'imageCount'=>'Images',\n // 'commentCount'=>'Comment',\n // 'upVoteCount'=> 'Up Vote',\n // 'downVoteCount'=> 'Down Vote'\n // 'category_id'=>'Category',\n ];\n }", "private function checkAuditConditions ($attribute)\n {\n //check if the columns fall under the restricted one\n if ( in_array($attribute, $this->restrictedFields) )\n return false;\n\n //see if the column is defined only for audit\n if ( sizeof($this->model->auditEnabled) ) {\n if ( !in_array($attribute, $this->model->auditEnabled) )\n return false;\n }\n\n //check if the column is disabled for auditing\n if ( sizeof($this->model->auditDisabled) ) {\n if ( in_array($attribute, $this->model->auditDisabled) )\n return false;\n }\n\n return true;\n }", "public function getAudits();", "public function index()\n {\n $name = ['Audit Trail Logs'];\n $mode = [route('audit_trail_logs.index')];\n\n $pagesize = [25, 50, 75, 100, 125];\n \n $rows = array();\n $rows = $this->log->latest()->get();\n\n $columnDefs = array(\n array('headerName'=>'MODULE','field'=>'module', 'floatingFilter'=> false),\n array('headerName'=>'USERNAME','field'=>'username', 'floatingFilter'=>false),\n array('headerName'=>'ACTION','field'=>'action', 'floatingFilter'=>false),\n array('headerName'=>'REMARKS','field'=>'remarks', 'floatingFilter'=>false),\n array('headerName'=>'IP ADDRESS','field'=>'ip', 'floatingFilter'=>false),\n array('headerName'=>'CREATED AT','field'=>'created_at', 'floatingFilter'=>false)\n );\n\n $data = json_encode(array(\n 'column' => $columnDefs,\n 'rows' => $rows\n )); \n\n $this->audit_trail_logs('','','','');\n \n return view('pages.audit_trail_logs.index', [\n 'breadcrumbs' => $this->breadcrumbs($name, $mode),\n 'data' => $data,\n 'pagesize' => $pagesize,\n 'title' => 'Audit Trail Logs'\n ]);\n }", "protected function _getDatesAtAttributes(){\n\t\treturn ActiveRecordMetaData::getDatesAt($this->_source, $this->_schema);\n\t}", "public function getAdditionalTableFields(): array\n\t{\n\t\treturn [];\n\t}", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'id' \t\t => '%d',\n\t\t\t'name' \t\t => '%s',\n\t\t\t'date_created' \t=> '%s',\n\t\t\t'date_modified' => '%s',\n\t\t\t'status'\t\t=> '%s',\n\t\t\t'ical_hash'\t\t=> '%s'\n\t\t);\n\n\t}", "public function getStatusAttribute()\n {\n return $this->audit()->first();\n }", "public function changeLogs()\n {\n return $this->hasMany(ChangeLog::class, 'package_id');\n }", "function WriteAuditTrailDummy($typ) {\r\n\t\t$table = 'pase_establecimiento';\r\n\t\t$usr = CurrentUserID();\r\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\r\n\t}", "function getChangeLog(\\PDO $dbh, $naIndex, $stDate = \"\", $endDate = \"\") {\r\n if ($stDate == \"\" && $endDate == \"\" && $naIndex < 1) {\r\n return \"Set a Start date. \";\r\n }\r\n\r\n $logDates = \"\";\r\n $whDates = \"\";\r\n $whereName = \"\";\r\n\r\n if ($stDate != \"\") {\r\n $logDates = \" and Date_Time >= '$stDate' \";\r\n $whDates = \" and a.Effective_Date >= '$stDate' \";\r\n }\r\n\r\n if ($endDate != \"\") {\r\n $logDates .= \" and Date_Time <= '$endDate' \";\r\n $whDates .= \" and a.Effective_Date <= '$endDate' \";\r\n }\r\n\r\n $whereName = ($naIndex == 0) ? \"\" : \" and idName = \" . $naIndex;\r\n\r\n $result2 = $dbh->query(\"SELECT * FROM name_log WHERE 1=1 \" . $whereName . $logDates . \" order by Date_Time desc limit 200;\");\r\n\r\n $data = \"<table id='dataTbl' class='display'><thead><tr>\r\n <th>Date</th>\r\n <th>Type</th>\r\n <th>Sub-Type</th>\r\n <th>User Id</th>\r\n <th>Member Id</th>\r\n <th>Log Text</th></tr></thead><tbody>\";\r\n\r\n while ($row2 = $result2->fetch(\\PDO::FETCH_ASSOC)) {\r\n\r\n $data .= \"<tr>\r\n <td>\" . date(\"Y-m-d H:i:s\", strtotime($row2['Timestamp'])) . \"</td>\r\n <td>\" . $row2['Log_Type'] . \"</td>\r\n <td>\" . $row2['Sub_Type'] . \"</td>\r\n <td>\" . $row2['WP_User_Id'] . \"</td>\r\n <td>\" . $row2['idName'] . \"</td>\r\n <td>\" . $row2['Log_Text'] . \"</td></tr>\";\r\n }\r\n\r\n\r\n // activity table has volunteer data\r\n $query = \"select a.idName, a.Effective_Date, a.Action_Codes, a.Other_Code, a.Source_Code, g.Description as Code, g2.Description as Category, ifnull(g3.Description, '') as Rank\r\nfrom activity a left join gen_lookups g on substring_index(Product_Code, '|', 1) = g.Table_Name and substring_index(Product_Code, '|', -1) = g.Code\r\nleft join gen_lookups g2 on g2.Table_Name = 'Vol_Category' and substring_index(Product_Code, '|', 1) = g2.Code\r\nleft join gen_lookups g3 on g3.Table_Name = 'Vol_Rank' and g3.Code = a.Other_Code\r\n where a.Type = 'vol' $whereName $whDates order by a.Effective_Date desc limit 100;\";\r\n\r\n $result3 = $dbh->query($query);\r\n\r\n while ($row2 = $result3->fetch(\\PDO::FETCH_ASSOC)) {\r\n\r\n $data .= \"<tr>\r\n <td>\" . date(\"Y-m-d H:i:s\", strtotime($row2['Effective_Date'])) . \"</td>\r\n <td>Volunteer</td>\r\n <td>\" . $row2['Action_Codes'] . \"</td>\r\n <td>\" . $row2['Source_Code'] . \"</td>\r\n <td>\" . $row2['idName'] . \"</td>\r\n <td>\" . $row2['Category'] . \"/\" . $row2[\"Code\"] . \", Rank = \" . $row2[\"Rank\"] . \"</td></tr>\";\r\n }\r\n\r\n\r\n return $data . \"</tbody></table>\";\r\n}", "public static function laratablesAdditionalColumns()\n\t\t{\n\t\t\treturn ['coa_name'];\n\t\t}", "protected static function bootHasAuditColumn()\n {\n if (auth()->guest()) {\n return;\n }\n\n static::getHasAuditColumnModelEvents()->each(function ($evenName) {\n static::$evenName(function (Model $model) use ($evenName) {\n if ($model->defaultAuditColumn() || (!blank($model->auditColumn) && $model->auditColumn)) {\n if ($evenName == 'creating') {\n $model->setAuditColumn(config('watchable.audit_columns.creator_column'));\n }\n $model->setAuditColumn(config('watchable.audit_columns.editor_column'));\n }\n });\n });\n }", "public function getLastLoginTableAttribute()\n {\n return is_null($this->last_login) ? ['display' => '', 'timestamp' => ''] : [\n 'display' => $this->last_login_for_humans,\n 'timestamp' => Carbon::parse($this->last_login)->timestamp,\n ];\n }", "protected function audit_record($action = false,$area = false,$id = false,$data = false){\n\t\treturn;\n\t}", "public function get_activity_logs_list($uid){\n\t\t$this->db->select('logs.id,logs.create_at,logs.action,floder_list.f_name,images.imag_org_name,links.l_name')->from('logs');\n\t\t$this->db->join('floder_list', 'floder_list.f_id = logs.folder', 'left');\t\t\n\t\t$this->db->join('images', 'images.img_id = logs.file', 'left');\t\t\n\t\t$this->db->join('links', 'links.l_id = logs.link', 'left');\t\t\n\t\t$this->db->where('logs.u_id', $uid);\n\t\t$this->db->order_by(\"logs.create_at\", \"DESC\");\n\t\treturn $this->db->get()->result_array();\n\t}", "public static function listTable() {\n self::init();\n $columns = self::getListTableColumns();\n $columnsData = array();\n\n foreach($columns as $key => $value)\n $columnsData[$key] = $value['label'];\n\n new AdminListTable(\n self::$table,\n array(\n 'singular' => 'Log',\n 'plural' => 'Logs',\n ),\n array(\n 'columns' => $columnsData,\n 'orderby' => 'date_time',\n 'order' => 'desc',\n 'search' => array(\n 'date_time',\n ),\n 'sortable' => array(\n 'date_time' => 'date_time',\n ),\n 'per_page' => 40,\n )\n );\n }", "public function setAuditPath($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->auditPath = $arr;\n\n return $this;\n }", "public static function getColumns(): array {\n return ['invoice_id', 'appointment_id', 'create_time', 'update_time', 'state', 'tax_rate',\n 'amount_due', 'amount_payed', 'discount_rate'];\n }", "public function table_headers() {\n\t\t\tglobal $mycred_types;\n\n\t\t\treturn apply_filters( 'mycred_log_column_headers', array(\n\t\t\t\t'column-username' => __( 'User', 'twodayssss' ),\n\t\t\t\t'column-time' => __( 'Date', 'twodayssss' ),\n\t\t\t\t'column-creds' => $this->core->plural(),\n\t\t\t\t'column-entry' => __( 'Entry', 'twodayssss' )\n\t\t\t), $this );\n\t\t}", "public function getAuditList()\n {\n $this->redirectUser();\n $auditor_id = $this->session->userdata['user_id'];\n $this->load->model('purchase_order/Purchase_order_model', 'PO');\n\n $this->PO->getPObyAuditor($auditor_id);\n $args = array($auditor_id);\n\n $recordsTotal = $this->db->count_all_results();\n $recordsFiltered = $this->PO->countFiltered('getPObyAuditor', $args);\n \n\n $this->PO->getPObyAuditor($auditor_id);\n if ($this->input->get('length') != -1) {\n $this->db->limit($this->input->get('length'), $this->input->get('start'));\n }\n $po = $this->db->get();\n\n\n $data['data'] = array();\n\n if ($po->num_rows()>0) {\n foreach ($po->result() as $key => $v) {\n $disabled = \"\";\n if ($v->status == 1) {\n $disabled = \"disabled\";\n }\n\n $class_action = '';\n if (in_array($v->status, $this->auditor_status_action)) {\n $class_action = 'has-action';\n }\n\n $data['data'][] = array(\n $v->po_num,\n $v->pr_number,\n $v->request_name,\n $v->vendor_name,\n $this->xwb_purchasing->getStatus('purchase_order', $v->status).'<label class=\"badge\">'.time_elapse($v->date_updated).'<label>',\n $v->pd_remarks,\n '<a target=\"_blank\" href=\"'.base_url('purchase_order/preview/'.$v->id).'\" class=\"btn btn-xs btn-info '.$class_action.'\">'.lang('btn_view').'</a>\n\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:;\" onClick=\"xwb.approvePO('.$v->id.')\" class=\"btn btn-xs btn-success '.$disabled.'\">'.lang('btn_approve').'</a>\n\t\t\t\t\t\t\t\t\t\t',\n );\n /*<a href=\"javascript:;\" onClick=\"xwb.returnToPurchasing('.$v->id.')\" class=\"btn btn-xs btn-warning '.$disabled.'\">Return</a>*/ //remove as of now\n }\n }\n $data['draw'] = $this->input->get('draw');\n $data['recordsTotal'] = $recordsTotal;\n $data['recordsFiltered'] = $recordsFiltered;\n echo $this->xwbJsonEncode($data);\n }", "public function getHistoryEventDescriptionData()\n {\n return array(\n 'trx_method' => static::t($this->getPaymentMethod()->getName()),\n 'trx_type' => static::t($this->getType()),\n 'trx_value' => $this->getOrder()->getCurrency()->roundValue($this->getValue()),\n 'trx_status' => static::t($this->getReadableStatus()),\n );\n }", "function WriteAuditTrailDummy($typ) {\n\t\t$table = 't_gaji_detail';\n\t\t$usr = CurrentUserName();\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\n\t}", "function get_auditlog_csv()\n{\n\n $xml = get_auditlog_xml(array(\"records\" => \"\"));\n\n // output header for csv\n header(\"Content-type: application/octet-stream\");\n header(\"Content-Disposition: attachment; filename=\\\"auditlog.csv\\\"\");\n\n // column definitions\n echo \"id,time,source,user,type,ip_address,message,details\\n\";\n\n // bail out of trial expired\n if (enterprise_features_enabled() == false)\n return;\n\n //print_r($xml);\n //exit();\n\n if ($xml) {\n foreach ($xml->auditlogentry as $a) {\n\n echo \"\\\"\" . $a->id . \"\\\",\\\"\" . $a->log_time . \"\\\",\\\"\" . $a->source . \"\\\",\\\"\" . $a->user . \"\\\",\\\"\" . $a->type . \"\\\",\\\"\" . $a->ip_address . \"\\\",\\\"\" . $a->message . \"\\\"\\n\";\n }\n }\n}", "function insert_history_tracking_fields_to_master_view(Array $visible_columns):Array{\n if( !in_array($this->CI->grants->history_tracking_field($this->controller,'created_by'),$visible_columns) || \n !in_array($this->CI->grants->history_tracking_field($this->controller,'last_modified_by'),$visible_columns)\n \n ){\n array_push($visible_columns,$this->CI->grants->history_tracking_field($this->controller,'created_by'),\n $this->CI->grants->history_tracking_field($this->controller,'last_modified_by')); \n }\n\n return $visible_columns;\n }", "function WriteAuditTrailDummy($typ) {\r\n\t\t$table = 'tutores';\r\n\t\t$usr = CurrentUserID();\r\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\r\n\t}", "function WriteAuditTrailDummy($typ) {\n\t\t$table = 'tbl_profile';\n\t $usr = CurrentUserID();\n\t\tup_WriteAuditTrail(\"log\", up_StdCurrentDateTime(), up_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\n\t}", "public function describeAuditLogRecords($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->describeAuditLogRecordsWithOptions($request, $runtime);\n }", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "public function alter_table()\n {\n $CI =& get_instance();\n $CI->load->model('config_model');\n\n $CI->config_model->create_tb_login_log();\n\n return true;\n }", "public function getChangedFields() {}", "public function change()\n {\n $table = $this->table('notifications');\n $table->addColumn('destination', 'enum', [\n 'values' => [\n 'Global',\n 'Role',\n 'User'\n ]\n ]);\n $table->addColumn('role_id', 'string', [\n 'default' => '',\n 'limit' => 32\n ]);\n $table->changeColumn('user_id', 'string', [\n 'default' => '',\n 'limit' => 36\n ]);\n $table->removeColumn('seen');\n $table->removeColumn('deleted');\n $table->update();\n\n $tableLogs = $this->table('admin_l_t_e_notification_logs');\n $tableLogs->addColumn('notification_id', 'integer');\n $tableLogs->addColumn('user_id', 'string', [\n 'default' => null,\n 'limit' => 36,\n 'null' => false\n ]);\n $tableLogs->addColumn('created', 'datetime');\n $tableLogs->create();\n }", "public function getAuditTypes(): array\n {\n $auditableTypes = DB::table('audits')\n ->distinct('auditable_type')\n ->pluck('auditable_type')\n ->toArray();\n\n $hasExportTag = DB::table('audits')\n ->where('tags', 'export')\n ->first();\n\n $formattedTypes = $this->formatTypes($auditableTypes);\n\n if (isset($hasExportTag)) {\n $formattedTypes[] = ['model' => 'Export', 'tag' => 'export'];\n }\n\n return $formattedTypes;\n }", "public function getAuditPath()\n {\n return $this->auditPath;\n }", "function WriteAuditTrailDummy($typ) {\n\t\t$table = 'user';\n\t $usr = CurrentUserName();\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\n\t}", "public function describeAuditRecords($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->describeAuditRecordsWithOptions($request, $runtime);\n }", "public function defineTableAttributes($source = null)\n {\n return [\n 'id' => Craft::t('ID'),\n 'user' => Craft::t('User'),\n 'subscription' => Craft::t('Subscription'),\n 'charge' => Craft::t('Charge'),\n 'dateCreated' => Craft::t('Date Joined')\n ];\n }", "public static function getUpdateColumns(): array {\n return ['appointment_id', 'create_time', 'update_time', 'state', 'tax_rate',\n 'amount_due', 'amount_payed', 'discount_rate'];\n }", "public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }", "public function getAllUncostedAudits() {\n\t\t$uncosted_audits = array();\n\t\tif($result = $this->db->query(sprintf('\n\t\t\tSELECT\n\t\t\t\t`audit`.*\n\t\t\tFROM `%1$s`.`audit`\n\t\t\tWHERE `audit`.`audit_cost` = \"0\";\n\t\t',\n\t\t\tDB_PREFIX.'audit'\n\t\t))) {\n\t\t\twhile($row = $result->fetch_object()) {\n\t\t\t\t$uncosted_audits[] = $row;\n\t\t\t}\n\t\t\t$result->close();\n\t\t}\n\t\treturn($uncosted_audits);\n\t}", "function WriteAuditTrailDummy($typ) {\n\t\t$table = 'scholarship_package';\n\t $usr = CurrentUserID();\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\n\t}", "public function activities()\n {\n return $this->morphMany(Config::get('auditing.activity'), 'auditable');\n }", "public function setHeader() {\n $dt = date('j M, Y');\n $name_header = '';\n $ao = new Application_Model_DbTable_AuditOwner();\n if ($this->usertype != '') {\n $name_header = \"&nbsp {$this->userfullname}\";\n }\n $complete_user = array('ADMIN','USER','APPROVER');\n $complete_audit = '';\n $audit_id = $this->audit['audit_id'];\n logit(\"audit: \" . print_r($this->audit, true));\n $complete_audit .= <<<\"END\"\n<li class=\"divider\"></li>\n<li class=\"tri\"><span style=\"color:black;padding-left: 15px;\"> With Selected Audit:</span></li>\nEND;\n\n # incomplete and owned audit OR not incomplete audit can be viewed\n if (($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) || $this->audit['status'] != 'INCOMPLETE') {\n $complete_audit .= <<<\"END\"\n<!li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/view\"><span title=\".icon .icon-color .icon-book \" class=\"icon icon-color icon-book\"></span> View Audit</a></li>\nEND;\n }\n # only incomplete and owned audit can be edited\n if ($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) {\n $complete_audit .= <<<\"END\"\n<!--li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/edit/\"><span title=\".icon .icon-color .icon-edit \" class=\"icon icon-color icon-edit\"></span> Edit Audit</a></li>\nEND;\n }\n if (in_array($this->usertype, $complete_user)) {\n $complete_audit .= <<<\"END\"\n<!--li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/exportdata\"><span title=\".icon .icon-color .icon-extlink \" class=\"icon icon-color icon-extlink\"></span> Export Audit Data</a></li>\nEND;\n if ($this->audit['owner']) {\n # $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/delete\"\n onclick=\" return confirm('Do you want to delete Selected Audit?');\">\n <span title=\".icon .icon-color .icon-trash \" class=\"icon icon-color icon-trash\"></span>\n Delete Audit</a></li>\nEND;\n }\n $complete_audit .= <<<\"END\"\n<li class=\"divider\"></li>\n<li class=\"tri\"><span style=\"color:black;padding-left: 15px;\"> Change Audit State:</span></li>\nEND;\n if ($this->audit['status'] == 'INCOMPLETE' && $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/complete\">\n<span title=\".icon .icon-color .icon-locked \" class=\"icon icon-color icon-locked\"></span> Mark Audit Complete</a></li>\nEND;\n }\n if ($this->audit['status'] == 'COMPLETE' && $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/incomplete\">\n<span title=\".icon .icon-color .icon-unlocked \" class=\"icon icon-color icon-unlocked\"></span> Mark Audit Incomplete</a></li>\nEND;\n }\n if ($this->audit['status'] == 'COMPLETE' && $this->usertype == 'APPROVER') {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/finalize\"\nonclick=\" return confirm('Do you want to finalize Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');\"><span title=\".icon .icon-color .icon-sent \" class=\"icon icon-color icon-sent\"></span> Mark Audit Finalized</a></li>\n<li><a href=\"{$this->baseurl}/audit/reject\"\n onclick=\" return confirm('Do you want to reject Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');\"><span title=\".icon .icon-color .icon-cross \" class=\"icon icon-color icon-cross\"></span> Mark Audit Rejected</a></li>\nEND;\n }\n }\n $this->header = <<<\"END\"\n<div class=\"navbar\">\n <div class=\"navbar-inner\">\n <div class=\"container-fluid\">\n <a class=\"brand\" href=\"{$this->baseurl}{$this->mainpage}\">\n <span title=\".icon .icon-black .icon-check \" class=\"icon icon-black icon-check\"></span> <span>eChecklist</span>\n </a>\nEND;\n $newuser = '';\n if ($this->usertype != '') {\n if ($this->usertype == 'ADMIN') {\n $newuser = <<<\"END\"\n<li><a href=\"{$this->baseurl}/user/create\">\n<span title=\".icon .icon-green .icon-user \" class=\"icon icon-green icon-user\"></span> New User</a></li>\nEND;\n }\n\n $this->header = $this->header . <<<\"END\"\n<div class=\"btn-group pull-left\" style=\"margin-left:100px;\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-blue .icon-clipboard \" class=\"icon icon-blue icon-clipboard\"></span>\n <span class=\"hidden-phone\">Audit</span>\n <span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\nEND;\n if (in_array($this->usertype, $complete_user)) {\n $this->header .= <<<\"END\"\n <li><a href=\"{$this->baseurl}/audit/create\"><span title=\".icon .icon-green .icon-clipboard \" class=\"icon icon-green icon-clipboard\"></span> New Audit</a></li>\nEND;\n }\n $this->header .= <<<\"END\"\n <li><a href=\"{$this->baseurl}/audit/search\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Search for Audit</a></li>\n{$complete_audit}\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/audit/runreports\"><span title=\".icon .icon-color .icon-newwin \" class=\"icon icon-color icon-newwin\"></span> Run Reports</a></li>\nEND;\n\n if (in_array($this->usertype, $complete_user)) {\n $this->header .= <<<\"END\"\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/audit/import\"><span title=\".icon .icon-blue .icon-import \" class=\"icon icon-blue icon-archive\"></span> Import Audit</a></li>\nEND;\n }\n $this->header .= <<<\"END\"\n</ul>\n</div>\n\n<div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-blue .icon-tag \" class=\"icon icon-blue icon-tag\"></span>\n <span class=\"hidden-phone\">Lab</span>\n <span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/lab/create\"><span title=\".icon .icon-green .icon-tag \" class=\"icon icon-green icon-tag\"></span> New Lab</a></li>\n <li><a href=\"{$this->baseurl}/lab/select\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Select a Lab</a></li>\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/lab/edit\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Edit Selected Lab</a></li>\n</ul>\n</div>\n\n<div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n<span title=\".icon .icon-blue .icon-user \" class=\"icon icon-blue icon-user\"></span>\n<span class=\"hidden-phone\">User</span>\n<span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n {$newuser}\n <li><a href=\"{$this->baseurl}/user/find\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span>Find User</a></li>\n</ul>\n</div>\n\n<!--div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n<span title=\".icon .icon-blue .icon-flag \" class=\"icon icon-blue icon-flag\"></span>\n<span class=\"hidden-phone\">Language</span>\n<span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/language/switch/EN\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> English</a></li>\n <li><a href=\"{$this->baseurl}/language/switch/FR\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> French</a></li>\n <li><a href=\"{$this->baseurl}/language/switch/VI\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> Vietnamese</a></li>\n</ul>\n</div-->\n\n<!-- user dropdown starts -->\n<div class=\"btn-group pull-right\">\n <a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-orange .icon-user \" class=\"icon icon-orange icon-user\"></span>\n <span class=\"hidden-phone\"> {$name_header}</span>\n\t<span class=\"caret\"></span>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/user/profile\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Profile</a></li>\n <li><a href=\"{$this->baseurl}/user/changepw\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Change Password</a></li>\n <li class=\"divider\"></li>\n\t<li><a href=\"{$this->baseurl}/user/logout\">Logout</a></li>\n </ul>\n</div>\n<!-- user dropdown ends -->\nEND;\n $auditinfo = '';\n //if ($this->dialog_name == 'audit/edit') {\n $auditinfo = \"<div style=\\\"margin:6px 0 6px 20px;padding-right:5px;\\\">Selected Audit: {$this->showaudit}</div>\";\n //}\n $this->header .= <<<\"END\"\n<div style=\"display:inline-block;\">\n <div style=\"margin:6px 0px 6px 20px;padding-right:5px;\">Selected Lab: {$this->showlab}</div>\n {$auditinfo}\n <div style=\"clear:both;\"></div></div>\nEND;\n } else {\n $this->header = $this->header . <<<\"END\"\n<div class=\"btn-group pull-left\" style=\"margin-left:100px;\">\n<a class=\"btn\" href=\"{$this->baseurl}/user/login\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Login</a></div>\nEND;\n }\n $this->header = $this->header . <<<\"END\"\n </div>\n </div> <!-- style=\"clear:both;\"></div -->\n</div>\nEND;\n\n $this->view->header = $this->header;\n }", "function get_sortable_columns()\n {\n $sortable_columns = array(\n \n 'timestamp' => array('timestamp', true),\n );\n\n return $sortable_columns;\n }", "function prepareModificationLog() {\n try {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n DB::execute(\"CREATE TABLE IF NOT EXISTS \" . TABLE_PREFIX . \"modification_logs (\n id bigint(20) unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL default 'ApplicationObjectModification',\n parent_type varchar(50) NOT NULL default '',\n parent_id int(11) unsigned NOT NULL default '0',\n created_on datetime default NULL,\n created_by_id int(10) unsigned NOT NULL default '0',\n created_by_name varchar(100) default NULL,\n created_by_email varchar(150) default NULL,\n is_first tinyint(1) NOT NULL default '0',\n PRIMARY KEY (id),\n KEY parent_type (parent_type,parent_id),\n KEY created_on (created_on)\n ) ENGINE=$engine DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE IF NOT EXISTS \" . TABLE_PREFIX . \"modification_log_values (\n modification_id bigint(20) unsigned NOT NULL default '0',\n field varchar(50) NOT NULL default '',\n value longtext,\n PRIMARY KEY (modification_id,field)\n ) ENGINE=$engine DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "function feature_model_detail_list_table_visible_columns(String $table) {\n\n $model = $this->CI->grants->load_detail_model($table);\n\n $detail_list_table_visible_columns = [];\n \n if(method_exists($this->CI->$model,'detail_list_table_visible_columns') && \n is_array($this->CI->$model->detail_list_table_visible_columns())\n ){\n $detail_list_table_visible_columns = $this->CI->$model->detail_list_table_visible_columns();\n \n //Add the table id columns if does not exist in $columns\n if(is_array($detail_list_table_visible_columns) && \n !in_array($this->CI->grants->primary_key_field($table),$detail_list_table_visible_columns)){\n array_unshift($detail_list_table_visible_columns,$this->CI->grants->primary_key_field($table));\n }\n\n //Remove status and approval columns if the approveable item is not approveable\n if(!$this->CI->grants_model->approveable_item($table)) {\n $this->CI->grants->remove_mandatory_lookup_tables($detail_list_table_visible_columns,['status_name','approval_name']);\n }else{\n $this->CI->grants->add_mandatory_lookup_tables($detail_list_table_visible_columns,['status_name','approval_name']);\n }\n \n }\n \n return $detail_list_table_visible_columns;\n }", "public function log_activity() {\n \n \n $CI =& get_instance();\n $CI->load->library('audit_trail');\n // Start off with the session stuff we know\n $data = array();\n $data['user_id'] = $CI->session->userdata('user_id');\n \n // Next up, we want to know what page we're on, use the router class\n $data['section'] = $CI->router->class;\n $data['action'] = $CI->router->method;\n \n // Lastly, we need to know when this is happening\n $data['when'] = date('Y-m-d G:i:s');\n \n // We don't need it, but we'll log the URI just in case\n $data['uri'] = uri_string();\n $path = realpath(APPPATH);\n // And write it to the database\n if($CI->router->method!='checkPortal' && $CI->router->method!='getAttendanceUpdates' && $CI->router->method!='getAverageDailyAttendance'):\n $CI->audit_trail->lfile($path.'/modules/logs/'.$CI->session->userdata('user_id').'.txt');\n $CI->audit_trail->lwrite($CI->session->userdata('name').' access '.$CI->router->method.' through '. uri_string().'.' , 'TRACE');\n endif;\n }", "function &columns() {\n // return by reference\n //ts('Contact Id') => 'contact_id',\n $columns = array(\n ts('Name') => 'sort_name',\n ts('Job Title') => 'job_title',\n ts('media') => 'current_employer',\n );\n return $columns;\n }" ]
[ "0.58903563", "0.5804952", "0.5765722", "0.5761494", "0.5751377", "0.5745253", "0.57414013", "0.57055414", "0.5587757", "0.55292755", "0.55138564", "0.5485987", "0.54815865", "0.54543823", "0.5400708", "0.5376485", "0.536115", "0.5356386", "0.5327246", "0.5315218", "0.5303601", "0.5302488", "0.5292043", "0.5257856", "0.52357364", "0.52075505", "0.51980007", "0.5187203", "0.5133463", "0.5113729", "0.51134527", "0.51113516", "0.51113266", "0.51085824", "0.5107341", "0.51004857", "0.50808865", "0.5071195", "0.5069174", "0.5068744", "0.50641847", "0.50550103", "0.5050587", "0.5049784", "0.5048194", "0.50457567", "0.50321203", "0.5026497", "0.50205415", "0.5016945", "0.50134146", "0.4993265", "0.49908188", "0.4990086", "0.49765497", "0.49696898", "0.49592146", "0.4951435", "0.49512243", "0.4948937", "0.49452138", "0.49432844", "0.49289346", "0.4919923", "0.48996764", "0.48833638", "0.48801136", "0.48756766", "0.48718953", "0.48701778", "0.48692966", "0.48618382", "0.48592553", "0.48547247", "0.4852403", "0.48484", "0.48469856", "0.48420033", "0.48415926", "0.48361003", "0.48172203", "0.48170355", "0.48152635", "0.48091364", "0.48070735", "0.47883332", "0.47871155", "0.47775123", "0.47718534", "0.4770669", "0.47669363", "0.4762783", "0.47582158", "0.47552046", "0.47515386", "0.4744495", "0.4740734", "0.47405842", "0.47379166", "0.47378737", "0.47376043" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search($options = array()) { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('old_value',$this->old_value,true); $criteria->compare('new_value',$this->new_value,true); $criteria->compare('action',$this->action,true); $criteria->compare('model',$this->model); $criteria->compare('field',$this->field,true); $criteria->compare('stamp',$this->stamp,true); $criteria->compare('username',$this->username); $criteria->compare('model_id',$this->model_id); $criteria->order='t.id desc'; $criteria->mergeWith($this->getDbCriteria()); return new CActiveDataProvider( get_class($this), array_merge( array( 'criteria'=>$criteria, ), $options ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.5979308", "0.5970091", "0.59315383", "0.5928182", "0.59239197", "0.5891605", "0.588925", "0.5849558", "0.58478904", "0.58265656", "0.5818011", "0.5813345", "0.5808009", "0.5790819", "0.57766616", "0.57694167", "0.5765023", "0.57642305", "0.57522315", "0.5740738", "0.5738047", "0.5727545", "0.5724201", "0.5723084", "0.57225823", "0.5721401", "0.5718913", "0.5714439", "0.5712011", "0.5707315", "0.5694636", "0.5680138", "0.56711453", "0.5670484", "0.56703377", "0.56703377", "0.56703377", "0.5669673", "0.56673825", "0.56659126", "0.5656451", "0.5651109", "0.56498116", "0.564325", "0.5635642", "0.5633513", "0.56310356", "0.56235486", "0.56176996", "0.5612909", "0.560956", "0.5595046", "0.5579938", "0.557241", "0.5556209", "0.5550101", "0.55487776", "0.5547998", "0.5547349", "0.5535324", "0.5534813", "0.55342954", "0.55319065", "0.5525128", "0.55199116", "0.5518253", "0.55144674", "0.5509604", "0.55057275", "0.550087", "0.550019", "0.54966915", "0.54966915", "0.54966915", "0.54954666", "0.54937917", "0.5492664", "0.5492298", "0.5490264", "0.5489261", "0.54850507" ]
0.0
-1
Display a listing of the resource.
public function index() { $fuels = Fuel::all(); $generators = Generator::where('status', 0)->get(); $assets = Asset::where('status', 0)->get(); return view('Generator.index',compact('generators', 'assets', 'fuels')); }
{ "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() { $generators = Generator::where('status', 0)->get(); $assets = Asset::where('status', 0)->get(); return view('Generator.index',compact('generators')); }
{ "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) { $validatedData = $request->validate([ 'model' => 'required', 'capacity' => 'required', 'manufacturing_date' => 'required', 'first_used_date' => 'required', 'first_odometer' => 'required', 'asset_id' => 'required', ]); $generator = new Generator(); $generator->model = $request['model']; $generator->capacity = $request['capacity']; $generator->manufacturing_date = $request['manufacturing_date']; $generator->first_used_date = $request['first_used_date']; $generator->first_odometer = $request['first_odometer']; $generator->asset_id = $request['asset_id']; $generator->save(); activity()->log('Added new Generator '.$request['model'].' capacity '.$request['capacity']); return redirect()->route('generator.index')->with('success','Generator added successfully.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $generators = Generator::find($id); $receivings = Receiving::all(); $receivedId = $generators->receiving_id; return view('Generator.show',compact('generators', 'receivings')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $generator = Generator::find($id); $generator_asset_id = $generator->asset_id; $generator_asset = Asset::find($generator_asset_id); $assets = Asset::all(); // $vehicled_driver_id = $vehicle->driver_id; // $vehicled_driver = Driver::find($vehicled_driver_id); // $drivers = Driver::all(); return view('Generator.edit',compact('generator','generator_asset','assets','generator')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $validatedData = $request->validate([ 'model' => 'required', 'capacity' => 'required', 'manufacturing_date' => 'required', 'first_used_date' => 'required', 'first_odometer' => 'required', /* 'asset_id' => 'required', */ ]); $generator = Generator::find($id); $generator_asset_id = $generator->asset_id; $generator->model = $request['model']; $generator->capacity = $request['capacity']; $generator->manufacturing_date = $request['manufacturing_date']; $generator->first_used_date = $request['first_used_date']; $generator->manufacturing_date = $request['manufacturing_date']; $generator->first_odometer = $request['first_odometer']; $generator_asset_id = $request['asset_id']; if($generator_asset_id !=NULL){ $generator->asset_id = $generator_asset_id; } $generator->save(); activity()->log('Edited Generator '.$request['model'].' informations with '.$request['capacity'].' capacity '); return redirect()->route('generator.index')->with('success', 'Generator updated successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $generator = Generator::find($id); activity()->log('Deleted Generator '.$generator->model.' with '.$generator->capacity.' capacity '); $generator->delete(); return redirect()->route('generator.index')->with('success', 'Generator deleted successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
The query report function
function report(&$irc, &$data) { global $adminchannel; global $users; $input = explode(" ", $data->message); //Report command - used by normal players to report another player to the admins if(strtolower(substr($data->message, 0, 7)) == "!report") { //If a nick was entered $input = explode(" ", $data->message); if($input[1] != "") { //If the user is in the channel if($users->is_added($users->nicktoqauth($input[1])) == true) { $reasoncheck = $input[0] . " " . $input[1]; $reason = str_replace($reasoncheck, "", $data->message); if($reason != "") { //Tell user the report is successful $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: The user has been successfully reported to the admins"); //Tell the admins in the admin channel $irc->message(SMARTIRC_TYPE_CHANNEL, $adminchannel, "\x02\x0304Report:\x02\x03 ".$data->nick." reported ".$input[1]." (via PM) for:".$reason); //Record in MySQL mysql_pu_addreport($data->nick, $input[1], $reason); } else { $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: Please enter a reason when attempting to report another player"); } } else { $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: The person you reported is not invited to this pickup, please double-check you entered the name correctly"); } } else { $irc->message(SMARTIRC_TYPE_QUERY, $data->nick, "\x0302,00Report: !report <nick> <reason>"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getReport() ;", "public function get_query_log()\n {\n }", "public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$_GET['rid'].\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\tparent:: reportListing($objRs);\n }", "public function test_queries()\n\t{\n\t\t$this->setup_options_obj($input);\n\t\t$rpt = new Reports_Model($this->options);\n\t\t$rpt->set_option('start_time', 0);\n\t\t$rpt->set_option('end_time', time());\n\t\t$result = $rpt->test_summary_queries();\n\t\techo \"<pre>\\n\";\n\t\t$cnt = count($result);\n\t\techo $cnt . \" total different queries\\n\";\n\t\t$total_rows = 0.0;\n\t\tforeach ($result as $query => $ary) {\n\t\t\techo $query . \"\\n\";\n\t\t\tprint_r($ary);\n\t\t\t$total_rows += $ary['rows'];\n\t\t}\n\t\t$avg_rows = $total_rows / $cnt;\n\t\techo \"Average row-count: $avg_rows\\n\";\n\t\techo \"</pre>\\n\";\n\t\tdie;\n\t}", "public function report()\n {\n \\Log::debug('Query failure');\n }", "public function getReport() {}", "public function getReport() {}", "protected function generateQueryReport()\n {\n $queryDetails = $this->getQueryDetails();\n if (count($queryDetails) === 0) {\n return '';\n }\n $queryInfo = '';\n foreach ($queryDetails as $query) {\n $sql = preg_replace('/[^%]%[^%]/', '%%', $query[ DFullProfiler::QUERY_SQL ]);\n $queryInfo .= sprintf(\"<tr><td>{$sql}</td><td class=\\\"good\\\">{$query[DFullProfiler::QUERY_COUNT]}</td><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">{$query[DFullProfiler::QUERY_AFFECTED_ROWS]}</td></tr>\",\n $query[ DFullProfiler::QUERY_EXECUTION_TIME ],\n $query[ DFullProfiler::QUERY_RETRIEVAL_TIME ],\n $query[ DFullProfiler::QUERY_PROCESSING_TIME ]);\n }\n\n return '<h2>Database Query Information</h2>'\n . '<table id=\"queries\">'\n . '<thead><tr><th style=\"width: 60%;\">SQL / Stored Procedure</th><th>Iterations</th><th>Execution Time</th><th>Result Retrieval Time</th><th>Processing Time</th><th>Affected Rows</th></tr></thead><tbody>'\n . $queryInfo\n . '</tbody></table>';\n }", "public static function getQueryLog()\n {\n }", "abstract public function buildReport();", "public function report()\n {\n }", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "function runReport (){\n\t\tif(!empty($this->params['form']))\n\t\t{\n\t\t\tif($this->params['form']=='allData'){\n\t\t\t\tindex();\n\t\t\t}else {\n\t\t\t\tindex();\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "public static function query()\n {\n }", "public function showHodReport()\n {\n $data = [];\n $query = \"\";\n\n if (!empty($_POST['academic_year'])) {\n $query .= \" academic_id = ? \";\n $this->acd_year = $this->verifyInput($_POST['academic_year']);\n $data[] = $this->acd_year;\n }\n if (!empty($_POST['year'])) {\n $query .= \" AND c.s_class_id = ? \";\n $this->year = $this->verifyInput($_POST['year']);\n $data[] = $this->year;\n }\n if (!empty($_POST['div'])) {\n $query .= \" AND c.div_id = ? \";\n $this->s_div = $this->verifyInput($_POST['div']);\n $data[] = $this->s_div;\n }\n if (!empty($_POST['sem_id']) || !empty($_POST['sem'])) {\n $query .= \" AND c.sem_id = ?\";\n $this->sem = isset($_POST['sem_id']) ? $this->verifyInput($_POST['sem_id']) : $this->verifyInput($_POST['sem']);\n $data[] = $this->sem;\n }\n if (!empty($_POST['class'])) {\n $query .= \" AND c.class_id = ? \";\n $this->class = $this->verifyInput($_POST['class']);\n $data[] = $this->class;\n }\n if ($_SESSION['role_id'] == 0) {\n if (isset($_POST['dept']) && !empty($_POST['dept'])) {\n $query .= \" AND c.dept_id = ? \";\n $this->dept = $this->verifyInput($_POST['dept']);\n $data[] = $this->dept;\n }\n } else if ($_SESSION['role_id'] == 1) {\n if (isset($_SESSION['dept'])) {\n $query .= \" AND c.dept_id = ? \";\n $this->dept = $this->verifyInput($_SESSION['dept']);\n $data[] = $this->dept;\n }\n } else {\n $query .= \" AND c.dept_id = ? \";\n $this->dept = $this->verifyInput($_SESSION['dept']);\n $data[] = $this->dept;\n }\n\n $result = $this->getStudentByDeptDivisionAndYear([$this->dept, $this->year, $this->s_div]);\n if (!$result) return json_encode(array(\"error\" => \"nostudent\"));\n\n if ((!empty($_POST['from-date']) && !empty($_POST['till-date'])) || ($_POST['from-date'] != \"\" && $_POST['till-date'] != \"\")) {\n $query .= \" AND DATE(date_time) >= DATE(?) AND DATE(date_time) <= DATE(?) \";\n $this->from_date = $this->verifyInput($_POST['from-date']);\n $this->till_date = $this->verifyInput($_POST['till-date']);\n $data[] = date('Y-m-d', strtotime($this->from_date));\n $data[] = date('Y-m-d', strtotime($this->till_date));\n\n $result = $this->getAttendanceByDate(\"date_time >= DATE(?) AND date_time <= DATE(?)\", [$this->dept, $this->year, $this->s_div, date('Y-m-d', strtotime($this->from_date)), date('Y-m-d', strtotime($this->till_date))]);\n\n if (!$result) return (array(\"error\" => \"noattend\"));\n } else if (!empty($_POST['from-date']) || $_POST['from-date'] != \"\") {\n $query .= \" AND DATE(date_time) >= DATE(?) \";\n $this->from_date = $this->verifyInput($_POST['from-date']);\n $data[] = date('Y-m-d', strtotime($this->from_date));\n $from_data = $this->getAttendanceByDate(\"DATE(date_time) >= DATE(?)\", [$this->dept, $this->year, $this->s_div, date('Y-m-d', strtotime($this->from_date))]);\n if (!$from_data) return (array(\"error\" => \"noattend\"));\n } else if (!empty($_POST['till-date']) || $_POST['till-date'] != \"\") {\n $query .= \" AND DATE(date_time) <= DATE(?) \";\n $this->till_date = $this->verifyInput($_POST['till-date']);\n $data[] = date('Y-m-d', strtotime($this->till_date));\n\n $till_data = $this->getAttendanceByDate(\"date_time <= DATE(?)\", [$this->dept, $this->year, $this->s_div, $this->sem_id, date('Y-m-d', strtotime($this->till_date))]);\n if (!$till_data) return (array(\"error\" => \"noattend\"));\n }\n\n $result = $this->getClassByYearDivisionAcademicAndDept([$_POST['academic_year'], $this->class, $this->s_div, $this->dept]);\n if (!$result) json_encode(array(\"error\" => \"noclass\"));\n else {\n //var_dump($_POST);\n //var_dump($query);\n $result = $this->getHodReportYearWise($query, $data);\n // if(empty($_POST['class_id'])){\n // $result = $this->getHodReportYearWise($query,$data);\n // }else{\n // $result[\"each_total\"], \"total\" => $result['total'], \"lectures\" =>$result['total_lectures']\n // } \n if (isset($result['e'])) return json_encode(array(\"error\" => \"notfound\"));\n return json_encode(array(\"error\" => \"none\", \"data\" => $result['report'], \"lectures\" => $result['lectures']));\n // if($from == 1 && $till == 1){\n // $query .= \" AND date_time >= DATE(?) AND date_time <= DATE(?) \";\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class,$_POST['form-date'],$_POST['till-date']]);\n // }else if($from == 1 && $till == 0){\n // $query .= \" AND date_time >= DATE(?) \";\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class,$_POST['form-date'], '9999-12-31']);\n // }else if($from = 0 && $till == 1){\n // $query .= \" AND date_time <= DATE(?) \";\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class,'0000-00-00',$_POST['till-date']]);\n // }else{\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class]);\n // }\n\n //return json_encode(array(\"error\" => \"none\",\"data\" => $result,\"total\" => $getTotal));\n }\n }", "public function basicreport()\n\t{\n\t\t\n\t\t$disp_msg = $this->session->flashdata('disp_msg');\n\t\t\n\t\t\n\t\t$search_filters = array();\n\t\t$search_results = array();\n\t\t\n\t\t$search_query = \"SELECT * FROM postpatch_schedule WHERE 1=1 \";\n\t\t\n\t\tif (!empty($_POST)) {\n\t\t\tif(!empty($_POST['dpa_flexinet_id']) && count($_POST['dpa_flexinet_id'])>0) {\n\t\t\t\t$dpavals = implode(\"' , '\", $_POST['dpa_flexinet_id']);\n\t\t\t\t$search_query .= \" AND dpa_flexinet IN ('\".$dpavals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['verificationstatus']) && count($_POST['verificationstatus'])>0) {\n\t\t\t\t$verfstatusvals = implode(\"' , '\", $_POST['verificationstatus']);\n\t\t\t\t$search_query .= \" AND verificationstatus IN ('\".$verfstatusvals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['scheduledate']) && count($_POST['scheduledate'])>0) {\n\t\t\t\t$scdvals = implode(\"' , '\", $_POST['scheduledate']);\n\t\t\t\t$search_query .= \" AND scheduledate IN ('\".$scdvals.\"') \";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$search_query_res = $this->commonclass->execute_rawquery($search_query);\n\t\t$search_results = $search_query_res->result_array();\n\t\t\n\t\t$dpa_emps = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(dpa_flexinet) as dpa_flexinet ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($dpa_emps)>0) {\n\t\t\tforeach($dpa_emps as $onedpa) {\n\t\t\t\t$search_filters['dpa'][] = $onedpa['dpa_flexinet'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$verf_status_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(verificationstatus) as verificationstatus ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($verf_status_res)>0) {\n\t\t\tforeach($verf_status_res as $oneverif) {\n\t\t\t\t$search_filters['verf_status'][] = $oneverif['verificationstatus'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$scheduledate_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(scheduledate) as scheduledate ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($scheduledate_res)>0) {\n\t\t\tforeach($scheduledate_res as $oneverif1) {\n\t\t\t\t$search_filters['scheduledates'][$oneverif1['scheduledate']] = ($oneverif1['scheduledate'] != \"0000-00-00\") ? $this->commonclass->dateformat1($oneverif1['scheduledate']) : \"00/00/0000\";\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t## ____________ Data sending to the template starts ____________ ##\n\t\t$data['disp_msg'] = $disp_msg; # display messages\n\t\t$data['search_filters'] = $search_filters; # search_filters\n\t\t$data['search_results'] = $search_results; # search_filters\n\t\t//$data['postpatch_uploads'] = $postpatch_uploads; # postpatch_schedule\n\t\t\n\t\t## ____________ Data sending to the template ends here ____________ ##\n\t\t\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/header', $data); # html view page\n\t\t$this->load->view('admin/report1-page', $data); # html view page\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/footer', $data); # html view page\n\t}", "public function query()\n {\n }", "public function query()\n {\n }", "public function query();", "public function query();", "public function query();", "public function processReports();", "public function query()\n\t{\n\t\t\n\t}", "abstract public function query();", "public function report()\n\t{\n \n \n $data[\"queen\"]= $this->queen_model->get_queen();\n if($data['queen']==null) {\n //error_no_queen_yet : 405\n $this->respond_errors(\"error no queen yet\",405);\n return;\n }\n $queen=$this->queen_model->mapper($data['queen']);\n\n $this->respond($queen,200);\n \n\n }", "public static function query();", "public function Generate_Report()\n\t{\n\t\t//\n\t\t// criteria start_date YYYYMMDD\n\t\t// criteria end_date YYYYMMDD\n\t\t// company_id\n\t\t//\n\t\ttry\n\t\t{\n\t\t\t$this->search_query = new Transaction_History_Report_Query($this->server);\n\n\t\t\t$data = new stdClass();\n\n\t\t\t// Save the report criteria\n\t\t\t$data->search_criteria = array(\n\t\t\t 'specific_date_MM' => $this->request->specific_date_month,\n\t\t\t 'specific_date_DD' => $this->request->specific_date_day,\n\t\t\t 'specific_date_YYYY' => $this->request->specific_date_year,\n\t\t\t 'company_id' => $this->request->company_id,\n\t\t\t 'loan_type' => $this->request->loan_type\n\t\t\t);\n\n\t\t\t$_SESSION['reports']['transaction_history']['report_data'] = new stdClass();\n\t\t\t$_SESSION['reports']['transaction_history']['report_data']->search_criteria = $data->search_criteria;\n\t\t\t$_SESSION['reports']['transaction_history']['url_data'] = array('name' => 'Transaction History', 'link' => '/?module=reporting&mode=transaction_history');\n\n\t\t\t// Start date\n\t\t\t$start_date_YYYY = $this->request->specific_date_year;\n\t\t\t$start_date_MM\t = $this->request->specific_date_month;\n\t\t\t$start_date_DD\t = $this->request->specific_date_day;\n\t\t\tif(!checkdate($start_date_MM, $start_date_DD, $start_date_YYYY))\n\t\t\t{\n\t\t\t\t//return with no data\n\t\t\t\t$data->search_message = \"Start Date invalid or not specified.\";\n\t\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$start_date_YYYYMMDD = 10000 * $start_date_YYYY\t+ 100 * $start_date_MM + $start_date_DD;\n\n\t\t\t$data->search_results = $this->search_query->Fetch_Transaction_History_Data( $start_date_YYYYMMDD,\n\t\t\t\t $this->request->loan_type,\n\t\t\t\t $this->request->company_id);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$data->search_message = \"Unable to execute report. Reporting server may be unavailable.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// we need to prevent client from displaying too large of a result set, otherwise\n\t\t// the PHP memory limit could be exceeded;\n\t\tif(!empty($data->search_results) && count($data->search_results) > $this->max_display_rows)\n\t\t{\n\t\t\t$data->search_message = \"Your report would have more than \" . $this->max_display_rows . \" lines to display. Please narrow the date range.\";\n\t\t\tECash::getTransport()->Set_Data($data);\n\t\t\tECash::getTransport()->Add_Levels(\"message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Sort if necessary\n\t\t$data = $this->Sort_Data($data);\n\n\t\tECash::getTransport()->Add_Levels(\"report_results\");\n\t\tECash::getTransport()->Set_Data($data);\n\t\t$_SESSION['reports']['transaction_history']['report_data'] = $data;\n\t}", "public function getQuery($params) { $report_id = $params['id']; // user-facing call - lookup query by record id\n $username = isset($params['username']) ? $params['username'] : USERID;\n \n $pid = isset($params['project_id']) ? $params['project_id'] : $this->currentPID;\n // get sql query from REDCap record\n\n if(!isset($params['query'])) {\n $data = \\REDCap::getData(array(\n 'project_id' => $this->configPID,\n 'return_format' => 'json',\n 'records' => $report_id,\n 'fields' => 'report_sql'\n ));\n\n \n $sql = json_decode($data, true)[0]['report_sql'];\n } else {\n \n $sql = $params['query'];\n }\n\n if (!isset($params['token'])) {\n $sql = \\Piping::pipeSpecialTags($sql, $pid, null, null, null, $username);\n }\n\n $formattedSql = htmlentities(strip_tags($sql), ENT_QUOTES, 'UTF-8');\n\n echo $formattedSql;\n }", "function query() {\n }", "abstract protected function query(Export $export);", "public function Query() {\n \n }", "public function _query()\n {\n }", "public function gatherSQLQueryData()\n {\n $queryTotals = array();\n\n $queryTotals['count'] = 0;\n $queryTotals['time'] = 0;\n\n $queries = array();\n\n if(isset($this->connection)) {\n $queryLog = $this->connection->getQueryLog();\n\n $queryTotals['count'] += count($queryLog);\n\n foreach($queryLog as $query) {\n if(isset($query['bindings']) && ! empty($query['bindings'])) {\n $query['sql'] = PdoDebugger::show($query['query'], $query['bindings']);\n } else {\n $query['sql'] = $query['query'];\n }\n\n $query = $this->attemptToExplainQuery($query);\n\n $queryTotals['time'] += $query['time'];\n\n $query['time'] = $this->getReadableTime($query['time']);\n\n //\n $queries[] = $query;\n }\n }\n\n $queryTotals['time'] = $this->getReadableTime($queryTotals['time']);\n\n $this->output['queries'] = $queries;\n $this->output['queryTotals'] = $queryTotals;\n }", "public function makeReport()\n {\n }", "public function Query(){\n\t}", "public function Query(){\n\t}", "public function Query(){\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 report()\n {\n // TODO: Implement report() method.\n }", "function query() {}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM patient_info';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function printquery(){\n\t\techo $this->query.\";\";\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_coverage';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "abstract public function extractReportDatas();", "function createQuery() ;", "public static function getReportHome()\n {\n$data = User::findBySql(\"SELECT COUNT(ei.ei_id) as totalstudent, i.*,ei.ei_graduation_year FROM university u \".\n \"JOIN institution i on u.uni_id = i.uni_id \".\n \"JOIN education_information ei on i.inst_id = ei.inst_id \".\n \"WHERE ei.ei_graduation_year BETWEEN '2010' AND '2014' AND u.uni_status = '1' \".\n \"AND i.inst_status = '1' GROUP BY ei.inst_id,ei.ei_graduation_year\")\n ->asArray()\n ->all();\n\n return $data;\n }", "public function data_report($id){\n\t\t\t//Obtenemos la base de datos que debemos consultar\n\t\t\tif(empty($this->session->userdata['logged_in']['name_db']))\n\t\t\t\treturn false;\n\t\t\telse{\n\t\t\t\t//Accedemos a la base de datos correcta \n\t\t\t\t$this->personal_db = $this->load->database('personal', TRUE);\n\t\t\t\t$this->personal_db->select('*');\n\t\t\t\t$this->personal_db->from('reports');\n\t\t\t\t$this->personal_db->where(\"autoid = '\".$id.\"'\");\n\n\t\t\t\t$query = $this->personal_db->get();\n\t\t\t\t//var_dump($query->result());die;\n\t\t\t\tif($query->num_rows() > 0)\n\t\t\t\t\treturn $query->result();\n\t\t\t\telse \n\t\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t}", "public function buildReport()\n\t{\n\t\t$this->_arrReportData = array();\n\t\t\n\t\t$intSaleStatusIdVerified\t= DO_Sales_SaleStatus::VERIFIED;\n\t\t\n\t\t$strSaleStatusesToConsider = implode(\", \", $this->_arrStatuses);\n\t\t\n\t\t$strQuery = \"\nSELECT \ts.id AS sale_id,\n\t\ts.sale_type_id AS sale_type_id,\n\t\ts.created_by AS created_by,\n\t\tverified_details.changed_on AS verified_on,\n\t\tverified_details.changed_by AS verified_by,\n\n\t\tcurrent_details.sale_status_id AS current_status_id,\n\t\tcurrent_details.changed_on AS current_status_changed_on,\n\t\tcurrent_details.changed_by AS current_status_changed_by,\n\t\tcurrent_details.description AS current_status_description,\n\n\t\tsa.business_name AS business_name,\n\t\tsa.external_reference AS account_external_reference,\n\t\tsa.vendor_id AS vendor_id\n\t\t\nFROM \tsale AS s\n\t\tLEFT JOIN sale_status_history AS verified_details /* The sale doesn't necesserily have to have been verified */\n\t\t\tON \ts.id = verified_details.sale_id \n\t\t\t\tAND verified_details.sale_status_id = $intSaleStatusIdVerified\n\t\tINNER JOIN sale_account AS sa\n\t\t\tON sa.sale_id = s.id\n\t\tINNER JOIN \n\t\t\t(\n\t\t\t\t/* This table defines details of the current state of the sale */\n\t\t\t\tSELECT\tsale_status_history.sale_status_id AS sale_status_id, \n\t\t\t\t\t\tsale_status_history.changed_on AS changed_on,\n\t\t\t\t\t\tsale_status_history.changed_by AS changed_by,\n\t\t\t\t\t\tsale_status_history.description AS description,\n\t\t\t\t\t\tsale_status_history.sale_id AS sale_id\n\t\t\t\tFROM\tsale_status_history\n\t\t\t\t\t\tINNER JOIN \n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t/* This finds the id of the most recent sale_status_history record, for each sale_id */\n\t\t\t\t\t\t\t\tSELECT sale_id, MAX(id) AS id \n\t\t\t\t\t\t\t\tFROM sale_status_history\n\t\t\t\t\t\t\t\tGROUP BY sale_id\n\t\t\t\t\t\t\t) AS newest_sale_status_record\n\t\t\t\t\t\t\t\tON sale_status_history.id = newest_sale_status_record.id\n\t\t\t\tWHERE sale_status_history.sale_status_id IN ($strSaleStatusesToConsider) /* This constraint is far more efficient when placed here instead of in the outer most WHERE clause */\n\t\t\t) AS current_details\n\t\t\t\tON s.id = current_details.sale_id\n\nORDER BY vendor_id ASC, sale_id ASC\n\";\n\n\t\t// Convert new line chars to spaces, and remove all tabs\n\t\t$strQuery = str_replace(\"\\n\", \" \", $strQuery);\n\t\t$strQuery = str_replace(\"\\t\", \" \", $strQuery);\n\t\t\n\t\t$dsSales = DO_Sales_Sale::getDataSource();\n\n\t\t// Cache data that will be used repeatedly\n\t\t$arrDealerCarriers\t= Carrier::listForCarrierTypeId(CARRIER_TYPE_SALES_CALL_CENTRE);\n\t\t$arrVendors\t\t\t= DO_Sales_Vendor::getAll();\n\t\tforeach ($arrVendors as &$doVendor)\n\t\t{\n\t\t\tif ($doVender->coolingOffPeriod === NULL)\n\t\t\t{\n\t\t\t\t$doVender->coolingOffPeriod = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$arrSaleStatuses\t= DO_Sales_SaleStatus::getAll();\n\t\t$arrSaleTypes\t\t= DO_Sales_SaleType::getAll();\n\t\t$arrDealers\t\t\t= array();\n\t\t\n\t\t// Execute the query\n\t\tif (MDB2::isError($objResults = $dsSales->query($strQuery)))\n\t\t{\n\t\t\tthrow new Exception(\"Failed to execute OutstandingSales Report Query, using query: $strQuery - \". $objResults->getMessage());\n\t\t}\n\t\n\t\twhile ($arrRecord = $objResults->fetchRow(MDB2_FETCHMODE_ASSOC))\n\t\t{\n\t\t\t// Work out the account Id\n\t\t\tif ($arrRecord['account_external_reference'] !== NULL && preg_match('/^Account.Id=\\d+$/', $arrRecord['account_external_reference']))\n\t\t\t{\n\t\t\t\t// The account is now in flex, retrieve the id\n\t\t\t\t$intAccountId = intval(str_replace('Account.Id=', '', $arrRecord['account_external_reference']));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$intAccountId = NULL;\n\t\t\t}\n\t\t\t\n\t\t\t// Find out who created the sale\n\t\t\tif (!array_key_exists($arrRecord['created_by'], $arrDealers))\n\t\t\t{\n\t\t\t\t$arrDealers[$arrRecord['created_by']] = Dealer::getForId($arrRecord['created_by'], TRUE);\n\t\t\t}\n\t\t\t$objCreatedByDealer = $arrDealers[$arrRecord['created_by']];\n\t\t\t\n\t\t\t// Find out who verified the sale, if it has been verified\n\t\t\tif ($arrRecord['verified_by'] !== NULL)\n\t\t\t{\n\t\t\t\t// The sale has been verified\n\t\t\t\tif (!array_key_exists($arrRecord['verified_by'], $arrDealers))\n\t\t\t\t{\n\t\t\t\t\t$arrDealers[$arrRecord['verified_by']] = Dealer::getForId($arrRecord['verified_by'], TRUE);\n\t\t\t\t}\n\t\t\t\t$objVerificationDealer = $arrDealers[$arrRecord['verified_by']];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The sale has not been verified\n\t\t\t\t$objVerificationDealer = NULL;\n\t\t\t}\n\n\t\t\t// Find out who performed the most recent status change on the sale_item\n\t\t\tif (!array_key_exists($arrRecord['current_status_changed_by'], $arrDealers))\n\t\t\t{\n\t\t\t\t$arrDealers[$arrRecord['current_status_changed_by']] = Dealer::getForId($arrRecord['current_status_changed_by'], TRUE);\n\t\t\t}\n\t\t\t$objLatestChangeDealer = $arrDealers[$arrRecord['current_status_changed_by']];\n\n\t\t\t// Add all the information to the record\n\t\t\t$arrDetails['VendorName']\t\t\t\t= $arrVendors[$arrRecord['vendor_id']]->name;\n\t\t\t$arrDetails['SaleId']\t\t\t\t\t= $arrRecord['sale_id'];\n\t\t\t$arrDetails['SaleTypeName']\t\t\t\t= $arrSaleTypes[$arrRecord['sale_type_id']]->name;\n\t\t\t$arrDetails['CreatedBy']\t\t\t\t= $objCreatedByDealer->username;\n\t\t\t$arrDetails['DealerCarrier']\t\t\t= $arrDealerCarriers[$objCreatedByDealer->carrierId]->name;\n\t\t\t$arrDetails['AccountName']\t\t\t\t= $arrRecord['business_name'];\n\t\t\t$arrDetails['AccountId']\t\t\t\t= $intAccountId;\n\t\t\t$arrDetails['VerifiedOn']\t\t\t\t= $arrRecord['verified_on'];\n\t\t\t$arrDetails['VerifiedBy']\t\t\t\t= ($objVerificationDealer !== NULL)? $objVerificationDealer->username : NULL;\n\n\t\t\t$arrDetails['CurrentStatusName']\t\t= $arrSaleStatuses[$arrRecord['current_status_id']]->name;\n\t\t\t$arrDetails['CurrentStatusTimestamp']\t= $arrRecord['current_status_changed_on'];\n\t\t\t$arrDetails['CurrentStatusSetBy']\t\t= $objLatestChangeDealer->username;\n\t\t\t$arrDetails['CurrentStatusDescription']\t= $arrRecord['current_status_description'];\n\n\t\t\t$this->_arrReportData[] = $arrDetails;\n\t\t}\n\t\treturn count($this->_arrReportData);\n\t}", "function summary_query() {\r\n $this->get_query_fields();\r\n \r\n // No way to do summaries on more than one field at a time.\r\n if (count($this->query_fields) > 1) {\r\n return;\r\n }\r\n \r\n $field = $this->query_fields[0]['field'];\r\n $date_handler = $this->query_fields[0]['date_handler'];\r\n \r\n // Get the SQL format for this granularity, like Y-m,\r\n // and use that as the grouping value.\r\n $format = $date_handler->views_formats($this->options['granularity'], 'sql');\r\n $this->formula = $date_handler->sql_format($format, $date_handler->sql_field($field['fullname']));\r\n \r\n // Add the computed field.\r\n $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $this->formula, $field['query_name']);\r\n \r\n return $this->summary_basics(FALSE);\r\n }", "function report()\n {\n if ($this->acl->otentikasi2($this->title) == TRUE){\n $cur = $this->input->post('ccurrency');\n $start = $this->input->post('start');\n $end = $this->input->post('end');\n\n $data['currency'] = $cur;\n $data['start'] = tglin($start);\n $data['end'] = tglin($end);\n $data['rundate'] = tglin(date('Y-m-d'));\n $data['log'] = $this->decodedd->log;\n\n // Property Details\n $data['company'] = $this->properti['name'];\n\n $result = null;\n foreach ($this->model->report($cur,$start,$end)->result() as $res) {\n $result[] = array (\"id\"=>$res->id, \"no\"=>$res->no, \"notes\"=>$res->notes, \"dates\"=>tglin($res->dates), \n \"currency\"=>$res->currency, \"from\"=>$this->get_acc($res->from), \"to\"=>$this->get_acc($res->to), \n \"posted\"=>$res->approved, \"amount\"=>$res->amount);\n }\n $data['result'] = $result; $this->output = $data;\n }else { $this->reject_token(); }\n $this->response('content');\n }", "public static function enableQueryLog()\n {\n }", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public abstract function get_query();", "public function reportListing_default()\n {\n\t$defaultreportnames = $this->reportNames(); $rid = $defaultreportnames->fetch_object();\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$rid->report_id.\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\treturn $objRs;\n }", "private function basicReport()\n {\n return $this->report->count();\n }", "abstract protected function get_reports( $args = array() );", "function logs_tbl()\n {\n // SELECT \n }", "public static function createDataReporter($query){\n\t\t$canalRepo = new CanalRepo();\n\t\t$canales = $canalRepo->find(array(\n\t\t\t'limit' => '0,1100'\n\t\t));\n\t\t$reporteRepo = new ReporteRepo();\n\t\t$reportes = $reporteRepo->find($query);\n\t\t$reportes->transform(function($reporte,$index) use ($canales){\n\t\t\t$reporte->canal = $canales->where('id',$reporte->canal)->first();\n\t\t\treturn $reporte;\n\t\t});\n\t\treturn $reportes;\n\t}", "Function report1(){\n\n\t}", "Function report1(){\n\n\t}", "public function Query(){\r\n\t\treturn self::get_query();\r\n\t}", "public function queryAction()\n {\n $this->logger = Zend_Registry::get('logger');\n $this->getHelper('ViewRenderer')->setNoRender('false');\n $this->_helper->layout()->disableLayout();\n try {\n if ($this->getRequest()->isPost()) {\n $this->logger->log('Post Parameters Received', Zend_Log::INFO,\n 'PASS');\n $data = $this->getRequest()->getPost();\n if (! $data['complain_type'] || ! $data['district_id'] || ! $data['date']) {\n throw new Exception('Bad Parameters', '400');\n }\n $model = new Model_DbTable_Complain();\n $response = $model->getComplainsByCondition($data);\n if ($response) {\n $this->getResponse()->setHttpResponseCode(200);\n $this->logger->log('Succesful QueryPerformed', Zend_Log::INFO,\n 'SUCCESS');\n $xml = $model->xmlConverter($response);\n print $xml;\n } else {\n throw new Exception('Service Unavailable', '503');\n }\n } else {\n throw new Exception('Bad Parameters', '400');\n }\n } catch (Exception $e) {\n $this->getResponse()->setHttpResponseCode($e->getCode());\n if ($e->getCode() == 503) {\n $this->logger->log($e->getMessage(), Zend_Log::WARN,\n 'SYSTEM ERROR');\n } else {\n $this->logger->log($e->getMessage(), Zend_Log::ERR, 'QUERY: ERROR');\n }\n $this->_response->setHttpResponseCode($e->getCode()); \n print 0;\n }\n }", "private function beginQuery() {\n $this->sql = 'SELECT sum(inv_total_cost) as total_cost,id,businessname,email,businesstelephone,'\n . 'IFNULL((SELECT SUM(pfp_importo) as pfp_importo FROM plused_fincon_payments where find_in_set(plused_fincon_payments.pfp_bk_id,GROUP_CONCAT(derived_booking_invoice.inv_booking_id)) AND plused_fincon_payments.pfp_dare_avere =\"avere\" ),0) as pfp_import,'\n . 'ROUND((sum(inv_total_cost) - IFNULL((SELECT SUM(pfp_importo) as pfp_importo FROM plused_fincon_payments where find_in_set(plused_fincon_payments.pfp_bk_id,GROUP_CONCAT(derived_booking_invoice.inv_booking_id)) AND plused_fincon_payments.pfp_dare_avere =\"avere\" ),0)), 2) as overdue '\n . 'FROM (SELECT t.* FROM agnt_booking_invoice t INNER JOIN (SELECT inv_total_cost,MAX(inv_invoice_id) AS latest,inv_booking_id FROM agnt_booking_invoice GROUP BY inv_booking_id) t1 ON t1.inv_booking_id=t.inv_booking_id AND t1.latest=t.inv_invoice_id) AS derived_booking_invoice '\n . 'LEFT JOIN agenti ON agenti.id=derived_booking_invoice.inv_agent_id WHERE agenti.status=\"active\" ';\n }", "public function report($id)\n { \n $were = array('status'=>'1');\n $data['grades']= Grades::getbycondition($were);\n $data['years']= Years::getbycondition($were);\n $data['courses']= course::getoption();\n $data['countries']= country::getoption();\n $data['results']=User_test::getbyconditionpagination233(array('user_id'=>$id));\n foreach($data['results']['data'] as $key=>$dd)\n {\n $data['results']['data'][$key]['date'] = date('d/m/Y', strtotime($dd['test_date']));\n $were2 = [['test_id','=',$dd['id']],['suggested_answer','!=','']];\n $data['results']['data'][$key]['suggested'] = User_test_answers::getbycount($were2);\n $data['results']['data'][$key]['score'] = $dd['correct_answers'].'/'.$dd['total_questions'];\n $were1 = [['test_id','=',$dd['id']],['answer','!=','']];\n $data['results']['data'][$key]['attempt_answer'] = User_test_answers::getbycount($were1);\n } \n \n if(count($data['results']) < 1)\n {\n $data['results']['data'] = array();\n }\n $messags['message'] = \"Report data\";\n $messags['status']= 1; \n $messags['data']= $data;\n echo json_encode($messags);\n die;\n }", "function exeGetreport($payid) {\n if($this->uri->segment(5) != '') {\n $and = \" AND b.user_id = \".$this->db->escape($this->uri->segment(5)).\" \";\n } else {\n if($_SESSION['userLevel'] != 1 ) {\n $and = \" AND b.user_id = \".$this->db->escape($_SESSION['userId']).\" \";\n } else {\n $and = \"\"; \n }\n }\n $exeGetreport = $this->db->query(\"SELECT *\n FROM report a\n LEFT JOIN employees b\n ON a.user_id = b.user_id \n LEFT JOIN employee_details c\n ON c.user_id = b.user_id\n LEFT JOIN payperiod d\n ON d.id = a.payperiod\n WHERE a.payperiod = \".$this->db->escape($payid).\"\n $and \");\n\n if($exeGetreport->num_rows() > 0) {\n return $exeGetreport->result_array();\n } else {\n return false;\n } \n }", "function getDailyReport($date = null)\n{\n//SELECT COUNT(0)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `invoice_count`,\n//`b`.`tran_date` AS `tran_date`,(\n//SELECT COUNT(`0_debtor_trans_details`.`id`)\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND\n//(`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_count`,(\n//SELECT SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_invoice_amount`,(\n//SELECT SUM(`0_debtor_trans`.`alloc`)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_amount_recieved`,(\n//SELECT (SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`)) - SUM(`0_debtor_trans`.`alloc`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `pending_amount`,(\n//SELECT (SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`unit_price`)) -\n//SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`discount_amount`)))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_charge`,(\n//SELECT SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`user_commission`))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_commission`,(\n//SELECT SUM(ABS(`0_gl_trans`.`amount`))\n//FROM `0_gl_trans`\n//WHERE ((`0_gl_trans`.`type` = 12) AND (`0_gl_trans`.`account` = 1200) AND\n//(`b`.`tran_date` = '$date'))) AS `total_collection`\n//FROM ((`0_debtor_trans` `a`\n//JOIN `0_gl_trans` `b` ON((`a`.`trans_no` = `b`.`type_no`)))\n//JOIN `0_debtor_trans_details` `c` ON((`a`.`trans_no` = `c`.`debtor_trans_no`)))\n//WHERE ((`c`.`debtor_trans_type` = 10) AND (`a`.`type` = 10)) and `b`.`tran_date` = '$date'\n//GROUP BY `b`.`tran_date`\n//ORDER BY `b`.`tran_date`\";\n//\n//// if ($date) {\n//// $sql .= \" and tran_date='$date' \";\n//// }\n////\n//// $sql .= \" order by tran_date desc LIMIT 10\";\n//\n//\n//// print_r($sql); die;\n//\n// $result = db_query($sql, \"Transactions could not be calculated\");\n//\n// $table_html = \"\";\n//\n// $i = 0;\n//\n// while ($myrow = db_fetch($result)) {\n//\n// $class = 'class=\"oddrow\"';\n// if ($i % 2 == 0)\n// $class = 'class=\"evenrow\"';\n//\n// $table_html .= \"<tr $class>\";\n// $table_html .= \"<td>\" . $myrow['tran_date'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['invoice_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['total_service_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_service_charge'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_invoice_amount'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_collection'], user_price_dec()) . \"</td>\";\n// $table_html .= \"</tr>\";\n// $i++;\n// }\n// return $table_html;\n\n}", "function getStudentReport( $datetypeselect, $startdate, $enddate, $classyear,\r\n\t\t\t\t $residenceselect, $ethnic, $userselect, $watched, $redflag, $vip,\r\n\t\t\t\t $acpro, $housingwaitlist, $field1, $field2, $field3 ) {\r\n\t\t\r\n\t\t$userid = $_SESSION['userid'];\r\n\t\t\r\n\t\tif( $datetypeselect == 0 ) $left = \"left\";\r\n\t\t\r\n\t\t\r\n\t\tif( $startdate ) $datestuff .= \" and c.datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\tif( $enddate ) $datestuff .= \" and c.datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\r\n\t\t$query = \"\r\n\t\t\tSELECT x.ID,\r\n\t\t\t concat( x.LAST_NAME, ', ', x.FIRST_NAME, ' ', x.MIDDLE_NAME ) as FullName,\r\n\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as AssignedToName,\r\n\t\t\t s.AssignedTo,\r\n\t\t\t x.ENROLL_STATUS,\r\n\t\t\t x.CAMPUS_PHONE,\r\n\t\t\t x.CELL_PHONE,\r\n\t\t\t x.WOOSTER_EMAIL,\r\n\t\t\t x.PRIMARY_EMAIL,\r\n\t\t\t x.CAMPUS_BOX,\r\n\t\t\t x.CLASS_YEAR,\r\n\t\t\t s.AcProbation,\r\n\t\t\t s.HousingWaitList,\r\n\t\t\t s.Field1,\r\n\t\t\t s.Field2,\r\n\t\t\t s.Field3,\r\n\t\t\t s.VIP,\r\n\t\t\t s.RedFlag,\r\n\t\t\t x.HOME_PHONE,\r\n\t\t\t concat( x.HOUSING_BLDG, ' ', x.HOUSING_ROOM ) as HousingAssignment,\r\n\t\t\t x.ETHNIC,\r\n\t\t\t x.ADVISOR\r\n\t\t\tFROM X_PNSY_STUDENT x, students s, users u, contacts c, `contacts-students` cs\r\n\t\t\tWHERE x.ID = s.StudentID AND cs.ContactID = c.ID $datestuff AND cs.StudentID = x.ID\r\n\t\t\tAND s.StudentID IN (SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID)\r\n\t\t\";\r\n\t\t\r\n\t\tif( $classyear ) $query .= \" and x.CLASS_YEAR = '$classyear'\";\r\n\r\n\t\tif( $residenceselect ) $query .= \" and x.HOUSING_BDLG = '$residenceselect'\";\r\n\t\tif( $userselect ) $query .= \" and s.assignedto = '$userselect'\";\r\n\t\tif( isset($watched) ) $query .= \" and x.ID in (select studentid from studentwatch where userid = '$userid')\";\r\n\t\tif( isset($redflag) ) $query .= \" and s.redflag != ''\";\r\n\t\tif( isset($vip) ) $query .= \" and s.vip != ''\";\r\n\t\tif( isset($acpro) ) $query .= \" and s.acprobation = 1\";\r\n\t\tif( isset($housingwaitlist) ) $query .= \" and s.housingwaitlist = 1\";\r\n\t\tif( isset($field1) ) $query .= \" and s.Field1 = 1\";\r\n\t\tif( isset($field2) ) $query .= \" and s.Field2 = 1\";\r\n\t\tif( isset($field3) ) $query .= \" and s.Field3 = 1\";\r\n\t\t$query .= \" group by x.ID order by x.LAST_NAME\";\r\n\t\t\t\t\r\n\t\t$return = array();\r\n\t\t$result = mysql_query( $query );\r\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $return as $rowNumber => $row ) {\r\n\t\t\t\r\n\t\t\t// include the number of contacts\r\n\t\t\t$query = \"select count(*) as NumContacts from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct contactid from `contacts-students` cs\r\n\t\t\t\t\twhere cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContacts'] = $numContactsArray['NumContacts'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContacts'] = false;\r\n\t\t\t\r\n\t\t\t// include the number of contacts in the date range\r\n\t\t\t$query = \"select count(*) as NumContactsInRange from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct c.id from contacts c\r\n\t\t\t\t\tjoin `contacts-students` cs\r\n\t\t\t\t\ton cs.contactid = c.id\r\n\t\t\t\t\tand cs.studentid = '\".$row['ID'].\"'$datestuff\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContactsInRange'] = $numContactsArray['NumContactsInRange'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContactsInRange'] = false;\r\n\t\t\t\r\n\t\t\t// include all the users associated with the contacts\r\n\t\t\t$query = \"select distinct u.ID,\r\n\t\t\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as FullName,\r\n\t\t\t\t\t u.Email\r\n\t\t\t\t from users u, `contacts-users` cu, `contacts-students` cs, contacts c\r\n\t\t\t\t where u.id = cu.userid\r\n\t\t\t\t and cu.contactid = cs.contactid\r\n\t\t\t\t and cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t and cs.contactid = c.id$datestuff\r\n\t\t\t\t \";\r\n\t\t\t$usersArray = array();\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\twhile( $userrow = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\tarray_push( $usersArray, $userrow );\r\n\t\t\t}\r\n\t\t\t$return[$rowNumber]['Users'] = $usersArray;\r\n\t\t\t\r\n\t\t\t$return[$rowNumber]['StartDate'] = $startdate;\r\n\t\t\t$return[$rowNumber]['EndDate'] = $startdate;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "public function log_query()\n\t{\n\t\t$query = $this->get_query();\n\n\t\tif ( ! $query ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_array( $query ) && ! is_object( $query ) ) {\n\t\t\t$query = [ $query ];\n\t\t}\n\n\t\t$log = new Charcoal_Log;\n\t\t$log->event_type = $this->event_type;\n\t\t$log->data = $query;\n\t\t$log->save();\n\t}", "public function query() {\n\n }" ]
[ "0.69480157", "0.6880098", "0.68651414", "0.68444467", "0.6816307", "0.66602457", "0.66602457", "0.66305923", "0.65538704", "0.6512989", "0.64980054", "0.64923275", "0.64923275", "0.6384686", "0.6371433", "0.6369469", "0.6353576", "0.6353576", "0.6346453", "0.6346453", "0.6346453", "0.6339945", "0.6304278", "0.6300224", "0.6294275", "0.62740195", "0.6252157", "0.6240225", "0.62322485", "0.6230099", "0.62196594", "0.61875796", "0.617956", "0.6162078", "0.6147162", "0.6147162", "0.6147162", "0.6139934", "0.6139934", "0.6139934", "0.6139934", "0.6139934", "0.6139934", "0.6139934", "0.6139934", "0.6139934", "0.6138563", "0.611265", "0.6092064", "0.60711306", "0.6068847", "0.60404605", "0.60398614", "0.60323536", "0.60265446", "0.60190266", "0.6005125", "0.6003039", "0.6000052", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5985497", "0.5974947", "0.59588957", "0.5952057", "0.594407", "0.5941203", "0.59411734", "0.5936038", "0.5936038", "0.5930489", "0.5909431", "0.58999795", "0.5894908", "0.5889077", "0.5888021", "0.588545", "0.5884381", "0.5871415" ]
0.0
-1
A user has typed something
function user_active(&$irc, &$data) { global $users; global $pickupchannel; global $pickup; //Remind the user they are added if((time() - $users->last_active($users->nicktoqauth($data->nick))) > 360) { if($pickup->is_added($users->nicktoqauth($data->nick))) { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": Remember you are added to this pickup. If you can't play type !del"); } } $users->user_active($data->nick); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cli_keyboardInput() {}", "public function getUserInput()\n {\n // TODO: Implement getUserInput() method.\n }", "public function getUserInput()\n {\n // TODO: Implement getUserInput() method.\n }", "public function getInput();", "public function getInput();", "public function getInput();", "abstract public function getInput();", "function input ()\n\t{}", "public function promptInput()\n {\n while ($this->run) {\n $this->valid = true;\n $input = readline('Enter a command : ');\n $this->handleInput($input);\n }\n }", "public function getInput() {}", "public function setUserTextInput($input)\n {\n $this->userInput = trim($input);\n }", "function typingStart(TextChannelInterface $channel, User $user);", "protected function userInput() {\n return trim(fgets($this->_stdin));\n }", "public function askName()\n {\n $this->ask('What is your name?', function (Answer $answer) {\n $this->user->name = $answer->getText();\n\n $this->askEmail();\n });\n }", "private static function was_username_provided($input)\n {\n }", "public function askName()\n {\n $this->ask('Antes que nada. ¿Cómo te llamas? Para dirigirme a ti', function(Answer $answer) {\n // Texto respuesta\n $this->name = $answer->getText();\n $this->say('Encantado, '.$this->name);\n $this->askWhatToDo();\n });\n }", "public function handleInput() {\n if ($this->isPressed(BUTTON_W)) {\n jump();\n } elseif ($this->isPressed(BUTTON_A)) {\n fireGun();\n } elseif ($this->isPressed(BUTTON_S)) {\n swapWeapon();\n } elseif ($this->isPressed(BUTTON_D)) {\n duck();\n }\n }", "public function enterName()\n {\n }", "public function renderInput();", "public function run()\n {\n $this->askFirstname();\n }", "public function incorrectInput()\n {\n return \"I can't play BuzzPhone like this.\" . $this->askForNumber();\n }", "function input($data);", "function correctAnswerWithTypo() {\n\t}", "public function getEditInput();", "public function userInput() \n {\n \n if (!defined(\"STDIN\")) {\n define(\"STDIN\", fopen('php://stdin', 'r'));\n }\n // getting path from user\n echo 'Hello! What is your complete path to the directory or if ' .\n 'you want to append signature in php files of current directory' .\n 'just press Enter (enter below):' . PHP_EOL;\n $this->pathToDir = fread(STDIN, 80);\n $this->pathToDir = trim($this->pathToDir);\n // checking if user has entered the path or not\n // if not than use working directory for modification\n if ($this->pathToDir == NULL) {\n $this->pathToDir = getcwd() . '/';\n }\n if (substr($this->pathToDir, -1) != '/') {\n $this->pathToDir = $this->pathToDir . '/';\n }\n // get all text files with a .php extension into an array.\n $this->filesArray = glob($this->pathToDir . \"*.php\");\n //checking if files exits in folder or not\n if (count($this->filesArray) > 0) {\n //getting text from user\n echo 'Hello! Enter the Text that you want to merge' .\n ' in php file (enter below):' . PHP_EOL;\n $this->textInput = fread(STDIN, 80);\n $this->textInput = trim($this->textInput);\n $this->doEditingInPhp();\n } else {\n echo 'provided directory does not contain any php file' . PHP_EOL;\n }\n }", "public function get_input()\n {\n }", "public function getInput($name);", "function get_String()\n {\n // takes the user input.\n $name = readline(\"Enter the name: \");\n return $name;\n }", "public function getAddInput();", "public function isShowInput() {\n\t\t$this->getShowInput();\n\t}", "public function input($text,$name,$type){\r\n\t\treturn $this->surround('<input type=\"text\" name=\"'.$name.'\" > ');\r\n\r\n\t}", "function validarInput( $text , $tipo){\r\n\t\tif ($tipo=='string' ){\r\n\t\t\tif ($text!='' && strlen($text) != 0){\r\n\t\t\t\t$valido=true;\r\n\t\t\t}else{\r\n\t\t\t\t$valido=false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif (esEntero($text) && strlen($text) != 0){\r\n\t\t\t\t$valido=true;\r\n\t\t\t}else{\r\n\t\t\t\t$valido=false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $valido;\r\n\t}", "function enterName() {\n\tfwrite(STDOUT, \"Enter name: \") . PHP_EOL;\n\t$name = ucfirst(trim(fgets(STDIN)));\n\treturn $name;\n}", "public function putInput(string $type, InputMessage $inputMessage): void;", "function get_input($upper = FALSE) \n{ \n $userInput = trim(fgets(STDIN));\n\n // Return input as either UPPERCASE or as user typed\n return $upper ? $userInput = strtoupper($userInput) : $userInput;\n}", "public function getPrompt();", "function keyPressed(KeyEvent $event);", "public static function userBadChoice()\n {\n say('Invalid entry, please try again');\n }", "public function showTyping(PresenceRegistryRequest $request)\n {\n if (! config('faithgen-sdk.source')) {\n event(new TypingRegistered(auth('web')->user(), $request->validated()));\n }\n }", "protected function getUserInputForUpdate() {}", "function input($name, $placeholder, $value=null) {\n\tif($value == null && isset($_SESSION['POST'][$name])){\n\t\t$value = $_SESSION['POST'][$name];\n\t\t\n\t\t//remove from session data\n\t\tunset($_SESSION['POST'][$name]);\n\t\t\n\t\tif($value ==''){ // nothing was enterd as hat value in the QS\n\t\t\t$class = 'class=\"error\"';\n\t\t} else {$class='';}\n\t} elseif($value != null){\n\t\t$class = '';\n\t}else {\n\t\n\t\t//error not present at initial loading of page \\/\n\t\t$value = '';\n\t\t$class='';\n\t}\n\t\t\t\t\n\t$input = \"<input $class type=\\\"text\\\" name=\\\"$name\\\" placeholder=\\\"$placeholder\\\"value=\\\"$value\\\"/>\";\n\treturn $input;\n}", "public function SendUserInput()\n {\n $this->ReadInputRecord($recArr);\n $this->UpdateActiveRecord($recArr);\n }", "public function addInput($LableText = null, $NewLine = false , $InputPrams = array(), $InputValue = array()) \n{\n $this->showElment($this->processInput($LableText, $NewLine, $InputPrams, $InputValue ));\n}", "public function setText(string $input) {\n $this->inputText = $input;\n }", "public function getInput($name = null);", "public function checkInputExists($name);", "function j2_yt_textbox_callback($args) {\n $option = get_option($args[0]);\n echo '<input type=\"text\" id=\"'. $args[0] .'\" name=\"'. $args[0] .'\" value=\"' . $option . '\" />';\n }", "function _valInput() {\r\n\t\tswitch(TRUE) {\r\n\t\t\tcase (empty($_POST['lynkvp_name'])):\r\n\t\t\t\t$this->note .= __('Please enter a Name.', $this->textdomain_name);\r\n\t\t\t\treturn FALSE; break;\r\n\t\t\tcase (empty($_FILES['lynkvp_file']['size']) && empty($_POST['lynkvp_url'])):\r\n\t\t\t\t$this->note .= __('Please choose a Video or enter an URL.', $this->textdomain_name);\r\n\t\t\t\treturn FALSE; break;\r\n\t\t\tcase (empty($_POST['lynkvp_type'])):\r\n\t\t\t\t$this->note .= __('Please choose a Video Type.', $this->textdomain_name);\r\n\t\t\t\treturn FALSE; break;\r\n\t\t\tcase (empty($_POST['lynkvp_size']) || !isset($this->videosizes[$_POST['lynkvp_size']])):\r\n\t\t\t\tif (empty($_POST['lynkvp_size']) || $_POST['lynkvp_size'] == 0) {\r\n\t\t\t\t\t$this->note .= __('Please select a Size.', $this->textdomain_name);\r\n\t\t\t\t\treturn FALSE;\r\n\t\t\t\t} elseif (preg_match('/[^\\d]/', $_POST['lynkvp_width'])) {\r\n\t\t\t\t\t$this->note .= __('Please enter a Width.', $this->textdomain_name);\r\n\t\t\t\t\treturn FALSE;\r\n\t\t\t\t} elseif(preg_match('/[^\\d]/', $_POST['lynkvp_height'])) {\r\n\t\t\t\t\t$this->note .= __('Please enter a Height.', $this->textdomain_name);\r\n\t\t\t\t\treturn FALSE; break;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn TRUE;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn TRUE; break;\r\n\t\t}\r\n\t}", "function InputTextBox($VariableName,$default,$maxlength,$size,$autres=\"\")\t{\n\t\t\tif($_SESSION[\"readonly\"]==\"true\")\n\t\t\t\t$cache=\"readonly disabled\";\n\t\t\t$res=\"\";\n\t\t\t$res.=\"<input type=\\\"text\\\" name=\\\"$VariableName\\\" id=\\\"$VariableName\\\" maxlength=\\\"$maxlength\\\" size=\\\"$size\\\" value=\\\"$default\\\" $autres $cache>\";\n\t\t\treturn $res;\n\t}", "public function askForNumber()\n {\n return \"Give me a number, and we can play BuzzPhone together!\";\n }", "function input($name){\n\t\tif(isset($_POST[$name])){\n\t\t\t$t = $this->simpleCleanInput($_POST[$name]);\n\t\t\tif($t !== false){\n\t\t\t\treturn $t;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "function get_input($upper = FALSE) \n{\n\t$result = trim(fgets(STDIN));\n\treturn $upper? strtoupper($result) : $result;\t\n}", "public function search_box($text, $input_id)\n {\n }", "public function search_box($text, $input_id)\n {\n }", "public function getQuestionFromInput() {\n return parent::getQuestionFromInput();\n }", "protected function onAfterInputHtml()\n {\n }", "function draw_input($s_type, $s_name_prefix, $s_name, $wt_default_value) {\n\tif ($s_type == 'textbox') {\n\t\t\treturn '<input type=\\'textbox\\' size=\\'20\\' name=\\''.$s_name_prefix.$s_name.'\\' value=\\''.$wt_default_value.'\\' />';\n\t} else if ($s_type == 'checkbox') {\n\t\t\treturn '<input type=\\'checkbox\\' name=\\''.$s_name_prefix.$s_name.'\\' '.($wt_default_value ? 'CHECKED' : '').'/>';\n\t}\n}", "public function getInput($key);", "protected function userInput(InputInterface $input, OutputInterface $output)\n {\n $this->askForApp($input, $output, 'Which app would you like to start?', 'stopped');\n }", "public function answer() {\n\n\t\t/**\n\t\t * Fires right before giving the answer.\n\t\t */\n\t\tdo_action( self::ACTION );\n\n\t\t/**\n\t\t * Filters the answer.\n\t\t *\n\t\t * @param string $answer The answer.\n\t\t */\n\t\treturn (string) apply_filters( self::FILTER, '42' );\n\t}", "function input($data)\r\n {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "public function handleInput() {\n $this->button_input = fread(STDIN, 1);\n if ($this->isPressed(BUTTON_W)) {\n $this->buttonW->execute();\n } elseif ($this->isPressed(BUTTON_A)) {\n $this->buttonA->execute();\n } elseif ($this->isPressed(BUTTON_S)) {\n $this->buttonS->execute();\n } elseif ($this->isPressed(BUTTON_D)) {\n $this->buttonD->execute();\n }\n }", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "function verify($dataName,$textout){\r\n\t\tif(isset($_POST['submitted'])){\r\n\t\t\tif(empty($_POST[$dataName])){\r\n\t\t\t\tif($textout){\r\n\t\t\t\t\tswitch($dataName){\r\n\t\t\t\t\t\tcase \"title\": print\"<p class=\\\"error\\\">Please enter a title for your thread</p>\"; break;\r\n\t\t\t\t\t\tcase \"entry\": print\"<p class=\\\"error\\\">Please type in something for your thread</p>\"; break;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function handleInput($input)\n {\n $input = strtoupper(trim($input));\n $input = preg_replace('/\\s+/', ' ', $input); // Remove any extra spaces.\n $input = preg_replace('/\\s*,\\s*/', ',', $input); // Remove any spaces after comma\n $args = explode(' ', $input);\n $this->command = $args[0];\n if ($this->isValidCommand($this->command)) {\n $placeArguments = [];\n if ($this->command === self::CMD_PLACE) {\n $placeArguments = $this->handlePlaceCommand(isset($args[1]) ? $args[1] : '');\n }\n if ($this->valid) {\n $this->processInput($this->command, $placeArguments);\n }\n } else {\n echo \"Please enter a valid command.\\n\";\n }\n }", "public function prosesinput_bahan_kuliah(){\n\n\t\t$this->m_aka->prosesinput_bahan_kuliah();\n\t\tredirect('c_index_aka/data_bahan_kuliah');\n\t}", "function getInputValues();", "function get_input($upper = FALSE) \n{\n // Return filtered STDIN input\n $result = trim(fgets(STDIN));\n \n if ($upper) \n {\n return strtoupper($result);\n } \n\n else \n\n {\n return $result;\n }\n}", "public function getInputFor($nome);", "public function ask($message);", "public function autocomplete_callback();", "public static function text_change_check()\n {\n }", "function postInput($string)\n\t{\n\t\treturn inset($_post[$string]) ? $_post[$string] : '';\n\t}", "function rp_title_text_input ( $title ) {\n\tif ( get_post_type() == 'people' ) {\n\t\t$title = __( 'Enter the last name here' );\n\t}\n\treturn $title;\n}", "private function _joke()\n {\n $question = str_replace(array(\"!joke \", \"!joke\"), \"\", $this->_data->message);\n $question = escapeshellcmd($question);\n \n if ($question == \"\") {\n $value = `ruby jokes.rb`;\n }\n else {\n $value = `ruby jokes.rb $question`; \n }\n \n if ($value) {\n $this->_message($this->_data->nick.': '. $value); \n }\n else {\n $this->_message($this->_data->nick.': No jokes about '. $question .'');\n \n }\n \n }", "function Type()\n {\n return 'autocomplete text';\n }", "function text_box() {\n\t\t$args = func_get_args();\n\n\t\t$this->explode_args($args);\n\t\t$this->buffer = \"<input type=\\\"text\\\" class=\\\"txtSearch\\\" \";\n\n\t\twhile (list($name,$val) = each($this->vars)) {\n\t\t\tif ($name != 'id')\n\t\t\t\t$this->buffer .= $name.($val !== NULL ? \"=\\\"$val\\\"\" : NULL).\" \";\n\n\t\t\tif ($name == \"name\" && !$id)\n\t\t\t\t$id = \" id=\\\"$val\\\"\";\n\t\t\tif ($name == \"id\")\n\t\t\t\t$id = \" id=\\\"$val\\\"\";\n\t\t}\n\t\t$this->buffer .= $id;\n\t\t$this->buffer .= \" />\";\n\t\treturn $this->output();\n\t}", "public function check_field_text ( $input ) {\n\t\t$is_valid = true;\n\n\t\treturn $is_valid;\n\t}", "public function askWhatToDo(){\n $question = Question::create('¿Qué deseas hacer en mi blog?')\n ->fallback('Lo siento pero...')\n ->callbackId('que_quieres_hacer')\n ->addButtons([Button::create('¿Ver todos los posts?')->value('all'),Button::create('¿Ver todas las categorías?')->value('categorias'),]);\n $this->ask($question, function(Answer $answer) {\n\n if ($answer->isInteractiveMessageReply()){\n $value = $answer->getValue();\n $text = $answer->getText();\n $this->say('Opcion, '.$value.' '.$text);\n }\n });\n }", "function typingStop(TextChannelInterface $channel, User $user);", "public function isEditable();", "public function isEditable();", "public function enterRequiredKeyword(string $keyword): void;", "function showFormInput($type, $name, $placeholder) {\n\t?>\n\t<div class=\"form-group\">\n \t\t<input \n\t\t\ttype=\"<?=$type?>\" \n\t\t\tclass=\"form-control center-block\" \n\t\t\tname=\"<?=$name?>\" \n\t\t\tid=\"<?=$name?>\" \n\t\t\tplaceholder=\"<?=$placeholder?>\" \n\t\t\tvalue=\"<?= array_key_exists($name,$_GET) ? $_GET[$name] : '' ?>\" \n\t\t\t<?=highlightFormFieldIfMissing($name)?>\n\t\t/>\n\t</div>\n\t<?php\n}", "public function getInput()\n\t{\n\t\treturn ' ';\n\t}", "public function prosesinput_mata_kuliah(){\n\n\t\t$this->m_aka->prosesinput_mata_kuliah();\n\t\tredirect('c_index_aka/data_mata_kuliah');\n\t}", "public function askEmail()\n {\n $this->ask('What is your email?', function (Answer $answer) {\n $this->user->email = $answer->getText();\n\n $user = User::where('email', $this->user->email)->first();\n\n if (isset($user)) {\n $this->repeat('Sorry this email is already in use. Please enter a valid email.');\n } else {\n $this->askPassword();\n }\n });\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 }", "function user_autocomplete() {\n\t\t$json = $this->user_model->get_users_autocomplete(str_replace('+', ' ', strtolower($_GET['term'])));\n\t\t\n\t\t$this->output->set_content_type('application/json')->set_output($json);\n\t}", "function promptUser($prompt, $allowedValues=NULL, $default=NULL, $lower=TRUE) {\n while (true) {\n $userValue = readline($prompt);\n if ($lower) {\n $userValue = strtolower($userValue);\n }\n // if answer is an empty string and default is specified, return default\n if (($userValue == \"\") && $default){\n err_log(\"defaulting to $default\");\n return $default;\n }\n // check answer against allowed values.\n if ($allowedValues) {\n if (in_array($userValue, $allowedValues)) {\n // valid answer given, return answer\n return $userValue;\n } else {\n // invalid answer given, prompt again\n $validAnswer = implode(\", \", $allowedValues);\n err_log(\"$userValue is not a valid answer. Please answer [$validAnswer]\");\n continue;\n }\n } else {\n // all answers valid\n return $userValue;\n }\n }\n}", "function formInput( $id, $value, $type='textline', $name )\n\t{\n\t\t$success = false;\n\t\t\n\t\t$newname = $name;\n\t\t//remove spaces from name\n\t\t$name = str_replace(' ','_',$newname);\n\t\t$name = str_replace('.','_',$name);\n\t\t\n\t\tswitch ($type) \n\t\t{\n\t\t\tcase \"radio\": \n\t\t\t\t$success = PhplistSelect::AttribRadio( $id, $value, $name );\n\t\t\t break;\n\t\t\tcase \"hidden\": \n\t\t\t\t$success = PhplistHelperAttribute::AttribHidden( $id, $value, $name, $site=\"admin\" );\n\t\t\t break;\n\t\t\tcase \"checkbox\": \n\t\t\t\t$success = PhplistHelperAttribute::AttribCheckbox( $id, $value, $name );\n\t\t\t break;\n\t\t\tcase \"checkboxgroup\":\n\t\t\t\t$success = PhplistHelperAttribute::AttribCheckboxgroup( $id, $value, $name ); \n\t\t\t break;\n\t\t\tcase \"select\":\n\t\t\t\t$success = PhplistSelect::AttribSelect( $id, $value, $name ); \n\t\t\t break;\n\t\t\tcase \"date\":\n\t\t\t\t$success = PhplistHelperAttribute::AttribDate( $id, $value, $name ); \n\t\t\t break; \n\t\t\tcase \"textarea\":\n\t\t\t\t$success = PhplistHelperAttribute::AttribTextarea( $id, $value, $name ); \n\t\t\t break; \n\t\t\tcase \"textline\": \n\t\t\tdefault: \n\t\t\t\t$success = PhplistHelperAttribute::AttribTextline( $id, $value, $name );\n\t\t\t break;\t\n\t\t}\n\t\t\n\t\treturn $success;\n\t}", "protected function getInput()\n\t{\n\t\treturn ' ';\n\t}", "function check_input ($data)\n{\n $data = trim($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function getEditableText() {}", "public function askPhoneNumber()\n {\n $this->ask('Ваш номер телефона', function (Answer $answer) {\n\n try {\n $contact = $answer->getMessage()->getContact()->getPhoneNumber();\n $this->getBot()->userStorage()->save([\n 'phone_number' => $contact\n ]);\n }catch (\\Exception $e){\n $contact = $answer->getMessage()->getText();\n $this->getBot()->userStorage()->save([\n 'phone_number' => $contact\n ]);\n }\n\n $this->askLocation();\n }, [\n 'reply_markup' => json_encode([\n 'keyboard' => [\n [\n ['text' => 'Отправить контакт', 'request_contact' => true]\n ]\n ],\n 'one_time_keyboard' => true,\n 'resize_keyboard' => true\n ])\n ]);\n }", "function testUserInput($data) {\n\t$data = trim($data);\n\t$data= stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "public static function textinput( $var, $label, $option = '' ) {\n\t\tif ( method_exists( 'Yoast_Form', 'textinput' ) ) {\n\t\t\tif ( $option !== '' ) {\n\t\t\t\tYoast_Form::get_instance()->set_option( $option );\n\t\t\t}\n\n\t\t\tYoast_Form::get_instance()->textinput( $var, $label );\n\n\t\t\treturn;\n\t\t}\n\n\t\treturn self::admin_pages()->textinput( $var, $label, $option );\n\t}", "function viewResult()\n{\n\n if (!empty($_POST['push_true'])) {\n $len_word = $_POST['leng_word'];\n if (is_numeric($len_word)) {\n addTextToFile(explode(\" \", $_POST['input_text']));\n viewText();\n delWord();\n\n } else {\n echo '<br>' . '\"' . $len_word . '\"' . ' - это не число, введите число';\n }\n\n }\n}", "function mASK(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$ASK;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:141:3: ( 'ask' ) \n // Tokenizer11.g:142:3: 'ask' \n {\n $this->matchString(\"ask\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function do_input_field($field) {\n do_input_field($field, $this->properties[$field], $this->$field);\n }" ]
[ "0.6223841", "0.59488744", "0.59488744", "0.5884164", "0.5884164", "0.5884164", "0.58016026", "0.5791626", "0.5745689", "0.56747735", "0.56547093", "0.5634551", "0.56049377", "0.5524392", "0.5509945", "0.5422995", "0.5338059", "0.5336933", "0.5329342", "0.53264594", "0.5319788", "0.5310403", "0.53069395", "0.53022915", "0.5299195", "0.52674115", "0.5234403", "0.5232015", "0.5225952", "0.52256155", "0.51783663", "0.5143924", "0.5143837", "0.5125587", "0.51214886", "0.5120041", "0.51079166", "0.50793755", "0.5075296", "0.5072823", "0.5056293", "0.504626", "0.50057065", "0.50034636", "0.50001293", "0.49997488", "0.49965334", "0.4995355", "0.4976579", "0.49689922", "0.49581262", "0.49545825", "0.49518663", "0.49518663", "0.4937702", "0.49349415", "0.49311104", "0.49287987", "0.4917679", "0.4910548", "0.49052957", "0.4896421", "0.48890695", "0.48873886", "0.4859789", "0.48595786", "0.48586017", "0.4857401", "0.48558676", "0.4853179", "0.4850219", "0.48478156", "0.48316", "0.48284385", "0.4825293", "0.481836", "0.480528", "0.48010388", "0.47978368", "0.47963247", "0.47933808", "0.47933808", "0.47810936", "0.47796023", "0.4774132", "0.47725502", "0.4766956", "0.4763696", "0.4763696", "0.47611123", "0.47585925", "0.47475767", "0.47474474", "0.4741648", "0.4736168", "0.4735732", "0.47328737", "0.47315988", "0.47295925", "0.47145176", "0.47120658" ]
0.0
-1
Check user list on join
function init_names(&$irc, &$data) { //Bring variables into scope global $users; global $PickupBot; global $queue; global $pickupchannel; $userlist = array(); //Unregister name list hook $irc->unregisterActionhandler(SMARTIRC_TYPE_NAME, '', &$PickupBot, 'init_names'); //Issue whois on names $counter = 0; $size = count($data->messageex); while($counter < $size) { $input = str_replace("@", "", $data->messageex[$counter]); $input = str_replace("+", "", $input); array_push($userlist, $input); $counter++; } //Add check commands to the Queue $counter = 0; while($counter < $size) { if($userlist[$counter] !== "Q") { $queue->add_item($userlist[$counter], "check"); $irc->whois($userlist[$counter]); } $counter++; } $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x02\x0302,00Bot initialised!"); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "NOW WITH A NEW VANILLA FLAVOUR"); init_hooks(); DisablePickup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "public function get_user_list($list){\n if(get_instance()->ecl('Instance')->mod('lists', 'if_user_has_list', [get_instance()->ecl('Instance')->user(),$list,'email'])){\n return true;\n } else {\n return false;\n }\n }", "public function list_members() {\n\n\t\t//ignored users\n\t\t$stm = $this->db()->prepare('select \"to_big\" from \"member_settings\" where \"from_big\" = :current_member_big and \"chat_ignore\" = 1');\n\t\t$stm->execute(array(\n\t\t\t':current_member_big'\t=> $this->member_big,\n\t\t));\n\t\t$ignored_members_raw = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t$ignored_members = array(0);\n\t\tforeach($ignored_members_raw as $member) {\n\t\t\t$ignored_members[] = $member['to_big'];\n\t\t}\n\t\t$ignored_members = implode(',', $ignored_members);\n\n\t\t//joined users\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\", (case when \"c\".\"physical\"=1 then \\'onsite\\' else \\'online\\' end) as \"status\"\n\t\t\tfrom \"checkins\" \"c\"\n\t\t\t\tleft join \"members\" \"m\" on (\"c\".\"member_big\" = \"m\".\"big\")\n\t\t\twhere (\"c\".\"checkout\" is null or \"c\".\"checkout\" > now())\n\t\t\t\tand \"c\".\"event_big\" = (select \"event_big\" from \"checkins\" where \"member_big\" = :member_big and (\"checkout\" is null or \"checkout\" > now()) order by \"created\" desc limit 1)\n\t\t\t\tand (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout)\n\t\t\t\tand \"m\".\"big\" != :member_big\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.')\n\t\t\torder by m.big, \"c\".\"created\" asc'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$joined_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$joined_member_bigs = array(0);\n\t\tforeach($joined_members as $member) {\n\t\t\t$joined_member_bigs[] = $member['big'];\n\t\t}\n\t\t$joined_member_bigs = implode(',', $joined_member_bigs);\n\n\t\t//users we already had conversation with\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\",\n\t\t\t\t(case when (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout) then \\'online\\' else \\'offline\\' end) as \"status\"\n\t\t\tfrom \"member_rels\" \"r\"\n\t\t\t\tleft join \"members\" \"m\" on (\"m\".\"big\" = (case when \"r\".\"member1_big\"=:member_big then \"r\".\"member2_big\" else \"r\".\"member1_big\" end))\n\t\t\t\tleft join \"chat_messages\" as \"cm\" on (\"cm\".\"rel_id\" = \"r\".\"id\" and (case when \"cm\".\"from_big\"=:member_big then \"cm\".\"from_status\" else \"cm\".\"to_status\" end) = 1)\n\t\t\twhere \"m\".\"big\" != :member_big\n\t\t\t\tand (r.member1_big = :member_big OR r.member2_big = :member_big)\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.','.$joined_member_bigs.')\n\t\t\t\tand \"cm\".\"id\" > 0\n\t\t\torder by m.big'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$history_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($joined_members as $key=>$val) {\n\t\t\t$joined_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\t\tforeach($history_members as $key=>$val) {\n\t\t\t$history_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\n\t\treturn $this->reply(array(\n\t\t\t'joined' => $joined_members,\n\t\t\t'history' => $history_members,\n\t\t));\n\n\t}", "public function join(User $user)\n {\n //\n }", "private function _isListAssociatedWithUser($listname) \r\n {\r\n return $this->_existsListAlready($listname);\r\n }", "private function checkOnlineList()\n {\n $this->online->checkOnlineList($this->loginTime);\n }", "public function test_get_users_in_context() {\n $this->resetAfterTest();\n\n $component = 'core_enrol';\n\n $user = $this->getDataGenerator()->create_user();\n $usercontext = context_user::instance($user->id);\n $course = $this->getDataGenerator()->create_course();\n $coursecontext = context_course::instance($course->id);\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n\n // Enrol user into course.\n $this->getDataGenerator()->enrol_user($user->id, $course->id, null, 'manual');\n\n // The list of users within the course context should contain user.\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the user context should be empty.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($usercontext, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }", "public function if_user_has_list($user_id, $list, $type) {\n \n $this->db->select('*');\n $this->db->from('lists');\n $this->db->where(['user_id' => $user_id, 'list_id' => $list, 'type' => $type]);\n $query = $this->db->get();\n \n if ($query->num_rows() > 0) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n }", "public function test_get_users_in_context() {\n $component = 'core_tag';\n\n $user1 = $this->set_up_tags()[0];\n $systemcontext = context_system::instance();\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user1->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the a context other than system context should be empty.\n $usercontext1 = context_user::instance($user1->id);\n $userlist2 = new \\core_privacy\\local\\request\\userlist($usercontext1, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }", "function userJoins() { \n $model = config('auth.model');\n return $model::data();\n }", "public function assigned_user_lists()\n {\n $result = common_select_values('user_id, name, role_id', 'users', ' status=0', 'result');\n return $result; \n\n }", "public function isJoin();", "public function hasPartinUsers(){\n return $this->_has(2);\n }", "public function check()\n {\n if(!empty($this->user)) {\n // If you need to check users online list in every page load, check this TRUE in config file\n if($this->config->item('check_users_on_page_load', 'online')) {\n $this->checkOnlineList();\n }\n\n $this->addUser();\n }\n }", "public function check_online_members(){\n \t$this->load->model(\"portalmodel\");\n \t\n \t$project_id = $this->input->post('project_id');\n \t\n \t$final_names = \"\";\n \t\n \t// get list of current online members\n \t$tmp_online_member_ids = $this->portalmodel->list_select1(\"onlinemembers\");\n \t$online_member_ids = array();\n \tforeach ($tmp_online_member_ids as $eachid){\n \t\t$online_member_ids[]=$eachid->user_id;\n \t}\n \t\n \t$associated_members_ids = $this->portalmodel->list_select(\"project\",\"id\",$project_id);\n \t$tmp_members_ids = implode(\",\", array($associated_members_ids[0]['accountmanager'],$associated_members_ids[0]['projectmanager'],$associated_members_ids[0]['developer']));\n \t$arr_member_names = $this->portalmodel->select_where('', '', 'user', \"id IN (\".$tmp_members_ids.\")\");\n \t$associated_member_names = array();\n \tforeach ($arr_member_names as $eachRecordDetail){\n \t\tif(in_array($eachRecordDetail->id, $online_member_ids)){\n \t\t\t$associated_member_names[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$eachRecordDetail->first_name;\n \t\t}else{\n \t\t\t$associated_member_names[] = $eachRecordDetail->first_name;\n \t\t}\n \t}\n \t$final_names = implode(\", \", $associated_member_names);\n \t\n \t// now get the customer member list\n \t$already_member_ids = $this->portalmodel->list_select(\"chat_project_members\",\"fk_project_id\",$project_id);\n \t$arr_already_member_ids = array();\n \tforeach ($already_member_ids as $eachrecord){\n \t\t$arr_already_member_ids[]=$eachrecord['fk_user_id'];\n \t}\n \t$arr_already_member_ids[]=1001; // here we are adding 1001 for the admin, because he doesn't need to be selected\n \t$in_already_member_ids = implode(\",\", $arr_already_member_ids);\n \t\n \t$arr_member_names = $this->portalmodel->select_where('', '', 'user', \"id IN (\".$in_already_member_ids.\")\");\n \t$associated_member_names = array();\n \tforeach ($arr_member_names as $eachRecordDetail){\n \t\tif(in_array($eachRecordDetail->id, $online_member_ids)){\n \t\t\t$associated_member_names[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$eachRecordDetail->first_name;\n \t\t}else{\n \t\t\t$associated_member_names[] = $eachRecordDetail->first_name;\n \t\t}\n \t}\n \t$associated_member_names = implode(\", \", $associated_member_names);\n \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_member_names:$associated_member_names;\n \t\n \t// online customers\n \t$associated_customer_id = $this->portalmodel->select_name('project', 'customerid', \"id='\".$project_id.\"'\");\n \tif(!empty($associated_customer_id)){\n \t\t$associated_customer_name = $this->portalmodel->select_name('customer', 'companyname', \"customerid='\".$associated_customer_id.\"'\");\n \t\t\n \t\t// also get list of onlinecustomers to highlight\n\t \t$tmp_online_user_ids = $this->portalmodel->list_select1(\"onlinecustomers\");\n\t \t$online_customer_ids = array();\n\t \tforeach ($tmp_online_user_ids as $eachid){\n\t \t\t$online_customer_ids[]=$eachid->customer_id;\n\t \t}\n\t \t\n\t \tif (in_array($associated_customer_id, $online_customer_ids)){\n\t \t\t$associated_customer_name = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$associated_customer_name;\n\t \t}\n\t \t\n\t \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_customer_name:$associated_customer_name;\n \t}\n \t\n \t// online customer users\n \t$tmp_online_customer_user_ids = $this->portalmodel->list_select1(\"online_customer_users\");\n \t$online_customer_user_ids = array();\n \tforeach ($tmp_online_customer_user_ids as $eachid){\n \t\t$online_customer_user_ids[]=$eachid->customer_user_id;\n \t}\n \t\n \t$associated_users = $this->portalmodel->select_where('', '', 'customer_user_project_chat', \"FIND_IN_SET( $project_id, project_ids )\");\n \t$arr_associated_users = array();\n \tforeach ($associated_users as $each_associated_user){\n \t\tif(in_array($each_associated_user->id, $online_customer_user_ids)){\n \t\t\t$arr_associated_users[] = '<i class=\"fa fa-circle\" aria-hidden=\"true\"></i> '.$each_associated_user->first_name;\n \t\t}else{\n \t\t\t$arr_associated_users[] = $each_associated_user->first_name;\n \t\t}\n \t}\n \t\n \t$associated_member_names = implode(\",\", $arr_associated_users);\n \t\n \t$final_names = (!empty($final_names))?$final_names.\", \".$associated_member_names:$associated_member_names;\n \t\n \techo $final_names;\n }", "public function getCompareUserList() {}", "function is_in_admin_list() {\n global $_admin_alias;\n $username = $_SESSION['username'];\n $my_emails = get_col(\"SELECT address FROM people WHERE disa_username = '$username'\");\n $admin_emails = get_col(\"SELECT forward_addr FROM mail_alias WHERE alias = '$_admin_alias'\");\n foreach($my_emails as $my_email) {\n if(in_array($my_email, $admin_emails))\n return true;\n }\n return false;\n}", "public function hasUser();", "function all_users($rolecheck){\n\t\t$session_data = $this->session->userdata();\n\t\tif( array_key_exists('role', $session_data ) && isset($session_data['role'])):\n\t\t\tif( $session_data['role'] != 'super_admin' && $rolecheck =='admin' ):\n\t\t\t\tredirect( base_url() );\n\t\t\t\t//echo $rolecheck;\n\t\t\telse:\n\t\t\t\t$user__list = $this->InteractModal->all__users( $rolecheck );\n\t\t\t\t//print_r( $user__list );\n\t\t\t\t$pagedata['user_list'] = $user__list; \n\t\t\t\t$pagedata['role'] = $rolecheck;\n\t\t\t\t$this->load->view('dashboard/header');\n\t\t\t\t \n\t\t\t\tif($rolecheck == 'client'){\n\t\t\t\t\t$active_listings = $this->InteractModal->get_active_listings_count();\n\t\t\t\t\t$pagedata['active_listings'] = $active_listings;\n\t\t\t\t\t$this->load->view('dashboard/users-new', $pagedata); \n\t\t\t\t\t \n\t\t\t\t}else{\n\t\t\t\t\t$this->load->view('dashboard/users', $pagedata);\n\t\t\t\t}\t\n\t\t\t\t\t$this->load->view('dashboard/footer');\n\t\t\tendif;\n\t\telse:\n\t\t\tredirect( base_url( 'Interact/login' ));\n\t\tendif;\n\t}", "public function hasJoinRequestsList()\n {\n return $this->join_requests !== null;\n }", "private function onJoin()\n {\n $payload = $this->clientEvent->getPayload();\n\n if ($this->authUserByToken($payload['token'] ?? null)) {\n $this->send($this->replyEvent());\n\n $this->send(\n (new StateContentEvent(\n $this->getService('quest.quest_manager')->getStateData($this->getUserId())\n ))\n );\n }\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }", "public function memberList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function checkUsersSession(){\n\t}", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function getUserList()\n {\n// return view('admin.module.user.list', ['data' => $data]);\n $userCurrentLogin = Auth::user()->id;\n $user = User::find($userCurrentLogin);\n if ($userCurrentLogin == 2) {\n $data = User::select('id', 'username', 'level')->get()->toArray();\n return view('admin.module.user.list', ['data' => $data]);\n } elseif ($user['level'] == 1) {\n $data = User::select('id', 'username', 'level')->where('id', '<>', 2)->get()->toArray();\n return view('admin.module.user.list', ['data' => $data]);\n } else {\n echo \"Bạn không có quyền truy cập\";\n }\n }", "public function court_members()\n {\n\n $query = \"SELECT * FROM users join users_court on users.id = users_court.user_id WHERE users_court.court1_id = $this->thiscourt or users_court.court2_id = $this->thiscourt\";\n $cart_result = @mysqli_query($this->dbc, $query) or die(\"Couldn't ViewSql users lists:(\" . mysqli_error($this->dbc));\n $this->num_rows = mysqli_num_rows($cart_result);\n\n while ($row = mysqli_fetch_assoc($cart_result)) {\n\n $court_in_list .= $row['user_id'] . \", \";\n\n $this->userlist .= \"<li><a href='users-details.php?user_id=\" . $row['user_id'] . \"'> \" . openssl_decrypt(clean($row['firstname']), ENCRYPTION_METHOD, ENCRYPTION_KEY) . \" \" .\n openssl_decrypt(clean($row['lastname']), ENCRYPTION_METHOD, ENCRYPTION_KEY) .\n \" (\" .$row['status'] .\n \")</a></li>\";\n }\n\n $court_in_list = rtrim($court_in_list, \", \");\n $this->court_in = \"(\" . $court_in_list . \")\";\n\n }", "public function join(User $user, User $model) {\n if ($user->hasRole(AuthServiceProvider::ADMIN)) return true;\n if ($user->hasPermissionTo('benutzer-bearbeiten')) return true;\n }", "public function is_watched_by_auth_user() {\n $id = Auth::id();\n\n\n $watcher_user_ids = [];\n\n foreach($this->watchers as $watcher) {\n\n //ja polnime nizata so user_id-s od konkretniot watcher\n $watcher_user_ids[] = $watcher->user_id;\n\n }\n\n // go sporeduvame sekoj user_id od watchers so id-to na logiraniot user\n if(in_array($id, $watcher_user_ids)){\n\n return true;\n }else{\n\n return false;\n }\n\n\n }", "function user_joined_groups($uid, $limit = NULL) {\n global $db;\n # REF QUERY : SELECT * FROM group_members,groups WHERE group_members.userid = '1' AND group_members.group_id = groups.group_id AND groups_members.userid != groups.userid\n $result = $db->select(tbl($this->gp_tbl) . ',' . tbl($this->gp_mem_tbl), \"*\", tbl($this->gp_mem_tbl) . \".userid='$uid' AND \n \" . tbl($this->gp_mem_tbl) . \".group_id = \" . tbl($this->gp_tbl) . \".group_id\", $limit, tbl($this->gp_tbl) . \".group_name\");\n \n if ($db->num_rows > 0)\n return $result;\n else\n return false;\n }", "public function getUsersList()\n {\n }", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "public function memberIdList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}", "public function testMeetupWillBeListedForPermittedUsers()\n {\n $data = array(\n 'permission' => 'custom',\n 'permittedUsers' => array('5003e8bc757df2020d000000'),\n );\n list($responseCode, $responseBody) = sendPutRequest($this->endpoint .'/5003e8bc757df2020d0f0033', $data, $this->user1Headers);\n\n list($responseCode, $responseBody2) = sendGetRequest($this->endpoint, array(), $this->user2Headers);\n $retrievedForUser2 = json_decode($responseBody2);\n\n list($responseCode, $responseBody3) = sendGetRequest($this->endpoint, array(), $this->user3Headers);\n $retrievedForUser3 = json_decode($responseBody3);\n\n $this->assertSame(2, count($retrievedForUser2));\n $this->assertSame(3, count($retrievedForUser3));\n }", "public function isMemberJoined($email='')\n\t\t\t{\n\t\t\t\t$sql = 'SELECT user_name, first_name, last_name, user_id'.\n\t\t\t\t\t\t' FROM '.$this->CFG['db']['tbl']['users'].\n\t\t\t\t\t\t' WHERE email='.$this->dbObj->Param($email).\n\t\t\t\t\t\t' AND usr_status=\\'Ok\\' LIMIT 1';\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt, array($email));\n\t\t\t\tif (!$rs)\n\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t$user_details = array();\n\t\t\t\tif ($rs->PO_RecordCount())\n\t\t\t\t\t{\n\t\t\t\t\t\t$user_details = $rs->FetchRow();\n\t\t\t\t\t}\n\t\t\t\treturn $user_details;\n\t\t\t}", "function addToRecipientsList(array $data) {\n global $CFG_GLPI;\n\n $new_target = null;\n $new_lang = '';\n\n // Default USER TYPE is ANONYMOUS\n $notificationoption = ['usertype' => self::ANONYMOUS_USER];\n\n if (isset($data['language'])) {\n $new_lang = trim($data['language']);\n }\n $username = '';\n if (isset($data['name']) && !empty($data['name'])) {\n $username = $data['name'];\n }\n if (isset($data['users_id']) && ($data['users_id'] > 0)) {\n $user = new User();\n if (!$user->getFromDB($data['users_id'])\n || ($user->getField('is_deleted') == 1)\n || ($user->getField('is_active') == 0)\n || (!is_null($user->getField('begin_date'))\n && ($user->getField('begin_date') > $_SESSION[\"glpi_currenttime\"]))\n || (!is_null($user->getField('end_date'))\n && ($user->getField('end_date') < $_SESSION[\"glpi_currenttime\"]))) {\n // unknown, deleted or disabled user\n return false;\n }\n $filt = getEntitiesRestrictCriteria('glpi_profiles_users', '', $this->getEntity(),\n true);\n $prof = Profile_User::getUserProfiles($data['users_id'], $filt);\n if (!count($prof)) {\n // No right on the entity of the object\n return false;\n }\n if (empty($username)) {\n $username = formatUserName(0, $user->getField('name'), $user->getField('realname'),\n $user->getField('firstname'), 0, 0, true);\n }\n // It is a GLPI user :\n $notificationoption['usertype'] = self::GLPI_USER;\n if ($user->fields['authtype'] == Auth::LDAP\n || Auth::isAlternateAuth($user->fields['authtype'])\n || (($user->fields['authtype'] == Auth::NOT_YET_AUTHENTIFIED)\n && Auth::isAlternateAuth(Auth::checkAlternateAuthSystems()))) {\n $notificationoption['usertype'] = self::EXTERNAL_USER;\n }\n }\n\n // Pass user type as argument ? forced for specific cases\n if (isset($data['usertype'])) {\n $notificationoption['usertype'] = $data['usertype'];\n }\n\n $notificationoption = array_merge($this->addAdditionnalUserInfo($data),\n $notificationoption);\n\n $param = [\n 'language' => (empty($new_lang) ? $CFG_GLPI[\"language\"] : $new_lang),\n 'additionnaloption' => $notificationoption,\n 'username' => $username\n ];\n if (isset($data['users_id']) && $data['users_id']) {\n $param['users_id'] = $data['users_id'];\n }\n\n $eventclass = $this->event;\n $target_field = $eventclass::getTargetField($data, $param);\n if ($data[$target_field] !== null) {\n $param[$target_field] = $data[$target_field];\n $this->target[$data[$target_field]] = $param;\n }\n\n if (isset($data['users_id']) && $data['users_id']) {\n $this->recipient_data = [\n 'itemtype' => User::class,\n 'items_id' => $data['users_id'],\n ];\n Plugin::doHook('add_recipient_to_target', $this);\n unset($this->recipient_data);\n }\n }", "public static function get_users_in_context(userlist $userlist) {\n $context = $userlist->get_context();\n if (is_a($context, \\context_module::class)) {\n $para = ['instanceid' => $context->id, 'modulelevel' => CONTEXT_MODULE, 'modulename' => 'attendanceregister'];\n $sql = \"SELECT at.userid FROM {attendanceregister} ar\n JOIN {modules} m ON m.name = :modulename\n JOIN {course_modules} cm ON cm.instance = ar.id AND cm.module = m.id\n JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :modulelevel\n JOIN {attendanceregister_session} at ON at.register = ar.id WHERE ctx.id = :instanceid\";\n $userlist->add_from_sql('userid', $sql, $para);\n $sql = \"SELECT at.addedbyuserid FROM {attendanceregister} ar\n JOIN {modules} m ON m.name = :modulename\n JOIN {course_modules} cm ON cm.instance = ar.id AND cm.module = m.id\n JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :modulelevel\n JOIN {attendanceregister_session} at ON at.register = ar.id WHERE ctx.id = :instanceid\";\n $userlist->add_from_sql('addedbyuserid', $sql, $para);\n $sql = \"SELECT at.userid FROM {attendanceregister} ar\n JOIN {modules} m ON m.name = :modulename\n JOIN {course_modules} cm ON cm.instance = ar.id AND cm.module = m.id\n JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :modulelevel\n JOIN {attendanceregister_aggregate} at ON at.register = ar.id WHERE ctx.id = :instanceid\";\n $userlist->add_from_sql('userid', $sql, $para);\n $sql = \"SELECT at.userid FROM {attendanceregister} ar\n JOIN {modules} m ON m.name = :modulename\n JOIN {course_modules} cm ON cm.instance = ar.id AND cm.module = m.id\n JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :modulelevel\n JOIN {attendanceregister_lock} at ON at.register = ar.id WHERE ctx.id = :instanceid\";\n $userlist->add_from_sql('userid', $sql, $para);\n }\n }", "public static function isJoined (array|string|int $ids , int|null $user_id = null): bool {\n if (!is_array($ids)) {\n $ids = [$ids];\n }\n $user_id = $user_id ?? request::catchFields('user_id');\n\n foreach ($ids as $id) {\n $check = telegram::getChatMember($id,$user_id);\n if (telegram::$status) {\n $check = $check->status;\n if ($check === chatMemberStatus::LEFT || $check === chatMemberStatus::KICKED) {\n return false;\n }\n }\n }\n return true;\n }", "function usersList($da){\r\n\t\t\treturn $this->trouverTout();\r\n\t\t}", "public function user_lists(){\n return get_instance()->ecl('Instance')->mod('lists', 'user_lists', [get_instance()->ecl('Instance')->user(),'email']);\n }", "public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}", "public function user_in_tribe_check($loginUserId,$searchId)\n { \n /*If search is created by login user then dont Check login user is in tribe */\n $searchCheck = \"SELECT * FROM searchcriteria s WHERE s.searchId = $searchId AND s.userId = $loginUserId\";\n $result = $this->db->query($searchCheck);\n if ($result->num_rows()>0) {\n return true;\n }else{\n $sql1 = \"SELECT * from tribe t where t.searchId = $searchId AND (t.touserId =$loginUserId OR t.fromuserId =$loginUserId) AND t.status = 'accept' AND t.deleteFlag != 1\";\n //echo $sql1;exit();\n $record = $this->db->query($sql1);\n if ($record->num_rows()>0) {\n return true;\n } \n }\n }", "public function userslist(Request $request) {\n\n $roles = DB::table('roles')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $userRoleRelations = DB::table('user_role_relations')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $userRoles = array();\n foreach ($userRoleRelations as $usrole) {\n $pc['id'] = $usrole->id;\n $pc['user_id'] = $usrole->user_id;\n $pc['role_id'] = $usrole->role_id;\n $role = Role::find($usrole->role_id);\n $pc['role_name'] = $role->name;\n $userRoles[] = $pc;\n }\n\n // filter apply if exists\n $userActivityFilter = request('userActivityFilter');\n $userRoleFilter = request('userRoleFilter');\n\n if ((!empty($userRoleFilter)) || (!empty($userActivityFilter))) {\n\n $users = User::select('users.id', 'users.first_name', 'users.last_name', 'users.is_active', 'users.email')\n ->leftjoin('user_role_relations', 'users.id', '=', 'user_role_relations.user_id')\n ->leftjoin('roles', 'roles.id', '=', 'user_role_relations.role_id')\n ->where('user_role_relations.deleted_at', '=', NULL)\n ->where('users.deleted_at', '=', NULL)\n ->where('roles.deleted_at', '=', NULL);\n if ($userRoleFilter != 'all') {\n $users->where('roles.id', '=', $userRoleFilter);\n }\n if (!empty($userActivityFilter)) {\n if ($userActivityFilter == 1) {\n $users->where('users.is_active', '=', $userActivityFilter);\n } else if ($userActivityFilter == 2) {\n $users->where('users.is_active', '=', 0);\n }\n }\n $users = $users->orderBy('users.id', 'desc')->groupBy('users.id')->get();\n// $users = $users->orderBy('users.id', 'desc')->distinct()->get();\n\n return view('user.usersfilter', compact('users', 'roles', 'userRoleRelations', 'userRoles'))->render();\n }\n\n\n $users = User::sortable()->whereNull('deleted_at')->orderBy('users.id', 'desc')->paginate(10);\n $modules = DB::table('modules')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $modulePermissions = DB::table('permissions')->whereNull('deleted_at')->orderBy('id', 'desc')->get();\n $serviceProviders = array();\n $serviceProviderRoleIds = array();\n $serviceProviderRoles = DB::table('roles')->whereNull('deleted_at')->where('roles.is_service_provider', '=', true)->orderBy('id', 'desc')->get();\n if ($serviceProviderRoles) {\n foreach ($serviceProviderRoles as $serviceProviderRole) {\n $spr['role_id'] = $serviceProviderRole->id;\n $serviceProviderRoleIds[] = $spr;\n }\n }\n if (count($serviceProviderRoleIds) > 0) {\n $serviceProviders = User::sortable()\n ->select('users.id', 'users.first_name', 'users.last_name', 'users.email', 'roles.name as name')\n ->leftjoin('user_role_relations', 'users.id', '=', 'user_role_relations.user_id')\n ->leftjoin('roles', 'roles.id', '=', 'user_role_relations.role_id')\n ->whereIn('user_role_relations.role_id', $serviceProviderRoleIds)\n ->where('user_role_relations.deleted_at', '=', NULL)\n ->where('users.deleted_at', '=', NULL)\n ->where('roles.deleted_at', '=', NULL)\n ->orderBy('users.id', 'desc')\n ->get();\n }\n //print_r($serviceProviders);exit;\n\n return view('user.userslist', compact('users', 'roles', 'userRoleRelations', 'userRoles', 'modules', 'modulePermissions', 'serviceProviders'));\n }", "function hc_users($args){\n\t\t$users = hc_get_users($args);\n\t\tif ( is_wp_error($users) ){\n\t\t\t\techo $users->get_error_message();\n\t\t\t\treturn false;\n\t\t}\n\t\tforeach ($users as $key => $user) {\n\t\t\techo '<ul class=\"hc_user_list\">';\n\t\t\techo '<li class=\"hc_user_name\">'.$user->display_name.'</li>';\n\t\t\techo '<li class=\"hc_user_gravatar\">'.$user->gravatar.'</li>';\n\t\t\techo '<ul class=\"hc_user_info\">';\n\t\t\t\tforeach ($user as $field => $value) {\n\t\t\t\t\tif (($field !=' display_name' && $field != 'gravatar') && $value != '') {\n\t\t\t\t\t\tif ($field == 'user_url') {\n\t\t\t\t\t\t\techo '<li><a href=\"'.$value.'\">'.$value.'</a></li>';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<li>'.$value.'</li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\techo '</ul>';\n\t\t\techo '</ul>';\n\t\t}\n\t}", "public function join(User $user, Activity $activity)\n {\n\t\treturn !$activity->participants->contains($user->id);\n }", "function forum_user_check() {\n\t global $vbulletin;\n\n\t // SEARCH VB DATABASE FOR LOGGED-IN SE USER\n\t $vb_user_query = $vbulletin->db->query_write(\"SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM \" . TABLE_PREFIX . \"user WHERE username='\".$this->user_info[user_username].\"' LIMIT 1\");\n\n\t // RETURN TRUE/FALSE IF VB USER EXISTS\n\t if($vbulletin->db->num_rows($vb_user_query) == 1) {\n\t $this->forum_user = $vbulletin->db->fetch_array($vb_user_query);\n\t return true;\n\t } else {\n\t return false;\n\t }\n\n\t}", "function memberlist_list() {\r\n\tglobal $wpdb;\r\n\tif (!current_user_can('manage_options')) {\r\n\t\twp_die('You do not have sufficient permissions!');\r\n\t}\r\n\t\r\n\tmemberlist_post_action();\r\n}", "private function _isListMemberLimitReached($listname)\r\n {\r\n $members = $this->getMembers($listname);\r\n return self::LIST_MEMBER_LIMIT < count($members->users->user);\r\n }", "public function hasuser()\n {\n return is_object($this->luser);\n }", "public function hasMultipleAccounts();", "function list_users() {\n $status = session_status();\n if($status == PHP_SESSION_NONE){\n session_start(); /// initialize session\n }\n $user_name = check_logged(); /// function checks if visitor is logged in.\n if (!$user_name)\n return;\n\n $allowed = false;\n if (!check_role( \"admin\" )) {\n return false;\n }\n\n // read the permissions database\n $d = loadDB();\n return $d[\"users\"];\n }", "public function test_join_waitlist()\n {\n $response = $this->post('/api/v1/subscribers', [\n 'email' => $this->email,\n ]);\n\n $response\n ->assertStatus(201)\n ->assertJson([\n 'position' => true,\n ]);\n\n $this->assertDatabaseHas('subscribers', [\n 'email' => $this->email,\n ]);\n }", "public function hasUsershow(){\n return $this->_has(32);\n }", "public function acceptJoinRequest()\n {\n $validations = ['isRoleOrganizer', 'issetJoinRequest'];\n $request = Validations::manageValidations($validations);\n if ($request != false) {\n if ($request->accept == 1) {\n $query = \"UPDATE activities_users SET pending = 0 WHERE user_id = $request->user_id and activity_id = $request->activity_id\";\n } else {\n $query = \"DELETE FROM activities_users WHERE user_id = $request->user_id and activity_id = $request->activity_id\";\n }\n return $this->connection->nonQueryId($query);\n }\n return 'invalid data';\n }", "function status()\n{\n\t$username = $this->Session->read('user');\n\tif (!$username){\n\t$this->redirect('/users/login');}\n\t\n\t// set knownusers\n\t$this->set('knownusers', $this->User->findAll(null, array('id', 'username',\n\t'first_name', 'last_name', 'last_login'), 'id DESC'));\n}", "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "function getUserList() {\n $connection = openConnection(); // connect to database\n echo '<tr class=\"userEntry\">'; // create select tag with id of country so it can be selected in Register.js\n $query = mysqli_query($connection, 'SELECT `user_id`, `full_name`, `acc_active` FROM `tbl_members`'); // create query to select record from user_id and full_name columns\n if(mysqli_num_rows($query) > 0) { // if a record exists then...\n while($option_row = mysqli_fetch_array($query, MYSQLI_NUM)) { // fetch query result as a numbered array and assign as $option_row\n // Ref: $option_row[0] = 'user_id', $option_row[1] = 'full_name', $option_row[2] = 'acc_active'\n if($option_row[0] === $_SESSION['user_id'] || $option_row[2] != 1) { // if current row user_id matches logged in user or if user account is not active then...\n // do not display record\n } else { // otherwise display user record in table\n echo \"<td class='user_name'>\" . $option_row[1] . \"</td>\"; // create table cell with full_name displayed\n echo \"<td></td>\"; // create a cell which will say if a follower or not\n echo \"<td><a href='#' id='follow_\" . $option_row[0] . \"' class='actionFollowUser'>Follow</a></td>\"; // action to follow a user\n echo \"<td><a href='#' id='wall_\" . $option_row[0] . \"' class='actionViewUserWall'>View Wall</a></td>\"; // create table cell with user_id as tag id which is passed to indentify user wall\n echo \"<td><a href='#'id='chat_\" . $option_row[0] . \"' class='actionChatMessage'>Send Message</a></td>\"; // create table cell with chat-user_id as tag id which is passed to indentify chat group\n echo \"<td><a href='#' id='report_\" . $option_row[0] . \"' class='actionReportUser'>Report User</a></td>\"; // create table cell with report user action link\n echo '</tr>'; // close select tag\n }\n }\n } \n closeConnection($connection); // close database connection\n}", "public function findUsers($args)\n {\n // Need read access to call this function\n if (!SecurityUtil::checkPermission(\"{$this->name}::\", '::', ACCESS_READ)) {\n return false;\n }\n\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n $dbtable = DBUtil::getTables();\n $userstable = $dbtable['users'];\n $userscolumn = $dbtable['users_column'];\n\n // Set query conditions (unless some one else sends a hardcoded one)\n $where = array();\n if (!isset($args['condition']) || !$args['condition']) {\n // Do not include anonymous user\n $where[] = \"({$userscolumn['uid']} != 1)\";\n\n foreach ($args as $arg => $value) {\n if ($value) {\n switch($arg) {\n case 'uname':\n // Fall through to next on purpose--no break\n case 'email':\n $where[] = \"({$userscolumn[$arg]} LIKE '%\".DataUtil::formatForStore($value).\"%')\";\n break;\n case 'ugroup':\n $uidList = UserUtil::getUsersForGroup($value);\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n break;\n case 'regdateafter':\n $where[] = \"({$userscolumn['user_regdate']} > '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'regdatebefore':\n $where[] = \"({$userscolumn['user_regdate']} < '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'dynadata':\n if ($useProfileMod) {\n $uidList = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata', array(\n 'dynadata' => $value\n ));\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n }\n break;\n default:\n // Skip unknown values--do nothing, and no error--might be other legitimate arguments.\n }\n }\n }\n }\n // TODO - Should this exclude pending delete too?\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . \")\";\n $where = 'WHERE ' . implode(' AND ', $where);\n\n $permFilter = array();\n $permFilter[] = array(\n 'realm' => 0,\n 'component_left' => $this->name,\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'uname',\n 'instance_middle' => '',\n 'instance_right' => 'uid',\n 'level' => ACCESS_READ,\n );\n $objArray = DBUtil::selectObjectArray('users', $where, 'uname', null, null, null, $permFilter);\n\n return $objArray;\n }", "public function who_did_see(){\n \t$feedback_id = $this->input->post('feedback_id') ;\n \t$this->db->join('user' , 'usr_id = wds_user_id');\n \t$users = $this->m_who_did_see->get_by(array('feedback_id' => $feedback_id)) ;\n \tforeach ($users as $key => $user){\n \t\techo '<li>' . $user->usr_fname . ' ' . $user->usr_lname . ' -- ' . jdate('H:i:s Y/m/d' ,strtotime($user->wds_time)) . '</li>' ; \n \t}\n }", "function is_joinable($group, $uid = NULL, $gen_err = FALSE) {\n if (!$uid)\n $uid = userid();\n\n $group_id = $group['group_id'];\n if ($this->is_member($uid, $group['group_id'])) {\n if ($gen_err)\n e(lang('grp_join_error'));\n return false;\n }elseif ($group['group_privacy'] != 2 || $this->is_invited($uid, $group_id, $group['userid'], $gen_err))\n return true;\n else\n return false;\n }", "function ulist_op()\n\t{\n\t\t$club_id = 0;\n\t\tif (isset($_REQUEST['club_id']))\n\t\t{\n\t\t\t$club_id = (int)$_REQUEST['club_id'];\n\t\t}\n\t\t\n\t\t$num = 0;\n\t\tif (isset($_REQUEST['num']))\n\t\t{\n\t\t\t$num = (int)$_REQUEST['num'];\n\t\t}\n\t\t\n\t\t$name = '';\n\t\tif (isset($_REQUEST['name']))\n\t\t{\n\t\t\t$name = $_REQUEST['name'];\n\t\t}\n\t\t\n\t\tarray();\n\t\tif (!empty($name))\n\t\t{\n\t\t\t$name_wildcard = '%' . $name . '%';\n\t\t\t$query = new DbQuery(\n\t\t\t\t'SELECT u.id, u.name as _name, NULL, u.flags, c.name FROM users u' .\n\t\t\t\t\t' LEFT OUTER JOIN clubs c ON c.id = u.club_id' .\n\t\t\t\t\t' WHERE (u.name LIKE ? OR u.email LIKE ?) AND (u.flags & ' . USER_FLAG_BANNED . ') = 0' .\n\t\t\t\t\t' UNION' .\n\t\t\t\t\t' SELECT DISTINCT u.id, u.name as _name, r.nick_name, u.flags, c.name FROM users u' .\n\t\t\t\t\t' LEFT OUTER JOIN clubs c ON c.id = u.club_id' .\n\t\t\t\t\t' JOIN registrations r ON r.user_id = u.id' .\n\t\t\t\t\t' WHERE r.nick_name <> u.name AND (u.flags & ' . USER_FLAG_BANNED . ') = 0 AND r.nick_name LIKE ? ORDER BY _name',\n\t\t\t\t$name_wildcard,\n\t\t\t\t$name_wildcard,\n\t\t\t\t$name_wildcard);\n\t\t}\n\t\telse if ($club_id > 0)\n\t\t{\n\t\t\t$query = new DbQuery('SELECT u.id, u.name, NULL, u.flags, c.name FROM users u JOIN user_clubs uc ON u.id = uc.user_id LEFT OUTER JOIN clubs c ON c.id = u.club_id WHERE uc.club_id = ? AND (uc.flags & ' . USER_CLUB_FLAG_BANNED . ') = 0 AND (u.flags & ' . USER_FLAG_BANNED . ') = 0 ORDER BY rating DESC', $club_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = new DbQuery('SELECT u.id, u.name, NULL, u.flags, c.name FROM users u LEFT OUTER JOIN clubs c ON c.id = u.club_id WHERE (u.flags & ' . USER_FLAG_BANNED . ') = 0 ORDER BY rating DESC');\n\t\t}\n\t\t\n\t\tif ($num > 0)\n\t\t{\n\t\t\t$query->add(' LIMIT ' . $num);\n\t\t}\n\t\t\n\t\t$list = array();\n\t\twhile ($row = $query->next())\n\t\t{\n\t\t\tlist ($u_id, $u_name, $nick, $u_flags, $club_name) = $row;\n\t\t\t$p = new GPlayer($u_id, $u_name, $club_name, $u_flags, USER_CLUB_PERM_PLAYER);\n\t\t\tif ($nick != NULL && $nick != $u_name)\n\t\t\t{\n\t\t\t\t$p->nicks[$nick] = 1; \n\t\t\t}\n\t\t\t$list[] = $p;\n\t\t}\n\t\t$this->response['list'] = $list;\n\t}", "function userslist($req,$active_room)\n{\n\twhile( $data = mysql_fetch_assoc($req) )\n\t{\t\n\t\t$status = \"\";\n\t\n\t\t// Auth ? // Admin ?\n\t\t$sql2 = \"SELECT * FROM users_registered WHERE user='\".$data['user'].\"'\";\n\t\t$req2 = query($sql2);\n\t\t$count = num_rows($sql2);\n\t\tif($count > 0 and isset($_SESSION['auth']) and $_SESSION['auth'] == 1) $status .= \"+i\"; else $status .= \"-i\";\n\t\n\t\t// Voiced ?\n\t\tif($data['voice']) $status .= \"+v\"; else $status .= \"-v\";\n\t\n\t\t// API key ?\n\t\tif(isset($data['apikey']) and !empty($data['apikey'])) $status .= \"+k\"; else $status .= \"-k\";\n\t\n\t\t// Admin ?\n\t\tif($count > 0)\n\t\t{\n\t\t\t$data2 = mysql_fetch_assoc($req2);\n\t\t\tif($data2['admin']) $status = \"@\";\n\t\t}\n\t\t\n\t\t// User\n\t\t$user = $data['user'];\n\t\t\n\t\tif($data['afk'])\n\t\t{\n\t\t\t$user = \"<span class=\\\"user-afk\\\">$user</span>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Focus\n\t\t\tif($data['focus'])\n\t\t\t\t$user = \"<span class=\\\"user-online\\\">$user</span>\";\n\t\t\telse\n\t\t\t\t$user = \"<span class=\\\"user-background\\\">$user</span>\";\n\t\t}\n\t\t\n\t\t// Dans la même salle que moi ?\n\t\tif($active_room == 0)\n\t\t\t$room = \"&bull;\";\n\t\telse\n\t\t{\n\t\t\t$rooms = new Rooms();\n\t\t\t$sameroom = $rooms->isUserInRoom($active_room,$data['user']);\n\t\t\tif($sameroom)\n\t\t\t\t$room = \"<span style=\\\"font-size:1em;\\\">&bull;</span>\";\n\t\t\telse\n\t\t\t{\n\t\t\t\t$room = \"\";\n\t\t\t\t$user = \"<s>$user</s>\";\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t// Afficher\n\t\techo \"<tr>\";\n\t\techo \"<td>$room</td>\";\n\t\techo \"<td style=\\\"font-size:0.8em;font-style:normal;font-weight:normal;text-align:right;\\\">\";\n\t\techo \"$status\";\n\t\techo \"</td>\";\n\t\techo \"<td style=\\\"text-align:left;\\\">\";\n\t\techo \"\\n<span class=\\\"user\\\" name=\\\"normal\\\" id=\\\"user_\".$data['id'].\"\\\" onclick=\\\"mp('\".$data['user'].\"')\\\" onmouseover=\\\"enlight('\".$data['user'].\"',true)\\\" onmouseout=\\\"enlight('\".$data['user'].\"',false)\\\">\";\n\t\techo \"&nbsp;\".$user;\n\t\techo \"</span>\";\n\t\techo \"</td></tr>\";\n\t}\n}", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "static function user_has_added_user($user1, $user2) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' \n FROM `relationship` \n WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\" AND `relationship`.`type` = 1;\";\n $query = mysqli_query($con, $sql);\n return (mysqli_fetch_object($query)->count == 1);\n }", "public function joinAction()\n {\n $roomId = $this->_getParam('id');\n $nickname = $this->_getParam('nick_name');\n if ( ! $roomId OR ! $nickname) {\n $this->badRequestAction();\n }\n \n // validate the room id\n if (strlen($roomId) > 100) {\n $this->failure(ERROR_FORM_VALIDATION_FAILURE);\n }\n \n $userDto = Zend_Registry::get('api_user');\n $result = $this->getBusiness()->join($roomId, $userDto, $nickname);\n \n $this->fromArray($result);\n }", "public function showUsers()\n {\n $role = Sentinel::findRoleBySlug('Client');\n $id=Sentinel::getUser()->id;\n $users=$role->users()->with('roles')->get();\n if($users->isNotEmpty()){\n $roles = Sentinel::findRoleBySlug('Client')->get();\n \n $roletype= $roles[1]->name;\n \n return view('Admins.viewUsers',compact('users','roletype'));\n }\n else\n {\n return view('Admins.viewUsers',compact('users'));\n }\n }", "public function findUsers();", "public function findUsers();", "function user_index()\n\t{\n\t\t$contact = $this->contact_details();\n\t\t$credentials = $this->MailchimpCredential->first();\n\t\tif(!empty($credentials))\n\t\t{\n\t\t\t# Copy access_token\n\t\t\t# GET LIST FROM MAILCHIMP\n\t\t\t$lists = $this->Mailchimp->get(\"lists\");\n\n\t\t\t# ALWAYS MAKE SURE WE HAVE CORE LISTS\n\t\t\t$listNames = Set::extract($lists['lists'], \"{n}.name\");\n\n\n\t\t\t$missingListNames = array_diff($this->listNames,$listNames);\n\n\t\t\t# Create initial list.\n\t\t\tif(!empty($missingListNames))\n\t\t\t{\n\t\t\t\tforeach($missingListNames as $listName)\n\t\t\t\t{\n\t\t\t\t\t# Make 'Subscribers' default list (ie for subscribe form on homepage)\n\t\t\t\t\t$this->Mailchimp->create_list($listName,$contact);\n\n\t\t\t\t}\n\n\t\t\t\t$lists = $this->Mailchimp->get(\"lists\");\n\t\t\t}\n\n\t\t\t$subscribers = $list_names = array();\n\n\t\t\tforeach($lists['lists'] as $l)\n\t\t\t{\n\t\t\t\t$lid = $l['id'];\n\t\t\t\t$lname = $l['name'];\n\t\t\t\t#echo \"LID=$lid, LNAME=$lname\\n\";\n\t\t\t\t$list_names[$lid] = $lname;\n\t\t\t\t$list_totals[$lid] = $l['stats']['member_count'];\n\t\t\t\t$subscribers[$lid] = $this->Mailchimp->members($lid);\n\t\t\t}\n\n\t\t\t$this->set(\"lists\", $subscribers);\n\t\t\t$this->set(\"list_names\", $list_names);\n\t\t\t$this->set(\"list_totals\", $list_totals);\n\t\t}\n\t}", "public function isFriendsWith($user_guid);", "function userIsNew($username)\n{\n //fetch list of usernames.\n $allUsers = mysql_query(\"SELECT Email FROM Users\")\n or die('Problem getting country list: '.mysql_error());\n //browse that list until entry found\n while ($requiredUser = mysql_fetch_array($allUsers))\n {\n if ($username == $requiredUser['Email'])\n {return false;}\n } //while \n //if it has reach this point, no entry has been found\n return true;\n}", "public function test_get_users_in_context() {\n $dg = $this->getDataGenerator();\n $c1 = $dg->create_course();\n $component = 'mod_lesson';\n\n $u1 = $dg->create_user();\n $u2 = $dg->create_user();\n $u3 = $dg->create_user();\n $u4 = $dg->create_user();\n $u5 = $dg->create_user();\n $u6 = $dg->create_user();\n\n $cm1 = $dg->create_module('lesson', ['course' => $c1]);\n $cm2 = $dg->create_module('lesson', ['course' => $c1]);\n\n $cm1ctx = context_module::instance($cm1->cmid);\n $cm2ctx = context_module::instance($cm2->cmid);\n\n $this->create_attempt($cm1, $u1);\n $this->create_grade($cm1, $u2);\n $this->create_timer($cm1, $u3);\n $this->create_branch($cm1, $u4);\n $this->create_override($cm1, $u5);\n\n $this->create_attempt($cm2, $u6);\n $this->create_grade($cm2, $u6);\n $this->create_timer($cm2, $u6);\n $this->create_branch($cm2, $u6);\n $this->create_override($cm2, $u6);\n\n $context = context_module::instance($cm1->cmid);\n $userlist = new \\core_privacy\\local\\request\\userlist($context, $component);\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(5, $userids);\n $expected = [$u1->id, $u2->id, $u3->id, $u4->id, $u5->id];\n $actual = $userids;\n sort($expected);\n sort($actual);\n $this->assertEquals($expected, $actual);\n\n $context = context_module::instance($cm2->cmid);\n $userlist = new \\core_privacy\\local\\request\\userlist($context, $component);\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(1, $userids);\n $this->assertEquals([$u6->id], $userids);\n }", "public function hasUserMapList()\n {\n return $this->user_map !== null;\n }", "public function FolloWer_User_List($uid,$lastFrid) {\n\t$uid=mysqli_real_escape_string($this->db,$uid);\n\t if($lastFrid) {\n\t\t$lastFrid = \"AND F.friend_id >'\".$lastFrid.\"'\";\t\n\t }\n\t // The query to select for showing user details\n\t $query=mysqli_query($this->db,\"SELECT U.username,U.uid,F.friend_id FROM users U, friends F WHERE U.status='1' AND U.uid=F.friend_one AND F.friend_two='$uid' $lastFrid AND F.role='fri' ORDER BY F.friend_id DESC LIMIT \" .$this->perpage) or die(mysqli_error($this->db));\n\t while($row=mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t // Store the result into array\n\t\t $data[]=$row;\n\t\t }\n\t if(!empty($data)) {\n\t\t// Store the result into array\n\t\t return $data;\n\t\t} \n}", "public static function joinChecker (array|string|int $ids , int|null $user_id = null): array {\n if (!is_array($ids)) {\n $ids = [$ids];\n }\n $user_id = $user_id ?? request::catchFields('user_id');\n\n $result = [];\n foreach ($ids as $id) {\n $check = telegram::getChatMember($id,$user_id);\n if (telegram::$status) {\n $check = $check->status;\n $result[$id] = $check !== chatMemberStatus::LEFT && $check !== chatMemberStatus::KICKED;\n }\n else $result[$id] = null;\n }\n return $result;\n }", "public static function GenerateList($db, $name)\n {\n $users = $db->Query('SELECT username, email, joining FROM user ORDER BY joining DESC');\n $users->execute();\n foreach ($users as $r) {\n if ($r['username'] == $name) {\n $list_name = '<h5 class=\"mb-1\"><strong>' . $r['username'] . '</strong></h5>';\n $ind = '<span class=\"badge badge-info badge-pill\" id=\"badge-' . $name . '\">You</span>';\n } else {\n $list_name = '<h5 class=\"mb-1\">' . $r['username'] . '</h5>';\n $ind = '';\n }\n print('<a href=\"#\" id=\"item-' . $r['username'] . '\" class=\"list-group-item list-group-item-action flex-column align-items-start\">\n <div class=\"row\">\n <div class=\"col-md-9\">\n <div class=\"d-flex w-100 justify-content-between\">' .\n $list_name . '\n <small>joined on:' . $r['joining'] . '</small>\n </div>\n <p class=\"mb-1\">' . $r['email'] . '</p> ' . $ind . '\n </div>\n <div class=\"col-md-3\">\n <button id=\"btn-' . $r['username'] . '\" class=\"btn btn-lg my-2 my-sm-0 mr-sm-2 btn-outline-info\" type=\"submit\" style=\"height: 100%; width: 100%;\" onclick=\"ModifyUser(\\'' . $r['username'] . '\\', \\'' . $r['email'] . '\\', \\'div-modify-user\\', false)\">Modify</button>\n </div>\n </div>\n </a>');\n }\n }", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "public function belongsToCurrent()\n {\n return Auth::id() == $this->user_id;\n }", "function sync_list_users( $list_id ) {\n\t\tif( !( $users = get_transient( '_um_mailchimp_sync_users' ) ) ) {\n\t\t\t//get all users with selected role and status\n\t\t\t$query_users = new \\WP_User_Query( array(\n\t\t\t\t'fields' => array( 'user_email', 'ID' )\n\t\t\t) );\n\t\t\t$users = $query_users->get_results();\n\t\t\t//set users list cache\n\t\t\tset_transient( '_um_mailchimp_sync_users', $users, 24 * 3600 );\n\t\t}\n\n\t\tif( count( $users ) > 0 ) {\n\t\t\t//get subscribers from mailchimp list\n\t\t\t$mailchimp_members = $this->get_external_list_users( $list_id );\n\n\t\t\t$subscribe = get_transient('_um_mailchimp_subscribe_users');\n\t\t\tforeach ( $users as $key => $user ) {\n\t\t\t\t$internal_user_lists = isset( $user->internal_lists ) ? $user->internal_lists : get_user_meta( $user->ID, \"_mylists\", true );\n\t\t\t\tif( is_array( $internal_user_lists ) && count( $internal_user_lists ) ) {\n\n\t\t\t\t\t//check if user isn't mailchimp subscriber for list with id $list_id but subscribed on current site\n\t\t\t\t\tif( !in_array( $user->user_email, $mailchimp_members ) && isset( $internal_user_lists[ $list_id ] ) ) {\n\t\t\t\t\t\t/*$this->mailchimp_subscribe()*/\n\n\t\t\t\t\t//check if user is mailchimp subscriber for list with id $list_id but didn't subscribed on current site\n\t\t\t\t\t} else if( in_array( $user->user_email, $mailchimp_members ) && !isset( $internal_user_lists[ $list_id ] ) ) {\n\t\t\t\t\t\tif( !is_array( $subscribe[ $list_id ] ) ) $subscribe[ $list_id ] = array();\n\t\t\t\t\t\t$subscribe[ $list_id ][] = $user;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif( !is_array( $subscribe[ $list_id ] ) ) $subscribe[ $list_id ] = array();\n\t\t\t\t\t$subscribe[ $list_id ][] = $user;\n\t\t\t\t}\n\t\t\t}\n\t\t\tset_transient( '_um_mailchimp_subscribe_users', $subscribe, 24 * 3600 );\n\t\t}\n\t}", "public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}", "public function canJoin($user_guid = 0){\n\n\t\t$result = false;\n\n\t\tif(empty($user_guid)){\n\t\t\t$user_guid = elgg_get_logged_in_user_guid();\n\t\t}\n\n\t\tif($user = get_user($user_guid)){\n\t\t\tif(!$this->isUser($user_guid)){\n\t\t\t\t// can join only returns true if you are not yet a member\n\t\t\t\tif($user->isAdmin() && empty($this->limit_admins)){\n\t\t\t\t\t// admin can join if not a private site\n\t\t\t\t\t$result = true;\n\t\t\t\t} else {\n\t\t\t\t\t// current membership\n\t\t\t\t\t$membership = $this->getMembership();\n\n\t\t\t\t\tswitch($membership){\n\t\t\t\t\t\tcase self::MEMBERSHIP_OPEN:\n\t\t\t\t\t\t\t// everyone can join\n\t\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase self::MEMBERSHIP_APPROVAL:\n\t\t\t\t\t\t\t// only after approval\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase self::MEMBERSHIP_DOMAIN:\n\t\t\t\t\t\tcase self::MEMBERSHIP_DOMAIN_APPROVAL:\n\t\t\t\t\t\t\t// based on email domain\n\t\t\t\t\t\t\tif($this->validateEmailDomain($user_guid)){\n\t\t\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase self::MEMBERSHIP_INVITATION:\n\t\t\t\t\t\t\t// if an outstanding invitation is available you can also join\n\t\t\t\t\t\t\t// this is NOT related to a membership type\n\t\t\t\t\t\t\tif($this->hasInvitation($user_guid, $user->email)){\n\t\t\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!$result && $this->hasInvitation($user_guid, $user->email)){\n\t\t\t\t\t\t// if user has been invited he can always join\n\t\t\t\t\t\t$result = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function loaded_user(string $id): bool { return isset($this->users[$id]); }", "function findUserAvailabilty($uname){\r\n global $connection;\r\n //querying for the list of admin usernames from admins table\r\n $query = \"select username from admins order by id;\";\t\t\r\n $adminset = mysqli_query($connection,$query);\r\n confirm_query($adminset);\r\n //conversting the retrieved query result into an assoc_array\r\n //that is $adminNames is a single row in the db.\r\n $adminNames = mysqli_fetch_assoc($adminset);\r\n if($adminNames != null){\r\n while($adminNames){\r\n if($adminNames['username'] == $uname){\r\n return true;\r\n } \r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n return false;\r\n}", "function bn_auto_group_join($userid, $x = 0, $y = 0){\r\n global $wpdb, $bp, $user_id;\r\n // get the user id\r\n if ($bp->loggedin_user->id && $x !== 'myid') {\r\n $userid = $bp->loggedin_user->id ; // current user if logged in. On activation, userid sent with do_action\r\n }\r\n\r\n // All users\r\n if($all_users_group = get_option('gaj_all_users_group')) {\r\n check_and_add_to_group($userid, $all_users_group);\r\n }\r\n\r\n // get profile fields with group linking\r\n $profiles = $wpdb->get_results(\"SELECT * FROM {$bp->profile->table_name_fields} WHERE group_link = 1\");\r\n foreach ($profiles as $profile) {\r\n\r\n // see what the person has for that field\r\n $profileinfo = $wpdb->get_results(\"SELECT value FROM {$bp->profile->table_name_data} WHERE user_id = $userid AND field_id = $profile->id\");\r\n foreach ($profileinfo as $profilevalue ) {\r\n\r\n // see if we can match the group\r\n $groupmatches = $wpdb->get_results(\"SELECT * FROM {$bp->groups->table_name} WHERE name like '$profile->group_pre_regex$profilevalue->value$profile->group_post_regex'\");\r\n foreach ($groupmatches as $groupmatch) {\r\n if(!check_and_add_to_group($userid, $groupmatch->id)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n}", "public function getUserList($data)\n {\n $return = [];\n foreach(UserModel::where(\"first_name\",\"like\", \"%{$data->value}%\")->get() as $q)\n {\n $return[][\"username\"] = $q->first_name;\n }\n if(!empty($return))\n {\n return $return;\n }\n return false;\n }", "public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function allupgraders(){\n // SQL statement\n $sql = \"SELECT * FROM user WHERE special = 1 AND (role = 'account' OR role = 'administrator') \";\n $result = $this->con->query($sql);\n\n // check if there is a user\n $count = $result->num_rows;\n if ($count != 0) {\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }", "public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}", "public function testJoin()\n {\n // create new user for testing\n $user = new User($this->p4);\n $user->setId('jdoe')\n ->setEmail('[email protected]')\n ->setFullName('J Doe')\n ->save();\n\n // create review record for change 1\n $this->createChange();\n Review::createFromChange('1')->save();\n\n // verify no reviewers are present\n $this->assertSame(array(), Review::fetch(2, $this->p4)->getReviewers());\n\n // add reviewer via posting data\n $postData = new Parameters(array('join' => 'nonadmin'));\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n $this->dispatch('/reviews/2');\n $this->assertSame('admin', Review::fetch(2, $this->p4)->get('author'));\n $this->assertSame(array('nonadmin'), Review::fetch(2, $this->p4)->getReviewers());\n\n // try again with different user and verify that fails to add them\n $this->resetApplication();\n $postData = new Parameters(array('join' => 'admin'));\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n $this->dispatch('/reviews/2');\n $this->assertSame(array('nonadmin'), Review::fetch(2, $this->p4)->getReviewers());\n }" ]
[ "0.67944664", "0.6793565", "0.6751185", "0.6268942", "0.6207929", "0.61670244", "0.6135367", "0.61185694", "0.60294163", "0.600132", "0.5988337", "0.5987466", "0.59751683", "0.59295964", "0.5924153", "0.58977383", "0.5889871", "0.58772075", "0.58542055", "0.58370394", "0.5831686", "0.5830664", "0.5822154", "0.58158857", "0.5777891", "0.5776105", "0.57725", "0.577244", "0.5771606", "0.57574135", "0.5746937", "0.57375574", "0.5722428", "0.5717218", "0.5715323", "0.570997", "0.57096875", "0.5709638", "0.57041246", "0.5686701", "0.5686336", "0.5686287", "0.5651925", "0.56418204", "0.5622905", "0.5621515", "0.5616156", "0.55894715", "0.5586573", "0.5584208", "0.55808353", "0.5579453", "0.5545291", "0.55417866", "0.55403507", "0.55386287", "0.5537456", "0.5536197", "0.55321044", "0.551998", "0.55190057", "0.55168337", "0.5505794", "0.5504093", "0.55034846", "0.5496592", "0.54928684", "0.548721", "0.5483556", "0.54692787", "0.54640937", "0.546364", "0.5463479", "0.5463479", "0.54607326", "0.54606485", "0.5456804", "0.5452693", "0.54507184", "0.5446016", "0.5445883", "0.54415464", "0.5438843", "0.54366535", "0.54344803", "0.5430856", "0.5425669", "0.54216176", "0.5419019", "0.5418658", "0.5414089", "0.5413364", "0.5401952", "0.54009223", "0.54009223", "0.54009223", "0.54009223", "0.54009223", "0.539925", "0.53938895", "0.5392813" ]
0.0
-1
Bring variables into scope
function join(&$irc, &$data) { global $pickupchannel; global $adminchannel; global $pickup; global $queue; global $chanjoin; global $ircinfo; //Check if this is the bot itself joining if($chanjoin < 3) { //Check if this is the pickup channel if($data->channel == $ircinfo->pickupchan) { //Join the bot and admin channel $irc->join($ircinfo->adminchan, $ircinfo->adminchan_pass); $irc->join($ircinfo->botchan, $ircinfo->botchan_pass); //Names the pickup channel $irc->names($ircinfo->pickupchan); } //Increment the channel join counter $chanjoin++; } else { //Get data to variables $nick = $data->nick; //Add user check to the queue $queue->add_item($nick, "check"); //Issue whois $irc->whois($nick); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "public function prepareVars()\n {\n $this->vars['statuses'] = IssueStatus::active()->get()->lists('name', 'id');\n $this->vars['model'] = $this->model;\n }", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}", "public function stepIntoScope();", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }", "function getVariableContainer() ;", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function getBoundVariables() {}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "public function getSetVariables() {}", "function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "function prepare_vars_for_template_usage()\n {\n }", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "public function completeScope(Scope $scope)\n {\n foreach ($scope->getVars() as $name => $var) {\n if ($var->isTypeInferred()) {\n $type = $var->getType();\n if (null === $type) {\n $flowType = $this->getSlot($name)->getType();\n $var->setType($flowType);\n }\n }\n }\n }", "public static function fromGlobals() {}", "public function resetScope();", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }", "public function getVariableContainer() {}", "protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "abstract public function getScope();", "protected static function initializeGlobalVariables() {}", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "function p(){\r\n\t//print_r($GLOBALS);\r\n\t$GLOBALS[\"a\"]=99;\r\n}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "public function clearVars()\r\n {\r\n $this->_smarty->clearAllAssign();\r\n $this->assign('this', $this);\r\n }", "private function initScopes()\n {\n $this->scopes = new Collections\\ArrayCollection();\n }", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }", "function repeatVars() {\n\treturn false;\n}", "function myTest() {\n $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "private function setQuantumVars() {\n \n if (!empty($_REQUEST['controller'])) {\n \n $this->controller = $_REQUEST['controller'];\n \n };\n \n if (!empty($_REQUEST['task'])) {\n \n $this->task = $_REQUEST['task'];\n \n }\n \n if (!empty($_REQUEST['object_id'])) {\n \n $this->object_id = $_REQUEST['object_id'];\n \n }\n \n \n }", "public function addVariables($tvs = array());", "public static function reassign() {\n\n\t\t}", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "public function getGlobals()\n {\n }", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function localVariable(){\n $a=15; //variable have to call inside of function\n echo $a;\n }", "public function getScope();", "public function getScope();", "public function set_vars($vars)\n\t{\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "public function _assignInScope($varname, $variable_obj, $scope_type = Smarty::SCOPE_LOCAL)\n {\n if ($scope_type == Smarty::SCOPE_GLOBAL) {\n Smarty::$_global_tpl_vars->{$varname} = $variable_obj;\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n // we must bubble from current template\n $scope_type = Smarty::SCOPE_ROOT;\n } else {\n // otherwise done\n return;\n }\n }\n\n // must always assign in local scope\n $this->_tpl_vars->{$varname} = $variable_obj;\n\n // if called on data object return\n if ($this->_usage == Smarty::IS_DATA) {\n return;\n }\n\n // if called from template object ($this->scope_type set) we must consider\n // the scope type if template object\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n if (($this->scope_type == Smarty::SCOPE_ROOT || $this->scope_type == Smarty::SCOPE_PARENT) &&\n $scope_type != Smarty::SCOPE_ROOT && $scope_type != Smarty::SCOPE_SMARTY\n ) {\n $scope_type = $this->scope_type;\n }\n }\n\n if ($scope_type == Smarty::SCOPE_LOCAL) {\n return;\n }\n\n $node = $this->parent;\n while ($node) {\n // bubble up only in template objects\n if ($node->_usage == Smarty::IS_TEMPLATE || ($scope_type == Smarty::SCOPE_SMARTY && $node->_usage != Smarty::IS_DATA)) {\n $node->_tpl_vars->{$varname} = $variable_obj;\n if ($scope_type == Smarty::SCOPE_PARENT) {\n break;\n }\n }\n $node = $node->parent;\n }\n }", "protected function getPreserveGetVars() {}", "function convert(){\n global $x;\n $x ='inside';\n}", "public function getAssignedVars()\n {\n return $this->_vars;\n }", "public function register_globals()\n {\n }", "public function register_globals()\n {\n }", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function declare()\n {\n // ...\n }", "function commonAssign() \n\t{\n\t\t$this->xt->assign(\"id\", $this->id);\n\t\t//search permissions\n\t\t$searchPermis = $this->permis[$this->tName]['search'];\n\t\t$this->xt->assign(\"details_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assign(\"pages_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assignbyref(\"body\", $this->body);\n\t\t\t\n\t\t$this->addAssignForGrid();\n\t\t\t\t\t\t\n\t\tif ($this->isDispGrid())\n\t\t\t$this->xt->assign_section(\"grid_block\", '', '');\n\t}", "function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }", "public function getGlobals();", "public function getGlobals();", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "protected function scope(array &$scope): void\n {\n $scope['FOO'] = __METHOD__;\n }", "function set_all( $arr_vars, $scope='', $obj_to_array=0 ){\n global $FUNCS;\n\n if( is_array($arr_vars) && count($arr_vars) ){\n // Set all the array elements into the selected context\n foreach( $arr_vars as $varname=>$value ){\n $this->set( $varname, $value, $scope, $obj_to_array );\n }\n }\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}", "function __construct(&$vars) {\r\n }", "function getBindVariableName() ;", "public function getVarHolder()\n {\n return $this->var_holder;\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function setVars( array $vars ) {\n $this->vars += $vars;\n }", "function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "public function variables(): array;", "public function variables(): array;", "function reset(){\n for( $x=count($this->ctx)-1; $x>=1; $x-- ){ // skip _ROOT_\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'] = array();\n return;\n }\n }\n }", "public function exportedVars(): iterable;", "private function populateScope(\\Scope $scope, $values) {\n \n $scope->setName($values['Name']);\n $scope->setDescription($values['Description']);\n $scope->setReserved(false);\n\n if (array_key_exists('Reserved', $values)) {\n $scope->setReserved($values['Reserved'] == true);\n } \n }", "protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}" ]
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.55508524", "0.5532014", "0.55298585", "0.5518366", "0.550361", "0.55027395", "0.5468626", "0.54586935", "0.54574203", "0.54543024", "0.541971", "0.5418266", "0.54139674", "0.5404131", "0.53960806", "0.53915924", "0.53817034", "0.53774065", "0.5366396", "0.53650004", "0.53578615", "0.53435016", "0.53225636", "0.5318747", "0.5286104", "0.52792346", "0.5259296", "0.5253161", "0.52494544", "0.52413344", "0.523746", "0.521829", "0.5216858", "0.5198363", "0.51928186", "0.5190487", "0.5184828", "0.51766056", "0.5167776", "0.51666427", "0.5166114", "0.51612884", "0.5155052", "0.51534945", "0.51127094", "0.51127094", "0.5096901", "0.50961393", "0.5095579", "0.50866956", "0.50861955", "0.5083885", "0.50714785", "0.50660086", "0.5055261", "0.5055261", "0.5048309", "0.50475246", "0.5031128", "0.50309014", "0.5021575", "0.5021575", "0.5020471", "0.50197035", "0.50193846", "0.50127083", "0.50115657", "0.5009248", "0.5009016", "0.50087315", "0.4992151", "0.49891695", "0.49878663", "0.49845544", "0.49827716", "0.49827716", "0.49697116", "0.49675742", "0.49675342", "0.49624735", "0.4961614" ]
0.0
-1
Bring variables into scope
function nick_change(&$irc, &$data) { global $pickup; global $users; global $pickupstatus; $users->nick_change($data->nick, $data->message); $pickup->nick_change($data->nick, $data->message); //Update topic if($pickup->is_added($users->nicktoqauth($data->nick)) == true) { if($pickupstatus === true) { SetTopic(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "public function prepareVars()\n {\n $this->vars['statuses'] = IssueStatus::active()->get()->lists('name', 'id');\n $this->vars['model'] = $this->model;\n }", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}", "public function stepIntoScope();", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }", "function getVariableContainer() ;", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function getBoundVariables() {}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "public function getSetVariables() {}", "function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "function prepare_vars_for_template_usage()\n {\n }", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "public function completeScope(Scope $scope)\n {\n foreach ($scope->getVars() as $name => $var) {\n if ($var->isTypeInferred()) {\n $type = $var->getType();\n if (null === $type) {\n $flowType = $this->getSlot($name)->getType();\n $var->setType($flowType);\n }\n }\n }\n }", "public static function fromGlobals() {}", "public function resetScope();", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }", "public function getVariableContainer() {}", "protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "abstract public function getScope();", "protected static function initializeGlobalVariables() {}", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "function p(){\r\n\t//print_r($GLOBALS);\r\n\t$GLOBALS[\"a\"]=99;\r\n}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "public function clearVars()\r\n {\r\n $this->_smarty->clearAllAssign();\r\n $this->assign('this', $this);\r\n }", "private function initScopes()\n {\n $this->scopes = new Collections\\ArrayCollection();\n }", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }", "function repeatVars() {\n\treturn false;\n}", "function myTest() {\n $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "private function setQuantumVars() {\n \n if (!empty($_REQUEST['controller'])) {\n \n $this->controller = $_REQUEST['controller'];\n \n };\n \n if (!empty($_REQUEST['task'])) {\n \n $this->task = $_REQUEST['task'];\n \n }\n \n if (!empty($_REQUEST['object_id'])) {\n \n $this->object_id = $_REQUEST['object_id'];\n \n }\n \n \n }", "public function addVariables($tvs = array());", "public static function reassign() {\n\n\t\t}", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "public function getGlobals()\n {\n }", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function localVariable(){\n $a=15; //variable have to call inside of function\n echo $a;\n }", "public function getScope();", "public function getScope();", "public function set_vars($vars)\n\t{\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "public function _assignInScope($varname, $variable_obj, $scope_type = Smarty::SCOPE_LOCAL)\n {\n if ($scope_type == Smarty::SCOPE_GLOBAL) {\n Smarty::$_global_tpl_vars->{$varname} = $variable_obj;\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n // we must bubble from current template\n $scope_type = Smarty::SCOPE_ROOT;\n } else {\n // otherwise done\n return;\n }\n }\n\n // must always assign in local scope\n $this->_tpl_vars->{$varname} = $variable_obj;\n\n // if called on data object return\n if ($this->_usage == Smarty::IS_DATA) {\n return;\n }\n\n // if called from template object ($this->scope_type set) we must consider\n // the scope type if template object\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n if (($this->scope_type == Smarty::SCOPE_ROOT || $this->scope_type == Smarty::SCOPE_PARENT) &&\n $scope_type != Smarty::SCOPE_ROOT && $scope_type != Smarty::SCOPE_SMARTY\n ) {\n $scope_type = $this->scope_type;\n }\n }\n\n if ($scope_type == Smarty::SCOPE_LOCAL) {\n return;\n }\n\n $node = $this->parent;\n while ($node) {\n // bubble up only in template objects\n if ($node->_usage == Smarty::IS_TEMPLATE || ($scope_type == Smarty::SCOPE_SMARTY && $node->_usage != Smarty::IS_DATA)) {\n $node->_tpl_vars->{$varname} = $variable_obj;\n if ($scope_type == Smarty::SCOPE_PARENT) {\n break;\n }\n }\n $node = $node->parent;\n }\n }", "protected function getPreserveGetVars() {}", "function convert(){\n global $x;\n $x ='inside';\n}", "public function getAssignedVars()\n {\n return $this->_vars;\n }", "public function register_globals()\n {\n }", "public function register_globals()\n {\n }", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function declare()\n {\n // ...\n }", "function commonAssign() \n\t{\n\t\t$this->xt->assign(\"id\", $this->id);\n\t\t//search permissions\n\t\t$searchPermis = $this->permis[$this->tName]['search'];\n\t\t$this->xt->assign(\"details_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assign(\"pages_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assignbyref(\"body\", $this->body);\n\t\t\t\n\t\t$this->addAssignForGrid();\n\t\t\t\t\t\t\n\t\tif ($this->isDispGrid())\n\t\t\t$this->xt->assign_section(\"grid_block\", '', '');\n\t}", "function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }", "public function getGlobals();", "public function getGlobals();", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "protected function scope(array &$scope): void\n {\n $scope['FOO'] = __METHOD__;\n }", "function set_all( $arr_vars, $scope='', $obj_to_array=0 ){\n global $FUNCS;\n\n if( is_array($arr_vars) && count($arr_vars) ){\n // Set all the array elements into the selected context\n foreach( $arr_vars as $varname=>$value ){\n $this->set( $varname, $value, $scope, $obj_to_array );\n }\n }\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}", "function __construct(&$vars) {\r\n }", "function getBindVariableName() ;", "public function getVarHolder()\n {\n return $this->var_holder;\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function setVars( array $vars ) {\n $this->vars += $vars;\n }", "function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "public function variables(): array;", "public function variables(): array;", "function reset(){\n for( $x=count($this->ctx)-1; $x>=1; $x-- ){ // skip _ROOT_\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'] = array();\n return;\n }\n }\n }", "public function exportedVars(): iterable;", "private function populateScope(\\Scope $scope, $values) {\n \n $scope->setName($values['Name']);\n $scope->setDescription($values['Description']);\n $scope->setReserved(false);\n\n if (array_key_exists('Reserved', $values)) {\n $scope->setReserved($values['Reserved'] == true);\n } \n }", "protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}" ]
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.55508524", "0.5532014", "0.55298585", "0.5518366", "0.550361", "0.55027395", "0.5468626", "0.54586935", "0.54574203", "0.54543024", "0.541971", "0.5418266", "0.54139674", "0.5404131", "0.53960806", "0.53915924", "0.53817034", "0.53774065", "0.5366396", "0.53650004", "0.53578615", "0.53435016", "0.53225636", "0.5318747", "0.5286104", "0.52792346", "0.5259296", "0.5253161", "0.52494544", "0.52413344", "0.523746", "0.521829", "0.5216858", "0.5198363", "0.51928186", "0.5190487", "0.5184828", "0.51766056", "0.5167776", "0.51666427", "0.5166114", "0.51612884", "0.5155052", "0.51534945", "0.51127094", "0.51127094", "0.5096901", "0.50961393", "0.5095579", "0.50866956", "0.50861955", "0.5083885", "0.50714785", "0.50660086", "0.5055261", "0.5055261", "0.5048309", "0.50475246", "0.5031128", "0.50309014", "0.5021575", "0.5021575", "0.5020471", "0.50197035", "0.50193846", "0.50127083", "0.50115657", "0.5009248", "0.5009016", "0.50087315", "0.4992151", "0.49891695", "0.49878663", "0.49845544", "0.49827716", "0.49827716", "0.49697116", "0.49675742", "0.49675342", "0.49624735", "0.4961614" ]
0.0
-1
Bring variables intro scope
function leave(&$irc, &$data) { global $pickup; global $users; global $irc; global $pickupchannel; global $pickup; global $pickupstatus; //Get data $nick = $data->nick; $qauth = $users->nicktoqauth($nick); //Remove from pickup if($pickup->is_added($qauth) == true) { $pickup->rm_player($qauth); SetTopic(); } //Mark the user out the channel $users->mark_outchannel($qauth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initVars() {\n\n\t\t}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "protected function constructScopes() {}", "function getVariableContainer() ;", "public function prepareVars()\n {\n $this->vars['statuses'] = IssueStatus::active()->get()->lists('name', 'id');\n $this->vars['model'] = $this->model;\n }", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}", "public function stepIntoScope();", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "public static function fromGlobals() {}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "function variable2(){\n\t\t \tglobal $a, $b, $texto;\t\t\t//Global palabra reservada para hace las variables locales.\n\t\t \t$a = $a + $b;\n\t\t }", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "function p(){\r\n\t//print_r($GLOBALS);\r\n\t$GLOBALS[\"a\"]=99;\r\n}", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "function prepare_vars_for_template_usage()\n {\n }", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "function localVariable(){\n $a=15; //variable have to call inside of function\n echo $a;\n }", "function convert(){\n global $x;\n $x ='inside';\n}", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}", "protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "function myTest() {\n $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "function foo() {\n global $my_variable; // import variable from global scope\n // before you use it\n echo $my_variable; // use the variable\n}", "protected static function initializeGlobalVariables() {}", "function make_lang_var()\n\t{\n\t\t// Pfad einbinden\n\t\tglobal $pfad;\n\n\t\t// Backend Sprache\n\t}", "public function getSetVariables() {}", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "public function getBoundVariables() {}", "public function getVariableContainer() {}", "function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "function display()\n{\n\techo $GLOBALS[\"a\"] .\"<br/>\";\n}", "public static function reassign() {\n\n\t\t}", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "function commonAssign() \n\t{\n\t\t$this->xt->assign(\"id\", $this->id);\n\t\t//search permissions\n\t\t$searchPermis = $this->permis[$this->tName]['search'];\n\t\t$this->xt->assign(\"details_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assign(\"pages_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assignbyref(\"body\", $this->body);\n\t\t\t\n\t\t$this->addAssignForGrid();\n\t\t\t\t\t\t\n\t\tif ($this->isDispGrid())\n\t\t\t$this->xt->assign_section(\"grid_block\", '', '');\n\t}", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "function admin1(){\n global $name1,$age1;//声明为全局变量,只能在函数内声明\n $name1 = 'addin111';\n $age1 = 22;\n}", "public function addVariables($tvs = array());", "function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }", "function e($var_nm)\n{\n\tglobal $$var_nm ;\n\n\treturn '$' . $var_nm . ' = ' . $$var_nm . ' ' ;\n}", "function getBindVariableName() ;", "function __construct(&$vars) {\r\n }", "public function getGlobals()\n {\n }", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "public function declare()\n {\n // ...\n }", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "public function prefill();", "public function getGlobals();", "public function getGlobals();", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function pagelines_less_var( $name, $value ){\n\t\n\tglobal $less_vars;\n\t\n\t$less_vars[$name] = $value;\n\t\n}", "function A2()\n{\n\n\tglobal $x;\n\n\t$x += 20;\n\techo \"El valor de x ejecutando la funci&oacute;n A2 es: $x<br />\";\n}", "function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function getVarHolder()\n {\n return $this->var_holder;\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('uploadUri', $this->getController()->buildUriPath(uploadController::ACTION_UPLOAD));\n\t\t$this->getEngine()->assign('doUploadUri', $this->getController()->buildUriPath(uploadController::ACTION_DO_UPLOAD));\n\t\t$this->getEngine()->assign('doMovieSave', $this->getController()->buildUriPath(uploadController::ACTION_MOVIE_SAVE));\n\t}", "function printUser2()\n{\n global $user; // this get global variable 'mohamed'\n echo $user; // print 'mohamed';\n $user = \"ahmed\"; // this make global varible mohamed to ahmed\n}", "function myTest2() {\n $y = 5; // local scope\n //echo \"<p>Variable y inside function is: $y</p>\";\n}", "public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }", "function mySuperglobals(){\n $x = 75;\n $y = 25;\n \n function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n }\n \n addition();\n echo $z; \n //$_SERVER is a PHP super global variable which holds information about headers, paths, and script locations. \n echo $_SERVER['PHP_SELF'];\n echo \"<br>\";\n echo $_SERVER['SERVER_NAME'];\n echo \"<br>\";\n echo $_SERVER['HTTP_HOST'];\n echo \"<br>\";\n echo $_SERVER['HTTP_REFERER'];\n echo \"<br>\";\n echo $_SERVER['HTTP_USER_AGENT'];\n echo \"<br>\";\n echo $_SERVER['SCRIPT_NAME'];\n \n }", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "function test(){\n global $greet;\n echo $greet;\n }", "function repeatVars() {\n\treturn false;\n}", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "function using($var)\n {\n return $var;\n }", "public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "public function change_one_global() {\n $var_name = $GLOBALS['test_var'];\n $GLOBALS[ $var_name ] = rand_str();\n }", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "protected function setAcoVariables() {\n\n $this->set('plugin',\n isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : '');\n $this->set('controller_name', $this->params['named']['controller']);\n $this->set('action', $this->params['named']['action']);\n }", "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }", "abstract public function getScope();", "private function setup_globals() {\r\n\t\t/** Versions **********************************************************/\r\n\r\n\t\t$this->version = '0.3-alpha';\r\n\t\t$this->db_version = '1';\r\n\r\n\t\t/** Paths *************************************************************/\r\n\r\n\t\t$this->file = __FILE__;\r\n\t\t$this->basename = apply_filters( 'atcf_plugin_basenname', plugin_basename( $this->file ) );\r\n\t\t$this->plugin_dir = apply_filters( 'atcf_plugin_dir_path', plugin_dir_path( $this->file ) );\r\n\t\t$this->plugin_url = apply_filters( 'atcf_plugin_dir_url', plugin_dir_url ( $this->file ) );\r\n\r\n\t\t$this->template_url = apply_filters( 'atcf_plugin_template_url', 'crowdfunding/' );\r\n\r\n\t\t// Includes\r\n\t\t$this->includes_dir = apply_filters( 'atcf_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );\r\n\t\t$this->includes_url = apply_filters( 'atcf_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );\r\n\r\n\t\t// Languages\r\n\t\t$this->lang_dir = apply_filters( 'atcf_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );\r\n\r\n\t\t/** Misc **************************************************************/\r\n\r\n\t\t$this->domain = 'atcf'; \r\n\t}", "function addVariable($name,$value,$eval = true) {\n\t\t $this->Open();\n\t\t if ($eval) {\t\t \t\t \n\t\t $this->Stream .= '$'.$name.' = '.$this->prepareVariableString($value).';'.chr(10);\n\t\t \n\t\t } else {\t\t \n\t\t $this->Stream .= '$'.$name.' = $'.$value.\";\".chr(10);\n\t\t } \n\t\t}", "function mytest() {\r\n global $x , $y;\r\n $y = $x + $y;\r\n\r\n}", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "public function register_globals()\n {\n }", "public function register_globals()\n {\n }", "function setVar() {\n\t\t\n\t\t$_argv = func_get_args();\n\t\t$_argc = func_num_args();\n\t\t\n\t\t// load vars\n\t\t$vars = getVars();\n\t\tif (!$_GET[\"__shared__\"][\"vars\"]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"] = array();\n\t\t}\n\t\tforeach ($vars as $varNamespace => $varArray) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$varNamespace] = $varArray;\n\t\t}\n\t\t\n\t\t// Register namespace if not existing\n\t\tif (!$_GET[\"__shared__\"][\"vars\"][$_argv[0]]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]] = array();\n\t\t}\n\t\tif ($_argc == 2) {\n\t\t\tif (is_array($_argv[1])) {\n\t\t\t\tforeach ($_argv[1] as $var => $val) {\n\t\t\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$var] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($_argc == 3) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$_argv[1]] = $_argv[2];\n\t\t}\n\t\t\n\t\t// save vars\n\t\t\n\t\tsaveVars();\n\t}", "function fx()\r\n{\r\n //global $light;\r\n $light = 10;\r\n //$GLOBALS['light']=$light;\r\n echo \"Local State: $light \\n\";\r\n //return $light;\r\n $_SESSION['light'] = $light;\r\n}", "Function test(){\n\t\tglobal a,b;\n\t\techo \"a+b=\".a+b;\n\n\t}", "private static function addGlobals()\n {\n \tself::$twig->addGlobal('session', $_SESSION);\n self::$twig->addGlobal('APP', APP);\n self::$twig->addGlobal('auth', Auth::getAuth());\n }", "function globalVariable(){\n global $b; //made it global\n echo $b;\n}" ]
[ "0.6239318", "0.60357803", "0.6015769", "0.59770525", "0.5899266", "0.5839367", "0.58005595", "0.57610434", "0.56655604", "0.5633504", "0.56105554", "0.5561419", "0.5555634", "0.5545249", "0.55423653", "0.5534709", "0.55232894", "0.54867923", "0.547725", "0.5475054", "0.5462145", "0.5445382", "0.5428502", "0.54122686", "0.5409114", "0.540704", "0.5385486", "0.5385384", "0.53755814", "0.5346841", "0.5331976", "0.53182834", "0.53119427", "0.53036666", "0.5302152", "0.52941716", "0.52934384", "0.5289755", "0.52861154", "0.527811", "0.5274333", "0.52715844", "0.52713734", "0.52712333", "0.52587605", "0.5256377", "0.5248147", "0.52249306", "0.5191751", "0.5186052", "0.5184118", "0.51823205", "0.5174193", "0.5170985", "0.51706946", "0.51685387", "0.51537156", "0.5150604", "0.51414675", "0.5125589", "0.5121366", "0.5112856", "0.51100796", "0.51100796", "0.51032346", "0.5087719", "0.5079599", "0.50795794", "0.5075854", "0.50674236", "0.505456", "0.50469583", "0.50420713", "0.50389206", "0.5038203", "0.5029244", "0.50265115", "0.50251853", "0.5010099", "0.5009906", "0.50034934", "0.49982065", "0.49975988", "0.49962753", "0.4994143", "0.49923593", "0.4981383", "0.49797124", "0.49787217", "0.49785224", "0.49760285", "0.4967724", "0.4964511", "0.4959399", "0.4957349", "0.4957349", "0.495067", "0.49492154", "0.4948505", "0.49453044", "0.49316576" ]
0.0
-1
Bring variables intro scope
function quit(&$irc, &$data) { global $pickup; global $users; global $irc; global $pickupchannel; global $pickup; global $pickupstatus; //Get data $nick = $data->nick; $qauth = $users->nicktoqauth($nick); //Remove from pickup if($pickup->is_added($qauth)) { $pickup->rm_player($qauth); SetTopic(); } //Mark the user out the channel $users->mark_outchannel($qauth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initVars() {\n\n\t\t}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "protected function constructScopes() {}", "function getVariableContainer() ;", "public function prepareVars()\n {\n $this->vars['statuses'] = IssueStatus::active()->get()->lists('name', 'id');\n $this->vars['model'] = $this->model;\n }", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}", "public function stepIntoScope();", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "public static function fromGlobals() {}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "function variable2(){\n\t\t \tglobal $a, $b, $texto;\t\t\t//Global palabra reservada para hace las variables locales.\n\t\t \t$a = $a + $b;\n\t\t }", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "function p(){\r\n\t//print_r($GLOBALS);\r\n\t$GLOBALS[\"a\"]=99;\r\n}", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "function prepare_vars_for_template_usage()\n {\n }", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "function localVariable(){\n $a=15; //variable have to call inside of function\n echo $a;\n }", "function convert(){\n global $x;\n $x ='inside';\n}", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}", "protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "function myTest() {\n $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "function foo() {\n global $my_variable; // import variable from global scope\n // before you use it\n echo $my_variable; // use the variable\n}", "protected static function initializeGlobalVariables() {}", "function make_lang_var()\n\t{\n\t\t// Pfad einbinden\n\t\tglobal $pfad;\n\n\t\t// Backend Sprache\n\t}", "public function getSetVariables() {}", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "public function getBoundVariables() {}", "public function getVariableContainer() {}", "function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "function display()\n{\n\techo $GLOBALS[\"a\"] .\"<br/>\";\n}", "public static function reassign() {\n\n\t\t}", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "function commonAssign() \n\t{\n\t\t$this->xt->assign(\"id\", $this->id);\n\t\t//search permissions\n\t\t$searchPermis = $this->permis[$this->tName]['search'];\n\t\t$this->xt->assign(\"details_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assign(\"pages_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assignbyref(\"body\", $this->body);\n\t\t\t\n\t\t$this->addAssignForGrid();\n\t\t\t\t\t\t\n\t\tif ($this->isDispGrid())\n\t\t\t$this->xt->assign_section(\"grid_block\", '', '');\n\t}", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "function admin1(){\n global $name1,$age1;//声明为全局变量,只能在函数内声明\n $name1 = 'addin111';\n $age1 = 22;\n}", "public function addVariables($tvs = array());", "function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }", "function e($var_nm)\n{\n\tglobal $$var_nm ;\n\n\treturn '$' . $var_nm . ' = ' . $$var_nm . ' ' ;\n}", "function getBindVariableName() ;", "function __construct(&$vars) {\r\n }", "public function getGlobals()\n {\n }", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "public function declare()\n {\n // ...\n }", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "public function prefill();", "public function getGlobals();", "public function getGlobals();", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function pagelines_less_var( $name, $value ){\n\t\n\tglobal $less_vars;\n\t\n\t$less_vars[$name] = $value;\n\t\n}", "function A2()\n{\n\n\tglobal $x;\n\n\t$x += 20;\n\techo \"El valor de x ejecutando la funci&oacute;n A2 es: $x<br />\";\n}", "function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function getVarHolder()\n {\n return $this->var_holder;\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('uploadUri', $this->getController()->buildUriPath(uploadController::ACTION_UPLOAD));\n\t\t$this->getEngine()->assign('doUploadUri', $this->getController()->buildUriPath(uploadController::ACTION_DO_UPLOAD));\n\t\t$this->getEngine()->assign('doMovieSave', $this->getController()->buildUriPath(uploadController::ACTION_MOVIE_SAVE));\n\t}", "function printUser2()\n{\n global $user; // this get global variable 'mohamed'\n echo $user; // print 'mohamed';\n $user = \"ahmed\"; // this make global varible mohamed to ahmed\n}", "function myTest2() {\n $y = 5; // local scope\n //echo \"<p>Variable y inside function is: $y</p>\";\n}", "public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }", "function mySuperglobals(){\n $x = 75;\n $y = 25;\n \n function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n }\n \n addition();\n echo $z; \n //$_SERVER is a PHP super global variable which holds information about headers, paths, and script locations. \n echo $_SERVER['PHP_SELF'];\n echo \"<br>\";\n echo $_SERVER['SERVER_NAME'];\n echo \"<br>\";\n echo $_SERVER['HTTP_HOST'];\n echo \"<br>\";\n echo $_SERVER['HTTP_REFERER'];\n echo \"<br>\";\n echo $_SERVER['HTTP_USER_AGENT'];\n echo \"<br>\";\n echo $_SERVER['SCRIPT_NAME'];\n \n }", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "function test(){\n global $greet;\n echo $greet;\n }", "function repeatVars() {\n\treturn false;\n}", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "function using($var)\n {\n return $var;\n }", "public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "public function change_one_global() {\n $var_name = $GLOBALS['test_var'];\n $GLOBALS[ $var_name ] = rand_str();\n }", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "protected function setAcoVariables() {\n\n $this->set('plugin',\n isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : '');\n $this->set('controller_name', $this->params['named']['controller']);\n $this->set('action', $this->params['named']['action']);\n }", "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }", "abstract public function getScope();", "private function setup_globals() {\r\n\t\t/** Versions **********************************************************/\r\n\r\n\t\t$this->version = '0.3-alpha';\r\n\t\t$this->db_version = '1';\r\n\r\n\t\t/** Paths *************************************************************/\r\n\r\n\t\t$this->file = __FILE__;\r\n\t\t$this->basename = apply_filters( 'atcf_plugin_basenname', plugin_basename( $this->file ) );\r\n\t\t$this->plugin_dir = apply_filters( 'atcf_plugin_dir_path', plugin_dir_path( $this->file ) );\r\n\t\t$this->plugin_url = apply_filters( 'atcf_plugin_dir_url', plugin_dir_url ( $this->file ) );\r\n\r\n\t\t$this->template_url = apply_filters( 'atcf_plugin_template_url', 'crowdfunding/' );\r\n\r\n\t\t// Includes\r\n\t\t$this->includes_dir = apply_filters( 'atcf_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );\r\n\t\t$this->includes_url = apply_filters( 'atcf_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );\r\n\r\n\t\t// Languages\r\n\t\t$this->lang_dir = apply_filters( 'atcf_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );\r\n\r\n\t\t/** Misc **************************************************************/\r\n\r\n\t\t$this->domain = 'atcf'; \r\n\t}", "function addVariable($name,$value,$eval = true) {\n\t\t $this->Open();\n\t\t if ($eval) {\t\t \t\t \n\t\t $this->Stream .= '$'.$name.' = '.$this->prepareVariableString($value).';'.chr(10);\n\t\t \n\t\t } else {\t\t \n\t\t $this->Stream .= '$'.$name.' = $'.$value.\";\".chr(10);\n\t\t } \n\t\t}", "function mytest() {\r\n global $x , $y;\r\n $y = $x + $y;\r\n\r\n}", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "public function register_globals()\n {\n }", "public function register_globals()\n {\n }", "function setVar() {\n\t\t\n\t\t$_argv = func_get_args();\n\t\t$_argc = func_num_args();\n\t\t\n\t\t// load vars\n\t\t$vars = getVars();\n\t\tif (!$_GET[\"__shared__\"][\"vars\"]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"] = array();\n\t\t}\n\t\tforeach ($vars as $varNamespace => $varArray) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$varNamespace] = $varArray;\n\t\t}\n\t\t\n\t\t// Register namespace if not existing\n\t\tif (!$_GET[\"__shared__\"][\"vars\"][$_argv[0]]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]] = array();\n\t\t}\n\t\tif ($_argc == 2) {\n\t\t\tif (is_array($_argv[1])) {\n\t\t\t\tforeach ($_argv[1] as $var => $val) {\n\t\t\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$var] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($_argc == 3) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$_argv[1]] = $_argv[2];\n\t\t}\n\t\t\n\t\t// save vars\n\t\t\n\t\tsaveVars();\n\t}", "function fx()\r\n{\r\n //global $light;\r\n $light = 10;\r\n //$GLOBALS['light']=$light;\r\n echo \"Local State: $light \\n\";\r\n //return $light;\r\n $_SESSION['light'] = $light;\r\n}", "Function test(){\n\t\tglobal a,b;\n\t\techo \"a+b=\".a+b;\n\n\t}", "private static function addGlobals()\n {\n \tself::$twig->addGlobal('session', $_SESSION);\n self::$twig->addGlobal('APP', APP);\n self::$twig->addGlobal('auth', Auth::getAuth());\n }", "function globalVariable(){\n global $b; //made it global\n echo $b;\n}" ]
[ "0.6239318", "0.60357803", "0.6015769", "0.59770525", "0.5899266", "0.5839367", "0.58005595", "0.57610434", "0.56655604", "0.5633504", "0.56105554", "0.5561419", "0.5555634", "0.5545249", "0.55423653", "0.5534709", "0.55232894", "0.54867923", "0.547725", "0.5475054", "0.5462145", "0.5445382", "0.5428502", "0.54122686", "0.5409114", "0.540704", "0.5385486", "0.5385384", "0.53755814", "0.5346841", "0.5331976", "0.53182834", "0.53119427", "0.53036666", "0.5302152", "0.52941716", "0.52934384", "0.5289755", "0.52861154", "0.527811", "0.5274333", "0.52715844", "0.52713734", "0.52712333", "0.52587605", "0.5256377", "0.5248147", "0.52249306", "0.5191751", "0.5186052", "0.5184118", "0.51823205", "0.5174193", "0.5170985", "0.51706946", "0.51685387", "0.51537156", "0.5150604", "0.51414675", "0.5125589", "0.5121366", "0.5112856", "0.51100796", "0.51100796", "0.51032346", "0.5087719", "0.5079599", "0.50795794", "0.5075854", "0.50674236", "0.505456", "0.50469583", "0.50420713", "0.50389206", "0.5038203", "0.5029244", "0.50265115", "0.50251853", "0.5010099", "0.5009906", "0.50034934", "0.49982065", "0.49975988", "0.49962753", "0.4994143", "0.49923593", "0.4981383", "0.49797124", "0.49787217", "0.49785224", "0.49760285", "0.4967724", "0.4964511", "0.4959399", "0.4957349", "0.4957349", "0.495067", "0.49492154", "0.4948505", "0.49453044", "0.49316576" ]
0.0
-1
Bring variables into scope
function whois_queue(&$irc, &$data) { global $pickupchannel; global $pickup; global $queue; global $users; global $invites; global $bans; //print_r($data); //print_r($queue); //Check for commands on queue if($data->rawmessageex[1] == "330") { if($queue->get_item($data->rawmessageex[3]) != false) { //Shift the command off the queue $queue_item = $queue->get_item($data->rawmessageex[3]); $qauth = $data->rawmessageex[4]; //Take Queue info to variables $map = $queue_item["map"]; $nick = $queue_item["nick"]; $class = $queue_item["class"]; //Queue command switch switch($queue_item["command"]) { case "check": //Check if the user is on the invite list if($users->is_added($qauth) == true) { if($users->is_banned($qauth) == false) { //Update nick on users $users->nick_change_join($qauth, $nick); $users->mark_inchannel($qauth); } else { $irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m You have been banned from this channel: ".$bans->info($qauth)->reason); } } else { //Temp ban the user //$irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m This is an invite-only pickup."); NewUser($qauth, $nick); } break; } } //Invite queue check $info = $invites->info($data->rawmessageex[3]); if($info->nick == $data->rawmessageex[3]) { if($users->is_added($data->rawmessageex[4])) { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00The user \"".$info->nick."\" is already added to this pickup channel"); } else { //Add qauth as stage2 $invites->stage2($info->nick, $data->rawmessageex[4], $data->rawmessageex[3]); } } } //No Such Nick reply from WHOIS if($data->rawmessageex[1] == "401") { $info = $invites->info($data->rawmessageex[3]); if($info->nick == $data->rawmessageex[3]) { //Inform the channel that the user does not exist $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No user with the nick \"".$info->nick."\" exists on quakenet. Please check again."); //And delete the invite $invites->rm_invite($data->rawmessageex[3]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "public function prepareVars()\n {\n $this->vars['statuses'] = IssueStatus::active()->get()->lists('name', 'id');\n $this->vars['model'] = $this->model;\n }", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}", "public function stepIntoScope();", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }", "function getVariableContainer() ;", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function getBoundVariables() {}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "public function getSetVariables() {}", "function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "function prepare_vars_for_template_usage()\n {\n }", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "public function completeScope(Scope $scope)\n {\n foreach ($scope->getVars() as $name => $var) {\n if ($var->isTypeInferred()) {\n $type = $var->getType();\n if (null === $type) {\n $flowType = $this->getSlot($name)->getType();\n $var->setType($flowType);\n }\n }\n }\n }", "public static function fromGlobals() {}", "public function resetScope();", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }", "public function getVariableContainer() {}", "protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "abstract public function getScope();", "protected static function initializeGlobalVariables() {}", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "function p(){\r\n\t//print_r($GLOBALS);\r\n\t$GLOBALS[\"a\"]=99;\r\n}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "public function clearVars()\r\n {\r\n $this->_smarty->clearAllAssign();\r\n $this->assign('this', $this);\r\n }", "private function initScopes()\n {\n $this->scopes = new Collections\\ArrayCollection();\n }", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }", "function repeatVars() {\n\treturn false;\n}", "function myTest() {\n $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "private function setQuantumVars() {\n \n if (!empty($_REQUEST['controller'])) {\n \n $this->controller = $_REQUEST['controller'];\n \n };\n \n if (!empty($_REQUEST['task'])) {\n \n $this->task = $_REQUEST['task'];\n \n }\n \n if (!empty($_REQUEST['object_id'])) {\n \n $this->object_id = $_REQUEST['object_id'];\n \n }\n \n \n }", "public function addVariables($tvs = array());", "public static function reassign() {\n\n\t\t}", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "public function getGlobals()\n {\n }", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function localVariable(){\n $a=15; //variable have to call inside of function\n echo $a;\n }", "public function getScope();", "public function getScope();", "public function set_vars($vars)\n\t{\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "public function _assignInScope($varname, $variable_obj, $scope_type = Smarty::SCOPE_LOCAL)\n {\n if ($scope_type == Smarty::SCOPE_GLOBAL) {\n Smarty::$_global_tpl_vars->{$varname} = $variable_obj;\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n // we must bubble from current template\n $scope_type = Smarty::SCOPE_ROOT;\n } else {\n // otherwise done\n return;\n }\n }\n\n // must always assign in local scope\n $this->_tpl_vars->{$varname} = $variable_obj;\n\n // if called on data object return\n if ($this->_usage == Smarty::IS_DATA) {\n return;\n }\n\n // if called from template object ($this->scope_type set) we must consider\n // the scope type if template object\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n if (($this->scope_type == Smarty::SCOPE_ROOT || $this->scope_type == Smarty::SCOPE_PARENT) &&\n $scope_type != Smarty::SCOPE_ROOT && $scope_type != Smarty::SCOPE_SMARTY\n ) {\n $scope_type = $this->scope_type;\n }\n }\n\n if ($scope_type == Smarty::SCOPE_LOCAL) {\n return;\n }\n\n $node = $this->parent;\n while ($node) {\n // bubble up only in template objects\n if ($node->_usage == Smarty::IS_TEMPLATE || ($scope_type == Smarty::SCOPE_SMARTY && $node->_usage != Smarty::IS_DATA)) {\n $node->_tpl_vars->{$varname} = $variable_obj;\n if ($scope_type == Smarty::SCOPE_PARENT) {\n break;\n }\n }\n $node = $node->parent;\n }\n }", "protected function getPreserveGetVars() {}", "function convert(){\n global $x;\n $x ='inside';\n}", "public function getAssignedVars()\n {\n return $this->_vars;\n }", "public function register_globals()\n {\n }", "public function register_globals()\n {\n }", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function declare()\n {\n // ...\n }", "function commonAssign() \n\t{\n\t\t$this->xt->assign(\"id\", $this->id);\n\t\t//search permissions\n\t\t$searchPermis = $this->permis[$this->tName]['search'];\n\t\t$this->xt->assign(\"details_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assign(\"pages_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assignbyref(\"body\", $this->body);\n\t\t\t\n\t\t$this->addAssignForGrid();\n\t\t\t\t\t\t\n\t\tif ($this->isDispGrid())\n\t\t\t$this->xt->assign_section(\"grid_block\", '', '');\n\t}", "function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }", "public function getGlobals();", "public function getGlobals();", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "protected function scope(array &$scope): void\n {\n $scope['FOO'] = __METHOD__;\n }", "function set_all( $arr_vars, $scope='', $obj_to_array=0 ){\n global $FUNCS;\n\n if( is_array($arr_vars) && count($arr_vars) ){\n // Set all the array elements into the selected context\n foreach( $arr_vars as $varname=>$value ){\n $this->set( $varname, $value, $scope, $obj_to_array );\n }\n }\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}", "function __construct(&$vars) {\r\n }", "function getBindVariableName() ;", "public function getVarHolder()\n {\n return $this->var_holder;\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function setVars( array $vars ) {\n $this->vars += $vars;\n }", "function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "public function variables(): array;", "public function variables(): array;", "function reset(){\n for( $x=count($this->ctx)-1; $x>=1; $x-- ){ // skip _ROOT_\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'] = array();\n return;\n }\n }\n }", "public function exportedVars(): iterable;", "private function populateScope(\\Scope $scope, $values) {\n \n $scope->setName($values['Name']);\n $scope->setDescription($values['Description']);\n $scope->setReserved(false);\n\n if (array_key_exists('Reserved', $values)) {\n $scope->setReserved($values['Reserved'] == true);\n } \n }", "protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}" ]
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.55508524", "0.5532014", "0.55298585", "0.5518366", "0.550361", "0.55027395", "0.5468626", "0.54586935", "0.54574203", "0.54543024", "0.541971", "0.5418266", "0.54139674", "0.5404131", "0.53960806", "0.53915924", "0.53817034", "0.53774065", "0.5366396", "0.53650004", "0.53578615", "0.53435016", "0.53225636", "0.5318747", "0.5286104", "0.52792346", "0.5259296", "0.5253161", "0.52494544", "0.52413344", "0.523746", "0.521829", "0.5216858", "0.5198363", "0.51928186", "0.5190487", "0.5184828", "0.51766056", "0.5167776", "0.51666427", "0.5166114", "0.51612884", "0.5155052", "0.51534945", "0.51127094", "0.51127094", "0.5096901", "0.50961393", "0.5095579", "0.50866956", "0.50861955", "0.5083885", "0.50714785", "0.50660086", "0.5055261", "0.5055261", "0.5048309", "0.50475246", "0.5031128", "0.50309014", "0.5021575", "0.5021575", "0.5020471", "0.50197035", "0.50193846", "0.50127083", "0.50115657", "0.5009248", "0.5009016", "0.50087315", "0.4992151", "0.49891695", "0.49878663", "0.49845544", "0.49827716", "0.49827716", "0.49697116", "0.49675742", "0.49675342", "0.49624735", "0.4961614" ]
0.0
-1
Bring variables into scope
function whois_check(&$irc, &$data) { global $pickupchannel; global $pickup; global $queue; global $users; //Check for commands on queue if($data->rawmessageex[1] == "330") { if($queue[$data->rawmessageex[3]][0]["nick"] == $data->rawmessageex[3]) { //Get qauth and nick $nick = $data->rawmessageex[3]; $qauth = $data->rawmessageex[4]; //Check the queue if($users->is_banned($qauth)) { if($queue[$data->rawmessageex[3]][0]["command"] == "check") { //Check if the user is in the database if($users->is_added($qauth) == false) { $irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m This is an invite-only pickup."); //$irc->kick($pickupchannel, $nick, "This is an invite-only pickup."); //Remove command array_shift($queue[$nick]); } else { if($users->is_banned($qauth) === false) { $users->nick_change_join($qauth, $nick); $users->mark_inchannel($qauth); array_shift($queue[$nick]); } else { $irc->message(SMARTIRC_TYPE_QUERY, "Q", "TEMPBAN ".$pickupchannel." *!*@".$qauth.".users.quakenet.org 1m This is an invite-only pickup."); array_shift($queue[$nick]); } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function scope()\n {\n $this->scope = (object) array_merge(\n (array) $this->rook->getScope(),\n (array) $this->bishop->getScope()\n );\n }", "protected function initVars() {\n\n\t\t}", "protected function constructScopes() {}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "public function prepareVars()\n {\n $this->vars['statuses'] = IssueStatus::active()->get()->lists('name', 'id');\n $this->vars['model'] = $this->model;\n }", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}", "public function stepIntoScope();", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }", "function getVariableContainer() ;", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function getBoundVariables() {}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "public function getSetVariables() {}", "function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "function prepare_vars_for_template_usage()\n {\n }", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "public function completeScope(Scope $scope)\n {\n foreach ($scope->getVars() as $name => $var) {\n if ($var->isTypeInferred()) {\n $type = $var->getType();\n if (null === $type) {\n $flowType = $this->getSlot($name)->getType();\n $var->setType($flowType);\n }\n }\n }\n }", "public static function fromGlobals() {}", "public function resetScope();", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "protected function getLocalVars() {\r\n\t\treturn [\r\n\t\t\t'model' => & $this->model,\r\n\t\t\t'log' => & $this->log,\r\n\t\t];\r\n\t}", "public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }", "public function getVariableContainer() {}", "protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "public function prepareVars()\n {\n $this->vars['history'] = $this->model->revision_history;\n $this->vars['chapter_id'] = $this->model->id;\n }", "abstract public function getScope();", "protected static function initializeGlobalVariables() {}", "public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }", "function p(){\r\n\t//print_r($GLOBALS);\r\n\t$GLOBALS[\"a\"]=99;\r\n}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "public function clearVars()\r\n {\r\n $this->_smarty->clearAllAssign();\r\n $this->assign('this', $this);\r\n }", "private function initScopes()\n {\n $this->scopes = new Collections\\ArrayCollection();\n }", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }", "function repeatVars() {\n\treturn false;\n}", "function myTest() {\n $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "private function setQuantumVars() {\n \n if (!empty($_REQUEST['controller'])) {\n \n $this->controller = $_REQUEST['controller'];\n \n };\n \n if (!empty($_REQUEST['task'])) {\n \n $this->task = $_REQUEST['task'];\n \n }\n \n if (!empty($_REQUEST['object_id'])) {\n \n $this->object_id = $_REQUEST['object_id'];\n \n }\n \n \n }", "public function addVariables($tvs = array());", "public static function reassign() {\n\n\t\t}", "public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }", "private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }", "public function getGlobals()\n {\n }", "function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->options[$var] = $this->{$var};\r\r\n\t\t}\t\r\r\n\t}", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function localVariable(){\n $a=15; //variable have to call inside of function\n echo $a;\n }", "public function getScope();", "public function getScope();", "public function set_vars($vars)\n\t{\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}", "function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}", "public function _assignInScope($varname, $variable_obj, $scope_type = Smarty::SCOPE_LOCAL)\n {\n if ($scope_type == Smarty::SCOPE_GLOBAL) {\n Smarty::$_global_tpl_vars->{$varname} = $variable_obj;\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n // we must bubble from current template\n $scope_type = Smarty::SCOPE_ROOT;\n } else {\n // otherwise done\n return;\n }\n }\n\n // must always assign in local scope\n $this->_tpl_vars->{$varname} = $variable_obj;\n\n // if called on data object return\n if ($this->_usage == Smarty::IS_DATA) {\n return;\n }\n\n // if called from template object ($this->scope_type set) we must consider\n // the scope type if template object\n if ($this->_usage == Smarty::IS_TEMPLATE) {\n if (($this->scope_type == Smarty::SCOPE_ROOT || $this->scope_type == Smarty::SCOPE_PARENT) &&\n $scope_type != Smarty::SCOPE_ROOT && $scope_type != Smarty::SCOPE_SMARTY\n ) {\n $scope_type = $this->scope_type;\n }\n }\n\n if ($scope_type == Smarty::SCOPE_LOCAL) {\n return;\n }\n\n $node = $this->parent;\n while ($node) {\n // bubble up only in template objects\n if ($node->_usage == Smarty::IS_TEMPLATE || ($scope_type == Smarty::SCOPE_SMARTY && $node->_usage != Smarty::IS_DATA)) {\n $node->_tpl_vars->{$varname} = $variable_obj;\n if ($scope_type == Smarty::SCOPE_PARENT) {\n break;\n }\n }\n $node = $node->parent;\n }\n }", "protected function getPreserveGetVars() {}", "function convert(){\n global $x;\n $x ='inside';\n}", "public function getAssignedVars()\n {\n return $this->_vars;\n }", "public function register_globals()\n {\n }", "public function register_globals()\n {\n }", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function declare()\n {\n // ...\n }", "function commonAssign() \n\t{\n\t\t$this->xt->assign(\"id\", $this->id);\n\t\t//search permissions\n\t\t$searchPermis = $this->permis[$this->tName]['search'];\n\t\t$this->xt->assign(\"details_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assign(\"pages_block\", $searchPermis && $this->rowsFound );\n\t\t$this->xt->assignbyref(\"body\", $this->body);\n\t\t\t\n\t\t$this->addAssignForGrid();\n\t\t\t\t\t\t\n\t\tif ($this->isDispGrid())\n\t\t\t$this->xt->assign_section(\"grid_block\", '', '');\n\t}", "function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }", "public function getGlobals();", "public function getGlobals();", "public function onTwigSiteVariables()\n\t{\n\t\trequire_once __DIR__ . '/classes/datetools.php';\n\n\t\t$args = [];\n\t\t$args['config'] = $this->grav['config'];\n\n\t\t$twig = $this->grav['twig'];\n\t\t$twig->twig_vars['datetools'] = new DateTools($args);\n\t\t//$twig->twig->addGlobal('datetools', new DateTools($args));\n\t}", "protected function scope(array &$scope): void\n {\n $scope['FOO'] = __METHOD__;\n }", "function set_all( $arr_vars, $scope='', $obj_to_array=0 ){\n global $FUNCS;\n\n if( is_array($arr_vars) && count($arr_vars) ){\n // Set all the array elements into the selected context\n foreach( $arr_vars as $varname=>$value ){\n $this->set( $varname, $value, $scope, $obj_to_array );\n }\n }\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}", "function __construct(&$vars) {\r\n }", "function getBindVariableName() ;", "public function getVarHolder()\n {\n return $this->var_holder;\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function setVars( array $vars ) {\n $this->vars += $vars;\n }", "function addition() {\n $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];\n}", "function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }", "public function variables(): array;", "public function variables(): array;", "function reset(){\n for( $x=count($this->ctx)-1; $x>=1; $x-- ){ // skip _ROOT_\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'] = array();\n return;\n }\n }\n }", "public function exportedVars(): iterable;", "private function populateScope(\\Scope $scope, $values) {\n \n $scope->setName($values['Name']);\n $scope->setDescription($values['Description']);\n $scope->setReserved(false);\n\n if (array_key_exists('Reserved', $values)) {\n $scope->setReserved($values['Reserved'] == true);\n } \n }", "protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }", "public function pushContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\t// If no context\n\t\tif ($index == 0 && !empty($this->tpl_vars)) {\n\t\t\t// Copy the variables in context #0\n\t\t\t$this->context[0] = $this->tpl_vars;\n\t\t\t$index = 1;\n\t\t}\n\n\t\t// Create a new context\n\t\t$this->context[$index] = array();\n\n\t\t// Copy global vars\n\t\tforeach ($this->tpl_vars_global_keys as $key) {\n\t\t\t$this->context[$index][$key] = $this->tpl_vars[$key];\n\t\t}\n\n\t\t$this->tpl_vars = &$this->context[$index];\n\t}" ]
[ "0.6641644", "0.64826626", "0.63503706", "0.6087459", "0.601733", "0.59810543", "0.59457684", "0.58883715", "0.5882299", "0.5871234", "0.58675045", "0.5817405", "0.57688063", "0.56937355", "0.5668305", "0.56221455", "0.5615361", "0.56122386", "0.5597342", "0.55550665", "0.55508524", "0.5532014", "0.55298585", "0.5518366", "0.550361", "0.55027395", "0.5468626", "0.54586935", "0.54574203", "0.54543024", "0.541971", "0.5418266", "0.54139674", "0.5404131", "0.53960806", "0.53915924", "0.53817034", "0.53774065", "0.5366396", "0.53650004", "0.53578615", "0.53435016", "0.53225636", "0.5318747", "0.5286104", "0.52792346", "0.5259296", "0.5253161", "0.52494544", "0.52413344", "0.523746", "0.521829", "0.5216858", "0.5198363", "0.51928186", "0.5190487", "0.5184828", "0.51766056", "0.5167776", "0.51666427", "0.5166114", "0.51612884", "0.5155052", "0.51534945", "0.51127094", "0.51127094", "0.5096901", "0.50961393", "0.5095579", "0.50866956", "0.50861955", "0.5083885", "0.50714785", "0.50660086", "0.5055261", "0.5055261", "0.5048309", "0.50475246", "0.5031128", "0.50309014", "0.5021575", "0.5021575", "0.5020471", "0.50197035", "0.50193846", "0.50127083", "0.50115657", "0.5009248", "0.5009016", "0.50087315", "0.4992151", "0.49891695", "0.49878663", "0.49845544", "0.49827716", "0.49827716", "0.49697116", "0.49675742", "0.49675342", "0.49624735", "0.4961614" ]
0.0
-1
Get the command from the input
function ChannelSay(&$irc, &$data) { $input = strtolower($data->message); $input = str_replace("!", "", $input); $command = explode(" ", $input, 2); global $pickupchannel; global $pickup; global $queue; global $users; global $waitbot; global $afk; global $classflood; global $startstatus; $nick = $data->nick; switch($command[0]) { //Admin remove user from pickup command case "adel": if($users->is_admin($data->nick)) { //Get entered nick $user = explode(" ", $data->message); $user = $user[1]; if($user != "") { $userq = $users->nicktoqauth($user); if($userq != false) { rm_player($userq); //Kill the pickup start process if this person was 12th if($waitbot->status == true) { if($waitbot->type > 0) { $waitbot->KillBot(); global $afk; } $afk->clear(); } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->message, "\x0302,00".$data->nick.": The user you entered could not be found"); } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->message, "\x0302,00!adel: Admin Delete Command: !adel <nick>"); } } break; //Add as Scout case "sc": case "sco": case "scout": case "scoot": if($pickup->count_class("scout") < 4) { $nick = $data->nick; $class = "scout"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Check if this player has not hit flood //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, if you definitely wish to add, type the command again"); } else { //Add the player add_player($qauth, $nick, $class, 2 ,$map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the scout spots are already filled. :("); //Check if the pickup is now full /*if($pickup->player_count() == 12) { start_pickup_s1(); }*/ } break; //Add as Soldier case "sol": case "soldier": case "sold": case "soulja": case "soli": case "solli": case "solly": if($pickup->count_class("soldier") < 4) { $nick = $data->nick; $class = "soldier"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, try to add again"); } else { //Add the player add_player($qauth, $nick, $class, 2, $map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the soldier spots are already filled. :("); } break; //Add as Demoman case "de": case "dem": case "demo": case "demoman": case "negro": if($pickup->count_class("demoman") < 2) { $nick = $data->nick; $class = "demoman"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, try to add again"); } else { //Add the player add_player($qauth, $nick, $class, 2, $map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the demo spots are already filled. :("); } break; //Add as Medic case "med": case "medic": case "madic": if($pickup->count_class("medic") < 2) { $nick = $data->nick; $class = "medic"; $map = $command[1]; $qauth = $users->nicktoqauth($nick); //Perform a whois check if qauth is false if($qauth == false) { $queue->add_item($data->nick, "check"); $irc->whois($data->nick); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have 2 logins with your Q account in this channel, try to add again"); } else { //Add the player add_player($qauth, $nick, $class, 2, $map); //Check if the pickup is now full if($pickup->player_count() == 12) { start_pickup_s1(); } } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Sorry ".$data->nick.", All of the medic spots are already filled. :("); } break; //Delete from the pickup case "del": case "delete": case "rem": case "remove": $nick = $data->nick; $qauth = $users->nicktoqauth($nick); rm_player($qauth); //Kill the pickup start process if this person was 12th if($waitbot->status == true) { if($waitbot->type > 0) { $waitbot->KillBot(); global $afk; } } $afk->clear(); break; //Map Vote case "map": case "vote": $nick = $data->nick; $qauth = $users->nicktoqauth($nick); $map = $command[1]; //Check if the user was added if($pickup->is_added($qauth) == true) { //Change topic if this map was not already voted for if($pickup->mapvote($qauth, find_map($map)) != true) { SetTopic(); } } break; case "rdy": case "ready": if($waitbot->status == true) { if($waitbot->type == 1) { //Check if the user was marked as afk if($afk->is_afk($users->nicktoqauth($data->nick))) { $afk->rm_player($users->nicktoqauth($data->nick)); } //Check if everyone has now readied up if(count($afk->afklist) == 0) { //Run straight to stage 2 start_pickup_s2(); } else { rupmessage(); } } } break; case "afk": if($waitbot->status == false) { //Mark the user afk $users->mark_afk($users->nicktoqauth($data->nick)); $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You have been marked as afk, simply type something in the channel to be marked as back."); } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00".$data->nick.": You cannot mark yourself as afk during this time"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function command()\n {\n return $this->parseCommand()[0];\n }", "public function getCommand() {}", "public function getCommand(string $command);", "public function getCommand();", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command received, no result\");\n }\n $this->command = $_POST['command'];\n }", "abstract protected function getCommand();", "public function getCommand() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"command\", NULL);\n\t}", "public function getCommand() {\n return $this->getValue(self::FIELD_COMMAND);\n }", "public function getCommand()\n {\n }", "public function getCommand(): string\n {\n return $this->attributes->get('command', '');\n }", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "function _getInputCLI()\r\n{\r\n $opt = _read();\r\n $opt = strtoupper (trim($opt));\r\n return $opt;\r\n}", "public function getCommand() {\n\t\treturn $this->command;\n\t}", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function command()\n {\n return $this->command;\n }", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getCommandText();", "public function command(): string;", "protected function extractCommand() {\n\t\t$queryPath = $this->getQueryPath();\n\t#\tif( count( $queryPath ) >= 2 )\n\t\t\treturn array_pop( $queryPath );\n\t#\treturn current( $queryPath );\n\t}", "public function getCmd()\n {\n if (! isset($this->params['args']['cmd'])) {\n return false;\n }\n\n return $this->params['args']['cmd'];\n }", "public function getCommand()\n {\n return $this->_command;\n }", "public function getCommand() {\n\t\treturn $this->_command;\n\t}", "public function getCommand() {\n return $this->command;\n }", "public function get()\n\t\t{\n\t\t\treturn $this->command;\n\t\t}", "public function getCommand()\n {\n return $this->_command;\n }", "public function getRequestCommand(){\n\t\treturn $this->requestCommand;\n\t}", "function getCommand($text)\r\n{\r\n\t$cmd = strtolower(substr($text, 0, 4));\r\n\tswitch ($cmd)\r\n\t{\r\n\t\tcase '/me ':\r\n\t\tcase '\\me ':\r\n\t\t\t$command = 'action';\r\n\t\t\tbreak;\r\n\t\tcase 'http':\r\n\t\tcase 'www.':\r\n\t\t\t$command = 'link';\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t$command = false;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn $command;\r\n}", "public function getCommand(RequestInterface $request);", "public function getInput(): string\n {\n return $this->input;\n }", "public function getCommand()\n {\n return $this->oCommand;\n }", "protected function getCommand(RequestInterface $request)\n {\n $requestType = $request->getRequestType();\n $token = $request->getToken();\n if (empty($this->command[$requestType->getValue()][$token])) {\n return null;\n }\n $commands = $this->command[$requestType->getValue()][$token];\n if ($request instanceof SlashRequest) {\n if (!empty($commands[$request->getCommand()])) {\n return $commands[$request->getCommand()];\n }\n if (!empty($commands[''])) {\n return $commands[''];\n }\n return null;\n }\n return $commands;\n }", "abstract public function getCommandName();", "static public function GetCommand() {\n if (isset(self::$command))\n return self::$command;\n else\n return false;\n }", "public function getCommand() {\n\t\t$command = $this->extractCommand() .'Action';\n\n\t\tif( $this->_verbose )\n\t\t\t$this->set( '_command', $command );\n\n\t\treturn $command;\n\t}", "public function commandValue()\n {\n return $this->parseCommand()[1];\n }", "abstract public function getCommand(string $name): string;", "public function getCommand()\n {\n return $this->getPath() . \" -\" . $this->getFlags();\n }", "private function get_current_command() {\n\t\t$runner = new RunnerInstance();\n\n\t\treturn implode( ' ', (array) $runner()->arguments );\n\t}", "public static function getCommandData($input) {\n $response = false;\n if (isset($input['hostname']) && isset($input['commandcode'])) {\n $url = self::getUrl('getcommanddata');\n $request = Array(\n \"data\" => Array(\n \"hostname\" => $input['hostname'],\n \"commandcode\" => $input['commandcode']\n )\n );\n $request = json_encode($request);\n $response = self::getApiResponse($url, $request);\n $response = json_decode($response, true);\n if (isset($response['data'])) {\n $response = $response['data'];\n } else {\n return false;\n }\n }\n return $response;\n }", "public function getInput() {}", "protected function determineCommand()\n {\n if (mb_strlen($this->source) === 0) {\n $this->isInterrupted = true;\n\n return;\n }\n\n $this->command = mb_substr($this->source, 0, 1);\n }", "protected function getCommandName(InputInterface $input)\n {\n try {\n $this->find($input->getFirstArgument());\n return parent::getCommandName($input);\n } catch (\\InvalidArgumentException $e) {\n $this->getDefinition()->setArguments(array());\n return 'phlexget';\n }\n }", "protected function getCommandInput()\n {\n $modelName = trim($this->argument('model-name'));\n $cName = trim($this->option('controller-name'));\n $controllerName = $cName ? Str::finish($cName, Config::getControllerNamePostFix()) : Helpers::makeControllerName($modelName);\n $prefix = ($this->option('routes-prefix') == 'default-form') ? Helpers::makeRouteGroup($modelName) : $this->option('routes-prefix');\n $resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($modelName);\n $force = $this->option('force');\n\n $template = $this->getTemplateName();\n $extends = $this->generatorOption('controller-extends');\n $withAuth = $this->option('with-auth');\n $viewDirectory = $this->option('views-directory');\n $langFile = $this->option('language-filename') ?: self::makeLocaleGroup($modelName);\n $apiVersion = $this->option('api-version');\n $controllerDirectory = trim($this->option('controller-directory'));\n $withFormRequest = false;\n\n return (object) compact(\n 'modelName',\n 'prefix',\n 'force',\n 'resourceFile',\n 'langFile',\n 'template',\n 'controllerName',\n 'extends',\n 'withAuth',\n 'apiVersion',\n 'controllerDirectory',\n 'withFormRequest',\n 'viewDirectory'\n );\n }", "public function getTaskCmd()\n {\n return $this->get(self::TASK_CMD);\n }", "public function getCommand()\n {\n return \"{$this->pipe} | {$this->nodeExecutable} \" . $this->script;\n }", "public static function getLine (\n\t)\t\t\t\t\t\t// RETURNS <str> the text entered into the command line.\n\t\n\t// $input = CLI_Input::getLine();\n\t{\n\t\treadline_callback_handler_remove();\n\t\treturn readline();\n\t}", "public function getToolCommand(): string;", "protected function getCommandInput()\n {\n $modelName = trim($this->argument('model-name'));\n $fileName = trim($this->option('class-name')) ?: Helpers::makeFormRequestName($modelName);\n $resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($modelName);\n $prefix = ($this->option('routes-prefix') == 'default-form') ? Helpers::makeRouteGroup($modelName) : $this->option('routes-prefix');\n\n $force = $this->option('force');\n $withAuth = $this->option('with-auth');\n $template = $this->option('template-name');\n $formRequestDirectory = trim($this->option('form-request-directory'));\n\n return (object) compact(\n 'formRequestDirectory',\n 'withAuth',\n 'modelName',\n 'prefix',\n 'fileName',\n 'resourceFile',\n 'force',\n 'template'\n );\n }", "public function parse($input) {\n preg_match($this->pattern, $input, $matches);\n $command = ucfirst(strtolower($matches['class'])) . ucfirst(strtolower($matches['action']));\n $arguments = [$matches['argument1'], $matches['rest']];\n //Construct the correct classpath and name so it can be autoloaded.\n $command_class = $this->command_namespace . $command . 'Command';\n if (class_exists($command_class)) {\n return new $command_class($this->remote_request, $arguments);\n } else {\n return new UnknownCommand($command);\n }\n }", "function getInput()\n {\n $input = '';\n $fr = fopen(\"php://stdin\", \"r\");\n while (!feof ($fr))\n {\n $input .= fgets($fr);\n }\n fclose($fr);\n return $input;\n }", "function qform_get_cmd($cmd_default = '')\n{\n // try GET\n $cmd = get_param('qform_cmd');\n $id = get_param('id');\n if (empty($id)) {\n $id = get_param('primary_val');\n }\n\n // get cmd from POST\n if (empty($cmd)) {\n $cmd = post_param('qform_cmd');\n }\n if (empty($id)) {\n $id = post_param('primary_val');\n }\n\n // manage cmd\n if (!empty($id) && !$cmd) {\n $cmd = 'update';\n }\n if (empty($cmd)) {\n $cmd = $cmd_default;\n }\n\n // process?\n if (post_param('qform_process') || $cmd == 'remove_item') {\n $process = true;\n } else {\n $process = false;\n }\n if ($process && !$id) {\n $cmd = 'new';\n }\n\n return array('cmd' => $cmd, 'id' => $id, 'process' => $process);\n}", "public function getCmdType();", "public function getInput();", "public function getInput();", "public function getInput();", "public function getCommandIdentifier() {}", "public function get_input()\n {\n }", "protected function getCommandName(InputInterface $input)\n {\n return 'phpcb';\n }", "abstract function command();", "abstract public function getInput();", "public static function getCharacter (\n\t)\t\t\t\t\t\t// RETURNS <str> a single character from the command line.\n\t\n\t// $characterPressed = CLI_Input::getCharacter();\n\t{\n\t\t// Prepare Required Functions\n\t\treadline_callback_handler_install('', function() { });\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\t$r = array(STDIN);\n\t\t\t$w = NULL;\n\t\t\t$e = NULL;\n\t\t\t$n = stream_select($r, $w, $e, 0);\n\t\t\t\n\t\t\tif($n && in_array(STDIN, $r))\n\t\t\t{\n\t\t\t\t$c = stream_get_contents(STDIN, 1);\n\t\t\t\t\n\t\t\t\treturn $c;\n\t\t\t}\n\t\t}\n\t}", "protected final function commandForToken($token)\n {\n if (isset($this->commandMap[$token])) return $this->commandMap[$token];\n return NULL;\n }", "public static function getCmd($name, $default = '', $hash = 'default')\n {\n return static::getVar($name, $default, $hash, 'cmd');\n }", "protected function getCommandInput()\n {\n $input = new ApiScaffoldInput(parent::getCommandInput());\n\n $input->withApiResource = $this->option('with-api-resource');\n $input->apiResourceDirectory = $this->option('api-resource-directory');\n $input->apiResourceCollectionDirectory = $this->option('api-resource-collection-directory');\n $input->apiResourceName = $this->option('api-resource-name');\n $input->apiResourceCollectionName = $this->option('api-resource-collection-name');\n $input->apiVersion = $this->option('api-version');\n $input->withDocumentations = $this->option('with-api-docs');\n\n return $input;\n }", "public function getTargetCmd() {\n if(!$this->isTargetInternal())\n return null;\n\n $c = $this->cutTarget();\n return strtolower($c['cmd']);\n }", "public function getCommand()\n {\n if (is_null($this->pipe)) {\n return \"{$this->pythonExecutable} {$this->script}\";\n }\n\n return \"{$this->pipe} | {$this->pythonExecutable} {$this->script}\";\n }", "public static function command()\n\t{\n\t\treturn self::getConnection()->command();\n\t}", "public function getCommandName(): string;", "public function getCommandName(InputInterface $input)\n {\n return 'peridot';\n }", "public function getCurrentCommand()\n {\n return $this->currentCommand;\n }", "public function latestCommand()\n {\n return $this->request('get', '/api/latest-command')['command'];\n }", "public function getCommand()\n {\n return sprintf('use %s', $this->_tube);\n }", "public function getInput($key);", "function get()\n\t{\n\t\treturn implode(' ', $this->_cmd);\n\t}", "protected function getCommandInput()\n {\n $input = new ScaffoldInputBase(trim($this->argument('model-name')));\n\n $input->prefix = trim($this->option('routes-prefix'));\n $input->languageFileName = trim($this->option('language-filename'));\n $input->table = trim($this->option('table-name'));\n $input->controllerName = trim($this->option('controller-name')) ?: Helpers::makeControllerName($input->modelName);\n $input->perPage = intval($this->option('models-per-page'));\n $input->resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($input->modelName);\n $input->fields = trim($this->option('fields'));\n $input->withFormRequest = $this->option('with-form-request');\n $input->controllerDirectory = $this->option('controller-directory');\n $input->controllerExtends = $this->option('controller-extends') ?: null;\n $input->modelExtends = $this->option('model-extends') ?: null;\n $input->withMigration = $this->option('with-migration');\n $input->force = $this->option('force');\n $input->modelDirectory = $this->option('model-directory');\n $input->primaryKey = $this->option('primary-key');\n $input->withSoftDelete = $this->option('with-soft-delete');\n $input->withoutTimeStamps = $this->option('without-timestamps');\n $input->withoutLanguages = $this->option('without-languages');\n $input->withoutModel = $this->option('without-model');\n $input->withoutController = $this->option('without-controller');\n $input->withoutFormRequest = $this->option('without-form-request');\n $input->migrationClass = $this->option('migration-class-name');\n $input->connectionName = $this->option('connection-name');\n $input->engineName = $this->option('engine-name');\n $input->template = $this->getTemplateName();\n $input->tableExists = $this->option('table-exists');\n $input->translationFor = $this->option('translation-for');\n $input->withAuth = $this->option('with-auth');\n $input->formRequestDirectory = $this->option('form-request-directory');\n\n return $input;\n }", "public function command($cmd)\n {\n $response = $this->protocol->opQuery(\"{$this->name}.\\$cmd\", $cmd, 0, -1, 0);\n return $response['result'][0];\n }", "function getInput()\n {\n $handle = fopen(\"php://stdin\", \"r\");\n $input = trim(fgets($handle));\n fclose($handle);\n return $input;\n }", "public function getCmdId()\n {\n return $this->get(self::CMD_ID);\n }", "public function getFullCommand(): string\n {\n return \"/{$this->request->command} {$this->name}\";\n }", "public function getInput() {\n return $this->input;\n }", "public function getInput() {\n return $this->input;\n }", "static public function parse_commands($input)\n\t{\n\t\t$commands = array();\n\n\t\tforeach ($input as $k => $c)\n\t\t{\n\t\t\t// if we're dealing string as parameter or an assoc array\n\t\t\tif ( ! is_array($c) OR count(array_filter(array_keys($c), 'is_string')) > 0)\n\t\t\t{\n\t\t\t\t$commands[] = array('name' => $k, 'param' => $c);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// if multiple command instances were defined (non-assoc array)\n\t\t\t\tforeach ($c as $p)\n\t\t\t\t{\n\t\t\t\t\t$commands[] = array('name' => $k, 'param' => $p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $commands;\n\t}", "public function handleInput($input)\n {\n $input = strtoupper(trim($input));\n $input = preg_replace('/\\s+/', ' ', $input); // Remove any extra spaces.\n $input = preg_replace('/\\s*,\\s*/', ',', $input); // Remove any spaces after comma\n $args = explode(' ', $input);\n $this->command = $args[0];\n if ($this->isValidCommand($this->command)) {\n $placeArguments = [];\n if ($this->command === self::CMD_PLACE) {\n $placeArguments = $this->handlePlaceCommand(isset($args[1]) ? $args[1] : '');\n }\n if ($this->valid) {\n $this->processInput($this->command, $placeArguments);\n }\n } else {\n echo \"Please enter a valid command.\\n\";\n }\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getQueryCommand();", "public function getCommand()\n {\n\n return [\n\n // Usage of the command\n 'usage' => \"Command reads a file and output it in upper or lower case\",\n\n // Options for only this command\n 'options' => [\n '--up' => 'Will put string in uppercase',\n '--low' => 'Will put string in lowercase'\n ],\n\n // 'cast' => [\n // 'up' => 'int', // Cast to int, bool, float. Default is string\n // ],\n\n // Main options, which other commands may have access to\n 'main_options' => [\n '--main' => 'Test with a main option'\n ],\n\n // Are there any arguments and what are they used for.\n // This is only for displaying help. Any number of arguments can be\n 'arguments' => [\n 'File' => 'Read from a file and output to stdout. You can also pipe input to the command',\n ],\n \n // Set a default command if none if given\n // php demos/example --up README.md\n // Instead of:\n // php demos/example echo --up README.md\n // Then set 'is_default' to true\n // 'is_default' => true, \n ];\n }", "function command_query($sock, $input) {\n\t// extract key and value\n\tif ($input[0] != '\"' || ($pos = strpos($input, '\"', 1)) === false) {\n\t\tprint(\"\\tSyntax error\\n\");\n\t\treturn;\n\t}\n print \"input:$input #$pos\\n\";\n $query = substr($input, 1, $pos-1);\n print \"query: $query\\n\";\n\t// send the command\n\t$buffer = chr(1) . chr(mb_strlen($query, 'ascii')+1) . $query.chr(0);\n print(\"sending $buffer#\\n\");\n\tfwrite($sock, $buffer);\n\t$response = fread($sock, 1);\n\tif (ord($response) != 1) {\n\t\tprint(\"\\tERROR\\n\");\n\t\treturn;\n\t}\n\t$response = fread($sock, 4);\n\t$length = unpack('Nint', $response);\n\t$length = $length['int'];\n\t$value = null;\n\tif ($length > 0) {\n\t\t$value = fread($sock, $length);\n\t\tprint(\"$value\\n\");\n\t}\n}", "public function commandWithIOParameters(InputInterface $input, OutputInterface $output)\n {\n return $input->getFirstArgument();\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function generateOutputCmd(): string;", "private function Getinstruction(){\n\t\t\twhile($line = fgets(STDIN)) {\n\t\t\t\t\n //pattern for string in line with first char # to end of line\n $comment_pattern = \"/#.*$/\";\n if(preg_match($comment_pattern,$line)){\n $this->COUNTERS[COMMENTS] +=1;\n }\n\n $line = preg_replace($comment_pattern,'',$line);\n\n //Split tokens with whitespaces on line. \n //-1 represent no limit to length. \n //flag PREG_SPLIT_NO_EMPTY => split will return only non empty parts\n\t\t\t\t$tokens = preg_split('/\\s+/', $line,-1,PREG_SPLIT_NO_EMPTY);\t\n \n if(count($tokens) > 0){\n $this->COUNTERS[LOC] += 1;\n return new instruction($tokens[0],$tokens[1],$tokens[2], $tokens[3], count($tokens));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"EOF\";\n\t\t}", "public function getInput()\n {\n return $this->_input;\n }" ]
[ "0.7548257", "0.7465151", "0.7457068", "0.74011767", "0.73530495", "0.7253527", "0.7126704", "0.71205306", "0.7037723", "0.6936631", "0.69175893", "0.69175893", "0.6888208", "0.68816423", "0.6867757", "0.6867757", "0.6867757", "0.6867757", "0.68676025", "0.6865471", "0.6865471", "0.68643355", "0.68610233", "0.68557703", "0.68514705", "0.68475914", "0.68413335", "0.6802883", "0.67031235", "0.66836774", "0.6655615", "0.6585851", "0.65831757", "0.65780026", "0.6568657", "0.6545921", "0.6475105", "0.6465672", "0.64649856", "0.6464025", "0.64340675", "0.63143474", "0.6299559", "0.6285996", "0.6285579", "0.62625", "0.62448007", "0.62276053", "0.6216736", "0.62111324", "0.6211104", "0.6199331", "0.619888", "0.6196301", "0.61908895", "0.61837506", "0.6179647", "0.6167474", "0.6167474", "0.6167474", "0.61575943", "0.61392516", "0.6108242", "0.61007684", "0.609913", "0.60961753", "0.60859776", "0.6073008", "0.6046725", "0.60450125", "0.60436374", "0.60183924", "0.6011593", "0.6009019", "0.6008246", "0.6006853", "0.5959067", "0.5940561", "0.59335667", "0.592152", "0.59032327", "0.5847519", "0.5835314", "0.5835051", "0.5823401", "0.5823401", "0.579195", "0.57799315", "0.5771223", "0.5771223", "0.5771223", "0.5771223", "0.5771223", "0.5765445", "0.5758272", "0.57572573", "0.57490385", "0.5743103", "0.5738075", "0.57351375", "0.5731579" ]
0.0
-1
Get the command from the input
function info(&$irc, &$data) { $command = explode(" ", $data->message); $command[0] = strtolower($command[0]); $command[0] = str_replace("!", "", $command[0]); global $pickupchannel; global $pickup; global $queue; global $skill; global $messages; global $users; global $invites; global $messageflood; global $skillstack; $nick = $data->nick; //Check for set message command if($command[0] == "setmessage") { //Check if issuer was an admin if($users->is_admin($nick)) { $new_command = strtolower($command[1]); $preload = "!setmessage ".$command[1]." "; $new_message = str_replace($preload, "", $data->message); if(isset($command[1]) || ($command[1] != "")) { if(isset($command[2]) || ($command[2] != "")) { //Check if it exists $counter1 = 0; $exists = false; while($counter1 < count($messages)) { if($messages[$counter1]["command"] == $new_command) { $exists = $counter1; $counter1 = count($messages) + 1; } $counter1++; } if($exists === false) { $position = count($messages); $messages[$position]["command"] = $new_command; $messages[$position]["message"] = $new_message; //Add to MySQL mysql_pu_addmessage($new_command, $new_message); //Inform the channel $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00New message successfully added: !".$new_command); } else { $messages[$exists]["message"] = $new_message; //Update on MySQL mysql_pu_updatemessage($new_command, $new_message); //Inform the channel $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Existing message successfully updated: !".$new_command); } //Change input so the new command will be displayed $command[0] = $new_command; } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No Message was entered"); } } else { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No command was entered"); } } } //Check for delete message command if($command[0] == "delmessage") { //Check if issuer was an admin if($users->is_admin($nick)) { $old_command = strtolower($command[1]); //Check if it exists $counter1 = 0; $exists = false; while($counter1 < count($messages)) { if($messages[$counter1]["command"] == $old_command) { $exists = $counter1; $counter1 = count($messages) + 1; } $counter1++; } if($exists === false) { $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00No such message exists: !".$old_command); } else { //Remove from the messages list $messages[$exists]["command"] = ""; $messages[$exists]["message"] = ""; //Check if the array should be re-oredered $counter2 = $exists + 1; $messages_size = count($messages); if($counter2 < $messages_size) { $counter3 = $exists; while($counter2 < $messages_size) { $messages[$counter3]["command"] = $messages[$counter2]["command"]; $messages[$counter3]["message"] = $messages[$counter2]["message"]; $messages[$counter2]["command"] = ""; $messages[$counter2]["message"] = ""; //Unset $counter2 element if it is the end of the array $unset = $counter2 + 1; if(($unset) == $messages_size) { unset($messages[$counter2]); } //Increment both counters $counter2++; $counter3++; } } else { //Unset current position unset($messages[$exists]); } //Remove in MySQL mysql_pu_delmessage($old_command); //Inform the channel $irc->message(SMARTIRC_TYPE_CHANNEL, $pickupchannel, "\x0302,00Successfully deleted message: !".$old_command); } } } //////////////////////////////////////////////// //This functionality has now been replaced by MessageBot (messagebot.php) //!skill command to let players see their skill rating in the bot /*if(strtolower($command[0]) == "skill") { if($command[1] == "") { $user = $nick; $user = $users->nicktoqauth($nick); } else { if($users->nicktoqauth($command[1]) != false) { $user = $users->nicktoqauth($command[1]); } } //Get the players skill as each class $scout = $users->Get_Skill($user, "scout"); $demo = $users->get_skill($user, "demo"); $soldier = $users->get_skill($user, "soldier"); $medic = $users->get_skill($user, "medic"); //Create output message $output = "\x0302,00\x02Skill:\x02 " . $users->qauthtonick($user) . " || Scout: ".$scout." / Demo: ".$demo." / Soldier: ".$soldier." / Medic: ".$medic; //Check spam class if($skillstack->trigger($user) == true) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $output); } }*/ if(strtolower($command[0]) == "matches") { //Look up match info from web server $stats = file_get_contents("http://pickup.pixelgaming.eu/dynamic.php?job=stats"); $stats = explode(":", $stats); $stats = $stats[0]; //Generate output $output = "\x0302,00" . $stats . " matches have been played since 8th February 2011"; //Check messageflood if((time() - $messageflood['matches']) > 20) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $output); } $messageflood['matches'] = time(); } if(strtolower($command[0]) == "players") { //Look up match info from web server $stats = file_get_contents("http://pickup.pixelgaming.eu/dynamic.php?job=stats"); $stats = explode(":", $stats); $stats = $stats[1]; //Generate output $output = "\x0302,00There are currently " . $stats . " players invited to this channel"; //Check messageflood if((time() - $messageflood['players']) > 20) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $output); } $messageflood['players'] = time(); } //Change command name for some commonly used commands switch($command[0]) { case "mum": case "voice": case "vent": case "ventrilo": case "ventrillo": $command[0] = "mumble"; break; case "req": case "reqs": case "requis": case "requi": case "requirements": $command[0] = "requirements"; break; case "rule": case "rul": case "ruls": $command[0] = "rules"; break; } //Check message array and display if it matches /*$counter = 0; while($counter < count($messages)) { if($messages[$counter]["command"] == $command[0]) { //Check messages anti flood if((time() - $messageflood[$command[0]]) > 15) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "\x0302,00".ucfirst($command[0]).": ".$messages[$counter]["message"]); $messageflood[$command[0]] = time(); } } $counter++; }*/ //////////////////////////////////////////////// //This functionality has now been replaced by MessageBot (messagebot.php) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function command()\n {\n return $this->parseCommand()[0];\n }", "public function getCommand() {}", "public function getCommand(string $command);", "public function getCommand();", "private function get_command(){\n if (!isset($_POST['command'])) {\n die(\"No command received, no result\");\n }\n $this->command = $_POST['command'];\n }", "abstract protected function getCommand();", "public function getCommand() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"command\", NULL);\n\t}", "public function getCommand() {\n return $this->getValue(self::FIELD_COMMAND);\n }", "public function getCommand()\n {\n }", "public function getCommand(): string\n {\n return $this->attributes->get('command', '');\n }", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "function _getInputCLI()\r\n{\r\n $opt = _read();\r\n $opt = strtoupper (trim($opt));\r\n return $opt;\r\n}", "public function getCommand() {\n\t\treturn $this->command;\n\t}", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function command()\n {\n return $this->command;\n }", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getCommandText();", "public function command(): string;", "protected function extractCommand() {\n\t\t$queryPath = $this->getQueryPath();\n\t#\tif( count( $queryPath ) >= 2 )\n\t\t\treturn array_pop( $queryPath );\n\t#\treturn current( $queryPath );\n\t}", "public function getCmd()\n {\n if (! isset($this->params['args']['cmd'])) {\n return false;\n }\n\n return $this->params['args']['cmd'];\n }", "public function getCommand()\n {\n return $this->_command;\n }", "public function getCommand() {\n\t\treturn $this->_command;\n\t}", "public function getCommand() {\n return $this->command;\n }", "public function get()\n\t\t{\n\t\t\treturn $this->command;\n\t\t}", "public function getCommand()\n {\n return $this->_command;\n }", "public function getRequestCommand(){\n\t\treturn $this->requestCommand;\n\t}", "function getCommand($text)\r\n{\r\n\t$cmd = strtolower(substr($text, 0, 4));\r\n\tswitch ($cmd)\r\n\t{\r\n\t\tcase '/me ':\r\n\t\tcase '\\me ':\r\n\t\t\t$command = 'action';\r\n\t\t\tbreak;\r\n\t\tcase 'http':\r\n\t\tcase 'www.':\r\n\t\t\t$command = 'link';\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t$command = false;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn $command;\r\n}", "public function getCommand(RequestInterface $request);", "public function getInput(): string\n {\n return $this->input;\n }", "public function getCommand()\n {\n return $this->oCommand;\n }", "protected function getCommand(RequestInterface $request)\n {\n $requestType = $request->getRequestType();\n $token = $request->getToken();\n if (empty($this->command[$requestType->getValue()][$token])) {\n return null;\n }\n $commands = $this->command[$requestType->getValue()][$token];\n if ($request instanceof SlashRequest) {\n if (!empty($commands[$request->getCommand()])) {\n return $commands[$request->getCommand()];\n }\n if (!empty($commands[''])) {\n return $commands[''];\n }\n return null;\n }\n return $commands;\n }", "abstract public function getCommandName();", "static public function GetCommand() {\n if (isset(self::$command))\n return self::$command;\n else\n return false;\n }", "public function getCommand() {\n\t\t$command = $this->extractCommand() .'Action';\n\n\t\tif( $this->_verbose )\n\t\t\t$this->set( '_command', $command );\n\n\t\treturn $command;\n\t}", "public function commandValue()\n {\n return $this->parseCommand()[1];\n }", "abstract public function getCommand(string $name): string;", "public function getCommand()\n {\n return $this->getPath() . \" -\" . $this->getFlags();\n }", "private function get_current_command() {\n\t\t$runner = new RunnerInstance();\n\n\t\treturn implode( ' ', (array) $runner()->arguments );\n\t}", "public static function getCommandData($input) {\n $response = false;\n if (isset($input['hostname']) && isset($input['commandcode'])) {\n $url = self::getUrl('getcommanddata');\n $request = Array(\n \"data\" => Array(\n \"hostname\" => $input['hostname'],\n \"commandcode\" => $input['commandcode']\n )\n );\n $request = json_encode($request);\n $response = self::getApiResponse($url, $request);\n $response = json_decode($response, true);\n if (isset($response['data'])) {\n $response = $response['data'];\n } else {\n return false;\n }\n }\n return $response;\n }", "public function getInput() {}", "protected function determineCommand()\n {\n if (mb_strlen($this->source) === 0) {\n $this->isInterrupted = true;\n\n return;\n }\n\n $this->command = mb_substr($this->source, 0, 1);\n }", "protected function getCommandName(InputInterface $input)\n {\n try {\n $this->find($input->getFirstArgument());\n return parent::getCommandName($input);\n } catch (\\InvalidArgumentException $e) {\n $this->getDefinition()->setArguments(array());\n return 'phlexget';\n }\n }", "protected function getCommandInput()\n {\n $modelName = trim($this->argument('model-name'));\n $cName = trim($this->option('controller-name'));\n $controllerName = $cName ? Str::finish($cName, Config::getControllerNamePostFix()) : Helpers::makeControllerName($modelName);\n $prefix = ($this->option('routes-prefix') == 'default-form') ? Helpers::makeRouteGroup($modelName) : $this->option('routes-prefix');\n $resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($modelName);\n $force = $this->option('force');\n\n $template = $this->getTemplateName();\n $extends = $this->generatorOption('controller-extends');\n $withAuth = $this->option('with-auth');\n $viewDirectory = $this->option('views-directory');\n $langFile = $this->option('language-filename') ?: self::makeLocaleGroup($modelName);\n $apiVersion = $this->option('api-version');\n $controllerDirectory = trim($this->option('controller-directory'));\n $withFormRequest = false;\n\n return (object) compact(\n 'modelName',\n 'prefix',\n 'force',\n 'resourceFile',\n 'langFile',\n 'template',\n 'controllerName',\n 'extends',\n 'withAuth',\n 'apiVersion',\n 'controllerDirectory',\n 'withFormRequest',\n 'viewDirectory'\n );\n }", "public function getTaskCmd()\n {\n return $this->get(self::TASK_CMD);\n }", "public function getCommand()\n {\n return \"{$this->pipe} | {$this->nodeExecutable} \" . $this->script;\n }", "public static function getLine (\n\t)\t\t\t\t\t\t// RETURNS <str> the text entered into the command line.\n\t\n\t// $input = CLI_Input::getLine();\n\t{\n\t\treadline_callback_handler_remove();\n\t\treturn readline();\n\t}", "public function getToolCommand(): string;", "protected function getCommandInput()\n {\n $modelName = trim($this->argument('model-name'));\n $fileName = trim($this->option('class-name')) ?: Helpers::makeFormRequestName($modelName);\n $resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($modelName);\n $prefix = ($this->option('routes-prefix') == 'default-form') ? Helpers::makeRouteGroup($modelName) : $this->option('routes-prefix');\n\n $force = $this->option('force');\n $withAuth = $this->option('with-auth');\n $template = $this->option('template-name');\n $formRequestDirectory = trim($this->option('form-request-directory'));\n\n return (object) compact(\n 'formRequestDirectory',\n 'withAuth',\n 'modelName',\n 'prefix',\n 'fileName',\n 'resourceFile',\n 'force',\n 'template'\n );\n }", "public function parse($input) {\n preg_match($this->pattern, $input, $matches);\n $command = ucfirst(strtolower($matches['class'])) . ucfirst(strtolower($matches['action']));\n $arguments = [$matches['argument1'], $matches['rest']];\n //Construct the correct classpath and name so it can be autoloaded.\n $command_class = $this->command_namespace . $command . 'Command';\n if (class_exists($command_class)) {\n return new $command_class($this->remote_request, $arguments);\n } else {\n return new UnknownCommand($command);\n }\n }", "function getInput()\n {\n $input = '';\n $fr = fopen(\"php://stdin\", \"r\");\n while (!feof ($fr))\n {\n $input .= fgets($fr);\n }\n fclose($fr);\n return $input;\n }", "function qform_get_cmd($cmd_default = '')\n{\n // try GET\n $cmd = get_param('qform_cmd');\n $id = get_param('id');\n if (empty($id)) {\n $id = get_param('primary_val');\n }\n\n // get cmd from POST\n if (empty($cmd)) {\n $cmd = post_param('qform_cmd');\n }\n if (empty($id)) {\n $id = post_param('primary_val');\n }\n\n // manage cmd\n if (!empty($id) && !$cmd) {\n $cmd = 'update';\n }\n if (empty($cmd)) {\n $cmd = $cmd_default;\n }\n\n // process?\n if (post_param('qform_process') || $cmd == 'remove_item') {\n $process = true;\n } else {\n $process = false;\n }\n if ($process && !$id) {\n $cmd = 'new';\n }\n\n return array('cmd' => $cmd, 'id' => $id, 'process' => $process);\n}", "public function getCmdType();", "public function getInput();", "public function getInput();", "public function getInput();", "public function getCommandIdentifier() {}", "public function get_input()\n {\n }", "protected function getCommandName(InputInterface $input)\n {\n return 'phpcb';\n }", "abstract function command();", "abstract public function getInput();", "public static function getCharacter (\n\t)\t\t\t\t\t\t// RETURNS <str> a single character from the command line.\n\t\n\t// $characterPressed = CLI_Input::getCharacter();\n\t{\n\t\t// Prepare Required Functions\n\t\treadline_callback_handler_install('', function() { });\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\t$r = array(STDIN);\n\t\t\t$w = NULL;\n\t\t\t$e = NULL;\n\t\t\t$n = stream_select($r, $w, $e, 0);\n\t\t\t\n\t\t\tif($n && in_array(STDIN, $r))\n\t\t\t{\n\t\t\t\t$c = stream_get_contents(STDIN, 1);\n\t\t\t\t\n\t\t\t\treturn $c;\n\t\t\t}\n\t\t}\n\t}", "protected final function commandForToken($token)\n {\n if (isset($this->commandMap[$token])) return $this->commandMap[$token];\n return NULL;\n }", "public static function getCmd($name, $default = '', $hash = 'default')\n {\n return static::getVar($name, $default, $hash, 'cmd');\n }", "protected function getCommandInput()\n {\n $input = new ApiScaffoldInput(parent::getCommandInput());\n\n $input->withApiResource = $this->option('with-api-resource');\n $input->apiResourceDirectory = $this->option('api-resource-directory');\n $input->apiResourceCollectionDirectory = $this->option('api-resource-collection-directory');\n $input->apiResourceName = $this->option('api-resource-name');\n $input->apiResourceCollectionName = $this->option('api-resource-collection-name');\n $input->apiVersion = $this->option('api-version');\n $input->withDocumentations = $this->option('with-api-docs');\n\n return $input;\n }", "public function getTargetCmd() {\n if(!$this->isTargetInternal())\n return null;\n\n $c = $this->cutTarget();\n return strtolower($c['cmd']);\n }", "public function getCommand()\n {\n if (is_null($this->pipe)) {\n return \"{$this->pythonExecutable} {$this->script}\";\n }\n\n return \"{$this->pipe} | {$this->pythonExecutable} {$this->script}\";\n }", "public static function command()\n\t{\n\t\treturn self::getConnection()->command();\n\t}", "public function getCommandName(): string;", "public function getCommandName(InputInterface $input)\n {\n return 'peridot';\n }", "public function getCurrentCommand()\n {\n return $this->currentCommand;\n }", "public function latestCommand()\n {\n return $this->request('get', '/api/latest-command')['command'];\n }", "public function getCommand()\n {\n return sprintf('use %s', $this->_tube);\n }", "public function getInput($key);", "function get()\n\t{\n\t\treturn implode(' ', $this->_cmd);\n\t}", "protected function getCommandInput()\n {\n $input = new ScaffoldInputBase(trim($this->argument('model-name')));\n\n $input->prefix = trim($this->option('routes-prefix'));\n $input->languageFileName = trim($this->option('language-filename'));\n $input->table = trim($this->option('table-name'));\n $input->controllerName = trim($this->option('controller-name')) ?: Helpers::makeControllerName($input->modelName);\n $input->perPage = intval($this->option('models-per-page'));\n $input->resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($input->modelName);\n $input->fields = trim($this->option('fields'));\n $input->withFormRequest = $this->option('with-form-request');\n $input->controllerDirectory = $this->option('controller-directory');\n $input->controllerExtends = $this->option('controller-extends') ?: null;\n $input->modelExtends = $this->option('model-extends') ?: null;\n $input->withMigration = $this->option('with-migration');\n $input->force = $this->option('force');\n $input->modelDirectory = $this->option('model-directory');\n $input->primaryKey = $this->option('primary-key');\n $input->withSoftDelete = $this->option('with-soft-delete');\n $input->withoutTimeStamps = $this->option('without-timestamps');\n $input->withoutLanguages = $this->option('without-languages');\n $input->withoutModel = $this->option('without-model');\n $input->withoutController = $this->option('without-controller');\n $input->withoutFormRequest = $this->option('without-form-request');\n $input->migrationClass = $this->option('migration-class-name');\n $input->connectionName = $this->option('connection-name');\n $input->engineName = $this->option('engine-name');\n $input->template = $this->getTemplateName();\n $input->tableExists = $this->option('table-exists');\n $input->translationFor = $this->option('translation-for');\n $input->withAuth = $this->option('with-auth');\n $input->formRequestDirectory = $this->option('form-request-directory');\n\n return $input;\n }", "public function command($cmd)\n {\n $response = $this->protocol->opQuery(\"{$this->name}.\\$cmd\", $cmd, 0, -1, 0);\n return $response['result'][0];\n }", "function getInput()\n {\n $handle = fopen(\"php://stdin\", \"r\");\n $input = trim(fgets($handle));\n fclose($handle);\n return $input;\n }", "public function getCmdId()\n {\n return $this->get(self::CMD_ID);\n }", "public function getFullCommand(): string\n {\n return \"/{$this->request->command} {$this->name}\";\n }", "public function getInput() {\n return $this->input;\n }", "public function getInput() {\n return $this->input;\n }", "static public function parse_commands($input)\n\t{\n\t\t$commands = array();\n\n\t\tforeach ($input as $k => $c)\n\t\t{\n\t\t\t// if we're dealing string as parameter or an assoc array\n\t\t\tif ( ! is_array($c) OR count(array_filter(array_keys($c), 'is_string')) > 0)\n\t\t\t{\n\t\t\t\t$commands[] = array('name' => $k, 'param' => $c);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// if multiple command instances were defined (non-assoc array)\n\t\t\t\tforeach ($c as $p)\n\t\t\t\t{\n\t\t\t\t\t$commands[] = array('name' => $k, 'param' => $p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $commands;\n\t}", "public function handleInput($input)\n {\n $input = strtoupper(trim($input));\n $input = preg_replace('/\\s+/', ' ', $input); // Remove any extra spaces.\n $input = preg_replace('/\\s*,\\s*/', ',', $input); // Remove any spaces after comma\n $args = explode(' ', $input);\n $this->command = $args[0];\n if ($this->isValidCommand($this->command)) {\n $placeArguments = [];\n if ($this->command === self::CMD_PLACE) {\n $placeArguments = $this->handlePlaceCommand(isset($args[1]) ? $args[1] : '');\n }\n if ($this->valid) {\n $this->processInput($this->command, $placeArguments);\n }\n } else {\n echo \"Please enter a valid command.\\n\";\n }\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getQueryCommand();", "public function getCommand()\n {\n\n return [\n\n // Usage of the command\n 'usage' => \"Command reads a file and output it in upper or lower case\",\n\n // Options for only this command\n 'options' => [\n '--up' => 'Will put string in uppercase',\n '--low' => 'Will put string in lowercase'\n ],\n\n // 'cast' => [\n // 'up' => 'int', // Cast to int, bool, float. Default is string\n // ],\n\n // Main options, which other commands may have access to\n 'main_options' => [\n '--main' => 'Test with a main option'\n ],\n\n // Are there any arguments and what are they used for.\n // This is only for displaying help. Any number of arguments can be\n 'arguments' => [\n 'File' => 'Read from a file and output to stdout. You can also pipe input to the command',\n ],\n \n // Set a default command if none if given\n // php demos/example --up README.md\n // Instead of:\n // php demos/example echo --up README.md\n // Then set 'is_default' to true\n // 'is_default' => true, \n ];\n }", "function command_query($sock, $input) {\n\t// extract key and value\n\tif ($input[0] != '\"' || ($pos = strpos($input, '\"', 1)) === false) {\n\t\tprint(\"\\tSyntax error\\n\");\n\t\treturn;\n\t}\n print \"input:$input #$pos\\n\";\n $query = substr($input, 1, $pos-1);\n print \"query: $query\\n\";\n\t// send the command\n\t$buffer = chr(1) . chr(mb_strlen($query, 'ascii')+1) . $query.chr(0);\n print(\"sending $buffer#\\n\");\n\tfwrite($sock, $buffer);\n\t$response = fread($sock, 1);\n\tif (ord($response) != 1) {\n\t\tprint(\"\\tERROR\\n\");\n\t\treturn;\n\t}\n\t$response = fread($sock, 4);\n\t$length = unpack('Nint', $response);\n\t$length = $length['int'];\n\t$value = null;\n\tif ($length > 0) {\n\t\t$value = fread($sock, $length);\n\t\tprint(\"$value\\n\");\n\t}\n}", "public function commandWithIOParameters(InputInterface $input, OutputInterface $output)\n {\n return $input->getFirstArgument();\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function generateOutputCmd(): string;", "private function Getinstruction(){\n\t\t\twhile($line = fgets(STDIN)) {\n\t\t\t\t\n //pattern for string in line with first char # to end of line\n $comment_pattern = \"/#.*$/\";\n if(preg_match($comment_pattern,$line)){\n $this->COUNTERS[COMMENTS] +=1;\n }\n\n $line = preg_replace($comment_pattern,'',$line);\n\n //Split tokens with whitespaces on line. \n //-1 represent no limit to length. \n //flag PREG_SPLIT_NO_EMPTY => split will return only non empty parts\n\t\t\t\t$tokens = preg_split('/\\s+/', $line,-1,PREG_SPLIT_NO_EMPTY);\t\n \n if(count($tokens) > 0){\n $this->COUNTERS[LOC] += 1;\n return new instruction($tokens[0],$tokens[1],$tokens[2], $tokens[3], count($tokens));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"EOF\";\n\t\t}", "public function getInput()\n {\n return $this->_input;\n }" ]
[ "0.7548257", "0.7465151", "0.7457068", "0.74011767", "0.73530495", "0.7253527", "0.7126704", "0.71205306", "0.7037723", "0.6936631", "0.69175893", "0.69175893", "0.6888208", "0.68816423", "0.6867757", "0.6867757", "0.6867757", "0.6867757", "0.68676025", "0.6865471", "0.6865471", "0.68643355", "0.68610233", "0.68557703", "0.68514705", "0.68475914", "0.68413335", "0.6802883", "0.67031235", "0.66836774", "0.6655615", "0.6585851", "0.65831757", "0.65780026", "0.6568657", "0.6545921", "0.6475105", "0.6465672", "0.64649856", "0.6464025", "0.64340675", "0.63143474", "0.6299559", "0.6285996", "0.6285579", "0.62625", "0.62448007", "0.62276053", "0.6216736", "0.62111324", "0.6211104", "0.6199331", "0.619888", "0.6196301", "0.61908895", "0.61837506", "0.6179647", "0.6167474", "0.6167474", "0.6167474", "0.61575943", "0.61392516", "0.6108242", "0.61007684", "0.609913", "0.60961753", "0.60859776", "0.6073008", "0.6046725", "0.60450125", "0.60436374", "0.60183924", "0.6011593", "0.6009019", "0.6008246", "0.6006853", "0.5959067", "0.5940561", "0.59335667", "0.592152", "0.59032327", "0.5847519", "0.5835314", "0.5835051", "0.5823401", "0.5823401", "0.579195", "0.57799315", "0.5771223", "0.5771223", "0.5771223", "0.5771223", "0.5771223", "0.5765445", "0.5758272", "0.57572573", "0.57490385", "0.5743103", "0.5738075", "0.57351375", "0.5731579" ]
0.0
-1
Q confirm Confirms if the bot is authed with Q
function qconfirm(&$irc, &$data) { global $pickupchannel; if($data->message == "Remember: NO-ONE from QuakeNet will ever ask for your password. NEVER send your password to ANYONE except [email protected].") { echo "\n\n\n\nSHIIIT\n\n\n\n"; $irc->join($pickupchannel); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function confirm_account() {\n \n # hash GET param exists\n if ($hash = data('hash')) {\n \n $hash = confirm_account($hash);\n\n if ($hash === -3)\n flash('Algo ocorreu errado. Tente novamente mais tarde..', 'error');\n else if ($hash === true)\n flash('Conta Confirmada! Agora você já pode se conectar.');\n }\n\n go('/');\n }", "public function confirm( $question, $assoc_args = array() ) {\n\n \\WP_CLI::confirm( $question, $assoc_args );\n }", "public function action_confirm()\n {\n $hash = $this->request->param('hash');\n\n $model_auth = new Model_Auth();\n\n $id = $model_auth->getUserIdByHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n if (!$id) {\n $error_text = 'Ваш аккаунт уже подтвержден';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $model_auth->deleteHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n $user = new Model_User($id);\n\n if (!$user->id) {\n $error_text = 'Переданы некорректные данные';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $user->updateUser($user->id, ['isConfirmed' => 1]);\n\n $this->redirect('/user/' . $id . '?confirmed=1');\n }", "public function confirm()\n {\n $this->confirmed = true;\n $this->confirmation_token = null;\n\n $this->save();\n }", "public function confirm() {\n\t\t\t\n\t\t\t$this->status = 'confirmed';\n\t\t\t$this->save();\n\t\t}", "abstract public function confirm(string $question, bool $default = false);", "public function actionConfirm(){\n if($this->confirm('Yakin loe..??'))\n echo \"Ok deh kaka..\";\n else\n echo \"Ga yakin diee..:p\";\n }", "function confirm()\n {\n return $this->__confirm();\n }", "public function askConfirmation($question, $default = true);", "function userConfirmation($data){\n\t\t$requiredData['action'] = $this->getPassword(@trim($data->action));\n\t\t$user_name_id = explode(\"#/#\",$requiredData['action']);\n\t\t$rec = $this->query(\"UPDATE `users` SET `status`=1 where `user_name` = '\".@$user_name_id[0].\"' AND `id`= \".@$user_name_id[1]);\n\t\tif($rec){\n\t\t\t$url = HTTP_HOST.\"confirm.php?action=1\";\n\t\t\techo \"<meta http-equiv=Refresh content=0;url=\".$url.\">\";\t\t\t\n\t\t\texit;\n\t\t}else{\n\t\t\t$url = HTTP_HOST.\"confirm.php?action=0\";\n\t\t\techo \"<meta http-equiv=Refresh content=0;url=\".$url.\">\";\t\t\t\n\t\t\texit;\t\t\n\t\t}\n\t}", "private function acceptConfirmation()\n {\n ChannelRepository::removeChannelsOfAuserByName(Chat::lastAskedQuestion()->answer,Chat::getCallBackQuery()->getFrom()->getId());\n Chat::$bot->editMessageText([\n 'text' => 'Your Channel Is Removed',\n 'inline_message_id' => Chat::getCallBackQuery()->getInlineMessageId()\n ]);\n Chat::deleteTemporaryData();\n Pages::channelOwnerPage();\n }", "function set_confirmacion($confirm)\n\t{\n\t\t$this->confirmacion = $confirm;\n\t}", "function __confirm()\n {\n $postdata = 'Comando=validar&Token=' . $this->token;\n foreach($_POST as $key => $value) {\n $val = $this->__clearstr($value);\n $postdata.= \"&$key=$val\";\n }\n return $this->__getConfirmation($postdata);\n }", "public function askConfirmation(string $question, bool $default = true): bool;", "public function confirm($question) {\n if ($this->input()->getOption('yes')) {\n $this->say('Ignoring confirmation question as --yes option passed.');\n\n return TRUE;\n }\n return parent::confirm($question);\n }", "function confirmation() {\n\t\n\n\n}", "function ConfirmUser(){\r\n if(empty($_GET['code'])||strlen($_GET['code'])<=10){\r\n $this->HandleError(\"Please provide the confirm code\");\r\n return false;\r\n }\r\n $user_rec = array();\r\n if(!$this->UpdateDBRecForConfirmation($user_rec)){\r\n return false;\r\n }\r\n \r\n $this->SendUserWelcomeEmail($user_rec);\r\n \r\n $this->SendAdminIntimationOnRegComplete($user_rec);\r\n \r\n return true;\r\n }", "static function confirm_account_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n $code = confirm_account_email($user->email);\n\n if ($code === -1) {\n flash('Sua conta já está confirmada, basta acessá-la.', 'warning');\n } else if ($code == true)\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você confirmar sua conta.\");\n else\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "public function confirmAccount(string $hash): void;", "public function confirmation(): void {\n $this->writeData($this->token);\n }", "public function confirmed()\n {\n \n $this->alert('success', 'Hello World!', [\n 'position' => 'top-end', \n 'timer' => 3000, \n 'toast' => true, \n 'text' => '', \n 'confirmButtonText' => 'Ok', \n 'cancelButtonText' => 'Cancel', \n 'showCancelButton' => true, \n 'showConfirmButton' => true, \n ]);\n }", "public function confirmed()\n {\n \n $this->alert('success', 'Hello World!', [\n 'position' => 'top-end', \n 'timer' => 3000, \n 'toast' => true, \n 'text' => '', \n 'confirmButtonText' => 'Ok', \n 'cancelButtonText' => 'Cancel', \n 'showCancelButton' => true, \n 'showConfirmButton' => true, \n ]);\n }", "private function promptDigest() {\n $this->debugPrint('Prompting user...');\n\n $nonce = base64_encode(openssl_random_pseudo_bytes(32));\n if ($this->verify_nonce)\n $this->{$this->nonce_create_function}($nonce);\n\n header(\"WWW-Authenticate: Digest realm=\\\"{$this->realm}\\\",qop=\\\"auth\\\",nonce=\\\"$nonce\\\",opaque=\\\"\" . md5($this->realm) . \"\\\"\");\n header('HTTP/1.0 401 Unauthorized');\n\n /* This is sent if the user cancels */\n if ($this->redirect_on_failure) {\n echo <<<EOF\n <html>\n\t<meta http-equiv=\"refresh\" content=\"0; url={$this->redirect_on_failure_url}?error=1\" />\n\t<body><h2>{$this->fail_text}</h2></body>\n </html>\nEOF;\n } else {\n echo \"<html><body><h2>{$this->fail_text}</h2></body></html>\";\n }\n exit();\n }", "function user_confirm() {\n // I'm not passing in any values or declaring globals\n global $supersecret_hash_padding;\n\n // Verify that they didn't tamper with the email address\n $new_hash = md5($_GET['email'].$supersecret_hash_padding);\n if ($new_hash && ($new_hash == $_GET['hash'])) {\n $query = \"SELECT user_name\n FROM user\n WHERE confirm_hash = '$new_hash'\";\n $result = mysql_query($query);\n if (!$result || mysql_num_rows($result) < 1) {\n $feedback = 'ERROR - Hash not found';\n return $feedback;\n } else {\n // Confirm the email and set account to active\n $email = $_GET['email'];\n $hash = $_GET['hash'];\n $query = \"UPDATE user SET email='$email', is_confirmed=1 WHERE confirm_hash='$hash'\";\n $result = mysql_query($query);\n return 1;\n }\n } else {\n $feedback = 'ERROR - Values do not match';\n return $feedback;\n }\n}", "function confirm()\n\t\t{\n\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\treturn $this->Gateway->confirm($this);\n\t\t\t}\n\t\t}", "public function confirmTask()\n\t{\n\t\t// Incoming, some versions of the code used 'code' some use 'confirm'\n\t\t$code = Request::getString('confirm', false);\n\t\tif (!$code)\n\t\t{\n\t\t\t$code = Request::getString('code', false);\n\t\t}\n\n\t\t// Get the return value if it was requested\n\t\t$return = Request::getString('return', false);\n\n\t\t// Check if the user is logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t// See if they've provided an email address as well\n\t\t\t// perhaps we can log them in with that and their token\n\t\t\t$email = Request::getString('email', false);\n\n\t\t\tif ($email != false && Plugin::isEnabled('authentication', 'emailtoken'))\n\t\t\t{\n\t\t\t\t// An email was provided\n\t\t\t\t// Get the Users controller\n\t\t\t\trequire_once Component::path('com_login') . '/site/controllers/auth.php';\n\t\t\t\t$authController = new \\Components\\Login\\Site\\Controllers\\Auth();\n\n\t\t\t\t// Return back here while resetting the return to here\n\t\t\t\t$return = base64_encode(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code . '&return=' . $return, false, true));\n\n\t\t\t\t// Set up a request to send to the login method\n\t\t\t\tRequest::setVar('return', $return);\n\t\t\t\tRequest::setVar('authenticator', 'emailtoken');\n\t\t\t\tRequest::setVar('email', $email);\n\t\t\t\tRequest::setVar('task', 'login');\n\t\t\t\tRequest::setVar('option', 'com_login');\n\n\t\t\t\t$authController->login();\n\t\t\t\t// $authController->login() always redirects, should never make it here\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Didn't provide enough information, warn about it\n\t\t\t\t// and let them log in to confirm their email address\n\t\t\t\t$return = base64_encode(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code . '&return=' . $return, false, true));\n\t\t\t\tApp::redirect(\n\t\t\t\t\tRoute::url('index.php?option=com_users&view=login&return=' . $return, false),\n\t\t\t\t\tLang::txt('Please login in to confirm your email address.'),\n\t\t\t\t\t'warning'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Grab the authenticator cookie, the user is logged in\n\t\t// Continue confirming the email address\n\t\t$cookie = \\Hubzero\\Utility\\Cookie::eat('authenticator');\n\n\t\t// @FIXME The session is overriding the activation code\n\t\t$xprofile = User::oneByActivationToken(-$code);\n\t\t$user = User::getInstance();\n\n\t\tif ($xprofile->get('id') != $user->get('id'))\n\t\t{\n\t\t\t// Redirect to member dashboard if email is already confirmed\n\t\t\tif ($xprofile->get('id') === 0) {\n\t\t\t\tApp::redirect(\"/members/myaccount\", \"Email is already confirmed. No need to do it again!\", \"warning\");\n\t\t\t}\n\n\t\t\t// Profile and logged in user does not match\n\t\t\t$this->setError('login mismatch');\n\n\t\t\t// Build logout/login/confirm redirect flow\n\t\t\t$login_return = base64_encode(Route::url('index.php?option=' . $this->option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code));\n\t\t\t$logout_return = base64_encode(Route::url('index.php?option=com_users&view=login&return=' . $login_return));\n\n\t\t\t$redirect = Route::url('index.php?option=com_users&view=login&task=logout&return=' . $logout_return);\n\t\t}\n\n\n\t\t$email_confirmed = $xprofile->get('activation');\n\n\t\tif ($email_confirmed == 1 || $email_confirmed == 3)\n\t\t{\n\t\t\t// The current user is confirmed - check to see if the incoming code is valid at all\n\t\t\tif (\\Components\\Members\\Helpers\\Utility::isActiveCode($code))\n\t\t\t{\n\t\t\t\t$this->setError('login mismatch');\n\n\t\t\t\t// Build logout/login/confirm redirect flow\n\t\t\t\t$login_return = base64_encode(Route::url('index.php?option=' . $this->option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code));\n\t\t\t\t$logout_return = base64_encode(Route::url('index.php?option=com_users&view=login&return=' . $login_return));\n\n\t\t\t\t$redirect = Route::url('index.php?option=com_users&view=login&task=logout&return=' . $logout_return);\n\t\t\t}\n\t\t}\n\t\telseif ($email_confirmed < 0 && $email_confirmed == -$code)\n\t\t{\n\t\t\t//var to hold return path\n\t\t\t$return = '';\n\n\t\t\t// get return path\n\t\t\t$cReturn = $this->config->get('ConfirmationReturn');\n\t\t\tif ($cReturn)\n\t\t\t{\n\t\t\t\t$return = $cReturn;\n\t\t\t}\n\n\t\t\t//check to see if we have a return param\n\t\t\t$pReturn = base64_decode(urldecode($xprofile->getParam('return')));\n\t\t\tif ($pReturn)\n\t\t\t{\n\t\t\t\t$return = $pReturn;\n\t\t\t\t$xprofile->setParam('return', '');\n\t\t\t}\n\n\t\t\t// make as confirmed\n\t\t\t$xprofile->set('activation', 1);\n\n\t\t\t// set public setting\n\t\t\t$xprofile->set('access', $this->config->get('privacy', 1));\n\n\t\t\t// update profile\n\t\t\tif (!$xprofile->save())\n\t\t\t{\n\t\t\t\t$this->setError(Lang::txt('COM_MEMBERS_REGISTER_ERROR_CONFIRMING'));\n\t\t\t}\n\n\t\t\t// if the user just changed their email & confirmed\n\t\t\t// reset 'userchangedemail' key\n\t\t\tif (Session::get('userchangedemail', 0) == 1)\n\t\t\t{\n\t\t\t\tSession::set('userchangedemail', 0);\n\t\t\t}\n\n\t\t\tEvent::trigger('onUserAfterConfirmEmail', array($xprofile->toArray()));\n\n\t\t\t// Redirect\n\t\t\tif (empty($return))\n\t\t\t{\n\t\t\t\t$r = $this->config->get('ConfirmationReturn');\n\t\t\t\t$return = ($r) ? $r : Route::url('index.php?option=com_members&task=myaccount');\n\n\t\t\t\t// consume cookie (yum) if available to return to whatever action prompted registration\n\t\t\t\tif (isset($_COOKIE['return']))\n\t\t\t\t{\n\t\t\t\t\t$return = $_COOKIE['return'];\n\t\t\t\t\tsetcookie('return', '', time() - 3600);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tApp::redirect($return, '', 'message', true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setError(Lang::txt('COM_MEMBERS_REGISTER_ERROR_INVALID_CONFIRMATION'));\n\t\t}\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Set the page title\n\t\t$this->_buildTitle();\n\n\t\t// Instantiate a new view\n\t\t$this->view\n\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER_CONFIRM'))\n\t\t\t->set('login', $xprofile->get('username'))\n\t\t\t->set('email', $xprofile->get('email'))\n\t\t\t->set('code', $code)\n\t\t\t->set('redirect', (isset($return) ? $return : ''))\n\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function askWhatToDo(){\n $question = Question::create('¿Qué deseas hacer en mi blog?')\n ->fallback('Lo siento pero...')\n ->callbackId('que_quieres_hacer')\n ->addButtons([Button::create('¿Ver todos los posts?')->value('all'),Button::create('¿Ver todas las categorías?')->value('categorias'),]);\n $this->ask($question, function(Answer $answer) {\n\n if ($answer->isInteractiveMessageReply()){\n $value = $answer->getValue();\n $text = $answer->getText();\n $this->say('Opcion, '.$value.' '.$text);\n }\n });\n }", "function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')\n{\n\tglobal $user, $template, $db;\n\tglobal $phpEx, $phpbb_root_path;\n\n\tif (isset($_POST['cancel']))\n\t{\n\t\treturn false;\n\t}\n\n\t$confirm = false;\n\tif (isset($_POST['confirm']))\n\t{\n\t\t// language frontier\n\t\tif ($_POST['confirm'] === $user->lang['YES'])\n\t\t{\n\t\t\t$confirm = true;\n\t\t}\n\t}\n\n\tif ($check && $confirm)\n\t{\n\t\t$user_id = request_var('confirm_uid', 0);\n\t\t$session_id = request_var('sess', '');\n\t\t$confirm_key = request_var('confirm_key', '');\n\n\t\tif ($user_id != $user->data['user_id'] || $session_id != $user->session_id || !$confirm_key || !$user->data['user_last_confirm_key'] || $confirm_key != $user->data['user_last_confirm_key'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Reset user_last_confirm_key\n\t\t$sql = 'UPDATE ' . USERS_TABLE . \" SET user_last_confirm_key = ''\n\t\t\tWHERE user_id = \" . $user->data['user_id'];\n\t\t$db->sql_query($sql);\n\n\t\treturn true;\n\t}\n\telse if ($check)\n\t{\n\t\treturn false;\n\t}\n\n\t$s_hidden_fields = build_hidden_fields(array(\n\t\t'confirm_uid'\t=> $user->data['user_id'],\n\t\t'sess'\t\t\t=> $user->session_id,\n\t\t'sid'\t\t\t=> $user->session_id,\n\t));\n\n\t// generate activation key\n\t$confirm_key = gen_rand_string(10);\n\n\tif (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])\n\t{\n\t\tadm_page_header((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]);\n\t}\n\telse\n\t{\n\t\tpage_header(((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]), false);\n\t}\n\n\t$template->set_filenames(array(\n\t\t'body' => $html_body)\n\t);\n\n\t// If activation key already exist, we better do not re-use the key (something very strange is going on...)\n\tif (request_var('confirm_key', ''))\n\t{\n\t\t// This should not occur, therefore we cancel the operation to safe the user\n\t\treturn false;\n\t}\n\n\t// re-add sid / transform & to &amp; for user->page (user->page is always using &)\n\t$use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);\n\t$u_action = reapply_sid($use_page);\n\t$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&amp;') . 'confirm_key=' . $confirm_key;\n\n\t$template->assign_vars(array(\n\t\t'MESSAGE_TITLE'\t\t=> (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],\n\t\t'MESSAGE_TEXT'\t\t=> (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],\n\n\t\t'YES_VALUE'\t\t\t=> $user->lang['YES'],\n\t\t'S_CONFIRM_ACTION'\t=> $u_action,\n\t\t'S_HIDDEN_FIELDS'\t=> $hidden . $s_hidden_fields)\n\t);\n\n\t$sql = 'UPDATE ' . USERS_TABLE . \" SET user_last_confirm_key = '\" . $db->sql_escape($confirm_key) . \"'\n\t\tWHERE user_id = \" . $user->data['user_id'];\n\t$db->sql_query($sql);\n\n\tif (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])\n\t{\n\t\tadm_page_footer();\n\t}\n\telse\n\t{\n\t\tpage_footer();\n\t}\n}", "public function confirm() {\n $user_id = $_GET['id'];\n $token = $_GET['token'];\n $userConfirmed = $this->model->confirmToken($user_id, $token);\n\n if ($userConfirmed) {\n $this->model->setFlash('success', 'Votre compte a bien été validé');\n // $_SESSION['flash']['success'] = 'Votre compte a bien été validé';\n header('location:index.php?controller=security&action=formLogin');\n } else {\n $this->model->setFlash('danger', \"Ce token n'est plus valide\");\n // $_SESSION['flash']['danger'] = \"Ce token n'est plus valide\";\n header('location:index.php?controller=security&action=formRegister');\n }\n }", "public function confirmation() {\n return false;\n }", "public function isConfirmada(): bool\n {\n return $this->getStatus() === self::STATUS_CONFIRMADA;\n }", "public function confirm(string $question, bool $default = false): bool\n {\n return $this->output->confirm($question, $default);\n }", "function confirmation() {\r\n return false;\r\n }", "protected function confirmDelete() {\n\t}", "public function confirmation(Request $req, $id)\n { \n $this->check_account($req);\n\n $user = User::find($id);\n $user->status = 'active';\n $user->save();\n\n echo \"Your account Already Activated! Please Login on Apps\";\n }", "private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }", "public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "function pre_confirmation_check() {\r\n return true;\r\n }", "public function confirm($question, $default = false)\n {\n return $this->output->confirm($question, $default);\n }", "public function confirmAction() {\n if (Zend_Auth::getInstance()->hasIdentity())\n $this->_redirect($this->getUrl());\n\n $errors = array();\n\n $action = $this->getRequest()->getParam('a');\n\n switch ($action) {\n case 'email':\n $id = $this->getRequest()->getParam('id');\n $key = $this->getRequest()->getParam('key');\n\n $result = $this->em->getRepository('Champs\\Entity\\User')->activateAccount($id, $key);\n\n if (!$result) {\n $errors['email'] = 'Error activating your account';\n }\n\n break;\n }\n\n $this->view->errors = $errors;\n $this->view->action = $action;\n }", "public function confirmLogout(): void\n {\n $this->password = '';\n\n $this->dispatch('confirming-logout-other-browser-sessions');\n\n $this->dispatch('open-modal', id: 'confirmingLogout');\n }", "function confirmAuth()\n{\n $login = $this->session->get(USER_LOGIN_VAR);\n$password = $this->session->get(USER_PASSW_VAR);\n$hashKey = $this->session->get('login_hash');\nif (md5($this->hashKey . $login . $password) != $hashKey)\n{\n$this->logout(true);\n}\n}", "function log_and_confirm($text, $who, $detail) {\n\t\n\tglobal $playobj, $log_level, $reasons, $softbot;\n\n\t/* append user's reasons for the action if the user is human */\n\t\n\tif ($reasons and ! $softbot and $who == $playobj->id) {\n\t\t$text .= \" ($reasons)\";\n\t\t$reasons = '';\n\t}\n\tif ($detail >= $log_level and isset($playobj->loggedin)) {\n\t\tif ($who == 'Event') echo \"$text<br>\";\n\t\tif ($who == $playobj->id) echo \"You $text<br>\";\n\t\tif ($who == 'bank') echo $playobj->name . \"$text<BR>\";\n\t}\n\t\t\n /* softbots are distinguished in the log by having names that start\n with a * */\n\tif ($softbot) $who = \"*\" . $who;\n\tlog_act($text, $who, $detail);\n}", "public function testShouldConfirm()\n {\n $app = m::mock('Illuminate\\Contracts\\Foundation\\Application');\n $repo = m::mock('Zizaco\\Confide\\RepositoryInterface');\n $passService = m::mock('Zizaco\\Confide\\PasswordServiceInterface');\n $loginThrottler = m::mock('Zizaco\\Confide\\LoginThrottleServiceInterface');\n $confide = new Confide($repo, $passService, $loginThrottler, $app);\n $code = '12345';\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n $repo->shouldReceive('confirmByCode')\n ->once()->with($code)\n ->andReturn(true);\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $this->assertTrue($confide->confirm($code));\n }", "public function confirmEmail()\n {\n $this->mail_confirmed = Carbon::now();\n $this->mail_token = null;\n $this->save();\n }", "public function confirm( $code )\n {\n if ( Confide::confirm( $code ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.confirmation');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_confirmation');\n return Redirect::action('UserController@login')\n ->with( 'error', $error_msg );\n }\n }", "public function confirmUpdateSettings() {\n\t\techo '<div class=\"alert successful\"><span class=\"btnclose\">&times;</span><strong>Vos identifiants ont bien été mis à jour !</strong></div>';\n\t}", "protected function showYesNoClick() {\n\n\t\t\t$dlgYesNo = new \\QCubed\\Project\\Jqui\\Dialog();\t// Note here there is no \"$this\" as the first parameter. By leaving this off, you\n\t\t\t\t\t\t\t\t\t\t// are telling QCubed to manage the dialog.\n\t\t\t$dlgYesNo->Text = t(\"Do you like QCubed?\");\n\t\t\t$dlgYesNo->AddButton ('Yes');\n\t\t\t$dlgYesNo->AddButton ('No');\n\t\t\t$dlgYesNo->AddAction (new \\QCubed\\Event\\DialogButton(), new \\QCubed\\Action\\Ajax ('dlgYesNo_Button'));\n\t\t\t$dlgYesNo->Resizable = false;\n\t\t\t$dlgYesNo->HasCloseButton = false;\n\t\t}", "public function confirm($id, Request $request){\n if(!$id)\n {\n $user = User::where('confirmation_code', $id)->first();\n return view(\"administrator.dashboard.pages.email_page.check_link.v_wrong_link\");\n }\n $user = User::where('confirmation_code', $id)->first();\n\n if (!$user)\n {\n return view(\"administrator.dashboard.pages.email_page.check_link.v_wrong_link\");\n }else{\n $user->active = '1';\n $user->confirmation_code = null;\n $user->save();\n\n Session::flash('message', 'Your account has been successfully verified, please log in!');\n\n return redirect('backend/pages/signin');\n }\n }", "public function authorize()\n {\n return Auth::user()->data_confirmacao != null;\n }", "protected function confirmEmailToken( $code ) {\n\t\tglobal $wgConfirmAccountContact, $wgPasswordSender;\n\n\t\t$reqUser = $this->getUser();\n\t\t$out = $this->getOutput();\n\t\t# Confirm if this token is in the pending requests\n\t\t$name = ConfirmAccount::requestNameFromEmailToken( $code );\n\t\tif ( $name !== false ) {\n\t\t\t# Send confirmation email to prospective user\n\t\t\tConfirmAccount::confirmEmail( $name );\n\n\t\t\t$adminsNotify = ConfirmAccount::getAdminsToNotify();\n\t\t\t# Send an email to admin after email has been confirmed\n\t\t\tif ( $adminsNotify->count() || $wgConfirmAccountContact != '' ) {\n\t\t\t\t$title = SpecialPage::getTitleFor( 'ConfirmAccounts' );\n\t\t\t\t$subject = $this->msg(\n\t\t\t\t\t'requestaccount-email-subj-admin' )->inContentLanguage()->escaped();\n\t\t\t\t$body = $this->msg(\n\t\t\t\t\t'requestaccount-email-body-admin', $name )->params(\n\t\t\t\t\t\t$title->getCanonicalURL() )->inContentLanguage()->text();\n\t\t\t\t# Actually send the email...\n\t\t\t\tif ( $wgConfirmAccountContact != '' ) {\n\t\t\t\t\t$source = new MailAddress( $wgPasswordSender, wfMessage( 'emailsender' )->text() );\n\t\t\t\t\t$target = new MailAddress( $wgConfirmAccountContact );\n\t\t\t\t\t$result = UserMailer::send( $target, $source, $subject, $body );\n\t\t\t\t\tif ( !$result->isOK() ) {\n\t\t\t\t\t\twfDebug( \"Could not sent email to admin at $target\\n\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t# Send an email to all users with \"confirmaccount-notify\" rights\n\t\t\t\tforeach ( $adminsNotify as $adminNotify ) {\n\t\t\t\t\tif ( $adminNotify->canReceiveEmail() ) {\n\t\t\t\t\t\t$adminNotify->sendMail( $subject, $body );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$out->addWikiMsg( 'requestaccount-econf' );\n\t\t\t$out->returnToMain();\n\t\t} else {\n\t\t\t# Maybe the user confirmed after account was created...\n\t\t\t$user = User::newFromConfirmationCode( $code, User::READ_LATEST );\n\t\t\tif ( is_object( $user ) ) {\n\t\t\t\t$user->confirmEmail();\n\t\t\t\t$user->saveSettings();\n\t\t\t\t$message = $reqUser->isLoggedIn()\n\t\t\t\t\t? 'confirmemail_loggedin'\n\t\t\t\t\t: 'confirmemail_success';\n\t\t\t\t$out->addWikiMsg( $message );\n\t\t\t\tif ( !$reqUser->isLoggedIn() ) {\n\t\t\t\t\t$title = SpecialPage::getTitleFor( 'Userlogin' );\n\t\t\t\t\t$out->returnToMain( true, $title );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$out->addWikiMsg( 'confirmemail_invalid' );\n\t\t\t}\n\t\t}\n\t}", "public function yesAction(){\r\n \t\r\n \t$id = $this->getRequest()->getParam('id');\r\n \t\r\n \t$faq = Mage::getModel('faq/faq')->load($id);\r\n \t\r\n \t$data = $faq->toArray();\r\n \t\r\n \tMage::dispatchEvent('infinity_faq_count_helpful', $data);\r\n \t\r\n \t$url = Mage::getUrl('faq/details/',array('id'=>$id));\r\n \t\r\n \t$cookie = Mage::getSingleton('core/cookie');\r\n \t$cookie->set('helpful'.$id, 'helpful' ,time()+86400,'/');\r\n \t\r\n \t$this->_redirectUrl($url);\r\n\r\n }", "protected function confirm(string $question, bool $default = false) : bool\n {\n return $this->_ask(new ConfirmationQuestion($question, $default));\n }", "public function confirmForget() {\n $user_id = $_GET['id'];\n $token = $_GET['token'];\n $userForgetConfirmed = $this->model->confirmTokenAfterForget($user_id, $token);\n\n if ($userForgetConfirmed) {\n $this->model->setFlash('success', 'Votre compte est à nouveau validé');\n // $_SESSION['flash']['success'] = 'Votre compte est à nouveau validé';\n header('location:index.php?controller=security&action=formReset');\n } else {\n $this->model->setFlash('danger', \"Ce token n'est plus valide\");\n // $_SESSION['flash']['danger'] = \"Ce token n'est plus valide\";\n header('location:index.php?controller=security&action=formLogin');\n }\n }", "public function confirmationAction($confirm)\n {\n $em = $this->getDoctrine()->getManager();\n $user = new User();\n $user_repository = $this->getDoctrine()->getRepository('CloudPodUserBundle:User');\n $user = $user_repository->findOneBy(array('confirmationCode'=>$confirm));\n\n if (!$user)\n {\n throw $this->createNotFoundException('Wrong Confirmation');\n }\n else\n { \n $user->setIsActive(true);\n $em->flush();\n \n return new Response('Account Confirmed!.You can now start using CloudPod.'); \n //return $this->redirect($this->generateUrl('admin_home');\n }\n }", "private function confirm_query($result)\n {\n if(!$result)\n {\n // if (mysqli_connect_errno()) \n // {\n // echo 'Connect failed: '. mysqli_connect_error();\n // }\n die(\"Database Query Failed: \" . mysqli_error($connection));\n }\n }", "public function confirm($code)\r\n {\r\n if (Confide::confirm($code)) {\r\n $notice_msg = Lang::get('confide::confide.alerts.confirmation');\r\n\r\n return Redirect::action('UserController@login')\r\n ->with('notice', $notice_msg);\r\n } else {\r\n $error_msg = Lang::get('confide::confide.alerts.wrong_confirmation');\r\n\r\n return Redirect::action('UserController@login')\r\n ->with('error', $error_msg);\r\n }\r\n }", "public function confirm(string $question, bool $default = false)\n {\n return $this->getOutput()->confirm($question, $default);\n }", "function confirm($result) {\n\tglobal $connection;\n\n\tif (!$result) {\n\t\tdie(\"Query Failed : \" . mysqli_error($connection));\n\t}\n}", "abstract protected function getConfirmationSecret();", "public function optInAction()\n {\n\n $tokenYes = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_yes') ? $this->request->getArgument('token_yes') : ''));\n $tokenNo = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_no') ? $this->request->getArgument('token_no') : ''));\n $userSha1 = preg_replace('/[^a-zA-Z0-9]/', '', $this->request->getArgument('user'));\n\n /** @var \\RKW\\RkwRegistration\\Tools\\Registration $register */\n $register = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('RKW\\\\RkwRegistration\\\\Tools\\\\Registration');\n $check = $register->checkTokens($tokenYes, $tokenNo, $userSha1, $this->request, $data);\n\n // set hash value for changing subscriptions without login\n $hash = '';\n if ($check == 1) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionSaved',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n if (!$frontendUser->getTxRkwnewsletterHash()) {\n $hash = sha1($frontendUser->getUid() . $frontendUser->getEmail() . rand());\n $frontendUser->setTxRkwnewsletterHash($hash);\n $this->frontendUserRepository->update($frontendUser);\n\n } else {\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n }\n\n\n } elseif ($check == 2) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionCanceled',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n\n } else {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.error.subscriptionError',\n 'rkw_newsletter'\n ),\n '',\n \\TYPO3\\CMS\\Core\\Messaging\\AbstractMessage::ERROR\n );\n }\n\n $this->redirect('message', null, null, array('hash' => $hash));\n //===\n }", "private function confirmed ($param)\n {\n $key = $this->key.'_confirmed';\n if (!isset($_POST[$key]))\n {\n $this->SetError('confirmed', 'The '.$this->SpacedKey.' field does not match its confirm counterpart');\n return false;\n }\n if ($this->value !== $_POST[$key])\n {\n $this->SetError('confirmed', 'The '.$this->SpacedKey.' field does not match its confirm counterpart');\n return false;\n }\n return true;\n }", "private function confirm_query($result)\n\t{\n\t\tif(!$result):\n\t\t\tdie('Query Failed' . $this->connection->error);\n\t\tendif;\n\t}", "private function confirm_query($result){\n if(!$result){\n $output = \"Database failed on query: \" . mysql_error() . \"<br />\";\n die($output);\n }\n }", "function pre_confirmation_check() {\r\n return false;\r\n }", "function ask_admin($querstion_for_admin){\n\t\tif( isset($_POST[$querstion_for_admin]) ){\n\t\t\tglobal $base;\n\n\t\t\t$content = $base->clear_string($_POST[$querstion_for_admin]);\n\n\t\t\t$query = \"SELECT * FROM users WHERE role='master_admin'\";\n $find_id = user::find_this_query($query);\n $master_admin_id='';\n\t foreach ($find_id as $id) {\n\t $master_admin_id = $id->user_id;\n\t\t\t\t}\n\n\t\t\t$user = user::find_this_id( $base->clear_string($_SESSION['user_id']) );\n\n\t\t\t$messages_admin = new messages_admin();\n\t\t\t$messages_admin->admin_id\t= $master_admin_id;\n\t\t\t$messages_admin->client_id \t= $user->user_id;\n\t\t\t$messages_admin->content \t= $content;\n\t\t\t$messages_admin->date \t\t= date('Y-m-d H:i:s');\n\n\t\t\t\n\t\t\t$messages_admin->create();\n\n\t\t\tmail('[email protected]', 'Pitanje Korisnika: '.$user->name, $content, \"From: \".$user->email);\n\n\t\t}\n\t}", "public function isConfirmed()\n {\n return $this->confirmation;\n }", "protected function showForgot() {}", "function _wp_privacy_account_request_confirmed_message($request_id)\n {\n }", "public function post_confirm() {\n $fields = array(\n 'code' => Input::get('code'),\n 'email' => Input::get('email'),\n 'confirmation_code' => Input::get('confirmation_code'),\n );\n\n $account = Account::where_code(Input::get('code', 0))->first();\n $account_id = 0;\n if(!is_null($account)) {\n $account_id = $account->id;\n }\n \n $rules = array(\n 'code' => 'required|exists:accounts',\n 'email' => 'required|email|exists_in_account:users,email,'.$account_id,\n 'confirmation_code' => 'required',\n );\n \n $validation = Validator::make($fields, $rules);\n \n if( $validation->fails() ) {\n Input::flash();\n return Redirect::to_action('login@confirm')->with_errors($validation);\n } else {\n $user = User::where('account_id', '=', $account_id)\n ->where('email', '=', Input::get('email'))\n ->where('confirmation_code', '=', Input::get('confirmation_code'))\n ->first();\n \n if(is_null($user)) {\n Input::flash();\n return $this->get_confirm()->with('confirm_error', true);\n } else {\n return $this->get_confirm($user->id, $user->confirmation_code);\n }\n }\n }", "public function confirmUserAction($hash = NULL)\n {\n // Prepare success dialog so far\n $messageTitle = 'Success, ';\n $messageBody = 'Your account was approved and you have been logged in!';\n $severity = 'ok';\n\n\n if(!$hash){\n $error = TRUE;\n }\n else {\n // a Register user\n $user = $this->userRepository->findHiddenByHash($hash);\n \n if(!$user){\n $error = TRUE;\n }\n else {\n \n $messageTitle .= $user->getName();\n $user->setHash(0);\n // $user->setPid($this->settings['']);\n \n // Set Groups \n $pendingGroup = $this->feUserGroupRepository->findByUid($this->settings['register']['pendingFeGroup']);\n $activeGroup = $this->feUserGroupRepository->findByUid($this->settings['register']['registeredFeGroup']);\n $user->removeUserGroup($pendingGroup);\n $user->addUserGroup($activeGroup);\n \n // Enable user\n $user->setDisable(0);\n \n // Update user data\n $this->userRepository->update($user);\n $persistenceManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\"TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager\");\n $persistenceManager->persistAll();\n\n // Login user\n if(!$this->loginUser($user->getUsername(), $user->getPassword(), TRUE)){\n die('There was a problem with your credentials. You could not be logged in.');\n }\n\n // Activate Ratings\n $ratings = $this->ratingRepository->findHiddenByUser($user);\n if($ratings){\n foreach ($ratings as $rating) {\n $rating->setHidden(FALSE);\n $this->ratingRepository->update($rating);\n\n // Inform user about publisheb rating\n $messageBody .= '<br>';\n $messageBody .= '<br>';\n $messageBody .= 'Your Rating has been published.';\n \n $this->view->assign('product', $rating->getProduct());\n }\n }\n \n // Send product suggestions if there are any\n $product = $this->productRepository->findHiddenByUser($user)->getFirst();\n\n if($product){\n \n $this->sendMessage($messageTitle, $messageBody, $severity);\n\n $this->redirect(\n 'proposeProduct',\n 'Product',\n NULL,\n array(\n 'product' => $product,\n // 'rating' => $ratings,\n // $arguments = NULL,\n ),\n $pageUid = $this->settings['ratingList']['pid']\n );\n \n $this->view->assign('product', $product);\n\n }\n }\n } \n # Visual Feedback to customer\n if($error){\n $messageBody = 'Please retry or contact us!';\n $messageTitle = 'An error occured!';\n $severity = 'error';\n }\n\n $this->sendMessage($messageTitle, $messageBody, $severity);\n \n // \n // Forward je nach Aktion vor der Registrierung\n // \n $this->view->assignMultiple(array(\n 'user' => $user,\n 'error' => $error,\n ));\n }", "public function pre_confirmation_check() {\n return false;\n }", "private function confirm_query($result){\n if(!$result){\n die(\"Query failed \" . $this->connection->error);\n }\n }", "public function confirmAction()\n {\n if (!$this->_isActive()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n if ($orderData = $this->getRequest()->getPost('order')) {\n $customerComment = (isset($orderData['customer_comment']) ? $orderData['customer_comment'] : '');\n $this->getOnepage()->getQuote()->setCustomerComment($customerComment);\n }\n\n $this->loadLayout();\n $this->renderLayout();\n }", "public function authorize(): void\n {\n $loop = $this->getLoop();\n\n $command = new Identify($this, $loop);\n $command->execute(null);\n\n $this->getLoop()->addPeriodicTimer($this->getInterval(), [\n $this,\n 'heartbeat',\n ]);\n\n $this->status = self::STATUS_AUTHED;\n }", "public function confirm($token) {\n\t\tif (true) {\n\t\t\t$success = true;\n\t\t} else {\n\t\t\t$success = false;\n\t\t}\n\t\t\n\t\treturn $success;\n\t}", "public function sendConfirm()\n {\n $newPackage = \"\";\n $client = $this->clientEntity;\n $client->writeByte($newPackage, ClientEntity::HEAD_MAIL_SENT);\n $client->writeByte($newPackage, 1);\n $client->writeLong($newPackage, $this->messageEntity->time);\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n }", "public function confirmUserDeletion(): void\n {\n $this->resetErrorBag();\n\n $this->password = '';\n\n $this->dispatch('confirming-delete-user');\n\n $this->dispatch('open-modal', id: 'confirmingUserDeletion');\n }", "private function confirm_query($result) {\n if(!$result) {\n die(\"Query failed\" . $this->connection->error);\n }\n }", "static function confirm($title, $msg, $false_button, $true_button)\n\t{\n\t\tself::echoPageHeader();\n\t\tUserSession::formOpen();\n\t\tself::info_box(\"/img/warning.png\", $title, $msg);\n\t\techo VSPACE;\n\t\tUserSession::button($false_button, UserSession::class . \"::invokeCallBackward\", FALSE);\n\t\techo HSPACE;\n\t\tUserSession::button($true_button, UserSession::class . \"::invokeCallBackward\", TRUE);\n\t\tUserSession::formClose();\n\t\tself::echoPageFooter();\n\t}", "protected function confirmTemplateSwitch()\n\t{\n\t\tinclude_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';\n\t\t$this->ctrl->setReturn($this,'perm');\n\t\t$this->ctrl->setCmdClass('ildidactictemplategui');\n\t\t$dtpl_gui = new ilDidacticTemplateGUI($this->gui_obj);\n\t\t$this->ctrl->forwardCommand($dtpl_gui,'confirmTemplateSwitch');\n\t}", "public function logoutFromQuoteConfirmationMode(Varien_Event_Observer $observer ) { \n if ( Mage::helper('qquoteadv')->isActiveConfirmMode()) { \n Mage::helper('qquoteadv')->setActiveConfirmMode(false); \n }\n }", "public function confirm_query($result) {\n if (!$result) {\n $output = \"Database query Failed: \" . mysqli_error($this->connection) . \"<br /><br />\";\n $output .= \"Last query: \" . $this->last_query;\n die($output);\n }\n }", "function setRequestConfirmedFor($hash, $id_request) {\n if ($this->connectToMySqlWithParams('localhost:3307', 'root', 'myzconun')) {\n //RECUPERA id_request dalla tabella\n $query = sprintf(\"UPDATE scuola.change_password_request\" .\n \" SET confirmed = 1 WHERE id_request = %s AND hash = '%s'\", $id_request, $hash);\n\n $result = mysql_query($query);\n\n $this->closeConnection();\n return $result;\n }\n return FALSE;\n }", "function confirm($question, $failText, $kill = false, $exit_status = 0) {\n\t$response = [true, \"y\"];\n\tprint $question.\"\\n(y/n)\\n\";\n\t$answer = readline();\n\tif ($answer != \"y\" && $answer != \"yes\") \n\t{\n\t\tif ($kill) {\n\t\t\tprint $failText.\"\\n\";\n\t\t\texit($exit_status);\n\t\t} else {\n\t\t\t$response = [false, $answer];\n\t\t\tprint $failText.\"\\n\";\n\t\t}\n\t}\n\treturn $response;\n}", "private function onAnswer()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $checkAnswer = $this->getService('quest.quest_manager')->checkAnswer(\n $this->getUserId(),\n $payload['chapterId'] ?? null,\n $payload['answer'] ?? null\n );\n\n $this->send(new AnswerEvent($this->clientEvent, $checkAnswer));\n\n if ($checkAnswer) {\n $newData = $this\n ->getService('quest.quest_manager')\n ->getNewData($payload['chapterId'], $this->getUserId(), true);\n\n if ($newData) {\n $this->send(\n new NewContentEvent($newData)\n );\n }\n\n }\n }", "public function confirm(Request $req)\n {\n $user = User::where('confirmation_token', $req->query('tokenID'))->first();\n\n // if we don't find a user aka ($user = null), redirect\n if (!$user) {\n return redirect()->route('threads.index')->with('flash', 'The confirmation token was invalid~danger');\n }\n \n // switch the users confirmed status to true\n $user->confirmed = 1;\n\n // reset the users confirmation token\n $user->confirmation_token = null;\n\n // update the user\n $user->save();\n\n return redirect()->route('threads.index')->with('flash', 'Ok you are good to go');\n }", "public function confirmed()\n {\n if(!Auth::check()){\n return redirect()->route('auth.registration');\n }\n\n return view('confirm');\n }", "public function askForFeeConfirmation()\n {\n }", "function correctAnswer() {\n\t}", "public function confirmRegister($email, $confirm_token){\n $user = new User;\n $the_user = $user->select()->where('email','=',$email)\n ->where('confirm_token','=',$confirm_token)->get();\n\n if(count($the_user)>0){\n $active = 1;\n $confirm_token = str_random(100);\n $user->where('email','=',$email)\n ->update(['activo'=>$active, 'confirm_token'=>$confirm_token]);\n\n Session::flash('message','En hora buena'.$the_user[0]['nombreUsuario'].' ya puedes iniciar sesión');\n return Redirect::to('/log');\n\n }else{\n\n Session::flash('message','Su cuenta ya ha sido habilitada anteriormente');\n return Redirect::to('/log'); \n }\n\n }", "public function get_confirm($user_id=0, $confirmation_code=0) {\n \n // If not information was provider, show the confirmation form\n if($user_id==0) {\n return View::make('login.confirm'); \n } else {\n // Confirm the account\n $user = User::where('id', '=', $user_id)\n ->where('confirmation_code', '=', $confirmation_code)\n ->first();\n\n if(is_null($user)) {\n return View::make('login.confirm')->with('confirm_error', true);\n } else {\n // Confirmed\n $user->confirmed='Y';\n $user->confirmation_code=null;\n $user->save();\n\n $this->successes[] = \"Your account has been confirmed successfully.\";\n //Session::put('successes', serialize($this->successes));\n\n // if the user is not logged in it will be redirected to the login page.\n if (Auth::guest()) return Redirect::to('login')->with('successes', serialize($this->successes));\n\n return Redirect::to('dashboard'); \n }\n }\n \n }", "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}", "private function _askQuestion()\n {\n // Grab the question\n $question = str_replace(\"!question \", \"\", $this->_data->message);\n\n // Create the yql\n $yql = 'select * from answers.search where query=\"'. $question .'\" and type=\"resolved\"';\n \n $array = $this->grabData($yql);\n \n $stuff = $array['query']['results']['Question'];\n if (is_array($stuff)) {\n $answer = $stuff[array_rand($stuff)]['ChosenAnswer'];\n $link = $stuff[array_rand($stuff)]['Link'];\n }\n $this->_message($this->_data->nick.': You asked: '. $question);\n if (!$answer) {\n $this->_message($this->_data->nick.': Sorry, I cannot answer that one! Try asking a simpler question.'); \n }\n else {\n $this->_message($this->_data->nick.': Yahoo! answers says: '. $answer .' ('. $link .')');\n }\n }", "private function confirmQuery($result){\n if (!$result) {\n die(\"Database query failed!\");\n }\n }", "private function setConfirmationValue()\n {\n $value = $this->getData(self::$confirmationAttributeCode);\n $websiteId = $this->getData(self::$websiteIdAttributeCode) ?: $this->getData(self::$websiteAttributeCode);\n $isConfirmationRequired = (bool)$this->scopeConfig->getValue(\n AccountManagement::XML_PATH_IS_CONFIRM,\n ScopeInterface::SCOPE_WEBSITES,\n $websiteId\n );\n\n $valueText = __('Confirmation Not Required');\n if ($isConfirmationRequired) {\n $valueText = $value === null ? __('Confirmed') : __('Confirmation Required');\n }\n\n $this->setCustomAttribute(self::$confirmationAttributeCode, $valueText);\n }", "public static function confirm($message) {\n //display confirm message.\n echo $message . '[Y/N]';\n \n $command = \"\";\n \n $stdin = fopen(\"php://stdin\", \"r\");\n if ( !$stdin ) {\n exit(\"[error] STDIN failure.\\n\");\n }\n while (true) {\n $command = trim(fgets($stdin, 64));\n if ($command == '') continue;\n break;\n }\n fclose($stdin);\n \n $command = strtolower($command);\n return $command === 'yes' || $command === 'y';\n }", "public function wpcd_app_trash_prompt() {\n\t\t$screen = get_current_screen();\n\t\tif ( in_array( $screen->id, array( 'edit-wpcd_app', 'wpcd_app' ), true ) ) {\n\t\t\t$prompt_message = __( 'Are you sure? This will only delete the data from our database. The application itself will remain on your server. To remove a WordPress app from the server, cancel this operation and use the REMOVE SITE option under the MISC tab.', 'wpcd' );\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery(document).ready(function($){\n\t\t\t\t\t$('a.submitdelete').click(function(e){\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tvar href = $(this).attr('href');\n\t\t\t\t\t\tvar r = confirm('<?php echo esc_html( $prompt_message ); ?>');\n\t\t\t\t\t\tif(r){\n\t\t\t\t\t\t\twindow.location = href;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t$('#doaction').click(function(e){\n\t\t\t\t\t\tif($('#bulk-action-selector-top').val() == 'trash'){\n\t\t\t\t\t\t\tif($('input[name=\"post[]\"]:checked').length > 0){\n\t\t\t\t\t\t\t\tvar r = confirm('<?php echo esc_html( $prompt_message ); ?>');\n\t\t\t\t\t\t\t\tif(!r){\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\n\t\tif ( 'edit-wpcd_app' === $screen->id ) {\n\t\t\t$prompt_message = __( 'Please note: Restoring this item will not necessarily restore your app on the server. This item will likely become an orphaned/ghost item - i.e: it will not have a connection to any app or server.', 'wpcd' );\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery(document).ready(function($){\n\t\t\t\t\t$('span.untrash a').click(function(e){\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tvar href = $(this).attr('href');\n\t\t\t\t\t\tvar r = confirm('<?php echo esc_html( $prompt_message ); ?>');\n\t\t\t\t\t\tif(r){\n\t\t\t\t\t\t\twindow.location = href;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\t\treturn true;\n\t}", "public static function confirm( $question, $strict = false ) \n\t{\n\t\t$question .= ' [yes/no]: ';\n\t\t\n\t\tif ( $strict ) \n\t\t{\n\t\t\tdo \n\t\t\t{\n\t\t\t\t$res = strtolower( static::read( $question ) );\n\t\t\t} \n\t\t\twhile ( $res !== 'yes' && $res !== 'no' );\n\t\t\t\n\t\t\treturn ( $res == 'yes' ) ? true : false;\n\t\t}\n\t\t\n\t\tdo \n\t\t{\n\t\t\t$res = strtolower( static::read( $question ) );\n\t\t} \n\t\twhile ( empty( $res ) );\n\t\t\n\t\t$positives = array(\n\t\t\t'yes', 'y', 'ya', 'ye', 'yeah', 'yup',\n\t\t\t'jep', 'jap', 'ja', \n\t\t\t'si', 'sim',\n\t\t\t'true',\n\t\t\t'hai',\n\t\t\t'oui',\n\t\t\t'no problemo',\n\t\t);\n\t\t\n\t\treturn in_array( $res, $positives );\n\t}", "private function confirm_query($result) {\n\t\tif(!$result) {\n\t\t\t$output = \"Database query failed: \" . mysqli_error() . \"<br /><br />\";\n\t\t\t$output .= \"Last SQL query: \" . $this->last_query;\n\t\t\tdie($output);\n\t\t}\n\t}" ]
[ "0.6658641", "0.65871006", "0.631289", "0.630034", "0.6283119", "0.6276487", "0.6275576", "0.6185592", "0.6162147", "0.6152652", "0.6133511", "0.60836256", "0.59814405", "0.5965078", "0.59468037", "0.59413147", "0.59306675", "0.5895425", "0.5861391", "0.583895", "0.58150935", "0.58150935", "0.57881063", "0.5784946", "0.5779114", "0.57714933", "0.5769313", "0.5744989", "0.5695956", "0.5683312", "0.5680867", "0.56635004", "0.56566566", "0.5653529", "0.5650497", "0.56245327", "0.55931956", "0.5576806", "0.55639154", "0.55547315", "0.55504346", "0.55300194", "0.5528483", "0.5525108", "0.55247855", "0.5523226", "0.5507543", "0.54826695", "0.5481938", "0.54761636", "0.54750496", "0.54561126", "0.54521954", "0.5451918", "0.54363346", "0.5435764", "0.5432875", "0.5419869", "0.5416884", "0.5416658", "0.5415532", "0.5413853", "0.5412968", "0.5409504", "0.5406832", "0.53922087", "0.53909063", "0.5372487", "0.53568846", "0.53564036", "0.5353022", "0.5352001", "0.53469205", "0.53399384", "0.53386927", "0.5330527", "0.53267026", "0.5320352", "0.5309957", "0.53087205", "0.5296723", "0.52905625", "0.528914", "0.528893", "0.528796", "0.5287228", "0.52867", "0.52777475", "0.5275513", "0.5270656", "0.52687544", "0.52501285", "0.52491593", "0.52485764", "0.52358735", "0.5232355", "0.5229813", "0.5229185", "0.5223477", "0.52227026" ]
0.77659047
0
Display a listing of the resource.
public function index() { $postings = DB::table('gearviews')->orderBy('post_id', 'desc')->paginate(10); $all = DB::table('gearviews')->count(); $gloves = DB::table('gearviews')->where('category', '2')->count(); $elbows = DB::table('gearviews')->where('category', '3')->count(); $shoulders = DB::table('gearviews')->where('category', '4')->count(); $shafts = DB::table('gearviews')->where('category', '5')->count(); $heads = DB::table('gearviews')->where('category', '6')->count(); $helmets = DB::table('gearviews')->where('category', '7')->count(); $misc = DB::table('gearviews')->where('category', '1')->count(); return View::make('gear.index', ['postings' => $postings])->with('gloves', $gloves)->with('elbows', $elbows)->with('shoulders', $shoulders)->with('shafts', $shafts)->with('heads', $heads)->with('helmets', $helmets)->with('misc', $misc)->with('all', $all); }
{ "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() { $password = "ml2.0"; return View::make('gear.create')->with('password', $password); }
{ "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() { $posting = new GearPosting; $posting->gear_title = Input::get('gear_title'); $posting->gear_content = Input::get('gear_content'); $posting->category = Input::get('category'); $posting->save(); return Redirect::route('gear.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($gear_title) { $posting = DB::table('gearviews')->where('gear_title', $gear_title)->first(); return View::make('gear.show', ['posting' => $posting]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Get all distinct values and their usage counts for a certain field. Will ignore NULL values
public function getFieldValueCounts(string $field): array { $field = 'tbl.'.$field; $qb = $this->createQueryBuilder('tbl'); $results = $qb ->select($field) ->addSelect($qb->expr()->count($field)) ->where($qb->expr()->isNotNull($field)) ->groupBy($field) ->orderBy($qb->expr()->asc($field)) ->getQuery() ->getArrayResult(); return array_map(function ($result) { return [ 'value' => current($result), 'count' => (int) $result[1], ]; }, $results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusesWithCount( $table_name, $statuses, $field_name = 'status' ) {\n global $wpdb;\n\n $sql = <<< SQL\nSELECT DISTINCT( `{$field_name}` ),\n COUNT(*) AS count\nFROM `{$table_name}`\nGROUP BY `{$field_name}`\nSQL;\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n foreach ( $result as $status ) {\n if ( !empty( $status['status'] ) ) {\n $statuses[$status['status']]['count'] = $status['count'];\n }\n }\n\n $statuses['all']['count'] = self::count( $table_name );\n\n return $statuses;\n }", "public abstract function get_counts();", "public function getValueCount()\n {\n return $this->count(self::VALUE);\n }", "public function count($field = 'id')\n {\n if(stristr($field, 'DISTINCT')) {\n $field = preg_replace('|^distinct (.*)$|i', 'DISTINCT `$1`', $field);\n } else {\n $field = '`'.$field.'`';\n }\n return (int)$this->select('COUNT('.$field.') as ct')->get()->scalar();\n }", "function get_unique_object_count(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select count(distinct ?z) where { graph ?g {?x ?y ?z} FILTER regex(?g, \\\"bio2rdf\\\") } \";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\n\t\treturn $results;\n\t} else {\n\t\treturn null;\n\t}\n}", "public abstract function field_count();", "public static function getGraphByField($field) {\n if (static::count() == 0) {\n return [];\n }\n\n return static::all()->groupBy($field)->map(function ($group) {\n return $group->count();\n });\n }", "function cfdef_prepare_list_distinct_values( array $p_field_def ) {\n\tdb_param_push();\n\t$t_query = 'SELECT possible_values FROM {custom_field} WHERE id=' . db_param();\n\t$t_result = db_query( $t_query, array( $p_field_def['id'] ) );\n\n\t$t_row = db_fetch_array( $t_result );\n\tif( !$t_row ) {\n\t\treturn false;\n\t}\n\n\t$t_possible_values = custom_field_prepare_possible_values( $t_row['possible_values'] );\n\t$t_values_arr = explode( '|', $t_possible_values );\n\t$t_return_arr = array();\n\n\tforeach( $t_values_arr as $t_option ) {\n\t\tarray_push( $t_return_arr, $t_option );\n\t}\n\treturn $t_return_arr;\n}", "function count($field = null)\r\n\t{\r\n\t\tif (empty($field)) {\r\n\t\t\t$field = $this->fields['PRI'];\r\n\t\t}\r\n\t\t$result = $this->field('count('.$field.') as count')->select();\r\n\t\treturn $result[0]['count'];\r\n\t}", "function get_unique_subject_predicate_unique_object_counts(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select ?p COUNT(DISTINCT ?s) COUNT(DISTINCT ?o) where { graph ?g { ?s ?p ?o . FILTER isIRI(?o) } FILTER regex(?g, \\\"bio2rdf\\\") }\";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\n\t\n\t\t$results_arr = array();\n\t\t\n\t\t$lines = explode(\"\\n\", $results);\n\t\tforeach($lines as $line){\n\t\t\t\t$split_line = preg_split('/[[:space:]]+/', $line);\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"subject_count\"] = $split_line[1];\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"object_count\"] = $split_line[2];\n\t\t}\n\n\t\treturn $results_arr;\n\t} else {\n\t\treturn null;\n\t}\n\t\n}", "function getStatistic() {\n\t\t$ret = array();\n\t\tforeach ($this->data as $entry) {\n\t\t\tif (array_key_exists($entry['entryType'], $ret)) {\n\t\t\t\t$ret[$entry['entryType']]++;\n\t\t\t} else {\n\t\t\t\t$ret[$entry['entryType']] = 1;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "function getDBcounts( )\n{\n\t// \"frequency\" is how often data was collected eg \"Annual\"\n\tglobal $fields, $connect;\n\t$queryreg = mysqli_query($connect, \"\n\t \tSELECT * from counts ORDER BY count DESC\");\n\n\twhile($row = mysqli_fetch_array($queryreg,MYSQLI_ASSOC))\n\t{\n\t\t$fields[$row['field']] = $row['count']; \n\t//\techo \"<BR>\" . $row['field'] . ' = ' . $row['count'];\n\t}\n}", "public static function get_owner_count() {\n\t\t$query = Doctrine_Query::create() -> select(\"COUNT(facility_code) as count , owner \") \n\t\t-> from(\"facilities\")->where(\"owner !=''\")->groupby(\"owner\")->ORDERBY ('count ASC' );\n\t\t$drugs = $query -> execute();\n\t\treturn $drugs;\n\t}", "private function ts_countHits()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n if ( $this->count_hits[ $this->curr_tableField ] != null )\n {\n return $this->count_hits[ $this->curr_tableField ];\n }\n\n\n // Short var\n $count_hits = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'count_hits' ];\n switch ( $count_hits )\n {\n case( true ):\n $this->count_hits[ $this->curr_tableField ] = true;\n break;\n default:\n $this->count_hits[ $this->curr_tableField ] = false;\n break;\n }\n\n // RETURN\n return $this->count_hits[ $this->curr_tableField ];\n }", "public function getFieldCount() {}", "public function count_all_by_field($field = false, $value = false, $get_deleted = false)\n\t{\n\n\t\t$this->db->where($field,$value);\n\t\tif ($get_deleted)\n\t\t{\n\t\t\t// Get only the deleted users\n\t\t\t$this->db->where('news_articles.deleted !=', 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->where('news_articles.deleted', 0);\n\t\t}\n\t\t//$this->from($this->table_name);\n\t\t\n\t\treturn $this->db->count_all_results('news_articles');\n\t}", "function getDataCount($table='',$selFields = '*',$where='') \t{\n\t\t$query \t= 'SELECT COUNT('.$selFields.') AS cnt FROM ' . $this->tablePrefix . $table .' ' .$where;\t\t\t\t \n \t\t\n \t\treturn $this->fetchOne($this->execute($query));\n\t}", "public static function get_count_for_distinct_column_values($table, $user_id, $column_name)\n {\n $database = Database::instance();\n $sql = \"SELECT COUNT(DISTINCT \" . $column_name . \") as num FROM \" . $table . \" WHERE active = 1 AND \" . $column_name . \" IS NOT NULL AND \" . $column_name . \" <> '' AND user_id = \" . $user_id;\n $query = $database->prepare($sql);\n $query->execute();\n $result = $query->fetch(\\PDO::FETCH_ASSOC);\n $query->closeCursor();\n if ($result === false){\n return false;\n }else{\n return $result;\n }\n }", "public function count($field = \"*\", $as = null);", "public function CountField ( $field )\r\n\t{\r\n\t\t$sum = 0;\r\n\t\t$field = strtolower ( $field );\r\n\t\tforeach ( $this->_qts as $qt )\r\n\t\t{\r\n\t\t\tif ( $qt->HasField ( $field ) )\r\n\t\t\t\t$sum++;\r\n\t\t}\r\n\t\treturn $sum;\r\n\t}", "public function get_used_by() {\n\t\t$_used_by = (array) get_post_meta( $this->id, '_used_by' );\n\t\t// Strip out any null values.\n\t\treturn array_filter( $_used_by );\n\t}", "function dokan_get_seller_count() {\n global $wpdb;\n\n\n $counts = array( 'yes' => 0, 'no' => 0 );\n\n $result = $wpdb->get_results( \"SELECT COUNT(um.user_id) as count, um1.meta_value as type\n FROM $wpdb->usermeta um\n LEFT JOIN $wpdb->usermeta um1 ON um1.user_id = um.user_id\n WHERE um.meta_key = 'wp_capabilities' AND um1.meta_key = 'dokan_enable_selling'\n AND um.meta_value LIKE '%seller%'\n GROUP BY um1.meta_value\" );\n\n if ( $result ) {\n foreach ($result as $row) {\n $counts[$row->type] = (int) $row->count;\n }\n }\n\n return $counts;\n}", "public function statisticUserBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, COUNT(DATE_FORMAT(created_at,'%Y-%m')) as number \n FROM user GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"number\"] = $stat[\"number\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "public function distinct();", "public function countAll() {}", "public function countAll() {}", "public function countAll() {}", "function get_unique_subject_predicate_unique_object_literal_counts(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select ?p COUNT(DISTINCT ?s) COUNT(DISTINCT ?o) where { graph ?g { ?s ?p ?o . FILTER isLiteral(?o) } FILTER regex(?g, \\\"bio2rdf\\\") }\";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\t\n\t\t$results_arr = array();\n\t\t\n\t\t$lines = explode(\"\\n\", $results);\n\t\tforeach($lines as $line){\n\t\t\t\t$split_line = preg_split('/[[:space:]]+/', $line);\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"subject_count\"] = $split_line[1];\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"object_count\"] = $split_line[2];\n\t\t}\n\n\t\treturn $results_arr;\n\t} else {\n\t\treturn null;\n\t}\n\t\n}", "static public function getEmptyUsageTypeTotals() {\n\t\treturn array(\n\t\t\t'usagev' => 0,\n\t\t\t'cost' => 0,\n\t\t\t'count' => 0,\n\t\t);\n\t}", "public function getUsageCount()\n {\n $today = Carbon::now('Asia/Singapore')->toDateTimeString();\n $timezone = new Carbon('Asia/Singapore');\n $last_thirty_days = $timezone->subDays(30);\n\n return count($this->appUserBlurb->where('interaction_type', 'use')->whereBetween('created_at', array($last_thirty_days->toDateTimeString(), $today))->groupBy('app_user_id')->get());\n }", "public function count()\n {\n return $this->getValue()->count();\n }", "private function getUsedChannelFieldtypes()\n {\n $channel_fields = ee()->db->select('field_type')->order_by('field_type')->get('channel_fields');\n $data = [];\n foreach ($channel_fields->result_array() as $ft) {\n $data[$ft['field_type']] = ['exp_channel_fields'];\n }\n\n return $data;\n }", "public abstract function GetFieldCount();", "function statistics_extended_users_metadata_value_count($metadata,$value,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}users_entity ue \";\r\n $query .= \"JOIN {$dbprefix}entities e ON ue.guid = e.guid AND e.enabled='yes'\";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"JOIN {$dbprefix}metadata m2 ON ue.guid = m2.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings m2v ON m.value_id = m2v.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n $query .= \"AND m2v.string like '$value' \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "public static function distinct();", "public function distinct(array $fields, $as = null);", "function get_type_relation_type_counts(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select ?p ?stype COUNT(DISTINCT ?s) ?otype COUNT(DISTINCT ?o) where { graph ?g { ?s a ?stype . ?s ?p ?o . ?o a ?otype . } FILTER regex(?g, \\\"bio2rdf\\\") }\";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\n\t\n\t\t$results_arr = array();\n\t\t\n\t\t$lines = explode(\"\\n\", $results);\n\t\tforeach($lines as $line){\n\t\t\t\t$split_line = preg_split('/[[:space:]]+/', $line);\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"subject_type\"] = $split_line[1];\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"subject_count\"] = $split_line[2];\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"object_type\"] = $split_line[3];\n\t\t\t\t$results_arr[$split_line[0]][\"count\"][\"object_count\"] = $split_line[4];\n\t\t}\n\n\t\treturn $results_arr;\n\t} else {\n\t\treturn null;\n\t}\n\n}", "public function getOptionValuesCountForRender()\n\t{\n\n\t\tif ($this->_foreignValuesCount == NULL) {\n\t\t\t$countQuery = Doctrine_Query::create()\n\t\t\t\t->from($this->_localClassName . ' m')\n\t\t\t\t->select('COUNT(id)')\n\t\t\t;\n\n\t\t\tforeach($this->_one2NmultiRelationCondition as $key => $value) {\n\n\t\t\t\tif ($value === NULL) {\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' IS NULL', array());\n\t\t\t\t} else\n\t\t\t\tif (is_array($value) &&\n\t\t\t\t\tarray_key_exists('like', $value) &&\n\t\t\t\t\t$value['like'] &&\n\t\t\t\t\tarray_key_exists('value', $value)) {\n\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' LIKE ? ', array($value['value']));\n\t\t\t\t} else\n\t\t\t\tif (is_array($value) &&\n\t\t\t\t\tarray_key_exists('like', $value) &&\n\t\t\t\t\t!$value['like'] &&\n\t\t\t\t\tarray_key_exists('value', $value)) {\n\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' NOT LIKE ? ', array($value['value']));\n\t\t\t\t} else\n\t\t\t\tif (is_array($value) &&\n\t\t\t\t\tarray_key_exists('difference', $value) &&\n\t\t\t\t\t$value['difference'] == 'lt' &&\n\t\t\t\t\tarray_key_exists('value', $value)) {\n\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' < ? ', array($value['value']));\n\t\t\t\t} else\n\t\t\t\tif (is_array($value) &&\n\t\t\t\t\tarray_key_exists('difference', $value) &&\n\t\t\t\t\t$value['difference'] == 'lte' &&\n\t\t\t\t\tarray_key_exists('value', $value)) {\n\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' <= ? ', array($value['value']));\n\t\t\t\t} else\n\t\t\t\tif (is_array($value) &&\n\t\t\t\t\tarray_key_exists('difference', $value) &&\n\t\t\t\t\t$value['difference'] == 'gt' &&\n\t\t\t\t\tarray_key_exists('value', $value)) {\n\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' > ? ', array($value['value']));\n\t\t\t\t} else\n\t\t\t\tif (is_array($value) &&\n\t\t\t\t\tarray_key_exists('difference', $value) &&\n\t\t\t\t\t$value['difference'] == 'gte' &&\n\t\t\t\t\tarray_key_exists('value', $value)) {\n\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' >= ? ', array($value['value']));\n\t\t\t\t} else {\n\t\t\t\t\t$countQuery = $countQuery->addWhere('m.' . $key . ' = ? ', array($value));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$countArray = $countQuery\n\t\t\t\t->setHydrationMode(Doctrine_Core::HYDRATE_SCALAR)\n\t\t\t\t->execute()\n\t\t\t;\n\n\t\t\tif (is_array($countArray) &&\n\t\t\t\tisset($countArray[0]) &&\n\t\t\t\tis_array($countArray[0]) &&\n\t\t\t\tisset($countArray[0]['m_COUNT'])) {\n\n\t\t\t\t$this->_foreignValuesCount = $countArray[0]['m_COUNT'];\n\t\t\t}\n\t\t}\n\t\t$returnValue = $this->_foreignValuesCount;\n\n\t\treturn $returnValue;\n\t}", "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 testGroupByFieldWithCardinality() {\n $field_storage = FieldStorageConfig::create([\n 'type' => 'integer',\n 'field_name' => 'field_test',\n 'cardinality' => 4,\n 'entity_type' => 'entity_test_mul',\n ]);\n $field_storage->save();\n $field = FieldConfig::create([\n 'field_name' => 'field_test',\n 'entity_type' => 'entity_test_mul',\n 'bundle' => 'entity_test_mul',\n ]);\n $field->save();\n\n $entities = [];\n $entity = EntityTestMul::create([\n 'field_test' => [1, 1, 1],\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $entity = EntityTestMul::create([\n 'field_test' => [2, 2, 2],\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $entity = EntityTestMul::create([\n 'field_test' => [2, 2, 2],\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $view = Views::getView('test_group_by_count_multicardinality');\n $this->executeView($view);\n $this->assertCount(2, $view->result);\n\n $this->assertEquals('3', $view->getStyle()->getField(0, 'id'));\n $this->assertEquals('1', $view->getStyle()->getField(0, 'field_test'));\n $this->assertEquals('6', $view->getStyle()->getField(1, 'id'));\n $this->assertEquals('2', $view->getStyle()->getField(1, 'field_test'));\n\n $entities[2]->field_test[0]->value = 3;\n $entities[2]->field_test[1]->value = 4;\n $entities[2]->field_test[2]->value = 5;\n $entities[2]->save();\n\n $view = Views::getView('test_group_by_count_multicardinality');\n $this->executeView($view);\n $this->assertCount(5, $view->result);\n\n $this->assertEquals('3', $view->getStyle()->getField(0, 'id'));\n $this->assertEquals('1', $view->getStyle()->getField(0, 'field_test'));\n $this->assertEquals('3', $view->getStyle()->getField(1, 'id'));\n $this->assertEquals('2', $view->getStyle()->getField(1, 'field_test'));\n $this->assertEquals('1', $view->getStyle()->getField(2, 'id'));\n $this->assertEquals('3', $view->getStyle()->getField(2, 'field_test'));\n $this->assertEquals('1', $view->getStyle()->getField(3, 'id'));\n $this->assertEquals('4', $view->getStyle()->getField(3, 'field_test'));\n $this->assertEquals('1', $view->getStyle()->getField(4, 'id'));\n $this->assertEquals('5', $view->getStyle()->getField(4, 'field_test'));\n\n // Check that translated values are correctly retrieved and are not grouped\n // into the original entity.\n $translation = $entity->addTranslation('it');\n $translation->field_test = [6, 6, 6];\n $translation->save();\n\n $view = Views::getView('test_group_by_count_multicardinality');\n $this->executeView($view);\n\n $this->assertCount(6, $view->result);\n $this->assertEquals('3', $view->getStyle()->getField(5, 'id'));\n $this->assertEquals('6', $view->getStyle()->getField(5, 'field_test'));\n }", "public function getCountsList(){\n return $this->_get(6);\n }", "private function _countTags($param) {\n\n\t\t$output = ['all' => 0 ];\n\t\t$param['select'] = 'type, count(`type`) as count';\n\t\t$param['group_by'] = 'type';\n\n\t\tunset($param['limit']);\n\n\t\t$count = $this->CI->model->get($param);\n\n\t\tforeach($count as $c) {\n\t\t\t$c['count'] = (int) $c['count'];\n\t\t\t$output['all'] += $c['count'];\n\t\t\tif (!isset($output[$c['type']])) {\n\t\t\t\t$output[$c['type']] = 0;\n\t\t\t}\n\t\t\t$output[$c['type']] += $c['count'];\n\t\t}\n\t\treturn $output;\n\t}", "function countAll() ;", "function requirement_get_distinct_field($project_id, $field, $blank=false) {\n\n global $db;\n\n\t$tbl_req \t\t\t\t\t= REQ_TBL;\n\t$f_req_proj_id\t\t\t\t= $tbl_req .\".\". REQ_PROJECT_ID;\n\t$f_req_id \t\t\t\t\t= $tbl_req .\".\". REQ_ID;\n\t$f_req_unique_id \t\t\t= $tbl_req .\".\". REQ_UNIQUE_ID;\n\n\t$tbl_req_ver\t\t\t\t= REQ_VERS_TBL;\n\t$f_req_ver_uid\t\t\t\t= $tbl_req_ver .\".\". REQ_VERS_UNIQUE_ID;\n\t$f_req_ver_req_id\t\t\t= $tbl_req_ver .\".\". REQ_VERS_REQ_ID;\n\n\t$q = \"\tSELECT DISTINCT ($field)\n\t\t\tFROM $tbl_req\n\t\t\tINNER JOIN $tbl_req_ver\n\t\t\t\tON $f_req_ver_req_id = $f_req_id\n\t\t\tWHERE $field != ''\n\t\t\t\tAND $f_req_proj_id = $project_id\n\t\t\tORDER BY $field ASC\";\n\n $rows = array();\n\n\t$rs = db_query($db, $q);\n\n\twhile($row = db_fetch_row($db, $rs)) {\n\t\t$rows[] = $row[$field];\n\t}\n\n if( $blank == true ) {\n \t$rows[] = \"\";\n }\n\n return $rows;\n}", "public function getDistinct($field,\n $join = '')\n {\n global $debug;\n global $warn;\n global $connection;\n\n $retval = array();\n // construct a query for the specific matches\n $className = $this->information['classname'];\n $nsclass = __NAMESPACE__ . \"\\\\\" . $className;\n $fields = explode(',',$field);\n $distinct = '';\n $orderFld = '';\n $comma = '';\n foreach($fields as $dfield)\n { // support multiple fields in DISTINCT clause\n $matches = array();\n if (preg_match('/(\\w+)\\s*\\.s*(\\w+)/', $dfield, $matches))\n { // support table.fieldname\n $tblName = $matches[1];\n $tfield = $matches[2];\n $info = Record::getInformation($tblName);\n $tclassName = $info['classname'];\n $tnsclass = __NAMESPACE__ . \"\\\\\" . $tclassName;\n // support field name and table name synonyms\n $tfield = $tnsclass::getRealFieldName($tfield);\n if (is_null($tfield))\n $fieldLc = null;\n else\n $fieldLc = $info['table'] . '.' . $tfield;\n } // support table.fieldname\n else\n $fieldLc = $nsclass::getRealFieldName(trim($dfield));\n if (is_null($fieldLc))\n $warn .= \"<p>RecordSet::getDistinct: \" .\n \"Invalid field name parameter '$dfield'</p>\\n\";\n else\n $distinct .= $comma . $fieldLc;\n\n // the value returned by getRealFieldName may be an expression\n // defined as a pseudo fieldname\n if (preg_match('/^(.*) AS (.*)$/i', $fieldLc, $matches))\n $orderFld .= $comma . $matches[2];\n else\n $orderFld = $comma . $fieldLc;\n $comma = ',';\n } // support multiple fields in DISTINCT clause\n\n // perform the query\n $query = \"SELECT DISTINCT $distinct \" .\n \"FROM `\" . $this->table . '` ' .\n $this->where . \" ORDER BY $orderFld\";\n $queryText = debugPrepQuery($query, $this->sqlParms);\n if ($debug)\n $warn .= \"<p>RecordSet::getDistinct: \" . __LINE__ . \" query='$queryText'</p>\\n\";\n\n // query the database for matches\n $stmt = $connection->prepare($query);\n if ($stmt->execute($this->sqlParms))\n { // success\n $this->lastSqlCmd = $queryText;\n if ($debug)\n $warn .= \"<p>RecordSet.inc: \" . __LINE__ .\n \" \\\"$queryText\\\"</p>\\n\";\n $result = $stmt->fetchAll(PDO::FETCH_NUM);\n foreach($result as $row)\n $retval[] = $row[0];\n return $retval;\n } // success\n else\n { // error performing query\n throw new Exception(\"RecordSet::getDistinct: \\\"$queryText\\\", \" .\n print_r($stmt->errorInfo(),true));\n } // error performing query\n\n }", "private function ts_getDisplayInCaseOfNoCounting()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n $displayInCaseOfNoCounting = $conf_array[ 'wrap.' ][ 'item.' ][ 'displayInCaseOfNoCounting' ];\n\n // RETURN TS value\n return $displayInCaseOfNoCounting;\n }", "public function countValue($value);", "public function countValues() {\n\t\t$values = array_values($this->_value);\n\n\t\tforeach ($values as $key => $value) {\n\t\t\tif (!is_string($value) && !is_numeric($value)) {\n\t\t\t\tunset($values[$key]);\n\t\t\t}\n\t\t}\n\n\t\treturn array_count_values($values);\n\t}", "public function havingIsNull($field);", "public function count()\n {\n return count($this->valueOf());\n }", "public function count($distinct = false)\r\n {\r\n $res = $this->getQuery()->count();\r\n $this->cleanup();\r\n \r\n return $res;\r\n }", "public function countUsed()\n {\n }", "function distinct_value($conn,$column_name,$table_name,$where)\r\n\t{\r\n\t$result=array();\r\n\t\t$qry=\"SELECT DISTINCT `$column_name` as dis_value FROM `$table_name` $where\";\r\n\t\t$res=mysql_query($qry);\r\n\t while($row=mysql_fetch_array($res))\r\n\t\t{\r\n\t\t$result[]=$row['dis_value'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "function get_unique_predicate_count(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select count(distinct ?y) where { graph ?g {?x ?y ?z} FILTER regex(?g, \\\"bio2rdf\\\") } \";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\n\t\treturn $results;\n\t} else {\n\t\treturn null;\n\t}\n}", "function getCount() {\n\t\t$i = $this->_query->join('synd_issue','i');\n\t\t$query = clone $this->_query;\n\t\t$query->column(\"COUNT(DISTINCT $i.node_id)\");\n\n\t\t$persistent = $this->_storage->getPersistentStorage();\n\t\t$database = $persistent->getDatabase();\n\t\treturn $database->getOne($query->toString());\n\t}", "public function getTotalResults()\n {\n $query = $this->deliverQueryObject();\n\n return $query->resetQueryParts(['groupBy', 'orderBy'])->select('count(distinct uph.upID)')->setMaxResults(1)->execute()->fetchColumn();\n }", "public function getDistinct() {\n\t\tif(is_null($this->distinct)) {\n\t\t\t$query = \"\";\n\t\t\t$query .= 'SELECT DISTINCT ';\n\t\t\t$query .= $this->getCodeField() . ' AS code, ';\n\t\t\t$query .= $this->getLabelField() . ' AS label';\n\t\t\t$query .= ' FROM ' . $this->getDatasourceName();\n\t\t\t$has_where = false;\n\t\t\tif(is_array($this->filter_value) && !in_array('-1', $this->filter_value)) {\n\t\t\t\t$select = \"\";\n\t\t\t\t$first = true;\n\t\t\t\tforeach($this->filter_value as $value) {\n\t\t\t\t\t$first ? $first = false : $select .= \",\";\n\t\t\t\t\t$select .= \"'\" . $value . \"'\";\n\t\t\t\t}\n\t\t\t\t$query .= ' WHERE ' . $this->getCodeField() . ' IN (' . $select . ')';\n\t\t\t\t$has_where = true;\n\t\t\t}\n\t\t\t$query .= ' ORDER BY ' . $this->getLabelField();\n\t\t\t$this->exploitResultset($this->execute($query));\n\t\t}\n\t\treturn $this->distinct;\n\t}", "public function get_counts() {\n\n\t\t$this->counts = [];\n\n\t\t// Base params with applied filters.\n\t\t$base_params = $this->get_filters_query_params();\n\n\t\t$total_params = $base_params;\n\t\tunset( $total_params['status'] );\n\t\t$this->counts['total'] = ( new EmailsCollection( $total_params ) )->get_count();\n\n\t\tforeach ( $this->get_statuses() as $status => $name ) {\n\t\t\t$collection = new EmailsCollection( array_merge( $base_params, [ 'status' => $status ] ) );\n\n\t\t\t$this->counts[ 'status_' . $status ] = $collection->get_count();\n\t\t}\n\n\t\t/**\n\t\t * Filters items counts by various statuses of email log.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param array $counts {\n\t\t * Items counts by statuses.\n\t\t *\n\t\t * @type integer $total Total items count.\n\t\t * @type integer $status_{$status_key} Items count by status.\n\t\t * }\n\t\t */\n\t\t$this->counts = apply_filters( 'wp_mail_smtp_pro_emails_logs_admin_table_get_counts', $this->counts );\n\t}", "function get_type_counts(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select ?type (COUNT(?s) AS ?c) where { graph ?g {?s a ?type} FILTER regex(?g, \\\"bio2rdf\\\") } order by DESC(?c)\";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\t\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\n\n\t\t$results_arr = array();\n\t\n\t\t$lines = explode(\"\\n\", $results);\n\t\tforeach($lines as $line){\n\t\t\t\t$split_line = preg_split('/[[:space:]]+/', $line);\n\t\t\t\t$results_arr[$split_line[0]] = $split_line[1];\n\t\t}//foreach\n\t\treturn $results_arr;\n\t} else {\n\t\treturn null;\t\t\n\t}//else\n}", "public function summary()\n {\n # select table to count data\n $query = \"SELECT\n (SELECT COUNT(*) FROM news) as news,\n (SELECT COUNT(*) FROM accounts) as accounts,\n (SELECT COUNT(*) FROM blog) as blog,\n (SELECT COUNT(*) FROM contect WHERE seen = 0) as message,\n (SELECT COUNT(*) FROM newsletter) as newsletter,\n (SELECT COUNT(*) FROM newsletter WHERE subscribed) as subscribed_newsletter\n FROM DUAL\";\n # use fake table (use count table)\n return $this->db->query($query)->result_array()[0];\n }", "function count_series() {\n $result = $this->pdo->query('SELECT COUNT(DISTINCT series) FROM files');\n return $result->fetchColumn();\n }", "public function statisticItineraryBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, COUNT(DATE_FORMAT(created_at,'%Y-%m')) as number \n FROM itinerary GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"number\"] = $stat[\"number\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "public function countableQueries()\n {\n return [];\n }", "function get_unique_subject_count(){\n\t\n\tGLOBAL $cmd_pre;\n\tGLOBAL $cmd_post;\n\t\n\t$qry = \"select count(distinct ?x) where { graph ?g {?x ?y ?z} FILTER regex(?g, \\\"bio2rdf\\\") } \";\n\t\n\t$cmd = $cmd_pre.$qry.$cmd_post;\n\t\n\t$out = \"\";\n\t\n\ttry {\n\t\t$out = execute_isql_command($cmd);\n\t} catch (Exception $e){\n\t\techo 'iSQL error: ' .$e->getMessage();\n\t\treturn null;\n\t}\n\n\t$split_results = explode(\"Type HELP; for help and EXIT; to exit.\\n\", $out);\n\t$split_results_2 = explode(\"\\n\\n\", $split_results[1]);\n\t$results = trim($split_results_2[0]);\n\t\n\tif (preg_match(\"/^0 Rows./is\", $results) === 0) {\n\t\treturn $results;\n\t} else {\n\t\treturn null;\n\t}\n}", "function distinctOptionsInColumn($csvArray) {\n\n $distinctValuesArray = array();\n\n for($i = 0; $i < count($csvArray) ; $i++) {\n if($csvArray[$i][0] != NULL && $csvArray[$i][0] != \"\" && trim($csvArray[$i][0]) != \"\" && trim($csvArray[$i][0]) != NULL)\n array_push($distinctValuesArray, $csvArray[$i][0]);\n }\n\n $distinctValuesArray = array_unique($distinctValuesArray);\n $tempArray = array();\n foreach ($distinctValuesArray as $key => $value) {\n array_push($tempArray, $value);\n }\n\n $distinctValuesArray = $tempArray;\n\n return $distinctValuesArray;\n}", "public function count() {\n\t\treturn count($this->values);\n\t}", "public function distinct($tableSpecId, $fieldName, array $filter=[])\n {\n $t = new \\Tripod\\Timer();\n $t->start();\n\n $filter['_id.'._ID_TYPE] = $tableSpecId;\n\n $collection = $this->config->getCollectionForTable($this->storeName, $tableSpecId, $this->readPreference);\n $results = $collection->distinct($fieldName, $filter);\n\n $t->stop();\n $query = array('distinct'=>$fieldName, 'filter'=>$filter);\n $this->timingLog(MONGO_TABLE_ROWS_DISTINCT, array('duration'=>$t->result(), 'query'=>$query, 'collection'=>TABLE_ROWS_COLLECTION));\n $this->getStat()->timer(MONGO_TABLE_ROWS_DISTINCT.\".$tableSpecId\",$t->result());\n return array(\n \"head\"=>array(\n \"count\"=>count($results)\n ),\n \"results\"=>$results\n );\n }", "public function getDistinct($attribute, $value, $parameters) {\n\n// echo $attribute . ' - ' . $value;\n// pr($parameters);\n\n\t\t$model = new $parameters[0]();\n\n\t\t$fType = isset($parameters[1]) ? $parameters[1] : null;\n\t\t$fType = strtolower($fType) == 'null' ? null : $fType;\n\n\t\t$fld1 = isset($parameters[2]) ? $parameters[2] : null;\n\t\t$fld1 = strtolower($fld1) == 'null' ? null : $fld1;\n\n\t\t$fld2 = isset($parameters[3]) ? $parameters[3] : null;\n\t\t$fld2 = strtolower($fld2) == 'null' ? null : $fld2;\n\n\t\t$id = isset($parameters[4]) ? $parameters[4] : null;\n\t\t$id = strtolower($id) == 'null' ? null : $id;\n\n\t\t$idCol = isset($parameters[5]) ? $parameters[5] : '_id';\n\n\t\tif($fType) $model = $model->where('ft_type', '=', $fType);\n\n\t\tif($fld2) $model = $model->where($fld1, '<=', $value)->where($fld2, '>=', $value);\n\t\telse if($fld1) $model = $model->where($fld1, '=', $value);\n\n\t\tif($id) $model = $model->where($idCol, '<>', $id);\n\n\t\t$kount = $model->count();\n\t\t//$kount = $model->get()->toArray();\n\n//pr($kount);\n\n\t\treturn $kount <= 0;\n\t}", "public function count($field, $alias = '')\n {\n return $this->prepareAggregateStatement($field, $alias, 'COUNT');\n }", "public function count()\r\n {\r\n return count($this->_values);\r\n }", "public static function getCountBy($field, $value)\n {\n $key = static::getPrimaryKey();\n\n return DB::table(static::$schema)\n ->select(['count('. $key .') tcount'])\n ->where($field, $value)\n ->fetchOne()\n ->tcount;\n }", "public function testValueIsNull(): void {\n $transform = $this->getTransform('count', [\n 'source' => 'source',\n 'field' => 'example_source_field',\n ]);\n $result = $transform->transform([\n 'example_source_field' => null\n ]);\n // Make sure it stays an array\n $this->assertEquals(null, $result);\n }", "public static function record_count()\r\r\n {\r\r\n global $wpdb;\r\r\n $result = false;\r\r\n $totalRecords = 0;\r\r\n $countKey = 'total';\r\r\n $mitambo_json_api = wpsearchconsole::getInstance()->mitambo_json_api;\r\r\n $lastCollectDate = $mitambo_json_api->last_collect_date;\r\r\n $tabName = List_of_Data::getCurrentTabName(isset($_GET['tab']) ? $_GET['tab'] : 1);\r\r\n $type = List_of_Data::getDefaultType($tabName);\r\r\n $type = (isset($_GET['type']) ? $_GET['type'] : $type);\r\r\n\r\r\n $sql = \"SELECT json_value FROM {$wpdb->prefix}wpsearchconsole_data\";\r\r\n\r\r\n $sql .= \" WHERE api_key = '$tabName'\";\r\r\n $sql .= ($tabName == 'keywords' && $type == 0) ? \" AND api_subkey = '$type'\" : \"\";\r\r\n $sql .= ($type && $type != 'all') ? \" AND api_subkey = '$type'\" : \"\";\r\r\n $sql .= \" AND datetime = '\" . substr($lastCollectDate, 0, 10) . \"'\";\r\r\n $sql .= \"GROUP BY api_subkey\";\r\r\n\r\r\n if ($tabName == 'duplication') {\r\r\n $countKey = 'DuplicateGroupsCount';\r\r\n }\r\r\n $response = $wpdb->get_results($sql);\r\r\n foreach ($response as $key => $val) {\r\r\n\r\r\n if (!empty($val) && array_key_exists('json_value', $val)) {\r\r\n\r\r\n $result = json_decode($val->json_value);\r\r\n $totalRecords += ($result && array_key_exists($countKey, $result)) ? $result->$countKey : 0;\r\r\n }\r\r\n }\r\r\n\r\r\n return $totalRecords;\r\r\n }", "public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []);", "public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []);", "public function getCountRowsOfTable ($tableName,$fieldname='*');", "abstract public function prepareFilteredCount();", "public function dcr_usage_count( $used_by = '' ) {\n\t\tif ( $this->id && $this->usage_count > 0 ) {\n\t\t\tglobal $wpdb;\n\t\t\t$this->usage_count--;\n\t\t\tupdate_post_meta( $this->id, 'usage_count', $this->usage_count );\n\n\t\t\tif ( $used_by ) {\n\t\t\t\t/**\n\t\t\t\t * We're doing this the long way because `delete_post_meta( $id, $key, $value )` deletes.\n\t\t\t\t * all instances where the key and value match, and we only want to delete one.\n\t\t\t\t */\n\t\t\t\t$meta_id = $wpdb->get_var( $wpdb->prepare( \"SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_used_by' AND meta_value = %s AND post_id = %d LIMIT 1;\", $used_by, $this->id ) );\n\t\t\t\tif ( $meta_id ) {\n\t\t\t\t\tdelete_metadata_by_mid( 'post', $meta_id );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function count_associated($field, $params = null) {\n\t\tif (isset($this->associations[$field])) {\n\t\t\treturn $this->associations[$field]->get($this, $params, true);\n\t\t}\n\n\t\treturn null;\n\t}", "public function typeCounts() : array\n {\n $counts = [\n self::CATEGORICAL => 0,\n self::CONTINUOUS => 0,\n self::RESOURCE => 0,\n ];\n\n return array_replace($counts, array_count_values($this->types()));\n }", "public function countDatas($data)\n{\n\t$this->db->select('*');\n\t$this->db->where('sample_field', $data['value']);\n\t$count=$this->db->count_all_results('sample_table');\n\treturn $count;\n}", "function countFieldRelationsSingleProp(&$rows, $field_type)\n\t{\n\t\tif ( !count($rows) ) return;\n\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$file_id_arr[] = $row->id;\n\t\t}\n\t\t$query\t= 'SELECT a.id as file_id, COUNT(rel.item_id) as count, GROUP_CONCAT(DISTINCT rel.item_id SEPARATOR \",\") AS item_list'\n\t\t\t\t. ' FROM #__flexicontent_files AS a'\n\t\t\t\t. ' JOIN #__flexicontent_fields_item_relations AS rel ON a.id = rel.value'\n\t\t\t\t. ' JOIN #__flexicontent_fields AS fi ON fi.id = rel.field_id AND fi.field_type = ' . $this->_db->Quote($field_type)\n\t\t\t\t. ' WHERE a.id IN (' . implode(',', $file_id_arr) . ')'\n\t\t\t\t. ' GROUP BY a.id'\n\t\t\t\t;\n\t\t$this->_db->setQuery($query);\n\t\t$assigned_data = $this->_db->loadObjectList('file_id');\n\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$row->{'assigned_'.$field_type} = isset($assigned_data[$row->id]) ? (int) $assigned_data[$row->id]->count : 0;\n\t\t\tif (isset($assigned_data[$row->id]) && $assigned_data[$row->id]->item_list)\n\t\t\t{\n\t\t\t\t$row->item_list[$field_type] = $assigned_data[$row->id]->item_list;\n\t\t\t\t$row->total_usage = isset($row->total_usage) ? $row->total_usage : 0;\n\n\t\t\t\t$item_ids = explode(',', $assigned_data[$row->id]->item_list);\n\t\t\t\t$row->total_usage += count($item_ids);\n\t\t\t}\n\t\t}\n\t}", "public function count()\n\t{\n\t\treturn count($this->values);\n\t}", "public function count_key_usage() {\n\t\t$this->db->from('key_usage');\n\t\treturn $this->db->count_all_results();\n\t}", "public function getAllDistinctSpaceTypes()\n {\n $this->db->query(\"\n SELECT DISTINCT Space_Type\n FROM Parking_Space;\n \");\n\n // ASSIGN RESULT SET\n $results = $this->db->resultSet();\n return $results;\n }", "public function distinct() {\n return $this->attribute('distinct', true);\n }", "public function getCounters()\n {\n $st = $this->db->query('SELECT COUNT(*) as count from users')->result_array();\n $data['users'] = $st[0]['count'];\n\n /*===== COUNT INSTANCES =====*/\n $st = $this->db->query('SELECT COUNT(*) as count from instances')->result_array();\n $data['instances'] = $st[0]['count'];\n\n\n /*===== COUNT SERVERS =====*/\n $st = $this->db->query('SELECT COUNT(*) as count from servers')->result_array();\n $data['servers'] = $st[0]['count'];\n\n /*==== COUNT MODULES ====*/\n $st = $this->db->query('SELECT COUNT(*) as count from modules')->result_array();\n $data['modules'] = $st[0]['count'];\n\n return $data;\n }", "public static function get_summary( $field = false ) {\n\t\t$_default = array(\n\t\t\t'list_size'\t\t\t=> 0,\n\t\t\t'last_update_time'\t=> 0,\n\t\t\t'curr_crawler'\t\t=> 0,\n\t\t\t'curr_crawler_beginning_time'\t=> 0,\n\t\t\t'last_pos'\t\t\t=> 0,\n\t\t\t'last_count'\t\t=> 0,\n\t\t\t'last_crawled'\t\t=> 0,\n\t\t\t'last_start_time'\t=> 0,\n\t\t\t'last_status'\t\t=> '',\n\t\t\t'is_running'\t\t=> 0,\n\t\t\t'end_reason'\t\t=> '',\n\t\t\t'meta_save_time'\t=> 0,\n\t\t\t'pos_reset_check'\t=> 0,\n\t\t\t'done'\t\t\t\t=> 0,\n\t\t\t'this_full_beginning_time'\t=> 0,\n\t\t\t'last_full_time_cost'\t\t=> 0,\n\t\t\t'last_crawler_total_cost'\t=> 0,\n\t\t\t'crawler_stats'\t\t=> array(), // this will store all crawlers hit/miss crawl status\n\t\t);\n\n\t\t$summary = parent::get_summary();\n\t\t$summary = array_merge( $_default, $summary );\n\n\t\tif ( ! $field ) {\n\t\t\treturn $summary;\n\t\t}\n\n\t\tif ( array_key_exists( $field, $summary ) ) {\n\t\t\treturn $summary[ $field ];\n\t\t}\n\n\t\treturn null;\n\t}", "public function countAll(): int;", "public function checkunique(){\n\t\n\t\t$count =$this->countByAttributes(array(\n 'no'=>$this->no,\n\t\t\t'TanggalTest'=>$this->TanggalTest\n ));\n\t}", "public function getDistinctEntries($type, $field)\n\t{\n\t\t$query = $this->db->getQuery(true)\n\t\t\t->select(\"DISTINCT h.type_id\")\n\t\t\t->from(\"#__history AS h\")\n\t\t\t->where(\"h.field=\" . $this->db->quote($field) . \" AND h.type=\" . $this->db->quote($type))\n\t\t\t->where(\"h.user_id IN(\" . implode(',', $this->users) . \")\");\n\n\t\treturn $this->db->setQuery($query)->loadColumn();\n\t}", "private function getUsedCoupons()\n\t{\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('coupon_id, count(*) as num')\n\t\t\t->from('#__conferenceplus_coupons_inuse')\n\t\t\t->where($db->qn('ticket_id') . ' <> 0')\n\t\t\t->where($db->qn('payment_id') . ' <> 0')\n\t\t\t->group('coupon_id');\n\n\t\t$db->setQuery($query);\n\n\t\treturn $db->loadObjectList('coupon_id');\n\n\t}", "public function getUsageForDate()\n\t{\n\t\t$period = $this->periodToInt(Request::getString('period', $this->params->get('period', 'prior12')));\n\t\t$datetime = Request::getString('datetime', date(\"Y\") . '-' . date(\"m\")) . '-00 00:00:00';\n\n\t\t$db = Components\\Usage\\Helpers\\Helper::getUDBO();\n\n\t\t$sql = \"SELECT value, valfmt\n\t\t\t\tFROM `summary_user_vals`\n\t\t\t\tWHERE rowid=\" . $db->quote(1) . \" AND period=\" . $db->quote($period) . \" AND datetime=\" . $db->quote($datetime) . \"\n\t\t\t\tORDER BY colid\";\n\t\t$db->setQuery($sql);\n\t\t$results = $db->loadObjectList();\n\n\t\t$res_iden = 1;\n\t\t$org_iden = 1;\n\n\t\t$i = 0;\n\n\t\t$highest = 1;\n\n\t\tforeach ($results as $row)\n\t\t{\n\t\t\t$i++;\n\n\t\t\tif ($i == 2)\n\t\t\t{\n\t\t\t\t$highest = $row->value;\n\t\t\t}\n\n\t\t\tif ($i == 7)\n\t\t\t{\n\t\t\t\t$highest = $row->value;\n\t\t\t}\n\n\t\t\tif ($row->valfmt == 2 && $highest > 100)\n\t\t\t{\n\t\t\t\t$row->value = number_format(($row->value / $highest) * 100);\n\t\t\t}\n\n\t\t\tswitch ($i)\n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'US',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-res-us'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'Asia',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-res-asia'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'Europe',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-res-europe'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'Other',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-res-other'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 8:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Education',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-org-education'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Industry',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-org-industry'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Government',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-org-government'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Other',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-visits-org-other'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$sql = \"SELECT value\n\t\t\tFROM `summary_user_vals`\n\t\t\tWHERE rowid=\" . $db->quote(1) . \" AND period=\" . $db->quote($period) . \" AND datetime=\" . $db->quote($datetime) . \" AND colid=\" . $db->quote(1) . \"\n\t\t\tORDER BY datetime ASC\";\n\t\t$db->setQuery($sql);\n\t\t$result = $db->loadResult();\n\n\t\t$data = new stdClass;\n\t\t$data->visits = new stdClass;\n\t\t$data->visits->total = number_format($result);\n\t\t$data->visits->residence = $residence;\n\t\t$data->visits->organization = $organization;\n\n\t\t$sql = \"SELECT value, valfmt\n\t\t\t\tFROM `summary_user_vals`\n\t\t\t\tWHERE rowid=\" . $db->quote(4) . \" AND period=\" . $db->quote($period) . \" AND datetime=\" . $db->quote($datetime) . \"\n\t\t\t\tORDER BY colid\";\n\t\t$db->setQuery($sql);\n\t\t$results = $db->loadObjectList();\n\n\t\t$res_iden = 1;\n\t\t$org_iden = 1;\n\n\t\t$i = 0;\n\n\t\t$highest = 1;\n\n\t\tforeach ($results as $row)\n\t\t{\n\t\t\t$i++;\n\n\t\t\tif ($i == 2)\n\t\t\t{\n\t\t\t\t$highest = $row->value;\n\t\t\t}\n\n\t\t\tif ($i == 7)\n\t\t\t{\n\t\t\t\t$highest = $row->value;\n\t\t\t}\n\n\t\t\tif ($row->valfmt == 2 && $highest > 100)\n\t\t\t{\n\t\t\t\t$row->value = number_format(($row->value / $highest) * 100);\n\t\t\t}\n\n\t\t\tswitch ($i)\n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'US',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-res-us'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'Asia',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-res-asia'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'Europe',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-res-europe'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$residence[] = array(\n\t\t\t\t\t\t'column' => 'Other',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-res-other'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 8:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Education',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-org-education'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Industry',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-org-industry'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Government',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-org-government'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\t$organization[] = array(\n\t\t\t\t\t\t'column' => 'Other',\n\t\t\t\t\t\t'value' => $row->value,\n\t\t\t\t\t\t'key' => 'users-downloads-org-other'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$sql = \"SELECT value\n\t\t\tFROM `summary_user_vals`\n\t\t\tWHERE rowid=\" . $db->quote(4) . \" AND period=\" . $db->quote($period) . \" AND datetime=\" . $db->quote($datetime) . \" AND colid=\" . $db->quote(1) . \"\n\t\t\tORDER BY datetime ASC\";\n\t\t$db->setQuery($sql);\n\t\t$result = $db->loadResult();\n\n\t\t$data->downloads = new stdClass;\n\t\t$data->downloads->total = number_format($result);\n\t\t$data->downloads->residence = $residence;\n\t\t$data->downloads->organization = $organization;\n\n\t\t$db->setQuery(\n\t\t\t\"SELECT value\n\t\t\tFROM `summary_simusage_vals`\n\t\t\tWHERE `period` = \" . $db->quote($period) . \"\n\t\t\tAND `rowid`= \" . $db->quote(1) . \"\n\t\t\tAND `datetime`=\" . $db->quote($datetime) . \"\n\t\t\tORDER BY `datetime` ASC\"\n\t\t);\n\t\t$data->simulation_users = number_format($db->loadResult());\n\n\t\t$db->setQuery(\n\t\t\t\"SELECT value\n\t\t\tFROM `summary_simusage_vals`\n\t\t\tWHERE `period` = \" . $db->quote($period) . \"\n\t\t\tAND `rowid`= \" . $db->quote(2) . \"\n\t\t\tAND `datetime`=\" . $db->quote($datetime) . \"\n\t\t\tORDER BY `datetime` ASC\"\n\t\t);\n\t\t$data->simulation_jobs = number_format($db->loadResult());\n\n\t\t$db->setQuery(\n\t\t\t\"SELECT a.label,b.value,b.valfmt,a.plot,a.id\n\t\t\tFROM `summary_simusage` AS a\n\t\t\tINNER JOIN `summary_simusage_vals` AS b\n\t\t\tWHERE a.id=b.rowid AND b.period = \" . $db->quote($period) . \" AND b.datetime = \" . $db->quote($datetime) . \" AND a.id > 2\n\t\t\tORDER BY a.id\"\n\t\t);\n\t\t$data->simulation = $db->loadObjectList();\n\n\t\tforeach ($data->simulation as $key => $sim)\n\t\t{\n\t\t\t$sim->key = 'simulation-' . preg_replace('/[^a-z0-9\\-_]/', '', strtolower($sim->label));\n\t\t\t$sim->value = self::formatValue($sim->value, $sim->valfmt);\n\n\t\t\t$data->simulation[$key] = $sim;\n\t\t}\n\n\t\t//ob_clean();\n\t\techo json_encode($data);\n\t\tdie();\n\t}", "public function getRepeatedObjFieldCount()\n {\n return $this->count(self::REPEATED_OBJ_FIELD);\n }", "function fieldValuesSimplified() {\n\t\t$arrFieldValuesSimplified = array();\n\t\t$fieldValues = $this->fieldValues();\n\t\tforeach ($fieldValues as $fieldID => $fieldVal) {\n\t\t\tif (!isset($arrFieldValuesSimplified[$fieldID])) {\n\t\t\t\t$arrFieldValuesSimplified[$fieldID] = array();\n\t\t\t}\n\t\t\tforeach ($fieldVal as $fieldSubVal) {\n\t\t\t\t$arrFieldValuesSimplified[$fieldID][] = $fieldSubVal['value'];\n\t\t\t}\n\t\t}\n\t\treturn $arrFieldValuesSimplified;\n\t}", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function count()\n {\n return count($this->activeValue);\n }", "static function customerCount( )\n {\n $db = eZDB::instance();\n $countArray = $db->arrayQuery( \"SELECT count( DISTINCT email) AS count FROM ezorder WHERE is_temporary='0'\" );\n return $countArray[0]['count'];\n }" ]
[ "0.5547004", "0.54670084", "0.5460378", "0.54362994", "0.5372136", "0.5359022", "0.533845", "0.53360397", "0.5262029", "0.5257002", "0.52501726", "0.5234169", "0.51985294", "0.51945853", "0.517596", "0.5169639", "0.5145563", "0.5119658", "0.51196253", "0.5096619", "0.5092015", "0.507064", "0.50581926", "0.50509423", "0.50360227", "0.50360227", "0.50360227", "0.5033379", "0.5030337", "0.5028409", "0.49887234", "0.4971518", "0.4969877", "0.4939295", "0.49279025", "0.49219406", "0.4898303", "0.48931575", "0.48762798", "0.48559994", "0.48508543", "0.48496774", "0.48460504", "0.48271242", "0.48246473", "0.48225957", "0.4814467", "0.48143363", "0.48136768", "0.48028097", "0.4794671", "0.47620478", "0.47535855", "0.47459668", "0.47401568", "0.47262573", "0.47258672", "0.4721312", "0.4720031", "0.471727", "0.47132838", "0.47130534", "0.46980888", "0.4693503", "0.4690005", "0.46853542", "0.4677795", "0.46694216", "0.4666725", "0.46637195", "0.465751", "0.46535745", "0.46516076", "0.46472478", "0.46472478", "0.4645584", "0.464157", "0.4625479", "0.46253654", "0.4624704", "0.4621281", "0.4621034", "0.46153682", "0.4593382", "0.45920977", "0.45907336", "0.45805123", "0.4572661", "0.4572303", "0.45703918", "0.45605427", "0.4551462", "0.45505366", "0.4548269", "0.45468295", "0.45452237", "0.45452237", "0.45452237", "0.45316258", "0.45258534" ]
0.549904
1
Updates $field of all adventures where $field = $oldValue to $newValue
public function updateField(Field $field, string $oldValue, string $newValue = null): int { if ($field->isRelatedEntity()) { $adventures = $this->updateRelatedField($field, $oldValue, $newValue); } else { $adventures = $this->updateSimpleField($field, $oldValue, $newValue); } $em = $this->getEntityManager(); $em->flush(); return count($adventures); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updated($field)\n {\n $this->validateOnly($field);\n }", "public function changeField( $field, $key, $value ) {\r\n if ( isset($this->fields[$field]) ) {\r\n $this->fields[$field][$key] = $value;\r\n }\r\n\r\n }", "function update_field($field)\n {\n }", "function update_field($field)\n {\n }", "function update_field($field)\n {\n }", "function update_field($field)\n {\n }", "function field_acfe_update($field){\n \n if(!acf_maybe_get($field, 'acfe_update'))\n return $field;\n \n unset($field['acfe_update']);\n \n return $field;\n \n }", "function acf_update_field($field, $specific = array())\n{\n}", "public function changeField( $table, $old_field, $new_field, $type='', $default=NULL );", "public function updateModifiedFields($event)\n {\n if($this->shouldAddCreatedAndModifiedFields())\n {\n $this->updateFields('update');\n }\n }", "public function delegateChangeField(&$primary_key_processed_by_extension, DbalSchema $dbal_schema, $drupal_table_name, $field_name, $field_new_name, array $drupal_field_new_specs, array $keys_new_specs, array $dbal_column_options);", "protected function _updatefields() {}", "public function valueChanged(ElementInterface $element, $oldValue)\n {\n if (!$this->form->modelAssigned()) {\n return;\n }\n\n $this->form->updateModel($element->name, $element->val());\n // if value on the model has been transformed in some way, assign it back to element\n $modelValue = $this->form->getModel()->{$element->name};\n if ($modelValue != $element->val()) {\n $element->val($modelValue);\n }\n }", "function aeris_team_manager_bidirectional_acf_update_value( $value, $post_id, $field ) {\n\t\n\t// vars\n\t$field_name = $field['name'];\n\t$field_key = $field['key'];\n\t$global_name = 'is_updating_' . $field_name;\n\t\t\n\t// bail early if this filter was triggered from the update_field() function called within the loop below\n\t// - this prevents an inifinte loop\n\tif( !empty($GLOBALS[ $global_name ]) ) return $value;\t\n\t\n\t// set global variable to avoid inifite loop\n\t// - could also remove_filter() then add_filter() again, but this is simpler\n\t$GLOBALS[ $global_name ] = 1;\t\n\t\n\t// loop over selected posts and add this $post_id\n\tif( is_array($value) ) {\n\t\n\t\tforeach( $value as $post_id2 ) {\n\t\t\t\n\t\t\t// load existing related posts\n\t\t\t$value2 = get_field($field_name, $post_id2, false);\t\t\t\n\t\t\t\n\t\t\t// allow for selected posts to not contain a value\n\t\t\tif( empty($value2) ) {\t\t\t\t\n\t\t\t\t$value2 = array();\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// bail early if the current $post_id is already found in selected post's $value2\n\t\t\tif( in_array($post_id, $value2) ) continue;\t\t\t\n\t\t\t\n\t\t\t// append the current $post_id to the selected post's 'related_posts' value\n\t\t\t$value2[] = $post_id;\t\t\t\n\t\t\t\n\t\t\t// update the selected post's value (use field's key for performance)\n\t\t\tupdate_field($field_key, $value2, $post_id2);\t\t\t\n\t\t}\n\t}\n\t\n\t// find posts which have been removed\n\t$old_value = get_field($field_name, $post_id, false);\n\t\n\tif( is_array($old_value) ) {\n\t\t\n\t\tforeach( $old_value as $post_id2 ) {\n\t\t\t\n\t\t\t// bail early if this value has not been removed\n\t\t\tif( is_array($value) && in_array($post_id2, $value) ) continue;\n\t\t\t\n\t\t\t// load existing related posts\n\t\t\t$value2 = get_field($field_name, $post_id2, false);\t\t\t\n\t\t\t\n\t\t\t// bail early if no value\n\t\t\tif( empty($value2) ) continue;\t\t\t\n\t\t\t\n\t\t\t// find the position of $post_id within $value2 so we can remove it\n\t\t\t$pos = array_search($post_id, $value2);\t\t\t\n\t\t\t\n\t\t\t// remove\n\t\t\tunset( $value2[ $pos] );\t\t\t\n\t\t\t\n\t\t\t// update the un-selected post's value (use field's key for performance)\n\t\t\tupdate_field($field_key, $value2, $post_id2);\t\t\t\n\t\t}\t\t\n\t}\n\t// reset global varibale to allow this filter to function as per normal\n\t$GLOBALS[ $global_name ] = 0;\n\t\n\t// return\n return $value;\n \n}", "function update_field( $field ) {\n\n\t\t$fieldKey = $field['key'];\n\n\t\tif ( ! isset( $_POST['acfAddressWidget'][ $fieldKey ] ) ) {\n\t\t\t$fieldKey = $field['ID'];\n\t\t}\n\n\t\t$field['address_options'] = json_decode( stripslashes( $_POST['acfAddressWidget'][ $fieldKey ]['address_options'] ) );\n\t\t$field['address_layout'] = json_decode( stripslashes( $_POST['acfAddressWidget'][ $fieldKey ]['address_layout'] ) );\n\n\t\treturn $field;\n\n\t}", "protected function replaceField(Field $field){\n }", "public function updateField($id_pg, $field, $value, $table=\"pg_view\"){\n\t\t\t//prevede 2 array in ingresso :) \n\t\t\t\n\t\t\t$updateQuery = new Query(); //apro l'oggetto query\n\t\t\t$updateQuery->tables=array($table);\n\t\t\t\n\t\t\t$updateQuery->fields=array($field);\n\t\t\t\n\t\t\t$updateQuery->values=array($value);\n\t\t\t\n\t\t\t$updateQuery->filters=\"id=\".(int)$id_pg;\n\t\t\t\n\t\t\tif($updateQuery->DoUpdate()){\n\t\t\t\t$result = true;\n\t\t\t}else{\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t\t\n\t\t\t$updateQuery->Close();\n\t\t\t\n\t\t\treturn $result;\n\t\t}", "static function save( $new, $old, $post_id, $field ) {\n\n update_post_meta( $post_id, $field[ 'id' ], $new, $old );\n\n $attributes = array_keys( ud_get_wp_property( 'property_stats', array() ) );\n\n foreach( self::$map as $meta ) {\n // Ignore meta if property attribute with the same name exists\n if( isset( $_REQUEST[ $meta ] ) && !in_array( $meta, $attributes ) ) {\n update_post_meta( $post_id, $meta, $_REQUEST[ $meta ] );\n }\n }\n }", "function calculate_changes(&$fields, &$db_rec, &$sage_rec)\n{\n global $FIELD_MAP, $NULLIFY_INSTATE;\n\n $changes = ['notes'=> [], 'abbrevs'=> [], 'sqldata'=> []];\n\n foreach ($fields as $abbr) {\n $dbfld = $FIELD_MAP[$abbr]['db'];\n $sagefld = $FIELD_MAP[$abbr]['sage'];\n $db_val = get($db_rec, $dbfld, 'NULL');\n $sage_val = get($sage_rec, $sagefld, 'NULL');\n if (is_array($sage_val)) {\n $sage_val = get($sage_val, 'district', 'NULL');\n }\n\n if ($db_val != $sage_val) {\n if ($sage_val != 'NULL' || in_array($abbr, $NULLIFY_INSTATE)) {\n // If the SAGE value for the current field is \"null\" (and the original\n // value was not null), then the field will be nullified only if it's\n // one of the four primary district fields (CD, SD, AD, or ED).\n if ($sage_val == 'NULL') {\n $sage_val = 0;\n }\n $changes['abbrevs'][] = $abbr;\n $changes['sqldata'][$dbfld] = $sage_val;\n $changes['notes'][] = \"$abbr:$db_val=>$sage_val\";\n }\n else {\n $changes['notes'][] = \"$abbr:$db_val~=$db_val\";\n }\n }\n else {\n $changes['notes'][] = \"$abbr:$db_val==$sage_val\";\n }\n }\n\n return $changes;\n}", "public function compileUpdates($field = '');", "function update_field( $field ) {\n\t\t\n\t\t// remove sub fields\n\t\tunset($field['sub_fields']);\n\t\t\n\t\t\t\t\n\t\t// return\t\t\n\t\treturn $field;\n\t}", "private function logFieldChanges($strName, $value, $oldval, $oldvalName=\"\")\r\n {\r\n // Log changes\r\n if ($oldval != $value)\r\n {\r\n $oldvalraw = $oldval;\r\n $newvalraw = $value;\r\n\r\n if ($oldvalName)\r\n $oldval = $oldvalName;\r\n\r\n if ($this->getValueNames($strName))\r\n $newval = $this->getValueNames($strName);\r\n else\r\n $newval = $value;\r\n\r\n $this->changelog[$strName] = array(\r\n \"field\"=>$strName,\r\n \"oldval\"=>$oldval,\r\n \"newval\"=>$newval,\r\n \"oldvalraw\"=>$oldvalraw,\r\n \"newvalraw\"=>$newvalraw\r\n );\r\n }\r\n }", "public function replaceField($fieldName, $newField, $dataFieldOnly = true)\n {\n }", "function brag_rest_update_flamingo( $value, $object, $field_name ) {\n \n\tforeach ($value as $field => $data) {\n\t\tupdate_post_meta( $object->ID, $field, $data );\n\t}\n}", "public function updated($field)\n {\n // Solo validamos el campo que genera el update\n $validatedData = $this->validateOnly($field, [\n 'usuario' => 'required',\n 'mensaje' => 'required',\n ]);\n }", "function dbplus_update($relation, $old, $new)\n{\n}", "function updateSetWhere ($tablename, $newFields, $whereClause)\n\t{\n\t\t$schema = $this->getSchema($tablename);\n\t\t$lockfp = $this->getLock($tablename);\n\t\tfor ($i = 0; $i < count($this->tables[$tablename]); ++$i) {\n\t\t\tif ($whereClause === NULL ||\n\t\t\t $whereClause->testRow($this->tables[$tablename][$i], $schema)) {\n\t\t\t\tforeach ($newFields as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t$this->tables[$tablename][$i][$k] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->writeTable($tablename);\n\t\t$this->releaseLock($lockfp);\n\t\t$this->loadTable($tablename);\n\t}", "public function __set($field, $value) {\n\t\tif(array_key_exists($field, $this->_data)) {\n\t\t\t$this->_data[$field] = $value;\n\t\t\t\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$this->_state = self::STATE_CHANGED;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The specified field \"' . $field . '\" was not found.');\n\t\t}\n\t}", "public function setField($field);", "public function setField($field);", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function update_value($value, $post_id, $field)\n {\n }", "function gigblaster_update_gig( $field_array, $id ) {\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . GIGBLASTER_TABLE_NAME;\n return $wpdb->update( $table_name , $field_array, array( 'ID' => $id ) );\n}", "public function propertyChanged($document, $propertyName, $oldValue, $newValue)\n {\n $oid = spl_object_hash($document);\n $class = $this->dm->getClassMetadata(get_class($document));\n\n if ( ! isset($class->fieldMappings[$propertyName])) {\n return; // ignore non-persistent fields\n }\n\n // Update changeset and mark document for synchronization\n $this->documentChangeSets[$oid][$propertyName] = array($oldValue, $newValue);\n if ( ! isset($this->scheduledForDirtyCheck[$class->rootDocumentName][$oid])) {\n $this->scheduleForDirtyCheck($document);\n }\n }", "function setField($field, $value)\n {\n $this->_data[$field] = $value;\n }", "function update($field, $value, $model)\n {\n }", "function updateField($table,$field,$value,$id){\n\n global $db;\n\n $sql = \"UPDATE $table SET $field='$value' WHERE id='$id'\";\n //Basic::EventLog(\"Product->updateField: \".$sql);\n $res =& $db->query($sql);\n return $res;\n\n }", "function changes(&$asset) {\n global $changed;\n $changed = false;\n foreach ($asset[\"metadata\"]->dynamicFields->dynamicField as $dyn) {\n if ($dyn->name == \"audiences\") {\n if (isset($dyn->fieldValues->fieldValue) ) {\n $el = new StdClass();\n $el->value = 'Press Release';\n if ( is_array($dyn->fieldValues->fieldValue) ) {\n if ( !in_array($el, $dyn->fieldValues->fieldValue) ) {\n array_push($dyn->fieldValues->fieldValue, $el);\n $changed = true;\n echo 'added to array';\n } else {\n echo 'Already one of the tags';\n }\n } else {\n if ( $dyn->fieldValues->fieldValue->value != 'Press Release' ) {\n $dyn->fieldValues->fieldValue = array ($dyn->fieldValues->fieldValue);\n array_push($dyn->fieldValues->fieldValue, $el);\n $changed = true;\n echo 'added second tag';\n } else {\n echo 'Already the only tag';\n }\n }\n } else {\n $dyn->fieldValues->fieldValue = new StdClass();\n $dyn->fieldValues->fieldValue->value = 'Press Release';\n $changed = true;\n echo 'added as only tag';\n }\n }\n }\n}", "function update_single_field($table,$set_field,$set_value,$where_field,$where_value)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"UPDATE $table SET $set_field = '$set_value' WHERE $where_field = '$where_value'\";\n\n\t\tif( !$result = $db->sql_query($sql) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Update Garage DB', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\treturn;\n\t}", "public function updateFieldSync($field)\n {\n\t$this->query('update [fields] set [hash] = %s where [name] = %s and [table] = %s',\n\t$field->getHash(),\n\t$field->getName(),\n\t$field->getModel()->GetTableName()\n\t);\n\n\t$this->updateModelSync($field->getModel());\n }", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "public function capture_filter_pre_update_option($new_value, $option_name, $old_value)\n {\n }", "public function update( $field, $value ) {\n\t\tif ( isset($this->ID) ) {\n\t\t\tupdate_post_meta($this->ID, $field, $value);\n\t\t\t$this->$field = $value;\n\t\t}\n\t}", "public function fieldValueChanged($checkfield)\r\n\t{\r\n\t\tif (!is_array($this->changelog))\r\n\t\t\treturn false;\r\n\r\n\t\tforeach ($this->changelog as $fname=>$log) {\r\n\t\t\tif ($fname == $checkfield) {\r\n return true;\r\n }\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "function update_field( $field, $post_id )\n\t{\n\t\t// Note: This function can be removed if not used\n\t\treturn $field;\n\t}", "function update_value( $value, $post_id, $field ) {\n\t\t\n\t\t// bail early if no sub fields\n\t\tif( empty($field['sub_fields']) ) return $value;\n\t\t\n\t\t\n\t\t// vars\n\t\t$new_value = 0;\n\t\t$old_value = (int) acf_get_metadata( $post_id, $field['name'] );\n\t\t\n\t\t\n\t\t// update sub fields\n\t\tif( !empty($value) ) { $i = -1;\n\t\t\t\n\t\t\t// remove acfcloneindex\n\t\t\tif( isset($value['acfcloneindex']) ) {\n\t\t\t\n\t\t\t\tunset($value['acfcloneindex']);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// loop through rows\n\t\t\tforeach( $value as $row ) {\t$i++;\n\t\t\t\t\n\t\t\t\t// bail early if no row\n\t\t\t\tif( !is_array($row) ) continue;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// update row\n\t\t\t\t$this->update_row( $row, $i, $field, $post_id );\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// append\n\t\t\t\t$new_value++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// remove old rows\n\t\tif( $old_value > $new_value ) {\n\t\t\t\n\t\t\t// loop\n\t\t\tfor( $i = $new_value; $i < $old_value; $i++ ) {\n\t\t\t\t\n\t\t\t\t$this->delete_row( $i, $field, $post_id );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// save false for empty value\n\t\tif( empty($new_value) ) $new_value = '';\n\t\t\n\t\t\n\t\t// return\n\t\treturn $new_value;\n\t}", "function update_value($post_id, $field, $value)\n\t{\n\t\t// do stuff with value\n\t\t\n\t\t// save value\n\t\tparent::update_value($post_id, $field, $value);\n\t}", "public function changed($field)\n {\n $origin = $this->findByPk($this->id);\n\n if (!empty($origin))\n $return = ($this->$field !== $origin->$field);\n else\n $return = false;\n \n return $return;\n }", "public function addReplacement ($oldValue, $newValue)\n {\n\n $this->oldValues[] = $oldValue;\n $this->newValues[] = $newValue;\n\n }", "public function set($field, $newVal) {\r\n $newVal = $this->addQuotes($newVal);\r\n $this->sqlSetValues[$field] = $newVal;\r\n return $this;\r\n }", "public function hasChanged($fieldName=null) {}", "function updateProductField($id, $field, $value){\r\n $query = \"UPDATE \".TBL_PRODUCTS.\" SET \".$field.\" = :value WHERE product_id = :id\";\r\n\t $stmt = $this->connection->prepare($query);\r\n\t return $stmt->execute(array(\":value\" => $value, ':id' => $id));\r\n }", "function commerce_product_field_views_data_alter(array &$data, FieldStorageConfigInterface $field_storage) {\n if ($field_storage->getType() == 'entity_reference' && $field_storage->getSetting('target_type') == 'commerce_product_attribute_value') {\n // Due to their nature, attribute fields are always assumed to be limited\n // to a single attribute (== single target bundle).\n $entity_type_id = $field_storage->getTargetEntityTypeId();\n $bundles = $field_storage->getBundles();\n $bundle = reset($bundles);\n $field_name = $field_storage->getName();\n $field = FieldConfig::loadByName($entity_type_id, $bundle, $field_name);\n if (!$field) {\n // There is no field yet, probably because a migration is in progress.\n return;\n }\n $handler_settings = $field->getSetting('handler_settings');\n $target_bundles = array_values($handler_settings['target_bundles']);\n $attribute = reset($target_bundles);\n\n foreach ($data as $table_name => $table_data) {\n foreach ($table_data as $field_name => $field_data) {\n if (isset($field_data['filter']) && $field_name != 'delta') {\n $data[$table_name][$field_name]['filter']['id'] = 'commerce_product_attribute_value';\n $data[$table_name][$field_name]['filter']['attribute'] = $attribute;\n }\n }\n }\n }\n}", "function acf_upgrade_500_field($field)\n{\n}", "public function testUpdateExtraFields(): void { }", "public function testUpdateField()\n {\n $remoteDataFolder = self::$baseRemoteFolderPath . \"/DocumentElements/Fields\";\n $fieldFolder = \"DocumentElements/Fields\";\n $localFileName = \"GetField.docx\";\n $remoteFileName = \"TestUpdateField.docx\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $fieldFolder . \"/\" . $localFileName,\n $remoteDataFolder . \"/\" . $remoteFileName\n );\n\n $requestField = new FieldUpdate(array(\n \"field_code\" => \"{ NUMPAGES }\",\n ));\n $request = new UpdateFieldRequest(\n $remoteFileName,\n 0,\n $requestField,\n \"sections/0/paragraphs/0\",\n $remoteDataFolder,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL\n );\n\n $result = $this->words->updateField($request);\n Assert::assertTrue(json_decode($result, true) !== NULL);\n Assert::assertNotNull($result->getField());\n Assert::assertEquals(\"{ NUMPAGES }\", $result->getField()->getFieldCode());\n Assert::assertEquals(\"0.0.0.0\", $result->getField()->getNodeId());\n }", "function formulize_updateDerivedValues($entry, $fid, $frid=\"\") {\n\t$GLOBALS['formulize_forceDerivedValueUpdate'] = true;\n\tgetData($frid, $fid, $entry);\n\tunset($GLOBALS['formulize_forceDerivedValueUpdate']);\n}", "private function updateValue($field, $value, $message)\n {\n $this->customer->update([$field => $value]);\n\n $this->notify(['title' => __('Updated'), 'message' => __($message)]);\n }", "public function changeFieldType($field)\n {\n\tif ( !$field->getRecastCallback())\n\t{\n\t throw new Exception(\"Unable to recast value as recast callback was not set for field '\".$field->getName().\"'\");\n\t}\n\n\t$builder= PerfORMController::getBuilder('fieldretype');\n\t\n\t$tmpfield= $field->getName().'_'.md5(time());\n\t$template= $builder->getTemplate('field-add');\n\t$fieldInfo= $builder->getField($field);\n\t$fieldInfo->name= $tmpfield;\n\t$fieldInfo->nullable= true;\n\t$template->field= $fieldInfo;\n\tPerfORMController::getBuilder()->addToBuffer($builder->renderTemplate($template), 'alters');\n\t//PerfORMController::getConnection()->nativeQuery($sql);\n\n\t$result= PerfORMController::getConnection()->query('select * from %n',\n\t $field->getModel()->getTableName()\n\t);\n\n\t$pk= $field->getModel()->getPrimaryKey();\n\n\tforeach($result as $row )\n\t{\n\t if ( is_callable($field->getRecastCallback()))\n\t {\n\t\t$value= call_user_func($field->getRecastCallback(), $row);\n\t\tif ( !$field->isNullable() and is_null($value))\n\t\t{\n\t\t throw new Exception(\"Unable to recast null value for field '\".$field->getName().\"' (id=\".$row->{$pk}.\") as field is not null\");\n\t\t}\n\t }\n\t else\n\t {\n\t\tthrow new Exception(\"Unable to recast value for field '\".$field->getName().\"' (id=\".$row->{$pk}.\")\");\n\t }\n\n\t $sql= PerfORMController::getConnection()->sql('update %n set %n = %'.$field->getType().' where %n = %i;',\n\t\t$field->getModel()->getTableName(),\n\t\t$tmpfield,\n\t\t$value,\n\t\t$pk,\n\t\t$row->{$pk}\n\t );\n\t PerfORMController::getBuilder()->addToBuffer($sql, 'alters');\n\t}\n\n\tif (!$field->isNullable())\n\t{\n\t $fieldInfo->nullable= false;\n\t $template= $builder->getTemplate('field-change-nullable');\n\t $template->field= $fieldInfo;\n\t $sql= $builder->renderTemplate($template);\n\t PerfORMController::getBuilder()->addToBuffer($sql, 'alters');\n\t //PerfORMController::getConnection()->nativeQuery($sql);\n\t}\n\n\tPerfORMController::getBuilder()->dropField($field->getName(), $field->getModel());\n\tPerfORMController::getBuilder()->renameField($field, $tmpfield);\n\t$this->updateFieldSync($field);\n }", "protected function saveUpdated() {\n $module_handler = \\Drupal::moduleHandler();\n $storage_controller = \\Drupal::entityManager()->getStorageController($this->entityType);\n\n $original = $storage_controller->loadUnchanged($this->id());\n\n // Some updates are always disallowed.\n if ($this->type != $original->type) {\n throw new FieldException(\"Cannot change an existing field's type.\");\n }\n if ($this->entity_types != $original->entity_types) {\n throw new FieldException(\"Cannot change an existing field's entity_types property.\");\n }\n if ($this->storage['type'] != $original->storage['type']) {\n throw new FieldException(\"Cannot change an existing field's storage type.\");\n }\n\n // Make sure all settings are present, so that a complete field definition\n // is saved. This allows calling code to perform partial updates on field\n // objects.\n $this->settings += $original->settings;\n\n $has_data = field_has_data($this);\n\n // See if any module forbids the update by throwing an exception. This\n // invokes hook_field_update_forbid().\n $module_handler->invokeAll('field_update_forbid', array($this, $original, $has_data));\n\n // Tell the storage engine to update the field by invoking the\n // hook_field_storage_update_field(). The storage engine can reject the\n // definition update as invalid by raising an exception, which stops\n // execution before the definition is written to config.\n $module_handler->invoke($this->storage['module'], 'field_storage_update_field', array($this, $original, $has_data));\n\n // Save the configuration.\n $result = parent::save();\n field_cache_clear();\n\n // Invoke hook_field_update_field() after the cache is cleared for API\n // consistency.\n $module_handler->invokeAll('field_update_field', array($this, $original, $has_data));\n\n return $result;\n }", "public function testChangeAttributeUseFillMethod()\n {\n // set value\n $this->post->tags = 'value1';\n $this->post->save();\n\n // change value\n $this->post->fill([\n 'tags' => $newValue = 'value2'\n ]);\n\n $this->post->save();\n\n // equals\n $this->assertEquals($this->post->tags, $newValue);\n }", "public function fill($new_values): void\n {\n foreach ($this->data['fields'] as $field_name => &$field_value) {\n if (key_exists($field_name, $new_values)) {\n $field_value['value'] = $new_values[$field_name];\n }\n }\n }", "public function setValue($field, $value){\n $this->values[$field] = $value;\n }", "public function updateDouble( Inx_Api_Recipient_Attribute $attr, $fValue );", "public function propertyChanged($entity, $propertyName, $oldValue, $newValue)\n {\n $oid = spl_object_hash($entity);\n $class = $this->manager->getClassMetadata(get_class($entity));\n $isAssocField = $class->hasAssociation($propertyName);\n if (!$isAssocField && !$class->hasField($propertyName)) {\n return; // ignore non-persistent fields\n }\n // Update changeset and mark entity for synchronization\n $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue];\n if (!isset($this->scheduledForSynchronization[$class->getRootEntityName()][$oid])) {\n $this->scheduleForDirtyCheck($entity);\n }\n }", "public function testGetChangeField()\n {\n }", "function acf_flush_field_cache($field)\n{\n}", "function update($table, $items, $field, $key)\n {\n\t\t$this->db->where($field, $key);\n $this->db->update($table, $items);\n }", "public function updated(Saida $saida)\n {\n //\n }", "public function setValue($field, $value) {\n $this->updates[$field] = $value;\n\n return $this;\n }", "public function set($field, $value);", "public function set($field, $value);", "public function updated($field)\n {\n $this->validateOnly($field, [\n 'body' => 'required|min:5'\n ]);\n }", "public function testUpdateFieldOnline()\n {\n $fieldFolder = \"DocumentElements/Fields\";\n\n $requestDocument = realpath(__DIR__ . '/../../..') . '/TestData/' . $fieldFolder . \"/GetField.docx\";\n $requestField = new FieldUpdate(array(\n \"field_code\" => \"{ NUMPAGES }\",\n ));\n $request = new UpdateFieldOnlineRequest(\n $requestDocument,\n $requestField,\n 0,\n \"sections/0/paragraphs/0\",\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL\n );\n\n $result = $this->words->updateFieldOnline($request);\n Assert::assertTrue($result !== NULL);\n }", "public function update_field_group($field_group)\n {\n }", "public function testPutChangeFilterValue() {\n $data = ['nid' => 1, 'delta' => 0];\n $filter = Filter::fromArray(['test' => 'unchanged', 'type' => 'test']);\n $r1 = new Redirect(['label' => 'First', 'filters' => [$filter]] + $data);\n $r1->save();\n\n $fakenode = (object) ['nid' => 1];\n $endpoint = new Endpoint($fakenode, 0);\n\n $data = $endpoint->get();\n $data['redirects'][0]['filters'][0]['test'] = 'changed';\n $new_data = $endpoint->put($data);\n $this->assertEqual($data, $new_data);\n }", "public function setValue($fieldname, $value);", "protected function update(){\n\t\t$this->aggregations = array();\n\t\t\n\t\t// also update any groups\n\t\tforeach($this->getGroups() as $group){\n\t\t\t$group->update();\n\t\t}\n\t}", "public function __set($field, $value){\n if (array_key_exists($field, $this->fields)){\n $this->fields[$field] = $value;\n }\n }", "public function __set($field, $value){\n if (array_key_exists($field, $this->fields)){\n $this->fields[$field] = $value;\n }\n }", "function acf_update_field_group($field_group)\n{\n}", "public function __set($field, $value){\n\t\tif(array_key_exists($field, $this->fields)){\n\t\t\t$this->fields[$field]=$value;\n\t\t}\n\t}", "static function value( $new, $old, $post_id, $field )\n\t\t{\n\t\t\t$new = (array) $new;\n\n\t\t\treturn array_unique( array_merge( $old, $new ) );\n\t\t}", "public function update(array $fields) {\n $changeable = array('name' => 1, 'enabled' => 1, 'description' => 1, 'server' => 1, 'options' => 1, 'read_only' => 1);\n $changed = FALSE;\n foreach ($fields as $field => $value) {\n if (isset($changeable[$field]) && $value !== $this->$field) {\n $this->$field = $value;\n $changed = TRUE;\n }\n }\n\n // If there are no new values, just return 0.\n if (!$changed) {\n return 0;\n }\n\n // Reset the index's internal property cache to correctly incorporate new\n // settings.\n $this->resetCaches();\n\n return $this->save();\n }", "public function update(FieldRequest $request, Field $onefield)\n {\n $startHour = Carbon::create(request('date'))\n ->modify(request('start'));\n\n $endHour = Carbon::create(request('date'))\n ->modify(request('end'));\n\n $hours = Carbon::parse(request('end'))\n ->diff(Carbon::parse(request('start')))\n ->format('%h hora(s) con %i minuto(s)');\n\n $data = [\n 'name' => $request->name,\n 'date' => $request->date,\n 'start' => $startHour,\n 'end' => $endHour,\n 'color' => $request->color,\n 'hour' => $hours,\n 'field_number' => $request->field_number,\n 'user_id' => $request->user_id,\n // 'user_id' => auth()->id(),\n ];\n\n $fields = Field::EventNotAvailableUpdate($startHour, $endHour)->get();\n\n if (count($fields) == 1) {\n\n $onefield->fill($data);\n\n $onefield->save();\n\n return response()->json([\n 'data' => new FieldResource($onefield),\n 'message' => 'Tu reserva fue actualizada!',\n 'title' => 'Muy Bien!',\n 'icon' => 'success',\n 'status' => Response::HTTP_CREATED\n ]);\n }\n\n // VALIDA SI HAY HORAS REPETIDAS\n else {\n return response()->json([\n 'message' => 'La hora elegida está ocupada',\n 'title' => 'Algo Salio Mal!',\n 'icon' => 'error',\n ]);\n }\n }", "public function update() {\n $this->connection->update(\n \"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), array(\"idchangemoney\" => $this->observer->idchangemoney), $this->user->iduser\n );\n }", "public function populateChangedFieldsList($attendeeFromSource, $attendeeSaved){\n $pf_map = array(\n 'emailAddress' => 'email_address',\n 'additionalInfo' => 'additional_info',\n 'regionName' => 'region_name',\n 'category' => 'category',\n 'emailSent' => 'email_sent',\n );\n\n if (!is_array($attendeeFromSource->changedFields)) {\n $attendeeFromSource->changedFields = array();\n }\n\n foreach($pf_map as $property => $field){\n switch($property){\n case 'emailSent':\n if ((int)$attendeeSaved->{$field} != 1){\n $attendeeFromSource->changedFields[$property] = array(\n 'old' => $attendeeSaved->{$field},\n 'new' => -1, // another attempt -- if successful will be set to 1\n );\n }\n break;\n default:\n if ($attendeeFromSource->{$property} != $attendeeSaved->{$field}){\n $attendeeFromSource->changedFields[$property] = array(\n 'old' => $attendeeSaved->{$field},\n 'new' => $attendeeFromSource->{$property},\n );\n }\n break;\n }\n }\n }", "public function updated(HoldAmount $holdAmount)\n {\n //\n }" ]
[ "0.59827757", "0.5902715", "0.5806615", "0.5806615", "0.5806615", "0.5806615", "0.56174934", "0.55780625", "0.55634713", "0.55141807", "0.5449993", "0.5382495", "0.5378881", "0.53189903", "0.5308761", "0.5303023", "0.5264805", "0.5233528", "0.5233083", "0.5224892", "0.52201027", "0.5178452", "0.51783836", "0.5174152", "0.5160919", "0.51591593", "0.51304966", "0.5116332", "0.5107177", "0.5107177", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5104697", "0.5085954", "0.50856864", "0.5073551", "0.5058281", "0.5057623", "0.50509685", "0.50471115", "0.5040953", "0.50381655", "0.5036296", "0.50228983", "0.50055295", "0.4974032", "0.49725792", "0.4949069", "0.49376592", "0.49305525", "0.49285096", "0.49172115", "0.4908724", "0.48966712", "0.48937082", "0.48934707", "0.48917827", "0.48731285", "0.48522422", "0.48501673", "0.48343515", "0.4831967", "0.4823136", "0.48192072", "0.48162204", "0.48116198", "0.479726", "0.4797113", "0.47937766", "0.47830954", "0.47791737", "0.47784823", "0.47784823", "0.4776795", "0.47735715", "0.47712386", "0.47658685", "0.47616893", "0.47595033", "0.47583362", "0.47583362", "0.47519815", "0.47425506", "0.47404984", "0.4722222", "0.47201598", "0.47186673", "0.47124964", "0.4708355" ]
0.67478013
0
Each of element must have valid version number (example: 1.0.1)
protected function runMigration(array $migrations, Processor $conn) { $migrations = array_filter($migrations, function ($v, $k) { return preg_match("/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)/", $k); }, ARRAY_FILTER_USE_BOTH); uksort($migrations, function ($a, $b) { return version_compare($a, $b) >= 0; }); foreach ($migrations as $v => $callback) { $callback($conn); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateVersion()\n {\n return preg_match('/[0-99]+\\.[0-99]+\\.[0-99]+.*/', $this->version);\n }", "public function validVersionNumberDataProvider() {}", "public function testValidVersionString(): void\n\t{\n\t\t$version = Version::createFromString('40306');\n\t\t$this->assertEquals(4, $version->major);\n\t\t$this->assertEquals(3, $version->minor);\n\t\t$this->assertEquals(6, $version->patch);\n\t}", "public function versionIsInvalid(string $version): void;", "private function isValidVersionNumber($version) {\n if(strpos($version, '.') !== false) {\n $parts = explode('.', $version);\n \n if(count($parts) == 3) {\n foreach($parts as $part) {\n if(!is_numeric($part)) {\n return false;\n } // if\n } // foreach\n \n return true;\n } else {\n return false;\n } // if\n } else {\n return false;\n } // if\n }", "public function invalidVersionNumberDataProvider() {}", "protected function validateVersionNumber($version) {\n\t\tif (1 !== preg_match('/^[\\\\d]{1,2}\\.[\\\\d]{1,2}\\.[\\\\d]{1,2}$/i', $version)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'Invalid version number \"' . $version . '\" detected from tag, aborting upload',\n\t\t\t\t1426360822\n\t\t\t);\n\t\t}\n\t}", "public function testUnparsableCoreVersionRequirement() {\n $unparsable_core_version_requirement = <<<UNPARSABLE_CORE_VERSION_REQUIREMENT\n# info.yml for testing invalid core_version_requirement value.\nname: Not this module\ndescription: 'Not the module you are looking for.'\npackage: Core\ntype: module\nversion: VERSION\ncore_version_requirement: not-this-version\nUNPARSABLE_CORE_VERSION_REQUIREMENT;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n 'unparsable_core_version_requirement.info.txt' => $unparsable_core_version_requirement,\n ],\n ]);\n $this->expectException(InfoParserException::class);\n $this->expectExceptionMessage(\"The 'core_version_requirement' constraint (not-this-version) is not a valid value in vfs://modules/fixtures/unparsable_core_version_requirement.info.txt\");\n $this->infoParser->parse(vfsStream::url('modules/fixtures/unparsable_core_version_requirement.info.txt'));\n }", "function getValidSchemaVersions($a_entity)\r\n\t{\r\n\t\treturn array (\r\n\t\t\t\"4.3.0\" => array(\r\n\t\t\t\t\"namespace\" => \"http://www.ilias.de/Services/Help/help/4_3\",\r\n\t\t\t\t\"xsd_file\" => \"ilias_help_4_3.xsd\",\r\n\t\t\t\t\"uses_dataset\" => true,\r\n\t\t\t\t\"min\" => \"4.3.0\",\r\n\t\t\t\t\"max\" => \"\")\r\n\t\t);\r\n\t}", "public function testSpecificationVersion() {\n $this->assertEquals(1.0, $this->object->get_specificationVersion());\n $this->assertTrue($this->object->isset_specificationVersion());\n\n $this->object->set_specificationVersion(1.1);\n $this->assertEquals(1.1, $this->object->get_specificationVersion());\n\n $this->object->set_specificationVersion(NULL);\n $this->assertFalse($this->object->isset_specificationVersion());\n }", "public function testInvalidVersionNumber(): void\n\t{\n\t\t$this->expectException(LycheeInvalidArgumentException::class);\n\t\tVersion::createFromInt(1000000);\n\t}", "public function testAddVersion()\n {\n $this->document->addJsonApiVersion('1.0', ['some' => 'meta']);\n $this->document->unsetData();\n\n $expected = <<<EOL\n {\n \"jsonapi\":{\n \"version\" : \"1.0\",\n \"meta\" : { \"some\" : \"meta\" }\n }\n }\nEOL;\n $this->check($expected);\n }", "function w_parse_version($version) {\n $versionList = [];\n if (is_string($version)) {\n $rawVersionList = explode('.', $version);\n if (isset($rawVersionList[0])) {\n $versionList[] = $rawVersionList[0];\n }\n if (isset($rawVersionList[1])) {\n $versionList[] = $rawVersionList[1];\n }\n }\n return $versionList;\n}", "function verify_version($version) // Colorize: green\n { // Colorize: green\n return isset($version) // Colorize: green\n && // Colorize: green\n is_int($version) // Colorize: green\n && // Colorize: green\n $version >= 20190101000000 // Colorize: green\n && // Colorize: green\n $version <= 99999999999999; // Colorize: green\n }", "function owa_parse_version($version) {\r\n\t\r\n\t$version_array = explode(\".\", $version);\r\n \r\n return $version_array;\r\n\t\r\n}", "public function checkValidVersion(string $version): void\n {\n if (!$this->validVersions->contains($version)) {\n throw WrapperException::instance(\"invalid version for notion-api\", ['invalidVersion' => $version]);\n }\n }", "public static function is_valid_version_format($version) {\n\t\t\tif (!empty($version)) {\n\t\t\t\t$parts = explode(\".\", $version);\n\t\t\t\tif (!empty($parts) && count($parts) === 3) {\n\t\t\t\t\t$all_are_numeric = true;\n\t\t\t\t\tforeach ($parts as $part) {\n\t\t\t\t\t\tif (!is_numeric($part)) {\n\t\t\t\t\t\t\t$all_are_numeric = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $all_are_numeric;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function getSpecifiedVersion();", "public function testInvalidVersionString(): void\n\t{\n\t\t$this->expectException(LycheeInvalidArgumentException::class);\n\t\tVersion::createFromString('1000000');\n\t}", "private function validateVersionNumber($version)\n\t{\n\t\treturn preg_match('/\\d+(?:\\.\\d+)+/', $version, $matches) ? $matches[0] : false;\n\t}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "function alertcloud_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 126) {\n return false;\n }\n return true;\n}", "function versionCheck($template) {\n\tglobal $communitySettings;\n\n\tif ( $template['MinVer'] && ( version_compare($template['MinVer'],$communitySettings['unRaidVersion']) > 0 ) ) return false;\n\tif ( $template['MaxVer'] && ( version_compare($template['MaxVer'],$communitySettings['unRaidVersion']) < 0 ) ) return false;\n\treturn true;\n}", "function s2_clean_version($version)\n{\n return preg_replace('/(\\.0)+(?!\\.)|(\\.0+$)/', '$2', $version);\n}", "function birdseye_component_checkversion()\n{\n if (!function_exists('get_product_release'))\n return false;\n if (get_product_release() < 207)\n return false;\n\n return true;\n}", "public static function getVersionParts() {\n preg_match('/^(?:(\\d+)\\.)?(?:(\\d+)\\.)?(?:(\\d+)\\.)?/', self::getVersion(), $matches);\n // Remove the full match.\n array_shift($matches);\n // Provide default values for major, minor and patch versions.\n $matches += [NULL, NULL, NULL];\n\n return $matches;\n }", "public function fakeVersion();", "abstract public function version();", "abstract public function version();", "private function getTestVersion()\n {\n static $arrTestVersions = array();\n\n $default = array(null, null);\n $testVersion = trim(PHPCSHelper::getConfigData('testVersion'));\n\n if (empty($testVersion) === false && isset($arrTestVersions[$testVersion]) === false) {\n\n $arrTestVersions[$testVersion] = $default;\n\n if (preg_match('`^\\d+\\.\\d+$`', $testVersion)) {\n $arrTestVersions[$testVersion] = array($testVersion, $testVersion);\n return $arrTestVersions[$testVersion];\n }\n\n if (preg_match('`^(\\d+\\.\\d+)?\\s*-\\s*(\\d+\\.\\d+)?$`', $testVersion, $matches)) {\n if (empty($matches[1]) === false || empty($matches[2]) === false) {\n // If no lower-limit is set, we set the min version to 4.0.\n // Whilst development focuses on PHP 5 and above, we also accept\n // sniffs for PHP 4, so we include that as the minimum.\n // (It makes no sense to support PHP 3 as this was effectively a\n // different language).\n $min = empty($matches[1]) ? '4.0' : $matches[1];\n\n // If no upper-limit is set, we set the max version to 99.9.\n $max = empty($matches[2]) ? '99.9' : $matches[2];\n\n if (version_compare($min, $max, '>')) {\n trigger_error(\n \"Invalid range in testVersion setting: '\" . $testVersion . \"'\",\n \\E_USER_WARNING\n );\n return $default;\n } else {\n $arrTestVersions[$testVersion] = array($min, $max);\n return $arrTestVersions[$testVersion];\n }\n }\n }\n\n trigger_error(\n \"Invalid testVersion setting: '\" . $testVersion . \"'\",\n \\E_USER_WARNING\n );\n return $default;\n }\n\n if (isset($arrTestVersions[$testVersion])) {\n return $arrTestVersions[$testVersion];\n }\n\n return $default;\n }", "protected function looksLikeVersion($name) {\n\t\t\t//Tag names may be prefixed with \"v\", e.g. \"v1.2.3\".\n\t\t\t$name = ltrim($name, 'v');\n\n\t\t\t//The version string must start with a number.\n\t\t\tif ( !is_numeric(substr($name, 0, 1)) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//The goal is to accept any SemVer-compatible or \"PHP-standardized\" version number.\n\t\t\treturn (preg_match('@^(\\d{1,5}?)(\\.\\d{1,10}?){0,4}?($|[abrdp+_\\-]|\\s)@i', $name) === 1);\n\t\t}", "public function testVersion()\r\n {\r\n $version = '2.1';\r\n $this->vcard->setVersion($version);\r\n\r\n $this->assertSame(\"VERSION:{$version}\", $this->vcard->getVersion());\r\n }", "function verify_version_for_user($version) // Colorize: green\n { // Colorize: green\n return isset($version) // Colorize: green\n && // Colorize: green\n is_int($version) // Colorize: green\n && // Colorize: green\n $version >= 20190101 // Colorize: green\n && // Colorize: green\n $version <= 99999999; // Colorize: green\n }", "protected function checkPcreVersion() {}", "abstract public function getVersion();", "abstract public function getVersion();", "abstract public function getVersion();", "abstract public function getVersion();", "public function convertVersionsStringToVersionNumbersForcesVersionNumberInRangeDataProvider() {}", "abstract public function get_version();", "public function testCoreVersionRequirementInvalid($test_case, $constraint) {\n $invalid_core_version_requirement = <<<INVALID_CORE_VERSION_REQUIREMENT\n# info.yml for core_version_requirement validation.\nname: Gracie Evaluator\ndescription: 'Determines if Gracie is a \"Good Dog\". The answer is always \"Yes\".'\npackage: Core\ntype: module\nversion: VERSION\ncore_version_requirement: '$constraint'\ndependencies:\n - goodness_api\nINVALID_CORE_VERSION_REQUIREMENT;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n \"invalid_core_version_requirement-$test_case.info.txt\" => $invalid_core_version_requirement,\n \"invalid_core_version_requirement-$test_case-duplicate.info.txt\" => $invalid_core_version_requirement,\n ],\n ]);\n $exception_message = \"The 'core_version_requirement' can not be used to specify compatibility for a specific version before 8.7.7 in vfs://modules/fixtures/invalid_core_version_requirement-$test_case\";\n // Set the expected exception for the 2nd call to parse().\n $this->expectException('\\Drupal\\Core\\Extension\\InfoParserException');\n $this->expectExceptionMessage(\"$exception_message-duplicate.info.txt\");\n try {\n $this->infoParser->parse(vfsStream::url(\"modules/fixtures/invalid_core_version_requirement-$test_case.info.txt\"));\n }\n catch (InfoParserException $exception) {\n $this->assertSame(\"$exception_message.info.txt\", $exception->getMessage());\n\n $this->infoParser->parse(vfsStream::url(\"modules/fixtures/invalid_core_version_requirement-$test_case-duplicate.info.txt\"));\n }\n }", "public function versioningMgm() {}", "function plugin_version_satisfactionsmiley() {\n return ['name' => 'SatisfactionSmiley',\n 'shortname' => 'satisfactionsmiley',\n 'version' => PLUGIN_SATISFACTIONSMILEY_VERSION,\n 'license' => 'AGPLv3+',\n 'author' => '<a href=\"mailto:[email protected]\">David DURIEUX</a>',\n 'homepage' => 'https://github.com/',\n 'requirements' => [\n 'glpi' => [\n 'min' => '9.5',\n 'max' => '9.6',\n 'dev' => '9.5+1.0' == 0\n ],\n ]\n ];\n}", "public function setVersion($version) {}", "public function setVersion($version) {}", "protected function parseVersion(string $version): bool\n {\n if (! preg_match('/\\\\d+\\\\.\\\\d+\\\\.\\\\d+/u', $version)) {\n return false;\n }\n\n $this->version = $version;\n\n [$this->major, $this->minor, $this->patch] = array_map('intval', explode('.', $this->version));\n\n return true;\n }", "public function testDoNotAllowNonEqualVersion()\n {\n $constraint = new EqualTo($this->createVersion(1));\n\n self::assertFalse(\n $constraint->allows($this->createVersion(4)),\n 'The versions 1.0.0 and 4.0.0 should not be equal.'\n );\n }", "protected function _version_check()\n\t{\n\t\tee()->load->library('el_pings');\n\t\t$version_file = ee()->el_pings->get_version_info();\n\n\t\tif ( ! $version_file)\n\t\t{\n\t\t\tee('CP/Alert')->makeBanner('notices')\n\t\t\t\t->asWarning()\n\t\t\t\t->withTitle(lang('cp_message_warn'))\n\t\t\t\t->addToBody(sprintf(\n\t\t\t\t\tlang('new_version_error'),\n\t\t\t\t\tee()->cp->masked_url(DOC_URL.'troubleshooting/error_messages/unexpected_error_occurred_attempting_to_download_the_current_expressionengine_version_number.html')\n\t\t\t\t))\n\t\t\t\t->now();\n\t\t}\n\t}", "protected function checkVersion(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Version) && $this->_Version !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Version} is not a valid value for Version\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "public static function createFromVersionString(string $version_string): ExtensionVersion {\n $original_version = $version_string;\n if (strpos($version_string, static::CORE_PREFIX) === 0 && $version_string !== '8.x-dev') {\n $version_string = preg_replace('/8\\.x-/', '', $version_string, 1);\n }\n else {\n // Ensure the version string has no unsupported core prefixes.\n $dot_x_position = strpos($version_string, '.x-');\n if ($dot_x_position === 1 || $dot_x_position === 2) {\n $after_core_prefix = explode('.x-', $version_string)[1];\n if ($after_core_prefix !== 'dev') {\n throw new \\UnexpectedValueException(\"Unexpected version core prefix in $version_string. The only core prefix expected in \\Drupal\\Core\\Extension\\ExtensionVersion is: 8.x-\");\n }\n }\n }\n $version_parts = explode('.', $version_string);\n $major_version = $version_parts[0];\n $version_parts_count = count($version_parts);\n if ($version_parts_count === 2) {\n $minor_version = NULL;\n }\n elseif ($version_parts_count === 3) {\n $minor_version = $version_parts[1];\n }\n $last_part_split = explode('-', $version_parts[count($version_parts) - 1]);\n $version_extra = count($last_part_split) === 1 ? NULL : $last_part_split[1];\n if ($version_parts_count > 3\n || $version_parts_count < 2\n || !is_numeric($major_version)\n || ($version_parts_count === 3 && !is_numeric($version_parts[1]))\n // The only case where a non-numeric version part other the extra part is\n // allowed is in development versions like 8.x-1.x-dev, 1.2.x-dev or\n // 1.x-dev.\n || (!is_numeric($last_part_split[0]) && $last_part_split !== 'x' && $version_extra !== 'dev')) {\n throw new \\UnexpectedValueException(\"Unexpected version number in: $original_version\");\n }\n return new static($major_version, $minor_version, $version_extra);\n }", "public function version();", "public function version();", "public function version();", "public function version();", "public function version();", "public function get_version();", "public function testFailParseErrorJsonRpcVersion()\n {\n $request = Request::create(\n '/test',\n 'POST',\n [],\n [],\n [],\n [],\n '{\"jsonrpc\":\"1.0\",\"method\":\"ruth_rpc.service_test:foo\",\"params\":{\"x\":1,\"y\":2},\"id\":\"2957f28d-8797-42b1-bd5d-45834b3202d\"}'\n );\n\n $result = $this->controller->execute($request);\n\n $this->assertInstanceOf(\n JsonRpcResponseError::class,\n $result\n );\n\n $this->assertEquals(\n '{\"jsonrpc\":\"2.0\",\"error\":{\"code\":\"-32700\",\"message\":\"Parse error\",\"data\":\"Invalid Request: json-rpc version is not 2.0\"},\"id\":null}',\n $result->getContent()\n );\n }", "public function testCoreVersionRequirement88() {\n $core_version_requirement = <<<BOTH_CORE_VERSION_REQUIREMENT\n# info.yml for testing core and core_version_requirement keys.\npackage: Core\ncore_version_requirement: ^8.8\nversion: VERSION\ntype: module\nname: Module for That\ndependencies:\n - field\nBOTH_CORE_VERSION_REQUIREMENT;\n\n vfsStream::setup('modules');\n foreach (['1', '2'] as $file_delta) {\n $filename = \"core_version_requirement-$file_delta.info.txt\";\n vfsStream::create([\n 'fixtures' => [\n $filename => $core_version_requirement,\n ],\n ]);\n $info_values = $this->infoParser->parse(vfsStream::url(\"modules/fixtures/$filename\"));\n $this->assertSame($info_values['core_version_requirement'], '^8.8', \"Expected core_version_requirement for file: $filename\");\n }\n }", "public function versionIsValid($version)\n {\n if (version_compare($version, 5.3, '>=')) {\n return true;\n }\n\n return false;\n }", "public function page_check_version()\n\t{\n\t\tif (!$content = Http::get_file_on_server(FSB_REQUEST_SERVER, FSB_REQUEST_VERSION, 10))\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\t$content = explode(\"\\n\", $content);\n\n\t\tif (count($content) < 3)\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\tif (strpos('http', $content[2]) === false)\n\t\t{\n\t\t\tarray_shift($content);\n\t\t}\n\n\t\t@list($last_version, $url, $level) = $content;\n\t\t$last_version = trim($last_version);\n\n\t\t// Aucune redirection\n\t\tFsb::$session->data['u_activate_redirection'] = 2;\n\n\t\tif (!is_last_version(Fsb::$cfg->get('fsb_version'), $last_version))\n\t\t{\n\t\t\tDisplay::message(sprintf(Fsb::$session->lang('adm_old_version'), $last_version, Fsb::$cfg->get('fsb_version'), $url, $url, Fsb::$session->lang('adm_version_' . trim($level))) . '<br /><br />' . sprintf(Fsb::$session->lang('adm_click_view_newer'), $url));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDisplay::message('adm_version_ok', 'index.' . PHPEXT, 'index_adm');\n\t\t}\n\t}", "function checkVersion($version)\n {\n return version_compare($this->getVersion(), $version, 'lt');\n }", "public static function split_version($version) {\n $version_parts = explode('.', $version);\n if (count($version_parts) !== 3) {\n return FALSE;\n }\n\n return (object) array(\n 'major' => (int) $version_parts[0],\n 'minor' => (int) $version_parts[1],\n 'patch' => (int) $version_parts[2]\n );\n }", "function mapVersions($element)\n {\n $matches = array();\n preg_match('/[\\/\\\\\\]+' . $this->_libPrefix . '(\\d+[\\w\\.]+)\\.js$/', $element, $matches);\n return array_pop($matches);\n }", "public function compatVersionConditionMatchesOlderRelease() {}", "public function compatVersionConditionMatchesOlderRelease() {}", "public function testCoreCoreVersionRequirement88() {\n $core_and_core_version_requirement_88 = <<<BOTH_CORE_CORE_VERSION_REQUIREMENT_88\n# info.yml for testing core and core_version_requirement keys.\npackage: Core\ncore: 8.x\ncore_version_requirement: ^8.8\nversion: VERSION\ntype: module\nname: Form auto submitter\ndependencies:\n - field\nBOTH_CORE_CORE_VERSION_REQUIREMENT_88;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n 'core_and_core_version_requirement_88.info.txt' => $core_and_core_version_requirement_88,\n 'core_and_core_version_requirement_88-duplicate.info.txt' => $core_and_core_version_requirement_88,\n ],\n ]);\n $exception_message = \"The 'core_version_requirement' constraint (^8.8) requires the 'core' key not be set in vfs://modules/fixtures/core_and_core_version_requirement_88\";\n // Set the expected exception for the 2nd call to parse().\n $this->expectException('\\Drupal\\Core\\Extension\\InfoParserException');\n $this->expectExceptionMessage(\"$exception_message-duplicate.info.txt\");\n try {\n $this->infoParser->parse(vfsStream::url('modules/fixtures/core_and_core_version_requirement_88.info.txt'));\n }\n catch (InfoParserException $exception) {\n $this->assertSame(\"$exception_message.info.txt\", $exception->getMessage());\n\n $this->infoParser->parse(vfsStream::url('modules/fixtures/core_and_core_version_requirement_88-duplicate.info.txt'));\n }\n }", "public function compatVersionConditionMatchesSameRelease() {}", "public function compatVersionConditionMatchesSameRelease() {}", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "function test6() {\n global $pd;\n $file3 = $pd->GetFile(\"test\");\n return check_test(count($file3), 2, \"Not all versions present\");\n}", "function alertstream_component_checkversion()\n{\n if(!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 500) {\n return false;\n }\n return true;\n}", "private static function parseVersions($versionDefinition)\n {\n static $regex = '/\n (?<!(?:<|>|\\.|\\d)) # Does not start with \"<\", \">\", \".\" or a number\n # that means it may be \">=7.1\", \"<=7.1\", \"7.1\" but cannot be \">7.1\" nor \"<7.1\"\n # We also eliminate partial matches ignoring stuff starting with\n # a number or a dot \".\", so that \">7.1.25\" does not become \"1.25\" nor \"5\"\n\n (?<version>\\d+(?:\\.\\d+(?:\\.\\d+)?)?)\n /x';\n\n if (\n preg_match_all($regex, $versionDefinition, $matches)\n && isset($matches['version'])\n && count($matches['version'])\n ) {\n $versions = $matches['version'];\n\n usort($versions, static function ($a, $b) {\n $af = floatval($a);\n $bf = floatval($b);\n\n if ($af < $bf) {\n return -1;\n } elseif ($af > $bf) {\n return 1;\n } else {\n if ($a < $b) {\n return -1;\n } elseif ($a > $b) {\n return 1;\n } else {\n return 0;\n }\n }\n });\n\n return $versions;\n } else {\n return [];\n }\n }", "public function version($check = null);", "public function testVersionCompare(): void\n {\n $bag = Bag::create($this->tmpdir);\n $method = $this->getReflectionMethod('\\whikloj\\BagItTools\\Bag', 'compareVersion');\n\n // Current version is 1.0\n $this->assertEquals(-1, $method->invokeArgs($bag, ['0.97']));\n $this->assertEquals(0, $method->invokeArgs($bag, ['1.0']));\n $this->assertEquals(1, $method->invokeArgs($bag, ['1.1']));\n }", "function admin_check_version()\n{\n global $app, $globalSettings;\n $versionAnswer = [];\n $contents = file_get_contents(VERSION_URL);\n if ($contents == false) {\n $versionClass = 'error';\n $versionAnswer = sprintf(getMessageString('admin_new_version_error'), $globalSettings['version']);\n } else {\n $versionInfo = json_decode($contents);\n $version = $globalSettings['version'];\n if (strpos($globalSettings['version'], '-') === false) {\n $v = preg_split('/-/', $globalSettings['version']);\n $version = $v[0];\n }\n $result = version_compare($version, $versionInfo->{'version'});\n if ($result === -1) {\n $versionClass = 'success';\n $msg1 = sprintf(getMessageString('admin_new_version'), $versionInfo->{'version'}, $globalSettings['version']);\n $msg2 = sprintf(\"<a href=\\\"%s\\\">%s</a>\", $versionInfo->{'url'}, $versionInfo->{'url'});\n $msg3 = sprintf(getMessageString('admin_check_url'), $msg2);\n $versionAnswer = $msg1 . '. ' . $msg3;\n } else {\n $versionClass = '';\n $versionAnswer = sprintf(getMessageString('admin_no_new_version'), $globalSettings['version']);\n }\n }\n $app->render('admin_version.html', [\n 'page' => mkPage(getMessageString('admin_check_version'), 0, 2),\n 'versionClass' => $versionClass,\n 'versionAnswer' => $versionAnswer,\n 'isadmin' => true,\n ]);\n}", "public function testAllowAnEqualVersion()\n {\n $constraint = new EqualTo($this->createVersion(1, 2, 3));\n\n self::assertTrue(\n $constraint->allows($this->createVersion(1, 2, 3)),\n 'The versions 1.2.3 and 1.2.3 should be equal.'\n );\n }", "public static function isStable()\n {\n return (bool) preg_match('/^[0-9\\.]+$/', static::VERSION);\n }", "public function test_library_version() {\n\t\t$path = route('v2_api_versionLatest',[],false);\n\t\t$params = implode('&', array_map(function ($v, $k) { return sprintf(\"%s=%s\", $k, $v); }, $this->params, array_keys($this->params)));\n\n\t\t$this->log(\"\\nTesting: \" . route('v2_api_versionLatest', $this->params),'light_cyan',true);\n\t\t$response = $this->get(route('v2_api_versionLatest'), $this->params);\n\t\t$response->assertSuccessful();\n\t\t$response->assertJsonStructure($this->getSchemaKeys('v2_api_versionLatest'));\n\t\t$this->compareToOriginal($path,$this->getSchemaKeys('v2_api_versionLatest'));\n\t}", "public function getAllowedVersions()\n {\n return $this->allowedVersions;\n }", "public function dataVersions()\n {\n return array(\n array('1.0.0', 1000050),\n array('2.0.0.2-dev', 2000002),\n array('3.4.2.1', 3040251),\n array('3.4.2-dev3', 3040203),\n array('3.4.2-dev', 3040200),\n array('3.4.2-pl', 3040260),\n array('3.4.2-pl3', 3040263),\n array('4.4.2-rc22', 4040252),\n array('4.4.2-rc', 4040230),\n array('4.4.22-beta22', 4042242),\n array('4.4.22-beta', 4042220),\n array('4.4.21-alpha22', 4042132),\n array('4.4.20-alpha', 4042010),\n array('4.40.20-alpha-dev', 4402010),\n array('4.4a', 4000050),\n array('4.4.4-test', 4040400),\n array('4.1.0', 4010050),\n array('4.0.1.3', 4000153),\n array('4.1-dev', 4010000),\n );\n }", "public function setVersion(string $version);", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();" ]
[ "0.7218646", "0.6905127", "0.6869545", "0.64904386", "0.64318305", "0.6399962", "0.63894886", "0.6359521", "0.6235395", "0.61884886", "0.61189806", "0.61177087", "0.6115376", "0.61144876", "0.6054213", "0.5975015", "0.5965742", "0.5943503", "0.59342664", "0.5913917", "0.5872457", "0.5872021", "0.585977", "0.5852043", "0.58517396", "0.5839409", "0.5775722", "0.57715446", "0.5762612", "0.5762612", "0.5762066", "0.57263625", "0.5686676", "0.5677464", "0.5632288", "0.5629755", "0.5629755", "0.5629755", "0.5629755", "0.5601308", "0.5592452", "0.55681074", "0.55654323", "0.55325824", "0.5524132", "0.5524132", "0.5523609", "0.5511928", "0.5505295", "0.54957783", "0.54844123", "0.5478077", "0.5478077", "0.5478077", "0.5478077", "0.5478077", "0.5475351", "0.54715776", "0.54653805", "0.5460115", "0.5441554", "0.5441157", "0.54358447", "0.54261696", "0.54247344", "0.5424427", "0.54213774", "0.5419051", "0.5418115", "0.5413818", "0.5413818", "0.5413818", "0.5413818", "0.5413818", "0.54094535", "0.54056835", "0.5403232", "0.540211", "0.53976667", "0.5392455", "0.5386665", "0.5382903", "0.5350341", "0.5340349", "0.5336861", "0.5334255", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263", "0.5326263" ]
0.0
-1
Lists all Question entities.
public function indexAction($page) { $em = $this->getDoctrine()->getManager(); $entities = $em->getRepository('QuizmooQuestionnaireBundle:Question')->findAll(); return $this->render('QuizmooQuestionnaireBundle:Question:index.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entities' => $entities, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CdlrcodeBundle:Question')->findAll();\n\n return $this->render('CdlrcodeBundle:Question:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index(){\n return new QuestionCollection(Question::all());\n }", "public function index()\n {\n return new QuestionCollection(Question::paginate(10));\n }", "public static function getAll() {\n \treturn Question::whereNull('deleted_at')->get();\n }", "public function index()\n {\n return Question::latest()->paginate(90);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CompeteComBundle:StudyQuestions')->findAll();\n\n return $this->render('CompeteComBundle:StudyQuestions:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function getQuestions()\n {\n $title = \"Questions\";\n $subtitle = \"Here you will find all the questions!\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the questions\n $questions = $this->di->get(\"questionModel\")->getQuestions();\n\n // Get number of answers\n $answers = [];\n foreach ($questions as $question) {\n $ans = $this->di->get(\"answerModel\")->getAnswersWhere(\"questionId\", $question->id);\n $answers[$question->id] = count($ans);\n }\n\n $data = [\n \"questions\" => $questions,\n \"subtitle\" => $subtitle,\n \"noOfAnswers\" => $answers,\n ];\n\n $view->add(\"pages/questions\", $data);\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function show(Questions $questions)\n {\n //\n }", "public function index(Question $question){\n return $question->answers()->with('user')->simplePaginate(3);\n }", "public function index()\n {\n $questions = Question::all();\n return view('admin/question/listing',compact('questions'));\n }", "public function index()\n {\n //\n $questions = Question::all();\n\n return view('admin.questions.all', ['questions' => $questions]);\n }", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "public function viewQuestionsAction() {\n\n $all = $this->comments->findAll();\n\n $res = [];\n foreach ($all as $value) {\n if ($this->commentanswer->isAnswer($value->id) == null) {\n $res[] = $value;\n }\n }\n\n /**\n * Alter object by connecting comment tags, adding user information from the database and filtering markdown on the comment object.\n */\n $res = $this->doAll($res);\n\n /**\n * Prepare the view.\n */\n $this->views->add('comment/commentsdb', [\n 'comments' => $res,\n 'title' => 'Browse Discussions',\n 'content' => \"\",\n ]);\n }", "public function getQuestions()\n {\n $title = \"Questions\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $post = new Post($this->di->get(\"db\"));\n $user = new User($this->di->get(\"db\"));\n $tag = $this->di->get(\"tag\");\n\n $questions = $post->getQuestions();\n foreach ($questions as $question) {\n $question->tags = $tag->getPostTags($question->id);\n $question->user = $user->findAllWhere(\"id = ?\", [$question->userId])[0];//$user->find(\"id\", $question->userId);\n }\n\n $pag = $this->getPagination($questions);\n $view->add(\"comment/question-list\", [\n \"questions\" => array_slice($questions, $pag[\"offset\"], $pag[\"length\"], true),\n \"pag\" => $pag,\n ]);\n return $pageRender->renderPage([\"title\" => $title]);\n }", "public function index()\n {\n $questions = Question::all();\n return view('questions.index');\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => QuestionAnswer::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $elements = Question::paginate(parent::PAGINATE);\n return view('backend.modules.question.index', compact('elements'));\n }", "public function displayQuestions() {\n $listQuestions = array();\n $sql = 'SELECT `id`, `question`, `picture` FROM `' . self::PREFIX . 'question`';\n $result = $this->db->query($sql);\n $listQuestions = $result->fetchAll(PDO::FETCH_OBJ);\n return $listQuestions;\n }", "public function findAll()\n {\n return $this->faqRepository->findAll();\n }", "public function index()\n {\n return QuestionResource::collection(Question::latest()->get()); //This line gets all the latest questions\n }", "public function index(Request $request)\n {\n $request->merge([\n 'order' => [\n [\n 'column' => 'order',\n 'dir' => 'asc'\n ]\n ]\n ]);\n\n $records = $this->faqService->getAll($request->query());\n\n return (new FaqQuestionCollection($records))\n ->additional(['success' => true]);\n }", "public function index()\n {\n $questions = Question::latest()->simplePaginate(10);\n \n return view('questions.list', compact('questions'));\n }", "public function getQuestionsEntities() : array;", "public function index()\n {\n return response()->json(Question::all()->toArray());\n }", "public function index()\n\t{\n\t\t$questions = Question::latest()->paginate(10);\n return view('admin.question.index', compact('questions'));\n\t}", "public function index()\n {\n $questions = Question::all();\n return view('question.index',compact('questions'));\n }", "public function index()\n {\n $data = Question::get();\n return view('questions.index', ['questions' => $data]);\n }", "public function index()\n {\n $questions = Question::orderBy('order')->orderBy('id')->get();\n\n return view('question.index', compact('questions'));\n }", "public function index()\n {\n $questions = Question::paginate();\n\n return view('question.index', ['questions' => $questions]);\n }", "public function index()\n {\n $questions = Question::orderBy('id', 'desc')->paginate(20);\n return view('admin.question.index', compact('questions'));\n }", "public function index()\n {\n $questions = Question::orderBy('id', 'desc')->paginate(30);\n return view('admin.questions.index',compact('questions'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('ItechSupQuestionnaireBundle:Formulaire')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n // $questions = Question::all();\n // dd($questions); \n return view('questions::index');\n }", "public function index(Question $question)\n {\n $answers = $question->answers()->with('user')->simplePaginate(4);\n\n return AnswerResource::collection($answers);\n }", "public function index()\n {\n $questions = Question::all();\n return view('question.index', compact('questions'));\n }", "public function index()\n {\n // \\DB::enableQueryLog();\n\n $questions = Question::orderBy('created_at', $this->order)->with('quiz')->paginate($this->limit);\n return view('Question.index', compact('questions'));\n // \\DB::getQueryLog();\n }", "public function index()\n {\n // Get questions list\n $questions = Questions::orderby('created_at', 'desc')->paginate(15);\n //return collection as resource\n return $questions;\n\n }", "public function all()\n\t{\n\t\t$r = Array();\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\tid\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq;\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\t$r[] = new FAQ($this->module, $line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $r;\n\t}", "public function index()\n {\n $questions = Question::orderby('updated_at', 'desc')->paginate(10);\n\n foreach ($questions as $question) {\n $categories = DB::table('category_question')\n ->select('category_id')\n ->where('question_id', $question->id)\n ->get();\n\n $cate = '';\n\n foreach ($categories as $i => $category) {\n if ($i + 1 == count($categories)) {\n $cate = $cate . $category->category_id;\n } else {\n $cate = $cate . $category->category_id . ',';\n }\n }\n\n $question->categories = $cate;\n\n $answers = Answer::where('question_id', $question->id)->orderby('created_at')->get();\n\n foreach ($answers as $answer) {\n $answer->author = $answer->author->name;\n $comments = Comment::where('answer_id', $answer->id)->orderby('created_at')->get();\n foreach ($comments as $comment) {\n $comment->author = $comment->author->name;\n }\n $answer->comments = $comments;\n $answer->liked = $answer->liked();\n }\n\n $question->answers = $answers;\n $question->author = $question->author->name;\n }\n\n return response($questions, 200);\n }", "public function index()\n {\n $questions = Question::all();\n\n return view('questions.index')->with(array(\n 'questions' => $questions\n ));\n }", "public function index(): ResourceCollection\n {\n $questionnaires = Questionnaire::paginate(10);\n return QuestionnaireResource::collection($questionnaires);\n }", "public function index()\n {\n $questions=(new Question)->getQuestions();\n return view('backend.question.index',compact('questions'));\n }", "public function index()\n {\n\n \n $questions = Question::paginate(5);\n\n return view('question.view', ['questions' => $questions]);\n \n // return view('question.view', ['questions' => Question::all()]);\n\n }", "public function index()\n\t{\n\t\t$this->showLayoutWithTitle(\n\t\t\tView::make('questions.index')->with('questions', Question::ByUser(Auth::User()->id)),\n\t\t\t'Questions',\n\t\t\t$this->pageTitles['index']\n\t\t);\n\t}", "public function index(Quiz $quiz)\n {\n return $quiz->questions;\n }", "public function index()\n {\n return new QuizCollection(Quiz::all());\n }", "public function index()\n {\n $question = $this->question->orderBy('id', 'asc')->paginate(15);\n return view('certification.question.index')\n ->with('question', $question);\n }", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM answer';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function index()\n {\n $questions=Question::all();\n return view('questions.index',compact('questions'));\n }", "public function index()\n {\n return Entity::all();\n }", "public function index(Request $request)\n {\n $query = $request->query('perPage');\n if($query) {\n return response()->json(QuestionResource::collection(Question::orderBy('title', 'ASC')->paginate($query)), 200);\n } else {\n return response()->json(QuestionResource::collection(Question::orderBy('title', 'ASC')->get()), 200);\n }\n }", "public function index()\n { \n\n \n $questions = Question::paginate(25);\n\n return view('questions.index', compact('questions'));\n\n }", "public function questions()\n {\n return $this->hasMany(\\App\\Question::class);\n }", "public function showAllAction () {\n $products = $this->getDoctrine()\n ->getRepository('AppBundle:Product')\n ->findAll();\n\n return $this->render('product/list.html.twig', array(\n 'products' => $products,\n ));\n }", "public function indexAction()\n {\n //get logged-in user (if exists)\n $user = $this->session->get(\"user\");\n\n //if the user is logged-in, get a random question that doesn't belong to them and that they haven't answered. Otherwise, get any random question\n if (!empty($user) && array_key_exists('id', $user) && !empty($user['id'])) {\n $question = $this->getNonUserQuestion($user['id']);\n } else {\n $question = $this->getAnyQuestion();\n }\n\n //get any preset answers for the chosen question\n $answers = Answer::find(\n [\n \"question_id = :questionid: AND (is_other IS NULL OR is_other != 1)\",\n \"bind\" => [\n \"questionid\" => $question->id\n ]\n ]\n );\n\n //store answers in question since they technically belong to it \n $question->answers = $answers;\n\n //assign question to the view\n $this->view->question = $question;\n }", "public function showEntities()\n {\n return Entity::paginate(10);\n }", "public function index()\n {\n $questions = Question::all();\n return response()->json(['questions' => $questions],200);\n }", "public function index()\n {\n $tof_questions = Tof_question::all();\n\n return view('faculty.tof_question.index',compact('tof_questions'));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $quizResults = $em->getRepository('AppBundle:QuizResults')->findAll();\n\n return $this->render('quizresults/index.html.twig', array(\n 'quizResults' => $quizResults,\n ));\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function indexAction()\n {\n $module = $this->params('module');\n $slug = $this->params('slug');\n // Get config\n $config = Pi::service('registry')->config->read($module);\n // Get user id\n $uid = Pi::user()->getId();\n // Get topic information from model\n $project = Pi::api('project', 'ask')->getProject($slug, 'slug');\n // Check slug set\n if (empty($project) || $project['status'] != 1) {\n $this->getResponse()->setStatusCode(404);\n $this->terminate(__('Project not set.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n // Set question info\n $where = array('status' => 1, 'type' => 'Q', 'project_id' => $project['id']);\n // check is project manager\n $userIsManager = false;\n if ($project['manager'] == $uid && $config['auto_approval'] == 2) {\n $userIsManager = true;\n $where['status'] = array(1, 2);\n }\n // Set paginator info\n $template = array(\n 'controller' => 'index',\n 'action' => 'index',\n );\n // Get question List\n $questions = $this->askList($where);\n // Get paginator\n $paginator = $this->askPaginator($template, $where);\n // Set view\n $this->view()->setTemplate('question-list');\n $this->view()->assign('questions', $questions);\n $this->view()->assign('paginator', $paginator);\n $this->view()->assign('project', $project);\n $this->view()->assign('config', $config);\n $this->view()->assign('userIsManager', $userIsManager);\n $this->view()->assign('title', __('List of all questions'));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $dqlsurvey = \"SELECT sy.id,sy.title,sy.descriptions,sy.active,sy.createdOn,ev.title as event_title FROM DroidInfotechDroidBundle:Survey sy JOIN DroidInfotechDroidBundle:Events ev WITH sy.eventId=ev.id\";\n\n $surveys = $em->createQuery($dqlsurvey)->getResult();\n // print_r($surveys); \n //$surveys = $em->getRepository('DroidInfotechDroidBundle:Survey')->findAll();\n return $this->render('survey/index.html.twig', array(\n 'surveys' => $surveys,\n ));\n }", "public function index()\n {\n $questions = Question::all();\n return view('index', ['questions' => $questions]);\n }", "public function questions()\n {\n return $this->hasMany(Question::class);\n }", "public function questions()\n {\n return $this->hasMany(Question::class);\n }", "public function showAllAction( Request $request)\n { $em = $this->getDoctrine()->getManager();\n\n $entrepots = $em->getRepository('GererEntrepotBundle:Entrepot')->findAll();\n\n\n return $this->render('@GererEntrepot/admin/index.html.twig', array(\n 'entrepots' => $entrepots,\n ));\n\n }", "public function questions()\n {\n \treturn $this->hasMany(Question::class);\n }", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function index()\n {\n $categoryId = Category::pluck('name', 'id');\n $questions = Question::latest('created_at')->get();\n return view('question.index', compact(['categoryId', 'questions']));\n }", "public function index()\n {\n $q = Question::where('status' , 1)->get();\n return view('admin.questions.index' , compact('q'));\n }", "public function questions()\n {\n\n $client = new \\GuzzleHttp\\Client();\n\n $request = $client->get('http://localhost/quizci/questions');\n $response = $request->getBody()->getContents();\n\n $res_json_decode = json_decode($response);\n $data_collection = collect($res_json_decode->questions);\n //dd($data_collect);\n\n return View('admin.pages.questions', compact('data_collection'));\n }", "public function index()\n {\n $questions = Question::where('status', Question::status['analyzing'])\n ->orderBy('updated_at', 'DESC')\n ->get();\n\n return view('questions.index', compact('questions'));\n }", "public function index(Question $question)\n {\n return $question->replies;\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Answer::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $questions = auth()->user()->questions()->paginate(10);\n return view('teacher.question.index',[\n 'questions' => $questions\n ]);\n }", "public function all()\n {\n if (!$this->isLogged()) exit;\n $this->oUtil->getModel('Todo');\n $this->oModel = new \\TestProject\\Model\\Todo;\n\n $this->oUtil->oTodos = $this->oModel->getAll();\n\n $this->oUtil->getView('index');\n }", "public function index(Request $request)\n {\n\n $quiz = Question::query();\n\n\n $page_options = new PageOption();\n $where =[];\n\n $page_options->default_sort_column = 'title';\n $page_options->search_column = 'title';\n $page_options->where = $where;\n\n $this->set_page_option( $quiz, $page_options );\n\n $where[ 'hidden' ] = 0;\n\n if( ( $this->isAdmin($user_id) ) ) {\n if( $request->get('_hidden_only' ) == 1 )\n $where['hidden'] = 1;\n else unset($where['hidden']);\n }\n\n if( !$quiz->where( $where )->exists() )\n return response([\"message\" => \"No Question Found\"]);\n\n if ( $request->has('exclution' ) ) {\n $exclutionList = explode( ',', $request->get('exclution' ) );\n $quiz->whereNotIn( 'id', $exclutionList );\n }\n\n $data = QuestionResource::collection( $quiz->where( $where )->paginate( $page_options->page_size ) );\n $data->additional( [ 'sql' => $quiz->toSql() ]);\n\n return $data;\n }", "public function questions()\n {\n return $this->hasMany('App\\Question');\n }", "public function questions()\n {\n return $this->hasMany('App\\Question');\n }", "public function index()\n {\n $quizzes = Quiz::withCount('questions');\n\n if(request()->get('title')){\n $quizzes = $quizzes->where('title','LIKE','%'.request()->get('title').'%');\n }\n if(request()->get('status')){\n $quizzes = $quizzes->where('status',request()->get('status'));\n }\n\n $quizzes = $quizzes->paginate(5);\n return view('admin.quizzes.list',compact('quizzes'));\n }", "public function index()\n {\n\n \n if(userController::checklogin() != 1){\n return redirect('/login');\n }\n\n\n // $questions = question::leftJoin('question_answers', 'questions.id', 'question_answers.question_id')->select('questions.*', 'questions.id as qid' , 'question_answers.*', 'question_answers.id as aid')->get();\n \n $questions = question::all();\n\n foreach($questions as $key => $question){\n $questions[$key]->first_answer = $question->answers->first()->first_answer;\n $questions[$key]->second_answer = $question->answers->first()->second_answer;\n $questions[$key]->third_answer = $question->answers->first()->third_answer;\n $questions[$key]->fourth_answer = $question->answers->first()->fourth_answer;\n $questions[$key]->correct_answer = $question->answers->first()->correct_answer;\n }\n\n // return $questions;\n\n return view('question')->with(['questions' => $questions]);\n }", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $askInfos = $em->getRepository('AppBundle:AskInfo')->findAll();\n\n return $this->render('askinfo/index.html.twig', array_merge([\n 'askInfos' => $askInfos,],\n $this->getData()));\n }", "public function index()\n {\n $questions = Question::with('user')->latest()->paginate(5);\n return view('questions.index', compact('questions'));\n }", "public function questions() {\n\n\t\t# Author has many Question\n return $this->hasMany('Question');\n \n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function index()\n {\n $questions = QuestionRiaSec::paginate(10);\n return view('admin.questions.RIASEC.index', compact('questions'));\n }", "public function actionIndex()\n {\n //session_unset();\n $dataProvider = new ActiveDataProvider([\n 'query' => Survey::find(),\n 'pagination'=>['pageSize'=>10],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n //session_unset();\n $dataProvider = new ActiveDataProvider([\n 'query' => Survey::find(),\n 'pagination'=>['pageSize'=>10],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index(){\n return view('frontend.questions.index');\n }", "public function index()\n {\n $questions = Question::latest()->paginate(5);\n\n return view('questions.index', compact('questions'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public static function findAll() {\n\n // on récupère la connexion à la bDD\n $connexion = \\Oquiz\\Utils\\Database::getDB();\n // requête de récupération de données\n $sql = 'SELECT *, quizzes.id AS id, CONCAT(users.first_name, \" \" , users.last_name) AS author\n FROM quizzes INNER JOIN users ON users.id = quizzes.id_author';\n // on exécute la requête dans la BDD\n $statement = $connexion->query($sql);\n\n // on retourne tous les résultats\n return $statement->fetchAll(\\PDO::FETCH_CLASS, static::class);\n }", "public function indexAction() {\n $faqs = new Faqs();\n $this->view->faqs = $faqs->getAll();\n }", "public function index()\n {\n $questions = AuditQuestion::All();\n return response()->json(array(\n 'questions'=> $questions,\n 'status'=>'success'\n ), 200);\n }", "public function index()\n {\n //\n $this->authorize('viewAny', Question::class);\n $questions= Question::all();\n $quizzes= Quiz::all();\n return view('question.index', compact('questions','quizzes'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('JetBredaBundle:Alquiler')->findAll();\n\n return array('entities' => $entities);\n }" ]
[ "0.72382724", "0.71103513", "0.6895588", "0.6802275", "0.6619215", "0.66156244", "0.6579145", "0.6518413", "0.64886487", "0.6384829", "0.6374225", "0.63657236", "0.63508075", "0.6321521", "0.6290748", "0.62879175", "0.6287528", "0.6275478", "0.6252492", "0.6224188", "0.62186104", "0.62122595", "0.6211064", "0.6182125", "0.61809367", "0.6179435", "0.6175652", "0.61743313", "0.61707306", "0.6168946", "0.61418915", "0.61350507", "0.61343026", "0.612833", "0.60845613", "0.6082411", "0.60804284", "0.6068715", "0.60477555", "0.60327053", "0.60103583", "0.6006971", "0.5996828", "0.5993696", "0.59767747", "0.59738487", "0.59527683", "0.59481657", "0.5941036", "0.5939035", "0.5934354", "0.5917115", "0.591628", "0.5911947", "0.59114426", "0.5910689", "0.59069395", "0.5902", "0.58963066", "0.5893607", "0.58705103", "0.58655167", "0.58629924", "0.58572096", "0.58479995", "0.58479995", "0.5847342", "0.58429176", "0.58150613", "0.5808969", "0.5805693", "0.5799659", "0.5798301", "0.57800233", "0.5773473", "0.57601243", "0.5760032", "0.5744313", "0.5729536", "0.5729536", "0.572484", "0.5719214", "0.571907", "0.57087755", "0.570184", "0.57003564", "0.569728", "0.569728", "0.569728", "0.569728", "0.569728", "0.5695384", "0.56930155", "0.56930155", "0.5690359", "0.56898576", "0.568982", "0.56893295", "0.5688243", "0.5688083", "0.56875116" ]
0.0
-1
Finds and displays a Question entity.
public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->render('QuizmooQuestionnaireBundle:Question:show.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n //\n }", "public function show(Question $question)\n {\n\n }", "public function show(Question $question)\n {\n }", "public function show(question $question)\n {\n //\n }", "function questionAction() {\n // Get question parameter\n $id = $this->_getParam('id');\n if (! $id) {\n // Redirect back to stats when no ID is found\n $this->_redirect(\"/index/stats\");\n return;\n }\n\n // Fetch question\n $mapper = new Model_Question_Mapper();\n $question = $mapper->findByPk($id);\n if (! $question instanceof Model_Question_Entity) {\n $this->render(\"question/notfound\");\n return;\n }\n \n $this->view->question = $question;\n\n switch ($question->getStatus()) {\n case \"moderation\" :\n $this->render(\"question/moderation\");\n break;\n case \"pending\" :\n $this->render(\"question/pending\");\n break;\n case \"active\" :\n $this->render(\"question/active\");\n break;\n case \"done\" :\n $this->render(\"question/done\");\n break;\n default :\n $this->render(\"question/notfound\");\n break;\n }\n }", "public function show(Questions $questions)\n {\n //\n }", "public function show(Question_Test $question_Test)\n {\n //\n }", "public function show(UserQuestion $userQuestion)\n {\n //\n }", "private function viewQuestion() : void\n {\n $allQuestions = $this->questionRepository->list(['id', 'question']);\n\n if( $this->questionRepository->hasUnAnsweredQuestions() ) {\n\n $this->transformQuestionsList($allQuestions);\n $this->chooseQuestionToAnswer();\n\n } elseIf(!$allQuestions->count()) {\n\n $this->console->info( 'No questions added. Add new question to start answering');\n\n } else {\n $this->showProgress();\n }\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CompeteComBundle:StudyQuestions')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find StudyQuestions entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CompeteComBundle:StudyQuestions:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function show(AdminQuestionStore $question)\n {\n //\n }", "public function show(Quest $quest)\n {\n //\n }", "public function show(Question $question) // the show part requires an id (default)\n {\n //Show function does Route Model Binding, is the simple way of telling that this\n // function provides the id of the question by default\n return new QuestionResource($question);\n }", "private function showQuestion($questionId)\n { \n $question = Question::findFirst(\n [\n \"id = :questionid:\",\n \"bind\" => [\n \"questionid\" => $questionId\n ]\n ]\n );\n \n //get any preset answers for the chosen question\n $answers = Answer::find(\n [\n \"question_id = :questionid: AND (is_other IS NULL OR is_other != 1)\",\n \"bind\" => [\n \"questionid\" => $question->id\n ]\n ]\n );\n\n //store answers in question since they technically belong to it \n $question->answers = $answers;\n\n //assign question to the view\n $this->view->question = $question;\n\n //go directly to index view\n return $this->view->pick(\n [\n \"answer/index\"\n ]\n );\n }", "public function viewQuestionsAction() {\n\n $all = $this->comments->findAll();\n\n $res = [];\n foreach ($all as $value) {\n if ($this->commentanswer->isAnswer($value->id) == null) {\n $res[] = $value;\n }\n }\n\n /**\n * Alter object by connecting comment tags, adding user information from the database and filtering markdown on the comment object.\n */\n $res = $this->doAll($res);\n\n /**\n * Prepare the view.\n */\n $this->views->add('comment/commentsdb', [\n 'comments' => $res,\n 'title' => 'Browse Discussions',\n 'content' => \"\",\n ]);\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CdlrcodeBundle:Question')->findAll();\n\n return $this->render('CdlrcodeBundle:Question:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function questionView($questions, $searchQuery = null) : object\n {\n $page = $this->di->get(\"page\");\n \n $question = new Question();\n $question->setDb($this->di->get(\"dbqb\"));\n\n $tag = new Tag();\n $tag->setDb($this->di->get(\"dbqb\"));\n\n foreach ($questions as $q) {\n $answer = new Answer();\n $answer->setDb($this->di->get(\"dbqb\"));\n $q->answersAmount = count($answer->findAllWhere(\"questionId = ?\", $q->id));\n $q->tags = $tag->findAllWhere(\"questionId = ?\", $q->id);\n };\n\n $form = new SearchForm($this->di);\n $form->check();\n\n $page->add(\"anax/v2/article/default\", [\n \"content\" => $form->getHTML(),\n ], \"sidebar-right\");\n\n $page->add(\"question/view-all\", [\n \"questions\" => $questions,\n \"searchQuery\" => $searchQuery ?? null\n ]);\n\n return $page->render([\n \"title\" => \"Topics\",\n ]);\n }", "public function show(Question $question)\n {\n //\n $answers = $question->answers();\n\n\n return view('question.show', compact('question', 'answers'));\n\n\n\n\n }", "public function question()\n {\n $question = \\App\\Question::orderby('created_at', 'desc')->get();\n return view('question.get', [\n 'questions' => $question,\n ]);\n }", "public function show(PastQuestionSingleRequest $request)\n {\n $past_question = PastQuestion::with([\n 'image',\n 'document',\n 'comment',\n ])->find($request->input('id'));\n\n if ($past_question) { \n return $this->success($past_question);\n } else {\n return $this->notFound('Past question was not found');\n }\n }", "function showquestionAction() {\n\t\t\n\t\t// $questionId = $this->getRequest()->getParam('questionid');\n\t\t// echo $questionId;\n\t\t$em = Zend_Registry::get('em');\n\t\t\n\t\t$questionId = $this->getRequest()->getParam('questionid');\n $questionName = '';\n if(isset($questionId) && $questionId > 0 ) {\n $res = $em->createQueryBuilder()->select('q.QUE_Data')\n ->from('Testcreator_Model_Question', 'q')\n ->where('q.QuestionId='.$questionId)->getQuery();\n\n $question = $res->getResult();\n if(is_array($question) && count($question) >0) {\n $questionName = $question[0]['QUE_Data'];\n } else {\n $questionName = \"Data has been deleted from master \";\n }\n }\n echo $questionName;\n\t\texit;\n\t}", "public function show(Question $question,Answer $answer)\n {\n //\n }", "public function display() {\n\t\t$this->loadModel('Questions');\n\t\t$best = $this->Questions->find()\n\t\t\t->order('upvotes DESC')\n\t\t\t->first();\n\t\t$this->set('bestQuestion', $best);\n\t}", "public function show(QuestionOption $questionOption)\n {\n //\n }", "public function show(Question $question)\n {\n $question->increment('views');\n $question->load('user','answers');\n return view('questions.show',compact('question'));\n }", "public function show(Question $question)\n {\n return view('questions.show', compact('question')); \n }", "public function getAction()\n {\n \t$id = $this->getRequest()->getParam('id');\n\t\t$this->_objectMapper->find($id, $this->_object);\n $this->view->question = $this->_object;\n\t\t$this->view->isMarked = $this->_objectMapper->isMarked($id);\n }", "public function showRandom()\n {\n $question = Question::inRandomOrder()->first();\n if ($question) {\n return $this->show($question->id);\n } else {\n return redirect(route('questions.index'));\n }\n }", "public function show(Question $question)\n {\n //\n $this->authorize('view', $question);\n $quizzes= Quiz::all();\n return view('question.show' compact('question','quizzes'));\n }", "public function show(QuestionCategory $questionCategory)\n {\n //\n }", "public function show($id)\n {\n // $questions = Question::findOrFail($id);\n // return view('question.show', compact(['questions','replies']));\n }", "public function show($id)\n {\n // $question = $this->question->find($id);\n // $answer = $question->answer;\n // return view('certification.question.show')\n // ->with(['question' => $question, 'answer' => $answer]);;\n }", "function show_question($id, $slug)\n\t{\n\t\t$this->form_validation->set_rules('id_questions', 'Id_Questions', 'required');\n\t\t$this->form_validation->set_rules('body', 'Body', 'required');\n\t\tif ($this->form_validation->run() == false) {\n\n\t\t\t$this->model_module->_set_viewers($id);\n\t\t\t$data['question'] = $this->model_module->questions_id('uuid_question', $id);\n\t\t\t$questions_id = $data['question']['id'];\n\t\t\t$data['module'] = $this->model_module->get_module($questions_id, $id);\n\t\t\t$queryGetquestion = \"SELECT `tb_questions` .*, `tbl_users`.`name`,`tbl_users`.`user_email`\n\t\t\t\t\tFROM `tb_questions` JOIN `tbl_users` \n\t\t\t\t\tON `tb_questions`.`id_user` = `tbl_users`. `user_id`\n\t\t\t\t\tlEFT JOIN `tb_sub_module` \n\t\t\t\t\tON `tb_questions`.`id_sub_module` = `tb_sub_module`.`id`\n\t\t\t\t\tWHERE `tb_questions`.`id` = $questions_id\n\t\t\t\";\n\t\t\t$query = $this->db->query($queryGetquestion)->row_array();\n\t\t\t$data['get_question'] = $query;\n\t\t\t$answerQuery = \"SELECT `tb_answers` .*, `tbl_users`.`name`,`tbl_users`.`user_email`\n\t\t\t\tFROM `tb_answers`\n\t\t\t\tJOIN `tb_questions` \n\t\t\t\tON `tb_answers`.`id_questions` = `tb_questions`.`id`\n\t\t\t\tJOIN `tbl_users`\n\t\t\t\tON `tb_answers`.`id_user` = `tbl_users`.`user_id`\n\t\t\t\tWHERE `tb_answers`.`id_questions` = $questions_id\n\t\t\t\tORDER BY `tb_answers`.`created_at` DESC\";\n\t\t\t$answer = $this->db->query($answerQuery)->result_array();\n\t\t\t$data['get_answer'] = $answer;\n\n\t\t\t// response_json($data);\n\t\t\t$this->load->view('layouts/header');\n\t\t\t$this->load->view('_partalis/navigation');\n\t\t\t$this->load->view('modules/show_questions', $data);\n\t\t\t$this->load->view('layouts/footer');\n\t\t} else {\n\t\t\t$this->model_module->addAnswers();\n\t\t\tredirect('user/module/show_question/' . $id . '/' . $slug);\n\t\t}\n\t}", "public function show(Question $question)\n {\n if($question->user_id != auth()->user()->id)\n return redirect()->back();\n return view('teacher.question.show',[\n 'question' => $question\n ]);\n }", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "public function show(){\n \t\treturn view('FilterQuestions') ;\n \t}", "public function show(Question $question)\n {\n return view('question.show', compact('question'));\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function show(Survey $survey)\n {\n \n }", "public function showAction($id, $note) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n $questions = $em->getRepository('CdlrcodeBundle:Question')->findAll();\n if (!$entity) {throw $this->createNotFoundException('Unable to find Question entity.');}\n $deleteForm = $this->createDeleteForm($id);\n//$em = $this->getDoctrine()->getManager();\n $ques = new Question;\n $ques = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n $request = $this->getRequest();\n if ($request->getMethod() == \"POST\") {$rep = $_POST['group1'];\n if ($rep === $ques->getBonneReponse()) {$note++;}\n if ($id < 5) { //return $this->render('CdlrcodeBundle:Question:reponse.html.twig', array('rep'=>$n));\n return $this->redirect($this->generateUrl('question_show', array('id' => $id + 1, 'note' => $note)));\n } else { if ($note<3){\n return $this->render('CdlrcodeBundle:Question:reponse.html.twig', array('rep' => $note, 'quest'=>$questions));}\n else {return $this->render('CdlrcodeBundle:Question:reponse2.html.twig', array('rep' => $note, 'quest'=>$questions));} }\n }\n if ($ques->getReponse3() != null) {\n return $this->render('CdlrcodeBundle:Question:show.html.twig', array('entity' => $entity, 'delete_form' => $deleteForm->createView(),));\n } else {\n return $this->render('CdlrcodeBundle:Question:show2.html.twig', array('entity' => $entity));\n }\n \n }", "public function questionAction(int $id) : object\n {\n\n $page = $this->di->get(\"page\");\n $questions = new Questions();\n $questions->setDb($this->di->get(\"dbqb\"));\n $question = $questions->find(\"id\", $id);\n $answers = new Answers();\n $answers->setDb($this->di->get(\"dbqb\"));\n $form = new AnswerForm($this->di, $id);\n $form->check();\n $all_answers_to_question = $answers->findAllWhere(\"question_id = ?\", $id);\n $all_answers_with_comments = [];\n foreach ($all_answers_to_question as $comment) {\n $comments = new Comments();\n $comments->setDb($this->di->get(\"dbqb\"));\n $all_comments = $comments->findAllWhere(\"answer_id = ?\", $comment->rowid);\n array_push($all_answers_with_comments, $all_comments);\n }\n\n $page->add(\"questions/view-question\", [\n \"question\" => $question,\n \"answers\" => $answers->findAllWhere(\"question_id = ?\", $id),\n \"comments\" => $all_answers_with_comments,\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Update an item\",\n ]);\n }", "public function show(Question $question)\n {\n return view('question')->with('question', $question);\n }", "public function show(Question $question)\n {\n return view('question')->with('question', $question);\n }", "public function show($id)\n {\n $question=Question::find($id);//obj\n $truefalsequestion=TrueFalseQuestion::find($id);//obj\n // dd($topic);\n return view('backend.truefalsequestions.show',compact('truefalsequestion','question'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CompeteComBundle:StudyQuestions')->findAll();\n\n return $this->render('CompeteComBundle:StudyQuestions:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Answer $answer)\n {\n //\n }", "public function show(Quiz $quiz)\n {\n //\n }", "public function show(Question $question)\n {\n return view('question.show', ['question' => $question]);\n }", "protected function findQuestion($id)\n\t{\n\t\tif (($model = Question::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('Опрос не существует.');\n\t\t}\n\t}", "public function showQuestions()\n\t{\n\t\t$program = $this->schoolService->findProgramById($this->profile->program_id);\n\t\t$data = array(\n\t\t\t'answers' => $this->profileService->getAnswersForProfile($this->profile)->toArray(),\n\t\t\t'profile' => $this->profile,\n\t\t\t'program' => $program,\n\t\t\t'questionMax' => Config::get('profile.questions.max'),\n\t\t\t'questions' => $this->profileService->getQuestionsForType($program->type_id)->lists('label', 'id')\n\t\t);\n\n\t\treturn new QuestionView($data);\n\t}", "public function indexAction()\n {\n //get logged-in user (if exists)\n $user = $this->session->get(\"user\");\n\n //if the user is logged-in, get a random question that doesn't belong to them and that they haven't answered. Otherwise, get any random question\n if (!empty($user) && array_key_exists('id', $user) && !empty($user['id'])) {\n $question = $this->getNonUserQuestion($user['id']);\n } else {\n $question = $this->getAnyQuestion();\n }\n\n //get any preset answers for the chosen question\n $answers = Answer::find(\n [\n \"question_id = :questionid: AND (is_other IS NULL OR is_other != 1)\",\n \"bind\" => [\n \"questionid\" => $question->id\n ]\n ]\n );\n\n //store answers in question since they technically belong to it \n $question->answers = $answers;\n\n //assign question to the view\n $this->view->question = $question;\n }", "public function answerFaq()\n {\n $faqManager = new FaqManager();\n if (!empty($_GET['id'])){\n $idFaq = $_GET['id'];\n }else{\n return $this->error404();\n }\n $answer = $faqManager->findOneFaqById($idFaq);\n\n View::show(\"admin/answerFaq.php\", \"Answer Faq Page\", ['answer'=>$answer]);\n\n\n }", "public function show($id)\n {\n // display an individual question\n // get the question to display\n $question = Question::find($id);\n \n // pass it to the view\n return view('question.show', ['question' => $question]);\n //return Question::find($id);\n }", "public function show(Question $question)\n {\n return view('questions.show', compact('question'));\n }", "public function show($id)\n {\n $row = Question::findOrFail($id);\n return view('questions.show', ['question' => $row]);\n }", "public function displayUserQuestion()\n\t{\n\t\t/*\n\t\t * Read flash data from session, this may be set for this request only\n\t\t * by LearningPageController::updateUserQuestion() before redirecting here\n\t\t * If route is called directly both will be empty\n\t\t */\n\t\t$userQuestionId = Session::get('user_question_id');\n\t\t$displayAnswer = Session::get('display_answer');\n\n\t\t/*\n\t\t * Obtain user question to be displayed\n\t\t */\n\t\tif ($userQuestionId)\n\t\t{\n\t\t\t/**\n\t\t\t * Obtain conrete question\n\t\t\t */\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_find_user_question', [\n\t\t\t\t'auth_token' => $this->apiAuthToken,\n\t\t\t\t'id' => $userQuestionId\n\t\t\t]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*\n\t\t\t * Obtain random question\n\t\t\t */\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_random_user_question', [\n\t\t\t\t'auth_token' => $this->apiAuthToken\n\t\t\t]);\n\t\t}\n\n\t\t/*\n\t\t * Success API response - display learning page with obtained user question\n\t\t */\n\t\tif ($apiResponse->getSuccess())\n\t\t{\n\t\t\t// display learning interface\n\t\t\t$this->viewData['display_answer'] = $displayAnswer;\n\t\t\t$this->viewData['user_question_id'] = $apiResponse->id;\n\t\t\t$this->viewData['question'] = $apiResponse->question;\n\t\t\t$this->viewData['answer'] = $apiResponse->answer;\n\t\t\treturn View::make('learning_page', $this->viewData);\n\t\t}\n\n\t\t// error API response\n\t\tif ($apiResponse->getErrorCode() == Config::get('api.user_has_not_created_any_questions_yet.error_code'))\n\t\t{\n\t\t\t$this->viewData['info'] = Lang::get('messages.no_questions', ['url' => route('display_user_questions')]);\n\t\t\treturn View::make('info_page', $this->viewData);\n\t\t}\n\n\t\t// unexpected API resppnse\n\t\tthrow new Exception('Unexpected API response');\n\t}", "public function executeShow()\r\n\t{\r\n\t\t$this->subscriber = Doctrine_Query::create()\r\n\t\t->from('User u, u.Questions q, u.Interests ui, ui.Question, u.Answers ua, ua.Question')\r\n\t\t->where('u.nickname = ?', $this->getRequestParameter('nickname'))\r\n\t\t->execute()->getFirst();\r\n\r\n\t\t$this->forward404Unless($this->subscriber);\r\n\r\n\t\t$this->questions = $this->subscriber->getQuestions();\r\n\r\n\t\t$this->interests = $this->subscriber->getInterests();\r\n\r\n\t\t$this->answers = $this->subscriber->getAnswers();\r\n\r\n\t}", "public function show(QuestionForum $questionForum)\n {\n //\n }", "public function edit(question $question)\n {\n //\n }", "public function show(Answers $answers)\n {\n //\n }", "public function show(Question $question)\n {\n return view('admin.show_question',compact('question'));\n }", "public function show($id)\n {\n $question = Question::find($id);\n return view('Question.show', compact('question'));\n }", "protected function detail($id)\n {\n return Show::make($id, new EmsQuestion(), function (Show $show) {\n// $show->field('id');\n// $show->field('questype_id');\n// $show->field('que_index');\n// $show->field('que_create_byid');\n// $show->field('que_create_byname');\n// $show->field('que_last_byid');\n// $show->field('que_last_byname');\n// $show->field('que_select');\n// $show->field('que_selectnum');\n// $show->field('que_answer');\n// $show->field('que_describe');\n// $show->field('que_status');\n// $show->field('que_level');\n// $show->field('que_sequence');\n// $show->field('declaration_id');\n// $show->field('major_id');\n// $show->field('que_head_id');\n// $show->field('que_head_satuts');\n// $show->field('que_son_num');\n// $show->field('que_son_value');\n// $show->field('que_sure_count');\n// $show->field('que_error_count');\n// $show->field('created_at');\n// $show->field('updated_at');\n $show->html(function () {\n // 获取字段信息\n $id = $this->id;\n $que_index = $this->que_index;\n $que_select = $this->que_select;\n $que_answer = $this->que_answer;\n return \"<div class=\\\"card\\\">\n <div class=\\\"card-header\\\"><h5>$que_index</h5></div>\n <div class=\\\"card-body\\\">\n <div style='padding-left: 20px'>$que_select</div>\n </div>\n <div class=\\\"card-footer\\\">正确答案:$que_answer</div>\n </div>\";\n });\n });\n }", "public function show($id)\n\t{\n\t\t$question = Question::with('tags')->findOrFail($id);\n\n\t\t$question->readtimes += 1;\n\n\t\t$userAvatar = DB::table('users')->where('name',$question->username)->value('avatar');\n\n\t\t$answer = Answer::all()->where('question_id',$id)->sortByDesc('isadopt');\n\n\t\t$question->save();\n\n\t\t$question->content = Markdown::convertToHtml($question->content);\n\n\t\t$popularQuestions = $question->orderBy('answertimes','desc')->where('answertimes','>',0)->limit(5)->get();\n\t\treturn view('questions.show', compact('question','userAvatar','answer','popularQuestions'));\n\t}", "public function show(Question $question)\n {\n return view('questions.show', compact('question'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function find($entity) {\n\n\t\t$em = $this->getServiceLocator ()->get ( 'Doctrine\\ORM\\EntityManager' );\n\n\t\tif (is_numeric ( $entity ))\n\t\t\t$entity = $em->find ( 'BaftFeedback\\Entity\\BaftfeedbackQuestion', $entity );\n\n\t\t\t// if not found submission\n\t\tif (! ($entity instanceof BaftfeedbackQuestion))\n\t\t\treturn null;\n\n\t\treturn $entity;\n\n\t}", "public function show($id)\n {\n $question = Question::find($id);\n //$answerData = Answer::where('question_id',$id)->get();\n //return view('admin/question/show',compact('question','answerData'));\n return view('admin/question/edit',compact('question'));\n }", "public function show($id)\n {\n //\n $question = Question::find($id);\n// $answers = $question->answers;\n// return compact('question');\n return view('Q&A.show', compact('question'));\n }", "public function show(Quest $quest)\n {\n return $this->crudShow($quest);\n }", "public function show(Question $question)\n {\n $question->increment('views');\n\n $answers = Answer::orderBy('created_at', 'desc')->get();\n // dd($question);\n return view('questions::frontend.show', compact('question','answers'));\n }", "public function show(questionaire $questionaire)\n {\n //\n }", "public function show($id)\n {\n $question=(new Question)->getQuestionById($id);\n return view('backend.question.show',compact('question'));\n }", "public function Read(){\n if (isset($_SESSION['question'])) {\n unset($_SESSION['question']);\n\n }\n \n $model = Survey::getInstance();\n $questions = $model->get_questions();\n $answers = $model->get_answers();\n // var_dump($query);\n $this->smarty->assign('questions',$questions);\n $this->smarty->assign('answers',$answers);\n\n $this->smarty->show('survey');\n }", "public function faqAction()\n {\n return $this->render('BerkmanSlideshowBundle:FAQ:show.html.twig');\n }", "public function show($id)\n\t{\n\t\t$question = Question::find($id);\n\n\t\t$answerListView = View::make('answers.list')->with('answers', $question->answersOrdered());\n\t\t$showView = View::make('questions.show')->with('question', $question);\n\t\t$showView->contentSub = $answerListView;\n\t\t$this->showLayoutWithTitle($showView);\n\t}", "public function show(Faq $faq)\n {\n //\n }", "public function show(Faq $faq)\n {\n //\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 getQuestion()\n {\n return $this->hasOne(Question::className(), ['id' => 'question_id']);\n }", "public function gestionquestionAction()\r\n {\r\n $auth = Zend_Auth::getInstance();\r\n $userGroupId = $auth->getIdentity()->UserGroupIdF;\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n $question = $question->getAllQuestionByGroupCrea($userGroupId);\r\n\r\n $this->view->question = $question;\r\n }", "public function single($question)\n {\n $question_data = Question::where('slug', $question)->first();\n // take data\n // $questComents = QuestionComment::where('question_id', $question->id)->get();\n $answers = Answer::where('question_id', $question_data->id)->get();\n $user = User::where('id', $question_data->user_id)->first();\n $users = User::orderBy('id', 'desc')->get();\n // $answerComents = AnswerComment::where('answer_id', $answers[0]->id)->get();\n\n // view\n $data = [\n 'question' => Question::where('slug', $question)->first(),\n // 'questComents' => $questComents,\n 'user' => $user,\n 'users' => $users,\n 'answers' => $answers,\n // 'answerComents' => $answerComents\n ];\n\n return view('single', $data);\n }", "public function show(Faq $faq)\n {\n \n }", "public function show($id)\n {\n $question=Question::find($id);\n return view('questions.show',compact('question'));\n }", "public function show($id)\n {\n //26497 it's just a key to hide the real ids\n $id = $id - 26497;\n $data['title']=\"Questions\";\n $data['table'] = \\App\\QuestionCategory::find($id);\n $data['questions'] = DB::table('questions')->where('parent_id', $id)->orderBy('subject', 'asc')->paginate(8);\n $data['parent_id'] = encrypt($id);\n return view('Admin.Questions.questions', $data);\n }", "public function QuestionAction($id, Request $request)\n {\n// if($id == -1 || $request->getSession()->get('current_form_id') === null || $id != $request->getSession()->get('current_step')) return $this->redirectToRoute('formsavailable');\n\n $em = $this->getDoctrine()->getManager();\n $form = $em->getRepository('AppBundle:Formation')->findOneBy(array('formId' => $request->getSession()->get('current_form_id')));\n if ($form === null) return $this->redirectToRoute('formsavailable');\n $question = $em->getRepository('AppBundle:Questions')->findOneBy(array('pagenumber' => $id, 'formid' => $form)); //and verify the form id\n if ($question == null) return $this->redirectToRoute('formsavailable');\n return $this->render(':Member:form_question.html.twig', array('question' => $question));\n }", "public function getQuestions()\n {\n $title = \"Questions\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $post = new Post($this->di->get(\"db\"));\n $user = new User($this->di->get(\"db\"));\n $tag = $this->di->get(\"tag\");\n\n $questions = $post->getQuestions();\n foreach ($questions as $question) {\n $question->tags = $tag->getPostTags($question->id);\n $question->user = $user->findAllWhere(\"id = ?\", [$question->userId])[0];//$user->find(\"id\", $question->userId);\n }\n\n $pag = $this->getPagination($questions);\n $view->add(\"comment/question-list\", [\n \"questions\" => array_slice($questions, $pag[\"offset\"], $pag[\"length\"], true),\n \"pag\" => $pag,\n ]);\n return $pageRender->renderPage([\"title\" => $title]);\n }", "public function show($id)\n {\n $question = QuestionBank::find($id);\n $question_details = QuestionBankDetails::where('question_bank_id',$id)->get();\n return view('admin.single_question.show',compact('question','question_details'));\n }" ]
[ "0.7581154", "0.7581154", "0.7581154", "0.7581154", "0.7581154", "0.7574523", "0.75638103", "0.7347168", "0.71108806", "0.7057562", "0.67303956", "0.66818106", "0.66534925", "0.66216683", "0.66023684", "0.6543588", "0.6509035", "0.6448239", "0.6446529", "0.642425", "0.64186865", "0.63912135", "0.6373338", "0.63621414", "0.63615555", "0.63552696", "0.63244337", "0.62705475", "0.62278444", "0.62176317", "0.6209781", "0.6202229", "0.6199357", "0.6192199", "0.6123656", "0.6121699", "0.610643", "0.6092407", "0.60586613", "0.60580456", "0.6021187", "0.6010124", "0.6010124", "0.6010124", "0.60028183", "0.60017693", "0.5998951", "0.5996823", "0.5996823", "0.599143", "0.59837145", "0.59603477", "0.59603477", "0.59603477", "0.59603477", "0.59603477", "0.59603477", "0.59603477", "0.59603477", "0.59507763", "0.595042", "0.5948483", "0.59377366", "0.5935604", "0.5933098", "0.59325093", "0.5931867", "0.5925751", "0.59150994", "0.5909406", "0.5896647", "0.5896077", "0.58957916", "0.58898115", "0.58896744", "0.5876761", "0.5873689", "0.58699703", "0.58626336", "0.5860378", "0.5860081", "0.5839566", "0.58394206", "0.5834755", "0.5832459", "0.5829191", "0.5825002", "0.5822047", "0.5813755", "0.5813755", "0.57941675", "0.578522", "0.5783165", "0.5781233", "0.57719564", "0.5763247", "0.5762373", "0.5754336", "0.57533497", "0.5745259" ]
0.67095256
11
Displays a form to create a new Question entity.
public function newAction($id) { $entity = new Question(); $form = $this->createForm(new QuestionType(), $entity); return $this->render('QuizmooQuestionnaireBundle:Question:new.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'id_questionnaire' =>$id )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 newAction()\n {\n $entity = new StudyQuestions();\n $form = $this->createForm(new StudyQuestionsType(), $entity);\n\n return $this->render('CompeteComBundle:StudyQuestions:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n\t{\n\t\treturn view('admin.question.create');\n\t}", "public function newAction()\r\n {\r\n $entity = new Question();\r\n $em = $this->getDoctrine()->getManager('interview');\r\n $form = $this->createForm(new QuestionType($em), $entity);\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "public function create()\n\t{\n\t\treturn view('questions.createQuestion');\n\t}", "public function create()\n {\n $question = new Question;\n $edit = FALSE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "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 create()\n {\n return view('backend.question.create');\n }", "public function create()\n {\n return view('admin.question.create');\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "public function create()\n {\n return view('questions::frontend.create');\n }", "public function create()\n {\n return view('question.add');\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create()\n {\n return view('admin/question/create');\n }", "public function create()\n {\n return view('admin.typeQuestion.create');\n }", "public function create()\n {\n $question = new Question();\n return view('questions.create', compact('question'));\n }", "public function create()\n {\n return view('questions.create');\n\n }", "public function create()\n {\n return view('question.create');\n }", "public function create()\n {\n //get new question instance\n $question = new Question;\n\n //set edit variable as false : new question\n $edit = FALSE;\n\n //display the question view\n return view('questionForm', ['question' => $question,'edit' => $edit ]);\n }", "public function create()\n {\n //\n return view('question.create');\n }", "public function create()\n {\n \n \n\n return view('questions.create');\n \n\n }", "public function create()\n {\n $question=new Question();\n return view('questions.create',compact('question'));\n }", "public function create( Question $question)\n {\n return view('admin.pages.answer.create',compact('question'));\n\n\n }", "public function create(){\n\n // returning view and results\n return view('create_question');\n }", "public function create()\n {\n BreadcrumbsRegister::Register($this->ModelName,$this->BreadCrumbName);\n return view('admin.questions.create')->with(['title' => $this->BreadCrumbName, 'chapter_id' => $_GET['chapter_id']]);\n }", "public function create()\n {\n $this->view->course_list_array = \\App\\Http\\Models\\Course::courseListArray();\n $this->view->title = 'Add Questionnaire';\n return $this->view('tes.form-management.questionnaire-list.add-questionnaire');\n }", "public function actionCreate($question_id)\n {\n $model = new QuestionAnswer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['question/view', 'id' => $question_id]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'question' => $this->findQuestionModel($question_id)\n ]);\n }", "public function createAction()\n {\n $post_request = (array) $this->postZingRequest();\n\n /** Handle the request */\n $errors = $this->_handleRequest($post_request);\n\n $api_manager = $this->get('zing.core.api.api');\n\n return $this->renderAdmin('ZingComponentPollBundle:Default:question/form.html.twig', array_merge(array_merge(array(\n 'zing_form_action' => 'create',\n 'zing_form_errors' => $errors,\n 'user_key' => $api_manager->createUserApiKey()\n ),\n array('post_request' => $post_request)\n ), $post_request));\n }", "public function createAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/create\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a item\",\n ]);\n }", "public function create()\n {\n return view('questionnaire.create');\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n }\n\n $que = new Question();\n\n $que->setQuesId($this->request->getPost(\"quesid\"));\n $que->setDesc($this->request->getPost(\"desc\"));\n $que->setOrder($this->request->getPost(\"order\"));\n $que->setBkgrId($this->request->getPost(\"bkgrid\"));\n $que->setQtype($this->request->getPost(\"qtype\"));\n $que->setAmtText($this->request->getPost(\"amttext\"));\n $que->setAmtType($this->request->getPost(\"amttype\"));\n $que->setCrdt($this->request->getPost(\"crdt\"));\n $que->setCrdtId($this->request->getPost(\"crdtid\"));\n $que->setUpdt($this->request->getPost(\"updt\"));\n $que->setUpdtId($this->request->getPost(\"updtid\"));\n $que->setDelmark($this->request->getPost(\"delmark\"));\n \n\n if (!$que->save()) {\n foreach ($que->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"ques\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"Question was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n\n }", "public function create()\n {\n if(!Auth::user()->is_admin == 1){\n abort(404, 'Page not found');\n }\n return view('Question.create');\n }", "public function create()\n {\n return view('master.form.quiz-form');\n }", "public function create()\n {\n $this->employeePermission('application' , 'create');\n $action = 'create';\n return view('admin.setting.question_form', compact('action'));\n }", "public function create()\n {\n $questions=Question::all();\n return view('backend.truefalsequestions.create',compact('questions'));\n }", "public function create()\n {\n return view('quest.create');\n }", "public function getPostCreateQuestion()\n {\n $title = \"Ask Question\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $user = $this->di->get(\"authHelper\")->getLoggedInUser();\n\n if (!$user) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $form = new QuestionForm($this->di);\n $form->check();\n $view->add(\"comment/question-form\", [\"form\" => $form->getHTML([\"use_buttonbar\" => false])]);\n return $pageRender->renderPage([\"title\" => $title]);\n }", "public function create()\n {\n //view form for add new quiz\n return view('admin.quiz.create_quiz');\n }", "public function createQuestion($questionnaire)\n {\n return view('admin.questions.create')->with('questionnaire', $questionnaire);\n }", "public function createQuestionAction(int $id) : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateQuestionForm($this->di, $id);\n $form->check();\n\n $page->add(\"questions/crud/create-question\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a question\",\n ]);\n }", "public function create()\n {\n $page = 'questionnaire';\n $questionnaire = new Questionnaire;\n $categories = Category::all();\n\n $questions = $questionnaire->questions()->paginate($this->nbPaginate);\n\n $questionsAll = Question::all();\n\n /*$questionsAll = DB::table('questions')\n ->select('questions.id', 'level', 'label', 'description', 'name')\n ->join('categories', 'questions.category_id', '=', 'categories.id')\n ->orderBy('categories.id')\n ->get();*/\n\n return view('admin.questionnaire-create-update', compact('page', 'categories', 'questionnaire', 'questions', 'questionsAll'));\n }", "public function create()\n {\n $categories = QuestionCategory::all();\n $selectedCategories = collect([]);\n return view($this->forms . '.create', compact('categories',\n 'selectedCategories'));\n }", "public function create()\n {\n $tags = QuestionTag::allTags();\n \n return view('questions.create', compact('tags'));\n }", "public function create()\n {\n $quest = Quest::make();\n\n return view('system.quests.create', compact('quest'));\n }", "public function createAction(Request $request) {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('question_show', array('id' => $entity->getQuestionId())));\n }\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 //\n if (\\Auth::guest())\n return redirect()->guest('login');\n\n $sections = null;\n\n $data = [\n 'pagetitle' => 'Draft a Question',\n 'sections' => $sections\n ];\n return view('questions.create',$data);\n }", "public function create()\n {\n $data=SetInformationLang(auth()->user(),$this->defaultPosition,$this->defaultCode);\n\n $trans=$data['trans'];\n $code=$data['code'];\n $position=$data['position'];\n return view(\"admin.question.create\",compact(\"code\",\"position\",\"trans\"));\n }", "public function actionCreate()\n {\n $model = new Quotation();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function addQuestionAction()\n {\n\n if($this->UserauthenticationController->isAuthenticated()) {\n \n $form = new \\Mos\\HTMLForm\\CForm(array(), array(\n 'title' => array(\n 'type' => 'text',\n 'label' => 'Rubrik:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'text' => array(\n 'type' => 'textarea',\n 'label' => 'Text:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'tags' => array(\n 'type' => 'text',\n 'label' => 'Taggar (separeras med kommatecken):',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'submit' => array(\n 'type' => 'submit',\n 'value' => 'Publicera fråga',\n 'callback' => function($form) {\n return true;\n }\n ),\n )\n );\n \n // Check the status of the form\n $status = $form->Check();\n \n // What to do if the form was submitted\n if($status === true) {\n \n $now = gmdate('Y-m-d H:i:s');\n \n $sql = \"INSERT INTO mvc_comments (commentTypeId, userId, userAcronym, userEmail, title, text, created) VALUES ('1', '\" . $_SESSION['user']->id . \"', '\" . $_SESSION['user']->acronym . \"', '\" . $_SESSION['user']->email . \"', '\" . $form->Value('title') . \"', '\" . $form->Value('text') . \"', '\" . $now . \"')\";\n $res = $this->db->executeFetchAll($sql);\n $qid = $this->db->lastInsertId();\n \n // Separate the defined tags for this question.\n $tagsSep = explode(\",\", strtolower($form->Value('tags')));\n foreach ($tagsSep as $key => $val) {\n if (!$this->tagExistAction($val)) {\n $trimmed = trim($val);\n $sql = \"INSERT INTO mvc_tag (name) VALUES (?)\";\n $res = $this->db->executeFetchAll($sql,array($trimmed));\n $tagId = $this->db->lastInsertId();\n }\n else {\n $tagId = $this->getTagIdAction($val);\n }\n $sql = \"INSERT INTO mvc_tag2question (idQuestion, idTag) VALUES (?, ?)\";\n $res = $this->db->executeFetchAll($sql,array($qid, $tagId));\n }\n \n $url = $this->url->create('') . '/question/view/' . $qid;\n $this->response->redirect($url);\n }\n \n // What to do when form could not be processed\n else if($status === false){\n header(\"Location: \" . $_SERVER['PHP_SELF']);\n }\n \n $this->theme->setTitle(\"Skapa en ny fråga\");\n \n $this->views->add('comment/form', [\n 'title' => \"Skapa en ny fråga\",\n 'content' => $form->getHTML()\n ]);\n \n }\n }", "public function create()\n {\n return view('application.questoes.create');\n }", "public function create()\n {\n //\n $this->authorize('create', Question::class);\n $quizzes= Quiz::all();\n return view('question.create' compact('quizzes'));\n\n }", "public function create()\n {\n return view('admin.questions.RIASEC.create', compact(''));\n }", "private function createCreateForm(Question $entity) {\n $form = $this->createForm(new QuestionType(), $entity, array(\n 'action' => $this->generateUrl('question_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\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 createquestionAction()\r\n {\r\n\r\n // Check Post\r\n if ($this->getRequest()->isPost()) {\r\n\r\n $params = $this->getRequest()->getParams();\r\n $questionname = trim($params['questionNameCreate']);\r\n\r\n\r\n $error = \"\";\r\n \r\n\r\n if (strlen($questionname)>50)\r\n $error .= \"Le nom de la question doit être compris entre 1 et 50 caractères. \";\r\n if (!empty($error)) {\r\n $this->_helper->json(array(\r\n 'code' => $error\r\n ));\r\n }\r\n $auth = Zend_Auth::getInstance();\r\n $userGroupId = $auth->getIdentity()->UserGroupIdF;\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // create the new group\r\n $idInsert = $question->createQuestion($questionname, $userGroupId);\r\n\r\n if ($idInsert == \"nok\") {\r\n $msg = \"Contactez un administrateur svp.\";\r\n $this->_helper->json(array(\r\n 'code' => $msg\r\n ));\r\n }\r\n $this->_helper->json(array(\r\n 'code' => '42'\r\n ));\r\n }\r\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create()\n\t{\n\t\tif ( Auth::check() ) \n\t\t{\n\n\t\t\t$this->showLayoutWithTitle(\n\t\t\t\t\tView::make('questions.create'),\n\t\t\t\t\t'Edit Question',\n\t\t\t\t\t$this->pageTitles['create']\n\t\t\t);\n\n\t\t} \n\n\t\telse return Redirect::route('index')->with('message', 'Please login to post a question')\n\t\t\t\t\t\t\t\t\t\t\t->with('messageType', 'error');\n\t}", "public function create()\n {\n //\n return view('Q&A.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\t$tags = Tag::pluck('name', 'id')->all();\n\t\treturn view('questions.createQuestion', compact('tags'));\n\t}", "public function create(\\FanFerret\\QuestionBundle\\Entity\\Question $question);", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n $subjects = Subject::all();\n return view('admin.single_question.create',compact('subjects'));\n }", "public function createComponentQuestionForm() {\n $form = new Form;\n\n $form->addHidden('test_id');\n $form->addHidden('id');\n $form->addTextArea('text', 'Text')->setRequired();\n $form->addSubmit('submit');\n $form->setDefaults($this->questions->getById($this->questionId));\n $form->onSuccess[] = $this->questionFormSucceeded;\n\n return $form;\n }", "public function actionCreate()\n {\n $model = new QuestionReported();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('answer.create');\n\t}", "public function create()\n {\n return view('pengguna.pages.faq.create');\n }", "public function create()\n {\n $questionData = getQuestionsData(); //Helper function in app\\Support\\helpers.php\n $numberAnswers = $questionData[0];\n $typeKeys = $questionData[1];\n $typeValues = $questionData[2];\n \n return view('questions.create', compact('typeKeys', 'typeValues', 'numberAnswers')); \n }", "public function create()\n {\n //\n $this->authorize('create', Choice::class);\n $question=Question::all();\n return view('choice.create', compact('question'));\n }", "public function create()\n {\n $questions = Question::all();\n return view('admins/answer/create',[\n 'questions' => $questions\n ]);\n }", "public function create()\n {\n return view ('survey.create');\n }", "public function create(Question $question)\n {\n return view('questionOptions.create', compact('question'));\n }", "public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n return view('quiz.create');\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('panel.faq.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n $rewards = Reward::all();\n $types = QuestType::all();\n $items = Item::all();\n $field = AdditionalQuestsField::where('name', 'itemID')->first();\n $descriptions = Description::all();\n $speakers = Speaker::pluck('name');\n $modes = DescriptionMode::all();\n $languages = Language::all();\n\n return view('admin.quests.create', compact('rewards', 'types', 'items', 'field', 'descriptions',\n 'modes', 'speakers', 'languages', 'notes'));\n }", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function actionCreate()\n\t{\n\t\t$model = new Question();\n\t\t$model->user = Yii::$app->user->id*1;\n\t\t$model->text = 'Новый опрос';\n\t\t$model->save(true,['user','text']);\n\t\treturn $this->redirect(['update', 'id' => $model->id]);\n\t}", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create(){\n return view('addfaq');\n }", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n $subjects = Subject::all();\n\n return view('faculty.tof_question.create',compact('subjects'));\n }", "public function create()\n {\n return view(\"backend.cms.form\");\n }", "public function newAction(Question $qid)\n {\n $user = $this->getUser();\n $entity = new MeasureUnit();\n $form_create = $this->createForm(new MeasureUnitType(), $entity);\n $form_select = $this->createForm(new MeasureUnitSelectType());\n\n return $this->render('IsssrCoreBundle:MeasureUnit:new.html.twig', array(\n 'entity' => $entity,\n 'question' => $qid,\n 'user' => $user,\n 'form_create' => $form_create->createView(),\n 'form_select' => $form_select->createView(),\n ));\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create()\n {\n $category = Category::pluck('name', 'id'); //Récupère le titre et l'id en renvoyant un tableau Array_collection\n \n return view('back.question.create', compact('category'));\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 create(Test $test, Question $question)\n {\n return view('choice.create', ['test' => $test, 'question' => $question]);\n }", "public function create()\r\n {\r\n if (!Gate::allows('questions_option_create')) {\r\n return abort(401);\r\n }\r\n $questions = Question::get()->pluck('question', 'id')->prepend('Please select', '');\r\n\r\n return view('backend.questions_options.create', compact('questions'));\r\n }", "public function createAction(Request $request, $id)\n {\n $entity = new Question();\n $form = $this->createForm(new QuestionType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n // On r�cup�re l'entit� questionnaire correspondant � l'id $id\n //$questionnaire = $em->getRepository('QuizmooQuestionnaireBundle:Questionnaire')->find($id);\n //$questionnaire->addQuestion($entity);\n $em->persist($entity);\n $em->flush();\n\n // return $this->redirect($this->generateUrl('question_show', array('id' => $entity->getId())));\n return $this->redirect($this->generateUrl('quizmoo_questionnaire_modifier', array('id' => $id)));\n }\n\n return $this->render('QuizmooQuestionnaireBundle:Question:new.'.$this->get('session')->get('whichTwig','').'html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "protected function form()\n {\n $option = QuestionType::getSelect();\n\n return Form::make(new Question(), function (Form $form) use ($option) {\n\n// $form->confirm('您确定要提交表单吗?');\n $form->display('id');\n $form->select('type')\n ->when([2, 3], function ($form) {\n $form->textarea('extra', '文章')->rows(4);\n })\n ->options($option)->default(1);\n\n $form->embedsTable('questions', '有关题目', function (NestedForm $form) {\n $form->text('question', '题干');\n $form->embedsTable('answers', '有关答案', function ($form) {\n $form->text('answer', '答案');\n $form->switch('is_correct', '正确答案');\n });\n });\n//\n// $form->number('sort', $form->getElementId())->default(50);\n// $form->switch('status')->default(1);\n//\n $form->display('created_at');\n $form->display('updated_at');\n });\n }", "public function create()\n {\n return view('backend.faqs.create');\n }", "public function create()\n {\n $newquestion = Pertanyaan::with('user')->orderBy('updated_at', 'desc')->get();\n return view('task17&18\\create', compact('newquestion'));\n }", "public function create()\n {\n $faq = new Faq;\n return view('admin.pages.faqs.create', array('faq' => $faq, 'action' => 'create'));\n }" ]
[ "0.83209324", "0.8028797", "0.7899313", "0.7859843", "0.7824358", "0.78081167", "0.7786203", "0.77786565", "0.77487636", "0.7734084", "0.7734084", "0.7677951", "0.7677697", "0.76622605", "0.76622605", "0.76622605", "0.76575917", "0.7656383", "0.76547354", "0.7654546", "0.7628615", "0.76225543", "0.7594356", "0.7535225", "0.7512069", "0.7475941", "0.74628234", "0.7431559", "0.74036187", "0.73655725", "0.73504514", "0.7347463", "0.7328253", "0.7278152", "0.72752976", "0.7267747", "0.7256799", "0.7239461", "0.7218032", "0.72156197", "0.71607274", "0.7160496", "0.7144176", "0.71241945", "0.71123236", "0.7097604", "0.70439994", "0.70400125", "0.7029135", "0.7022914", "0.70225704", "0.70170385", "0.7008096", "0.70030546", "0.69984734", "0.69700384", "0.6951848", "0.69489616", "0.6930846", "0.6916859", "0.69149214", "0.6912208", "0.69118774", "0.6890472", "0.68893826", "0.68801713", "0.6873105", "0.68687296", "0.6863897", "0.6859879", "0.685816", "0.68572694", "0.6846112", "0.6831322", "0.6831146", "0.68250436", "0.682101", "0.6808421", "0.678956", "0.67617863", "0.67585564", "0.67543095", "0.6752704", "0.67508656", "0.675086", "0.67504865", "0.6744207", "0.67434704", "0.6738526", "0.67357105", "0.67275", "0.67239356", "0.6722916", "0.6722717", "0.67217433", "0.6715843", "0.67117447", "0.6710179", "0.6700753", "0.6700599" ]
0.7098166
45
Creates a new Question entity.
public function createAction(Request $request, $id) { $entity = new Question(); $form = $this->createForm(new QuestionType(), $entity); $form->bind($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); // On r�cup�re l'entit� questionnaire correspondant � l'id $id //$questionnaire = $em->getRepository('QuizmooQuestionnaireBundle:Questionnaire')->find($id); //$questionnaire->addQuestion($entity); $em->persist($entity); $em->flush(); // return $this->redirect($this->generateUrl('question_show', array('id' => $entity->getId()))); return $this->redirect($this->generateUrl('quizmoo_questionnaire_modifier', array('id' => $id))); } return $this->render('QuizmooQuestionnaireBundle:Question:new.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create(\\FanFerret\\QuestionBundle\\Entity\\Question $question);", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n }\n\n $que = new Question();\n\n $que->setQuesId($this->request->getPost(\"quesid\"));\n $que->setDesc($this->request->getPost(\"desc\"));\n $que->setOrder($this->request->getPost(\"order\"));\n $que->setBkgrId($this->request->getPost(\"bkgrid\"));\n $que->setQtype($this->request->getPost(\"qtype\"));\n $que->setAmtText($this->request->getPost(\"amttext\"));\n $que->setAmtType($this->request->getPost(\"amttype\"));\n $que->setCrdt($this->request->getPost(\"crdt\"));\n $que->setCrdtId($this->request->getPost(\"crdtid\"));\n $que->setUpdt($this->request->getPost(\"updt\"));\n $que->setUpdtId($this->request->getPost(\"updtid\"));\n $que->setDelmark($this->request->getPost(\"delmark\"));\n \n\n if (!$que->save()) {\n foreach ($que->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"ques\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"Question was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n\n }", "public function createAction(Request $request) {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('question_show', array('id' => $entity->getQuestionId())));\n }\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create(Productquestion $productquestion)\n {\n //\n }", "public function createquestionAction()\r\n {\r\n\r\n // Check Post\r\n if ($this->getRequest()->isPost()) {\r\n\r\n $params = $this->getRequest()->getParams();\r\n $questionname = trim($params['questionNameCreate']);\r\n\r\n\r\n $error = \"\";\r\n \r\n\r\n if (strlen($questionname)>50)\r\n $error .= \"Le nom de la question doit être compris entre 1 et 50 caractères. \";\r\n if (!empty($error)) {\r\n $this->_helper->json(array(\r\n 'code' => $error\r\n ));\r\n }\r\n $auth = Zend_Auth::getInstance();\r\n $userGroupId = $auth->getIdentity()->UserGroupIdF;\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // create the new group\r\n $idInsert = $question->createQuestion($questionname, $userGroupId);\r\n\r\n if ($idInsert == \"nok\") {\r\n $msg = \"Contactez un administrateur svp.\";\r\n $this->_helper->json(array(\r\n 'code' => $msg\r\n ));\r\n }\r\n $this->_helper->json(array(\r\n 'code' => '42'\r\n ));\r\n }\r\n }", "public function createQuestion($Question){\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_QuestionDAO->createQuestion($Question);\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in QuestionDAO.createQuestion()\");\t\t\n\n\t\treturn $Result;\n\n\t\n\t}", "public function actionCreate() {\n $test = $this->tests->add($this->user->id);\n $values['test_id'] = $test->id;\n $this->questions->add($values);\n $this->redirect('Test:edit', $test->id);\n }", "public function store(StoreQuestionRequest $request)\n {\n $question = new Question();\n $question->type = $request->input('type');\n $question->title = $request->input('title');\n $question->quiz()->associate($request->input('quiz'));\n $question->feedback = $request->input('feedback', null);\n try {\n $question->save();\n session()->flash('success', 'Question created!');\n return response()->json([\n \"error\" => false,\n \"code\" => 201,\n \"reason\" => \"Question created!\"\n ]);\n } catch (\\Exception $exception) {\n logger($exception);\n session()->flash('error', 'Question could not be created!');\n return response()->json([\n \"error\" => true,\n \"code\" => 500,\n \"reason\" => \"Question could not be created!\"\n ]);\n }\n }", "public function create()\n\t{\n\t\treturn view('questions.createQuestion');\n\t}", "public function create()\n {\n $question = new Question();\n return view('questions.create', compact('question'));\n }", "public function store(Request $request){\n $question = new Question();\n $question->questionnaire_id = $request->input('q_id');\n $question->question_name = $request->input('q_name');\n $question->question_type = $request->input('q_type');\n $question->choices = $request->input('choices');\n $question->answer = $request->input('q_ans');\n $question->points = $request->input('q_point');\n $question->save();\n }", "public function createAction(Request $request)\n {\n $entity = new StudyQuestions();\n \n $form = $this->createForm(new StudyQuestionsType(), $entity);\n $form->bind($request);\n $entity->setCreatedAt(new \\DateTime()); \n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('studyquestions_show', array('id' => $entity->getId())));\n }\n\n return $this->render('CompeteComBundle:StudyQuestions:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate($question_id)\n {\n $model = new QuestionAnswer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['question/view', 'id' => $question_id]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'question' => $this->findQuestionModel($question_id)\n ]);\n }", "public function create($question, $type = ObjectFactory::TEXT_QUESTION)\n\t{\n\t\t// echo $type;\n\t\t$newQuestion = $this->objectFactory->createQuestion($type);\n\t\t// if ($type == ObjectFactory::SINGLE_CHOICE_QUESTION) echo \"single\";\n\t\t// echo $question;\n\t\t$newQuestion->setQuestion($question);\n\t\t$this->questions[$newQuestion->getId()] = $newQuestion;\n\t\treturn $newQuestion;\n\t}", "public function createAction(Request $request)\r\n {\r\n $em = $this->getDoctrine()->getManager('interview');\r\n $entity = new Question();\r\n $form = $this->createForm(new QuestionType($em), $entity);\r\n $form->bind($request);\r\n\r\n if ($form->isValid()) {\r\n $em->persist($entity);\r\n $em->flush();\r\n\r\n return $this->redirect($this->generateUrl('question_answer', array('id' => $entity->getId())));\r\n }\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "abstract protected function create(string $name, string $description, array $variants): Question;", "public function create()\n\t{\n\t\treturn view('admin.question.create');\n\t}", "public function store(Question $question, CreateAnswerRequest $request)\n {\n // dd($question);\n $question->answers()->create([\n 'body' => $request->body,\n 'user_id' => auth()->id(),\n ]);\n\n session()->flash('success', 'Answer has been added successfully');\n return redirect($question->url);\n }", "public function create()\n {\n $question=new Question();\n return view('questions.create',compact('question'));\n }", "public function create()\n {\n //get new question instance\n $question = new Question;\n\n //set edit variable as false : new question\n $edit = FALSE;\n\n //display the question view\n return view('questionForm', ['question' => $question,'edit' => $edit ]);\n }", "public function newAction()\r\n {\r\n $entity = new Question();\r\n $em = $this->getDoctrine()->getManager('interview');\r\n $form = $this->createForm(new QuestionType($em), $entity);\r\n\r\n return array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n );\r\n }", "public function store(AskQuestionRequest $request)\n {\n $request->user()->questions()->create($request->only('title', 'body'));\n return redirect()->route('questions.index')->with('success', 'Your Question has been created');\n }", "public function create()\n {\n return view('backend.question.create');\n }", "public function store(Question $question, Request $request)\n {\n $request->validate([\n 'body' => 'required|min:2'\n ]);\n\n $answer = $question->answers()->create(['body' => $request->body, 'user_id' => Auth::id()]);\n\n return response()->json([\n 'message' => \"Your answer has been submitted successfully\",\n //Eager load user relationship\n 'answer' => new AnswerResource($answer->load('user')),\n ]);\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create()\n {\n return view('questions.create');\n }", "public function create(Entity $entity);", "public function actionCreate()\n\t{\n\t\t$model = new Question();\n\t\t$model->user = Yii::$app->user->id*1;\n\t\t$model->text = 'Новый опрос';\n\t\t$model->save(true,['user','text']);\n\t\treturn $this->redirect(['update', 'id' => $model->id]);\n\t}", "public function create()\n {\n //\n return view('question.create');\n }", "public function create()\n {\n return view('questions.create');\n\n }", "public function store(QuestionRequest $request)\n\t{\n\t\tQuestion::create($this->questionRepository($request));\n flash('Create question success!', 'success');\n return redirect('admin/questions');\n\t}", "public function store(StoreQuestion $request)\n {\n\n\n $validated = $request->validated();\n\n\n\n Question::create([\n 'question_text' => $validated['question_text']\n ]);\n\n\n $placeholder = $this->newExample();\n $questions = Question::with('answers')->get();\n return redirect('/Question');\n\n }", "public function create()\n {\n \n \n\n return view('questions.create');\n \n\n }", "public function create( Question $question)\n {\n return view('admin.pages.answer.create',compact('question'));\n\n\n }", "public function store(QuestionRequest $request)\n {\n\n\n\n $requests=[\n \"ask\"=>$request->ask,\n \"answer\"=>$request->answer,\n \"user_id\"=>auth()->user()->id,\n \"status\"=>($request->status==\"on\") ? \"1\":\"0\",\n \"order\"=>$request->order,\n \"lang_id\"=>$request->lang,\n\n\n ];\n\n return Question::CreateRecord(Question::SpaceName(),$requests,$request,\"questions.index\",true,null,true,\"images\",false,null);\n\n\n\n }", "public function create($question, $type = ObjectFactory::TEXT_QUESTION) {\n $questionObj = $this->objectFactory->createQuestion($type);\n $questionObj->setQuestion($question);\n $this->poll->addItem($questionObj);\n return $questionObj;\n\t}", "public function store(CreateQuestionRequest $request)\n {\n// dd(dd($request['chapter_id']));\n $question = $this->questionRepository->saveRecord($request);\n\n Flash::success($this->BreadCrumbName . ' saved successfully.');\n if (isset($request->continue)) {\n $redirect_to = redirect(route('admin.questions.create'));\n } elseif (isset($request->translation)) {\n $redirect_to = redirect(route('admin.questions.edit', $question->id));\n } else {\n $redirect_to = redirect(route('admin.questions.index'));\n }\n return $redirect_to->with([\n 'title' => $this->BreadCrumbName\n ]);\n }", "public function createEntity();", "public function create()\n {\n $question = new Question;\n $edit = FALSE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function store(Request $request,Question $question)\n {\n $question->answers()->create(\n [\n 'text'=>$request->body,\n 'user_id'=> Auth::id()\n ]\n )->save();\n\n// return view('questions.show',[\n// 'question'=>$question,\n// 'success'=>'success'\n// ]);\n return redirect()->route('questions.show',$question->slug)->with('success','Answered Successfull!');\n\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "public function create($entity);", "public function create()\n {\n return view('question.create');\n }", "public function create()\n {\n return view('admin.question.create');\n }", "public function create()\n {\n $questions=Question::all();\n return view('backend.truefalsequestions.create',compact('questions'));\n }", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "public function create(){\n\n // returning view and results\n return view('create_question');\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 store(Question $question, Request $request)\n {\n $question->answers()->create([\n 'body'=>$request->body,\n 'user_id'=>auth()->id()\n ]);\n session()->flash('success', 'Your answer has been submitted successfully');\n return redirect($question->url);\n }", "public function store(Request $request)\n {\n $question = new Question;\n $question->prompt = $request->prompt;\n $question->difficulty = $request->difficulty;\n $question->total_score = $request->total_score;\n $question->subject_id = 1;\n $question->save();\n\n $a1 = new Answer;\n $a2 = new Answer;\n $a3 = new Answer;\n $a4 = new Answer;\n $a5 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n $a3->text = $request->choice3;\n $a4->text = $request->choice4;\n $a5->text = $request->choice5;\n\n $a1->save();\n $a2->save();\n $a3->save();\n $a4->save();\n $a5->save();\n\n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n $question->answers()->attach($a3->id, array('is_correct' => ($request->isCorrect3 != 1 ? 0 : 1)));\n $question->answers()->attach($a4->id, array('is_correct' => ($request->isCorrect4 != 1 ? 0 : 1)));\n $question->answers()->attach($a5->id, array('is_correct' => ($request->isCorrect5 != 1 ? 0 : 1)));\n\n // return Redirect::back()->withMsg('Quiz Question Created');\n return redirect('/question');\n }", "public function create()\n {\n return view('admin.typeQuestion.create');\n }", "public function newQuestion($question, $connection) {\r\n\t\t$connection -> exec(\"INSERT INTO `\".$GLOBALS['dbPrefix'].\"question_question` (`set`, `question`, `mode`) VALUES (\" . $this -> setid . \", '\" . $question -> getQuestion() . \"', '\" . $question -> getMode() . \"')\");\r\n\t\t$question -> setId($connection -> lastInsertId());\r\n\t\tarray_push($this -> questions, $question);\r\n\t}", "public function store(Request $request): JsonResponse\n {\n// if (!$request->question_pack_id\n// || !$request->question_level_id\n// || !$request->name\n// || !$request->question_type_id) {\n// return $this->respondNotFound();\n// }\n $question = Question::query()->create([\n 'name' => $request->name,\n 'question_pack_id' => $request->question_pack_id,\n 'question_level_id' => $request->question_level_id,\n 'question_type_id' => $request->question_type_id,\n 'time' => $request->time\n ]);\n return $this->respond($question);\n }", "public function store(Question $question, Request $request)\n {\n $question->replies()->create($request->all());\n $message = [\n 'status'=> 'success',\n 'message'=> 'reply created successfully!'\n ];\n \n return response()->json($message, 201);\n }", "public function createQuestionAction(int $id) : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateQuestionForm($this->di, $id);\n $form->check();\n\n $page->add(\"questions/crud/create-question\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a question\",\n ]);\n }", "public function __construct(Question $question)\n {\n $this->question = $question;\n }", "function create($entity);", "public function actionCreate()\n {\n $model = new Quotation();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function question($id)\n {\n return $this->create($id);\n }", "public function create()\n {\n $data=SetInformationLang(auth()->user(),$this->defaultPosition,$this->defaultCode);\n\n $trans=$data['trans'];\n $code=$data['code'];\n $position=$data['position'];\n return view(\"admin.question.create\",compact(\"code\",\"position\",\"trans\"));\n }", "public function create()\n {\n $quest = Quest::make();\n\n return view('system.quests.create', compact('quest'));\n }", "public function store(Request $request)\n {\n $question = new Question;\n $question->quiz_id = $request->quiz_id;\n $question->text = $request->question_text;\n $question->save();\n\n // for some reason it won't show on the page without the answers array\n // (may need to look into this later)\n $question->answers = [];\n\n return response(['question' => $question]);\n }", "public function create()\n {\n //\n $this->authorize('create', Question::class);\n $quizzes= Quiz::all();\n return view('question.create' compact('quizzes'));\n\n }", "public function create()\n {\n return view('question.add');\n }", "public function create()\n\t{\n\t\t$tags = Tag::pluck('name', 'id')->all();\n\t\treturn view('questions.createQuestion', compact('tags'));\n\t}", "public function store($project, CreateQuestionRequest $request)\n {\n $this->questions->create(\n\t\t\t$request->all(),\n\t\t\t$project\n\t\t);\n return redirect()->route('admin.project.questions.editall', $project->id)->withFlashSuccess('The question was successfully created.');\n }", "public function create()\n {\n $tags = QuestionTag::allTags();\n \n return view('questions.create', compact('tags'));\n }", "private function createCreateForm(Question $entity) {\n $form = $this->createForm(new QuestionType(), $entity, array(\n 'action' => $this->generateUrl('question_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create()\n {\n $questionData = getQuestionsData(); //Helper function in app\\Support\\helpers.php\n $numberAnswers = $questionData[0];\n $typeKeys = $questionData[1];\n $typeValues = $questionData[2];\n \n return view('questions.create', compact('typeKeys', 'typeValues', 'numberAnswers')); \n }", "public function create(Request $request)\n {\n $client = $request->input('client');\n $area = $request->input('area');\n $address = $request->input('address');\n $parent_company = $request->input('parent_company');\n $contact_id = $request->input('contact_id');\n $general_id = $request->input('general_id');\n $report_id = $request->input('report_id');\n $user_id = $request->input('user_id');\n $branch_id = $request->input('branch_id');\n $questionnaire = new Questionnaire([\n 'client' => $client,\n 'area' => $area,\n 'address' => $address,\n 'parent_company' => $parent_company,\n 'contact_id' => $contact_id,\n 'general_id' => $general_id,\n 'report_id' => $report_id,\n 'user_id' => $user_id,\n 'branch_id' => $branch_id\n ]);\n $questionnaire->save();\n return response()->json($questionnaire);\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'question' => 'required|string',\n 'created_by' => 'required|numeric',\n ]);\n\n if ($validator->fails()) {\n return response(['errors' => $validator->errors()], 422);\n }\n\n return Question::create($request->all());\n }", "public function create()\n {\n $animals = Animal::all();\n $ani = [];\n foreach ($animals as $animal) {\n $ani[$animal -> animal_id] = $animal -> animal_name;\n }\n\n $worksheets = Worksheet::all();\n $works = [];\n foreach ($worksheets as $worksheet) {\n $works[$worksheet -> worksheet_id] = $worksheet -> worksheet_name;\n }\n\n $descriptions = Question_description::all();\n $descrip = [];\n foreach ($descriptions as $description) {\n $descrip[$description -> description_id] = $description -> description;\n }\n\n\n return view('pages/data_manage/question/create') -> withAni($ani) \n -> withAnimals($animals)\n -> withWorks($works)\n -> withDescrip($descrip);\n }", "public function store(QuestionRequest $request)\n { \n $question = Question::create( $request->all() );\n\n $question->status = 'unpublished';\n\n if($request->status == 'on') $question->status = 'published';\n\n $question->save();\n\n session()->flash('flashMessage', 'La question a été ajoutée');\n\n return redirect()->route('dashboard');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'title'=>'required|min:2',\n 'body' =>'required'\n ]);\n $request->user()->questions()->create($request->only(['title','body']));\n return redirect()->route('questions.index')->with('success','Sual xetasiz qeyd olundu');\n }", "public function store(StoreQuestionRequest $request)\n {\n try { \n \n DB::beginTransaction();\n\n Question::addQuestion();\n\n DB::commit();\n\n session()->flash('success', 'Question created successfully.');\n\n } catch(\\Exception $e) {\n\n DB::rollBack();\n\n session()->flash('error', $e->getMessage());\n }\n\n return redirect()->route('question.list');\n }", "public function actionCreate()\n {\n $model = new AeExtQuiz;\n\n try {\n if ($model->load($_POST) && $model->save()) {\n\n if ($questions = Yii::$app->request->post('outer-group')) {\n $app_id = $model->app_id;\n $quiz_id = $model->id;\n AeExtQuizSet::addOrUpdateRelations($questions, $app_id, $quiz_id, false);\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } elseif (!\\Yii::$app->request->isPost) {\n $model->load($_GET);\n }\n\n } catch (\\Exception $e) {\n $msg = (isset($e->errorInfo[2])) ? $e->errorInfo[2] : $e->getMessage();\n $model->addError('_exception', $msg);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'questions' => AeExtQuizQuestionController::getAllQuestions(),\n 'questions_json' => '',\n ]);\n }", "public function store(Question $question, Request $request)\n {\n //karena di route kita include {question}\n // we need to capture the question by specify or type-hint\n // argumen pertama with a question instance\n dd($question);\n // kalau valid pass gan\n $answer = $question->answers()->create($request->validate([\n // specifyy validation rules to answer body\n 'body' => 'required'\n ]) + ['user_id' => \\Auth::id()]);\n\n if($request->expectsJson()){\n return response()->json([\n 'message' => \"Your answer has been submited succesfully\",\n 'answer' => $answer->load('user')\n ]);\n }\n\n // back to previous page\n return back()->with('success', \"Your answer has been submitted successfully\");\n\n }", "public function actionCreate() {\n $model = new QA();\n $request = \\Yii::$app->getRequest();\n if ($request->isPost && $model->load($request->post())) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return ['success' => $model->save()];\n }\n }", "public function create()\n {\n return view('admin/question/create');\n }", "public function create()\n {\n if(!Auth::user()->is_admin == 1){\n abort(404, 'Page not found');\n }\n return view('Question.create');\n }", "public function actionCreate($question_id, $survey_id)\n //$survey_id ist notwendig, um auf die Survey zurückzukommen, für die man die Answer erstellt hat.\n {\n $model = new Answer();\n\n //Die Question holen, die im survey/view erstellungsformular erstellt wurde.\n $question = Question::find()->where(['id'=>$question_id]);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $model->link('questions', $question->one());\n return $this->redirect(['survey/view/', 'id' => $survey_id]);\n\n } else {\n return $this->render('create', ['id'=>$question_id,\n 'model' => $model,\n ]);\n }\n\n }", "public function testQuestionTypeEntity() {\n $values = [];\n $bundle = new QuestionType($values, 'quiz_question_type');\n\n $this->assertInstanceOf('\\Drupal\\quiz\\Entity\\QuestionType', $bundle);\n }", "public function create()\n {\n return view('quest.create');\n }", "public function newAction()\n {\n $entity = new StudyQuestions();\n $form = $this->createForm(new StudyQuestionsType(), $entity);\n\n return $this->render('CompeteComBundle:StudyQuestions:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n //\n if (\\Auth::guest())\n return redirect()->guest('login');\n\n $sections = null;\n\n $data = [\n 'pagetitle' => 'Draft a Question',\n 'sections' => $sections\n ];\n return view('questions.create',$data);\n }", "public function store(Requests\\StoreQuestionRequest $request)\n\t{\n\t $tags = $this->normalizeTag($request->get('tags'));\n\t\t$data = [\n 'title' => $request->get('title'),\n 'content' => $request->get('mdContent'),\n 'username' => Auth::user()->name,\n ];\n\n\t\t$question = Question::create($data);\n\n\t\t$question->tags()->attach($tags);\n $user = User::find(Auth::user()->id)->increment('questions_count');\n\n\t\tflash('提问成功!', 'success');\n\n\t\treturn redirect()->route('questions.show', [$question->id]);\n\t}", "public function create()\n {\n return view('questions::frontend.create');\n }", "public function testQuestionCreatePostWithValidData() {\n //Select catalogs\n $catalog = $this->course->catalog()->first();\n $subcatalogs = $catalog->children()->get();\n $ids = array();\n\n foreach ($subcatalogs as $c) {\n $ids[] = $c->id;\n }\n\n $post_data = array(\n 'course' => $this->course->id,\n 'type' => 'Question y',\n 'question' => 'Question y',\n 'answer' => 'Question y',\n 'catalogs' => $ids\n );\n $response = $this->post('question/create', $post_data);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public function createAction()\n {\n $post_request = (array) $this->postZingRequest();\n\n /** Handle the request */\n $errors = $this->_handleRequest($post_request);\n\n $api_manager = $this->get('zing.core.api.api');\n\n return $this->renderAdmin('ZingComponentPollBundle:Default:question/form.html.twig', array_merge(array_merge(array(\n 'zing_form_action' => 'create',\n 'zing_form_errors' => $errors,\n 'user_key' => $api_manager->createUserApiKey()\n ),\n array('post_request' => $post_request)\n ), $post_request));\n }", "public function createQuestion($questionnaire)\n {\n return view('admin.questions.create')->with('questionnaire', $questionnaire);\n }", "public function create(Test $test, Question $question)\n {\n return view('choice.create', ['test' => $test, 'question' => $question]);\n }", "public function store(QuestionRequest $request)\n {\n if($request->input('type')=='radio' or $request->input('type')=='checkbox'){\n foreach($request->input('option') as $v){\n if(empty($v)){\n $words = \"你有選項是空的!\";\n return view('layouts.error',compact('words'));\n }\n }\n }\n $att['order_by'] = $request->input('order_by');\n $att['title'] = $request->input('title');\n $att['description'] = $request->input('description');\n $att['type'] = $request->input('type');\n $att['test_id'] = $request->input('test_id');\n $att['content'] = serialize($request->input('option'));\n\n Question::create($att);\n return redirect()->route('questions.index',$request->input('test_id'));\n }", "public function createQuestionAndAnswers () {\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n\n\n $ilTabs->activateTab(\"editQuiz\");\n\n\n if ($wiz->checkInput()){\n $wiz->createQuestionAndAnswers($this->object);\n ilUtil::sendSuccess($this->txt(\"question_obj_create\"), true);\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n $this->initAddQuestionAndAnswersFormAfterError();\n //$tpl->setContent(\"Test\");\n }", "public function store(Request $request)\n {\n //To store the user question\n\n $question = new Question([\n 'question' => $request->question,\n 'description' => $request->description,\n 'askedby' => $request->authUser,\n ]);\n\n $question->save();\n\t return response()->json([\n\t\t\t'message' => 'Question Submitted Successfully'\n\t \t], 201);\n }", "public function create($questionId)\n {\n $question = Question::where('id', $questionId)->with('subject')->get()->first();\n // dd($question);\n return view('studentAnswers.create', compact('questionId', 'question'));\n }", "public function store(Request $request)\n {\n $validate = validator($request->all(), [\n 'name_ar' => 'required|max:200|unique:questions',\n 'name_en' => 'required|max:200|unique:questions',\n 'notes_ar' => 'nullable',\n 'notes_en' => 'nullable',\n 'is_multi' => 'boolean|nullable',\n 'is_text' => 'boolean|nullable',\n 'active' => 'boolean|nullable',\n 'order' => 'numeric|nullable',\n ]);\n\n if ($validate->fails()) {\n return redirect()->back()->withErrors($validate->errors());\n }\n if (!$request->is_multi) {\n $request->request->add(['is_text' => true]);\n }\n $element = Question::create($request->all());\n if ($element) {\n return redirect()->back()->with('success', 'question created successfully');\n }\n return redirect()->back()->with('error', 'question is not created');\n }", "public function store(Request $request)\n {\n $rules = [\n 'title' => 'required|min:20|max:1000',\n 'answers' => 'required|min:10|max:1000',\n 'right_answer' => 'required|min:3|max:100',\n 'score' => 'required|integer|in:5,10,15,20,25,30',\n 'type' => 'required|in:text,checkbox',\n 'quiz_id' => 'required|integer',\n ];\n\n $this->validate($request, $rules);\n\n if(Question::create($request->all())) {\n return redirect('/admin/questions')->withStatus('Question successfully created.');\n }else {\n return redirect('/admin/questions/create')->withStatus('Something Wrong, Try again.');\n }\n }" ]
[ "0.8293698", "0.71725", "0.69828284", "0.6895809", "0.67903924", "0.6594571", "0.65870386", "0.65495354", "0.65425205", "0.6504954", "0.6458008", "0.6439501", "0.64351386", "0.64271814", "0.6420468", "0.64196134", "0.64028704", "0.63661873", "0.6360412", "0.6334223", "0.63221514", "0.62694114", "0.62692946", "0.6256677", "0.62449837", "0.62449837", "0.62449837", "0.62387395", "0.62364227", "0.6231913", "0.622429", "0.62203383", "0.6219389", "0.62159127", "0.6205768", "0.62027806", "0.619892", "0.61987245", "0.61889416", "0.6181317", "0.6179223", "0.6174965", "0.6174965", "0.61697835", "0.6142064", "0.61329865", "0.61323786", "0.61301154", "0.6126227", "0.60994726", "0.60872674", "0.6073394", "0.60701567", "0.6058587", "0.6028493", "0.60114366", "0.6004184", "0.60026294", "0.5992506", "0.59891057", "0.59842813", "0.5974925", "0.5973545", "0.59666324", "0.5965045", "0.59561604", "0.59561557", "0.5955661", "0.5944797", "0.59445673", "0.5930582", "0.5925957", "0.5923555", "0.5917258", "0.5915632", "0.5913874", "0.5913212", "0.59084266", "0.5902916", "0.5901497", "0.58980113", "0.58830845", "0.5874848", "0.5845521", "0.5827245", "0.5826181", "0.58253145", "0.58116245", "0.5810405", "0.5809337", "0.5807317", "0.58057886", "0.5796712", "0.57960457", "0.57823724", "0.57729644", "0.5766909", "0.57640564", "0.57597387", "0.5756848" ]
0.65926975
6
Displays a form to edit an existing Question entity.
public function editAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $editForm = $this->createForm(new QuestionType(), $entity); $deleteForm = $this->createDeleteForm($id); return $this->render('QuizmooQuestionnaireBundle:Question:edit.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\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(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n return view('admin.edit_question',compact('question'));\n }", "public function edit(question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n return view('admin.questions.edit',compact('question'));\n }", "public function edit(Question $question)\n {\n //\n $this->authorize('update', $question);\n $quizzes= Quiz::all();\n return view('question.edit',compact('question','quiz'));\n }", "public function edit(Question $question)\n {\n return view('edit_question', compact('question'));\n }", "public function edit(Question $question)\n {\n return view('admin.question.edit', compact('question'));\n }", "public function edit(Question $question)\n {\n return view('question.edit', compact('question'));\n }", "public function edit(Question $question)\n {\n\n $data=SetInformationLang(auth()->user(),$this->defaultPosition,$this->defaultCode);\n\n $trans=$data['trans'];\n $code=$data['code'];\n $position=$data['position'];\n return view(\"admin.question.edit\",compact(\"question\",\"code\",\"position\",\"trans\"));\n }", "public function edit(Question $question)\n {\n return view('questions.edit', compact('question'));\n }", "public function edit(Question $question)\n {\n $questionData = getQuestionsData(); //Helper function in app\\Support\\helpers.php\n $numberAnswers = $questionData[0];\n $typeKeys = $questionData[1];\n $typeValues = $questionData[2];\n return view('questions.edit', compact('question', 'typeKeys', 'typeValues', 'numberAnswers')); \n }", "public function edit($id)\n\t{\n\t\t$question = Question::findOrFail($id);\n return view('admin.question.edit', compact('question'));\n\t}", "public function edit(Question $question)\n {\n// if (\\Gate::allows('update-question',$question)){\n// return view('questions.edit',compact('question'));\n// }\n//\n// abort('404','Sehifeye giris izniniz yoxdur');\n $this->authorize('update',$question);\n return view('questions.edit',compact('question'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CompeteComBundle:StudyQuestions')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find StudyQuestions entity.');\n }\n\n $editForm = $this->createForm(new StudyQuestionsType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CompeteComBundle:StudyQuestions:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editAction()\n {\n /* Checking if user is signed in to be allowed to edit answer */\n $this->requireSignin();\n\n /* Getting user's id */\n $user = Auth::getUser();\n \n /* Getting Answer by id */\n $this_answer = Answer::getById(intval($_POST['answer_id']));\n\n /* Getting Question by id for redirecting back after editing */\n $this_question = Question::getById($this_answer->question_id);\n\n /* Checking if user is answer's author */\n if ($this_answer->user_id == $user->id) {\n\n /* Updating answer details */\n $answer = new Answer([ \n 'id' => $_POST['answer_id'],\n 'answer' => $_POST['new_answer'], \n ]);\n \n if ($answer->update()) {\n\n /* Show success message */\n Flash::addMessage(\"Done: Answer was updated!\", Flash::INFO);\n \n } else {\n \n /* Show error messages */\n Flash::addMessage(\"Error: \".implode(\", \", $answer->errors), Flash::INFO);\n }\n\n } else {\n\n /* Redirect to question's page and show error messages */\n Flash::addMessage(\"Error: You can not edit this answer.\", Flash::INFO);\n }\n\n /* Redirect to question page */\n $this->redirect(\"/question/\".$this_question->url);\n }", "public function edit(Question $question)\n {\n $tags = QuestionTag::allTags();\n\n return view('questions.edit', compact('question', 'tags'));\n }", "public function edit($id)\n {\n $q = Question::find($id);\n return view('admin.questions.edit' , compact('q'));\n }", "public function edit(Question $question)\n {\n if($question->user_id != auth()->user()->id)\n return redirect()->back();\n $studies = auth()->user()->studies;\n return view('teacher.question.edit',[\n 'studies' => $studies,\n 'question' => $question\n ]);\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(Questions $questions)\n {\n //\n }", "public function edit($id)\n {\n $question = Question::findOrFail($id);\n \n\n return view('questions.edit', compact('question'));\n }", "public function edit($id)\n {\n //\n $question = Question::find($id);\n return view('Q&A.edit', compact('question'));\n }", "public function edit($id)\n {\n $row = Question::find($id);\n return view('questions.edit', ['question' => $row]);\n }", "public function edit($id)\n {\n $question = Question::find($id);\n // dd($question);\n return view('questions::frontend.edit', compact('question'));\n }", "public function edit($id)\n {\n $question = Question::find($id);\n return view('question.edit', compact('question'));\n }", "public function edit($id)\n {\n $question = Question::findOrFail($id);\n\n return view('questions.edit')->with(array(\n 'question' => $question\n ));\n }", "public function edit($id)\n {\n $question = Question::find($id);\n return view('question.edit', ['question' => $question]);\n }", "public function edit($id)\n {\n $question=Question::find($id);\n return view('questions.edit',compact('question'));\n }", "public function edit($id)\n {\n $question = $this->questionRepository->findWithoutFail($id);\n\n if (empty($question)) {\n Flash::error($this->BreadCrumbName . ' not found');\n return redirect(route('admin.questions.index'));\n }\n\n BreadcrumbsRegister::Register($this->ModelName,$this->BreadCrumbName, $question);\n return view('admin.questions.edit')->with(['question' => $question, 'title' => $this->BreadCrumbName]);\n }", "public function edit($id)\n {\n\n $question = Question::find($id);\n\n return view('question.edit', compact('question'));\n }", "public function edit($id)\n {\n $Question = Question::findOrFail($id);\n return view('question.edit', compact('Question'));\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 }", "private function createEditForm(Question $entity) {\n $form = $this->createForm(new QuestionType(), $entity, array(\n 'action' => $this->generateUrl('question_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit($id)\n {\n $question = Question::where('id','=',$id)->first();\n return view('question.edit',compact('question'));\n }", "public function edit($question_id)\n {\n $questionData = Question::where('question_id', $question_id) -> first();\n $optionData = Question_option::where('question_id', $question_id) -> get();\n\n $animals = Animal::all();\n $ani = [];\n foreach ($animals as $animal) {\n $ani[$animal -> animal_id] = $animal -> animal_name;\n }\n\n $worksheets = Worksheet::all();\n $works = [];\n foreach ($worksheets as $worksheet) {\n $works[$worksheet -> worksheet_id] = $worksheet -> worksheet_name;\n }\n\n $descriptions = Question_description::all();\n $descrip = [];\n foreach ($descriptions as $description) {\n $descrip[$description -> description_id] = $description -> description;\n }\n\n return view('pages/data_manage/question/edit')\n -> withQuestionData($questionData)\n -> withOptionData($optionData)\n -> withAni($ani)\n -> withWorks($works)\n -> withDescrip($descrip);\n }", "public function edit($id)\n {\n $question=(new Question)->getQuestionById($id);\n $quizzes=(new Quiz)->allQuiz();\n return view('backend.question.edit',compact('question','quizzes'));\n }", "public function edit($id){\n\n // DB query here\n $question = Question::findOrFail($id);\n\n // returning view and results\n return view('edit_question', ['question' => $question]);\n }", "public function edit(enquiryForm $enquiryForm)\n {\n //\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Activity_Service_ShareQq::get(intval($id));\n\t\t$this->assign('info', $info);\n\t}", "public function editQuestionAction($questionId)\n {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getManager();\n\n $questionRepository = $em->getRepository('TeclliureQuestionBundle:Question');\n\n $entity = $questionRepository->find($questionId);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n if ($request->isXmlHttpRequest()) {\n $questionForm = $this->createForm(new QuestionType(), $entity);\n $questionary = $entity->getQuestionary();\n\n\n return $this->render(':ajax:base_ajax.html.twig', array(\n 'template' => 'TeclliureQuestionBundle:Question:questionForm.html.twig',\n 'entity' => $questionary,\n 'questionForm' => $questionForm->createView(),\n 'questionFormError' => true\n ));\n }\n else {\n return $this->render(':msg:error.html.twig', array(\n 'msg' => 'Error: Not ajax call'\n ));\n }\n }", "public function edit($id)\n {\n //\n if(!\\Auth::check())\n return redirect()->route('questions.index');\n\n $question = Document::question()->where('id',$id)->first();\n if(!$question)\n return redirect()->route('questions.index');\n if(!$question->isEditor())\n return redirect()->route('questions.show',$question->id);\n\n $data = [\n 'pagetitle' => 'Draft a Question',\n 'document' => $question,\n 'input' => $question->toArray(),\n 'sections' => $question->sections->toArray()\n ];\n return view('questions.create',$data);\n }", "public function edit($id)\n {\n $question = QuestionRiaSec::find($id);\n\n return view('admin.questions.RIASEC.edit', compact('question'\n ));\n }", "public function edit($project, $question)\n {\n \n //$question = $this->questions->findOrThrowException($id, true); //dd((array) $question->answers);\n $answers = count((array) $question->answers);\n if(empty($answers)){\n $answers = 1;\n }\n javascript()->put([\n\t\t\t'index' => $answers\n\t\t]);\n return view('backend.project.questions.edit')\n ->withQuestion($question)\n ->withQuestions($this->questions->getAllQuestions('qnum', 'asc')->prepend(['none' => 'None'])) \n ->withProjects($this->project->getAllProjects('name','asc',true))\n ->withOrganizations($this->organization->getAllOrganizations('name', 'asc', ['projects']));\n }", "public function edit(Question $question,Answer $answer)\n {\n $this->authorize('update',$answer);\n return view('answers.edit',['question'=>$question,'answer'=>$answer]);\n }", "public function editAction()\r\n\t{\r\n\t\t$id = $this->getRequest()->getParam('faq_id');\r\n\t\t$model = Mage::getModel('flagbit_faq/faq');\r\n\t\t\r\n\t\t// if current id given -> try to load and edit current FAQ item\r\n\t\tif ($id) {\r\n\t\t\t$model->load($id);\r\n\t\t\tif (!$model->getId()) {\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError(\r\n\t\t\t\t\tMage::helper('flagbit_faq')->__('This FAQ item no longer exists')\r\n\t\t\t\t);\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data = Mage::getSingleton('adminhtml/session')->getFormData(true);\r\n\t\tif (!empty($data)) {\r\n\t\t\t$model->setData($data);\r\n\t\t}\r\n\t\t\r\n\t\tMage::register('faq', $model);\r\n\t\t\r\n\t\t$this->_initAction()\r\n\t\t\t\t->_addBreadcrumb(\r\n\t\t\t\t\t$id\r\n\t\t\t\t\t\t? Mage::helper('flagbit_faq')->__('Edit FAQ Item')\r\n\t\t\t\t\t\t: Mage::helper('flagbit_faq')->__('New FAQ Item'),\r\n\t\t\t\t\t$id\r\n\t\t\t\t\t\t? Mage::helper('flagbit_faq')->__('Edit FAQ Item')\r\n\t\t\t\t\t\t: Mage::helper('flagbit_faq')->__('New FAQ Item')\r\n\t\t\t\t)\r\n\t\t\t\t->_addContent(\r\n\t\t\t\t\t\t$this->getLayout()\r\n\t\t\t\t\t\t\t\t->createBlock('flagbit_faq/adminhtml_item_edit')\r\n\t\t\t\t\t\t\t\t->setData('action', $this->getUrl('adminhtml/faq/save'))\r\n\t\t\t\t)\r\n\t\t\t\t->_addLeft($this->getLayout()->createBlock('flagbit_faq/adminhtml_item_edit_tabs'));\r\n\t\t\r\n\t\t$this->renderLayout();\r\n\t}", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit($id)\n {\n $category = $this->category->all();\n $question = $this->question->find($id);\n $question->category;\n $answer = $question->answer;\n return view('certification.question.edit')\n ->with([\n 'question' => $question,\n 'category' => $category,\n 'answer' => $answer\n ]);\n }", "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 {\n $questionId = questionaire::findOrFail($id);\n return view('questionaire.EditQuestion', compact('questionId'));\n }", "public function edit($id)\n {\n //\n // $question = \\App\\Question::find($id);\n\n // return view('view.register', compact('question'));\n }", "public function edit($id)\n\t{\n\t\t$question = Question::find($id);\n\n\t\tif ( Auth::check() ) \n\t\t{\n\t\t\tif ( Auth::user()->id == $question->user_id ) {\n\n\t\t\t\t$this->showLayoutWithTitle(\n\t\t\t\t\t\tView::make( 'questions.edit', compact('question') ),\n\t\t\t\t\t\t'Edit Question',\n\t\t\t\t\t\t$this->pageTitles['edit']\n\t\t\t\t);\n\t\t\t}\n\t\t\telse return $this->Index();\n\n\t\t} \n\t\telse return Redirect::route('index');\n\t}", "public function edit($id)\n {\n $questionnaire = Questionnaire::find($id);\n return view('questionnaire.edit', compact('questionnaire', 'id'));\n }", "public function edit($id)\n\t{\n\t\t$question = Question::findOrFail($id);\n\t\t$tags = Tag::all();\n\t\treturn view('questions.edit', compact('question', 'tags'));\n\t}", "public function editquestionAction(Request $request, $question_id) {\n $em = $this->getDoctrine()->getManager();\n $question = $em->getRepository('PollPollBundle:QuestionImpl')->find($question_id);\n $options = $em->getRepository('PollPollBundle:Choice\\OptionImpl')->findBy(array('question' => $question_id));\n\n $universal_question = new UniversalQuestion();\n $universal_question->populateQuestion($question);\n $universal_question->populateOptions($options);\n\n $form = $this->createForm(new EditQuestion(), $universal_question);\n $form->handleRequest($request);\n if ($form->isValid()) {\n $question = $question->populateQuestion($universal_question);\n $em->persist($question);\n\n foreach ($options as $option) {\n $em->remove($option);\n }\n\n if (in_array($universal_question->getType(), array(\n ObjectFactory::SINGLE_CHOICE_QUESTION,\n ObjectFactory::MULTIPLE_CHOICE_QUESTION))) {\n $options = $universal_question->getOptions();\n $options = preg_split('/\\R/', $options);\n $poll = $question->getPollId();\n\n foreach ($options as $opt) {\n $option = new OptionImpl();\n $option->setPoll($poll);\n $option->setOption($opt);\n $option->setQuestion($question);\n $em->persist($option);\n }\n }\n\n $em->flush();\n return $this->redirect($this->generateUrl('poll_show_one', array(\"poll_id\" => $question->getPollId()->getId())));\n }\n return $this->render('PollPollBundle:Poll:edit_question.html.twig', array('form' => $form->createView()));\n }", "public function edit($id)\n {\n $element = Question::whereId($id)->first();\n $answers = Answer::active()->get();\n return view('backend.modules.question.edit', compact('element', 'answers'));\n }", "public function edit($id)\n {\n $questions =Question::all();\n $truefalsequestion=TrueFalseQuestion::find($id);\n // dd($subcategory);\n return view ('backend.truefalsequestions.edit',compact('truefalsequestion','questions'));\n }", "public function edit($id_question)\n {\n $question = Question::find($id_question);\n $question['opsi'] = OpsiJawaban::where('id_question',$id_question)->get();\n return view('edit-question')->with('question',$question);\n }", "public function editTask() {\n return $this->render('enterprise/task/task_form.html.twig');\n }", "public function edit(Question_Test $question_Test)\n {\n //\n }", "public function edit(AuditQuestion $auditQuestion)\n {\n //\n }", "public function edit(Form $form)\n {\n //\n }", "public function editForm(): void\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $editArticle = $query->fetch();\n\n $this->title = $editArticle['title'];\n $this->content = $editArticle['content'];\n $this->category = $editArticle['category'];\n }", "public function edit($id)\n {\n //Récupération des datas sur la question\n $question = Question::find($id);\n\n //Récupération des datas nécéssaires au formulaire\n $category = Category::pluck('name', 'id');\n\n return view('back.question.edit', compact('question', 'category'));\n }", "public function edit($id)\n {\n $data = Quiz::where('id', $id)->first();\n\n return view('master.form.quiz-form', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$category = QuestionCategory::findOrFail($id);\n\n\t\t$this->layout->content = View::make('question-categories.edit')->with(compact('category'));\n\t}", "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(UserQuestion $userQuestion)\n {\n //\n }", "public function edit($id)\n {\n $exams = Exam::all();\n $difficultyLevels = Difficulty::all();\n // $exam1 = Exam::with('questions')->get();\n $question = Question::where('id', $id)->first();\n return view('add-question.edit', compact(['exams','difficultyLevels','question']));\n }", "public function edit(Quiz $quiz)\n {\n //\n }", "public function edit($id)\n {\n $question = Question::findOrFail($id);\n $topics = Topic::all();\n\n return view('admin.questions.edit', ['question' => $question, 'topics' => $topics]);\n }", "public function edit($id) {\n \n $page = 'questionnaire';\n \n $questionnaire = questionnaire::findOrFail($id);\n \n $catsQuestionnaire = $questionnaire->categories;\n \n //$questionsAll = Question::with('category')->paginate($this->nbPaginate);\n $questionsAll = Question::all();\n\n /*$questionsWithCats = Question::join('categories', 'categories.id', '=', 'questions.category_id')\n ->join('questionnaire')\n ->get();*/\n\n /*$questionsWithQ = Question::join('question_questionnaire', 'questions.id', '=', 'question_questionnaire.question_id')\n ->join('questionnaires', 'questionnaires.id', '=', 'question_questionnaire.questionnaire_id')\n ->get();*/\n\n $categories = Category::paginate(8);\n\n $questions = $questionnaire->questions()->paginate($this->nbPaginate);\n\n return view('admin.questionnaire-create-update', compact('page', 'questionnaire','categories', 'questions', 'questionsAll', 'catsQuestionnaire'));\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function editSurveyForm(Survey $survey)\n {\n return view('survey.editsurvey', ['survey'=>$survey]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function hydrateeditquestionformAction()\r\n {\r\n\r\n // Check Post\r\n if (!$this->getRequest()->isPost())\r\n die();\r\n\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n $question = $question->getOneQuestionById($questionId);\r\n $this->_helper->json($question);\r\n\r\n }", "public function edit($id)\n {\n $questions = Question::findOrFail($id);\n $categoryId = Category::pluck('name', 'id');\n return view('question.edit', compact(['questions', 'categoryId']));\n }", "public function edit($id)\n {\n //\n $questao = Questoes::find($id);\n\n return view('application.questoes.edit', compact('questao'));\n }", "public function edit($id)\n {\n $question = Question::findOrFail($id);\n $type = $question->typable_type;\n $view = 'forms.modals.'.$type.'.edit';\n return view($view, compact('question'));\n }", "public function edit($id, $question_id)\n {\n $input = [\n 'question' => Question::find($question_id),\n 'answers' => Answer::where('question_id',$question_id)->take(Question::find($question_id)->type == 0 ? 4 : 2)->get(),\n 'exam_id' => $id\n ];\n return view('admin.examQuestions.edit',$input);\n\n }", "public function edit(form $form)\n {\n //\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function edit()\n\t {\n\t return view('lecturer.edit');\n\t }", "public function edit(QuestionOption $questionOption)\n {\n return view('questionOptions.edit', compact('questionOption'));\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function editQuiz() {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n iljQueryUtil::initjQuery();\n\n $tpl->setContent($this->initQuestionAndAnswersTable());\n }", "public function edit()\n {\n return view('Person.edit');\n }", "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()\n {\n return view('admincp::edit');\n }", "public function edit(QuestionForum $questionForum)\n {\n //\n }", "public function edit(QuestionCategory $questionCategory)\n {\n $category = $questionCategory;\n return view($this->forms . '.edit', compact('category'));\n }", "public function edit($id)\n {\n $question = Question::findOrFail($id);\n\n // if the type is an option return a list of options to the user\n if($question['type'] == 3){\n //get all of the options that belong to it\n $options = Option::where('question', $id)->get();\n $question['options'] = $options;\n } else if($question['type'] == 4){\n $scale = Scale::where('question', $id)->first();\n $question['scale'] = $scale;\n }\n\n return view('admin.questions.edit')->with('question', $question);\n }", "public function edit($id)\n {\n $newquestion = Pertanyaan::where('id', $id)->first();\n return view('task17&18\\edit', compact('newquestion'));\n }" ]
[ "0.7946827", "0.7859411", "0.78564346", "0.7827021", "0.7823256", "0.7823256", "0.7823256", "0.77015096", "0.7680449", "0.7595589", "0.75841063", "0.75832146", "0.75274086", "0.75214666", "0.7501612", "0.7478512", "0.7468027", "0.7389807", "0.73264104", "0.73055655", "0.7298724", "0.72883487", "0.7269901", "0.7251268", "0.7231592", "0.7225235", "0.718622", "0.7147514", "0.71420985", "0.71073985", "0.7084755", "0.7082843", "0.7073464", "0.7064857", "0.70601404", "0.7012997", "0.7011998", "0.70063514", "0.70048636", "0.69968563", "0.697936", "0.69717276", "0.69251955", "0.6920646", "0.69080806", "0.6885419", "0.68728983", "0.68670535", "0.6866116", "0.68531084", "0.68524903", "0.68516254", "0.68408585", "0.68329704", "0.6831601", "0.68239385", "0.68041456", "0.6799234", "0.67966", "0.6793069", "0.677935", "0.67651033", "0.67639565", "0.6750491", "0.6745683", "0.67433745", "0.6731235", "0.67124027", "0.6709896", "0.6704447", "0.67001265", "0.66835254", "0.66776067", "0.6677425", "0.6673205", "0.6671575", "0.66595566", "0.66337067", "0.663216", "0.6629169", "0.6627219", "0.66162044", "0.6607027", "0.6606853", "0.6601976", "0.6599567", "0.6597305", "0.659475", "0.6590846", "0.6590272", "0.65889174", "0.65889174", "0.6587445", "0.6583333", "0.6579039", "0.6577528", "0.6574126", "0.65715927", "0.6569727", "0.6553049" ]
0.7445065
17
Edits an existing Question entity.
public function updateAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $deleteForm = $this->createDeleteForm($id); $editForm = $this->createForm(new QuestionType(), $entity); $editForm->bind($request); if ($editForm->isValid()) { $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('question_edit', array('id' => $id))); } return $this->render('QuizmooQuestionnaireBundle:Question:edit.'.$this->get('session')->get('whichTwig','').'html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(question $question)\n {\n //\n }", "public function edit(Questions $questions)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n\n }", "public function update(Request $request, question $question)\n {\n //\n }", "public function edit(Question_Test $question_Test)\n {\n //\n }", "public function update(AskQuestionRequest $request, Question $question)\n {\n if(Gate::denies('update-question', $question)) {\n // nếu user đang login thì khi bấm vào edit button của nó mới hiển thị trang edit\n return abort(403, 'Access Denies');\n }\n $question->update($request->only('title', 'body'));\n return redirect()->route('questions.index')->with('success', 'Your Question has been updated');\n }", "public function edit(AuditQuestion $auditQuestion)\n {\n //\n }", "public function edit(UserQuestion $userQuestion)\n {\n //\n }", "public function editAction()\n {\n /* Checking if user is signed in to be allowed to edit answer */\n $this->requireSignin();\n\n /* Getting user's id */\n $user = Auth::getUser();\n \n /* Getting Answer by id */\n $this_answer = Answer::getById(intval($_POST['answer_id']));\n\n /* Getting Question by id for redirecting back after editing */\n $this_question = Question::getById($this_answer->question_id);\n\n /* Checking if user is answer's author */\n if ($this_answer->user_id == $user->id) {\n\n /* Updating answer details */\n $answer = new Answer([ \n 'id' => $_POST['answer_id'],\n 'answer' => $_POST['new_answer'], \n ]);\n \n if ($answer->update()) {\n\n /* Show success message */\n Flash::addMessage(\"Done: Answer was updated!\", Flash::INFO);\n \n } else {\n \n /* Show error messages */\n Flash::addMessage(\"Error: \".implode(\", \", $answer->errors), Flash::INFO);\n }\n\n } else {\n\n /* Redirect to question's page and show error messages */\n Flash::addMessage(\"Error: You can not edit this answer.\", Flash::INFO);\n }\n\n /* Redirect to question page */\n $this->redirect(\"/question/\".$this_question->url);\n }", "public function edit(Question $question)\n {\n //\n $this->authorize('update', $question);\n $quizzes= Quiz::all();\n return view('question.edit',compact('question','quiz'));\n }", "public function update(StoreQuestionRequest $request, Question $question)\n {\n $question->type = $request->input('type');\n $question->title = $request->input('title');\n $question->quiz()->associate($request->input('quiz'));\n $question->feedback = $request->input('feedback', null);\n try {\n $question->save();\n session()->flash('success', 'Question updated!');\n return response()->json([\n \"error\" => false,\n \"code\" => 201,\n \"reason\" => \"Question updated!\"\n ]);\n } catch (\\Exception $exception) {\n logger($exception);\n session()->flash('error', 'Question could not be updated!');\n return response()->json([\n \"error\" => true,\n \"code\" => 500,\n \"reason\" => \"Question could not be updated!\"\n ]);\n }\n }", "public function update(Request $request, Question $question)\n {\n $rules = [\n 'title' => 'required|min:10|max:1000',\n 'answers' => 'required|min:10|max:1000',\n 'right_answer' => 'required|min:3|max:50',\n 'quiz_id' => 'required|integer',\n 'score' => 'required|integer|min:5|max:30'\n ];\n $this->validate($request, $rules);\n\n $question->update($request->all());\n\n if($question) {\n return redirect('/admin/questions')->withStatus('Question Successfully Updated.');\n } else {\n return redirect('/admin/questions/create')->withStatus('Something Wrong , Try Agin .');\n }\n }", "public function update(Request $request, Question $question)\n {\n $rules = [\n 'title' => 'required|min:10|max:1000',\n 'answers' => 'required|min:10|max:1000',\n 'right_answer' => 'required|min:3|max:100',\n 'score' => 'required|integer|in:5,10,15,20,25,30',\n 'type' => 'required|in:text,checkbox',\n 'quiz_id' => 'required|integer',\n ];\n\n $this->validate($request, $rules);\n\n if($question->update($request->all())) {\n return redirect('/admin/questions')->withStatus('Question successfully up[dated.');\n }else {\n return redirect('/admin/questions/'. $questions->id .'/edit')->withStatus('Something Wrong, Try again.');\n }\n }", "public function edit(Question $question)\n {\n// if (\\Gate::allows('update-question',$question)){\n// return view('questions.edit',compact('question'));\n// }\n//\n// abort('404','Sehifeye giris izniniz yoxdur');\n $this->authorize('update',$question);\n return view('questions.edit',compact('question'));\n }", "public function updateAction(Request $request, $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 $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n $em->flush();\n\n return $this->redirect($this->generateUrl('question_edit', array('id' => $id)));\n }\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 update(Request $request, Question $question)\n {\n// $this->authorize('update-question',$question);\n $this->authorize('update',$question);\n\n $question->update($request->only(['title','body']));\n return redirect()->route('questions.index')->with('success','Sualda deyisiklik edildi');\n }", "public function editquestionAction(Request $request, $question_id) {\n $em = $this->getDoctrine()->getManager();\n $question = $em->getRepository('PollPollBundle:QuestionImpl')->find($question_id);\n $options = $em->getRepository('PollPollBundle:Choice\\OptionImpl')->findBy(array('question' => $question_id));\n\n $universal_question = new UniversalQuestion();\n $universal_question->populateQuestion($question);\n $universal_question->populateOptions($options);\n\n $form = $this->createForm(new EditQuestion(), $universal_question);\n $form->handleRequest($request);\n if ($form->isValid()) {\n $question = $question->populateQuestion($universal_question);\n $em->persist($question);\n\n foreach ($options as $option) {\n $em->remove($option);\n }\n\n if (in_array($universal_question->getType(), array(\n ObjectFactory::SINGLE_CHOICE_QUESTION,\n ObjectFactory::MULTIPLE_CHOICE_QUESTION))) {\n $options = $universal_question->getOptions();\n $options = preg_split('/\\R/', $options);\n $poll = $question->getPollId();\n\n foreach ($options as $opt) {\n $option = new OptionImpl();\n $option->setPoll($poll);\n $option->setOption($opt);\n $option->setQuestion($question);\n $em->persist($option);\n }\n }\n\n $em->flush();\n return $this->redirect($this->generateUrl('poll_show_one', array(\"poll_id\" => $question->getPollId()->getId())));\n }\n return $this->render('PollPollBundle:Poll:edit_question.html.twig', array('form' => $form->createView()));\n }", "public function update(StoreQuestionRequest $request, Question $question)\n {\n try { \n \n DB::beginTransaction();\n\n Question::updateQuestion($question);\n\n DB::commit();\n\n session()->flash('success', 'Question updated successfully.');\n\n } catch(\\Exception $e) {\n\n DB::rollBack();\n \n session()->flash('error', $e->getMessage());\n }\n\n return redirect()->route('question.list');\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 update(Request $request, Question $question)\n {\n //\n $this->authorize('update', $question);\n $input = $request->all();\n $question->update($input);\n return redirect('/question/'.$question->id);\n }", "public function edit(Quiz $quiz)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n //validations\n $input = $request->validate([\n 'body' => 'required|min:5',\n 'title' => 'required',\n ], [\n 'body.required' => 'Body is required',\n 'body.min' => 'Body must be at least 5 characters',\n 'title.required' => ' title is required',\n ]);\n $question->body = $request->body;\n $question->title = $request->title;\n $question->save();\n return redirect()->route('question.show',['question_id' => $question->id])->with('message', 'Question Updated Successfully!');\n }", "public function update(Request $request, $id){\n $question = Question::find($id);\n $question->question_name = $request->input('q_name');\n $question->question_type = $request->input('q_type');\n $question->choices = $request->input('choices');\n $question->answer = $request->input('q_ans');\n $question->points = $request->input('q_point');\n $question->save();\n }", "public function edit(Question $question)\n {\n $questionData = getQuestionsData(); //Helper function in app\\Support\\helpers.php\n $numberAnswers = $questionData[0];\n $typeKeys = $questionData[1];\n $typeValues = $questionData[2];\n return view('questions.edit', compact('question', 'typeKeys', 'typeValues', 'numberAnswers')); \n }", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n if (!$question) {\n throw new ModelNotFoundException();\n }\n $poll =Poll::findOrFail($question->poll_id);\n\n if($poll->app_id != $request->app_id){\n throw new UnauthorizedHttpException('','not allowed');\n }\n $requestData = $request->all();\n $question->update($requestData);\n\n /*replace options*/\n if (!empty($requestData['options'])) {\n $question->options()->delete();\n $question->options()->createMany($requestData['options']);\n }\n\n return response('Question Updated', 200);\n }", "public function update(Request $request, Questions $questions)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n $request->validate([\n 'question' => 'required',\n 'content' => 'required',\n ]);\n\n $question->update($request->all());\n\n return redirect()->route('questions.index')\n ->with('success', 'Question updated successfully');\n }", "public function edit(Question $question)\n {\n\n $data=SetInformationLang(auth()->user(),$this->defaultPosition,$this->defaultCode);\n\n $trans=$data['trans'];\n $code=$data['code'];\n $position=$data['position'];\n return view(\"admin.question.edit\",compact(\"question\",\"code\",\"position\",\"trans\"));\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(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function update(Request $request, Question $question)\n {\n $inputQuestion = $request->question;\n $question->text = $inputQuestion['text'];\n $question->save();\n\n // delete answers if they are missing from request data\n $answersFromDatabase = $question->answers;\n $inputAnswers = collect($inputQuestion['answers']);\n\n $this->removeAnswers($answersFromDatabase, $inputAnswers);\n\n // create or update answers\n foreach ($inputAnswers as $inputAnswer) {\n if (array_key_exists('id', $inputAnswer)) {\n $ans = $answersFromDatabase->where('id', $inputAnswer['id'])->first();\n } else {\n $ans = new Answer;\n }\n\n $ans->text = $inputAnswer['text'];\n \n if (array_key_exists('correct', $inputAnswer)) {\n $ans->correct = $inputAnswer['correct'];\n }\n\n $question->answers()->save($ans);\n }\n\n $question->answers = $question->answers;\n\n return response(['question' => $question]);\n }", "public function update(Request $request, Question $question)\n {\n error_log(\"******************************inside update\");\n $input = $request->validate([\n 'body' => 'required|min:5',\n ], [\n 'body.required' => 'Body is required',\n 'body.min' => 'Body must be at least 5 characters',\n ]);\n $question->body = $request->body;\n $question->save();\n return redirect()->route('question.show', ['question_id' => $question->id])->with('message', 'Saved');\n }", "public function update(Request $request, Question $question)\n {\n $question->update($request->all());\n return redirect()->route('questions.index')\n ->with('status','Question updated successfully');\n }", "public function edit(Question $question)\n {\n if($question->user_id != auth()->user()->id)\n return redirect()->back();\n $studies = auth()->user()->studies;\n return view('teacher.question.edit',[\n 'studies' => $studies,\n 'question' => $question\n ]);\n }", "public function update(Request $request, Question_Test $question_Test)\n {\n //\n }", "public function update()\n {\n $data = Input::all();\n foreach (array_combine($data['question_id'], $data['question_name']) as $question_id => $question_name) {\n $question = Question::find($question_id);\n $question->question_name = $question_name;\n $question->save();\n }\n\n Flash::success('The question has been successfully updated!');\n return Redirect::action('AnswerController@edit', $question->exam_id);\n }", "public function editQuestionAction($questionId)\n {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getManager();\n\n $questionRepository = $em->getRepository('TeclliureQuestionBundle:Question');\n\n $entity = $questionRepository->find($questionId);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n if ($request->isXmlHttpRequest()) {\n $questionForm = $this->createForm(new QuestionType(), $entity);\n $questionary = $entity->getQuestionary();\n\n\n return $this->render(':ajax:base_ajax.html.twig', array(\n 'template' => 'TeclliureQuestionBundle:Question:questionForm.html.twig',\n 'entity' => $questionary,\n 'questionForm' => $questionForm->createView(),\n 'questionFormError' => true\n ));\n }\n else {\n return $this->render(':msg:error.html.twig', array(\n 'msg' => 'Error: Not ajax call'\n ));\n }\n }", "public function update(Request $request, UserQuestion $userQuestion)\n {\n //\n }", "public function edit(StudentAnswerController $studentAnswer)\n {\n //\n }", "public function edit($project, $question)\n {\n \n //$question = $this->questions->findOrThrowException($id, true); //dd((array) $question->answers);\n $answers = count((array) $question->answers);\n if(empty($answers)){\n $answers = 1;\n }\n javascript()->put([\n\t\t\t'index' => $answers\n\t\t]);\n return view('backend.project.questions.edit')\n ->withQuestion($question)\n ->withQuestions($this->questions->getAllQuestions('qnum', 'asc')->prepend(['none' => 'None'])) \n ->withProjects($this->project->getAllProjects('name','asc',true))\n ->withOrganizations($this->organization->getAllOrganizations('name', 'asc', ['projects']));\n }", "public function updateAction(Request $request, $id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CompeteComBundle:StudyQuestions')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find StudyQuestions entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createForm(new StudyQuestionsType(), $entity);\n $editForm->bind($request);\n\n if ($editForm->isValid()) {\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('studyquestions_edit', array('id' => $id)));\n }\n\n return $this->render('CompeteComBundle:StudyQuestions:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit(Question $question)\n {\n return view('edit_question', compact('question'));\n }", "public function update(QuestionRequest $request, Question $question)\n {\n try {\n $question->update($request->all());\n } catch (\\Exception $e) {\n dd($e);\n }\n\n return redirect()->route('question-set.show', $question->questionSet);\n\n }", "public function edit(QuestionForum $questionForum)\n {\n //\n }", "public function edit(Survey $survey)\n {\n //\n }", "public function update(Request $request, Question $question)\n {\n // validasi\n $request->validate([\n 'title' => 'required',\n 'content' => 'required'\n ]);\n $question->update([\n 'title' => $request->title,\n 'content' => $request->content\n ]);\n\n // updating tags\n $tagIds = [];\n foreach (explode(' ', $request->tags) as $tag) {\n $tag = Tag::firstOrCreate(['name' => $tag]);\n $tagIds[] = $tag->id;\n }\n $question->tags()->sync($tagIds);\n\n return redirect('/pertanyaan/' . $question->slug)->with('status', 'Pertanyaan Diubah!!');\n }", "public function update(ExamQuestionRequest $request, $id, $question_id)\n {\n //\n try{\n $question = Question::find($question_id);\n $question->question = $request->question;\n $question->type = $request->q_type;\n $question->sol = $request->co;\n $question->save();\n\n\n $x = $request->q_type == 0 ? 4 : 2 ;\n $answers = Answer::where('question_id',$question_id)->take($x)->get();\n foreach($answers as $i => $answer){\n $answer->answer = $request->a[$i];\n $answer->true = $i == $request->co ? 1 : 0 ;\n $answer->save();\n }\n\n } catch(Exception $e) {\n return redirect()->back()->with([\n 'alert'=>[\n 'icon'=>'error',\n 'title'=>__('site.alert_failed'),\n 'text'=>__('site.question_failed_updated'),\n ]]);\n }\n return redirect('admin/exam/'.$id.'/questions')->with([\n 'alert'=>[\n 'icon'=>'success',\n 'title'=>__('site.done'),\n 'text'=>__('site.updated successfully'),\n ]]);\n }", "public function update(Request $request, Question $question)\n {\n $validator = \\Validator::make($request->all(), [\n 'content' => 'required|max:255',\n 'correct_message' => 'max:65535',\n 'wrong_message' => 'max:65535',\n ]);\n if ($validator->fails()) {\n return response()->json([\n 'success' => false,\n 'errors' => $validator->errors(),\n ]);\n }\n //更新題目\n $question->update([\n 'content' => $request->get('content'),\n 'correct_message' => $request->get('correct_message'),\n 'wrong_message' => $request->get('wrong_message'),\n ]);\n //回傳結果\n $json = [\n 'success' => true,\n 'content' => $question->content,\n ];\n\n return response()->json($json);\n }", "public function update(Request $request, Question $question)\n {\n $validator = Validator::make($request->all(), [\n 'question' => 'string',\n 'created_by' => 'numeric',\n ]);\n\n if ($validator->fails()) {\n return response(['errors' => $validator->errors()], 422);\n }\n\n $question->update($request->all());\n\n return $question;\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createForm(new QuestionType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('QuizmooQuestionnaireBundle:Question:edit.'.$this->get('session')->get('whichTwig','').'html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit(Answers $answers)\n {\n //\n }", "public function setQuestion(Question $question) {\n $this->question = $question;\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CompeteComBundle:StudyQuestions')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find StudyQuestions entity.');\n }\n\n $editForm = $this->createForm(new StudyQuestionsType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CompeteComBundle:StudyQuestions:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit(Question $question)\n {\n return view('admin.edit_question',compact('question'));\n }", "public function edit(Question $question)\n {\n return view('question.edit', compact('question'));\n }", "public function update(Request $request, Question $question)\n {\n $question->update($request->all());\n return response('Updated', Response::HTTP_ACCEPTED);\n }", "abstract protected function modifyQuestion(Question $question): void;", "public function edit(Question $question)\n {\n return view('questions.edit', compact('question'));\n }", "public function edit($question_id)\n {\n $questionData = Question::where('question_id', $question_id) -> first();\n $optionData = Question_option::where('question_id', $question_id) -> get();\n\n $animals = Animal::all();\n $ani = [];\n foreach ($animals as $animal) {\n $ani[$animal -> animal_id] = $animal -> animal_name;\n }\n\n $worksheets = Worksheet::all();\n $works = [];\n foreach ($worksheets as $worksheet) {\n $works[$worksheet -> worksheet_id] = $worksheet -> worksheet_name;\n }\n\n $descriptions = Question_description::all();\n $descrip = [];\n foreach ($descriptions as $description) {\n $descrip[$description -> description_id] = $description -> description;\n }\n\n return view('pages/data_manage/question/edit')\n -> withQuestionData($questionData)\n -> withOptionData($optionData)\n -> withAni($ani)\n -> withWorks($works)\n -> withDescrip($descrip);\n }", "public function update(Request $request,Question $question, Answer $answer)\n {\n $this->authorize('update',$answer);\n $answer->text=$request->body;\n $answer->save();\n\n\n return redirect()->route('questions.show',$question->slug)->with('success','Answer Update Successfull!');\n }", "public function edit(Question $question)\n {\n $tags = QuestionTag::allTags();\n\n return view('questions.edit', compact('question', 'tags'));\n }", "public function edit(Question $question)\n {\n return view('admin.questions.edit',compact('question'));\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n }\n\n $quesid = $this->request->getPost(\"quesid\");\n\n $que = Question::findFirstByQuesId($quesid);\n if (!$que) {\n $this->flash->error(\"Question does not exist \" . $quesid);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n }\n\n $que->setQuesId($this->request->getPost(\"quesid\"));\n $que->setDesc($this->request->getPost(\"desc\"));\n $que->setOrder($this->request->getPost(\"order\"));\n $que->setBkgrId($this->request->getPost(\"bkgrid\"));\n $que->setQtype($this->request->getPost(\"qtype\"));\n $que->setAmtText($this->request->getPost(\"amttext\"));\n $que->setAmtType($this->request->getPost(\"amttype\"));\n $que->setCrdt($this->request->getPost(\"crdt\"));\n $que->setCrdtId($this->request->getPost(\"crdtid\"));\n $que->setUpdt($this->request->getPost(\"updt\"));\n $que->setUpdtId($this->request->getPost(\"updtid\"));\n $que->setDelmark($this->request->getPost(\"delmark\"));\n \n\n if (!$que->save()) {\n\n foreach ($que->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"edit\",\n \"params\" => array($que->quesid)\n ));\n }\n\n $this->flash->success(\"Question was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n\n }", "public function updatequestionAction(){\n\n try{\n\n\t\t global $objSession;\n\n\t\t $this->view->languages = $this->ModelObj->systemlanguage();\n\n\t\t $this->view->operatortype = $this->ModelObj->operatortype(); \n\n\t\t $this->view->addedquestions = $this->ModelObj->addedquestiondata($this->Request);\n\n\t\t if($this->_request->isPost()){\n\n\t\t if(!empty($this->Request['operators']) && count($this->Request['question'])>0){\n\n\t\t\t $this->ModelObj->updatequestions($this->Request);\t\n\n\t\t\t $objSession->successMsg = \"Record Updated Successfully\";\n\n\t\t\t $this->_redirect($this->_request->getControllerName().'/helpdesksetting'); \n\n\t\t }\n\n\t\t else{\n\n\t\t\t $objSession->errorMsg = \"Please enter question and select Operator!\";\n\n\t\t }\n\n\t\t}\n\n\t }\n\n\t \n\n\t catch (Exception $e) {\n\n $this->ModelObj->_logger->info('Class-'.__CLASS__.',Function-'.__FUNCTION__.',Line-'.__LINE__.',Error-'.$e->getMessage());\n\n }\n\n\t \n\n }", "public function save_edit($id){\n \n // DB query here\n $question = Question::findOrFail($id);\n\n // requesting data from form\n $userdata = request('question');\n\n // changing data\n $question->question = $userdata;\n\n // saving data to DB\n if($question->save()){\n\n // returning view and results\n return redirect(\"/questions/$id\")->with('message', 'A változásokat sikeresen mentette a rendszer!');\n } else {\n\n // returning view and results\n return redirect(\"/questions/$id\")->with('message', 'HIBA! Kérjük próbálkozzon újra.');\n }\n }", "public function update(Request $request)\n {\n $question = $request->question;\n $q_id = $request->q_id;\n\n DB::table('questions')->where('id',$q_id)->update(\n [\n 'question' => $question,\n\n \"updated_at\" => \\Carbon\\Carbon::now(),\n ]\n\n );\n\n return redirect('admin/questions/edit/'.$q_id)->with('message','Question Updated');\n }", "public function edit(Question $question)\n {\n return view('admin.question.edit', compact('question'));\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'title' => 'required', \n 'position' => 'required', \n 'options' => 'required', \n 'points' => 'required', \n ] , [\n 'title.required' => 'Ingresa el título de la pregunta', \n 'position.required' => 'Selecciona la pocición de la pregunta', \n 'options.required' => 'Ingresa al menos una opción para la pregunta',\n 'points.required' => 'Ingresa la puntuación de la pregunta',\n ]);\n\n $q = Question::find($id);\n $v_old = Question::where('position' , $request->position)->first();\n if ($v_old && $v_old->id != $q->id) {\n $v_old->position = $q->position;\n $v_old->save();\n }\n $q->title = $request->title;\n $q->position = $request->position;\n $q->points = $request->points;\n $q->save();\n\n foreach ($q->getOpt as $oo) {\n $oo->delete();\n }\n\n foreach ($request->options as $key => $value) {\n $o = new Option;\n $o->question_id = $q->id;\n $o->title = $value;\n $o->position = $key;\n if ($key == $request->correct) {\n $o->correct = 1;\n }\n $o->save();\n }\n\n return back()->with('msj' , 'Pregunta editada exitosamente');\n }", "public function update(Request $request, Quiz $quiz)\n {\n //\n }", "public function update(Request $request, Quiz $quiz)\n {\n //\n }", "public function editAction()\r\n\t{\r\n\t\t$id = $this->getRequest()->getParam('faq_id');\r\n\t\t$model = Mage::getModel('flagbit_faq/faq');\r\n\t\t\r\n\t\t// if current id given -> try to load and edit current FAQ item\r\n\t\tif ($id) {\r\n\t\t\t$model->load($id);\r\n\t\t\tif (!$model->getId()) {\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError(\r\n\t\t\t\t\tMage::helper('flagbit_faq')->__('This FAQ item no longer exists')\r\n\t\t\t\t);\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data = Mage::getSingleton('adminhtml/session')->getFormData(true);\r\n\t\tif (!empty($data)) {\r\n\t\t\t$model->setData($data);\r\n\t\t}\r\n\t\t\r\n\t\tMage::register('faq', $model);\r\n\t\t\r\n\t\t$this->_initAction()\r\n\t\t\t\t->_addBreadcrumb(\r\n\t\t\t\t\t$id\r\n\t\t\t\t\t\t? Mage::helper('flagbit_faq')->__('Edit FAQ Item')\r\n\t\t\t\t\t\t: Mage::helper('flagbit_faq')->__('New FAQ Item'),\r\n\t\t\t\t\t$id\r\n\t\t\t\t\t\t? Mage::helper('flagbit_faq')->__('Edit FAQ Item')\r\n\t\t\t\t\t\t: Mage::helper('flagbit_faq')->__('New FAQ Item')\r\n\t\t\t\t)\r\n\t\t\t\t->_addContent(\r\n\t\t\t\t\t\t$this->getLayout()\r\n\t\t\t\t\t\t\t\t->createBlock('flagbit_faq/adminhtml_item_edit')\r\n\t\t\t\t\t\t\t\t->setData('action', $this->getUrl('adminhtml/faq/save'))\r\n\t\t\t\t)\r\n\t\t\t\t->_addLeft($this->getLayout()->createBlock('flagbit_faq/adminhtml_item_edit_tabs'));\r\n\t\t\r\n\t\t$this->renderLayout();\r\n\t}", "public function setQuestion(?Question $question)\n {\n $this->question = $question;\n }", "public function update(Quiz $quiz): void\n {\n }", "public function edit(enquiryForm $enquiryForm)\n {\n //\n }", "public function update($id, QuestionRequest $request)\n\t{\n $question = Question::findOrFail($id);\n $question->update($this->questionRepository($request, $question->image));\n flash('Create question success!', 'success');\n return redirect('admin/questions');\n\t}", "public function update($project, $question, UpdateQuestionRequest $request)\n {\n $this->questions->update($question,\n\t\t\t$request->except('project_id', 'organization'),\n $project\n \n\t\t);\n\t\treturn redirect()->route('admin.project.questions.editall',[$project->id])->withFlashSuccess('The question was successfully updated.');\n }", "public function edit($id)\n {\n //\n if(!\\Auth::check())\n return redirect()->route('questions.index');\n\n $question = Document::question()->where('id',$id)->first();\n if(!$question)\n return redirect()->route('questions.index');\n if(!$question->isEditor())\n return redirect()->route('questions.show',$question->id);\n\n $data = [\n 'pagetitle' => 'Draft a Question',\n 'document' => $question,\n 'input' => $question->toArray(),\n 'sections' => $question->sections->toArray()\n ];\n return view('questions.create',$data);\n }", "public function update(Request $request)\n { \n $question = Question::where('question_id', $request -> question_id) -> first();\n $question -> worksheet_id = $request -> worksheet_name;\n $question -> animal_id = $request -> animal_name;\n\n if($request -> description == null) {\n $question -> description_id = $request -> existDesc;\n } else {\n $description = new Question_description;\n $description -> description = $request -> description;\n $description -> save();\n $descriptionId = Question_description::where('description', $request -> description) \n -> first();\n $question -> description_id = $descriptionId -> description_id;\n }\n\n $question -> question = $request -> question;\n $question -> answer = $request -> answer;\n $question -> save();\n\n $option = Question_option::where('question_id', $request -> question_id) -> delete();\n for ($i = 1; $i <= 4; $i++) { \n $qOption = \"qOption_\".$i;\n if($request -> $qOption == null)\n break;\n $newOption = new Question_option;\n $newOption -> question_id = $request -> question_id;\n $newOption -> option_id = $i;\n $newOption -> qOption = $request -> $qOption;\n $newOption -> save(); \n }\n \n Session::flash('success', 'this post was sucessfully saved');\n return redirect()->route('questionPosts.show', $request -> question_id); \n }", "public function update(Request $request, $id)\n {\n\n $Question = Question::find($id);\n\n\n $this->validate($request,array(\n 'title'=>'required|max:255'\n ));\n \n\n $Question =Question::find($id);\n\n $Question->user_id = Auth::user()->id;\n $Question->title = $request->title;\n $Question->category_id =$request->category_id;\n $Question->slug = str_slug($request->title,'-');\n \n \n \n $Question->save();\n \n // $Question->marks()->sync($request->marks,false);\n\n\n Session::flash('Success',' Your Question has been Updated!');\n\n return redirect()->route('questions.show', [$Question->id]);\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "public function edit(Question $question,Answer $answer)\n {\n $this->authorize('update',$answer);\n return view('answers.edit',['question'=>$question,'answer'=>$answer]);\n }", "public function update(QuestionRequest $request, $id)\n { \n //Récupération des informations de la question\n $question = Question::find($id);\n\n $question->update( $request->all() );\n\n $question->status = 'unpublished';\n\n if($request->status == 'on') $question->status = 'published';\n\n $question->save();\n\n session()->flash('flashMessage', 'Modification effectuée');\n\n return redirect()->route('dashboard');\n }", "public function update(Request $request, $id)\n {\n $question= TrialTest::find($id);\n $question->question = $request->input('question');\n $question->answer = $request->input('answer');\n $question->unit =$request->input('unit');\n $question->save();\n return redirect()->back()->with('success','question updated');\n }", "public function update($question_id, StoreQuestion $request)\n {\n $validated = $request->validated();\n $question = Question::findOrFail($question_id);\n $question->update([\n 'content' => $validated['question'],\n 'expe' => $validated['expe'],\n 'file_id' => $validated['file']\n ]);\n\n return redirect()->route('gamePointIndex', [$question->game->id, $question->point->id])->with('success', 'La question a bien été modifiée');\n }", "public function hydrateeditquestionformAction()\r\n {\r\n\r\n // Check Post\r\n if (!$this->getRequest()->isPost())\r\n die();\r\n\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n $question = $question->getOneQuestionById($questionId);\r\n $this->_helper->json($question);\r\n\r\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Activity_Service_ShareQq::get(intval($id));\n\t\t$this->assign('info', $info);\n\t}", "public function edit($id)\n\t{\n\t\t$question = Question::findOrFail($id);\n return view('admin.question.edit', compact('question'));\n\t}" ]
[ "0.80544305", "0.80544305", "0.80544305", "0.78718233", "0.7496963", "0.7222481", "0.7222481", "0.7222481", "0.721919", "0.7152132", "0.7016294", "0.6998531", "0.69794244", "0.69211453", "0.6913584", "0.68841183", "0.6874914", "0.68640214", "0.68564796", "0.68515724", "0.6832124", "0.6830298", "0.6801703", "0.6800889", "0.67724884", "0.6759035", "0.6731687", "0.67179173", "0.66686434", "0.66526437", "0.6642241", "0.6642241", "0.6642241", "0.6642241", "0.6642241", "0.6600722", "0.6588253", "0.65649843", "0.65497065", "0.65428454", "0.6542235", "0.65380627", "0.65342873", "0.6514759", "0.6499119", "0.6495577", "0.6488202", "0.6463856", "0.64431953", "0.6437281", "0.6408049", "0.6385362", "0.6367586", "0.6366887", "0.63645995", "0.6363951", "0.6354006", "0.6353068", "0.63479763", "0.63323843", "0.6330099", "0.6313609", "0.6300513", "0.62943965", "0.6289242", "0.62780553", "0.6277016", "0.6263797", "0.62364656", "0.6234647", "0.6213719", "0.62135136", "0.619522", "0.6194169", "0.6192611", "0.61881036", "0.6169121", "0.61660206", "0.6152879", "0.61516637", "0.61358404", "0.61358404", "0.6129181", "0.61182314", "0.61182195", "0.61122125", "0.60917234", "0.60881716", "0.6087488", "0.60846287", "0.608103", "0.60787874", "0.60787874", "0.60777533", "0.60765797", "0.6059206", "0.6034874", "0.60319936", "0.60262704", "0.6002275" ]
0.6662711
29
Deletes a Question entity.
public function deleteAction(Request $request, $id) { $form = $this->createDeleteForm($id); $form->bind($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('QuizmooQuestionnaireBundle:Question')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Question entity.'); } $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('question')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deletequestionAction()\r\n {\r\n if ($this->getRequest()->isPost()) {\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // delete the question\r\n $question->deleteQuestion($questionId);\r\n\r\n // Return to the page informations\r\n $this->_helper->redirector('gestionquestion', 'admin', null);\r\n\r\n }\r\n\r\n }", "public function destroy(Question $Question)\n {\n //\n }", "public function destroy(Question $question)\n {\n\n\n }", "public function destroy(Question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n $this->authorize('delete', $question);\n $question->delete();\n return redirect('/question');\n }", "public function destroy(question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n $question->delete();\n\n return response('success');\n }", "public function destroy(Question $question)\n {\n $question->delete();\n return redirect('/admin/questions')->withStatus('Question successfully deleted.');\n }", "public function destroy(Question $question)\n {\n $question->delete();\n return redirect()->route('home')->with('message', 'Deleted');\n }", "public function deleteQuestion($Question){\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_QuestionDAO->deleteQuestion($Question);\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in QuestionDAO.deleteQuestion()\");\t\t\n\n\t\treturn $Result;\n\n\t}", "public function destroy(Question $question)\n {\n $question->delete();\n return redirect('/admin/questions')->withStatus('Delete Question Successfully .');\n }", "public function destroy(Question $question)\n {\n if(Gate::denies('delete-question', $question)) {\n // nếu user đang login thì khi bấm vào edit button của nó mới hiển thị trang edit\n return abort(403, 'Access Denies');\n }\n// $question->destroy($question->id);\n $question->delete();\n return redirect()->route('questions.index')->with('success', 'Your Question has been removed');\n }", "public function destroy(Question $question)\n {\n $question->delete();\n return redirect()->route('questions.index')\n ->with('status','Question deleted successfully');\n }", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "public function destroy(Question $question)\n {\n $this->authorize('delete-question',$question);\n $question->delete();\n return redirect()->back()->with('success','Sual silindi');\n }", "public function deleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "public function destroy(Question $question)\n {\n $id = $question->id;\n $question->delete();\n $message = 'Question Deleted Successfully!';\n return redirect()->route('home')->with('message', $message);\n }", "public function destroy(Question $question)\n {\n $question->delete();\n return redirect('/home')->with('status', 'Pertanyaan Dihapus!!');\n }", "public function destroy(Questions $questions)\n {\n //\n }", "public function destroy(Question $question)\n {\n $file_name = $question->image_source;\n if ($file_name != NULL) {\n unlink('images/' . $file_name);\n }\n\n\n $question->delete();\n\n return redirect()->route('questions.index')\n ->with('success', 'Question deleted successfully');\n }", "public function destroy($questionId)\n {\n $question = Question::findOrFail($questionId);\n\n $exam = Exam::findOrFail($question->exam_id);\n $exam->questions_count--;\n $exam->save();\n\n Question::destroy($questionId);\n }", "public function delete(SurveyService $surveyService, QuestionService $questionService)\n {\n $type = \\request('type', 'survey');\n $id = \\request('id', 0);\n if (0 == $id) {\n return $this->error('params error');\n }\n if ('survey' == $type) {\n $ret = $surveyService->delete($id);\n } else {\n $ret = $questionService->delete($id);\n }\n\n if (empty($ret)) {\n return $this->error('failed to delete it');\n }\n return $this->success('delete success');\n }", "public function delete($entity);", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "public function test_deleting_question() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('DELETE', '/api/v1/' . $videoquanda->id . '/questions/1');\n\n $this->assertEquals(204, $client->getResponse()->getStatusCode());\n $this->assertFalse($DB->record_exists('videoquanda_questions', array('instanceid' => $videoquanda->id)));\n }", "public function destroy(Question $question)\n {\n $question->delete();\n\n return redirect()->route('question.index')->with('global', '題目已刪除');\n }", "public function destroy(Question $question)\n {\n if($question->test->user_id != auth()->user()->id){\n $words = \"這不是你的問卷!\";\n return view('error',compact('words'));\n }\n Answer::where('question_id',$question->id)->delete();\n\n $question->delete();\n return redirect()->route('questions.index',$question->test_id);\n }", "public function destroy(Question $question) // the route model binding is in parameters\n //-> Question $question <- here is the model binding that binds the question controller\n // with model controller.\n {\n $question->delete();\n return response(null, Response::HTTP_NO_CONTENT); //201 is the status code generated on postman when\n // the api is deleted. \n }", "public function deleteAction()\n {\n /* Check if user is signed in and redirect to sign in if is not */\n $this->requireSignin();\n\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Redirect link after deleting. By default index page */\n $returnUrl = (isset($_POST['return'])) ? '/'.$_POST['return'] : '/';\n\n /* Getting Question by id */\n $answer = Answer::getById(intval($_POST['id']));\n\n /* If Answer exists and is active */\n if ($answer) {\n\n /* Checking if signed in user is answer's author */\n if ($answer->user_id == $user->id) {\n\n /* Check if question deleted */\n if (Answer::delete($answer->id)) {\n\n Flash::addMessage(\"Answer deleted!\", Flash::INFO);\n \n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n } else {\n\n Flash::addMessage(\"You can not delete this answer!\", Flash::INFO);\n }\n\n /* Redirect back */\n $this->redirect($returnUrl);\n }", "public function delete(DimeEntityInterface $entity);", "public function deleteAction(Request $request, $id) {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('question'));\n }", "public function delete(Question $question) {\n if (!$this->poll->hasItem($question)) {\n throw new QuestionDoesNotExistException(\"The removal of the question was unsuccessful.\n The following question is not present in the Question Service.\");\n }\n $this->poll->removeItem($question);\n return $question;\n\t}", "public function destroy(Question_Test $question_Test)\n {\n //\n }", "public function deleteAnswersByQuestion($idQuestion)\n\t{\n\t\t$this->db->delete('respostas', \" `id_pergunta` = '\".$idQuestion.\"'\"); \n\t}", "public function destroy(Request $request,Question $question)\n {\n if (!$question) {\n throw new ModelNotFoundException();\n }\n $poll =Poll::findOrFail($question->poll_id);\n\n if($poll->app_id != $request->app_id){\n throw new UnauthorizedHttpException('','not allowed');\n }\n $question->delete();\n\n return response('deleted', 204);\n }", "public function destroy(Question $question)\n {\n try {\n $question->delete();\n } catch (\\Exception $e) {\n dd($e);\n }\n\n return redirect()->route('question-set.show', $question->questionSet);\n\n }", "public function destroy($id){\n Question::destroy($id);\n }", "public function delete($entity){ \n //TODO: Implement remove record.\n }", "public function delete(EntityInterface $Entity);", "public function deleteById($faqId);", "public function delete($entity)\n {\n \n }", "function deleteQuestions(Query $q = null) {\n\t\treturn $this->deleteQuestionsRelatedByQuizId($q);\n\t}", "public function deleteAnswers($question_id)\n\t{\n\t}", "public function destroy(Question $question)\n {\n\n $question->delete();\n \n $question->media()->delete($question->id);\n\n if ($question) {\n $data = [\n 'status' => '1',\n 'msg' => 'success'\n ];\n toastr()->success('اطلاعات شما حذف شد');\n } else {\n $data = [\n 'status' => '0',\n 'msg' => 'fail'\n ];\n toastr()->warning('اطلاعات شما حذف نشد');\n\n\n\n }\n return response()->json($data);\n }", "public function deleteQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n if(isset($_GET['question_id']) && is_numeric($_GET['question_id'])){\n\n $question_id = $_GET['question_id'];\n\n $this->object->deleteQuestion($question_id);\n $ilTabs->activateTab(\"editQuiz\");\n\n ilUtil::sendSuccess($this->txt(\"successful_delete\"), true);\n // Forwarding\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n }", "public function destroy(UserQuestion $userQuestion)\n {\n //\n }", "public function destroy(Question $question): JsonResponse\n {\n Answer::query()->where('question_id',$question->id)->delete();\n $question->delete();\n return $this->respond($question);\n }", "public function deleteAnswer()\n {\n $this->is_answer = false;\n $this->topic->is_answered = false;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "function deleteQuestion($idQuestion = null)\n {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) { // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) { //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n if (isset($tempArr[$idQuestion]['id']) && ($tempArr[$idQuestion]['id'] != '')) { // questions that have been written to the database will have an id set\n $delArr = array();\n if ($this->Session->check('SurveyQuestion.delete')) { // get a copy of any questions already marked for deletion\n $delArr = $this->Session->read('SurveyQuestion.delete');\n }\n $delArr[] = $tempArr[$idQuestion]['id']; // add our question to the array for deletion from the database\n $this->Session->write('SurveyQuestion.delete',$delArr); // write to the session\n }\n unset($tempArr[$idQuestion]); // remove the question from the temporary question array\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "public function deleteanswer(Request $request)\n\t{\n\t\t$ans = \\App\\Answer::destroy($request->input('id'));\n\t}", "public function destroy($id)\n\t{\n $question = Question::findOrFail($id);\n $question->delete();\n flash('Success deleted question!');\n return redirect('admin/questions');\n\t}", "public function delete($entity) {\n $this->deleteRecord([\n 'id' => $entity->getId(),\n ]);\n }", "public function delete($entity) : bool;", "public function destroy($id)\n {\n $question = Question::find($id);\n $question->delete();\n return redirect('questions');\n }", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "function delete_question($questionid) {\n delete_records(\"question_turprove\", \"question\", $questionid);\n return true;\n }", "public function Delete($entity) {\n }", "public function destroy(StudentAnswerController $studentAnswer)\n {\n //\n }", "public function destroy(Request $request)\n {\n auth()->user()->questions()->find($request->id)->delete();\n\n return redirect()->route('teachers.questions.index')->with(['success' => 'Soal berhasil di hapus']);\n }", "public function destroy($id)\n {\n $question = Question::findOrFail($id);\n $question->typable->delete();\n $question->delete();\n }", "public function destroy($question_id)\n {\n $question = Question::findOrFail($question_id);\n $game_id = $question->game->id;\n $point_id = $question->point->id;\n $question->delete();\n return redirect()->route('gamePointIndex', [$game_id, $point_id])->with('success', 'La question a bien été supprimée.');\n }", "public function destroy(Question $question)\n {\n try {\n $question->delete();\n session()->flash('success', 'Question removed!');\n return response()->json([\n \"error\" => false,\n \"code\" => 204,\n \"reason\" => \"Question removed\"\n ]);\n } catch (\\Exception $exception) {\n return response([\n \"error\" => false,\n \"code\" => 204,\n \"reason\" => \"Question could not be removed\"\n ]);\n }\n }", "public function testQuestionDeleteWithValidData() {\n $response = $this->get('question/' . $this->question->id . '/delete');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function destroy($q_id,$a_id)\n {\n $answer = Answer::find($a_id);\n $answer->delete();\n return redirect()->route('questions.show',$q_id);\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function destroy(Exam $exam)\n {\n foreach ($exam->questions()->orderBy('order')->get() as $Q) {\n\n $exam->questions()->detach([$Q->id_Question]);\n }\n $exam->delete();\n return redirect('/teacher/exams');\n }", "public function deleteEntity($entity)\n {\n return $this->model->destroy($entity->id);\n\n }", "public function delFaq(){\n// $faqManager = new FaqManager();\n// $idFaq = $_GET['id'];\n// $faqManager->deleteFaq($idFaq);\n\n View::show('admin/deleteFaq.php', 'Question deleted', []);\n\n }", "public function actionDelete($q = 1)\n {\n if ($q != 1 AND $q != 2 AND $q != 3 AND $q != 5 AND $q != 15 AND $q != 30) {\n echo 'error';\n }\n $time = new \\DateTime('now');\n date_sub($time, date_interval_create_from_date_string($q . ' days'));\n $today = $time->format('Y-m-d');\n echo $today;\n $comments = Comments::deleteAll(['<', 'data', $today]);\n echo \"Was removed \" . $comments . \" records\";\n }", "public function destroy( Request $request, $id = null)\n {\n $pDelete = $request->get( '_permanent' ) == \"true\";\n $bundleDelete = $request->get( '_bundle' ) == \"true\";\n $Ids = $request->get( '_bundle_ids' );\n\n $Ids = explode( ',', urldecode( $Ids ) );\n\n if( !$bundleDelete ) {\n $Ids = [$id];\n }\n\n $question = $pDelete ? Question::whereIn( 'id', $Ids)->onlyTrashed( ) : Question::whereIn('id',$Ids)->withoutTrashed( );\n\n// dd( $question->get() );\n\n if ( $question->exists() ) {\n $deleted = 0;\n $this->set( 'data', $question->get() );\n\n if( $pDelete ) {\n if( QuestAssign::where( [ 'question_id' => $id ] )->exists() ) {\n return $this->setAndGetResponse( 'message', 'Quiz assigned with question!', 403 );\n }\n\n if( $deleted = $question->forceDelete() ) {\n $this->set('action', 'permanently-deleted');\n }\n }else {\n if( $deleted = $question->delete()) {\n $this->set('action', 'deleted');\n }\n }\n\n if( $deleted > 0){\n $this->set( 'delete_count', $deleted );\n return $this->setAndGetResponse('message', \"Question \" . ( $pDelete ? \" permanently \":\"\" ) . \"deleted\" );\n }\n }\n\n return $this->setAndGetResponse( 'message' , 'Question not found!', 404 );\n }", "public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }", "public function delete_question($qid){\n\t$tables = array('Comment', 'Answer', 'Question');\n\t$this->db->where('questionID', $qid);\n\t$this->db->delete($tables);\n\treturn $this -> db -> affected_rows();\n\t}", "function delete_question() {\r\n global $db;\r\n\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) || (!isset($_SESSION['session_survey']))) {\r\n logout();\r\n die();\r\n }\r\n\r\n $question = new Question();\r\n $question->get_from_db($_GET['question_id']);\r\n $survey = new Survey();\r\n $survey->get_from_db($question->getSurvey());\r\n\r\n if ($survey->getCreatedBy() != $user->getId()) {\r\n if ($user->getAdmin() != 1) {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $question->setIsActive(0);\r\n $question->update_in_db();\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно изтрихте елемент от анкетата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n die();\r\n}", "public function destroy($id)\n\t{\n\t\t$question = Question::findOrFail($id);\n\n\t\t$question->delete();\n\t}", "public function destroy($id)\n\t{\n\t\t$question = Question::findOrFail($id);\n\n\t\t$question->delete();\n\t}", "public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('CompeteComBundle:StudyQuestions')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find StudyQuestions entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('studyquestions'));\n }", "public function delete(IndexableEntity $entity);", "public function destroy($id)\n {\n //\n $command = new DestoryQuestionCommand($id);\n //run command\n $this->dispatch($command);\n return redirect('/questions')\n ->with('message','Question is deleted');\n \n }", "public function destroy(Question $question, Answer $answer)\n {\n $this->authorize('delete', $answer);\n\n $answer->delete();\n\n session()->flash('success', \"Your asnwer has been deleted successfully\");\n return redirect()->back();\n }", "public function delete($entity)\n {\n $statement = \"DELETE FROM contact WHERE id = :id\";\n $prepare = $this->db->prepare($statement);\n $prepare->bindValue(\":id\", $entity->getId());\n $prepare->execute();\n }", "public function deleteById($entityId);", "public function deleteById($entityId);", "function delete_answer($answerId, $questionId){\n $this->db->where('ans_id', $answerId);\n $this->db->where('ans_question', $questionId);\n $this->db->delete('answers');\n }", "public function destroy($id)\n {\n $question = Question::find($id);\n $question->delete();\n return redirect()->route('question.index')-> with('success','question deleted successfully');\n }", "public function question_delete(Request $request)\n {\n $postdata = file_get_contents(\"php://input\");\n $data=json_decode($postdata,true);\n $id2 = $data['id'];\n $data2 = [\n 'status' => '2',\n 'qstatus'=> '2',\n ];\n $this->updateData('question_answers',array('id'=>$id2), $data2);\n $messags['message'] = \"Question has been deleted successfully.\";\n $messags['status']= 1; \n $messags['data']= 'Null';\n \n echo json_encode($messags);\n die;\n }", "public function destroy($id)\n {\n $questions=DB::table('questions')->where('id', '=',$id)->delete();\n }", "public function destroy(Request $request, $questionId, $id)\n {\n $success = false;\n\n /*\n * Students can delete a solution if\n * They Created it\n * Admin has not yet approved it\n */\n $solution = Solution::find($id);\n\n if(!$solution->isApproved() && $solution->creator_id == $request->user()->id){\n $success = $solution->delete();\n }\n\n /*\n * Admin can delete a question at any time.\n */\n elseif($request->user()->isAdmin()){\n $success = $solution->delete();\n }\n\n /*\n * Fire the Event\n */\n event(new QuestionsSolutionModified($solution->question));\n\n /*\n * If AJAX Request, Send Back JSON\n */\n if($request->ajax()){\n return response()->json([\n 'success' => $success\n ]);\n }\n\n /*\n * If POST Request, Send to Home Page Once Deleted.\n */\n if($success){\n return redirect('/');\n }else{\n return back()->with('status','Unable to Delete Question');\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function delQuestionComment(Request $request, QuestionModel $question, Comment $comment)\n {\n $user = $request->user();\n if ($user->id !== $comment->user_id) {\n return response()->json(['message' => [trans('plus-question::comments.not-owner')]], 403);\n }\n\n $question->getConnection()->transaction(function () use ($question, $comment, $user) {\n $comment->delete();\n $question->decrement('comments_count', 1);\n $user->extra()->decrement('comments_count', 1);\n });\n\n return response()->json()->setStatusCode(204);\n }", "public function forceDeleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function destroy($project, $question)\n {\n $this->questions->destroy($project, $question);\n return redirect()->route('admin.project.questions.editall',[$project->id])->withFlashSuccess('The question was successfully deleted.');\n }", "public function delete_question($session_key, $sid, $gid, $qid)\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t\t$sid = sanitize_int($sid);\n\t\t\t$gid = sanitize_int($gid);\n\t\t\t$qid = sanitize_int($qid);\t\t\t\n\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\n\t\t\tif (!isset($surveyidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\n \t\t \n\t\t\t$groupidExists = Groups::model()->findByAttributes(array('gid' => $gid));\n\t\t\tif (!isset($groupidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid groupid', 22);\n\n\t\t\t$questionidExists = Questions::model()->findByAttributes(array('qid' => $qid));\n\t\t\tif (!isset($questionidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid questionid', 22);\n\t\t\n\t\t\tif($surveyidExists['active']=='Y')\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Survey is active and not editable', 35);\t\n\t\t\t\t\t\t\t\n if (hasSurveyPermission($sid, 'surveycontent', 'delete'))\n {\n\t\t\t\t$ccresult = Conditions::model()->findAllByAttributes(array('cqid' => $qid));\n\t\t\t\tif(count($ccresult)>0)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Cannot delete Question. There are conditions for other questions that rely on this question ', 37);\n\t\t\t\t\n\t\t\t\t$row = Questions::model()->findByAttributes(array('qid' => $qid))->attributes;\n\t\t\t\tif ($row['gid']!=$gid)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Missmatch in groupid and questionid', 21);\t\n\n\t\t\t\tLimeExpressionManager::RevertUpgradeConditionsToRelevance(NULL,$qid);\n\n Conditions::model()->deleteAllByAttributes(array('qid' => $qid));\n Question_attributes::model()->deleteAllByAttributes(array('qid' => $qid));\n Answers::model()->deleteAllByAttributes(array('qid' => $qid));\n\n $criteria = new CDbCriteria;\n $criteria->addCondition('qid = :qid or parent_qid = :qid');\n $criteria->params[':qid'] = $qid;\n Questions::model()->deleteAll($criteria);\n\n Defaultvalues::model()->deleteAllByAttributes(array('qid' => $qid));\n Quota_members::model()->deleteAllByAttributes(array('qid' => $qid));\n Questions::updateSortOrder($gid, $sid);\n \n return \"Deleted \".$qid;\n }\n else\n throw new Zend_XmlRpc_Server_Exception('No permission', 2);\n }\t\t\n\t}", "public function deleteAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new DeleteForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Delete an item\",\n ]);\n }", "public function deleteFormQuestion($formId, $questionId)\n {\n $response = $this->client->request(\"DELETE\", \"form/{$formId}/question/{$questionId}\");\n return $response[\"content\"];\n }", "public function destroy($id, $question_id)\n {\n //\n $question = Question::find($question_id);\n $answers = Answer::where('question_id',$question->id)->get();\n try{\n if(!is_null($answers)){\n foreach($answers as $answer){\n $answer->delete();\n }\n $question->delete();\n }\n } catch(Exception $e) {\n return response()->json([ 'err'=>'1',\n 'alert'=>[\n 'icon'=>'error',\n 'title'=>__('site.alert_failed'),\n 'text'=>__('site.error in delete'),\n ]]);\n }\n\n return response()->json(['err'=>'0',\n 'alert'=>[\n 'icon'=>'success',\n 'title'=>__('site.done'),\n 'text'=>__('site.question deleted successfully'),\n ]]);\n }", "public function deleteAction()\r\n\t{\r\n\t\t// check if we know what should be deleted\r\n\t\tif ($id = $this->getRequest()->getParam('faq_id')) {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\t// init model and delete\r\n\t\t\t\t$model = Mage::getModel('flagbit_faq/faq');\r\n\t\t\t\t$model->load($id);\r\n\t\t\t\t$model->delete();\r\n\t\t\t\t\r\n\t\t\t\t// display success message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('cms')->__('FAQ Entry was successfully deleted'));\r\n\t\t\t\t\r\n\t\t\t\t// go to grid\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e) {\r\n\t\t\t\t\r\n\t\t\t\t// display error message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\t\r\n\t\t\t\t// go back to edit form\r\n\t\t\t\t$this->_redirect('*/*/edit', array (\r\n\t\t\t\t\t\t'faq_id' => $id ));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// display error message\r\n\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('cms')->__('Unable to find a FAQ entry to delete'));\r\n\t\t\r\n\t\t// go to grid\r\n\t\t$this->_redirect('*/*/');\r\n\t}", "public function destroy($id)\n {\n $question = Question::find($id);\n// return $id;\n// return DB::table('category_question')->where('question_id', $id)->get();\n DB::table('category_question')->where('question_id', $id)->delete();\n\n $question->delete();\n\n return response('success', 200);\n }" ]
[ "0.7516813", "0.72266424", "0.7171089", "0.7161552", "0.7161552", "0.7161552", "0.711802", "0.71177685", "0.69913006", "0.6842207", "0.6833916", "0.6823587", "0.68161196", "0.68118584", "0.6734905", "0.6733893", "0.6708633", "0.66975296", "0.66901654", "0.6614768", "0.66033715", "0.6596484", "0.6570497", "0.65309364", "0.6503006", "0.6495797", "0.64880604", "0.64850456", "0.64612824", "0.64544547", "0.6447186", "0.6446702", "0.6441704", "0.64316374", "0.64163315", "0.6386426", "0.6361299", "0.633936", "0.629396", "0.62824905", "0.6242051", "0.6224499", "0.6218468", "0.6197509", "0.61929893", "0.6188727", "0.6183043", "0.6159514", "0.61503494", "0.6149282", "0.61413807", "0.61382073", "0.61308914", "0.6129217", "0.60964775", "0.60915375", "0.6087863", "0.60870993", "0.60860544", "0.6076299", "0.60715", "0.60689205", "0.60626334", "0.6047437", "0.60428137", "0.6009767", "0.6009311", "0.60066605", "0.6002562", "0.5998681", "0.5997334", "0.5990837", "0.5988099", "0.59873945", "0.59861296", "0.59807765", "0.59807765", "0.5980419", "0.59693515", "0.59499997", "0.59499663", "0.5946321", "0.59401435", "0.59401435", "0.59366316", "0.5932284", "0.5916566", "0.59085757", "0.5905718", "0.5891146", "0.58869404", "0.58849144", "0.5879939", "0.58769125", "0.58769023", "0.58740467", "0.5859151", "0.58560765", "0.58525807", "0.5848057" ]
0.6265359
40
Calculate duration in months from year & month
function calculateDurationInMonthsAndYears($months) { $duration = []; $years = floor($months/12); $months = $months%12; $duration["month"] = $months; $duration["years"] = $years; return $duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDifferenceInMonths();", "public function getMonths();", "function convertMonths($months){\n\t\treturn $seconds = $months * 2635200; // Seconds for 30.5 days\n\t}", "public static function getMonth(){\n\t\t// this represents the number of seconds ni a month\n\t\t// editing this will lead to false values\n\t\treturn 2419200;\n\t}", "public function getDurationAsString() {\n $years = floor($this->months / 12);\n $extraMonths = $this->months % 12;\n if ($years<=0) {\n // code...\n return \"$extraMonths meses\";\n }if($extraMonths==0){\n return \"$years años\";\n }\n else {\n return \"$years años $extraMonths meses\";\n }\n \n }", "function Duration($s){\n$timestamp = strtotime(\"now\") - $s;\n\n/* Cleaver Maths! */\n$years=floor($timestamp/(60*60*24*365));$timestamp%=60*60*24*365;\n$months=floor($timestamp/(60*60*24*30));\n/* Display for date, can be modified more to take the S off */\nif ($years >= 1) { $str.= $years; }\nif ($months >= 1) { //$str.= $months.'M'; \n}\nreturn $str;\n\n}", "function monthsDif($start, $end)\n{\n $splitStart = explode('-', date('Y-n',$start));\n $splitEnd = explode('-', date('Y-n',$end));\n\n if (is_array($splitStart) && is_array($splitEnd)) \n {\n $startYear = $splitStart[0];\n $startMonth = $splitStart[1];\n $endYear = $splitEnd[0];\n $endMonth = $splitEnd[1];\n\n $difYears = $endYear - $startYear;\n $difMonth = $endMonth - $startMonth;\n\n if (0 == $difYears && 0 == $difMonth) \n { // month and year are same\n return 0;\n }\n else if (0 == $difYears && $difMonth > 0) \n { // same year, dif months\n return $difMonth;\n }\n else if (1 == $difYears) \n {\n $startToEnd = 13 - $startMonth; // months remaining in start year(13 to include final month\n return ($startToEnd + $endMonth); // above + end month date\n }\n else if ($difYears > 1) \n {\n $startToEnd = 13 - $startMonth; // months remaining in start year \n $yearsRemaing = $difYears - 2; // minus the years of the start and the end year\n $remainingMonths = 12 * $yearsRemaing; // tally up remaining months\n $totalMonths = $startToEnd + $remainingMonths + $endMonth; // Monthsleft + full years in between + months of last year\n return $totalMonths;\n }\n }\n else \n {\n return false;\n }\n}", "public function diffMonths($month){\n\t\t$month = abs($month);\n\t\tif($this->_month-$month<1){\n\t\t\t$year = floor(($month-$this->_month)/12) + 1;\n\t\t\t$this->_month = $this->_month + ($year * 12) - $month;\n\t\t\t$this->_year-= $year;\n\t\t} else {\n\t\t\t$this->_month-=$month;\n\t\t}\n\t\tif($this->_day>30||($this->_day>28&&$this->_month==2)){\n\t\t\t$this->_day = substr(self::getLastDayOfMonth($this->_month, $this->_year),-2);\n\t\t}\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "function ElapsedDays($year, $month, $day) {\n global $now;\n global $UTC;\n $date = DateTime::createFromFormat('ymd', \"$year$month$day\", $UTC);\n $daytime = $date->getTimestamp();\n $elapsed = max($now - $daytime, 0) / 86400;\n return $elapsed;\n}", "public function get_month_permastruct()\n {\n }", "function months_diff($date1, $date2 = FALSE)\n{\n $date1 = is_int($date1) ? $date1 : strtotime($date1);\n $date2 = ($date2 === FALSE) ? time() : (is_int($date2) ? $date2 : strtotime($date2));\n\n return (int) floor(abs($date2 - $date1) / (30*60*60*24));;\n}", "function get_age_difference($start_date,$end_date, $separator){\n \n\tlist($start_month,$start_date,$start_year) = explode($separator, $start_date);\n list($current_month,$current_date,$current_year) = explode($separator, $end_date);\n $result = '';\n \n /** days of each month **/\n \n for($x=1 ; $x<=12 ; $x++){\n \n $dim[$x] = date('t',mktime(0,0,0,$x,1,date('Y')));\n \n }\n \n /** calculate differences **/\n \n $m = $current_month - $start_month;\n $d = $current_date - $start_date;\n $y = $current_year - $start_year;\n\n /** if the start day is ahead of the end day **/\n \n if($d < 0) {\n \n $today_day = $current_date + $dim[$current_month];\n $today_month = $current_month - 1;\n $d = $today_day - $start_date;\n $m = $today_month - $start_month;\n if(($today_month - $start_month) < 0) {\n \n $today_month += 12;\n $today_year = $current_year - 1;\n $m = $today_month - $start_month;\n $y = $today_year - $start_year;\n \n }\n \n }\n \n /** if start month is ahead of the end month **/\n \n if($m < 0) {\n \n $today_month = $current_month + 12;\n $today_year = $current_year - 1;\n $m = $today_month - $start_month;\n $y = $today_year - $start_year;\n \n }\n \n /** Calculate dates **/\n \n if($y < 0) {\n \n die(\"Start date entered is a future date.\");\n \n } else {\n \n switch($y) {\n \n case 0 : $result .= ''; break;\n case 1 : $result .= $y.($m == 0 && $d == 0 ? ' Year' : ' Year'); break;\n default : $result .= $y.($m == 0 && $d == 0 ? ' Years' : ' Years');\n \n }\n \n switch($m) {\n \n case 0: $result .= ''; break;\n case 1: $result .= ($y == 0 && $d == 0 ? $m.' Month' : ($y == 0 && $d != 0 ? $m.' Month' : ($y != 0 && $d == 0 ? ' and '.$m.' Month' : ', '.$m.' Month'))); break;\n default: $result .= ($y == 0 && $d == 0 ? $m.' Months' : ($y == 0 && $d != 0 ? $m.' Months' : ($y != 0 && $d == 0 ? ' and '.$m.' Months' : ', '.$m.' Months'))); break;\n \n }\n \n switch($d) {\n \n case 0: $result .= ($m == 0 && $y == 0 ? 'Today' : ''); break;\n case 1: $result .= ($m == 0 && $y == 0 ? $d.' Day' : ($y != 0 || $m != 0 ? ' and '.$d.' Day' : '')); break;\n default: $result .= ($m == 0 && $y == 0 ? $d.' Days' : ($y != 0 || $m != 0 ? ' and '.$d.' Days' : ''));\n \n }\n \n }\n\n return $result;\n \n}", "public function takePostBaseOnMonth();", "private function _daysInMonth ()\n {\n return date('t', strtotime($this->currentYear.'-'.$this->currentMonth));\n }", "function endMonth($start_month, $timeline)\n{\n $convertStartMonthToDateFormat = strtotime($start_month);\n $convertStartMonthToMonthNumber = date('n', $convertStartMonthToDateFormat);\n $monthNum = $convertStartMonthToMonthNumber + (int)$timeline;\n\n $mytime = Carbon::now();\n $mytime = strtotime($mytime);\n $month = date('F', $mytime);\n $currentMonth = strtotime($month);\n $year = date('Y', $mytime);\n\n if($currentMonth > $convertStartMonthToDateFormat) {\n $newyear = $year + 1;\n if($monthNum > 12) {\n $monthNum = $monthNum - 12;\n $newyear = $newyear + 1;\n }\n }\n elseif($currentMonth <= $convertStartMonthToDateFormat) {\n $newyear = $year;\n if($monthNum > 12) {\n $monthNum = $monthNum - 12;\n $newyear = $newyear + 1;\n }\n }\n $convertEndMonthYear = strtotime($monthNum . '/' . 1 . '/' .$newyear);\n $endMonth = date('Y-m-d', $convertEndMonthYear);\n\n return $endMonth;\n}", "public static function getDaysInMonth($month, $year) {}", "function add_months(&$t, $m)\n{\n $t['tm_mon'] += $m;\n if ($t['tm_mon'] > 12) \n {\n $t['tm_mon'] -= 12;\n $t['tm_year'] ++;\n }\n elseif ($t['tm_mon'] < 1) \n {\n $t['tm_mon'] += 12;\n $t['tm_year'] --;\n }\n return;\n}", "public function indivMonthly(Request $request){\n $id = $request->SLAVE_ID;\n $year = date('Y');\n $month = [];\n for($i = 1; $i<=12; $i++){\n $perMonth = 0;\n $res = EMeterData::where('METER_ID',$id)\n ->whereMonth('CREATED_AT', '=', $i)\n ->whereYear('CREATED_AT','=',$year)->latest()->first();\n if (!empty($res) || $res == !null) {\n $perMonth += $res->CURRENT_MONTH_KWH;\n $perMonth = round($perMonth, 4);\n }\n $json = array(\n 'months' => date('D F d Y H:i:s O',mktime(0,0,0,$i,25)),\n 'usage' => $perMonth,\n );\n array_push($month,$json);\n }\n return $month;\n }", "private function _daysInMonth($month=null,$year=null){\n \n if(null==($year))\n $year = date(\"Y\",time()); \n \n if(null==($month))\n $month = date(\"m\",time());\n \n return date('t',strtotime($year.'-'.$month.'-01'));\n }", "function add_month($start, $months)\n{\n $date1 = new DateTime($start->format(\"Y-m-d\\TH:i:sP\"));\n $day1 = intval($date1->format(\"d\"));\n\n $date2 = $date1->add(new DateInterval('P'.strval($months).'M'));\n $year2 = intval($date2->format(\"Y\"));\n $month2 = intval($date2->format(\"m\"));\n $day2 = intval($date1->format(\"d\"));\n\n if ($day1 <= $day2)\n {\n return $date2;\n }\n $date2->setDate($year2, $month2, 0);\n return $date2;\n}", "function monthPeriod_start_end($begin, $end)\n{\n $begin = (new DateTime($begin.'-01-01'))->modify('first day of this month');\n $end = (new DateTime($end.'-12-01 +1 month'))->modify('first day of this month');\n $daterange = new DatePeriod($begin, new DateInterval('P1M'), $end);\n\n foreach ($daterange as $date) {\n $dates[] = $date->format(\"m\");\n }\n return $dates;\n}", "protected function getMonthsArray()\n\t{\n\t\t$ma = array_pad([], 13, null);\n\t\tunset($ma[0]);\n\t\tforeach ($this->_attr[self::MONTH_OF_YEAR] as $m) {\n\t\t\tif (is_numeric($m['moy'])) {\n\t\t\t\tfor ($i = $m['moy']; $i <= $m['end'] && $i <= 12; $i += $m['period']) {\n\t\t\t\t\t$ma[$i] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ma;\n\t}", "function days_in_month($month, $year)\n{\n\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\n}", "function nb_mois($date1, $date2)\r\n\t{\r\n\t // $end = new DateTime( $date2 );\r\n\t // $end = $end->modify( '+1 month' );\r\n\r\n\t // $interval = DateInterval::createFromDateString('+ 1 month');\r\n\r\n\t // $period = new DatePeriod($begin, $interval, $end);\r\n\t // $counter = 0;\r\n\t // foreach($period as $dt) {\r\n\t // $counter++;\r\n\t // }\r\n\r\n\t // return $counter;\r\n\t\t// $date1 = '2000-01-25';\r\n\t\t// $date2 = '2010-02-20';\r\n\r\n\t\t$ts1 = strtotime($date1);\r\n\t\t$ts2 = strtotime($date2);\r\n\r\n\t\t$year1 = date('Y', $ts1);\r\n\t\t$year2 = date('Y', $ts2);\r\n\r\n\t\t$month1 = date('m', $ts1);\r\n\t\t$month2 = date('m', $ts2);\r\n\r\n\t\t$diff = (($year2 - $year1) * 12) + ($month2 - $month1);\r\n\t\treturn $diff;\r\n\t}", "public function subMonths(int $months)\n {\n $time = clone $this;\n\n return $time->sub(DateInterval::createFromDateString(\"{$months} months\"));\n }", "function addMonths( $n=0 ) {\n\t\t$an = abs( $n );\n\t\t$years = floor( $an / 12 );\n\t\t$months = $an % 12;\n\t\t\n\t\tif ($n < 0) {\n\t\t\t$this->year -= $years;\n\t\t\t$this->month -= $months;\n\t\t\tif ($this->month < 1) {\n\t\t\t\t$this->year--;\n\t\t\t\t$this->month = 12 - $this->month;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->year += $years;\n\t\t\t$this->month += $months;\n\t\t\tif ($this->month > 12) {\n\t\t\t\t$this->year++;\n\t\t\t\t$this->month -= 12;\n\t\t\t}\n\t\t}\n\t}", "public function months(): int\n {\n return $this->months;\n }", "function getMonthsInYear($y=null)\n {\n return 12;\n }", "function getMonthlyHiredDays( $startDate, $endDate ) {\n \n $startDate = DateTime::createFromFormat('Y-m-d H:i:s', $startDate);\n $endDate = DateTime::createFromFormat('Y-m-d H:i:s', $endDate);\n \n if ( !$startDate || !$endDate ) {\n \n echo 'Invalid arguments';\n return;\n }\n \n if ( $startDate > $endDate) {\n \n echo 'The start date is greater than the end date';\n return;\n }\n \n $hiredDays = array(); \n if ( $startDate->format('n') == $endDate->format('n') && $startDate->format('Y') == $endDate->format('Y') ) {\n \n // Get ddays between days and push to the array\n array_push( $hiredDays,\n array(\n 'year' => $startDate->format('Y'),\n 'month' => $startDate->format('n'),\n 'days' => $startDate->diff($endDate, true)->days\n )\n );\n \n }else {\n \n // Loop until the last date and get the days of every month \n while( true ) { \n \n if( !isset($startPoint) ) {\n \n $startPoint = $startDate; \n $m = $startDate->format('n');\n }else {\n \n $startPoint = $endPoint->add(new DateInterval('P1D'));\n $startPoint = $startPoint->setTime(0,0,0);\n $m = $startPoint->format('n');\n }\n \n if ( $m == 11 //30 days\n || $m == 4\n || $m == 6\n || $m == 9 ) {\n \n $monthDays = 30;\n }elseif ( $m == 2 ) { // 28 days\n \n $monthDays = $startPoint->format('L') == 1 ? 29 : 28;\n \n }else { // 31 days \n \n $monthDays = 31;\n }\n \n $endPoint = DateTime::createFromFormat('Y-m-d H:i:s', $startPoint->format('Y').'-'.$m.'-'.$monthDays.' 23:59:59');\n \n if ( $endPoint > $endDate ) {\n \n $endPoint = $endDate;\n } \n \n array_push( $hiredDays,\n array(\n 'year' => $startPoint->format('Y'),\n 'month' => $startPoint->format('n'),\n 'days' => $startPoint->diff($endPoint, true)->days + 1\n )\n );\n\n if ( $endPoint == $endDate ) {\n break;\n }\n \n $m = $m == 12 ? 1 : $m + 1;\n }\n } \n return $hiredDays;\n }", "public function calculate_duration() {\n $date_helper = YITH_WCBK_Date_Helper();\n $duration = $date_helper->get_time_diff( $this->from, $this->to, $this->duration_unit );\n if ( $this->is_all_day() )\n $duration += 1;\n\n return $duration;\n }", "function cal_days_in_year($year){\n $days=0; \n for($month=1;$month<=12;$month++){ \n $days = $days + cal_days_in_month(CAL_GREGORIAN,$month,$year);\n }\n return $days;\n}", "public static function end_of_month_minutes() {\n $carbon_now = Carbon::now();\n\n return $carbon_now->diffInMinutes($carbon_now->copy()->endOfMonth());\n }", "function getDays_ym($month, $year){\n // Start of Month\n $start = new DateTime(\"{$year}-{$month}-01\");\n $month = $start->format('F');\n\n // Prepare results array\n $results = array();\n\n // While same month\n while($start->format('F') == $month){\n // Add to array\n $day = $start->format('D');\n $sort_date = $start->format('j');\n $date = $start->format('Y-m-d');\n $results[$date] = ['day' => $day,'sort_date' => $sort_date,'date' => $date];\n\n // Next Day\n $start->add(new DateInterval(\"P1D\"));\n }\n // Return results\n return $results;\n}", "public function getNumberOfMonths()\n {\n return $this->number_of_months;\n }", "function daysInMonth( $month=0, $year=0 ) {\n\t\t$month = intval( $month );\n\t\t$year = intval( $year );\n\t\tif (!$month) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$month = $this->month;\n\t\t\t} else {\n\t\t\t\t$month = date( \"m\" );\n\t\t\t}\n\t\t}\n\t\tif (!$year) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$year = $this->year;\n\t\t\t} else {\n\t\t\t\t$year = date( \"Y\" );\n\t\t\t}\n\t\t}\n\t\tif ($month == 2) {\n\t\t\tif (($year % 4 == 0 && $year % 100 != 0) || $year % 400 == 0) {\n\t\t\t\treturn 29;\n\t\t\t} else {\n\t\t\t\treturn 28;\n\t\t\t}\n\t\t} else if ($month == 4 || $month == 6 || $month == 9 || $month == 11) {\n\t\t\treturn 30;\n\t\t} else {\n\t\t\treturn 31;\n\t\t}\n\t}", "public function IsMoonPhase() {\n switch($this->GetYear() . \"-\" . $this->GetMOnth() . \"-\" . $this->GetDay()) {\n case \"2015-01-20\":\n case \"2015-02-19\":\n case \"2015-03-20\":\n case \"2015-04-18\":\n case \"2015-05-18\":\n case \"2015-06-16\":\n case \"2015-07-16\":\n case \"2015-08-14\":\n case \"2015-09-13\":\n case \"2015-10-13\":\n case \"2015-11-11\":\n case \"2015-12-11\":\n return array(1, \"Nymåne\"); // new moon\n case \"2015-01-27\":\n case \"2015-02-25\":\n case \"2015-03-27\":\n case \"2015-04-26\":\n case \"2015-05-25\":\n case \"2015-06-24\":\n case \"2015-07-24\":\n case \"2015-08-22\":\n case \"2015-09-21\":\n case \"2015-10-20\":\n case \"2015-11-19\":\n case \"2015-12-18\":\n return array(3, \"Växande halvmåne\"); // first quarter moon\n case \"2015-01-05\":\n case \"2015-02-04\":\n case \"2015-03-05\":\n case \"2015-04-04\":\n case \"2015-05-04\":\n case \"2015-06-02\":\n case \"2015-07-02\":\n case \"2015-07-31\":\n case \"2015-08-29\":\n case \"2015-09-28\":\n case \"2015-10-27\":\n case \"2015-11-25\":\n case \"2015-12-25\":\n return array(5, \"Fullmåne\"); // full moon\n case \"2015-01-13\":\n case \"2015-02-12\":\n case \"2015-03-13\":\n case \"2015-04-12\":\n case \"2015-05-11\":\n case \"2015-06-09\":\n case \"2015-07-08\":\n case \"2015-08-07\":\n case \"2015-09-05\":\n case \"2015-10-04\":\n case \"2015-11-03\":\n case \"2015-12-03\":\n return array(7, \"Avtagande halvmåne\"); // third quarter moon\n default:\n return array(null, null);\n }\n }", "public function countAllMonths(DateTime $start, DateTime $end) : int\n\t{\n\t\t$startYear = (int) $start->format('Y');\n\t\t$startMonth = (int) $start->format('m');\n\t\t$endYear = (int) $end->format('Y');\n\t\t$endMonth = (int) $end->format('m');\n\t\treturn ($endYear - $startYear) * 12 + ($endMonth - $startMonth) + 1;\n\t}", "public function ntc_months ($input) {\n $this->months_input = substr($input, -19, 2);\n return $this->months_output = date('m') - $this->months_input;\n }", "public static function getMonths() \n\t {\n\t\t $month=array(1,2,3,4,5,6,7,8,9,10,11,12);\n\t\t return $month;\n\t }", "public function get_duration();", "function _deleteMonths($eventId) {\n return $this->databaseDeleteRecord(\n $this->tableRecurrenceMonths,\n 'event_id',\n $eventId\n );\n }", "function daysInMonth($year, $month) \n{\n if ($month == 1) return 31;\n if ($month == 2) {\n if ((($year%4) == 0) && ((($year%100) != 0) \n || ((($year%100) == 0) && (($year%400) == 0)))\n ) return 29;\n return 28;\n }\n if ($month == 3) return 31;\n if ($month == 4) return 30;\n if ($month == 5) return 31;\n if ($month == 6) return 30;\n if ($month == 7) return 31;\n if ($month == 8) return 31;\n if ($month == 9) return 30;\n if ($month == 10) return 31;\n if ($month == 11) return 30;\n if ($month == 12) return 31;\n return 0;\n \n}", "public function testYearlyByMonthLoop()\n {\n $this->parse(\n 'FREQ=YEARLY;INTERVAL=1;UNTIL=20120203T225959Z;BYMONTH=2;BYSETPOS=1;BYDAY=SU,MO,TU,WE,TH,FR,SA',\n '2012-01-01 15:45:00',\n [\n '2012-02-01 15:45:00',\n ],\n 'yearly', null, 1, new DateTime('2012-02-03 22:59:59'),\n '2012-01-29 23:00:00'\n );\n }", "function totalHari($month,$year){\n $jumlah = cal_days_in_month(CAL_GREGORIAN,$month,$year);\n return $jumlah;\n}", "private function getDatesInMonth() {\n $viewer = $this->getViewer();\n\n $timezone = new DateTimeZone($viewer->getTimezoneIdentifier());\n\n $month = $this->month;\n $year = $this->year;\n\n list($next_year, $next_month) = $this->getNextYearAndMonth();\n\n $end_date = new DateTime(\"{$next_year}-{$next_month}-01\", $timezone);\n\n list($start_of_week, $end_of_week) = $this->getWeekStartAndEnd();\n\n $days_in_month = id(clone $end_date)->modify('-1 day')->format('d');\n\n $first_month_day_date = new DateTime(\"{$year}-{$month}-01\", $timezone);\n $last_month_day_date = id(clone $end_date)->modify('-1 day');\n\n $first_weekday_of_month = $first_month_day_date->format('w');\n $last_weekday_of_month = $last_month_day_date->format('w');\n\n $day_date = id(clone $first_month_day_date);\n\n $num_days_display = $days_in_month;\n if ($start_of_week !== $first_weekday_of_month) {\n $interim_start_num = ($first_weekday_of_month + 7 - $start_of_week) % 7;\n $num_days_display += $interim_start_num;\n\n $day_date->modify('-'.$interim_start_num.' days');\n }\n if ($end_of_week !== $last_weekday_of_month) {\n $interim_end_day_num = ($end_of_week - $last_weekday_of_month + 7) % 7;\n $num_days_display += $interim_end_day_num;\n $end_date->modify('+'.$interim_end_day_num.' days');\n }\n\n $days = array();\n\n for ($day = 1; $day <= $num_days_display; $day++) {\n $day_epoch = $day_date->format('U');\n $end_epoch = $end_date->format('U');\n if ($day_epoch >= $end_epoch) {\n break;\n } else {\n $days[] = clone $day_date;\n }\n $day_date->modify('+1 day');\n }\n\n return $days;\n }", "public static function yearsMonthsPassed ( $date1, $date2 ) \r\n {\r\n \r\n \t$d1 = new DateTime( $date1 );\r\n \t$d2 = new DateTime( $date2 );\r\n \r\n \t$diff = $d2->diff( $d1 );\r\n \r\n \t// Return array years and months\r\n \treturn array ( $diff->y, $diff->m );\r\n }", "public function getMoisCloture($months)\n {\n \n $result = array();\n\n foreach ($months as $month) {\n \n $explode = explode('-', $month);\n $value = strval(intval($explode[0]) - 1) . '-' . $explode[1];\n array_push($result, $value);\n\n }\n\n return $result;\n\n }", "protected function month(){\n return $this->now->format('m');\n }", "function getTimeDuration();", "function dayToMonth($time){\n $time = $time * 24 * 3600;\n $years = floor($time / (60*60*24*365));\n $time-=$years*60*60*24*365;\n $months = floor($time/(60*60*24*30));\n $time-=$months*60*60*24*30;\n $days = floor($time/(60*60*24));\n $time-=$days*60*60*24;\n $hours = floor($time/(60*60));\n $time-=$hours*60*60;\n $seconds = floor($time/60);\n return ($years>0?$years.' ano'. ($years>1?'s ':' '):'') .\n ($months>0?$months.' mes'.($months>1?'es ':' '):'') . ' e '.\n ($days>0?$days.' dia' .($days>1?'s ':' '):'');\n}", "public static function months_within_range($start, $end, $format = \"F\") {\n\t\t$start = (new DateTime($start))->modify('first day of this month');\n\t\t$end = (new DateTime($end))->modify('first day of next month');\n\t\t$interval = DateInterval::createFromDateString('1 month');\n\t\t$period = new DatePeriod($start, $interval, $end);\n\n\t\t$months = [];\n\t\tforeach ($period as $dt) {\n\t\t array_push($months, $dt->format($format));\n\t\t}\n\t\treturn $months;\n\t}", "function getDaysInMonth()\r\n {\r\n return Data_Calc::diasInMonth($this->mes, $this->ano);\r\n }", "public function volume_year_to($month_div){\n\t\t\n\t\t$year_to = $this->curr_yr;\n\t\treturn $year_to;\n\t\t\n\t}", "public function addMonths($month){\n\t\t$month = abs($month);\n\t\tif($this->_month+$month>12){\n\t\t\t$year = ceil(($month+$this->_month)/12) - 1;\n\t\t\t$this->_month = ($year * 12) - $this->_month + $month;\n\t\t\t$this->_year+= $year;\n\t\t} else {\n\t\t\t$this->_month+=$month;\n\t\t}\n\t\tif($this->_day>30||($this->_day>28&&$this->_month==2)){\n\t\t\t$this->_day = substr(self::getLastDayOfMonth($this->_month, $this->_year),-2);\n\t\t}\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "public function subMonths($numMonths)\r\n\t{\r\n\t\t// Check the input for a numeric value\r\n\t\tif (!is_numeric($numMonths))\r\n\t\t{\r\n\t\t\tthrow new Exception('addMonths() expects an integer');\r\n\t\t}\r\n\t\t\r\n\t\t// Make negative numbers not an issue\r\n\t\t$numMonths = abs(intval($numMonths));\r\n\t\t\r\n\t\t// Subtract the months form the current month\r\n\t\t$newValue = $this->_month - $numMonths;\r\n\t\t\r\n\t\t// Are we in the same year? If the result is\r\n\t\t// greater than 0 we are - just set the month value\r\n\t\tif ($newValue > 0)\r\n\t\t{\r\n\t\t\t$this->_month = $newValue;\r\n\t\t}\r\n\t\t// We're back to the previous year(s).\r\n\t\t// Year should be changed as well.\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Create an array for months in reverse\r\n\t\t\t// Logic: \r\n\t\t\t//\t\t\t\tFebruary - 2 months is 2 - 2 = 0 is December\r\n\t\t\t//\t\t\t\tFebruary - 2 months is 2 - 3 = -1 is November\r\n\t\t\t// So, October is -2, Septermber -3 and so on till January is -12\r\n\t\t\t// We take away the minus and we've got our array from 12 to 1\r\n\t\t\t// $months[0] = 12 = December\r\n\t\t\t$months = range(12, 1);\r\n\t\t\t\r\n\t\t\t// Get the absolute (positive) value of $newValue\r\n\t\t\t$newValue = abs($newValue);\r\n\t\t\t\r\n\t\t\t// Get the array position of the resulting months\r\n\t\t\t// We divide the input by 12 and the result we get\r\n\t\t\t// is \r\n\t\t\t//\t\t- years - full value\r\n\t\t\t//\t\t- months - remainder\r\n\t\t\t$monthPosition = $newValue % 12;\r\n\t\t\t$this->_month = $months[$monthPosition];\r\n\t\t\t\r\n\t\t\t// Check, if the month position is December\r\n\t\t\t// Since array key for December is 0, everything that is not 0\r\n\t\t\t// is December.\r\n\t\t\tif ($monthPosition)\r\n\t\t\t{\r\n\t\t\t\t$this->_year -= ceil($newValue / 12);\r\n\t\t\t}\r\n\t\t\t// It is December - fix the December issue by adding 1\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->_year -= ceil($newValue / 12) + 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Normalize the end of the months days\r\n\t\t\t// See checkLastDayOfMonth() for details\r\n\t\t\t$this->checkLastDayOfMonth();\r\n\t\t\tparent::setDate($this->_year, $this->_month, $this->_day);\r\n\t\t}\r\n\t}", "function getMonthTotal(){\n\t\t$total = $this->hhRentAmount;\n\t\tforeach ($this->members as $member){\n\t\t\tforeach ($member->getBills() as $bill){\n\t\t\t\t$total += $bill->getBillAmount();\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}", "public function days_in_month($month, $year)\n\t{\n\t\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\n\t}", "public function getMonthlyInstalment();", "public function Months() {\r\n// $months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\r\n $months = array(1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');\r\n return $months;\r\n }", "function days_in_month($month, $year)\n\t{\n\t\tif(checkdate($month, 31, $year)) return 31;\n\t\tif(checkdate($month, 30, $year)) return 30;\n\t\tif(checkdate($month, 29, $year)) return 29;\n\t\tif(checkdate($month, 28, $year)) return 28;\n\t\treturn 0; // error\n\t}", "public static function getMonths()\n {\n return [ \n CarbonInterface::JANUARY => 'January', \n CarbonInterface::FEBRUARY => 'February', \n CarbonInterface::MARCH => 'March', \n CarbonInterface::APRIL => 'April', \n CarbonInterface::MAY => 'May', \n CarbonInterface::JUNE => 'June', \n CarbonInterface::JULY => 'July', \n CarbonInterface::AUGUST => 'August', \n CarbonInterface::SEPTEMBER => 'September', \n CarbonInterface::OCTOBER => 'October', \n CarbonInterface::NOVEMBER => 'November', \n CarbonInterface::DECEMBER => 'December', \n ];\n }", "public function getMonths()\r\n\t{\r\n \t$months = array();\r\n\t\t\r\n\t\tfor($i = 1; $i <= 12; $i++)\r\n\t\t{\r\n\t\t\t$label = ($i < 10) ? (\"0\" . $i) : $i;\r\n\t\t\t\r\n\t\t\t$months[] = array(\"num\" => $i, \"label\" => $this->htmlEscape($label));\r\n\t\t}\r\n\t\t\r\n\t\treturn $months;\r\n\t}", "public function monthly()\n {\n return $this->cron('0 0 1 * * *');\n }", "public function is_month()\n {\n }", "public function getMonth()\n {\n return $this->_getDateValue('m');\n }", "public function month_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_start',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date',\n\t\t\t\t'default'\t=> 'year-01-01'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_end',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'limit',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'integer',\n\t\t\t\t'default'\t=> 12\n\t\t\t)\n\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set(\n\t\t\t\t'date_range_end',\n\t\t\t\t$this->CDT->add_month($this->P->value('limit'))\n\t\t\t);\n\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = (\n\t\t\t$this->P->value('date_range_end', 'ymd') >\n\t\t\t\t$this->P->value('date_range_start', 'ymd')\n\t\t) ? 1 : -1;\n\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo\n\t\t{\n\t\t\t$vars['conditional']\t= array(\n\t\t\t\t'is_current_month'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t),\n\t\t\t\t'is_not_current_month'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t) ? FALSE : TRUE,\n\t\t\t\t'is_current_year'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? TRUE : FALSE,\n\t\t\t\t'is_not_current_year'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? FALSE : TRUE\n\t\t\t);\n\n\t\t\t$vars['single']\t= array(\n\t\t\t\t'year'\t=> $this->CDT->year,\n\t\t\t\t'month'\t=> $this->CDT->month\n\t\t\t);\n\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'month'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_month($dir);\n\t\t\t$count++;\n\t\t}\n\t\twhile (\n\t\t\t$count < $this->P->value('limit') AND\n\t\t\t$this->CDT->ymd < $this->P->value('date_range_end', 'ymd')\n\t\t);\n\n\t\treturn $output;\n\t}", "function getMonthDir() {\n return date(\"Y_m\");\n }", "public function duration()\n {\n $start_date = (int) $this->start_date;\n $end_date = (int) $this->end_date;\n\n $duration = ($end_date - $start_date) / 1000;\n\n return $duration;\n }", "function initMonth()\n {\n //! Si aucun mois ou année n'est recupéré on prend le mois et l'année actuel\n if (!$this->currentMonthName || !$this->year) {\n $this->currentMonthIndex = (int)date(\"m\", time()) - 1;\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n $this->year = (int)date(\"Y\", time());\n }\n // recalcule le premier jour pour ce mois et le nombre de jour total du mois\n $this->firstDayInMonth = strftime('%u', strtotime(strval($this->currentMonthIndex + 1) . '/01/' . strval($this->year)));\n $this->nbDaysMonth = cal_days_in_month(CAL_GREGORIAN, $this->currentMonthIndex + 1, $this->year);\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n }", "public static function totalExperience($id){\n $experiences = Experience::where('user_id',$id)->get();\n $months = 0;\n $years = 0;\n $days = 0;\n foreach ($experiences as $experience){\n $start_date = strtotime($experience->start_date);\n if ($experience->is_current==1 && $experience->end_date==\"Continue\"){\n $end_date = strtotime(date('Y-m-d'))+$days*60*60*24;\n }else{\n $end_date = strtotime($experience->end_date)+$days*60*60*24;\n }\n while (strtotime('+1 MONTH', $start_date) < $end_date) {\n $months++;\n $start_date = strtotime('+1 MONTH', $start_date);\n if($months>11){\n $years++;\n $months=0;\n }\n }\n $days = ($end_date - $start_date) / (60*60*24);\n\n }\n return $years.\" year, \". $months. ' month, '. $days . ' days';\n }", "function monthLength($year, $mon)\n {\n $l = 28;\n while (checkdate($mon, $l + 1, $year)) $l++;\n return $l;\n }", "protected static function months_between(DateTime $date1, DateTime $date2){\r\n \r\n\r\n $months_between = array();\r\n $m1 = $date1->format('n');\r\n $m2 = $date2->format('n');\r\n $y1 = $date1->format('Y');\r\n $y2 = $date2->format('Y');\r\n// echo \"<h5>1: $m1 $y1 2: $m2 $y2</h5>\";\r\n \r\n $total_months_between = $m2-$m1 + ($y2-$y1)*12 ;\r\n// echo \"<h5>ukupno izmedju $total_months_between</h5>\";\r\n \r\n $date1->modify('first day of this month');\r\n $date2->modify('first day of this month');\r\n $date1->modify('+1 month');\r\n\r\nfor ($i=1; $i<=$total_months_between; $i++){\r\n $month = $date1->format('F');\r\n $month = strtolower($month);\r\n $year = $date1->format('Y');\r\n \r\n $months_between[$year][] = $month;\r\n $date1->modify('+1 month');\r\n }\r\n\r\n \r\n// var_dump($months_between);\r\n return $months_between;\r\n\r\n }", "function daysOnMonth($month, $year) {\n\tif (month <= 0) {\n\t\t$year -= 1;\n\t\t$month += 12;\n\t}\n\tif ( in_array( $month, array(4,6,9,11) ) ) return 30;\n\telseif ($month == 2) {\n\t\tif ( isBissextile($year) ) return 29;\n\t\telse return 28;\n\t} else return 31;\n}", "function get_month_days_cm ($fecha) {\n $labels = array();\n $month = month_converter($fecha->month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $fecha->month, $fecha->year);\n $i = 0;\n while ($i < $monthdays) {\n $i++;\n $labels[] = $i;\n }\n return $labels;\n}", "function daysInMonth($m, $y)\n\t{\n\t\tif( $m < 1 || $m > 12 )\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// 30: 9, 4, 6, 11\n\t\t\tif( $m == 9 || $m == 4 || $m == 6 || $m == 11 )\n\t\t\t{\n\t\t\t\treturn 30;\n\t\t\t}\n\t\t\telse if( $m != 2 )\n\t\t\t{\n\t\t\t\t// all the rest have 31\n\t\t\t\treturn 31;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// except for february alone\n\t\t\t\tif( $y % 4 != 0 )\n\t\t\t\t{\n\t\t\t\t\t// which has 28\n\t\t\t\t\treturn 28;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif( $y % 100 != 0 ) \n\t\t\t\t\t{\n\t\t\t\t\t\t// and on leap years 29\n\t\t\t\t\t\treturn 29;\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( $y % 400 != 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// deja vu: which has 28\n\t\t\t\t\t\t\treturn 28;\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// deja vu: and on leap years 29\n\t\t\t\t\t\t\treturn 29;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getExpiryMonth()\n {\n return $this->expiry_month;\n }", "private function getEditableMonths($startYear = 2013, $startMonth = 1)\n {\n $months = array();\n $start = Carbon::create($startYear, $startMonth, 1);\n $end = Carbon::now()->addMonth();\n\n while($end->gte($start))\n {\n array_push($months, $end->copy());\n $end->subMonth();\n }\n\n return $months;\n\n }", "public function monthLengthDays(int $month = null, int $year = null) : int\n {\n $mnth = $month ?? $this->format('m');\n switch ($mnth) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 8:\n case 10:\n case 12:\n return 31;\n case 4:\n case 6:\n case 9:\n case 11:\n return 30;\n case 2:\n return !date('L', $year === null ? $this->getTimestamp() : mktime(1, 1, 1, 2, 1, $year)) ? 28 : 29;\n }\n throw new \\InvalidArgumentException('Arg month[' . $month . '] is not 1 through 12.');\n }", "function hebrew_month_days($mo, $yr) {\n\n\t\tswitch ($mo) {\n\t\t\tcase 2:\t\t//fixed length 29 day months\n\t\t\tcase 4:\n\t\t\tcase 6:\n\t\t\tcase 10:\n\t\t\tcase 13:\n\t\t\t\treturn (29);\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\tif (! hebrew_leap($yr) ) return(29);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t//Heshvan depends on length of year\n\t\t\t\tif ( !( (hebrew_year_days($yr) % 10) == 5) ) return (29);\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\t//Kislev also varies with the length of year\n\t\t\t\tif ( (hebrew_year_days($yr) % 10) == 3 ) return (29);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//otherwise the month has 30 days\n\t\treturn (30);\n\t}", "function GetAllMonthsTillDate($date,$year)\n\t{\n\t\t$date1=$date;\n\t\t$yr1=$year;\n\t\t$yr2='2014';\n\t\t$date2=date('Y-m-d');\n\t\t$time1 = strtotime($date1);\n\t\t$time2 = strtotime($date2);\n\t\t$my = date('mY', $time2);\n\n\t\t$months = array(date($yr1.'-m-d', $time1));\n\n\t\twhile($time1 < $time2) {\n\t\t\t$time1 = strtotime(date('Y-m-d', $time1).' +1 month');\n\t\t\tif(date('mY', $time1) != $my && ($time1 < $time2)){\n\t\t\t\tif(count($months)>=12)\n\t\t\t\t{$yr1=$yr2;}\n\t\t\t\t\n\t\t\t\t$months[] = date($yr1.'-m-d', $time1);\n\n\t\t\t}\n\t\t}\n\n\t\treturn $months;\n\t\t\t\n\t}", "public function monthlyViews()\n {\n // Group and map views to a collection of totals\n return $this->views\n ->groupBy(function($view) {\n return $view->created_at->format('m/y');\n })\n ->map(function ($views) {\n $view = $views->first();\n\n return collect([\n 'id' => $view->created_at->format('m-y-').\n $view->episode_uuid,\n 'episode_uuid' => $view->episode_uuid,\n 'total' => $views->count(),\n 'label' => $view->created_at->format('m/y'),\n ]);\n });\n }", "public function addMonths(int $months)\n {\n $time = clone $this;\n\n return $time->add(DateInterval::createFromDateString(\"{$months} months\"));\n }", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "public function getNumberOfDays($month = \"\"){ $month = ($month == \"\")? $this->getMonth(): $month; return cal_days_in_month(CAL_GREGORIAN,$month,$this->getYear());}", "public static function days_in_month($month, $year)\n\t{\n\t\t// calculate number of days in a month\n\t\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\n\t}", "protected function caseMonths()\n\t{\n\t\t$months = '';\n\n\t\tforeach(range(1,12) as $month) {\n\t\t\t$months.= \"sum(CASE WHEN month(v.date) = {$month} THEN v.views END) AS month_{$month}, \";\n\t\t}\n\n\t\treturn rtrim($months,', ');\n\t}", "public static function calculateRemainTime($start,$end)\n {\n $date1 = strtotime($start); \n $date2 = strtotime($end); \n \n // Formulate the Difference between two dates \n $diff = abs($date2 - $date1); \n \n \n // To get the year divide the resultant date into \n // total seconds in a year (365*60*60*24) \n $years = floor($diff / (365*60*60*24)); \n \n \n // To get the month, subtract it with years and \n // divide the resultant date into \n // total seconds in a month (30*60*60*24) \n $months = floor(($diff - $years * 365*60*60*24) \n / (30*60*60*24)); \n \n \n // To get the day, subtract it with years and \n // months and divide the resultant date into \n // total seconds in a days (60*60*24) \n $days = floor(($diff - $years * 365*60*60*24 - \n $months*30*60*60*24)/ (60*60*24)); \n \n \n // To get the hour, subtract it with years, \n // months & seconds and divide the resultant \n // date into total seconds in a hours (60*60) \n $hours = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24) \n / (60*60)); \n \n \n // To get the minutes, subtract it with years, \n // months, seconds and hours and divide the \n // resultant date into total seconds i.e. 60 \n $minutes = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60)/ 60); \n \n \n // To get the minutes, subtract it with years, \n // months, seconds, hours and minutes \n $seconds = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60 - $minutes*60)); \n \n // Print the result\n return [\n 0=>$days,\n 1=>$hours,\n 2=>$minutes,\n 3=>$seconds\n ];\n }", "public function getMonth() : int\n {\n return $this->month;\n }", "public function calculate(Request $request)\n {\n \t$this->validate($request, [\n \t\t'start_date' => 'required',\n \t\t'end_date' => 'required',\n \t]);\n\n \t// get monthly days array\n \t$monthlyDays = getMonthlyDays();\n\n \t$startArray = explode('/', $request->start_date);\n\t\t$endArray = explode('/', $request->end_date);\n\n\t\t$startDate = (int)$startArray[0];\n\t\t$endDate = (int)$endArray[0];\n\t\t$startMonth = (int)$startArray[1];\n\t\t$endMonth = (int)$endArray[1];\n\t\t$startYear = (int)$startArray[2];\n\t\t$endYear = (int)$endArray[2];\n\n\t\t// get yearly days array\n\t\t$totalDaysInYears = [];\n\t\t$leap_years = [];\n\t\tfor ($i = $startYear; $i < $endYear + 1; $i++) {\n\t\t\t$totalDaysInYears[$i] = getYearDays($i);\n\t\t\tif ($totalDaysInYears[$i]==366) {\n\t\t\t\t$leap_years[] = $i;\n\t\t\t}\n\t\t}\n\n\t\t// If both year and months are same\n\t\tif (($startYear == $endYear) && ($startMonth == $endMonth)) {\n\t\t\t$finalDays = $endDate - $startDate;\n\t\t// If only year is same\n\t\t} elseif ($startYear == $endYear) {\n\t\t\t// get total monthly days\n\t\t\t$finalDays = 0;\n\t\t\tfor ($i = $startMonth; $i < $endMonth + 1; $i++) {\n\t\t\t\tif ($i == $startMonth) {\n\t\t\t\t\t$finalDays += $monthlyDays[$i] - $startDate;\n\t\t\t\t} elseif ($i == $endMonth) {\n\t\t\t\t\t$finalDays += $endDate;\n\t\t\t\t} else {\n\t\t\t\t\t$finalDays += $monthlyDays[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// reduce 1 day from total days of year if year isn't leap and start month is 1 or 2 or end month is not 1 or 2\n\t\t\tif (($totalDaysInYears[$startYear] == 365) && (in_array($startMonth, [1, 2])) && (!in_array($endMonth, [1, 2]))) {\n\t\t\t\t$finalDays -= 1;\n\t\t\t}\n\t\t} else {\n\t\t\t// ========== Start years days count ========== //\n\t\t\t// get total monthly days\n\t\t\t$totalStartYearsDays = 0;\n\t\t\tfor ($i = $startMonth + 1; $i < 13; $i++) {\n\t\t\t\t$totalStartYearsDays += $monthlyDays[$i];\n\t\t\t}\n\n\t\t\t// get start months current days and add to total days in start year\n\t\t\t$totalStartYearsDays += $monthlyDays[$startMonth] - $startDate;\n\n\t\t\t// reduce 1 day from total days of year if year isn't leap and start month is 1 or 2\n\t\t\tif (($totalDaysInYears[$startYear] == 365) && (in_array($startMonth, [1, 2]))) {\n\t\t\t\t$totalStartYearsDays -= 1;\n\t\t\t}\n\n\t\t\t// ========== End years days count ========== //\n\t\t\t// get total monthly days\n\t\t\t$totalEndYearsDays = 0;\n\t\t\tfor ($i = 1; $i < $endMonth; $i++) {\n\t\t\t\t$totalEndYearsDays += $monthlyDays[$i];\n\t\t\t}\n\n\t\t\t// get start months current days and add to total days in start year\n\t\t\t$totalEndYearsDays += $endDate;\n\n\t\t\t// reduce 1 day from total days of year if year isn't leap and end month is not 1 or 2\n\t\t\tif (($totalDaysInYears[$endYear] == 365) && (!in_array($endMonth, [1, 2]))) {\n\t\t\t\t$totalEndYearsDays -= 1;\n\t\t\t};\n\t\t\t// print_r($totalDaysInYears[0] - $totalStartYearsDays $totalEndYearsDays);exit();\n\n\t\t\t// total days between two dates\n\t\t\t$finalDays = 0;\n\t\t\tforeach ($totalDaysInYears as $year => $days) {\n\t\t\t\tif ($year == $startYear) {\n\t\t\t\t\t$finalDays += $totalStartYearsDays;\n\t\t\t\t} elseif ($year == $endYear) {\n\t\t\t\t\t$finalDays += $totalEndYearsDays;\n\t\t\t\t} else {\n\t\t\t\t\t$finalDays += $days;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if end date option included or not\n\t\tif ($request->end_date_included == true) {\n\t\t\t$end_date_included = 1;\n\t\t\t$finalDays += 1;\n\t\t} else {\n\t\t\t$end_date_included = 0;\n\t\t}\n\n\t\t// save to database\n\t\t$dateCalculation = new DateCalculation;\n\t\t$dateCalculation->start_date = $request->start_date;\n\t\t$dateCalculation->end_date = $request->end_date;\n\t\t$dateCalculation->end_date_included = $end_date_included;\n\t\t$dateCalculation->difference = $finalDays;\n\t\t$dateCalculation->created_at = now();\n\t\t$dateCalculation->save();\n\n\t\t$msg = 'Total Days difference: '.$finalDays;\n\t\tif (!empty($leap_years)) {\n\t\t\t$msg = 'Total Days difference: '.$finalDays.' Leap year '.sizeof($leap_years).' detected :'.implode(',', $leap_years);\n\t\t}\n \treturn response()->json(['success' => true, 'message' => $msg]);\n }", "private function getUpcomingMonths(string $yearMonth, int $monthsCount): \\DatePeriod\n {\n $start = new \\DateTime($yearMonth);\n $start->modify('+1 month');\n $start->modify('first day of this month');\n\n $end = clone $start;\n $end->modify(\"+$monthsCount months\");\n\n $interval = new \\DateInterval('P1M');\n\n return new \\DatePeriod($start, $interval, $end);\n }", "public function months($callback = null)\n {\n Carbon::setTestNow(Carbon::now()->addMonths($this->value));\n\n return $this->handleCallback($callback);\n }", "protected function getDateInterval(){\n\n $dt = new \\DateTime();\n $dt->modify('-1 month');\n $interval['max'] = $dt->format('Ym');\n $dt->modify('-11 months');\n $interval['min'] = $dt->format('Ym');\n\n return $interval;\n }", "public function isMonth() : bool {\n $monthsArr = $this->taskDetails['months'];\n $retVal = true;\n\n if ($monthsArr['every-month'] !== true) {\n $retVal = false;\n $current = TasksManager::getMonth();\n $ranges = $monthsArr['at-range'];\n\n foreach ($ranges as $range) {\n if ($current >= $range[0] && $current <= $range[1]) {\n $retVal = true;\n break;\n }\n }\n\n if ($retVal === false) {\n $months = $monthsArr['every-x-month'];\n $retVal = in_array($current, $months);\n }\n }\n\n return $retVal;\n }", "public function nextMonth(): Month{\n $month = $this->month +1;\n $year=$this->year;\n if($month > 12){\n $month = 1;\n $year += 1;\n }\n return new Month($month, $year);\n }", "function get_month_days ($month) {\n $labels = array();\n $month = month_converter($month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $month, $date->format('Y'));\n $day = $date->format('d');\n $i = 0;\n while ($i < 30) {\n if ($day <= $monthdays) {\n if (strlen($day) == 1) {\n $day = '0' . $day;\n }\n if (strlen($month) == 1) {\n $month = '0' . $month;\n }\n $labels[] = $day.'-'.$month;\n $day++;\n $i++;\n } else {\n $day = 1;\n $month++;\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $month, $date->format('Y'));\n }\n }\n return $labels;\n}", "public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "protected function getMonths()\n {\n\t$year = $_REQUEST['year'] ;\n\tif( !$year )\n\t{\n\t print( \"Month query failed: no year has been specified\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\t$year = trim( $year ) ;\n\n\t// need to connect to the database here in order to run the\n\t// function mysql_real_escape_string\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\tif( $year )\n\t{\n\t $year = mysql_real_escape_string( $year ) ;\n\t}\n\n\t$params = $_REQUEST['params'] ;\n\tif( $params )\n\t{\n\t $params = trim( $params ) ;\n\t $params = mysql_real_escape_string( $params ) ;\n\t}\n\n\t$kinst = $_REQUEST['kinst'] ;\n\tif( $kinst )\n\t{\n\t $kinst = trim( $kinst ) ;\n\t $kinst = mysql_real_escape_string( $kinst ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT d.MONTH\" ;\n\tif( $kinst && !$params )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t}\n\telse if( $params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( $params && $kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( !$params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t}\n\n\t$query .= \" ORDER BY d.MONTH ASC\" ;\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }", "function getMonth(){\r\n return date('F',$this->timestamp);\r\n }", "public function GET_MONTHS(bool $raw = false)\n\t{\n\t\tif ($raw)\n\t\t{\n\t\t\treturn $this->difference / MONTH;\n\t\t}\n\n\t\t$time = clone($this->currentTime);\n\t\treturn $time->fieldDifference($this->testTime, IntlCalendar::FIELD_MONTH);\n\t}", "public function volume_year_from($month_div){\n\t\t$year_from = \"2008\";\n\t\treturn $year_from;\n\t}" ]
[ "0.69311464", "0.63495886", "0.61990505", "0.6094006", "0.6044016", "0.60174686", "0.591602", "0.58024275", "0.58017385", "0.5727241", "0.57053465", "0.5655696", "0.5644924", "0.5591834", "0.55795735", "0.55244136", "0.5524124", "0.55149406", "0.55029726", "0.550102", "0.5499903", "0.549989", "0.54980475", "0.5494173", "0.5463354", "0.5458485", "0.545156", "0.5449166", "0.5431611", "0.54087365", "0.5404715", "0.5391106", "0.5368807", "0.53643775", "0.5362969", "0.53506106", "0.53434277", "0.5337553", "0.5333899", "0.52876276", "0.5284866", "0.5256469", "0.52563673", "0.5237728", "0.5228596", "0.52271676", "0.5218616", "0.5204388", "0.5182878", "0.5174577", "0.51731974", "0.5156157", "0.515603", "0.5153657", "0.51360106", "0.5130734", "0.51259494", "0.5113264", "0.51128113", "0.5111843", "0.510887", "0.51004255", "0.5097079", "0.50925994", "0.5092359", "0.50703007", "0.50661254", "0.50543094", "0.50529146", "0.5052777", "0.50333536", "0.5032285", "0.50293636", "0.5028077", "0.5023653", "0.5015479", "0.5008805", "0.5001384", "0.50012547", "0.5000056", "0.4994021", "0.49922988", "0.4983775", "0.49810076", "0.4980973", "0.49793684", "0.4973123", "0.49706057", "0.49615517", "0.4950985", "0.49491733", "0.49478775", "0.4947543", "0.49411052", "0.49252036", "0.49224722", "0.4907435", "0.49023283", "0.489999", "0.4885286" ]
0.72407365
0
/ $fileBasePath = $this>_filesystem>getDirectoryRead(DirectoryList::APP)>getAbsolutePath('code/MGS/Acm/data/'); $io = $this>_ioFile; $file = $fileBasePath . '/template_email_base.html'; $io>open(array('path' => $fileBasePath));
public function getTemplateContent($model){ $templateContent = ''; //$io->streamClose(); $fields = $this->getModel('MGS\Acm\Model\Field') ->getCollection() ->addFieldToFilter('acm_type_id', $model->getId()) ->addFieldToFilter('type', ['nin'=>['store', 'image', 'file']]) ->setOrder('position', 'ASC'); $content = ''; if(count($fields)>0){ foreach($fields as $field){ $templateContent .= '<p>{{trans "'.$field->getTitle().': %'.$field->getIdentifier().'" '.$field->getIdentifier().'=$data.'.$field->getIdentifier().'}}</p>'."\n"; } } //$templateContent = str_replace('{{template_email_content}}', $content, $templateContent); return $templateContent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEmailTemplateFile() {}", "abstract public function getTemplateFile();", "public function getTemplateFilePath() {\n\t}", "public function getTemplateFile();", "function fileaccess_gettemplatehtml($directory)\r\n{\r\n\t#Deze staat onder de root als er sprake is van een template dat niet verandert bij verschillende tagen\r\n\t#Wanneer er wel taalverschillen zijn dan zijn er subdirectories met de naam van de talen en die worden \r\n\t#afgezocht naar template.htm. Vanzelfsprekend wordt enkel de html file geopend van de taal die actief is.\r\n\t\r\n\t#Zit er een template.htm of html file in de root\r\n\tif(file_exists($directory.\"/template.htm\"))\r\n\t{\r\n\t\t$templatefilepath=$directory.\"/template.htm\";\r\n\t}\r\n\telseif(file_exists($directory.\"/template.html\"))\r\n\t{\r\n\t\t$templatefilepath=$directory.\"/template.html\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\t#Geen templatefile in de root => taal ophalen en nakijken of er een taaldirectory is\r\n\t\trequire_once $_SERVER['DOCUMENT_ROOT'].\"/core/logic/parameters.php\";\r\n\t\t$languagestring = getlanguage();\r\n\t\t\r\n\t\t#het templatepad moet dan /templates/$directory/$languagestring/template.htm of html zijn\r\n\t\t$templatedirectory = $directory.\"/\".$languagestring;\r\n\r\n\t\tif(file_exists($templatedirectory.\"/template.htm\"))\r\n\t\t{\r\n\t\t\t$templatefilepath=$directory.\"/\".$languagestring.\"/template.htm\";\r\n\t\t}\r\n\t\telseif(file_exists($templatedirectory.\"/template.html\"))\r\n\t\t{\r\n\t\t\t$templatefilepath=$directory.\"/\".$languagestring.\"/template.htmL\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new Exception(\"Unable to find template.htm / template.html under $directory\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t#Op dit punt is de uitvoering gestopt wegens een exception of is de templatefile bekend.\r\n\t#Nu moet de htmlingelezen worden en teruggegeven.\r\n\t$filehandler = fopen($templatefilepath,'r',0);\r\n\t$html = fread($filehandler,filesize($templatefilepath));\r\n\t#De HTML is ingeladen en wordt teruggegeven naar het templatesysteem voor verdere verwerking.\r\n\treturn $html;\r\n}", "function get_template_ini(){\n\n $file = 'site_media/html/template.html';\n $template = file_get_contents($file);\n return $template;\n\n}", "function _get() {\n if( file_exists($this->_template) ) {\n $this->_text = file($this->_template);\n }\n else {\n $this->_text = array(\"Template file {$this->_template} could not be found.\");\n }\n }", "public static function getFile(){\n\t\t$file_name = base_path().\"/resources/views/DURC/durc_html.mustache\";\n\t\treturn($file_name);\n\t}", "function make($filename, $data){\n\n extract($data);\n //turn on output buffering\n ob_start(); //this is to store the data in an internal buffer and not the browser\n\n //include the template\n include(__DIR__ .'/../../resources/views/emails/' .$filename .'.php');\n\n //to get the contents out of the file\n\n $content = ob_get_contents();\n\n //erase the content and turn off output buffering\n ob_end_clean();\n\n return $content;\n}", "protected function getTemplatePathAndFilename() {}", "protected static function file()\n {\n }", "public function getTemplatePathAndFilename() {}", "protected function openFile() {}", "function agnosia_initialize_file_getter() {\r\n\r\n\trequire_once get_template_directory() . '/inc/utils/agnosia-file-getter.php';\r\n\r\n}", "public function templateFile() {\n return $this->_templateFile($this->intendedTemplate());\n }", "function st_get_template($file,$data = array()){\r $file = ST_DIR.'/templates/'.$file;\r if(file_exists($file)){\r include($file); return true;\r }\r return false;\r}", "private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}", "public function fullPath(){\n if ( strpos( $this->template, DIRECTORY_SEPARATOR ) === 0 ) {\n return $this->template . '.php';\n } else {\n return $this->path . DIRECTORY_SEPARATOR . $this->template . '.php';\n }\n }", "final public function getFile($file) {\n $this->template = file_get_contents('app/'.$file);\n }", "private function __getEmailDir() {\n\t\treturn $this->_testDir() . 'HMS_Emails/';\n\t}", "public function index()\n\t{ \n\t\t$mail_path = base64_url($path, 'decode');\n\t}", "public function intendedTemplateFile() {\n return $this->kirby->component('template')->file($this->intendedTemplate());\n }", "function fillerPhpFile($data)\n {\n extract($data, EXTR_PREFIX_ALL, $this->projectConfig['template_profile_prefix']);\n extract($this->projectConfig['project'], EXTR_PREFIX_ALL, '_project');\n\n ob_start();\n require $this->templateFile;\n return ob_get_clean();\n }", "public static function fileReadingLocation()\n {\n return '/app/public/excels/';\n }", "function template_path($file, $data = [])\n{\n return sage('blade')->compiledPath($file, $data);\n}", "function template_path($file, $data = [])\n{\n return sage('blade')->compiledPath($file, $data);\n}", "abstract public function open();", "function read_template_file (){\n\n\t// Generate an error if the template file does not exist and return 'false'.\n if (! file_exists($this->template_file)) {\n print 'Template file does not exist: ['.$this->template_file.']';\n\t return false;\n }\n\t// We use templates and the template file exists\n\t// Capture the template, this way we can use php code inside templates\n\t\n\t$this->start_capture (); // Start capture to buffer\n\trequire $this->template_file; // Includes the template, this way php code can be used in templates\n\t$this->stop_capture ('template_html');\n\treturn true;\n }", "function get_the_file($file_path) {\n\n md_include_component_file($file_path);\n\n }", "private function render_template() {\n\t\t$template = $this->template;\n\n\t\tif ( ! is_readable( $template ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinclude $template;\n\t}", "private function readTemplate($page)\n {\n // Evaluate the direcory, in which the templates are located.\n // This is the \"templates\" direcory relative from the actually called script.\n $template_path = sprintf(\n \"%s/%s/%s.%s\",\n dirname($_SERVER[\"SCRIPT_FILENAME\"]),\n $page->configuration->template_directory,\n $page->template_name,\n $page->configuration->template_extension\n );\n return file_get_contents($template_path);\n }", "private function __fileContent()\n {\n return VIEWS . DS . $this->__paths['controller'] . DS . $this->__paths['action'] . '.php';\n }", "public function get_default_template() {\n\t\t\t$file = file_get_contents( dirname( __FILE__ ).'/assets/template.html' );\n\t\t\treturn $file;\n\t\t}", "private static function file()\n {\n $files = ['File', 'Filesystem'];\n $folder = static::$root.'Filesystem'.'/';\n\n self::call($files, $folder);\n\n $files = ['FileNotFoundException', 'DirectoryNotFoundException'];\n $folder = static::$root.'Filesystem/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function theme_webform_mail_file($data, $component) {\r\n $file = is_string($data) ? unserialize($data) : $data;\r\n $output = $component['name'] .': '. (!empty($file['filepath']) ? webform_file_url($file['filepath']) : '') .\"\\n\";\r\n return $output;\r\n}", "public static function getFile() {}", "public function filePath() {\n $path = 'templates/modules/modal-base.php';\n $template = new SageWrapping( $path );\n\n return $template;\n }", "function readFile(){\n $this->setHeaders();\n $this->readContent();\n\n }", "function stream_open($path, $mode, $options, &$opened_path) {\n\t\t\n\t\tglobal $smarty;\n\t\t\n\t\tPan :: $logger->log(__METHOD__);\n\t\tPan :: $logger->log('Path : ' . $path);\n\t\t\n\t\t$path = str_replace('db://', '', $path);\n\t\t\n\t\tPan :: $logger->log('MPath : ' . $path);\n\t\t\n\t\t$this->template = Pan_Db_TemplatePeer :: retrieveByPath($path);\n\t\t\n\t\tPan :: $logger->log('Content : ' . $this->template->getContent());\n\t\t\n\t\t// FIXME \n\t\t// Should return false if the template can't be opened ?\n return true;\n \n }", "function downloadHtml() {\n $filePath = './temp.html';\n\n if(file_exists($filePath)) {\n $fileName = basename($filePath);\n $fileSize = filesize($filePath);\n header(\"Cache-Control: private\");\n header(\"Content-Type: application/stream\");\n header(\"Content-Length: \".$fileSize);\n header(\"Content-Disposition: attachment; filename=NEWSLETTER SPRI \".date(\"Y-m-d H:i:s\").\".html\");\n readfile ($filePath); \n exit();\n } else {\n die('The provided file path is not valid.');\n }\n}", "public function textfile($template = null) {\n if(is_null($template)) $template = $this->intendedTemplate();\n return textfile($this->diruri(), $template);\n }", "private function loadMasterTemplate() {\n\t\t//SOME_THEMES should be defined in SOME_PATH/includes/defines.php\n\t\t$path_and_file = SOME_THEMES.DS.$this->template.DS.$this->file.'.php';\n\t\tif (!file_exists($path_and_file)) {\n\t\t\tthrow new SomeFileNotFoundException(\"Master template file {$this->file} for {$this->template} not found\");\n\t\t}\n\t\t\n\t\tob_start();\n\t\t//$content = file_get_contents(SOME_THEMES.DS.'default'.DS.'index.php');\n\t\t$templatefile = $path_and_file;\n\t\trequire_once($templatefile);\n\t\t$content = ob_get_clean();\n\t\treturn $content;\n\t}", "function getTemplate($fileName) {\n\n $file = file_get_contents($fileName);\n\n if ($file) {\n\n return $file;\n }\n else {\n echo (\"File not found: \" . $fileName);\n }\n}", "function render_template($template_path,$template_data)\n{\n\t// Stores output buffer\n\t$html = '';\n\t// Start output buffering\n\tob_start();\n\trequire($template_path);\n\t$html = ob_get_clean();\n\n\t// Return generated (buffered) HTML\n\treturn $html;\t\t\n}", "public function open();", "public function open();", "function run()\n{\n include config('template_path').'/template.php';\n}", "function template($template_filename) {\n if ( $template_filename[0] == '/' ) {\n $this->template_file = $template_filename;\n } else {\n $this->template_file = $this->module_path.'template/'.$template_filename;\n }\n }", "public function file() {\n return resource_path('views/' . $this->crud->getPluralsKebabSlash() . \"/show.blade.php\");\n }", "function grabarTemplate($filename, $somecontent) {\n fopen($filename, \"wb\");\n // Let's make sure the file exists and is writable first.\n if (is_writable($filename)) {\n\n // In our example we're opening $filename in append mode.\n // The file pointer is at the bottom of the file hence\n // that's where $somecontent will go when we fwrite() it.\n if (!$handle = fopen($filename, 'a')) {\n return \"No se pudo abrir el archivo ($filename)\";\n }\n\n // Write $somecontent to our opened file.\n if (fwrite($handle, $somecontent) === FALSE) {\n return \"No se pudo escribir en el archivo ($filename)\";\n }\n\n //echo \"Success, wrote (html) to file ($filename)<br/>\";\n\n fclose($handle);\n } else {\n return \"El Archivo $filename tiene permisos de escritura\";\n }\n }", "public function getFile() {}", "public function getFile() {}", "function ffd_get_template_html( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\r\n\tob_start();\r\n\tffd_get_template( $template_name, $args, $template_path, $default_path );\r\n\treturn ob_get_clean();\r\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 create_file($file_path, $content=''){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "function load_body_html($fbase=false){\n\t$fl = basename($fbase);\n\t$fn = preg_replace('/.php$/','_body.txt',$fl);\n\tif(file_exists($fn)){\n\t\t// open file\n\t\treturn sprintf('<div id=\"content_right\">%s</div>',file_get_contents($fn));\n\t}\n\telse {\n\t\treturn '';\n\t}\n}", "public static function wdtFileReadingLocation()\n {\n return '/app/public/excels/wdt/';\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 getFile ();", "protected function getTestTemplatePath()\n {\n return __DIR__.'/../Generators/templates/scaffold/controller-test.txt';\n }", "function template($file, $error = \"Template Datei nicht gefunden!\") {\n // Variabeln auf Standardwerte setzen\n $this->tmp_file = $file;\n $this->error = $error;\n $this->content = \"\";\n }", "public function readFileTemplate(): string\n {\n $template = resource_path('templates/EnumModel.txt');\n\n if (!file_exists($template) || !is_readable($template)) {\n throw new Exception(sprintf('The path \"%s\" is not a file or not readable', $template));\n }\n $search = [\"/\", \"app\"];\n $replace = [\"\\\\\", \"App\"];\n $namespace = str_replace($search, $replace, $this->path);\n\n $values = [\n '$className' => $this->className,\n '$content' => $this->content,\n '$namespace' => $namespace\n ];\n\n return strtr(file_get_contents($template), $values);\n }", "public function getFileAToView()\n {\n // when displaying uploaded doc/image in the view.\n return '/../'.$this->getUploadDir().'/'.$this->pathA;\n }", "function copyTemplateFiles(){\n\t\t\tcopy('data/template/index.html', $this->profile_URI.'/index.html');\n\t\t}", "function app_template_path() {\n return APP_Wrapping::$main_template;\n}", "public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}", "public function atmf_html_backend(){\n\n $template_loader = new Uou_Atmf_Load_Template();\n ob_start();\n $template = $template_loader->locate_template( 'popup.php' );\n\n if(is_user_logged_in() ){\n include( $template );\n }\n echo ob_get_clean();\n\n }", "public function getTemplatePath(): string\n {\n return '@Core/components/navbar.html';\n }", "public function openFile() {\n $this->file = fopen($this->_dir . $this->_filename,\"r\");\n }", "function Trigger_WelcomeEmail(&$tNG) {\r\n $emailObj = new tNG_Email($tNG);\r\n $emailObj->setFrom(\"{KT_defaultSender}\");\r\n $emailObj->setTo(\"{member_email}\");\r\n $emailObj->setCC(\"\");\r\n $emailObj->setBCC(\"\");\r\n $emailObj->setSubject(\"Welcome\");\r\n //FromFile method\r\n $emailObj->setContentFile(\"includes/mailtemplates/welcome.html\");\r\n $emailObj->setEncoding(\"UTF-8\");\r\n $emailObj->setFormat(\"HTML/Text\");\r\n $emailObj->setImportance(\"Normal\");\r\n return $emailObj->Execute();\r\n}", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getTemplatefile()\n\t{\n\t\treturn $this->templatefile;\n\t}", "public static function get_tpl_dir()\n {\n return __DIR__ . DS . 'templates' . DS;\n }", "public function getPanel() {\n\t\t$template = new FileTemplate();\n\t\t$template->registerFilter(new Engine);\n\t\t$template->registerHelperLoader('Nette\\\\Templating\\\\Helpers::loader');\n\t\t$template->setFile(__DIR__ . '/MailPanel.latte');\n\t\t$template->baseUrl = $this->request->getUrl()->getBaseUrl();\n\t\t$template->messages = $this->mailer->getMessages($this->messagesLimit);\n\n\t\treturn (string) $template;\n\t}", "public function export_utemplate() {\n global $CFG;\n\n $fs = get_file_storage();\n $xmlfile = $fs->get_file_by_id($this->utemplateid);\n $filename = $xmlfile->get_filename();\n $content = $xmlfile->get_content();\n\n // echo '<textarea rows=\"10\" cols=\"100\">'.$content.'</textarea>';\n\n $templatename = clean_filename('temptemplate-' . gmdate(\"Ymd_Hi\"));\n $exportsubdir = \"mod_surveypro/templateexport\";\n make_temp_directory($exportsubdir);\n $exportdir = \"$CFG->tempdir/$exportsubdir\";\n $exportfile = $exportdir.'/'.$templatename;\n if (!preg_match('~\\.xml$~', $exportfile)) {\n $exportfile .= '.xml';\n }\n $this->templatename = basename($exportfile);\n\n $this->trigger_event('usertemplate_exported');\n\n header(\"Content-Type: application/download\\n\");\n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n header('Expires: 0');\n header('Cache-Control: must-revalidate,post-check=0,pre-check=0');\n header('Pragma: public');\n $xmlfile = fopen($exportdir.'/'.$this->templatename, 'w');\n print $content;\n fclose($xmlfile);\n unlink($exportdir.'/'.$this->templatename);\n }", "function ahr_render_tpl( $path, $data = array() ) {\r\n \r\n ob_start();\r\n include( $path );\r\n $output = ob_get_clean();\r\n echo $output;\r\n \r\n}", "public function actionGetTemplate(){\n $post = Yii::$app->getRequest()->post();\n echo file_get_contents(dirname(\\Yii::getAlias('@webroot')).'/frontend/views/templates/'.$post['template']);\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}", "public function template()\n {\n\n include './views/template.php';\n\n }", "function homepage_action()\n{\n\n require_once __DIR__ . '/../templates/home.php';\n}", "function fetchTemplate(string $content, string $user, string $usr_email, string $template): string{\n $chnd = fopen($template, \"r\");\n $rawContent = fread($chnd, filesize($template));\n fclose($chnd);\n $replacer = [\n \"%content%\" => $content,\n \"%user%\" => $user,\n \"%email%\" => $usr_email,\n \"%tms%\" => date(\"Y-M-d H:m:i\")\n ];\n foreach($replacer as $needle => $val)\n $rawContent = str_replace($needle, $val, $rawContent);\n return $rawContent;\n}", "function generateHtml($content)\n{\n $htmlFile = \"index.html\"; // generated html file name\n $f = fopen($htmlFile, 'w');\n\n// the html code injected to the html file\n\n $htmlData = \"\n<!doctype html>\n<html>\n<head><meta charset='utf-8'>\n<title>Address book</title>\n</head>\n<body>\n$content \n</body>\n</html>\n\";\n fwrite($f, $htmlData);\n fclose($f);\n}", "private function auto_create(){\n\n if ( $this->firebug ) \\FB::info(get_called_class().\": auto creating file\");\n\n $root = $this->use_codeza_root ? (string)new Code_Alchemy_Root_Path() : '';\n\n $filename = $root . $this->template_file;\n\n if ( file_exists($filename) && ! file_exists($this->file_path)) {\n\n $copier = new Smart_File_Copier($filename,$this->file_path,$this->string_replacements,false);\n\n $copier->copy();\n\n }\n\n\n\n }", "public function getFilePath(): string;", "public function getFilePath(): string;", "function template ($file, $data) {\n\textract ($data);\n\trequire ($file);\n}", "public function setTemplate($file);", "public function getTemplateFile()\r\n {\r\n $templateRootPath = $this->getTemplateRootPath();\r\n\r\n // Returns the template file in the template root path if it exists\r\n $templateFile = $templateRootPath . '/' . $this->templateFile;\r\n if (@is_file(Environment::getPublicPath() . '/' . $templateFile) === true) {\r\n return $templateFile;\r\n } else {\r\n // Returns the file in the default template root path\r\n $defaultTemplateRootPath = $this->getDefaultTemplateRootPath();\r\n $templateFile = $defaultTemplateRootPath . '/' . $this->templateFile;\r\n if (@is_file(Environment::getPublicPath() . '/' . $templateFile) === true) {\r\n return $templateFile;\r\n } else {\r\n throw new Exception('The file \"' . htmlspecialchars(Environment::getPublicPath() . '/' . $templateFile) . '\" does not exist');\r\n }\r\n }\r\n }", "function get_template_form($op) {\n\n $file = 'site_media/html/login_'.$op.'.php';\n $template = file_get_contents($file);\n return $template;\n\n}", "function loadTemplate( $input )\r\n {\r\n if (isset($this->_rootAtts['relative'])) {\r\n $relative = $this->_rootAtts['relative'];\r\n } else {\r\n $relative = false;\r\n }\r\n return $this->_getFileContents($this->getTemplateRoot().$input.'.'.$CONFIG['tpl']['ext']);\r\n }", "function getFeedTemplate() {\n $file = __DIR__ .'/../../templates/feed_box.html';\n if(file_exists($file)) {\n $html = file_get_contents($file);\n return $html;\n } else {\n $html = \"404 Template not found - \" . $file;\n return $html;\n }\n}", "public function generate() {\n\t\t// Use the home directory of the current user as file source\n\t\tif($this->useHomeDir && FE_USER_LOGGED_IN) {\n\t\t\t$this->import('FrontendUser', 'User');\n\n\t\t\tif($this->User->assignDir && $this->User->homeDir) {\n\t\t\t\t$this->orderSRC = array($this->User->homeDir);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->orderSRC = deserialize($this->orderSRC);\n\t\t}\n\n\t\t// Return if there are no files\n\t\tif(!is_array($this->orderSRC) || empty($this->orderSRC)) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Get the file entries from the database\n\t\t$this->objFiles = \\FilesModel::findMultipleByUuids($this->orderSRC);\n\n\t\tif($this->objFiles === null) {\n\t\t\tif(!\\Validator::isUuid($this->orderSRC[0])) {\n\t\t\t\treturn '<p class=\"error\">'.$GLOBALS['TL_LANG']['ERR']['version2format'].'</p>';\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\t$file = \\Input::get('file', true);\n\n\t\t// Send the file to the browser and do not send a 404 header (see #4632)\n\t\tif($file != '' && !preg_match('/^meta(_[a-z]{2})?\\.txt$/', basename($file))) {\n\t\t\twhile($this->objFiles->next()) {\n\t\t\t\tif($file == $this->objFiles->path || dirname($file) == $this->objFiles->path) {\n\t\t\t\t\t\\Controller::sendFileToBrowser($file);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->objFiles->reset();\n\t\t}\n\n\t\treturn parent::generate();\n\t}", "function openid_login_file() {\n global $CFG;\n //error_log(\"/auth/openid/locallib.php::openid_login_file() => {$CFG->themedir}/{$CFG->theme}/openid.html\");\n return \"{$CFG->themedir}/{$CFG->theme}/openid.html\";\n}", "protected function getContentTemplate($html_file_name)\n {\n $html_path = ROOT . '/' . PATH_VIEWS . \"$html_file_name/$html_file_name\" . '.php';\n if(is_file($html_path)){\n extract($this->params);\n ob_start();\n require($html_path);\n $template = ob_get_contents();\n ob_end_clean();\n return $template;\n }else{\n throw new Exception(\"Error No existe $html_path\");\n }\n }", "public static function editFolderTpl()\n {\n extract(FeedPage::$var);\n?>\n<?php include(\"tpl/edit_folder.tpl.php\"); ?>\n<?php\n }", "function setBufferFile()\r\n\t {\r\n\t \t//$this->_bufferFile = '/tmp/fabrik_package-' . $this->label . '.xml';\r\n\t\t$this->_bufferFile = JPATH_SITE . \"/administrator/components/com_fabrik/fabrik_package-\". $this->label . '.xml';\r\n\t }", "function loadTemplateFile($filePath)\n{\n return loadTemplateString(file_get_contents($filePath));\n}", "public function getPathToFile(): string;" ]
[ "0.6602586", "0.65234256", "0.63546884", "0.6307818", "0.6292047", "0.60973185", "0.6066543", "0.604754", "0.5989284", "0.5979335", "0.59628594", "0.59299946", "0.59276175", "0.59219396", "0.5889384", "0.5828153", "0.5794503", "0.5793668", "0.5780732", "0.57045686", "0.5703041", "0.5673095", "0.56334466", "0.56217754", "0.5617926", "0.5617926", "0.56175673", "0.561264", "0.5607283", "0.56071407", "0.560286", "0.5602702", "0.5584515", "0.55797684", "0.55749035", "0.55736697", "0.5570137", "0.55605936", "0.5541708", "0.5541527", "0.5523262", "0.54934776", "0.5490698", "0.5489615", "0.54756874", "0.54756874", "0.5473964", "0.5471137", "0.5464975", "0.5457896", "0.54543674", "0.5453836", "0.54407525", "0.54392517", "0.5436565", "0.54237527", "0.541786", "0.5417181", "0.54129744", "0.5412333", "0.5411108", "0.54042536", "0.53999287", "0.53994995", "0.53980196", "0.5394286", "0.5385988", "0.5383123", "0.53819317", "0.53740805", "0.5369183", "0.5369183", "0.5369183", "0.5369183", "0.5365134", "0.53615683", "0.5352055", "0.5350296", "0.53473836", "0.53472817", "0.5347006", "0.5345957", "0.53392994", "0.5332717", "0.5328271", "0.5314739", "0.53138673", "0.53138673", "0.5310682", "0.5302976", "0.5302898", "0.52879226", "0.52878165", "0.5287391", "0.52851695", "0.5277097", "0.52661437", "0.52645814", "0.52625823", "0.5262305", "0.5258741" ]
0.0
-1
Constructor method for RandomCategorySelection
public function __construct($numberOfItems = null, $questionID = null) { $this ->setNumberOfItems($numberOfItems) ->setQuestionID($questionID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n parent::__construct( 'categories' );\n\n // We want to make sure they match\n if ( isset( $this->category_id ) )\n $this->id = $this->category_id;\n }", "public function __construct()\n {\n $cats = get_categories();\n if(class_exists('Category'))\n {\n if( is_array($cats) && count($cats)>0 ){\n $idC = 0;\n foreach($cats as &$cat)\n {\n $category = new Category($cat->term_id, $cat->name, $cat->slug, $cat->parent);\n $this->lstCat[$idC] = $category->convertToArray(array('id', 'name', 'slug', 'parent'));\n $this->lstCat[$idC]['aff']=true;\n $idC++;\n }unset($cat);\n }\n }\n }", "public function __construct()\n {\n $this->categories = new ArrayCollection();\n }", "public function __construct()\n {\n $this->categories = new ArrayCollection();\n }", "public function selectRandomCategory() {\n $categories = new \\WebDriverSelect($this->driver->findElement($this->inputCategory));\n $options = $categories->getOptions();\n \n do {\n $option = $options[array_rand($options)];\n } while(preg_match('/^-/', $option->getText()));\n \n $option->click();\n return $option->getText();\n }", "public function __construct()\n {\n //Call parent\n parent::__construct();\n\n //Load helpers\n $this->load->helper(array('form', 'url'));\n\n //Load libraries\n $this->load->library('form_validation');\n\n //Get all categories\n $categories_data = $this->Category_model->getCategories();\n\n //Fill array field\n foreach ($categories_data as $c) {\n $this->categories[$c->id] = $c->name;\n }\n }", "public function _construct()\r\n {\r\n $this->_init('items/melicategoriesfilter', 'category_id');\r\n }", "function get_random_categories( $number, $args = null ) {\n$categories = get_categories( $args ); // Get all the categories, optionally with additional arguments\n\n// If there aren't enough categories, use as many as possible to avoid an error\nif( $number > count( $categories ) )\n $number = count( $categories );\n\n// If no categories are available or none were requested, return an empty array\nif( $number === 0 )\n return array();\n\nshuffle( $categories ); // Mix up the category array randomly\n\n// Return the first $number categories from the shuffled list\nreturn array_slice( $categories, 0, $number );\n}", "public static function seed()\n {\n $category1 = \\Article\\Model\\Category::create(\n [\n 'name' => 'category 1',\n ]\n );\n\n $category2 = \\Article\\Model\\Category::create(\n [\n 'name' => 'category 2',\n ]\n );\n\n $category3 = \\Article\\Model\\Category::create(\n [\n 'name' => 'category 3',\n ]\n );\n\n $category4 = \\Article\\Model\\Category::create(\n [\n 'name' => 'category 4',\n ]\n );\n }", "function __construct()\n {\n parent::__construct();\n\t\t\t\t$this->load->model('Category');\n }", "public function __construct() {\n $this->_resourceName = 'category';\n parent::__construct();\n }", "function __construct( $data = false ){\n\t\t$this->taxonomy = EM_TAXONOMY_CATEGORY;\n\t\tparent::__construct($data);\n\t}", "public function __construct() {\r\n\r\n $this->defaults = array(\r\n 'title' => __(\"Advert Categories\", \"adverts\"),\r\n 'show_count' => 1,\r\n 'hide_empty' => 1,\r\n 'top_only' => 0,\r\n 'multi_level' => 0,\r\n );\r\n \r\n \r\n parent::__construct(\r\n 'wpadverts-widget-categories', \r\n __(\"Advert Categories\", \"adverts\"),\r\n array(\r\n \"description\"=> __(\"Displays list of available categories.\", \"adverts\"),\r\n \"classname\" => 'wpadverts-widget-categories'\r\n )\r\n );\r\n \r\n }", "public function _construct(Categoria $categoria){\n\n\t\t$this->categoria = $categoria;\n\t}", "public function __construct($categoryType = self::ALL_CATEGORY)\n {\n $this->categoryType = $categoryType;\n }", "public function __construct(){\r\n\t\t\tparent::__construct();\r\n\t\t\t$this->categoryModel = $this->model('Category'); \r\n\t\t}", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }", "public function _construct()\r\n {\r\n $this->_init('advancedfaq/category', 'category_id');\r\n }", "function random_category($category)\n {\n return \\Infoexam\\Eloquent\\Models\\Category::getCategories($category)->random()->getKey();\n }", "public function __construct()\n {\n $this->readCategory = new ReadCategories();\n }", "public function fromCategories(string ...$categories): self;", "public function __construct() {\n $this->articleModel = $this->loadModel('Article');\n $this->categories = $this->articleModel->findAllCategories();\n }", "public function __construct(Category $categories)\n {\n $this->categories = $categories;\n }", "public function __construct()\n {\n $this->cate = Category::all();\n }", "public function __construct()\n {\n $categories = Category::orderBy('id', 'ASC')->get();\n\n $this->CategoryList = $categories;\n }", "public function __construct(Category $category)\n {\n $this->category = $category;\n }", "public function __construct(Category $category)\n {\n $this->category = $category;\n }", "public function __construct() {\n parent::__construct();\n \n $query = \"SELECT * from categories\";\n // execute the SQL query in the database and return an array \n \n $this->query($query);\n }", "private function createSampleCategory()\n {\n $cat = new Downloads_Entity_Categories();\n $cat->setTitle($this->__(\"SampleCategory\"));\n $cat->setDescription($this->__(\"This category is provided as a sample and can be safely deleted.\"));\n $cat->setPid(0);\n $this->entityManager->persist($cat);\n $this->entityManager->flush();\n return $cat;\n }", "function random_category_num(){\n $cat_array = array();\n\n $all_category = $this->get_all_category();\n foreach ($all_category as $key => $category) {\n $cat_array[$key] = $category->cat_ID;\n }\n\n shuffle($cat_array);\n $rand_cat_num = $cat_array[ array_rand( $cat_array ) ];\n\n return $rand_cat_num;\n }", "public function createCategory();", "protected function _construct()\r\n {\r\n parent::_construct();\r\n $this->_controller = 'adminhtml_category';\r\n $this->_blockGroup = 'TransPerfect_GlobalLink';\r\n $this->_headerText = __('Categories');\r\n $this->removeButton('add');\r\n }", "function fillInCategories()\n {\n #echo \"eZNewsFlowerArticleCreator::fillInCategories()<br />\\n\";\n\n $name = $this->IniObject->GlobalIni->read_var( \"eZNewsCustomer\", \"Name\" );\n $itemType = new eZNewsItemType( \"flowercategory\" );\n $changeType = new eZNewsChangeType( \"publish\" );\n \n $categories = new eZNewsItem( $name );\n $categories->getChildren( &$childrenItems, $count );\n\n $canonicalParent = $this->Item->getIsCanonical();\n\n $i = 0;\n foreach( $childrenItems as $child )\n {\n $child->get( $outID );\n if( $child->ItemTypeID() == $itemType->ID() && $changeType->ID() == $child->status() )\n {\n $this->IniObject->set_var( \"item_id\", $child->ID() );\n $this->IniObject->set_var( \"item_name\", $child->name() );\n $this->IniObject->set_var( \"Selected\", \"\" );\n if( $i == 0 && empty( $canonicalParent ) )\n {\n $this->IniObject->set_var( \"Selected\", \"selected\" );\n }\n\n if( $child->ID() == $canonicalParent || $child->Name() == $canonicalParent ) \n {\n $this->IniObject->set_var( \"Selected\", \"selected\" );\n }\n \n $this->IniObject->parse( \"item\", \"item_template\", true );\n \n $i++;\n }\n }\n }", "public function __construct()\n {\n $this->category = \\App\\Models\\Category::whereFeatured(true)->get();\n }", "public function __construct() {\n $this->data['title'] = 'Category';\n }", "public function __construct()\n\t{\n\t\t$this->category_model = '';\n\t\t$this->root_names = array(\n\t\t\t'expense' => 'Expenses',\n\t\t\t'income' => 'Incomes',\n\t\t);\n\t}", "function __construct() {\n\t\t$this -> modelo = new categoriaBss();\n\t}", "function __construct() {\n\t\tparent::__construct(\n\t\t\t'random_tips', // Base ID\n\t\t\t__( 'ATW Random Tips', 'text_domain' ), // Name\n\t\t\tarray( 'description' => __( 'Show 2 random entries from the Blog', 'text_domain' ), ) // Args\n\t\t);\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->setType('smile_virtualcategories/rule_condition_combine');\n }", "function makeCategory($ar_kat)\r\n\t{\r\n\t\tforeach($ar_kat as $val)\r\n\t\t{\r\n\t\t\t$this->trainNewCategory($val, $val);\r\n\t\t}\r\n\t\t\r\n\t\t/*isi word probability*/\r\n\t\tforeach($ar_kat as $val) //untuk setiap kategori\r\n\t\t{\r\n\t\t\tforeach ($this->arr_wc[$val]->vocab as $key => $row)\r\n\t\t\t{\r\n\t\t\t\t$prob = (1 + $row) / ($this->ctgrmgr->listCategory[$val]->jumWordInCategory + $this->arr_wc[$val]->jumVocab);\r\n\t\t\t\t//echo \"$row \";\r\n\t\t\t\t$this->ctgrmgr->listCategory[$val]->addWordProb($key, $prob);\r\n\t\t\t}\r\n\t\t\tif ($this->debug)\r\n\t\t\t{\r\n\t\t\t\techo \"<br/>\";\r\n\t\t\t\techo \"jum in category : \"; echo $this->ctgrmgr->listCategory[$val]->jumWordInCategory; echo \"<br/>\";\r\n\t\t\t\techo \"jum vocab : \"; echo $this->arr_wc[$val]->jumVocab; echo \"<br/>\";\r\n\t\t\t\techo \"get cat prob $val : \"; echo $this->ctgrmgr->getCatProb($val); echo \"<br/>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->serializeCat();\r\n\t}", "function __construct() {\n $this->varName = 'cat' . self::$i++;\n }", "public function __construct(Category $model)\n {\n parent::__construct($model);\n }", "public function __construct(){\r\n\t\tparent::__construct();\r\n\t\tif (!$this->session->userdata('logado')){\r\n\t\t\tredirect(base_url('admin/login'));\r\n\t\t}\r\n\t\t$this->load->model('categorias_model','modelcategorias');\r\n\t\t//guarda em uma variavel a lista de tipos\r\n\t\t//após carregar o model no construtor eu vou chamar um metodo do model carregado\r\n\t\t$this->categorias = $this->modelcategorias->listar_categorias();\r\n\t}", "function __construct()\n {\n $this->productGroupsToCategories = Array(\n 1 => 1, // Power kits => Systems\n 2 => 3, // Solar lanterns => Light\n 14 => 1, // SHS 12V => Systems\n 16 => 3, // LED => Light\n 17 => 2, // Fans => Appliances\n 18 => 2, // Fridges => Appliances\n 19 => 2, // Pumps => Appliances\n 24 => 2, // Various appliances => Appliances\n 20 => 2, // Radios => Appliances\n 21 => 2, // TV => Appliances\n 25 => 0, // PAYG (component) => n/a\n 26 => 1, // SHS <12V => Systems\n );\n\n /*\n * Productsubgroups => Options\n */\n $this->productSubGroupsToOptions = Array(\n 14 => 23, // 21Wp - 50Wp =>\n 15 => 23, // 1Wp - 20Wp =>\n 16 => 24, // 51Wp -100Wp =>\n 17 => 36, // Table =>\n 18 => 37, // Ceiling =>\n 19 => 79, // < 1W =>\n 20 => 80, // 1W =>\n 21 => 81, // 2W =>\n 22 => 82, // 3W =>\n 23 => 83, // 4W =>\n 24 => 84, // 5W =>\n 25 => 85, // > 5W =>\n 26 => 44, // up to 20'' =>\n 27 => 45, // > 20'' =>\n //28 => 0, // Cloth dryers =>\n 29 => 58, // Egg incubators =>\n 30 => 59, // Electric fences =>\n 31 => 60, // Hand drills =>\n 32 => 61, // Kettles =>\n 33 => 62, // Sewing machines =>\n //34 => 0, // Spinning wheels =>\n 35 => 63, // Washing machines =>\n 36 => 25, // > 100Wp =>\n 37 => 35, // Stand =>\n 38 => 41, // Surface =>\n 39 => 40, // Submersible =>\n 40 => 46, // Portable =>\n\n 41 => 57, // Iron =>\n 42 => 56, // Hair dryer =>\n 43 => 55, // Mosquito repellent =>\n 44 => 54, // Cooker/Stove =>\n\n 45 => 2, // <12V =>\n 46 => 3, // 12V =>\n 47 => 4, // 24V =>\n 48 => 5, // 48V =>\n\n 49 => 53, // Refrigerators/Freezers =>\n 50 => 50, // Medical Fridges/Freezers =>\n 51 => 51, // Mobile/Portable =>\n 52 => 52, // Refrigerators =>\n 53 => 49, // Freezers =>\n );\n }", "public function __construct(CategoryRepository $category)\n {\n $this->category = $category;\n\n }", "public function random ($count)\n {\n $criteria = Category::select('*')\n ->inRandomOrder()\n ->limit($count)\n ->get();\n\n return new CategoryCollection($criteria);\n }", "public function __construct()\n {\n $this->_blockGroup = 'icc_vchannel';\n $this->_controller = 'adminhtml_category';\n $this->_headerText = $this->__('Manage Categories');\n $this->_addButtonLabel = $this->__('Add New Category');\n\n parent::__construct();\n }", "public function __construct()\n {\n if (!isLoggedIn())\n {\n redirect('users/login');\n }\n\n // Check for admin\n if (!$_SESSION['admin'] > 0)\n {\n redirect('pages');\n }\n\n // instantiate category\n $this->categoryModel = $this->model('Category');\n }", "public function __construct(Categories $categories)\n {\n $this->categories = $categories;\n }", "function __construct() {\n\t\t$this->defaults = array(\n\t\t\t'title'\t\t\t=> 'RS Category Feeds',\n\t\t\t'categories'\t=> ''\n\t\t);\n\n\t\t$widget_ops = array(\n\t\t\t'classname' => 'rs-category-widget',\n\t\t\t'description' => __( 'RSS Feeds by selected categories.', THEME_DOMAIN )\n\t\t);\n\n\t\t$control_ops = array(\n\t\t\t'id_base' => 'rs-category-widget',\n\t\t\t'width' => 240,\n\t\t\t'height' => 300\n\t\t);\n\n\t\t$this->WP_Widget( 'rs-category-widget', __( 'Category Feed Links', THEME_DOMAIN ), $widget_ops, $control_ops );\n\t}", "public function __construct() {\n parent::__construct();\n \n //llamo al helper url\n $this->load->helper(\"url\"); \n \n //llamo o incluyo el modelo\n $this->load->model(\"CategoriesModel\");\n \n //cargo la libreria de sesiones\n $this->load->library(\"session\");\n }", "public function __construct($category = null, $level = null)\n {\n $this\n ->setCategory($category)\n ->setLevel($level);\n }", "public function HM_CategoCuentas()\n {\n }", "function CATEGORYSET($t_args) {\n // The dictionary of the associated factor.\n $dictionary = get_first_key($t_args, ['dictionary', 'dict', 0]);\n $values = array_values($dictionary);\n\n // The component types used.\n $category = lookupType('category', ['dict' => $dictionary]);\n $bitset = lookupType('bitset', ['values' => $values]);\n\n $size = $bitset->get('size.bytes');\n\n // The name of the object type.\n $className = 'CategorySet' . $size;\n\n $systemHeaders = ['cstdio', 'cstring'];\n $userHeaders = [];\n $libHeaders = [];\n $libraries = [];\n $constructors = [];\n $methods = [];\n $functions = [];\n $binaryOperators = [];\n $unaryOperators = [];\n $globalContent = '';\n $complex = false;\n $properties = [];\n $extra = ['size.bytes' => $size];\n $describeJson = DescribeJson('categoryset',\n DescribeJsonStatic(['levels' => $values]));\n\n $globalContent = '';\n?>\n\nclass <?=$className?> {\n public:\n using Category = <?=$category?>;\n using BitSet = <?=$bitset?>;\n using StorageType = BitSet::StorageType;\n\n private:\n // The binary data corresponding to the encoded string.\n BitSet data;\n\n public:\n<? $constructors[] = [[], true]; ?>\n <?=$className?>();\n<? $constructors[] = [['BASE::NULL'], true]; ?>\n <?=$className?>(const GrokitNull& null);\n<? $constructors[] = [['BASE::STRING_LITERAL'], true]; ?>\n <?=$className?>(const char* str);\n <?=$className?>(const BitSet& data);\n <?=$className?>(const <?=$className?>& other);\n\n<? $methods[] = ['IsEmpty', [], 'BASE::BOOL', true]; ?>\n bool IsEmpty() const;\n\n <?=$className?>& operator =(const <?=$className?>& other) = default;\n<? $binaryOperators[] = '=='; ?>\n bool operator ==(const <?=$className?>& other) const;\n<? $binaryOperators[] = '!='; ?>\n bool operator !=(const <?=$className?>& other) const;\n<? $binaryOperators[] = '<'; ?>\n bool operator <(const <?=$className?>& other) const;\n<? $binaryOperators[] = '>'; ?>\n bool operator >(const <?=$className?>& other) const;\n<? $binaryOperators[] = '<='; ?>\n bool operator <=(const <?=$className?>& other) const;\n<? $binaryOperators[] = '>='; ?>\n bool operator >=(const <?=$className?>& other) const;\n\n void FromString(const char* str);\n int ToString(char* buffer) const;\n\n void FromJson(const Json::Value& src);\n void ToJson(Json::Value& dest) const;\n};\n\ninline <?=$className?>::<?=$className?>()\n : data() {\n}\n\ninline <?=$className?>::<?=$className?>(const GrokitNull& null)\n : data() {\n}\n\ninline <?=$className?>::<?=$className?>(const char* str) {\n this->FromString(str);\n}\n\ninline <?=$className?>::<?=$className?>(const <?=$className?>::BitSet& data)\n : data(data) {\n}\n\ninline <?=$className?>::<?=$className?>(const <?=$className?>& other)\n : data(other.data) {\n}\n\ninline bool <?=$className?>::IsEmpty() const {\n return data == 0;\n}\n\ninline bool <?=$className?>::operator ==(const <?=$className?>& other) const {\n return this->data == other.data;\n}\n\ninline bool <?=$className?>::operator !=(const <?=$className?>& other) const {\n return this->data != other.data;\n}\n\ninline bool <?=$className?>::operator <(const <?=$className?>& other) const {\n return this->data < other.data;\n}\n\ninline bool <?=$className?>::operator >(const <?=$className?>&other) const {\n return this->data > other.data;\n}\n\ninline bool <?=$className?>::operator <=(const <?=$className?>& other) const {\n return this->data <= other.data;\n}\n\ninline bool <?=$className?>::operator >=(const <?=$className?>& other) const {\n return this->data >= other.data;\n}\n\ninline void <?=$className?>::FromString(const char* str) {\n StorageType mask;\n char* storage;\n char* copy = strdup(str);\n char* token = strtok_r(copy, \" \", &storage);\n while (token != NULL) {\n Category level (token);\n WARNINGIF(level.Invalid(), \"Invalid token: %s\", token);\n mask |= 1 << level;\n token = strtok_r(NULL, \" \", &storage);\n }\n data = mask;\n free(copy);\n}\n\ninline int <?=$className?>::ToString(char* buffer) const {\n char* start = buffer;\n<? foreach ($dictionary as $name) { ?>\n if (data.<?=$name?>())\n buffer += sprintf(buffer, \"%s \", \"<?=$name?>\");\n<? }?>\n if (start == buffer) {\n buffer[0] = '\\0';\n return 1;\n } else {\n buffer[-1] = '\\0';\n return buffer - start;\n }\n}\n\ninline void <?=$className?>::FromJson(const Json::Value& src) {\n this->FromString(src.asCString());\n}\n\ninline void <?=$className?>::ToJson(Json::Value& dest) const {\n char* buffer;\n this->ToString(buffer);\n dest = buffer;\n}\n\n<? ob_start(); ?>\n\ninline void FromString(@type& data, const char* buffer) {\n data.FromString(buffer);\n}\n\ninline int ToString(const @type& data, char* buffer) {\n return data.ToString(buffer);\n}\n\ninline void FromJson(const Json::Value& src, @type& dest) {\n dest.FromJson(src);\n}\n\ninline void ToJson(const @type& src, Json::Value& dest) {\n src.ToJson(dest);\n}\n\n<? $globalContent .= ob_get_clean(); ?>\n\n<?\n return [\n 'kind' => 'TYPE',\n 'name' => $className,\n 'complex' => $complex,\n 'system_headers' => $systemHeaders,\n 'user_headers' => $userHeaders,\n 'lib_headers' => $libHeaders,\n 'libraries' => $libraries,\n 'binary_operators' => $binaryOperators,\n 'unary_operators' => $unaryOperators,\n 'global_content' => $globalContent,\n 'constructors' => $constructors,\n 'methods' => $methods,\n 'functions' => $functions,\n 'libraries' => $libraries,\n 'properties' => $properties,\n 'extras' => $extra,\n 'describe_json' => $describeJson,\n ];\n}", "function randomRatingCategory($candidates)\n{\n\t$index = 0;\n\t$groupIndex = 0;\n\t$randomNum = 0;\n\t$chosenGroup = array(); /* group of recipe IDs to return (by chosen rating value) */\n\t\n\t$randomNum = rand(1, 100);\n\t\n\t//assign required recipe IDs to 4-star rating group (if group chosen)\n\tif ($randomNum <= 3)\n\t{\n\t\t//traverse to 4-star ratings in sorted rating array\n\t\twhile (1)\n\t\t{\n\t\t\t//traverse to 4.5-star ratings in sorted rating array\n\t\t\tif ($candidates[$index][1] < 3.75)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t\tif (($candidates[$index][1] < 4.25) && ($candidates[$index][1] >= 3.75))\n\t\t\t{\n\t\t\t\t$chosenGroup[$groupIndex] = $candidates[$index][0];\n\t\t\t\t\t\n\t\t\t\t$groupIndex++;\n\t\t\t}\n\t\t\t\t\n\t\t\t$index++;\n\t\t}\n\t}\n\t\n\t//assign required recipe IDs to 4.5-star rating group (if group chosen)\n\tif (($randomNum >= 4) && ($randomNum <= 33))\n\t{\n\t\twhile (1)\n\t\t{\n\t\t\t//traverse to 4.5-star ratings in sorted rating array\n\t\t\tif ($candidates[$index][1] < 4.25)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t\tif (($candidates[$index][1] < 4.75) && ($candidates[$index][1] >= 4.25))\n\t\t\t{\n\t\t\t\t$chosenGroup[$groupIndex] = $candidates[$index][0];\n\t\t\t\t\t\n\t\t\t\t$groupIndex++;\n\t\t\t}\n\t\t\t\t\n\t\t\t$index++;\n\t\t}\n\t}\n\t\n\t//assign required recipe IDs to 5-star rating group (if group chosen)\n\tif ($randomNum >= 34)\n\t{\n\t\t//already begins at 5-star ratings\n\t\twhile (1)\n\t\t{\n\t\t\tif ($candidates[$index][1] < 4.75)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\telse \n\t\t\t{\n\t\t\t\t$chosenGroup[$groupIndex] = $candidates[$index][0];\n\t\t\t\t\n\t\t\t\t$index++;\n\t\t\t\t$groupIndex++;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $chosenGroup;\n}", "public function __construct() {\n $this->message = \"Problema ao listar categorias alfabeticamente.\";\n }", "public function __construct(AttributeCategory $attributeCategory)\n {\n $this->attributeCategory = $attributeCategory;\n }", "public function testConstructor_noCategory()\n {\n $actual = new DataPoint('uniqueid', 'ASSAULT', new \\DateTime(), 'Gotham', ['lat' => 0, 'lon' => 0], '', '');\n \n $this->assertEquals('MISDEMEANOR', $actual->getCategory());\n $this->assertEquals('1', $actual->getClass());\n }", "function __construct()\n {\n parent::__construct();\n \n \n \t$this->load->model('category_model'); \n \t$this->cm->isloggedIn();\n }", "function __construct()\n\t{\t\n\t\t$this ->user;\n\t\t$this ->needLogin = false;\n\t\t$this->categories = array();\n\t}", "function dropdown_categories($default_category = 0, $category_parent = 0, $popular_ids = array())\n {\n }", "public function __construct()\n {\n parent::__construct('BaseMtc_membership_category');\n }", "public function categoryName() {\n $categories = array(\n 'Fantasy',\n 'Technology',\n 'Thriller',\n 'Documentation',\n );\n\n return $categories[array_rand($categories)];\n }", "public function __construct(){\n\n // Break, if disabled.\n if ( !WPP_FEATURE_FLAG_WPP_LISTING_CATEGORY ) {\n return;\n }\n\n // Register taxonomy.\n add_filter('wpp_taxonomies', array( $this, 'define_taxonomies'), 10 );\n\n }", "public function __construct()\n {\n $this->categories = [];\n $this->faker = Factory::create();\n $this->useContext('symfony_doctrine_context', new SymfonyDoctrineContext());\n }", "function __construct()\n {\n parent::__construct();\n\n $this->load->model('categories_model');\n $this->load->model('order_model');\n\n $this->data['data_store'] = array();\n $this->data['data_outlet'] = array();\n\n $this->data['data_store'] = $this->get_data_store();\n $this->data['data_outlet'] = $this->get_data_outlet();\n if ($this->ion_auth->logged_in()) {\n $user = $this->ion_auth->user()->row();\n $user_groups = $this->ion_auth->get_users_groups($user->id)->result();\n $this->groups_access->group_id = $user_groups[0]->id;\n }\n }", "public function GetRandomRssChannelCategory(){\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\tzt_rss_channel_categories\n\t\t\tORDER BY RAND()\n\t\t\tLIMIT 1;\n\t\t\";\n\t\t\n\t\t$rssChannelCategoryQueryResult = $this->db->query($query)->row();\n\n\t\treturn $this->CreateObject($rssChannelCategoryQueryResult);\n\t\t\n\t}", "public function __construct()\n {\n parent::__construct('BaseAta_program_category');\n }", "public function __construct(CategoryRepo $repo)\n {\n $this->repo = $repo;\n }", "public static function getRandom()\n\t{\n\t\t$randNumPhp = Lottery::getSecureRand( self::getCount() );\n\t\t//$randNumSql = '( SELECT FLOOR( MAX(`id`) * RAND() ) FROM `category_prize` LIMIT 1 )';\n\n\t\treturn self::find()\n ->select(['id', 'name'])\n\t\t ->andWhere(['>=', 'id', $randNumPhp])\n\t\t ->orderBy('id')\n\t\t ->asArray()\n ->one();\n\t}", "public function init()\n {\n $config = new Zend_Config_Ini(\n APPLICATION_PATH . '/configs/forms/category.ini',\n 'category'\n );\n $this->setConfig($config->category);\n $this->_populateSelectWithCategories();\n $select = $this->getElement('preferentialCategory');\n }", "function __construct(\n $code, $category_id, $name, $distribution, $price,\n $active, $ord, $weight, $id=0\n ) {\n // Assign & check\n $this->code = trim(strip_tags($code));\n $this->category_id = trim(strip_tags($category_id));\n $this->name = trim($name);\n $this->distribution = trim(strip_tags($distribution));\n $this->price = floatval($price);\n $this->ord = intval($ord);\n $this->weight = intval($weight);\n $this->id = intval($id);\n $this->active($active);\n\n if ($this->ord <= 0) { $this->ord = 0; }\n // Default values for everything else as stated above\n\n // Enable cloning of Products with Attributes\n if ($this->id > 0) {\n $this->arrRelations =\n Attributes::getRelationArray($this->id);\n }\n }", "protected function _initCatagory()\r\n\t{\r\n\t\tMage::dispatchEvent('vendor_catalog_controller_category_init_before', array('controller_action' => $this));\r\n\t\t$categoryId = (int) $this->getRequest()->getParam('id', false);\r\n\t\tif (!$categoryId) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$category = Mage::getModel('vendorscategory/category')\r\n\t\t->load($categoryId);\r\n\t\tif (!Mage::helper('vendorscategory')->canShow($category)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!Mage::registry(\"vendor_id\") && !Mage::registry(\"vendor\") && !Mage::registry(\"current_vendor\")){\r\n\t\t\t//echo $category->getVendorId();exit;\r\n\t\t\t$vendorObj = Mage::getModel('vendors/vendor')->load($category->getVendorId());\r\n\r\n\t\t\t//var_dump($vendorObj->getData());exit;\r\n\t\t\tMage::register('vendor_id', $vendorObj->getVendorId());\r\n\t\t\tMage::register('vendor', $vendorObj);\r\n\t\t\tMage::register('current_vendor', $vendorObj);\r\n\t\t}\r\n\t\t\r\n\t\tMage::register('current_vendor_category', $category);\r\n\t\tMage::register('current_vendor_entity_key', $category->getPath());\r\n\t\ttry {\r\n\t\t\tMage::dispatchEvent(\r\n\t\t\t'vendor_catalog_controller_category_init_after',\r\n\t\t\tarray(\r\n\t\t\t'category' => $category,\r\n\t\t\t'controller_action' => $this\r\n\t\t\t)\r\n\t\t\t);\r\n\t\t} catch (Mage_Core_Exception $e) {\r\n\t\t\tMage::logException($e);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\treturn $category;\r\n\t}", "public function __construct() {\n\n $this->model_name = 'App\\\\' . ucfirst($this->category);\n\n }", "protected function _createSubset() {}", "function __construct() {\n // initialize things when class is instantiated\n $this->id = rand(100, 1000000);\n echo \"The created animal was assigned an id of \" . $this->id . \"<br>\";\n Animal::$numberOfAnimals+=1;\n }", "public function __construct()\n {\n $this->beforeFilter(function() {\n View::share('catnav', Category::all());\n });\n }", "function abl_droploader_get_image_cat_select() {\n\t\t$image_categories = getTree('root', 'image');\n\t\t//$image_categories_select = str_ireplace(\"\\n\", '', tag('<label for=\"image-category\">' . gTxt('image_category') . '</label>' . br .\n\t\t//\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' id=\"abl-droploader-image-cat-sel\" class=\"category\"'));\n\t\t//$alt_caption =\ttag('<label for=\"alt-text\">'.gTxt('alt_text').'</label>'.br.\n\t\t//\t\tfInput('text', 'alt', '', 'edit', '', '', 50, '', 'alt-text'), 'div', ' class=\"alt text\"').\n\t\t//\ttag('<label for=\"caption\">'.gTxt('caption').'</label>'.br.\n\t\t//\t\t'<textarea id=\"caption\" name=\"caption\"></textarea>'\n\t\t//\t\t, 'div', ' class=\"caption description text\"');\n\t\t$image_categories_select = str_ireplace(\"\\n\", '', tag(tag('<label for=\"image-category\">'.gTxt('image_category').'</label>'.br.\n\t\t\t\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' class=\"category\"'), 'div', ' id=\"abl-droploader-image-cat-sel\"'));\n\t\treturn $image_categories_select;\n\t}", "protected function _construct()\n {\n \t$this->_isEnabled = Mage::getStoreConfig('ceesenco_maattabel/configuration/enabled');\n \t$this->_accountid = Mage::getStoreConfig('ceesenco_maattabel/configuration/accountid');\n \t$this->_width = Mage::getStoreConfig('ceesenco_maattabel/configuration/width');\n \t$this->_height = Mage::getStoreConfig('ceesenco_maattabel/configuration/height');\n \t$this->_label = Mage::getStoreConfig('ceesenco_maattabel/configuration/label');\n \t$this->_lang = Mage::getStoreConfig('ceesenco_maattabel/configuration/lang');\n\n \t$this->_categorie = Mage::getSingleton(\"eav/config\")->getAttribute(\"catalog_category\", 'maattabel_categorie')->getSource()->getOptionText(Mage::getSingleton('catalog/layer')->getCurrentCategory()->getData('maattabel_categorie'));\n \tif ($this->_categorie == \"\") {\n\t\t $current_product = Mage::registry('current_product');\n\t\t if(is_object($current_product))\n\t\t {\n\t\t $categories = $current_product->load($current_product->getId())->getCategoryIds();\n\t\t if (is_array($categories) and count($categories))\n\t\t {\n \t\t\t\t\t$this->_categorie = Mage::getSingleton(\"eav/config\")->getAttribute(\"catalog_category\", 'maattabel_categorie')->getSource()->getOptionText(Mage::getModel('catalog/category')->load($categories[count($categories)-1])->getData('maattabel_categorie'));\n\t\t }\n\t\t }\n \t}\n \t$temp = explode(\" - \", $this->_categorie);\n \t$this->_categorie = $temp[0];\n }", "public function __construct() {\n\t\t$widget_ops = array( \n\t\t\t'classname' => 'Display Random Widgets Widget',\n\t\t\t'description' => 'Displays a random widget from a list by shortcode with a widget.',\n\t\t\t\n\t\t);\n\n\t\tparent::__construct( 'RandWidsWid', 'Random Widgets Widget', $widget_ops );\n\t}", "public function __construct( $categories_id = null ) {\n\t\tif (!is_null($categories_id)) {\n\t\t\t$sql = 'select c.*, cd.* from cart_categories c LEFT JOIN cart_categories_description cd ON (cd.categories_id = c.categories_id) where c.categories_id=' . $categories_id;\n\t\t\tif (!$result = Database::singleton()->query_fetch($sql)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// sets from cart_categories table\n\t\t\t$this->setId($result['categories_id']);\n\t\t\t$this->setImage($result['categories_image']);\n\t\t\t$this->setParent_id($result['parent_id']);\n\t\t\t$this->setSort_order($result['sort_order']);\n\t\t\t$this->setDate_added($result['date_added']);\n\t\t\t$this->setLast_modified($result['last_modified']);\n\t\t\t$this->setStatus($result['categories_status']);\n\t\t\t\n\t\t\t// sets from cart_categories_description table\n\t\t\t$this->setName($result['categories_name']);\n\t\t\t$this->setDescription($result['categories_description']);\n\t\t}\n\t}", "public function __construct() {\n\t\tparent::__construct(\n\t \t\t'fixtures_live_comp_list', // Base ID\n\t\t\t'Fixtures Live Competition List', // Name\n\t\t\tarray( 'description' => __( 'A list of selected competitons in the league', 'fixtures_live' ), ) // Args\n\t\t);\n\n\t\t$this->opts = array(1 => 'Divisions',2 => 'Cups');\n\t}", "function __construct()\n\t{\n\t\tparent::__construct(\n\t\t\t'jetty_widget_andeavor_category_faq',\n\t\t\t__('Jetty Widget - Andeavor Category Faq', 'jetty'),\n\t\t\tarray( 'description' => __( 'This widget for display collapse latest section on certain page', 'jetty' ), )\n\t\t);\n\t}", "static public function create(int $catAmount)\n {\n /** @var array $cats */\n $cats = [];\n\n $breed = Config::get('cat_breed');\n $gender = Config::get('gender');\n $color = Config::get('cat_color');\n $name = Config::get('cat_name');\n $catAge = Config::get('cat_age');\n $catSquare = Config::get('cat_square');\n\n $catBreed = $breed[array_rand($breed,1)];\n $catGender = $gender[array_rand($gender, 1)];\n $catColor = $color[array_rand($color,1)];\n $catName = $name[array_rand($name,1)];\n\n while ($catAmount > 0) {\n array_push($cats,new Cat($catBreed,$catAge,$catGender,$catColor,$catName,$catSquare));\n\n $catAmount--;\n }\n return $cats;\n }", "private function __construct() \n {\n $this->id = random_int(1, 10);\n }", "public function choose(array $categories = array(), Exercise $result = null);", "public function __construct(Category $model)\n {\n $this->model = $model;\n }", "public function __construct()\n {\n $categories = Category::all();\n \n view()->share('categories', $categories);\n \n }", "public function __construct()\n {\n parent::__construct(\n 'label', 'description', // Categories\n 'slug', 'title', 'content', 'created_at', 'modified_at', 'owner', 'fk_category_id' // Posts\n );\n $this->categories = Reflector::reflect('Http\\Models\\Blog\\Category');\n $this->posts = Reflector::reflect('Http\\Models\\Blog\\Post');\n $this->populate();\n\n }", "protected function setupCategories()\n {\n static $done;\n\n if (!empty($done)) {\n return;\n }\n\n $c = new Categories();\n $c->setContext('G_Access');\n $c->setIsActive(true);\n $c->save();\n\n $ci = new CategoriesI18n();\n $ci->setId($c->getId());\n $ci->setTitle('Girl Accessories');\n $ci->setLocale('da_DK');\n $ci->setContent('test 1.2.3');\n $ci->save();\n\n $c = new Categories();\n $c->setContext('LG_Access');\n $c->setIsActive(true);\n $c->save();\n\n $ci = new CategoriesI18n();\n $ci->setId($c->getId());\n $ci->setTitle('Little Girl Accessories');\n $ci->setLocale('da_DK');\n $ci->setContent('test 1.2.3');\n $ci->save();\n\n $done = true;\n }", "public function __construct()\n {\n $this->categories = new ArrayCollection();\n $this->families = new ArrayCollection();\n $this->types = new ArrayCollection();\n $this->designations = new ArrayCollection();\n $this->makes = new ArrayCollection();\n }", "function _make_cat_compat(&$category)\n {\n }", "public function _construct()\n {\n $this->_initProductCollection();\n parent::_construct();\n }", "public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}", "public function __construct(\\App\\Categroy $categories)\n {\n // Dependencies automatically resolved by service container...\n $this->categories = $categories;\n }", "public function categorylist($c){\n $this->cat_id = $c; \n }", "private function init_category_and_course() {\n global $DB;\n\n // Category.\n $category = new stdClass;\n $category->name = 'category';\n $category->id = $DB->insert_record('course_categories', $category);\n context_coursecat::instance($category->id);\n\n // Course.\n $coursedata = new stdClass;\n $coursedata->category = $category->id;\n $coursedata->fullname = 'fullname';\n $course = create_course($coursedata);\n\n return context_course::instance($course->id);\n }", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "function getCategory($pid) {\n srand(MAGIC_KEY * $pid);\n return (rand() % 12) + 1;\n}", "protected function actionRandom() {\n //Fetch all images of the selected category\n $arrRandom = $this->loadFilesRecursive($this->arrElementData[\"repo_id\"]);\n $intRand = array_rand($arrRandom);\n //set the systemid as current\n if(isset($arrRandom[$intRand]))\n $this->setSystemid($arrRandom[$intRand]);\n //and load all\n $strReturn = $this->actionFileDetails(false);\n $strReturn = $this->addPortaleditorCode($strReturn);\n return $strReturn;\n }" ]
[ "0.67127997", "0.665652", "0.6210082", "0.6210082", "0.6191347", "0.61228466", "0.60735077", "0.5970062", "0.5934775", "0.59150916", "0.58615243", "0.5843152", "0.57911336", "0.57910144", "0.5786045", "0.5785097", "0.57795167", "0.5763429", "0.5753034", "0.5743912", "0.57061124", "0.5686841", "0.56839764", "0.5665489", "0.5660187", "0.5644968", "0.5644968", "0.56371945", "0.5631928", "0.5625398", "0.56101537", "0.5564697", "0.5563573", "0.5550299", "0.55186045", "0.5494556", "0.5485788", "0.5479278", "0.5478929", "0.5466466", "0.54539526", "0.5450687", "0.5435662", "0.54343534", "0.5412356", "0.5400964", "0.53884125", "0.5358114", "0.53488386", "0.5335518", "0.53301126", "0.5318297", "0.5309224", "0.52879715", "0.5273139", "0.527198", "0.52484155", "0.5233808", "0.5231622", "0.522821", "0.5225811", "0.5223262", "0.52168894", "0.52147204", "0.5209744", "0.5206638", "0.52018833", "0.5200682", "0.5197198", "0.5193369", "0.5187894", "0.5181883", "0.51720804", "0.51650536", "0.5150426", "0.5147021", "0.5143151", "0.5137699", "0.5131289", "0.51310533", "0.51281667", "0.5125506", "0.512392", "0.5119799", "0.51140267", "0.51123524", "0.51043403", "0.5103131", "0.5103115", "0.5098731", "0.5090733", "0.5089051", "0.5080409", "0.5078146", "0.5072598", "0.50697297", "0.5068511", "0.50610054", "0.50610054", "0.50599676", "0.50552195" ]
0.0
-1
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values
public static function __set_state(array $array) { return parent::__set_state($array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Root;\n $plugin->Identifier = $this->Identifier;\n \n // Return result\n return $plugin;\n }", "protected function constructExportObject()\n\t{\n\t\t//default export is \"all public fields\"\n\t\treturn (object) Arrays::getPublicPropertiesOfObject($this);\n\t}", "function from_export($value) {\n return $value;\n }", "public function export(): mixed;", "public function ExportObject() {\n // Init object\n $col = new stdClass();\n \n // Set values\n $col->id = $this->Id;\n $col->type = $this->Type;\n $col->label = $this->Label;\n $col->p = $this->P;\n \n // Return values\n return $col;\n }", "public function exportData() {\n\t\treturn $this->constructExportObject();\n\t}", "public function toObject();", "function ctools_export_new_object($table, $set_defaults = TRUE) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n $object = new $export['object'];\r\n foreach ($schema['fields'] as $field => $info) {\r\n if (isset($info['object default'])) {\r\n $object->$field = $info['object default'];\r\n }\r\n else if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = NULL;\r\n }\r\n }\r\n\r\n if ($set_defaults) {\r\n // Set some defaults so this data always exists.\r\n // We don't set the export_type property here, as this object is not saved\r\n // yet. We do give it NULL so we don't generate notices trying to read it.\r\n $object->export_type = NULL;\r\n $object->{$export['export type string']} = t('Local');\r\n }\r\n return $object;\r\n}", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "public function createExport();", "public function newInstance(): object;", "public static function createFromGlobals();", "public function export (){\n\n }", "function &object(object $value, string $namespace = 'default'): object\n{\n $var = new Variable\\ObjectVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function getObj();", "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 export()\n {\n }", "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}", "public function getExportableValues() {\n\t\telgg_deprecated_notice(__METHOD__ . ' has been deprecated by toObject()', 1.9);\n\t\treturn array(\n\t\t\t'id',\n\t\t\t'entity_guid',\n\t\t\t'name',\n\t\t\t'value',\n\t\t\t'value_type',\n\t\t\t'owner_guid',\n\t\t\t'type',\n\t\t);\n\t}", "public function ExportObject() {\n // Init object\n $overviewChart = new stdClass();\n \n // Set values\n $overviewChart->Types = $this->Types;\n $overviewChart->Chart = $this->Chart->ExportObject();\n \n //return result\n return $overviewChart;\n }", "public function export()\n {\n \n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function getter () {\n return (object)[\n get_plugin_name => $this->plugin_name,\n get_plugin_version => $this->plugin_version,\n get_translation_slug => $this->translation_slug,\n get_admin_page_slug => $this->admin_page_slug,\n get_api_namespace => $this->api_namespace,\n get_options_name => $this->options_name\n ];\n }", "public function getObject() {}", "public function getObject() {}", "public function export()\n {\n //\n }", "function _instantiateExportDeployment($context) {\n\t\t$exportDeploymentClassName = $this->getExportDeploymentClassName();\n\t\t$this->import($exportDeploymentClassName);\n\t\t$exportDeployment = new $exportDeploymentClassName($context, $this);\n\t\treturn $exportDeployment;\n\t}", "function get_obj()\n {\n $object = new ApiRest;\n return $object;\n }", "public function newInstance();", "public function newInstance();", "public function __CONSTRUCT(){\n\t}", "public function getInstance(): object;", "public function exportedVars(): iterable;", "public static function fromGlobals() {}", "public function ExportObject() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->GitHash = $this->GitHash;\n $submission->Categories = array();\n \n // Export each category\n foreach ($this->Categories as $category) {\n $submission->Categories[] = $category->ExportObject();\n }\n \n // return result\n return $submission;\n }", "public function getInstance(): object\n {\n }", "function ctools_get_default_object($table, $name) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n if (!$export['default hook']) {\r\n return;\r\n }\r\n\r\n // Try to load individually from cache if this cache is enabled.\r\n if (!empty($export['cache defaults'])) {\r\n $defaults = _ctools_export_get_some_defaults($table, $export, array($name));\r\n }\r\n else {\r\n $defaults = _ctools_export_get_defaults($table, $export);\r\n }\r\n\r\n $status = variable_get($export['status'], array());\r\n\r\n if (!isset($defaults[$name])) {\r\n return;\r\n }\r\n\r\n $object = $defaults[$name];\r\n\r\n // Determine if default object is enabled or disabled.\r\n if (isset($status[$object->{$export['key']}])) {\r\n $object->disabled = $status[$object->{$export['key']}];\r\n }\r\n\r\n $object->{$export['export type string']} = t('Default');\r\n $object->export_type = EXPORT_IN_CODE;\r\n $object->in_code_only = TRUE;\r\n\r\n return $object;\r\n}", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->number = $this->_number;\n $stdClass->internal = $this->_internal;\n return $stdClass;\n }", "public function getObject(): object;", "public function get_export_data()\n {\n\n $l_sql = \"SELECT isys_obj_type__id, isys_obj_type__title, isys_verinice_types__title, isys_verinice_types__const \" . \"FROM isys_obj_type \" . \"INNER JOIN isys_verinice_types ON isys_obj_type__isys_verinice_types__id = isys_verinice_types__id \";\n\n return $this->retrieve($l_sql);\n\n }", "public function dataProviderExport()\n {\n // Regular :\n $data = [\n [\n 'test string',\n var_export('test string', true),\n ],\n [\n 75,\n var_export(75, true),\n ],\n [\n 7.5,\n var_export(7.5, true),\n ],\n [\n null,\n 'null',\n ],\n [\n true,\n 'true',\n ],\n [\n false,\n 'false',\n ],\n [\n [],\n '[]',\n ],\n ];\n // Arrays :\n $var = [\n 'key1' => 'value1',\n 'key2' => 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => 'value1',\n 'key2' => 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'value1',\n 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'value1',\n 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n // Objects :\n $var = new \\StdClass();\n $var->testField = 'Test Value';\n $expectedResult = \"unserialize('\" . serialize($var) . \"')\";\n $data[] = [$var, $expectedResult];\n $var = function () {return 2;};\n $expectedResult = 'function () {return 2;}';\n $data[] = [$var, $expectedResult];\n return $data;\n }", "public static function export()\n {\n return null;\n }", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function construct()\n {\n return $this->object;\n }", "public function metaExport($object = false);", "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \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 getObject();", "public function getObject();", "function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ObjectForReviewPerson');\n\t\treturn new ObjectForReviewPerson();\n\t}", "public function __construct(VariableExportInterface $variableExport)\n {\n $this->serialized = $variableExport->toSerialize();\n }", "public function as_object($class = TRUE, $arguments = array());", "function var_export($expression, $return = false)\n{\n}", "function getObject();", "function getObject();", "abstract public function object();", "public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }", "abstract protected function createObject();", "function &getInstance($module_srl)\n\t{\n\t\treturn new ExtraVar($module_srl);\n\t}", "abstract function exportData();", "function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}", "abstract protected function exportFunctions();", "public static function factory()\n {\n $class = get_called_class();\n $object = new $class();\n foreach (static::getDefaults() as $field => $value) {\n $object->{$field} = $value;\n }\n return $object;\n }", "public function &__invoke()\r\n\t{\r\n\t\t$result = new stdClass();\r\n\t\tAdhoc::eachTrap('Registry',\r\n\t\t\tfunction ($trap) use (&$result)\r\n\t\t\t{\r\n\t\t\t\t$data =& $trap->GetList();\r\n\t\t\t\tforeach ($data as $k=>$v)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($result->$k) and isset($v))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result->$k = $v;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public static function instantation($the_record){\n\n // can be used to retrieve a string with the name of the called class and static:: introduces its scope.\n $calling_class = get_called_class();\n\n $the_object = new $calling_class;\n\n\n // doing a loop to get all of the values in the object ]\n foreach($the_record as $key => $value) {\n\n if($the_object->has_the_key($key)){\n $the_object->$key = $value;\n \n }\n }\n\n return $the_object;\n }", "public static function get_object() {\n\t\treturn self::$object;\n\t}", "function adminer_object() {\r\n include_once \"./plugins/plugin.php\";\r\n \r\n // autoloader\r\n foreach (glob(\"plugins/*.php\") as $filename) {\r\n include_once \"./$filename\";\r\n }\r\n \r\n $plugins = array(\r\n // specify enabled plugins here\r\n // new AdminerDumpXml,\r\n // new AdminerTinymce,\r\n // new AdminerFileUpload(\"data/\"),\r\n // new AdminerSlugify,\r\n // new AdminerTranslation,\r\n // new AdminerForeignSystem,\r\n // new AdminerLoginPasswordLess(password_hash(\"\", PASSWORD_DEFAULT)),\r\n );\r\n \r\n /* It is possible to combine customization and plugins:\r\n class AdminerCustomization extends AdminerPlugin {\r\n }\r\n return new AdminerCustomization($plugins);\r\n */\r\n class AdminerCustomization extends AdminerPlugin {\r\n function login($login, $password) {\r\n // validate user submitted credentials\r\n return true;\r\n }\r\n }\r\n return new AdminerCustomization($plugins);\r\n \r\n // return new AdminerPlugin($plugins);\r\n}", "public function ExportItem() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->ImportDateTime = $this->ImportDateTime;\n $submission->User = $this->User;\n $submission->Good = $this->Good;\n $submission->Bad = $this->Bad;\n $submission->Strange = $this->Strange;\n $submission->GitHash = $this->GitHash;\n $submission->SequenceNumber = $this->SequenceNumber;\n \n // Return result\n return $submission;\n }", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "function instance($obj) {\n\tif (is_string($obj)) {\n\t\t$obj = new $obj;\n\t}\n\treturn $obj;\n}", "function ctools_var_export($var, $prefix = '') {\r\n if (is_array($var)) {\r\n if (empty($var)) {\r\n $output = 'array()';\r\n }\r\n else {\r\n $output = \"array(\\n\";\r\n foreach ($var as $key => $value) {\r\n $output .= $prefix . \" \" . ctools_var_export($key) . \" => \" . ctools_var_export($value, $prefix . ' ') . \",\\n\";\r\n }\r\n $output .= $prefix . ')';\r\n }\r\n }\r\n else if (is_object($var) && get_class($var) === 'stdClass') {\r\n // var_export() will export stdClass objects using an undefined\r\n // magic method __set_state() leaving the export broken. This\r\n // workaround avoids this by casting the object as an array for\r\n // export and casting it back to an object when evaluated.\r\n $output = '(object) ' . ctools_var_export((array) $var, $prefix);\r\n }\r\n else if (is_bool($var)) {\r\n $output = $var ? 'TRUE' : 'FALSE';\r\n }\r\n else {\r\n $output = var_export($var, TRUE);\r\n }\r\n\r\n return $output;\r\n}", "public function getOutputObject()\n {\n $baseObject = parent::getOutputObject();\n $baseObject->name = $this->getName();\n\n return $baseObject;\n }", "public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function regularNew() {}", "public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }", "function data2Object($data) { \n\t\t\t$class_object = new getData($data); \n\t\t\treturn $class_object; \n\t\t}", "function _construct(){ }", "function ctools_export_object($table, $object, $indent = '', $identifier = NULL, $additions = array(), $additions2 = array()) {\r\n $schema = ctools_export_get_schema($table);\r\n if (!isset($identifier)) {\r\n $identifier = $schema['export']['identifier'];\r\n }\r\n\r\n $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . \"();\\n\";\r\n\r\n if ($schema['export']['can disable']) {\r\n $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . \"\\n\";\r\n }\r\n if (!empty($schema['export']['api']['current_version'])) {\r\n $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . \";\\n\";\r\n }\r\n\r\n // Put top additions here:\r\n foreach ($additions as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n $fields = $schema['fields'];\r\n if (!empty($schema['join'])) {\r\n foreach ($schema['join'] as $join) {\r\n if (!empty($join['load'])) {\r\n foreach ($join['load'] as $join_field) {\r\n $fields[$join_field] = $join['fields'][$join_field];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Go through our schema and joined tables and build correlations.\r\n foreach ($fields as $field => $info) {\r\n if (!empty($info['no export'])) {\r\n continue;\r\n }\r\n if (!isset($object->$field)) {\r\n if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = '';\r\n }\r\n }\r\n\r\n // Note: This is the *field* export callback, not the table one!\r\n if (!empty($info['export callback']) && function_exists($info['export callback'])) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $object->$field, $indent) . \";\\n\";\r\n }\r\n else {\r\n $value = $object->$field;\r\n if ($info['type'] == 'int') {\r\n if (isset($info['size']) && $info['size'] == 'tiny') {\r\n $info['boolean'] = (!isset($info['boolean'])) ? $schema['export']['boolean'] : $info['boolean'];\r\n $value = ($info['boolean']) ? (bool) $value : (int) $value;\r\n }\r\n else {\r\n $value = (int) $value;\r\n }\r\n }\r\n\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n }\r\n\r\n // And bottom additions here\r\n foreach ($additions2 as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n return $output;\r\n}", "public function createValidObject() : object {\n\t\treturn (object) [\"tweetContent\" => bin2hex(random_bytes(12))];\n\t}", "public function _init_obj()\n {\n // dummy\n }", "protected function make_object( \\stdClass $data ) {\n\t\treturn new Purchase( $data );\n\t}", "public function as_object()\n {\n $this->return_as = 'object';\n return $this;\n }", "static public function fromObj($anObj) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anObj);\n\t}", "function adminer_object() {\n\t\tinclude_once \"plugins/plugin.php\";\n\t\t// autoloader\n\t\tforeach (glob(\"plugins/*.php\") as $filename) {\n\t\t\tinclude_once $filename;\n\t\t}\n\t\t$plugins = array(\n\t\t\t// specify enabled plugins here\n\t\t\tnew AdminerDatabaseHide(array('information_schema', 'mysql', 'performance_schema')),\n\t\t\t//new AdminerDumpJson,\n\t\t\t//new AdminerDumpBz2,\n\t\t\t//new AdminerDumpZip,\n\t\t\t//new AdminerDumpXml,\n\t\t\t//new AdminerDumpAlter,\n\t\t\t//~ new AdminerSqlLog(\"past-\" . rtrim(`git describe --tags --abbrev=0`) . \".sql\"),\n\t\t\t//new AdminerFileUpload(\"\"),\n\t\t\t//new AdminerJsonColumn,\n\t\t\t//new AdminerSlugify,\n\t\t\t//new AdminerTranslation,\n\t\t\t//new AdminerForeignSystem,\n\t\t\t//new AdminerEnumOption,\n\t\t\t//new AdminerTablesFilter,\n\t\t\t//new AdminerEditForeign,\n\t\t);\n\n\t\treturn new AdminerPlugin($plugins);\n\t}", "public function newCObj() {}", "private function PREPARE_OBJECT_VARIABLE_METHOD()\r\r {\r\r if($this->_type === 'POST')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_POST[$key])?$_POST[$key]:false;\r\r } \r\r } \r\r else if($this->_type === 'GET')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_GET[$key])?$_GET[$key]:false;\r\r } \r\r } \r\r }", "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 }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->billOfLading = $this->_billOfLading;\n $stdClass->secondaryPickingType = $this->_secondaryPickingType;\n return $stdClass;\n }", "abstract public function prepare_new_object(array $args);", "protected function getRealScriptUserObj() {}", "public function export(bool $private = FALSE, bool $meta = FALSE) {\n\t\t$keys = [];\n\t\t$ret = [];\n\n\t\tif ($private) {\n\t\t\t$keys = static::$PRIVATE;\n\t\t} else {\n\t\t\t$keys = static::$PUBLIC;\n\t\t}\n\n\t\tif (!empty(array_intersect(EXP_RESERVED, $keys))) {\n\t\t\tthrow new ExportableException(\n\t\t\t\t\"Reserved key '\".EXP_CLASSNAME.\"' used in object.\"\n\t\t\t);\n\t\t}\n\n\t\tif ($meta) { // Add metadata.\n\t\t\t$ret[EXP_CLASSNAME] = get_class($this);\n\t\t\t$ret[EXP_VISIBILITY] = $private ? 'private' : 'public';\n\t\t}\n\n\t\tforeach ($keys as $k) {\n\t\t\t$current = $this->__exportable_get($k);\n\t\t\tswitch (gettype($current)) {\n\t\t\t\tcase 'object':\n\t\t\t\t\t$ret[$k] = $this->exp_obj(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\t\t$ret[$k] = $this->exp_array(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$ret[$k] = $current;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public static function & GetInstance ();", "public function getInstance(): mixed;", "public function convertToUserIntObject() {}", "function FetchObj() {}" ]
[ "0.6951056", "0.69235533", "0.6576406", "0.6377145", "0.61438453", "0.6123597", "0.60555947", "0.60385406", "0.5922576", "0.5922576", "0.5922576", "0.5922576", "0.5922576", "0.5859328", "0.58386916", "0.58126146", "0.5800945", "0.5715804", "0.571534", "0.5712997", "0.5688761", "0.5658427", "0.5640244", "0.56017965", "0.5525057", "0.5512275", "0.54624516", "0.54065686", "0.54065686", "0.5402593", "0.53759634", "0.5372155", "0.5371501", "0.5371501", "0.53698903", "0.5342519", "0.5334929", "0.5315758", "0.5307627", "0.5297458", "0.5262869", "0.5260146", "0.5248292", "0.5244241", "0.52275795", "0.51874787", "0.51795346", "0.5150348", "0.5141145", "0.513255", "0.5131906", "0.5117587", "0.5117587", "0.5117466", "0.5112706", "0.51077455", "0.50988156", "0.50935", "0.50935", "0.5078365", "0.50393796", "0.50392556", "0.5032243", "0.500829", "0.500578", "0.50021815", "0.49989748", "0.4986421", "0.4985877", "0.49773422", "0.49751663", "0.49675283", "0.4957486", "0.49566287", "0.49518955", "0.49497175", "0.49412116", "0.49269983", "0.49269983", "0.4919096", "0.4918042", "0.49162993", "0.4907476", "0.49073106", "0.48962304", "0.48928276", "0.4889555", "0.48821777", "0.48817694", "0.4876133", "0.48756412", "0.48639464", "0.48624778", "0.48621023", "0.48483175", "0.4845858", "0.48404086", "0.48386553", "0.48385635", "0.48351642", "0.4834503" ]
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return __CLASS__;;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "function getName()\n {\n return get_class($this);\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function toString()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getNamespacedName()\n {\n return get_class();\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function __toString() {\n\t\treturn $this->className();\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }" ]
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529981", "0.85237026", "0.8502733", "0.8493115", "0.8491238", "0.8488943", "0.8484194", "0.847459", "0.8441478", "0.8418852", "0.8399611", "0.83950585", "0.83949184", "0.83853173", "0.8378261", "0.837777", "0.8372544", "0.8355432", "0.8355432", "0.83479965", "0.8325877", "0.8325877", "0.8312873", "0.83027107", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.82474744", "0.8242934", "0.8202995", "0.8185409", "0.8184752", "0.81829107", "0.81829107", "0.8176191", "0.81761754", "0.8162896", "0.8142928", "0.81323636", "0.8062757", "0.80528253", "0.8045769", "0.8033823", "0.8026215", "0.8001116", "0.79949147", "0.79779136", "0.79672754", "0.7957633", "0.790449", "0.78617185", "0.7860126", "0.7847096", "0.78195953", "0.7817044", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.77821547", "0.7761565", "0.77588034", "0.7747239", "0.77409905", "0.77409905", "0.7710985", "0.76808393", "0.7670475", "0.76640886", "0.76514393", "0.76499707", "0.76323646", "0.76005036", "0.75937456" ]
0.0
-1
The public method save_alert saves a new alert
public function save_alert($args) { // Verify if the alert has the expected parameters if ( empty($args['alert_name']) || !isset($args['alert_type']) || !isset($args['alert_audience']) || !isset($args['alert_fields']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_missing_some_alert_parameters') ); } // Verify if the alert's parameters have correct value if ( ($args['alert_type'] < 0) || ($args['alert_type'] > 3) || !is_numeric($args['alert_type']) || ($args['alert_audience'] < 0) || ($args['alert_audience'] > 2) || !is_numeric($args['alert_audience']) || !is_array($args['alert_fields']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_parameters') ); } // Verify if the alert's fields have correct value if ( empty($args['alert_fields']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_fields') ); } // Verify if the alert's parameters have correct value if ( !isset($args['alert_fields'][0]['field_name']) || !isset($args['alert_fields'][0]['field_value']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_fields') ); } // Verify if the alert's parameters have correct value if ( !isset($args['alert_fields'][0]['language']) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_fields_without_language') ); } // Check for errors by type if ( $args['alert_type'] === '0' ) { // Banner count $banner_count = 0; // Page count $page_count = 0; // List the alert's fields foreach ( $args['alert_fields'] as $field ) { // Verify if is the banner content field if ( $field['field_name'] === 'banner_content' ) { // Verify if banner is empty if ( !empty($field['field_value']) ) { $banner_count++; } } // Verify if is the banner enabled field if ( $field['field_name'] === 'banner_enabled' ) { // Verify if banner is enabled if ( !empty($field['field_value']) ) { $banner_count++; } } // Verify if is the page title field if ( $field['field_name'] === 'page_title' ) { // Verify if page title is empty if ( !empty($field['field_value']) ) { $page_count++; } } // Verify if is the page content field if ( $field['field_name'] === 'page_content' ) { // Verify if page content is empty if ( !empty($field['field_value']) ) { $page_count++; } } // Verify if is the page enabled field if ( $field['field_name'] === 'page_enabled' ) { // Verify if page is enabled if ( !empty($field['field_value']) ) { $page_count++; } } } // Verify if at least the banner or page content exists if ( ($banner_count < 2) && ($page_count < 3) ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_can_not_be_saved_wrong_parameters') ); } } else if ( $args['alert_type'] === '1' ) { // Banner count $banner_count = 0; // List the alert's fields foreach ( $args['alert_fields'] as $field ) { // Verify if is the banner content field if ( $field['field_name'] === 'banner_content' ) { // Verify if banner is empty if ( !empty($field['field_value']) ) { $banner_count++; } } } // Verify if at least the banner or page content exists if ( $banner_count < 1 ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_type_requires_banner') ); } } else { // Banner count $banner_count = 0; // Page count $page_count = 0; // List the alert's fields foreach ( $args['alert_fields'] as $field ) { // Verify if is the banner content field if ( $field['field_name'] === 'banner_content' ) { // Verify if banner is empty if ( !empty($field['field_value']) ) { $banner_count++; } } } // Verify if at least the banner exists if ( $banner_count < 1 ) { // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_type_requires_banner') ); } } // Create the alert's parameters $alert_args = array( 'alert_name' => $args['alert_name'], 'alert_type' => $args['alert_type'], 'alert_audience' => $args['alert_audience'], 'created' => time() ); // Save the alert $alert_id = $this->CI->base_model->insert('notifications_alerts', $alert_args); // Verify if the alert was saved if ( $alert_id ) { // Fields counter $fields_count = 0; // List all alert fields foreach ( $args['alert_fields'] as $field ) { // Set extra $field_extra = isset($field['field_extra'])?$field['field_extra']:''; // Set language $language = isset($field['language'])?$field['language']:''; // Try to save the field if ( $this->save_alerts_field($alert_id, $field['field_name'], $field['field_value'], $field_extra, $language ) ) { $fields_count++; } } // Verify if the alert has filters if ( !empty($args['alert_filters']) ) { // List all alert filters foreach ( $args['alert_filters'] as $filter ) { // Set extra $filter_extra = isset($filter['filter_extra'])?$filter['filter_extra']:''; // Try to save the filter $this->save_alerts_filter($alert_id, $filter['filter_name'], $filter['filter_value'], $filter_extra); } } // Verify if the alert has users if ( !empty($args['alert_users']) ) { // List all alert's users' foreach ( $args['alert_users'] as $user ) { // Verify if user's id is numeric if ( is_numeric($user['user_id']) ) { // Try to save the alert's user $this->save_alerts_user($alert_id, $user['user_id']); } } } // Verify if all fields were saved if ( $fields_count === count($args['alert_fields']) ) { // Return the success return array( 'success' => TRUE, 'message' => $this->CI->lang->line('notifications_alert_was_saved') ); } } // Return the error return array( 'success' => FALSE, 'message' => $this->CI->lang->line('notifications_alert_was_not_saved') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveAlert(Request $request, $alert_id)\n {\n $alerta = Alerta::where(\n 'id',\n '=',\n $alert_id\n )\n ->get()->first();\n\n if ($alerta != null) {\n\n $pesquisa = Pesquisa::where(\n 'child_id',\n '=', $alerta->child_id\n )\n ->get()->first();\n\n //2- Instanciar os campos a serem atualizados\n $place_address = $request->get(\"place_address\");\n $place_cep = $request->get(\"place_cep\");\n $place_reference = $request->get(\"place_reference\");\n $place_neighborhood = $request->get(\"place_neighborhood\");\n\n //3 - Atualizar os campos instanciados no passo 2.\n $alerta->place_address = $place_address;\n $alerta->place_cep = $place_cep;\n $alerta->place_reference = $place_reference;\n $alerta->place_neighborhood = $place_neighborhood;\n\n $pesquisa->place_address = $place_address;\n $pesquisa->place_cep = $place_cep;\n $pesquisa->place_reference = $place_reference;\n $pesquisa->place_neighborhood = $place_neighborhood;\n\n $pesquisa->save(); //4 - update\n $alerta->save(); //4 - update\n\n $alerta = [\n //5 -Retorna o corpo do jason esperado no front\n \"status\" => \"SUCCESS\",\n \"message\" => \"Alerta atualizado\",\n \"data\" => $alerta //data chama o alerta atualizado\n ];\n\n return response()->json($alerta);\n\n } else { //Em caso do front enviar um id incorreto, o else retorna ERROR\n $alerta = [\n \"status\" => \"ERROR\",\n \"message\" => \"Alerta não localizada\",\n \"data\" => null,\n ];\n return response()->json($alerta);\n }\n }", "public function save_fields( $alert ) {\n\t\tcheck_admin_referer( 'save_alert', 'wp_stream_alerts_nonce' );\n\n\t\tif ( empty( $_POST['wp_stream_highlight_color'] ) ) {\n\t\t\t$alert->alert_meta['color'] = 'yellow';\n\t\t}\n\t\t$input_color = sanitize_text_field( wp_unslash( $_POST['wp_stream_highlight_color'] ) );\n\t\tif ( ! array_key_exists( $input_color, $this->get_highlight_options() ) ) {\n\t\t\t$alert->alert_meta['color'] = 'yellow';\n\t\t} else {\n\t\t\t$alert->alert_meta['color'] = $input_color;\n\t\t}\n\n\t}", "public function store(Requests\\StoreAlert $request)\n {\n $this->authorize('create', Alert::class);\n\n $input = $request->all();\n\n $alert = $this->alerts->create(['name' => $input['name']]);\n\n $this->set($alert, $input, [\n 'is_active',\n 'show_url',\n 'slug',\n 'url',\n 'intro',\n 'body',\n 'starts_at',\n 'ends_at',\n ]);\n\n $alert->save();\n\n $this->service()->cache();\n\n return response()->json($alert, 201);\n }", "public function store(CreateAlertRequest $request)\n {\n $input = $request->all();\n\n $alert = $this->alertRepository->create($input);\n\n Flash::success('Alert saved successfully.');\n\n return redirect(route('alerts.index'));\n }", "public function actionCreateAlert($commentDescription,$statut, $idSubCampaign, $idEcart)\n{\n $date = new DateTime('now');\n\n $newAlert = new \\Business\\Alert();\n $newAlert->creationDate = $date->format('Y-m-d H:i:s');\n $newAlert->statut = $statut;\n $newAlert->idSubCampaign = $idSubCampaign;\n $newAlert->idEcart = $idEcart;\n\n if ($newAlert->save()) {\n $comment = new Business\\CommentAlert();\n $comment->creationDate = $date->format('Y-m-d H:i:s');\n $comment->description = $commentDescription;\n $comment->idAlert = $newAlert->id;\n if (!$comment->save()){\n echo \"error while saving the comment\";\n print_r($comment->getErrors());\n }\n print_r(\"OK! Saved.\");\n } else {\n echo \"error while saving the new Alert\";\n print_r($newAlert->getErrors());\n }\n}", "public final function save() {\n }", "public function store(AlertFormRequest $request)\n {\n $data = $request->getData($request);\n\n Alert::create($data);\n\n return redirect()->route('alert.index')->withSuccess('You have successfully created a Category!');\n }", "public final function save()\n {\n }", "protected function save_alerts_user($alert_id, $user_id) {\n\n // Create user's activity for alert\n $user_activity = array(\n 'alert_id' => $alert_id,\n 'user_id' => $user_id,\n 'page_seen' => 0,\n 'deleted' => 0,\n 'updated' => time(),\n 'created' => time()\n );\n\n // Save the alert's user\n if ( $this->CI->base_model->insert('notifications_alerts_users', $user_activity) ) {\n return true;\n } else {\n return false;\n }\n \n }", "public function process(Alert $alert, $date) {\n $alert->store();\n\n // Log a creation entry.\n $log = new AlertLog();\n $log['alert_id'] = $alert['id'];\n $log['action'] = AlertLog::A_CREATE;\n $log->store();\n\n $this->client->update($alert);\n }", "function save()\n\t{\n\t\t$this->store() ;\n\t\t$link = 'index.php?option=com_arts_curriculum';\n\t\t$this->setRedirect( $link, $this->msg);\n\t}", "public function store(Request $request)\n {\n\n $validatedData = $request->validate([\n 'AlertDateEvent' => 'after_or_equal:AlertDateNotifi',\n ], ['AlertDateEvent.after_or_equal' => 'El campo Fecha Evento debe ser una fecha posterior o igual a Fecha de notificación.'\n ]);\n\n /*return $request;*/\n $alert = new Alerts();\n $alert->AlertName = $request->input('AlertName');\n $alert->AlertDateEvent = $request->input('AlertDateEvent');\n $alert->AlertDescription = $request->input('AlertDescription');\n $alert->AlertDateNotifi = $request->input('AlertDateNotifi');\n $alert->AlertType = $request->input('AlertType');\n $alert->AlertNotification = 0;\n $alert->AlertRealizado = 0;\n $alert->AlertPercentage = 100;\n $alert->user_id = Auth::user()->id;\n $alert->save();\n\n $usuario = User::where('id', $alert->user_id)->first();\n $areadelusuario = Areas::where('id', $usuario->areas_id)->first();\n $jefearea = User::with(['areas', 'roles' => function ($query) {\n $query->where('name', 'JefeArea');\n }])\n ->role('JefeArea')\n ->where('areas_id', $areadelusuario->id)->first();\n\n switch ($alert->AlertType) {\n case 'Global':\n Mail::to(User::all())->queue(new NewAlert($alert));\n break;\n\n case 'Sede':\n $areaUsuario = Areas::where('id', Auth::user()->id)->first();\n $areasdeSede = Areas::where('AreaSede', $areaUsuario->AreaSede)->get('id');\n $destinatariosSede = User::whereIn('areas_id', $areasdeSede)\n ->with('areas')\n ->get();\n Mail::to($destinatariosSede)->queue(new NewAlert($alert));\n break;\n\n case 'Area':\n $area = Areas::where('id', Auth::user()->id)->with('users')->first();\n Mail::to($area->users)->queue(new NewAlert($alert));\n break;\n\n case 'Personal':\n Mail::to($request->user())->queue(new NewAlert($alert));\n break;\n \n default:\n Mail::to($request->user())->queue(new NewAlert($alert));\n break;\n }\n\n return redirect()->route('alerts.index')->withStatus(__('Alerta creada correctamente'));\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function savealert($employerid , $message , $title, $applicantId)\n{\n$query = mysql_query(\"INSERT INTO `gs_alerts`(`id`, `userid`,`applicant_id`, `message`, `title`, `date_alerted`) VALUES ('','$employerid','$applicantId','$message','$title',CURDATE())\");\n\nif($query){\n return 1;\n}else \nreturn 2;\n\n}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function store(Request $request)\n {\n // INTRODUIR ALERTANTS BASE DE DADES-----------------------------------------------\n\n $id_tipus_alertant = $request->input('tipusAlertant');\n $id_alertant = null;\n\n if($id_tipus_alertant == 1){\n $id_alertant = $request->input('centreSanitari');\n } else if($id_tipus_alertant == 2){\n $alertant = new Alertant();\n $alertant->nom = \"Dades de l'afectat\";\n $alertant->tipus_alertant_id = $id_tipus_alertant;\n $alertant->save();\n $alertant = Alertant::find($alertant->id);\n $id_alertant = $alertant->id;\n\n }else{\n if($request->input('nomAlertant') || $request->input('cognomAlertant') || $request->input('telefonAlertant')) {\n\n $alertant = new Alertant();\n\n $alertant->nom = $request->input('nomAlertant');\n $alertant->cognoms = $request->input('cognomAlertant');\n $alertant->adreca = $request->input('adreçaAlertant');\n $alertant->municipis_id = $request->input('municipiAlertant');\n $alertant->telefon = $request->input('telefonAlertant');\n $alertant->tipus_alertant_id = $request->input('tipusAlertant');\n $alertant->save();\n $alertant = Alertant::find($alertant->id);\n $id_alertant = $alertant->id;\n }\n }\n\n // INTRODUIR NOVA INCIDENCIA A LA BASE DE DADES------------------------------------\n $incidencia = new Incidencia();\n\n $incidencia->localitzacio = $request->input('localitzacioIncidencia');\n\n\n $incidencia->num_incidencia = rand( 100000 , 999999 );\n\n $incidencia->telefon_alertant = $request->input('telefonIncidencia');\n $incidencia->data = $request->input('dataIncidencia');\n $incidencia->hora = $request->input('horaIncidencia');\n $incidencia->adreca = $request->input('adreçaIncidencia');\n $incidencia->complement_adreca = $request->input('indicacionsIncidencia');\n $incidencia->descripcio = $request->input('descripcioIncidencia');\n\n $incidencia->municipis_id = $request->input('municipiIncidencia');\n $incidencia->tipus_incident_id = $request->input('tipusIncidencia');\n $incidencia->estats_incidencia_id = $request->input('estatIncidencia');\n $incidencia->tipus_alertant_id = $request->input('tipusAlertant');\n $incidencia->alertants_id = $id_alertant;\n\n $incidencia->save();\n $user = Auth::user();\n $incidencia->usuari()->save($user);\n\n // INTRODUIR AFECTATS BASE DE DADES--------------------------------------------\n\n $numAfectats = $request->input('numAfectats');\n\n for($i = 1; $i <= $numAfectats; $i++){\n\n $afectat_tarjeta = $request->input(('tenir_tarjeta').$i);\n $afectat = null;\n\n if($afectat_tarjeta == 0 || !$request->input(('CipAfectat').$i)){\n if($request->input(('nomAfectat').$i) && $request->input(('cognomAfectat').$i)){\n $afectat = Afectat::where('nom', $request->input(('nomAfectat').$i))\n ->where('cognoms', $request->input(('cognomAfectat').$i))->first();\n if(!$afectat){\n $afectat = new Afectat();\n $afectat->nom = $request->input(('nomAfectat').$i);\n $afectat->cognoms = $request->input(('cognomAfectat').$i);\n\n }\n $afectat->cip = null;\n $afectat->telefon = $request->input(('telefonAfectat').$i);\n $afectat->sexe = $request->input(('sexeAfectat').$i);\n $afectat->edat = $request->input(('edatAfectat').$i);\n $afectat->tenir_tarjeta = $afectat_tarjeta;\n $afectat->municipis_id = $request->input(('municipiAfectat').$i);\n $afectat->save();\n }\n }\n else{\n $afectat = Afectat::where('cip', $request->input(('CipAfectat').$i))->first();\n if(!$afectat){\n if($request->input(('nomAfectat').$i) && $request->input(('cognomAfectat').$i)){\n $afectat = Afectat::where('nom', $request->input(('nomAfectat').$i))\n ->where('cognoms', $request->input(('cognomAfectat').$i))->first();\n if(!$afectat){\n $afectat = new Afectat();\n $afectat->nom = $request->input(('nomAfectat').$i);\n $afectat->cognoms = $request->input(('cognomAfectat').$i);\n\n }\n }\n\n $afectat->cip = $request->input(('CipAfectat').$i);\n }\n $afectat->nom = $request->input(('nomAfectat').$i);\n $afectat->cognoms = $request->input(('cognomAfectat').$i);\n $afectat->telefon = $request->input(('telefonAfectat').$i);\n $afectat->sexe = $request->input(('sexeAfectat').$i);\n $afectat->edat = $request->input(('edatAfectat').$i);\n $afectat->tenir_tarjeta = $afectat_tarjeta;\n $afectat->municipis_id = $request->input(('municipiAfectat').$i);\n $afectat->save();\n\n }\n if($afectat){\n $afectatsIncidencia = $incidencia->afectats()->get();\n\n $trobat = false;\n foreach($afectatsIncidencia as $afectatIn){\n if($afectatIn->id == $afectat->id){\n $trobat=true;\n }\n }\n if(!$trobat){$incidencia->afectats()->save($afectat);}\n }\n\n }\n\n // INTRODUIR RECURSOS BASE DE DADES--------------------------------------------\n $numRecursos = $request->input('numRecursos');\n\n for($i = 1; $i <= $numRecursos; $i++){\n\n $codi = $request->input('CodiRecurs'.$i);\n\n $recurs = RecursMobil::where('codi', $codi)->first();\n\n $incidencia->recursosMobils()->attach($recurs,\n [\n 'prioritat' =>$request->input('prioritat'.$i),\n 'hora_acitvacio' => $request->input('hActivacio'.$i),\n 'hora_mobilitzacio' => $request->input('hMovilitzacio'.$i),\n 'hora_assistencia' => $request->input('hAssistencia'.$i),\n 'hora_transport' => $request->input('hTransport'.$i),\n 'hora_arribada_hospital' => $request->input('hArribada'.$i),\n 'hora_transferencia' => $request->input('hTransferencia'.$i),\n 'hora_finalitzacio' => $request->input('hFinalització'.$i)\n ]);\n }\n\n // QUAN ACABEM D'INTRODUIR LES DADES REDIRECCIONEM AL INDEX------------------------------\n return redirect()->action('IncidenciaController@index');\n\n }", "public function save()\n {\n }", "public function save()\r\n {\r\n \r\n }", "public function save() {\n $questionId = request('question');\n $answerTitle = request('answer_title');\n\n $answer = new Answer();\n $answer->question_id = $questionId;\n $answer->title = $answerTitle;\n $answer->save();\n\n return redirect('/poll/answers?question=' . $questionId);\n }", "public function action_save()\n {\n // clear old reject info\n $this->setRejectInfo(null);\n\n if (isset($this->m_partial) && !empty($this->m_partial)) {\n $this->partial($this->m_partial);\n\n return;\n } else {\n $this->doSave();\n }\n }", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function setAlert($solicitud, $alert){\n\t\t$this->solicitudes_model->setAlert($solicitud, $alert);\n\t}", "public function store(CoinPriceAlertRequest $request)\n {\n $validatedData = $request->validated();\n $newAlert = $request->user()->coinPriceAlerts()->create($validatedData);\n return response()->json([\n 'status' => 'Success',\n 'id' => $newAlert->id\n ], 201);\n }", "public function save() {\n\t\t\t\n\t\t}", "public function save ()\n {\n $this->objMysql->_insert (\"calendar.calendar_holidays\", [\n \"CALENDAR_UID\" => $this->calendar_uid,\n \"CALENDAR_HOLIDAY_NAME\" => $this->calendar_holiday_name,\n \"CALENDAR_HOLIDAY_START\" => $this->calendar_holiday_start,\n \"CALENDAR_HOLIDAY_END\" => $this->calendar_holiday_end\n ]\n );\n }", "public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('traineecert')) {\n try {\n $data = $this->_filterDates($data, array('issue_date'));\n $traineecert = $this->_initTraineecert();\n $traineecert->addData($data);\n $traineecert->save();\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.'.$this->getJsObjectName().'.reload(); window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_traineecert')->__('Trainee Certificate was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $traineecert->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setTraineecertData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineecert')->__('There was a problem saving the trainee certificate.')\n );\n Mage::getSingleton('adminhtml/session')->setTraineecertData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineecert')->__('Unable to find trainee certificate to save.')\n );\n $this->_redirect('*/*/');\n }", "public function store(Request $request)\n {\n $salesAlert = new SalesAlert();\n $salesAlert->department = $request->get('department');\n $salesAlert->start_time = $request->get('start_time');\n $salesAlert->end_time = $request->get('end_time');\n $salesAlert->year = $request->get('year');\n $salesAlert->month = $request->get('month');\n $salesAlert->sales = $request->get('sales');\n $salesAlert->week = $request->get('week');\n $salesAlert->marketing_expenses = $request->get('marketing_expenses');\n $salesAlert->creatrd_user = Auth::user()->name;\n\n if ($salesAlert->save()) {\n $request->session()->flash('success_message','Set SalesAlert Success');\n return redirect('salesAlert');\n } else {\n $request->session()->flash('error_message','Set SalesAlert Failed');\n return redirect()->back()->withInput();\n }\n }", "public function actionSave()\n\t{\n\t\t$redirect = parent::actionSave();\n\t\t\n\t\tif (!empty($redirect))\n\t\t{\n\t\t\t// send bookmark alert\n\t\t\t$postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);\n\t\t\t$bookmarksModel = $this->_getBookmarksModel();\n\t\t\t$bookmarksModel->sendBookmarkAlerts('post', $postId, 'content_edit', 'edit');\n\t\t}\n\t\t\n\t\treturn $redirect;\n\t}", "public function save() {\n \n $fields = array(\"id\", \"title\", \"largeimage\", \"description\", \"credits\", \"activitypoints\", \"activitypointstype\", \"expirydays\", \"enabled\", \"items\");\n \n foreach ($fields as $value)\n {\n if (!isset($_POST[$value]))\n {\n $this->load_view('housekeeping/response');\n $this->view->data->status = \"Error\";\n $this->view->data->alert_type = \"important\";\n $this->view->data->error = \"Unexpected error occured!\";\n $this->view->publish();\n return;\n }\n else if ($_POST[$value] == \"\")\n {\n $this->load_view('housekeeping/response');\n $this->view->data->status = \"Error\";\n $this->view->data->alert_type = \"important\";\n $this->view->data->error = \"You left a field blank!\";\n $this->view->publish();\n return;\n }\n }\n \n $daysUntilExpiry = (time() + (86400 * intval($_POST['expirydays'])));\n \n //R::exec(\"UPDATE site_articles SET article_name = ?, article_topstory = '/c_images/Top_Story_Images/\" . $_POST[\"topstory\"] . \"', article_description = ?, article_story = ? WHERE id = \". $_POST[\"id\"], array($_POST[\"name\"], $_POST[\"description\"], $_POST[\"story\"]));\n \n R::exec(\"UPDATE targeted_offers SET title = ?, description = ?, credits = ?, activity_points = ?, activity_points_type = ?, large_image = ?, expire_time = ?, enabled = ?, items = ? WHERE id = ?\", array($_POST[\"title\"], $_POST[\"description\"], $_POST[\"credits\"], $_POST[\"activitypoints\"], $_POST[\"activitypointstype\"], \"targetedoffers/\" . $_POST[\"largeimage\"], $daysUntilExpiry, $_POST[\"enabled\"], $_POST[\"items\"], $_POST['id']));\n \n MUS(\"reloadoffers\", \"\");\n \n $this->load_view('housekeeping/response');\n $this->view->data->status = \"Success\";\n $this->view->data->alert_type = \"success\";\n $this->view->data->error = \"Targeted offer is saved!\";\n $this->view->publish();\n }", "public function _insert_alert($info){\n global $dbconn, $config;\n $data = array( \"zabbix_eventid\" => intval($info['eventid']),\n\t\t\t\t\t\t\t\"is_ack\" => new MongoInt32($info['acknowledged']),\n\t\t\t\t\t\t\t\"zbx_host\" => $info['host'],\n\t\t\t\t\t\t\t\"zabbix_hostid\" => intval($info['hostid']),\n\t\t\t\t\t\t\t\"zabbix_server_id\" => (((intval($info['hostid']) - 10000) * 256) + 2),\n\t\t\t\t\t\t\t\"alert_message\" => $info['msg'],\n\t\t\t\t\t\t\t\"zabbix_trigger_description\" => $info['msg'],\n \"is_show\" => new MongoInt32(SHOW),\n\t\t\t\t\t\t\t\"clock\" => intval($info['clock']),\n\t\t\t\t\t\t\t\"create_date\" => intval($info['clock']),\n\t\t\t\t\t\t\t\"priority\" => new MongoInt32($info['priority']),\n\t\t\t\t\t\t\t\"zabbix_trigger_priority\" => new MongoInt32($info['priority']),\n\t\t\t\t\t\t\t\"source_from\" => SRC_FRM_ZABBIX,\n\t\t\t\t\t\t\t\"source_id\" => $info['triggerid'],\n\t\t\t\t\t\t\t\"zbx_zabbix_server_id\" => new MongoInt32(2),\n\t\t\t\t\t\t\t\"zbx_maintenance\" => new MongoInt32(0),\n\t\t\t\t\t\t\t\"level\" => new MongoInt32(0),\n\t\t\t\t\t\t\t\"num_of_case\" => new MongoInt32(0),\n\t\t\t\t\t\t\t\"zabbix_version\" => \"1.8\",\n\t\t\t\t\t\t\t\"ack_msg\" => \"\",\n\t\t\t\t\t\t\t\"affected_deals\" => \"\",\n\t\t\t\t\t\t\t\"attachments\" => \"\",\n\t\t\t\t\t\t\t\"description\" => \"\",\n\t\t\t\t\t\t\t\"external_status\" => \"\",\n\t\t\t\t\t\t\t\"internal_status\" => \"\",\n\t\t\t\t\t\t\t\"itsm_incident_id\" => \"\",\n\t\t\t\t\t\t\t\"ticket_id\" => \"\",\n\t\t\t\t\t\t\t\"title\" => \"\",\n\t\t\t\t\t\t\t\"update_date\" => \"\"\n );\n InsertAll($data,ZABBIX_MONITOR_ALERT_TABLE);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $holiday = Holidays::findFirstByid($id);\n\n if (!$holiday) {\n $this->flash->error(\"holiday does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $holiday->date = $this->request->getPost(\"date\");\n $holiday->name = $this->request->getPost(\"name\");\n \n\n if (!$holiday->save()) {\n\n foreach ($holiday->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'edit',\n 'params' => [$holiday->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Запись успешно изменена\");\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n }", "protected function save_alerts_field($alert_id, $name, $value, $extra=NULL, $language=NULL) {\n\n // Prepare the field\n $field_args = array(\n 'alert_id' => $alert_id,\n 'field_name' => $name,\n 'field_value' => $value\n );\n\n // Verify if extra exists\n if ( $extra !== NULL ) {\n\n // Set the field's extra\n $field_args['field_extra'] = $extra;\n\n }\n\n // Verify if language exists\n if ( $language !== NULL ) {\n\n // Set the field's language\n $field_args['language'] = $language;\n\n } \n\n // Save the message's field\n if ( $this->CI->base_model->insert('notifications_alerts_fields', $field_args) ) {\n return true;\n } else {\n return false;\n }\n \n }", "function save()\n\t{\n\n\t\t$db =JFactory::getDBO();\n\t\t$db->setQuery('select * from #__pbbooking_customfields');\n\t\t$customfields = $db->loadObjectList();\t\t\n\t\t$db->setQuery('select * from #__pbbooking_config');\n\t\t$config = $db->loadObject();\n\t\t\n\t\t//load up the appointment data in an array.\n\t\t$data = array();\n\t\t$error = false;\n\t\tforeach ($customfields as $field) {\n\t\t\tif (JRequest::getVar($field->varname)) {\n\t\t\t\t$data[$field->varname] = is_array(JRequest::getVar($field->varname)) ? implode('|',JRequest::getVar($field->varname)) : JRequest::getVar($field->varname);\n\t\t\t} else if ($field->is_required == 1) {\n\t\t\t\t$error = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['treatment_id'] = JRequest::getInt('treatment_id',0);\n\t\t$data['date'] = JRequest::getVar('date',\"\");\n\t\t$data['treatment_time'] = JRequest::getVar('treatment_time');\n\t\t$data['cal_id'] = JRequest::getInt('cal_id');\n\t\t\n\t\t//redirect on error or missing data\n\t\tif ($error || $data['treatment_id'] == 0 || $data['date'] == \"\" || $data['treatment_time'] == \"\") {\n\t\t\t$this->setRedirect('index.php?option=com_pbbooking',JText::_('COM_PBBOOKING_MISSING_DATA'));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t//verify the appointment is actually available \n\t\t$valid = Pbbookinghelper::valid_appointment($data);\n\t\tif ($valid) {\n\t\t\t//create pending event and email user\n\t\t\t$pending_id = Pbbookinghelper::save_pending_event($data);\n\t\t\tif ($pending_id) {\n\t\t\t\t$data['pending_id'] = $pending_id;\n\n\t\t\t\tPbbookinghelper::email_user($data);\n\t\t\t\t\n\t\t\t\t//now redirect - load up the view\n\t\t\t\t$view = $this->getView('PBBooking','html');\n\t\t\t\t$view->setLayout('success');\n\t\t\t\t\n\t\t\t\t//populate needed data into the view.\n\t\t\t\t$db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($data['treatment_id']));\n\t\t\t\t$view->service = $db->loadObject();\n\t\t\t\t$view->config = $config;\n\t\t\t\t$db->setQuery('select * from #__pbbooking_pending where id = '.$db->escape($pending_id));\n\t\t\t\t$view->pending = $db->loadObject();\n\n\t\t\t\t//display the view\n\t\t\t\t$view->display();\t\t \t\n\t\t\t} else {\n\t\t\t\t$this->setRedirect('index.php/option=com_pbbooking',JText::_('COM_PBBOOKING_BOOKING_PROBLEM'));\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t$this->setRedirect('index.php/option=com_pbbooking',JText::_('COM_PBBOOKING_BOOKING_PROBLEM'));\n\t\t}\n\t}", "function Save()\r\n\t{\r\n\t\t$connection = Database::Connect();\r\n\t\t$this->pog_query = \"select `specialofferid` from `specialoffer` where `specialofferid`='\".$this->specialofferId.\"' LIMIT 1\";\r\n\t\t$rows = Database::Query($this->pog_query, $connection);\r\n\t\tif ($rows > 0)\r\n\t\t{\r\n\t\t\t$this->pog_query = \"update `specialoffer` set \r\n\t\t\t`title`='\".$this->Escape($this->title).\"', \r\n\t\t\t`link`='\".$this->Escape($this->link).\"', \r\n\t\t\t`content`='\".$this->Escape($this->content).\"', \r\n\t\t\t`days`='\".$this->Escape($this->days).\"', \r\n\t\t\t`supplierid`='\".$this->Escape($this->supplierId).\"', \r\n\t\t\t`status`='\".$this->status.\"', \r\n\t\t\t`date`='\".$this->date.\"', \r\n\t\t\t`dateend`='\".$this->dateEnd.\"' where `specialofferid`='\".$this->specialofferId.\"'\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->pog_query = \"insert into `specialoffer` (`title`, `link`, `content`, `days`, `supplierid`, `status`, `date`, `dateend` ) values (\r\n\t\t\t'\".$this->Escape($this->title).\"', \r\n\t\t\t'\".$this->Escape($this->link).\"', \r\n\t\t\t'\".$this->Escape($this->content).\"', \r\n\t\t\t'\".$this->Escape($this->days).\"', \r\n\t\t\t'\".$this->Escape($this->supplierId).\"', \r\n\t\t\t'\".$this->status.\"', \r\n\t\t\t'\".$this->date.\"', \r\n\t\t\t'\".$this->dateEnd.\"' )\";\r\n\t\t}\r\n\t\t$insertId = Database::InsertOrUpdate($this->pog_query, $connection);\r\n\t\tif ($this->specialofferId == \"\")\r\n\t\t{\r\n\t\t\t$this->specialofferId = $insertId;\r\n\t\t}\r\n\t\treturn $this->specialofferId;\r\n\t}", "public abstract function save();", "public function save()\n\t{\n\n\t}", "public function store(Request $request)\n {\n \n $this->validate(\n $request,\n [\n 'title' => 'required',\n 'vaccination_id' => 'required',\n 'start_date' => 'required',\n 'end_date' => 'required',\n 'start_time' => 'required',\n 'end_time' => 'required',\n ]\n );\n $vaccination_alert = new Vaccination_alert();\n $vaccination_alert ->title = $request->title;\n $vaccination_alert ->vaccination_id = $request->vaccination_id;\n $vaccination_alert ->start_date = $request->start_date;\n $vaccination_alert ->end_date = $request->end_date;\n $vaccination_alert ->start_time = $request->start_time;\n $vaccination_alert ->end_time = $request->end_time;\n $vaccination_alert ->url = $request->url;\n $vaccination_alert ->alert_parents = $request->alert_parents;\n $vaccination_alert ->save();\n Session::flash('message','Vaccination Alert Created Successfully'); \n return Redirect::back();\n }", "public function adsaveAction() {\n\t// Received Parameter from JS file.\n\t$adCancelReasion = (string) $this->_getParam('adCancelReasion');\n\t$adsId = (string) $this->_getParam('adsId');\n\t// Decode a ad id\n\t$adsId = Engine_Api::_()->communityad()->getEncodeToDecode($adsId);\n\t$adDescription = (string) $this->_getParam('adDescription');\n\t//Insert entry in the data base.\n\t$viewerId = Engine_Api::_()->user()->getViewer()->getIdentity();\n\t$adcancelTable = Engine_Api::_()->getItemTable('communityad_adcancel');\n\t$adcancelList = $adcancelTable->createRow();\n\t$adcancelList->user_id = $viewerId;\n\t$adcancelList->report_type = $adCancelReasion;\n\tif (!empty($adDescription)) {\n\t $adcancelList->report_description = $adDescription;\n\t}\n\t$adcancelList->ad_id = $adsId;\n\t$adcancelList->save();\n\t$this->view->showMsg = 1;\n }", "function save();", "function save();", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function save() {\n }", "public function save() {\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function save()\n {\n // For V2.0\n }", "function SaveNew()\r\n\t{\r\n\t\t$this->specialofferId = '';\r\n\t\treturn $this->Save();\r\n\t}", "public function save() {\n }", "public function save()\r\n {\r\n //\r\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 }", "protected function _createAlertItem()\n {\n $alert = $this->_helper->createAlert(\n array(\n 'email' => NoShipmentsAlert_Helper_Data::PATH_EMAIL,\n 'identity' => NoShipmentsAlert_Helper_Data::PATH_IDENTITY,\n 'alert_template' => NoShipmentsAlert_Helper_Data::PATH_ALERT_TEMPLATE,\n 'alert_time' => NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n 'alert_type' => NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n 'store_id' => $this->_storeId\n )\n );\n\n return $alert;\n }", "public function actionSetStatut($idAlert,$statut)\n {\n $alert = \\Business\\Alert::loadById($idAlert);\n echo \"Alert : \".$alert->id;\n echo \" Old statut : \".$alert->statut;\n $alert->statut= $statut;\n if ($alert->save()){\n echo \" new statut : \".$alert->statut;\n }else{\n echo \"error while savin the alert\";\n }\n\n }", "public function save()\n {\n parent::save();\n $warningBlock = $this->browser->find($this->warningBlock);\n if ($warningBlock->isVisible()) {\n $warningBlock->click();\n }\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function actionCreateAlertUser($idAlert, $idUser, $action)\n {\n $date = new DateTime('now');\n $newAlertUser = new \\Business\\AlertUser();\n $newAlertUser->idAlert = $idAlert;\n $newAlertUser->idUser = $idUser;\n $newAlertUser->creationDate = $date->format('Y-m-d H:i:s');\n $newAlertUser->action = $action;\n\n if ($newAlertUser->save()) {\n print_r(\"OK! Saved.\");\n } else {\n echo '<pre>';\n print_r($newAlertUser->attributes);\n }\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "function save(){\n\t\t$id_po = $this->Frmmpo->insert($this->input->post());\n\t\t$no_po = $this->input->post('no_po');\n\t\t$jenis_pesanan = $this->input->post('sumber_dana');\n\t\t$supplier_id = $this->input->post('supplier_id');\n $supplier = $this->Frmmpo->getNamaSupplier($supplier_id);\n\n\t\tif ( $id_po != '' ){\n\t\t\t$msg = \t' <div class=\"alert alert-success alert-dismissable\">\n\t\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>\n\t\t\t\t\t\t<i class=\"icon fa fa-check\"></i>Data PO berhasil disimpan\n\t\t\t\t\t </div>';\n\t\t}else{\t\t\t\t\n\t\t\t$msg = \t' <div class=\"alert alert-danger alert-dismissable\">\n\t\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>\n\t\t\t\t\t\t<i class=\"icon fa fa-ban\"></i>Data PO gagal disimpan\n\t\t\t\t\t </div>';\n\t\t}\n $this->session->set_flashdata('alert_msg', $msg);\n $this->cetak_faktur($id_po, $no_po, $jenis_pesanan, $supplier->adress);\n $this->session->set_flashdata('cetak', 'cetak('.$id_po.');');\n redirect('logistik_farmasi/Frmcpo/form');\n\t\t\n }", "function save()\n {\n }", "function save()\n {\n }", "public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\n\t\t$this->db->query('UPDATE `'.$table_prefix.'indicator_lang` SET indicator_title = ?, indicator_description = ? WHERE indicator_id = ? AND locale = ?',\n\t\t\t$this->indicator_title, $this->indicator_description, $this->id, $this->locale\n\t\t);\n\t}", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "protected function save(): void\n\t{\n\t\t$this->session->set($this->flashKey, $this->flashRecord);\n\t}", "function createNewAlert($title, $text){\r\n //$GLOBALS['link'] = connect();\r\n mysqli_query($GLOBALS['link'], 'insert into alerts(`title`, `text`) values(\"'. $title .'\", \"'. $text.'\");');\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "public function update(Request $request, Alerts $alert)\n {\n $validatedData = $request->validate([\n 'AlertDateEvent' => 'after_or_equal:AlertDateNotifi',\n ], ['AlertDateEvent.after_or_equal' => 'El campo Fecha Evento debe ser una fecha posterior o igual a Fecha de notificación.'\n ]);\n\n $alert->update($request->all());\n return redirect()->route('alerts.index')->withStatus(__('Alerta actualizada correctamente'));\n }", "public function save()\n {\n }", "public function save()\n {\n }", "static public function ctrAgregarAlerta(){\n\n\t\tif(isset($_POST[\"nuevaAccion\"])){\n\n\t\t\tif(isset($_POST[\"nuevaAccion\"])){\n\n\n\t\t\t\t$tabla = \"alarmas\";\n\n\t\t\t\t$datos = array(\"idAlerta\" => $_POST[\"idAlerta\"],\n\t\t\t\t\t\t\t\t \"accion\" => $_POST[\"nuevaAccion\"]);\n\n\t\t\t\t$respuesta = ModeloAccionAlertas::mdlIngresarAlerta($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario ha sido editado correctamente\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t}).then(function(result) {\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"listadoAlertas\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\ttitle: \"¡El nombre no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t}).then(function(result) {\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"listadoAlertas\";\n\n\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}\n\n\t\t}\n\n\t}", "function save(){\r\n\t\tglobal $wpdb;\r\n\t\t$table = EM_TICKETS_BOOKINGS_TABLE;\r\n\t\tdo_action('em_ticket_booking_save_pre',$this);\r\n\t\t//First the person\r\n\t\tif($this->validate()){\t\t\t\r\n\t\t\t//Now we save the ticket\r\n\t\t\t$this->booking_id = $this->get_booking()->id; //event wouldn't exist before save, so refresh id\r\n\t\t\t$data = $this->to_array(true); //add the true to remove the nulls\r\n\t\t\tif($this->id != ''){\r\n\t\t\t\t$where = array( 'ticket_booking_id' => $this->id ); \r\n\t\t\t\t$result = $wpdb->update($table, $data, $where, $this->get_types($data));\r\n\t\t\t\t$this->feedback_message = __('Changes saved','dbem');\r\n\t\t\t}else{\r\n\t\t\t\t//TODO better error handling\r\n\t\t\t\t$result = $wpdb->insert($table, $data, $this->get_types($data));\r\n\t\t\t $this->id = $wpdb->insert_id; \r\n\t\t\t\t$this->feedback_message = __('Ticket booking created','dbem'); \r\n\t\t\t}\r\n\t\t\tif( $result === false ){\r\n\t\t\t\t$this->feedback_message = __('There was a problem saving the ticket booking.', 'dbem');\r\n\t\t\t\t$this->errors[] = __('There was a problem saving the ticket booking.', 'dbem');\r\n\t\t\t}\r\n\t\t\treturn apply_filters('em_ticket_booking_save', ( count($this->errors) == 0 ), $this);\r\n\t\t}else{\r\n\t\t\t$this->feedback_message = __('There was a problem saving the ticket booking.', 'dbem');\r\n\t\t\t$this->errors[] = __('There was a problem saving the ticket booking.', 'dbem');\r\n\t\t\treturn apply_filters('em_ticket_booking_save', false, $this);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function test_save() {\n global $DB;\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n // Check existance.\n self::$event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage)\",\n ['idoutage' => self::$outage->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertTrue(is_object(self::$event));\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('ifeedback')) {\n try {\n $ifeedback = $this->_initIfeedback();\n $ifeedback->addData($data);\n $ifeedback->save();\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.'.$this->getJsObjectName().'.reload(); window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_kst')->__('Instructor Feedback was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $ifeedback->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('There was a problem saving the instructor feedback.')\n );\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('Unable to find instructor feedback to save.')\n );\n $this->_redirect('*/*/');\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $employee = Employee::findFirstByid($id);\n\n if (!$employee) {\n $this->flash->error(\"employee does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $employee->id = $this->request->getPost(\"id\");\n $employee->name = $this->request->getPost(\"name\");\n $employee->surename = $this->request->getPost(\"surename\");\n $employee->patronymic = $this->request->getPost(\"patronymic\");\n $employee->position = $this->request->getPost(\"position\");\n $employee->departmentId = $this->request->getPost(\"department_id\");\n \n\n if (!$employee->save()) {\n\n foreach ($employee->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'edit',\n 'params' => [$employee->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"employee was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('handovertwo')) {\n try {\n $handovertwo = $this->_initHandovertwo();\n $handovertwo->addData($data);\n $handovertwo->save();\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_handover')->__('Minutes of Handover V2 was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $handovertwo->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setHandovertwoData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_handover')->__('There was a problem saving the minutes of handover v2.')\n );\n Mage::getSingleton('adminhtml/session')->setHandovertwoData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_handover')->__('Unable to find minutes of handover v2 to save.')\n );\n $this->_redirect('*/*/');\n }", "public function store(Request $request)\n {\n //\n $e = new Pointsmaster();\n $e->reason = $request->get('reason');\n $e->value = $request->get('value');\n $e->save();\n\n alert()->Success('New Point Value Added')->autoclose(2000);\n return redirect(action('SettingsController@index'));\n }", "public function save()\n\t{\n\t\tvalidateToken('admin-ssc');\n\n\t\t$this->adapter->save();\n\t}", "public function save()\n {\n parent::save();\n\n $soxId = $this->getEditObjectId();\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n // shopid\n $sShopID = oxRegistry::getSession()->getVariable(\"actshop\");\n $aParams['oxarticles__oxshopid'] = $sShopID;\n\n $oArticle = oxNew(\"oxarticle\");\n $oArticle->loadInLang($this->_iEditLang, $soxId);\n\n $oArticle->setLanguage(0);\n\n // checkbox handling\n if (!$oArticle->oxarticles__oxparentid->value && !isset($aParams['oxarticles__oxremindactive'])) {\n $aParams['oxarticles__oxremindactive'] = 0;\n }\n\n $oArticle->assign($aParams);\n\n //tells to article to save in different language\n $oArticle->setLanguage($this->_iEditLang);\n $oArticle = oxRegistry::get(\"oxUtilsFile\")->processFiles($oArticle);\n\n $oArticle->resetRemindStatus();\n\n $oArticle->updateVariantsRemind();\n\n $oArticle->save();\n }", "public function saveAction()\n {\n //the data for the thing\n $_consumerId = $this->getRequest()->getParam('consumer_id');\n \n //the post data\n $_data = $this->getRequest()->getPost();\n if ($_data) {\n $_artist = $this->_initConsumerSave();\n \n try {\n $_artist->save();\n \n $_redirectBack = false;\n $this->_getSession()->addSuccess($this->__('The consumer has been saved.'));\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage())\n ->setArtistData($_data);\n $_redirectBack = true;\n } catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()->addError($e->getMessage());\n $_redirectBack = true;\n }\n }\n \n if ($_redirectBack) {\n $this->_redirect(\n '*/*/edit', array(\n 'id' => $_consumerId,\n '_current' => true\n )\n );\n } else {\n $this->_redirect('*/*/');\n }\n }" ]
[ "0.6766544", "0.6699804", "0.666615", "0.6610759", "0.6310637", "0.61864454", "0.61687326", "0.60864913", "0.6072034", "0.6067644", "0.6042843", "0.60277516", "0.6025234", "0.6025234", "0.6024811", "0.60223955", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.59931576", "0.5979124", "0.5970654", "0.5944121", "0.5939984", "0.5939681", "0.59270805", "0.5921954", "0.59171313", "0.59065235", "0.58918935", "0.58490705", "0.58415926", "0.58263755", "0.5820195", "0.58118546", "0.58035624", "0.578771", "0.5780493", "0.5774639", "0.5772822", "0.57726806", "0.5769576", "0.57677406", "0.5758124", "0.5756091", "0.5752631", "0.5752631", "0.573676", "0.57349306", "0.57349306", "0.5726752", "0.5726752", "0.5726752", "0.5726752", "0.5726752", "0.57188964", "0.57150215", "0.5713663", "0.5694369", "0.5684466", "0.5678186", "0.56719387", "0.5666156", "0.5665274", "0.56488186", "0.5644965", "0.5636327", "0.56335455", "0.56335455", "0.5625996", "0.5620459", "0.56004936", "0.5588123", "0.55872494", "0.5586231", "0.5586231", "0.5583165", "0.55636644", "0.55447483", "0.55392605", "0.5532341", "0.5527204", "0.5525927", "0.5524382", "0.55201477", "0.5512872" ]
0.66555196
3
The protected method save_alerts_field saves an alert's field
protected function save_alerts_field($alert_id, $name, $value, $extra=NULL, $language=NULL) { // Prepare the field $field_args = array( 'alert_id' => $alert_id, 'field_name' => $name, 'field_value' => $value ); // Verify if extra exists if ( $extra !== NULL ) { // Set the field's extra $field_args['field_extra'] = $extra; } // Verify if language exists if ( $language !== NULL ) { // Set the field's language $field_args['language'] = $language; } // Save the message's field if ( $this->CI->base_model->insert('notifications_alerts_fields', $field_args) ) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_fields( $alert ) {\n\t\tcheck_admin_referer( 'save_alert', 'wp_stream_alerts_nonce' );\n\n\t\tif ( empty( $_POST['wp_stream_highlight_color'] ) ) {\n\t\t\t$alert->alert_meta['color'] = 'yellow';\n\t\t}\n\t\t$input_color = sanitize_text_field( wp_unslash( $_POST['wp_stream_highlight_color'] ) );\n\t\tif ( ! array_key_exists( $input_color, $this->get_highlight_options() ) ) {\n\t\t\t$alert->alert_meta['color'] = 'yellow';\n\t\t} else {\n\t\t\t$alert->alert_meta['color'] = $input_color;\n\t\t}\n\n\t}", "protected function hook_afterSave(){}", "function save() {\n //save the added fields\n }", "public function save()\n {\n // Quantity is reset to 1 if it's not specified, so make sure it's included\n if (count($this->updatedFields) AND !in_array('Quantity', $this->updatedFields)) {\n $this->updatedFields[] = 'Quantity';\n }\n\n // Need to save custom fields first\n $this->saveCustom();\n parent::save();\n }", "public function postSave() {}", "protected function _postSave()\r\n\t{\r\n\t}", "public function onAfterSave();", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "protected function realSave($attendee){\n /*** ****************************************************** ***\n 1: Property names must match field names in base table(s)\n 2: The following fields should only be updated by the email process\n $a->email_sent = $attendee->emailSent;\n $a->email_send_date = $attendee->emailSendDate;\n ************************************************************ ***/\n $rec = array();\n $a = null;\n try{\n $rec = entity_load($this->entityName, array($attendee->attendeeId,));\n if (empty($rec)){\n $a = entity_create($this->entityName, array('attendee_id' => $attendee->attendeeId,));\n }else{\n $a = reset($rec);\n }\n $a->event_id = $attendee->eventId;\n $a->order_id = $attendee->orderId;\n $a->ticket_class_id = $attendee->ticketClassId;\n $a->create_date = $attendee->createDate;\n $a->change_date = $attendee->changeDate;\n $a->email_address = $attendee->emailAddress;\n $a->last_name = self::no_overflow($attendee->lastName,50);\n $a->first_name = self::no_overflow($attendee->firstName,50);\n $a->category = $attendee->category;\n// $a->category_nid = $attendee->categoryNid;\n $a->order_type = $attendee->orderType;\n $a->reg_type = $attendee->regType;\n $a->region_name = $attendee->regionName;\n $a->contestant_last_name = self::no_overflow($attendee->contestantLastName,50);\n $a->contestant_first_name = self::no_overflow($attendee->contestantFirstName,50);\n $a->gender = $attendee->gender;\n $a->grade = $attendee->grade;\n $a->school = self::no_overflow($attendee->school,255);\n $a->year_of_birth = $attendee->yearOfBirth;\n $a->month_of_birth = $attendee->monthOfBirth;\n $a->day_of_birth = $attendee->dayOfBirth;\n $a->home_address_line_1 = self::no_overflow($attendee->homeAddressLine1,255);\n $a->home_address_line_2 = self::no_overflow($attendee->homeAddressLine2,255);\n $a->home_city = self::no_overflow($attendee->homeCity,100);\n $a->home_prov_state = $attendee->homeProvState;\n $a->home_postal_zip = self::no_overflow($attendee->homePostalZip,20);\n $a->home_phone_1 = self::no_overflow($attendee->homePhone1,20);\n $a->home_phone_2 = self::no_overflow($attendee->homePhone2,20);\n $a->email_consent = $attendee->emailConsent;\n $a->additional_info = self::no_overflow($attendee->additionalInfo,2500);\n $a->ts_create_date = strtotime($attendee->createDate);\n $a->ts_change_date = strtotime($attendee->changeDate);\n $a->category_nid = $this->getCategoryNodeId($attendee->category, $attendee->eventId, $attendee->language);\n $a->language = $attendee->language;\n $a->link_nid = $this->getLinkNodeId($attendee->category, $attendee->eventId, $attendee->ticketClassId, $attendee->language);\n\n $a->save();\n }catch(Exception $e){\n watchdog_exception(EBConsts::EBS_APP_NAME_MAIN, $e);\n }\n\n return $a;\n }", "function facebook_instant_articles_field_ui_fields_save($form, &$form_state) {\n // Setup some variables.\n $entity_type = $form['#entity_type'];\n $bundle = $form['#bundle'];\n $view_mode = $form['#view_mode'];\n\n // Delete previous field configuration configuration.\n db_delete('facebook_instant_articles_field_settings')\n ->condition('entity_type', $entity_type)\n ->condition('bundle', $bundle)\n ->condition('view_mode', $view_mode)\n ->execute();\n\n if (empty($form_state['layout_saved'])) {\n return;\n }\n\n $field_settings = array();\n\n // Save settings for each field.\n $fields = $form['#fbia_fields'];\n foreach ($fields as $field) {\n\n // Field settings.\n $field_values = $form_state['values']['fields'][$field];\n\n // In case the region is hidden, do not save.\n if (isset($field_values['region']) && $field_values['region'] == 'hidden') {\n continue;\n }\n\n // Build settings.\n $settings = array();\n $settings['weight'] = $field_values['weight'];\n $settings['label'] = $field_values['label'];\n $settings['format'] = $field_values['format']['type'];\n\n // Any formatter settings.\n if (isset($form_state['formatter_settings'][$field])) {\n $settings['formatter_settings'] = $form_state['formatter_settings'][$field];\n }\n\n $field_settings[$field] = $settings;\n }\n\n // Allow other modules to modify the field settings before they get saved.\n drupal_alter('facebook_instant_articles_field_settings', $field_settings, $form, $form_state);\n\n // Save the record.\n if (!empty($field_settings)) {\n $record = new stdClass();\n $record->id = $form['#export_id'];\n $record->entity_type = $entity_type;\n $record->bundle = $bundle;\n $record->view_mode = $view_mode;\n $record->settings = $field_settings;\n drupal_write_record('facebook_instant_articles_field_settings', $record);\n }\n\n // Clear the field cache.\n cache_clear_all('facebook_instant_articles_fields:', 'cache', TRUE);\n cache_clear_all('facebook_instant_articles_field_settings', 'cache');\n}", "public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }", "protected function hook_beforeSave(){}", "function socialAlertSet($opt){\n\n\tif($opt['debug']) $this->pre($opt);\n\n\t# NEW !\n\t#\n\tif($opt['id_socialalert'] == NULL){\n\t\t$this->dbQuery(\"INSERT INTO k_socialalert (socialAlertName) VALUES ('TEMP+NAME')\");\n\t\tif($opt['debug']) $this->pre($this->db_query, $this->db_error);\n\t\n\t\t$id_socialalert = $this->db_insert_id;\n\t}else{\n\t\t$id_socialalert = $opt['id_socialalert'];\n\t}\n\t$this->id_socialalert\t= $id_socialalert;\n\n\n\t# CORE\n\t#\n\t$query = $this->dbUpdate(array('k_socialalert' => $opt['core'])).\" WHERE id_socialalert=\".$id_socialalert;\n\t$this->dbQuery($query);\n\tif($opt['debug']) $this->pre(\"QUERY\", $this->db_query, \"ERROR\", $this->db_error);\n\n\t# FIELD\n\t#\n\tif(sizeof($opt['field']) > 0){\n\n\t\t# Si on utilise le KEY au lieu des ID\n\t\t$fields = $this->apiLoad('field')->fieldGet(array('socialAlert' => true));\n\t\tforeach($fields as $e){\n\t\t\t$fieldsKey[$e['fieldKey']] = $e;\n\t\t} $fields = $fieldsKey;\n\n\t\tunset($def);\n\t\t$apiField = $this->apiLoad('field');\n\n\t\tforeach($opt['field'] as $id_field => $value){\n\t\t\tif(!is_integer($id_field)) $id_field = $fields[$id_field]['id_field'];\n\t\t\t\n\t\t\tif(intval($id_field) > 0){\n\t\t\t\t$value = $apiField->fieldSaveValue($id_field, $value);\n\t\t\t\t$def['k_socialalert']['field'.$id_field] = array('value' => $value);\n\t\t\t}\n\t\t}\n\n\t\t$this->dbQuery($this->dbUpdate($def).\" WHERE id_socialalert=\".$id_socialalert);\n\t\tif($opt['debug']) $this->pre($this->db_query, $this->db_error);\n\t}\n\n\treturn true;\n}", "function wpbm_extra_field_save( $post_id ){\n\n// Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'wpbm_blog_nonce' ] ) && wp_verify_nonce( $_POST[ 'wpbm_blog_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n// Exits script depending on save status\n if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {\n return;\n }\n if ( isset( $_POST[ 'wpbm_extra_option' ] ) ) {\n\n $wpbm_extra = ( array ) $_POST[ 'wpbm_extra_option' ];\n\n $extra_field = $this -> sanitize_array( $wpbm_extra );\n// save data\n update_post_meta( $post_id, 'wpbm_extra_option', $extra_field );\n }\n return;\n }", "public function save($bean, $params, $field, $properties, $prefix = '') {\n $GLOBALS['log']->debug(\"DotbFieldAddSurveyPagefield::save() function called.\");\n parent::save($bean, $params, $field, $properties, $prefix);\n }", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\n\t}", "protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\r\n\t}", "public function saveCustomFields()\n\t{\n\t\t$state = $this->getStateVariables();\n\t\t$validation = $this->getValidation();\n\n\t\t$user = JFactory::getUser();\n\t\t$user = $this->getState('user', $user);\n\n\t\t// Find an existing record\n\t\t$list = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->user_id($user->id)\n\t\t\t->getItemList();\n\n\t\tif(!count($list)) {\n\t\t\t$id = 0;\n\t\t} else {\n\t\t\t$thisUser = array_pop($list);\n\t\t\t$id = $thisUser->akeebasubs_user_id;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'akeebasubs_user_id' => $id,\n\t\t\t'user_id'\t\t=> $user->id,\n\t\t\t'isbusiness'\t=> $state->isbusiness ? 1 : 0,\n\t\t\t'businessname'\t=> $state->businessname,\n\t\t\t'occupation'\t=> $state->occupation,\n\t\t\t'vatnumber'\t\t=> $state->vatnumber,\n\t\t\t'viesregistered' => $validation->validation->vatnumber,\n\t\t\t// @todo Ask for tax authority\n\t\t\t'taxauthority'\t=> '',\n\t\t\t'address1'\t\t=> $state->address1,\n\t\t\t'address2'\t\t=> $state->address2,\n\t\t\t'city'\t\t\t=> $state->city,\n\t\t\t'state'\t\t\t=> $state->state,\n\t\t\t'zip'\t\t\t=> $state->zip,\n\t\t\t'country'\t\t=> $state->country,\n\t\t\t'params'\t\t=> $state->custom\n\t\t);\n\n\t\t// Allow plugins to post-process the fields\n\t\tJLoader::import('joomla.plugin.helper');\n\t\tJPluginHelper::importPlugin('akeebasubs');\n\t\t$app = JFactory::getApplication();\n\t\t$jResponse = $app->triggerEvent('onAKSignupUserSave', array((object)$data));\n\t\tif(is_array($jResponse) && !empty($jResponse)) foreach($jResponse as $pResponse) {\n\t\t\tif(!is_array($pResponse)) continue;\n\t\t\tif(empty($pResponse)) continue;\n\t\t\tif(array_key_exists('params', $pResponse)) {\n\t\t\t\tif(!empty($pResponse['params'])) foreach($pResponse['params'] as $k => $v) {\n\t\t\t\t\t$data['params'][$k] = $v;\n\t\t\t\t}\n\t\t\t\tunset($pResponse['params']);\n\t\t\t}\n\t\t\t$data = array_merge($data, $pResponse);\n\t\t}\n\n\t\t// Serialize custom fields\n\t\t$data['params'] = json_encode($data['params']);\n\n\t\t$status = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->setId($id)\n\t\t\t->getItem()\n\t\t\t->save($data);\n\n\t\treturn $status;\n\t}", "public function saveAlert(Request $request, $alert_id)\n {\n $alerta = Alerta::where(\n 'id',\n '=',\n $alert_id\n )\n ->get()->first();\n\n if ($alerta != null) {\n\n $pesquisa = Pesquisa::where(\n 'child_id',\n '=', $alerta->child_id\n )\n ->get()->first();\n\n //2- Instanciar os campos a serem atualizados\n $place_address = $request->get(\"place_address\");\n $place_cep = $request->get(\"place_cep\");\n $place_reference = $request->get(\"place_reference\");\n $place_neighborhood = $request->get(\"place_neighborhood\");\n\n //3 - Atualizar os campos instanciados no passo 2.\n $alerta->place_address = $place_address;\n $alerta->place_cep = $place_cep;\n $alerta->place_reference = $place_reference;\n $alerta->place_neighborhood = $place_neighborhood;\n\n $pesquisa->place_address = $place_address;\n $pesquisa->place_cep = $place_cep;\n $pesquisa->place_reference = $place_reference;\n $pesquisa->place_neighborhood = $place_neighborhood;\n\n $pesquisa->save(); //4 - update\n $alerta->save(); //4 - update\n\n $alerta = [\n //5 -Retorna o corpo do jason esperado no front\n \"status\" => \"SUCCESS\",\n \"message\" => \"Alerta atualizado\",\n \"data\" => $alerta //data chama o alerta atualizado\n ];\n\n return response()->json($alerta);\n\n } else { //Em caso do front enviar um id incorreto, o else retorna ERROR\n $alerta = [\n \"status\" => \"ERROR\",\n \"message\" => \"Alerta não localizada\",\n \"data\" => null,\n ];\n return response()->json($alerta);\n }\n }", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function afterCreate()\n {\n $this->saveCustomFields();\n }", "public function saveAction()\n {\n $field = '';\n $this->_initOrder();\n if (Mage::registry('current_order')->getCustomerId() != Mage::getSingleton('customer/session')->getCustomerId()) {\n $this->getResponse()->setBody('Error');\n exit;\n }\n\n /*\n * decide what form submitted: product field || order field\n * product fields have field names like: \"amProduct_%orderItemID%_%fieldID%\"\n */\n $productSubmit = strpos($this->getRequest()->getPost('field'), 'amProduct_') !== FALSE ? 1 : 0;\n // process product fields\n if ($productSubmit) {\n // extract all data from POST (stored value like \"xyz_orderItemID_FieldCode\"\n $itemData = explode('_', $this->getRequest()->getPost('field'), 3);\n $itemId = $itemData[1];\n $code = $itemData[2];\n\n // load product item data\n $fieldModel = Mage::getModel('amorderattach/field')->load($code, 'code');\n $field = Mage::getModel('amorderattach/order_products')->load($itemId, 'order_item_id');\n\n if ($fieldModel->getId()) {\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderItemId()) {\n $field->setOrderItemId($itemId);\n }\n\n $this->itemCode = $fieldModel->getItemCode($itemId);\n } else {\n die('Error on filed load: no such field found');\n }\n } else {\n $fieldModel = Mage::getModel('amorderattach/field')->load($this->getRequest()->getPost('field'), 'code');\n if ($fieldModel->getId()) {\n // load order item data\n $field = Mage::getModel('amorderattach/order_field')->load(Mage::registry('current_order')->getId(), 'order_id');\n $code = $this->getRequest()->getPost('field');\n $this->itemCode = $code;\n\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderId()) {\n $field->setOrderId(Mage::registry('current_order')->getId());\n }\n } else {\n die('Error on filed load: no such field found');\n }\n }\n\n if ('date' == $code) {\n if ($this->getRequest()->getPost('value')) {\n $data = $this->getRequest()->getPost();\n $valueToFilter = $this->_filterDates($data, array('value'));\n $itemValue = date('Y-m-d', strtotime($valueToFilter['value']));\n } else {\n $itemValue = null;\n }\n } else {\n $itemValue = $this->getRequest()->getPost('value');\n }\n // set data\n $this->itemValue = $itemValue;\n $field->setData($code, $itemValue);\n\n // save if customer can edit\n if ('edit' == $fieldModel->getCustomerVisibility()) {\n $field->save();\n } else {\n die('Error on field save: no privileges for action');\n }\n\n\n Mage::register('current_attachment_order_field', $field); // required for renderer\n $this->_sendResponse($fieldModel);\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n try {\n $this->validate($value);\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $msg = __('%1', $e->getMessage());\n $error = new \\Magento\\Framework\\Exception\\LocalizedException($msg, $e);\n throw $error;\n }\n }", "protected function callAfterSuccessfulSave()\n\t{\n\t\tforeach($this->editFields as $f)\n\t\t{\n\t\t\t$this->getControl($f, $this->id)->afterSuccessfulSave();\n\t\t}\n\t}", "function save()\n\t{\n\n\t\t$db =JFactory::getDBO();\n\t\t$db->setQuery('select * from #__pbbooking_customfields');\n\t\t$customfields = $db->loadObjectList();\t\t\n\t\t$db->setQuery('select * from #__pbbooking_config');\n\t\t$config = $db->loadObject();\n\t\t\n\t\t//load up the appointment data in an array.\n\t\t$data = array();\n\t\t$error = false;\n\t\tforeach ($customfields as $field) {\n\t\t\tif (JRequest::getVar($field->varname)) {\n\t\t\t\t$data[$field->varname] = is_array(JRequest::getVar($field->varname)) ? implode('|',JRequest::getVar($field->varname)) : JRequest::getVar($field->varname);\n\t\t\t} else if ($field->is_required == 1) {\n\t\t\t\t$error = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['treatment_id'] = JRequest::getInt('treatment_id',0);\n\t\t$data['date'] = JRequest::getVar('date',\"\");\n\t\t$data['treatment_time'] = JRequest::getVar('treatment_time');\n\t\t$data['cal_id'] = JRequest::getInt('cal_id');\n\t\t\n\t\t//redirect on error or missing data\n\t\tif ($error || $data['treatment_id'] == 0 || $data['date'] == \"\" || $data['treatment_time'] == \"\") {\n\t\t\t$this->setRedirect('index.php?option=com_pbbooking',JText::_('COM_PBBOOKING_MISSING_DATA'));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t//verify the appointment is actually available \n\t\t$valid = Pbbookinghelper::valid_appointment($data);\n\t\tif ($valid) {\n\t\t\t//create pending event and email user\n\t\t\t$pending_id = Pbbookinghelper::save_pending_event($data);\n\t\t\tif ($pending_id) {\n\t\t\t\t$data['pending_id'] = $pending_id;\n\n\t\t\t\tPbbookinghelper::email_user($data);\n\t\t\t\t\n\t\t\t\t//now redirect - load up the view\n\t\t\t\t$view = $this->getView('PBBooking','html');\n\t\t\t\t$view->setLayout('success');\n\t\t\t\t\n\t\t\t\t//populate needed data into the view.\n\t\t\t\t$db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($data['treatment_id']));\n\t\t\t\t$view->service = $db->loadObject();\n\t\t\t\t$view->config = $config;\n\t\t\t\t$db->setQuery('select * from #__pbbooking_pending where id = '.$db->escape($pending_id));\n\t\t\t\t$view->pending = $db->loadObject();\n\n\t\t\t\t//display the view\n\t\t\t\t$view->display();\t\t \t\n\t\t\t} else {\n\t\t\t\t$this->setRedirect('index.php/option=com_pbbooking',JText::_('COM_PBBOOKING_BOOKING_PROBLEM'));\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t$this->setRedirect('index.php/option=com_pbbooking',JText::_('COM_PBBOOKING_BOOKING_PROBLEM'));\n\t\t}\n\t}", "public function store(Request $request)\n {\n\n $validatedData = $request->validate([\n 'AlertDateEvent' => 'after_or_equal:AlertDateNotifi',\n ], ['AlertDateEvent.after_or_equal' => 'El campo Fecha Evento debe ser una fecha posterior o igual a Fecha de notificación.'\n ]);\n\n /*return $request;*/\n $alert = new Alerts();\n $alert->AlertName = $request->input('AlertName');\n $alert->AlertDateEvent = $request->input('AlertDateEvent');\n $alert->AlertDescription = $request->input('AlertDescription');\n $alert->AlertDateNotifi = $request->input('AlertDateNotifi');\n $alert->AlertType = $request->input('AlertType');\n $alert->AlertNotification = 0;\n $alert->AlertRealizado = 0;\n $alert->AlertPercentage = 100;\n $alert->user_id = Auth::user()->id;\n $alert->save();\n\n $usuario = User::where('id', $alert->user_id)->first();\n $areadelusuario = Areas::where('id', $usuario->areas_id)->first();\n $jefearea = User::with(['areas', 'roles' => function ($query) {\n $query->where('name', 'JefeArea');\n }])\n ->role('JefeArea')\n ->where('areas_id', $areadelusuario->id)->first();\n\n switch ($alert->AlertType) {\n case 'Global':\n Mail::to(User::all())->queue(new NewAlert($alert));\n break;\n\n case 'Sede':\n $areaUsuario = Areas::where('id', Auth::user()->id)->first();\n $areasdeSede = Areas::where('AreaSede', $areaUsuario->AreaSede)->get('id');\n $destinatariosSede = User::whereIn('areas_id', $areasdeSede)\n ->with('areas')\n ->get();\n Mail::to($destinatariosSede)->queue(new NewAlert($alert));\n break;\n\n case 'Area':\n $area = Areas::where('id', Auth::user()->id)->with('users')->first();\n Mail::to($area->users)->queue(new NewAlert($alert));\n break;\n\n case 'Personal':\n Mail::to($request->user())->queue(new NewAlert($alert));\n break;\n \n default:\n Mail::to($request->user())->queue(new NewAlert($alert));\n break;\n }\n\n return redirect()->route('alerts.index')->withStatus(__('Alerta creada correctamente'));\n }", "function after_save() {}", "public function beforeSave($options = array()){\n foreach(array_keys($this->data[$this->alias]) as $field)\n if(!$this->hasField($field)){\n $field_value = $this->data[$this->alias][$field];\n trigger_error(\"ERR DB field missing: `\" . $this->alias . '`.' . $field, E_USER_ERROR);\n }\n }", "public function save_alert($args) {\n\n // Verify if the alert has the expected parameters\n if ( empty($args['alert_name']) || !isset($args['alert_type']) || !isset($args['alert_audience']) || !isset($args['alert_fields']) ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_missing_some_alert_parameters')\n );\n\n }\n\n // Verify if the alert's parameters have correct value\n if ( ($args['alert_type'] < 0) || ($args['alert_type'] > 3) || !is_numeric($args['alert_type']) || ($args['alert_audience'] < 0) || ($args['alert_audience'] > 2) || !is_numeric($args['alert_audience']) || !is_array($args['alert_fields']) ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_parameters')\n );\n\n }\n \n // Verify if the alert's fields have correct value\n if ( empty($args['alert_fields']) ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_fields')\n );\n\n }\n\n // Verify if the alert's parameters have correct value\n if ( !isset($args['alert_fields'][0]['field_name']) || !isset($args['alert_fields'][0]['field_value']) ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_wrong_value_some_alert_fields')\n );\n\n }\n\n // Verify if the alert's parameters have correct value\n if ( !isset($args['alert_fields'][0]['language']) ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_alert_fields_without_language')\n );\n\n }\n\n // Check for errors by type\n if ( $args['alert_type'] === '0' ) {\n\n // Banner count\n $banner_count = 0;\n\n // Page count\n $page_count = 0;\n\n // List the alert's fields\n foreach ( $args['alert_fields'] as $field ) {\n\n // Verify if is the banner content field\n if ( $field['field_name'] === 'banner_content' ) {\n\n // Verify if banner is empty\n if ( !empty($field['field_value']) ) {\n $banner_count++;\n }\n\n }\n\n // Verify if is the banner enabled field\n if ( $field['field_name'] === 'banner_enabled' ) {\n\n // Verify if banner is enabled\n if ( !empty($field['field_value']) ) {\n $banner_count++;\n }\n\n }\n\n // Verify if is the page title field\n if ( $field['field_name'] === 'page_title' ) {\n\n // Verify if page title is empty\n if ( !empty($field['field_value']) ) {\n $page_count++;\n }\n\n }\n\n // Verify if is the page content field\n if ( $field['field_name'] === 'page_content' ) {\n\n // Verify if page content is empty\n if ( !empty($field['field_value']) ) {\n $page_count++;\n }\n\n }\n\n // Verify if is the page enabled field\n if ( $field['field_name'] === 'page_enabled' ) {\n\n // Verify if page is enabled\n if ( !empty($field['field_value']) ) {\n $page_count++;\n }\n\n } \n\n }\n\n // Verify if at least the banner or page content exists\n if ( ($banner_count < 2) && ($page_count < 3) ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_alert_can_not_be_saved_wrong_parameters')\n );\n\n }\n\n } else if ( $args['alert_type'] === '1' ) {\n\n // Banner count\n $banner_count = 0;\n\n // List the alert's fields\n foreach ( $args['alert_fields'] as $field ) {\n\n // Verify if is the banner content field\n if ( $field['field_name'] === 'banner_content' ) {\n\n // Verify if banner is empty\n if ( !empty($field['field_value']) ) {\n $banner_count++;\n }\n\n } \n\n }\n\n // Verify if at least the banner or page content exists\n if ( $banner_count < 1 ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_alert_type_requires_banner')\n );\n\n }\n\n } else {\n\n // Banner count\n $banner_count = 0;\n\n // Page count\n $page_count = 0;\n\n // List the alert's fields\n foreach ( $args['alert_fields'] as $field ) {\n\n // Verify if is the banner content field\n if ( $field['field_name'] === 'banner_content' ) {\n\n // Verify if banner is empty\n if ( !empty($field['field_value']) ) {\n $banner_count++;\n }\n\n } \n\n }\n\n // Verify if at least the banner exists\n if ( $banner_count < 1 ) {\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_alert_type_requires_banner')\n );\n\n }\n\n }\n\n // Create the alert's parameters\n $alert_args = array(\n 'alert_name' => $args['alert_name'],\n 'alert_type' => $args['alert_type'],\n 'alert_audience' => $args['alert_audience'],\n 'created' => time()\n );\n\n // Save the alert\n $alert_id = $this->CI->base_model->insert('notifications_alerts', $alert_args);\n\n // Verify if the alert was saved\n if ( $alert_id ) {\n\n // Fields counter\n $fields_count = 0; \n \n // List all alert fields\n foreach ( $args['alert_fields'] as $field ) {\n\n // Set extra\n $field_extra = isset($field['field_extra'])?$field['field_extra']:'';\n\n // Set language\n $language = isset($field['language'])?$field['language']:'';\n \n // Try to save the field\n if ( $this->save_alerts_field($alert_id, $field['field_name'], $field['field_value'], $field_extra, $language ) ) {\n $fields_count++;\n } \n\n }\n\n // Verify if the alert has filters\n if ( !empty($args['alert_filters']) ) {\n\n // List all alert filters\n foreach ( $args['alert_filters'] as $filter ) {\n\n // Set extra\n $filter_extra = isset($filter['filter_extra'])?$filter['filter_extra']:'';\n \n // Try to save the filter\n $this->save_alerts_filter($alert_id, $filter['filter_name'], $filter['filter_value'], $filter_extra); \n\n }\n\n }\n\n // Verify if the alert has users\n if ( !empty($args['alert_users']) ) {\n\n // List all alert's users'\n foreach ( $args['alert_users'] as $user ) {\n\n // Verify if user's id is numeric\n if ( is_numeric($user['user_id']) ) {\n \n // Try to save the alert's user\n $this->save_alerts_user($alert_id, $user['user_id']); \n \n }\n\n }\n\n }\n\n // Verify if all fields were saved\n if ( $fields_count === count($args['alert_fields']) ) {\n\n // Return the success\n return array(\n 'success' => TRUE,\n 'message' => $this->CI->lang->line('notifications_alert_was_saved')\n );\n\n } \n\n }\n\n // Return the error\n return array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('notifications_alert_was_not_saved')\n );\n\n }", "public function kiwip_save_post(){\n\t\t// Load Helper class\n\t\t$Helper = new Kiwip_Helper;\n\t\t// Deny the wordpress autosave function\n\t\tif(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;\n\n\t\tif($_POST && !wp_verify_nonce($_POST['kiwip_nonce'], plugin_basename(__FILE__))) return;\n\t\tif(!isset($_POST)) return;\n\t\t\n\t\tglobal $post;\n\t\tif(!isset($post->ID) && get_post_type($post->ID) !== $this->post_type_name) return;\n\t\t\n\t\t// Loop through each meta box\n\t\tif(!empty($this->meta_fields)){\n\t\t\tforeach($this->meta_fields as $field){\n\t\t\t\t$field_id_name = '_'.$this->slug.\"_\".$Helper->kiwip_make_slugable($field['name']);\n\n\t\t\t\t// validation rules here \n\n\t\t\t\tupdate_post_meta($post->ID, $field_id_name, $_POST['kiwip'][$field_id_name]);\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "protected function afterSave() {\n\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function setAlertForm();", "protected function saveUpdated() {\n $module_handler = \\Drupal::moduleHandler();\n $storage_controller = \\Drupal::entityManager()->getStorageController($this->entityType);\n\n $original = $storage_controller->loadUnchanged($this->id());\n\n // Some updates are always disallowed.\n if ($this->type != $original->type) {\n throw new FieldException(\"Cannot change an existing field's type.\");\n }\n if ($this->entity_types != $original->entity_types) {\n throw new FieldException(\"Cannot change an existing field's entity_types property.\");\n }\n if ($this->storage['type'] != $original->storage['type']) {\n throw new FieldException(\"Cannot change an existing field's storage type.\");\n }\n\n // Make sure all settings are present, so that a complete field definition\n // is saved. This allows calling code to perform partial updates on field\n // objects.\n $this->settings += $original->settings;\n\n $has_data = field_has_data($this);\n\n // See if any module forbids the update by throwing an exception. This\n // invokes hook_field_update_forbid().\n $module_handler->invokeAll('field_update_forbid', array($this, $original, $has_data));\n\n // Tell the storage engine to update the field by invoking the\n // hook_field_storage_update_field(). The storage engine can reject the\n // definition update as invalid by raising an exception, which stops\n // execution before the definition is written to config.\n $module_handler->invoke($this->storage['module'], 'field_storage_update_field', array($this, $original, $has_data));\n\n // Save the configuration.\n $result = parent::save();\n field_cache_clear();\n\n // Invoke hook_field_update_field() after the cache is cleared for API\n // consistency.\n $module_handler->invokeAll('field_update_field', array($this, $original, $has_data));\n\n return $result;\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function save()\n {\n parent::save();\n\n $soxId = $this->getEditObjectId();\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n // shopid\n $sShopID = oxRegistry::getSession()->getVariable(\"actshop\");\n $aParams['oxarticles__oxshopid'] = $sShopID;\n\n $oArticle = oxNew(\"oxarticle\");\n $oArticle->loadInLang($this->_iEditLang, $soxId);\n\n $oArticle->setLanguage(0);\n\n // checkbox handling\n if (!$oArticle->oxarticles__oxparentid->value && !isset($aParams['oxarticles__oxremindactive'])) {\n $aParams['oxarticles__oxremindactive'] = 0;\n }\n\n $oArticle->assign($aParams);\n\n //tells to article to save in different language\n $oArticle->setLanguage($this->_iEditLang);\n $oArticle = oxRegistry::get(\"oxUtilsFile\")->processFiles($oArticle);\n\n $oArticle->resetRemindStatus();\n\n $oArticle->updateVariantsRemind();\n\n $oArticle->save();\n }", "public function save() {\n\t\t\t\n\t\t}", "public function save_widget() {\n\t\t$this->get_cache();\n\t\t$this->get_db_values();\n\t\tif ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST[ $this->unique() ] ) ) {\n\t\t\t$this->get_db_values();\n\t\t\t$this->get_cache();\n\t\t\t$instance = new Save_Handler( array(\n\t\t\t\t'module' => &$this,\n\t\t\t\t'unique' => $this->unique(),\n\t\t\t\t'fields' => $this->fields(),\n\t\t\t\t'db_values' => $this->get_db_values(),\n\t\t\t) );\n\t\t\t$instance->run();\n\n\t\t\t$this->options_cache['field_errors'] = $instance->get_errors();\n\t\t\t$this->set_db_cache( $this->options_cache );\n\t\t\t$this->set_db_values( $instance->get_values() );\n\t\t\tif ( ! empty( $instance->get_errors() ) ) {\n\t\t\t\twp_redirect( add_query_arg( 'wponion-save', 'error' ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->init_theme()->render();\n\t\t}\n\t}", "private function _save_warning()\n\t{\n\t\tglobal $txt, $context, $cur_profile;\n\n\t\tif (isset($this->_req->post->save))\n\t\t{\n\t\t\t// Security is good here.\n\t\t\tcheckSession('post');\n\n\t\t\t// There must be a reason, and use of flowery words is allowed.\n\t\t\t$warn_reason = $this->_req->getPost('warn_reason', 'trim|\\\\ElkArte\\\\Util::htmlspecialchars', '');\n\t\t\tif ($warn_reason === '' && !$context['user']['is_owner'])\n\t\t\t{\n\t\t\t\t$this->_issueErrors[] = 'warning_no_reason';\n\t\t\t}\n\n\t\t\t// If the value hasn't changed it's either no JS or a real no change (Which this will pass)\n\t\t\tif ($warn_reason === 'SAME')\n\t\t\t{\n\t\t\t\t$this->_req->post->warning_level = $this->_req->post->warning_level_nojs;\n\t\t\t}\n\n\t\t\t// Set and contain the level and level changes\n\t\t\t$warning_level = (int) $this->_req->post->warning_level;\n\t\t\t$warning_level = max(0, min(100, $warning_level));\n\n\t\t\tif ($warning_level < $context['min_allowed'])\n\t\t\t{\n\t\t\t\t$warning_level = $context['min_allowed'];\n\t\t\t}\n\t\t\telseif ($warning_level > $context['max_allowed'])\n\t\t\t{\n\t\t\t\t$warning_level = $context['max_allowed'];\n\t\t\t}\n\n\t\t\t// We need this to log moderation notices\n\t\t\trequire_once(SUBSDIR . '/Moderation.subs.php');\n\n\t\t\t// Do we actually have to issue them with a PM?\n\t\t\t$id_notice = $this->_issue_warning_pm();\n\n\t\t\t// What have we changed?\n\t\t\t$level_change = $warning_level - $cur_profile['warning'];\n\n\t\t\t// No errors? Proceed! Only log if you're not the owner.\n\t\t\tif (empty($this->_issueErrors))\n\t\t\t{\n\t\t\t\t// Log what we've done!\n\t\t\t\tif (!$context['user']['is_owner'])\n\t\t\t\t{\n\t\t\t\t\tlogWarning($this->_memID, $cur_profile['real_name'], $id_notice, $level_change, $warn_reason);\n\t\t\t\t}\n\n\t\t\t\t// Make the change.\n\t\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\t\t\t\tupdateMemberData($this->_memID, array('warning' => $warning_level));\n\n\t\t\t\t// Leave a lovely message.\n\t\t\t\t$context['profile_updated'] = $context['user']['is_owner'] ? $txt['profile_updated_own'] : $txt['profile_warning_success'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Try to remember some bits.\n\t\t\t\t$context['warning_data'] = array(\n\t\t\t\t\t'reason' => $warn_reason,\n\t\t\t\t\t'notify' => !empty($this->_req->post->warn_notify),\n\t\t\t\t\t'notify_subject' => $this->_req->getPost('warn_sub', 'trim', ''),\n\t\t\t\t\t'notify_body' => $this->_req->getPost('warn_body', 'trim', ''),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Show the new improved warning level.\n\t\t\t$context['member']['warning'] = $warning_level;\n\t\t}\n\t}", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\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 saveField($vars, $moduleid, $weight = 0) {\r\n $field =& $this->createField();\r\n $field->setVar('field_name', $vars['name']);\r\n $field->setVar('field_moduleid', $moduleid);\r\n $field->setVar('field_valuetype', $vars['valuetype']);\r\n $field->setVar('field_type', $vars['type']);\r\n $field->setVar('field_weight', $weight);\r\n if (isset($vars['title'])) {\r\n $field->setVar('field_title', $vars['title']);\r\n }\r\n if (isset($vars['description'])) {\r\n $field->setVar('field_description', $vars['description']);\r\n }\r\n if (isset($vars['required'])) {\r\n $field->setVar('field_required', $vars['required']); //0 = no, 1 = yes\r\n }\r\n if (isset($vars['maxlength'])) {\r\n $field->setVar('field_maxlength', $vars['maxlength']);\r\n }\r\n if (isset($vars['default'])) {\r\n $field->setVar('field_default', $vars['default']);\r\n }\r\n if (isset($vars['notnull'])) {\r\n $field->setVar('field_notnull', $vars['notnull']);\r\n }\r\n if (isset($vars['show'])) {\r\n $field->setVar('field_show', $vars['show']);\r\n }\r\n if (isset($vars['edit'])) {\r\n $field->setVar('field_edit', $vars['edit']);\r\n }\r\n if (isset($vars['config'])) {\r\n $field->setVar('field_config', $vars['config']);\r\n }\r\n if (isset($vars['options'])) {\r\n $field->setVar('field_options', $vars['options']);\r\n }\r\n else {\r\n $field->setVar('field_options', array());\r\n }\r\n if ($this->insertField($field)) {\r\n $msg = '&nbsp;&nbsp;Field <b>'.$vars['name'].'</b> added to the database';\r\n }\r\n else {\r\n $msg = '&nbsp;&nbsp;<span style=\"color:#ff0000;\">ERROR: Could not insert field <b>'.$vars['name'].'</b> into the database. '.implode(' ', $field->getErrors()).$this->db->error().'</span>';\r\n }\r\n unset($field);\r\n return $msg;\r\n }", "function save()\n {\n $ldap= $this->config->get_ldap_link();\n\n /* Call parents save to prepare $this->attrs */\n plugin::save();\n\n /* Save arrays */\n $this->attrs['scalixEmailAddress']= $this->scalixEmailAddress; \n \n /* Save boolean vars ... the scalix schema expects them as strings */\n if(!$this->scalixGroup){\n $this->attrs['scalixAdministrator'] = $this->scalixAdministrator?\"TRUE\":\"FALSE\";\n $this->attrs['scalixMailboxAdministrator'] = $this->scalixMailboxAdministrator?\"TRUE\":\"FALSE\";\n $this->attrs['scalixLimitOutboundMail'] = $this->scalixLimitOutboundMail?\"TRUE\":\"FALSE\";\n $this->attrs['scalixLimitInboundMail'] = $this->scalixLimitInboundMail?\"TRUE\":\"FALSE\";\n $this->attrs['scalixLimitNotifyUser'] = $this->scalixLimitNotifyUser?\"TRUE\":\"FALSE\";\n }\n \n $this->attrs['scalixScalixObject'] = $this->scalixScalixObject?\"TRUE\":\"FALSE\";\n $this->attrs['scalixHideUserEntry'] = $this->scalixHideUserEntry?\"TRUE\":\"FALSE\";\n\n /* Remove Mailquota if = \"\" */\n if((isset($this->attrs['scalixLimitMailboxSize']))&&($this->attrs['scalixLimitMailboxSize']==\"\")) {\n $this->attrs['scalixLimitMailboxSize']=array();\n }\n\n /* Save data to LDAP */\n $ldap->cd($this->dn);\n $ldap->modify($this->attrs);\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }\n\n /* Optionally execute a command after we're done */\n if ($this->initially_was_account == $this->is_account){\n if ($this->is_modified){\n $this->handle_post_events(\"modify\");\n }\n } else {\n $this->handle_post_events(\"add\");\n }\n\n }", "public function postSave($with_validation) {}", "public abstract function save();", "public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\n\t\t$this->db->query('UPDATE `'.$table_prefix.'indicator_lang` SET indicator_title = ?, indicator_description = ? WHERE indicator_id = ? AND locale = ?',\n\t\t\t$this->indicator_title, $this->indicator_description, $this->id, $this->locale\n\t\t);\n\t}", "public function afterSave(){\n\t}", "public final function save() {\n }", "public function save()\r\n {\r\n \r\n }", "public function timestampFieldIsUpdatedOnPostSave() {}", "public function save()\n {\n parent::save();\n $warningBlock = $this->browser->find($this->warningBlock);\n if ($warningBlock->isVisible()) {\n $warningBlock->click();\n }\n }", "public function saveEditedFieldData($field) {\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$field_type_id = getArrayKey($info, 'field_type_id');\n\t\t\t$guide_id = getArrayKey($info, 'guide_id');\n\t\t\t$in_search = getArrayKey($info, 'in_search');\n\t\t\t$in_filter = getArrayKey($info, 'in_filter');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\t\t\t$isRequired = getArrayKey($info, 'is_required');\n\t\t\t$restrictionId = getArrayKey($info, 'restriction_id');\n\t\t\t$isImportant = getArrayKey($info, 'is_important');\n\n\t\t\tif($field instanceof umiField) {\n\t\t\t\t$field->setTitle($title);\n\t\t\t\t$field->setName($name);\n\t\t\t\t$field->setIsVisible($is_visible);\n\t\t\t\t$field->setFieldTypeId($field_type_id);\n\t\t\t\t$field->setIsInSearch($in_search);\n\t\t\t\t$field->setIsInFilter($in_filter);\n\t\t\t\t$field->setTip($tip);\n\t\t\t\t$field->setIsRequired($isRequired);\n\t\t\t\t$field->setRestrictionId($restrictionId);\n\t\t\t\t$field->setImportanceStatus($isImportant);\n\n\t\t\t\t//Choose or create public guide for unlinked relation field\n\t\t\t\t$field_type_obj = umiFieldTypesCollection::getInstance()->getFieldType($field_type_id);\n\t\t\t\t$field_data_type = $field_type_obj->getDataType();\n\n\t\t\t\tif($field_data_type == \"relation\" && $guide_id == 0) {\n\t\t\t\t\t$guide_id = self::getAutoGuideId($title);\n\t\t\t\t}\n\n\t\t\t\tif($field_data_type == \"optioned\" && $guide_id == 0) {\n\t\t\t\t\t$parent_guide_id = umiObjectTypesCollection::getInstance()->getTypeIdByGUID('emarket-itemoption');\n\t\t\t\t\t$guide_id = self::getAutoGuideId($title, $parent_guide_id);\n\t\t\t\t}\n\n\t\t\t\t$field->setGuideId($guide_id);\n\n\t\t\t\t$field->commit();\n\t\t\t} else {\n\t\t\t\tthrow new coreException(\"Expected instance of type umiField\");\n\t\t\t}\n\t\t}", "public function save(){\n\t\tglobal $wpdb;\n\t\t$wpdb->insert( $wpdb->prefix . 'cf_form_entry_values', $this->to_array() );\n\t\treturn (int) $wpdb->insert_id;\n\n\t}", "public function post_save(){\n\n }", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function save()\n\t{\n\t\n\t\tif ($this->id == null) throw new Exception(\"Cannot save. id is null\");\n\t\t\n\t\t//store the data in the content column so that our worker will be searchable.\n\t\t$wp_content = \"\";\n\t\t\n\t\tforeach($this->values as $field=>$value)\n\t\t{\n\t\t\tupdate_post_meta($this->id, $field, $value);\n\t\t\t$wp_content .= \"<div>$value</div>\";\n\t\t}\n\t\t\n\t\t//wp_die($wp_content);\n\n\t\t//save the data entry in wp_posts\n\t\tglobal $wpdb;\n\t\t$wpdb->update(\n\t\t\t$wpdb->posts, \n\t\t\tarray(\n\t\t\t\t\"post_content\" => $wp_content,\n\t\t\t\t\"post_title\" => \"{$this->values['lastname']}, {$this->values['firstname']} {$this->values['middlename']}\" \n\t\t\t),\n\t\t\tarray(\"ID\" => $this->id),\n\t\t\tarray(\"%s\"),\n\t\t\tarray(\"%d\")\n\t\t);\n\t\t\n\t\t\n\t}", "public function onSaveSuccess($type, $id) {\nglobal $_LW;\nif (!isset($_LW->ENV->editors[$_LW->page])) {\n\t// if not saving from the editor, this is coming from the ->update() API and these steps can be skipped\n\treturn false;\n}\nif ($type=='events' && ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit')) { // if saving an event from the editor\n\t$_LW->setCustomFields($type, $id, ['sample_textarea'=>@$_LW->_POST['sample_textarea']], []); // store the value entered for sample_textarea, allowing the sample_textarea field full visibility (on details pages, in widget results, and /live/* requests such as /live/json)\n\t/*\n\tNote:\n \tTo optionally hide the field (i.e. store it in the database but not expose it to the public on the frontend web site or API requests, add \"sample_textarea\" to the empty array above, registering it as a hidden field).\n\tNon-hidden fields may be added to a details template via <xphp var=\"details_custom_sample_textarea\"/> or to a widget format arg via {custom_sample_textarea}.\n\t*/\n\t$_LW->setCustomFields($type, $id, ['sample_text'=>@$_LW->_POST['sample_text']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_select'=>@$_LW->_POST['sample_select']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_checkbox'=>@$_LW->_POST['sample_checkbox']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_radio'=>@$_LW->_POST['sample_radio']], []); // store the value\n};\n}", "public function onBeforeSave();", "public function saveSettings(){\n\n $vars = $this->getAllSubmittedVariablesByName();\n\n $vars['email'] = $this->email;\n $vars['firstname'] = $this->firstname;\n $vars['lastname'] = $this->lastname;\n $vars['real_name'] = $this->firstname .' ' .$this->lastname;\n $vars['phone'] = $this->phone;\n\n $vars['name'] = $this->firstname;\n $vars['surname'] = $this->lastname;\n $vars['screen_name'] = $this->firstname;\n\n\n $vars['about_my_artwork'] = $this->getSubmittedVariableByName('about_my_artwork');\n $vars['what_i_like_to_do'] = $this->getSubmittedVariableByName('what_i_like_to_do');\n $vars['experience'] = $this->getSubmittedVariableByName('experience');\n $vars['instructions'] = $this->getSubmittedVariableByName('instructions');\n $vars['aftercare'] = $this->getSubmittedVariableByName('aftercare');\n $vars['apprenticeship'] = $this->getSubmittedVariableByName('apprenticeship');\n\n $this->saveNamedVariables($vars);\n }", "public function post_save($data) {\n\n\t\t// Empty save result\n\t\tif (!$data) {\n\t\t\treturn $data;\n\t\t}\n\n\t\t// Fetch elements\n\t\t$this->_load_elements_lib();\n\t\t$content_elements = $this->EE->elements->fetch_avaiable_elements($this->get_vars2export());\n\n\t\t// Current settings\n\t\tif (!is_array($data))\n\t\t\t$data = unserialize($data);\n\n\t\tforeach ($data as $eid => $element) {\n\n\t\t\tif (empty($element[\"element_type\"]))\n\t\t\t\tcontinue;\n\n\t\t\t$element_data = $element[\"data\"];\n\t\t\t$element_settings = unserialize(base64_decode($element[\"element_settings\"]));\n\t\t\t$element_type = $element_settings[\"type\"];\n\n\t\t\tif (!empty($this->EE->elements->$element_type) and method_exists($this->EE->elements->$element_type->handler, 'post_save_element')) {\n\t\t\t\t// Attach element settings\n\t\t\t\tforeach ($this->_exclude_setting_system_fields($element_settings[\"settings\"]) as $setting_var => $setting_value) {\n\t\t\t\t\t$this->EE->elements->$element_type->handler->settings[$setting_var] = $setting_value;\n\t\t\t\t}\n\n\t\t\t\t// Attach element field name\n\t\t\t\t$this->EE->elements->$element_type->handler->field_name = $this->_element_field_name() . '[' . $eid . '][data]';\n\n\t\t\t\t// Attach title\t\t\t\t\t\n\t\t\t\t$this->EE->elements->$element_type->handler->element_title = $element_settings[\"settings\"][\"title\"];\n\n\t\t\t\t// Set element id\n\t\t\t\t$this->EE->elements->$element_type->handler->element_id = $eid;\n\n\t\t\t\t// Set field id\t\n\t\t\t\tif (isset($this->field_id) && $this->field_id) {\n\t\t\t\t\t$this->EE->elements->$element_type->handler->field_id = $this->field_id;\n\t\t\t\t}\n\n\t\t\t\t// Send data & call event\n\t\t\t\t$this->EE->elements->$element_type->handler->post_save_element($data[$eid][\"data\"]);\n\t\t\t}\n\t\t}\n\n\t\t## fix saved revision\n\t\t\n\t\t// get channel settings\n\t\t$query = ee()->api_channel_structure->get_channel_info($_POST['channel_id']);\n\t\tforeach(array('channel_url', 'rss_url', 'deft_status', 'comment_url', 'comment_system_enabled', 'enable_versioning', 'max_revisions') as $key)\n\t\t{\n\t\t\t$c_prefs[$key] = $query->row($key);\n\t\t}\n\t\t\n\t\t// get entry titles\n\t\tee()->db->select('versioning_enabled');\n\t\t$query_v = ee()->db->get_where('channel_titles', array('entry_id' => $this->settings['entry_id']));\n\t\t\n\t\t// if entry version is disable then disable versioning\n\t\tif ($query_v->row('versioning_enabled') == 'n')\n\t\t{\n\t\t\t$c_prefs['enable_versioning'] = 'n';\n\t\t}\n\t\t\n\t\t// if is versioning enabled then fix saved data\n\t\tif ($c_prefs['enable_versioning'] == 'y')\n\t\t{\n\t\t\t// get last saved revision\n\t\t\tee()->db->select('*');\n\t\t\tee()->db->from('entry_versioning');\n\t\t\tee()->db->where('entry_id', $this->settings['entry_id']);\n\t\t\tee()->db->order_by('version_id', 'desc');\n\t\t\tee()->db->limit(1);\n\t\t\t\t\n\t\t\t$query = ee()->db->get();\n\t\t\t\t\n\t\t\t// if revision exist\n\t\t\tif ($query->num_rows == 1) {\n\t\t\n\t\t\t\t$temp = $query->result_array();\n\t\t\n\t\t\t\t// replace wrong data\n\t\t\t\t$field = unserialize($temp[0]['version_data']);\n\t\t\t\t$field[$this->settings['field_name']] = $data;\n\t\t\t\t$field = serialize($field);\n\t\t\n\t\t\t\t// update last revision with correct data\n\t\t\t\tee()->db->update('entry_versioning', array('version_data'\t=> $field), array('version_id' => $temp[0]['version_id']));\n\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\n\t\treturn $data;\n\t}", "public function save_builder() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforminator_validate_ajax( \"forminator_save_builder_fields\" );\n\n\t\t$submitted_data = $this->get_post_data();\n\t\t$form_data = $submitted_data['data'];\n\t\t$form_data = json_decode( stripslashes( $form_data ), true );\n\t\t$fields = array();\n\t\t$notifications = array();\n\t\t$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;\n\t\t$id = intval( $id );\n\t\t$title = sanitize_text_field( $submitted_data['formName'] );\n\t\t$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';\n\t\t$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';\n\t\t$action = false;\n\n\t\tif ( is_null( $id ) || $id <= 0 ) {\n\t\t\t$form_model = new Forminator_Custom_Form_Model();\n\t\t\t$action = 'create';\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = Forminator_Custom_Form_Model::STATUS_PUBLISH;\n\t\t\t}\n\t\t} else {\n\t\t\t$form_model = Forminator_Custom_Form_Model::model()->load( $id );\n\t\t\t$action = 'update';\n\n\t\t\tif ( ! is_object( $form_model ) ) {\n\t\t\t\twp_send_json_error( __( \"Form model doesn't exist\", Forminator::DOMAIN ) );\n\t\t\t}\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = $form_model->status;\n\t\t\t}\n\n\t\t\t//we need to empty fields cause we will send new data\n\t\t\t$form_model->clear_fields();\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data, 'forminator_sanitize_field' );\n\n\t\t// Build the fields\n\t\tif ( isset( $form_data ) ) {\n\t\t\t$fields = $form_data['wrappers'];\n\t\t\tunset( $form_data['wrappers'] );\n\t\t}\n\n\t\tforeach ( $fields as $row ) {\n\t\t\tforeach ( $row['fields'] as $f ) {\n\t\t\t\t$field = new Forminator_Form_Field_Model();\n\t\t\t\t$field->form_id = $row['wrapper_id'];\n\t\t\t\t$field->slug = $f['element_id'];\n\t\t\t\tunset( $f['element_id'] );\n\t\t\t\t$field->import( $f );\n\t\t\t\t$form_model->add_field( $field );\n\t\t\t}\n\t\t}\n\n\t\t// Sanitize settings\n\t\t$settings = forminator_sanitize_field( $form_data['settings'] );\n\n\t\t// Sanitize custom css\n\t\tif ( isset( $form_data['settings']['custom_css'] ) ) {\n\t\t\t$settings['custom_css'] = sanitize_textarea_field( $form_data['settings']['custom_css'] );\n\t\t}\n\n\t\t// Sanitize thank you message\n\t\tif ( isset( $form_data['settings']['thankyou-message'] ) ) {\n\t\t\t$settings['thankyou-message'] = $form_data['settings']['thankyou-message'];\n\t\t}\n\n\t\t// Sanitize user email message\n\t\tif ( isset( $form_data['settings']['user-email-editor'] ) ) {\n\t\t\t$settings['user-email-editor'] = $form_data['settings']['user-email-editor'];\n\t\t}\n\n\t\t// Sanitize admin email message\n\t\tif ( isset( $form_data['settings']['admin-email-editor'] ) ) {\n\t\t\t$settings['admin-email-editor'] = $form_data['settings']['admin-email-editor'];\n\t\t}\n\n\t\tif ( isset( $form_data['notifications'] ) ) {\n\t\t\t$notifications = forminator_sanitize_field( $form_data['notifications'] );\n\n\t\t\t$count = 0;\n\t\t\tforeach( $notifications as $notification ) {\n\t\t\t\tif( isset( $notification['email-editor'] ) ) {\n\t\t\t\t\t$notifications[ $count ]['email-editor'] = $form_data['notifications'][ $count ]['email-editor'];\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data );\n\n\t\t// Handle quiz questions\n\t\t$form_model->notifications = $notifications;\n\n\t\t$settings['formName'] = $title;\n\n\t\t$settings['version'] = $version;\n\t\t$form_model->settings = $settings;\n\n\t\t// status\n\t\t$form_model->status = $status;\n\n\t\t// Save data\n\t\t$id = $form_model->save();\n\n\t\t/**\n\t\t * Action called after form saved to database\n\t\t *\n\t\t * @since 1.11\n\t\t *\n\t\t * @param int $id - form id\n\t\t * @param string $title - form title\n\t\t * @param string $status - form status\n\t\t * @param array $fields - form fields\n\t\t * @param array $settings - form settings\n\t\t *\n\t\t */\n\t\tdo_action( 'forminator_custom_form_action_' . $action, $id, $title, $status, $fields, $settings );\n\n\t\t// add privacy settings to global option\n\t\t$override_privacy = false;\n\t\tif ( isset( $settings['enable-submissions-retention'] ) ) {\n\t\t\t$override_privacy = filter_var( $settings['enable-submissions-retention'], FILTER_VALIDATE_BOOLEAN );\n\t\t}\n\t\t$retention_number = null;\n\t\t$retention_unit = null;\n\t\tif ( $override_privacy ) {\n\t\t\t$retention_number = 0;\n\t\t\t$retention_unit = 'days';\n\t\t\tif ( isset( $settings['submissions-retention-number'] ) ) {\n\t\t\t\t$retention_number = (int) $settings['submissions-retention-number'];\n\t\t\t}\n\t\t\tif ( isset( $settings['submissions-retention-unit'] ) ) {\n\t\t\t\t$retention_unit = $settings['submissions-retention-unit'];\n\t\t\t}\n\t\t}\n\n\t\tforminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );\n\n\t\twp_send_json_success( $id );\n\t}", "public function save()\n {\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function save_core_field( $post_id, $field, $value ) {\n\n\t\tswitch ( $field['name'] ) {\n\n\t\t\tcase 'assignee':\n\n\t\t\t\tif ( $value !== get_post_meta( $post_id, '_dev_assignee', true ) ) {\n\t\t\t\t\tdev_assign_ticket( $post_id, $value, $field['args']['log'] );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}", "public final function save()\n {\n }", "public function settings_save()\n {\n $method = rcube_utils::get_input_value('_method', rcube_utils::INPUT_POST);\n $data = @json_decode(rcube_utils::get_input_value('_data', rcube_utils::INPUT_POST), true);\n\n $rcmail = rcmail::get_instance();\n $storage = $this->get_storage($rcmail->get_user_name());\n $success = false;\n $errors = 0;\n $save_data = array();\n\n if ($driver = $this->get_driver($method)) {\n if ($data === false) {\n if ($this->check_secure_mode()) {\n // remove method from active factors and clear stored settings\n $success = $driver->clear();\n }\n else {\n $errors++;\n }\n }\n else {\n // verify the submitted code before saving\n $verify_code = rcube_utils::get_input_value('_verify_code', rcube_utils::INPUT_POST);\n $timestamp = intval(rcube_utils::get_input_value('_timestamp', rcube_utils::INPUT_POST));\n if (!empty($verify_code)) {\n if (!$driver->verify($verify_code, $timestamp)) {\n $this->api->output->command('plugin.verify_response', array(\n 'id' => $driver->id,\n 'method' => $driver->method,\n 'success' => false,\n 'message' => str_replace('$method', $this->gettext($driver->method), $this->gettext('codeverificationfailed'))\n ));\n $this->api->output->send();\n }\n }\n\n foreach ($data as $prop => $value) {\n if (!$driver->set($prop, $value)) {\n $errors++;\n }\n }\n\n $driver->set('active', true);\n }\n\n // commit changes to the user properties\n if (!$errors) {\n if ($success = $driver->commit()) {\n $save_data = $data !== false ? $this->format_props($driver->props()) : array();\n }\n else {\n $errors++;\n }\n }\n }\n\n if ($success) {\n $this->api->output->show_message($data === false ? $this->gettext('factorremovesuccess') : $this->gettext('factorsavesuccess'), 'confirmation');\n $this->api->output->command('plugin.save_success', array(\n 'method' => $method,\n 'active' => $data !== false,\n 'id' => $driver->id) + $save_data);\n }\n else if ($errors) {\n $this->api->output->show_message($this->gettext('factorsaveerror'), 'error');\n $this->api->output->command('plugin.reset_form', $method);\n }\n\n $this->api->output->send();\n }", "function save_object()\n {\n if (isset($_POST['scalixTab'])){\n\n /* Save ldap attributes */\n plugin::save_object();\n\n /* Check if given value is not empty */\n if (isset($_POST['email_address']) && !empty($_POST['email_address']) && isset($_POST['add_email'])){\n $valid= FALSE;\n\n /* Valid mail address */\n if( ($this->is_template && !tests::is_email($_POST['email_address'], TRUE)) ||\n (!$this->is_template && !tests::is_email($_POST['email_address']))){\n msg_dialog::display(_(\"Error\"), _(\"Cannot add invalid mail address!\"), ERROR_DIALOG);\n }else{\n $valid = TRUE;\n }\n\n /* Check write access */\n if(!$this->acl_is_writeable(\"scalixEmailAddress\")){\n msg_dialog::display(_(\"Error\"), _(\"You have no permission to modify these addresses.\"), ERROR_DIALOG);\n }else{\n\n /* Mail address already in use ? */\n if ($valid && ($user= $this->addEmail (get_post('email_address'))) != \"\"){\n $ui= get_userinfo();\n if ($user != $ui->username){\n msg_dialog::display(_(\"Error\"), sprintf(_(\"Cannot add mail address: it is already used by user '%s'.\"), $user),\n ERROR_DIALOG);\n }\n }\n }\n }\n\n /* Delete email addresses */\n if (isset($_POST['delete_email']) && isset ($_POST['emails_list']) && $this->acl_is_writeable(\"scalixEmailAddress\")){\n if(!$this->acl_is_writeable(\"scalixEmailAddress\")){\n msg_dialog::display(_(\"Error\"), _(\"You have no permission to modify these addresses.\"), ERROR_DIALOG);\n }else{\n if (count($_POST['emails_list'])){\n $this->delEmail ($_POST['emails_list']);\n }\n }\n }\n\n /* Save fakeBooleanAttributes*/\n foreach ($this->fakeBooleanAttributes as $val){\n if ($this->acl_is_writeable($val)) {\n if( isset ($_POST[\"$val\"])) {\n $data = TRUE;\n } else {\n $data = FALSE;\n }\n if ($this->$val != $data){\n $this->is_modified= TRUE;\n }\n\n $this->$val= $data;\n }\n }\n }\n }", "public function save()\r\n {\r\n //\r\n }", "protected function save() {\n $saved = parent::save();\n if ($saved !== false) {\n $message = \"This record has been saved.\";\n I2CE::getConfig()->setIfIsSet( $message, \"/modules/forms/page_feedback_messages/person_child_save\" );\n } else {\n $message = \"This record has not been saved.\";\n I2CE::getConfig()->setIfIsSet( $message, \"/modules/forms/page_feedback_messages/person_child_not_save\" ); \n }\n $this->userMessage($message);\n $this->setRedirect( \"view?id=\" . $this->getPrimary()->getParent() );\n return $saved;\n }", "function save($args, $instance) {\n\t\tdie('function cf_Field::save() must be over-ridden in a sub-class.');\n\t}", "public function save() {\n }", "protected function beforeSaveInDB(){}", "public function save( $value = null ) {\n\t\t$submited_value = json_decode( stripslashes( $_REQUEST['customized'] ) );\n\t\tparent::save( explode( ',', $submited_value->{$this->field->alias} ) );\n\t\t/* dirty hack to make multiple elms on customize.php page */\n\n\t}", "public function onAfterSaveField(&$field, &$post, &$file, &$item)\n\t{\n\t}", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function acf_validate_save_post()\n {\n }", "function woo_add_custom_general_fields_save( $post_id ){\n\t\n\t// Text Field\n\t$woocommerce_text_field = $_POST['_nameofrunner'];\n\tif( !empty( $woocommerce_text_field ) )\n\t\tupdate_post_meta( $post_id, '_nameofrunner', esc_attr( $woocommerce_text_field )\n\t);\n}", "public function save()\n\t{\n\n\t}", "public function save(){\r\n // Need the post type name again\r\n $post_type_name = $this->post_type_name;\r\n\r\n add_action( 'save_post',\r\n function() use( $post_type_name ){\r\n // Deny the WordPress autosave function\r\n if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\r\n\r\n if ( ! wp_verify_nonce( $_POST['custom_post_type'], plugin_basename(__FILE__) ) ) return;\r\n\r\n global $post;\r\n\r\n if( isset( $_POST ) && isset( $post->ID ) && get_post_type( $post->ID ) == $post_type_name ){\r\n global $custom_fields;\r\n\r\n // Loop through each meta box\r\n foreach( $custom_fields as $title => $fields ){\r\n // Loop through all fields\r\n foreach( $fields as $label => $type ){\r\n $field_id_name = strtolower( str_replace( ' ', '_', $title ) ) . '_' . strtolower( str_replace( ' ', '_', $label ) );\r\n if($_POST['custom_meta'][$field_id_name] != ''){//Check Entry is not empty\r\n update_post_meta( $post->ID, $field_id_name, $_POST['custom_meta'][$field_id_name] );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n );\r\n }", "public function save()\n {\n // make sure there is a maximum of 1 unassigned appointment\n if( is_null( $this->assignment_id ) )\n {\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'participant_id', '=', $this->participant_id );\n $modifier->where( 'assignment_id', '=', NULL );\n if( !is_null( $this->id ) ) $modifier->where( 'id', '!=', $this->id );\n if( 0 < static::count( $modifier ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot have more than one unassigned appointment per participant.', __METHOD__ );\n }\n\n parent::save();\n }", "public function afterSave()\n {\n\n }", "public function save() {\n\t\t/** @var FieldtypeFile $fieldtype */\n\t\t$fieldtype = $this->field->type;\n\t\treturn $fieldtype->saveFile($this->page, $this->field, $this);\n\t}", "function after_validation_on_update() {}", "public function saveFieldDescription($fieldName, FieldDescription $fieldDescription);", "function _save_post_hook()\n {\n }", "public function save() {\n }", "public function save() {\n }" ]
[ "0.69186336", "0.59851325", "0.5939146", "0.5848555", "0.5635172", "0.56118774", "0.56031895", "0.5539846", "0.55016863", "0.5483187", "0.54554963", "0.543541", "0.5416728", "0.5392574", "0.5387089", "0.53844434", "0.5374407", "0.53695726", "0.5366855", "0.53637034", "0.5363161", "0.53631073", "0.53535914", "0.5345442", "0.53354925", "0.5330011", "0.5322378", "0.53026944", "0.5299999", "0.52948636", "0.52935", "0.5293304", "0.5288561", "0.52851397", "0.52851397", "0.5284311", "0.5279356", "0.52744526", "0.526738", "0.526738", "0.526738", "0.5266465", "0.5265368", "0.526355", "0.5254337", "0.5245851", "0.52438426", "0.523381", "0.5233696", "0.52231705", "0.5214631", "0.52125543", "0.5209196", "0.52049696", "0.52010286", "0.52007085", "0.52000743", "0.5188439", "0.5187321", "0.5186781", "0.51858246", "0.51847166", "0.51847166", "0.51847166", "0.51847166", "0.51847166", "0.5179935", "0.5173666", "0.51733935", "0.5170264", "0.5169392", "0.51606566", "0.5157894", "0.51488006", "0.5146241", "0.5139917", "0.51379806", "0.51376516", "0.51370806", "0.51318544", "0.51259667", "0.5123629", "0.5118769", "0.5118656", "0.5110108", "0.51077795", "0.51077795", "0.51077795", "0.51077795", "0.51009107", "0.5093905", "0.50866514", "0.5082585", "0.5079785", "0.507828", "0.5076285", "0.50666356", "0.5066585", "0.5066462", "0.5066462" ]
0.6687043
1
The protected method save_alerts_filter saves an alert's filter
protected function save_alerts_filter($alert_id, $name, $value, $extra=NULL) { // Prepare the filter $filter_args = array( 'alert_id' => $alert_id, 'filter_name' => $name, 'filter_value' => $value ); // Verify if extra exists if ( $extra !== NULL ) { // Set the filter's extra $filter_args['filter_extra'] = $extra; } // Save the message's filter if ( $this->CI->base_model->insert('notifications_alerts_filters', $filter_args) ) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function saveFilters(array $filters) {\n unset($filters['id']); \n $this->getUser()->setAttribute(viewLeaveEntitlementsAction::FILTERS_ATTRIBUTE_NAME, $filters, 'leave');\n }", "public function saveItemFilters()\n {\n $variables = $this->getAllSubmittedVariablesByName();\n\n $categories = array();\n\n foreach ($variables as $key => $value) {\n if (strstr($key, 'category|') && !empty($value)) {\n $categories[] = $value;\n }\n }\n\n $filter = ItemFilterModel::model()->find('play_id = :playId', array(\n ':playId' => $this->playid\n ));\n $method = 'update';\n\n if (empty($filter)) {\n $filter = new ItemFilterModel();\n $method = 'insert';\n }\n\n $filter->play_id = $this->playid;\n $filter->price_from = $variables['price_from'];\n $filter->price_to = $variables['price_to'];\n $filter->tags = json_encode($this->sessionGet('filter_tags'));\n $filter->categories = json_encode($categories);\n $filter->$method();\n\n if (isset($variables['filter_distance'])) {\n $this->saveVariable('filter_distance', $variables['filter_distance']);\n }\n\n return $filter;\n }", "protected function _save()\n\t{\n\t\treturn Session::instance()->set(Filter::$session_key, $this->_filters);\n\t}", "public function save()\n\t{\n\t\t$old_options = get_option($this->filterName);\n\t\t//create new options\n\t\t$this->options = is_array($old_options) ? array_merge($old_options, $this->options) : $this->options;\n\t\t\n\t\t//verify default value\n\t\t$this->defaultOptions($this->options);\n\t\tupdate_option($this->filterName, $this->options);\n\t}", "public function savePolicy() : void\n {\n if ($this->isFiltered())\n {\n throw new GodException('cannot save a filtered policy');\n }\n\n $this->adapter->savePolicy($this->model);\n\n if ($this->watcher !== null)\n {\n $this->watcher->update();\n }\n }", "protected function filterStore()\n\t{\n\t\tif ($this->arParams[\"SAVE_IN_SESSION\"] == \"Y\" && strlen($_REQUEST[\"filter\"]))\n\t\t{\n\t\t\t$_SESSION[\"spo_filter_id\"] = $_REQUEST[\"filter_id\"];\n\t\t\t$_SESSION[\"spo_filter_date_from\"] = $_REQUEST[\"filter_date_from\"];\n\t\t\t$_SESSION[\"spo_filter_date_to\"] = $_REQUEST[\"filter_date_to\"];\n\t\t\t$_SESSION[\"spo_filter_status\"] = $_REQUEST[\"filter_status\"];\n\t\t\t$_SESSION[\"spo_filter_payed\"] = $_REQUEST[\"filter_payed\"];\n\t\t\t$_SESSION[\"spo_filter_history\"] = $_REQUEST[\"filter_history\"];\n\t\t}\n\t}", "public function afterFilter()\n\t{\n\n\t}", "public function save_fields( $alert ) {\n\t\tcheck_admin_referer( 'save_alert', 'wp_stream_alerts_nonce' );\n\n\t\tif ( empty( $_POST['wp_stream_highlight_color'] ) ) {\n\t\t\t$alert->alert_meta['color'] = 'yellow';\n\t\t}\n\t\t$input_color = sanitize_text_field( wp_unslash( $_POST['wp_stream_highlight_color'] ) );\n\t\tif ( ! array_key_exists( $input_color, $this->get_highlight_options() ) ) {\n\t\t\t$alert->alert_meta['color'] = 'yellow';\n\t\t} else {\n\t\t\t$alert->alert_meta['color'] = $input_color;\n\t\t}\n\n\t}", "public function applyFilterReport() {\n\t\t$this->table->writeFilterToSession();\n\t\t$this->table->resetOffset();\n\t\t$this->report();\n\t}", "protected function filterRestore()\n\t{\n\t\tif ($this->arParams[\"SAVE_IN_SESSION\"] == \"Y\" && !strlen($_REQUEST[\"filter\"]))\n\t\t{\n\t\t\tif (intval($_SESSION[\"spo_filter_id\"]))\n\t\t\t\t$_REQUEST[\"filter_id\"] = $_SESSION[\"spo_filter_id\"];\n\t\t\tif (strlen($_SESSION[\"spo_filter_date_from\"]))\n\t\t\t\t$_REQUEST[\"filter_date_from\"] = $_SESSION[\"spo_filter_date_from\"];\n\t\t\tif (strlen($_SESSION[\"spo_filter_date_to\"]))\n\t\t\t\t$_REQUEST[\"filter_date_to\"] = $_SESSION[\"spo_filter_date_to\"];\n\t\t\tif (strlen($_SESSION[\"spo_filter_status\"]))\n\t\t\t\t$_REQUEST[\"filter_status\"] = $_SESSION[\"spo_filter_status\"];\n\t\t\tif (strlen($_SESSION[\"spo_filter_payed\"]))\n\t\t\t\t$_REQUEST[\"filter_payed\"] = $_SESSION[\"spo_filter_payed\"];\n\t\t\tif (strlen($_SESSION[\"spo_filter_canceled\"]))\n\t\t\t\t$_REQUEST[\"filter_canceled\"] = $_SESSION[\"spo_filter_canceled\"];\n\t\t\tif ($_SESSION[\"spo_filter_history\"] == \"Y\")\n\t\t\t\t$_REQUEST[\"filter_history\"] = \"Y\";\n\t\t}\n\t}", "public function store(Request $request, Filter $filter)\n {\n $request->validate([\n 'name' => 'required|unique:filters,name',\n 'alias' => 'required|regex:/^([a-zA-Z]+-?)+$/|unique:filters,alias',\n ]);\n\n if($request->has(['name', 'alias'])) {\n $filter->name = $request->name;\n $filter->alias = $request->alias;\n\n if($request->has('status')) {\n $filter->status = 1;\n }\n $filter->setDate($request->date);\n $filter->save();\n\n if($request->has('elements')) {\n foreach ($request->elements as $element) {\n $portfolio = Portfolio::find((int)$element);\n $filter->portfolioAll()->attach($portfolio);\n }\n }\n\n return redirect()->route('admin.filter_portfolio');\n }\n return back()->withErrors(['inform' => 'Что-то пошло не так. Пожалуйста, повторите попытку.']);\n }", "public static function storeAll()\n {\n foreach (self::$_activeFilters as $target => $filter) {\n $filter->store();\n }\n }", "public function setFilter($filter){ }", "protected function save_filter($p_field, $p_value = '', $p_obj_type_id = null)\n {\n if ($p_obj_type_id !== null)\n {\n $_SESSION['object-list-filter']['obj-type-' . $p_obj_type_id]['timestamp'] = time();\n $_SESSION['object-list-filter']['obj-type-' . $p_obj_type_id]['field'] = $p_field;\n $_SESSION['object-list-filter']['obj-type-' . $p_obj_type_id]['value'] = $p_value;\n\n if (empty($p_value) || empty($p_field))\n {\n unset($_SESSION['object-list-filter']['obj-type-' . $p_obj_type_id]);\n } // if\n } // if\n }", "public function testFilterSave()\n {\n $searchName = 'search' . uniqid();\n\n $this->visit('/')\n ->click('Login')\n ->seePageIs('/login')\n ->type('[email protected]', '#email')\n ->type('password123', '#password')\n ->click('#login-button');\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->type($searchName, '#searchName')\n ->press('Save search');\n $this->visit('/properties/searches')\n ->see($searchName)\n ->press('#search-' . md5($searchName));\n $this->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }", "public function _post_filter()\n {\n }", "public function store(FilterRequest $request) {\n\n $result = $this->filters_rep->addFilter($request);\n\n if(is_array($result) && !empty($result['error'])) {\n return back()->withErrors($result);\n }\n\n return redirect('/admin/filter')->with($result);\n\n\n }", "public function postSavefilters()\n {\n if (Request::ajax())\n {\n\t\t\t$datatoblob = json_decode(Input::get('selectedvalues'), true);\n //serialization\n $checkuserid = Auth::id();\n $autheduser = User::find(Auth::id());\n $objforuser = new stdClass;\n $objforuser->data = json_encode($datatoblob);\n $objforuser->is_array = is_array($datatoblob); // doing this for proper deserialize\n $objforuser_json = json_encode($objforuser);\n $autheduser->filters_patient = json_encode($objforuser);\n if ($autheduser->forceSave())\n {\n return 'success';\n }else\n {\n return 'nope';\n }\n } else\n {\n return false;\n }\n }", "protected function _store(&$ob)\n {\n switch ($ob->obType()) {\n case self::ACTION_BLACKLIST:\n case self::ACTION_WHITELIST:\n $is_blacklist = (int)($ob->obType() == self::ACTION_BLACKLIST);\n if ($is_blacklist) {\n $filters = &$this->retrieve(self::ACTION_FILTERS);\n if (is_a($filters, 'PEAR_Error')) {\n return $filters;\n }\n $id = $filters->findRuleId(self::ACTION_BLACKLIST);\n if ($id !== null) {\n $rule = $filters->getRule($id);\n if (!isset($rule['action-value']) ||\n $rule['action-value'] != $ob->getBlacklistFolder()) {\n $rule['action-value'] = $ob->getBlacklistFolder();\n $filters->updateRule($rule, $id);\n }\n }\n }\n $query = sprintf('DELETE FROM %s WHERE list_owner = ? AND list_blacklist = ?',\n $this->_params['table_lists']);\n $values = array(Ingo::getUser(), $is_blacklist);\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $result = $this->_write_db->query($query, $values);\n if (is_a($result, 'PEAR_Error')) {\n Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);\n return $result;\n }\n $query = sprintf('INSERT INTO %s (list_owner, list_blacklist, list_address) VALUES (?, ?, ?)',\n $this->_params['table_lists']);\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $addresses = $is_blacklist ? $ob->getBlacklist() : $ob->getWhitelist();\n foreach ($addresses as $address) {\n $result = $this->_write_db->query($query,\n array(Ingo::getUser(),\n $is_blacklist,\n $address));\n if (is_a($result, 'PEAR_Error')) {\n Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);\n return $result;\n }\n }\n $ob->setSaved(true);\n $ret = true;\n break;\n\n case self::ACTION_FILTERS:\n $ret = true;\n break;\n\n case self::ACTION_FORWARD:\n if ($ob->isSaved()) {\n $query = 'UPDATE %s SET forward_addresses = ?, forward_keep = ? WHERE forward_owner = ?';\n } else {\n $query = 'INSERT INTO %s (forward_addresses, forward_keep, forward_owner) VALUES (?, ?, ?)';\n }\n $query = sprintf($query, $this->_params['table_forwards']);\n $values = array(\n implode(\"\\n\", $ob->getForwardAddresses()),\n (int)(bool)$ob->getForwardKeep(),\n Ingo::getUser());\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $ret = $this->_write_db->query($query, $values);\n if (!is_a($ret, 'PEAR_Error')) {\n $ob->setSaved(true);\n }\n break;\n\n case self::ACTION_VACATION:\n if ($ob->isSaved()) {\n $query = 'UPDATE %s SET vacation_addresses = ?, vacation_subject = ?, vacation_reason = ?, vacation_days = ?, vacation_start = ?, vacation_end = ?, vacation_excludes = ?, vacation_ignorelists = ? WHERE vacation_owner = ?';\n } else {\n $query = 'INSERT INTO %s (vacation_addresses, vacation_subject, vacation_reason, vacation_days, vacation_start, vacation_end, vacation_excludes, vacation_ignorelists, vacation_owner) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)';\n }\n $query = sprintf($query, $this->_params['table_vacations']);\n $values = array(\n implode(\"\\n\", $ob->getVacationAddresses()),\n Horde_String::convertCharset($ob->getVacationSubject(),\n Horde_Nls::getCharset(),\n $this->_params['charset']),\n Horde_String::convertCharset($ob->getVacationReason(),\n Horde_Nls::getCharset(),\n $this->_params['charset']),\n (int)$ob->getVacationDays(),\n (int)$ob->getVacationStart(),\n (int)$ob->getVacationEnd(),\n implode(\"\\n\", $ob->getVacationExcludes()),\n (int)(bool)$ob->getVacationIgnorelist(),\n Ingo::getUser());\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $ret = $this->_write_db->query($query, $values);\n if (!is_a($ret, 'PEAR_Error')) {\n $ob->setSaved(true);\n }\n break;\n\n case self::ACTION_SPAM:\n if ($ob->isSaved()) {\n $query = 'UPDATE %s SET spam_level = ?, spam_folder = ? WHERE spam_owner = ?';\n } else {\n $query = 'INSERT INTO %s (spam_level, spam_folder, spam_owner) VALUES (?, ?, ?)';\n }\n $query = sprintf($query, $this->_params['table_spam']);\n $values = array(\n (int)$ob->getSpamLevel(),\n $ob->getSpamFolder(),\n Ingo::getUser());\n Horde::logMessage('Ingo_Storage_Sql::_store(): ' . $query,\n __FILE__, __LINE__, PEAR_LOG_DEBUG);\n $ret = $this->_write_db->query($query, $values);\n if (!is_a($ret, 'PEAR_Error')) {\n $ob->setSaved(true);\n }\n break;\n\n default:\n $ret = false;\n break;\n }\n\n if (is_a($ret, 'PEAR_Error')) {\n Horde::logMessage($ret, __FILE__, __LINE__);\n }\n\n return $ret;\n }", "public function weave( ) {\n\t\n\t\t$bweaver = aop_factory::get( 'aop_beautifier_inserter' );\n\t\t$ifilter = aop_factory::get( 'aop_filter_inserter', $bweaver );\n\t\n\t\t// for aop_filter_inserter\n\t\t$bweaver->setPointcutList( $this->pointcuts );\n\t\t\n\t\t$bweaver->addFilter( $ifilter );\n\t\t$bweaver->setInputString( $this->iFileObj->getContent() );\n\t\t\n\t\ttry {\n\t\t\t$bweaver->process();\n\t\t} catch(Exception $e) {\n\t\t\tthrow new aop_exception( $e->getMessage() );\n\t\t}\n\t\t$result = $bweaver->get();\n\t\t\n\t\t// recycle!\n\t\taop_object_pool::recycle( $bweaver );\n\t\taop_object_pool::recycle( $ifilter );\n\t\t\n\t\t$this->oFileObj->setContent( $result );\n\t\t\n\t\t// effectively just saves the result in the file\n\t\treturn $this->oFileObj->process();\n\t}", "public function filter($filter)\n {\n }", "protected function postFilter($filterChain)\n {\n }", "public function handleFilters()\n\t{\n\t\t$profile = $this->profile;\n\n\t\t$data = Input::get('filteroption');\n\t\tforeach($data as &$value)\n\t\t{\n\t\t\t$value = (array) $value;\n\t\t}\n\n\t\t$this->profileService->syncProfileProperties($profile, $data);\n\n\t\treturn Redirect::action('datacollector.controller@index');\n\t}", "public function setFilter($arrFilter);", "function after_filter($action, $args) {\n }", "public function createFilter();", "public function _report_js_filterReportsAction()\n\t{\n\t\t$filter_js = View::factory('actionable_filter_js');\n\t\t$filter_js->render(TRUE);\n\t}", "public function apply_filter(Request $request)\n {\n \t$new_filter = $request->get('reports_filter_domain');\n \t$filters = session('reports_filter_domain', []);\n \t$filters[$new_filter['field']] = $new_filter;\n \tsession()->put('reports_filter_domain', $filters);\n \t$data = session('reports_filter_domain');\n \treturn $data;\n }", "public function handleStoreFilters($filters)\r\n {\r\n $session = $this->session->getSection('map');\r\n $session->filters = $filters;\r\n \r\n $this->terminate();\r\n }", "public function set_filter(){\n \tsetcookie(\"filter\", addslashes($_POST['filter']), time()+(60*60*24*30), '/');\n }", "public function addFilters()\n {\n foreach (func_get_args() as $filter) {\n if (is_a($filter, 'Rhubarb\\Stem\\Filters\\Filter')) {\n $this->filters[] = $filter;\n } else {\n throw new \\Exception('Non filter object added to Group filter');\n }\n }\n }", "public function addFilter(callable $filter);", "abstract public function prepareFilters();", "public function addFilters()\n {\n }", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(ew_StripSlashes(@$_POST[\"filter\"]), TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field id\n\t\t$this->id->AdvancedSearch->SearchValue = @$filter[\"x_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator = @$filter[\"z_id\"];\n\t\t$this->id->AdvancedSearch->SearchCondition = @$filter[\"v_id\"];\n\t\t$this->id->AdvancedSearch->SearchValue2 = @$filter[\"y_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator2 = @$filter[\"w_id\"];\n\t\t$this->id->AdvancedSearch->Save();\n\n\t\t// Field name\n\t\t$this->name->AdvancedSearch->SearchValue = @$filter[\"x_name\"];\n\t\t$this->name->AdvancedSearch->SearchOperator = @$filter[\"z_name\"];\n\t\t$this->name->AdvancedSearch->SearchCondition = @$filter[\"v_name\"];\n\t\t$this->name->AdvancedSearch->SearchValue2 = @$filter[\"y_name\"];\n\t\t$this->name->AdvancedSearch->SearchOperator2 = @$filter[\"w_name\"];\n\t\t$this->name->AdvancedSearch->Save();\n\n\t\t// Field email\n\t\t$this->_email->AdvancedSearch->SearchValue = @$filter[\"x__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator = @$filter[\"z__email\"];\n\t\t$this->_email->AdvancedSearch->SearchCondition = @$filter[\"v__email\"];\n\t\t$this->_email->AdvancedSearch->SearchValue2 = @$filter[\"y__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator2 = @$filter[\"w__email\"];\n\t\t$this->_email->AdvancedSearch->Save();\n\n\t\t// Field companyname\n\t\t$this->companyname->AdvancedSearch->SearchValue = @$filter[\"x_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchOperator = @$filter[\"z_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchCondition = @$filter[\"v_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchValue2 = @$filter[\"y_companyname\"];\n\t\t$this->companyname->AdvancedSearch->SearchOperator2 = @$filter[\"w_companyname\"];\n\t\t$this->companyname->AdvancedSearch->Save();\n\n\t\t// Field servicetime\n\t\t$this->servicetime->AdvancedSearch->SearchValue = @$filter[\"x_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchOperator = @$filter[\"z_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchCondition = @$filter[\"v_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchValue2 = @$filter[\"y_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->SearchOperator2 = @$filter[\"w_servicetime\"];\n\t\t$this->servicetime->AdvancedSearch->Save();\n\n\t\t// Field country\n\t\t$this->country->AdvancedSearch->SearchValue = @$filter[\"x_country\"];\n\t\t$this->country->AdvancedSearch->SearchOperator = @$filter[\"z_country\"];\n\t\t$this->country->AdvancedSearch->SearchCondition = @$filter[\"v_country\"];\n\t\t$this->country->AdvancedSearch->SearchValue2 = @$filter[\"y_country\"];\n\t\t$this->country->AdvancedSearch->SearchOperator2 = @$filter[\"w_country\"];\n\t\t$this->country->AdvancedSearch->Save();\n\n\t\t// Field phone\n\t\t$this->phone->AdvancedSearch->SearchValue = @$filter[\"x_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator = @$filter[\"z_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchCondition = @$filter[\"v_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchValue2 = @$filter[\"y_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator2 = @$filter[\"w_phone\"];\n\t\t$this->phone->AdvancedSearch->Save();\n\n\t\t// Field skype\n\t\t$this->skype->AdvancedSearch->SearchValue = @$filter[\"x_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchOperator = @$filter[\"z_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchCondition = @$filter[\"v_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchValue2 = @$filter[\"y_skype\"];\n\t\t$this->skype->AdvancedSearch->SearchOperator2 = @$filter[\"w_skype\"];\n\t\t$this->skype->AdvancedSearch->Save();\n\n\t\t// Field website\n\t\t$this->website->AdvancedSearch->SearchValue = @$filter[\"x_website\"];\n\t\t$this->website->AdvancedSearch->SearchOperator = @$filter[\"z_website\"];\n\t\t$this->website->AdvancedSearch->SearchCondition = @$filter[\"v_website\"];\n\t\t$this->website->AdvancedSearch->SearchValue2 = @$filter[\"y_website\"];\n\t\t$this->website->AdvancedSearch->SearchOperator2 = @$filter[\"w_website\"];\n\t\t$this->website->AdvancedSearch->Save();\n\n\t\t// Field linkedin\n\t\t$this->linkedin->AdvancedSearch->SearchValue = @$filter[\"x_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchOperator = @$filter[\"z_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchCondition = @$filter[\"v_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchValue2 = @$filter[\"y_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->SearchOperator2 = @$filter[\"w_linkedin\"];\n\t\t$this->linkedin->AdvancedSearch->Save();\n\n\t\t// Field facebook\n\t\t$this->facebook->AdvancedSearch->SearchValue = @$filter[\"x_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchOperator = @$filter[\"z_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchCondition = @$filter[\"v_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchValue2 = @$filter[\"y_facebook\"];\n\t\t$this->facebook->AdvancedSearch->SearchOperator2 = @$filter[\"w_facebook\"];\n\t\t$this->facebook->AdvancedSearch->Save();\n\n\t\t// Field twitter\n\t\t$this->twitter->AdvancedSearch->SearchValue = @$filter[\"x_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchOperator = @$filter[\"z_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchCondition = @$filter[\"v_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchValue2 = @$filter[\"y_twitter\"];\n\t\t$this->twitter->AdvancedSearch->SearchOperator2 = @$filter[\"w_twitter\"];\n\t\t$this->twitter->AdvancedSearch->Save();\n\n\t\t// Field active_code\n\t\t$this->active_code->AdvancedSearch->SearchValue = @$filter[\"x_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchOperator = @$filter[\"z_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchCondition = @$filter[\"v_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchValue2 = @$filter[\"y_active_code\"];\n\t\t$this->active_code->AdvancedSearch->SearchOperator2 = @$filter[\"w_active_code\"];\n\t\t$this->active_code->AdvancedSearch->Save();\n\n\t\t// Field identification\n\t\t$this->identification->AdvancedSearch->SearchValue = @$filter[\"x_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchOperator = @$filter[\"z_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchCondition = @$filter[\"v_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchValue2 = @$filter[\"y_identification\"];\n\t\t$this->identification->AdvancedSearch->SearchOperator2 = @$filter[\"w_identification\"];\n\t\t$this->identification->AdvancedSearch->Save();\n\n\t\t// Field link_expired\n\t\t$this->link_expired->AdvancedSearch->SearchValue = @$filter[\"x_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchOperator = @$filter[\"z_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchCondition = @$filter[\"v_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchValue2 = @$filter[\"y_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->SearchOperator2 = @$filter[\"w_link_expired\"];\n\t\t$this->link_expired->AdvancedSearch->Save();\n\n\t\t// Field isactive\n\t\t$this->isactive->AdvancedSearch->SearchValue = @$filter[\"x_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchOperator = @$filter[\"z_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchCondition = @$filter[\"v_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchValue2 = @$filter[\"y_isactive\"];\n\t\t$this->isactive->AdvancedSearch->SearchOperator2 = @$filter[\"w_isactive\"];\n\t\t$this->isactive->AdvancedSearch->Save();\n\n\t\t// Field pio\n\t\t$this->pio->AdvancedSearch->SearchValue = @$filter[\"x_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchOperator = @$filter[\"z_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchCondition = @$filter[\"v_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchValue2 = @$filter[\"y_pio\"];\n\t\t$this->pio->AdvancedSearch->SearchOperator2 = @$filter[\"w_pio\"];\n\t\t$this->pio->AdvancedSearch->Save();\n\n\t\t// Field google\n\t\t$this->google->AdvancedSearch->SearchValue = @$filter[\"x_google\"];\n\t\t$this->google->AdvancedSearch->SearchOperator = @$filter[\"z_google\"];\n\t\t$this->google->AdvancedSearch->SearchCondition = @$filter[\"v_google\"];\n\t\t$this->google->AdvancedSearch->SearchValue2 = @$filter[\"y_google\"];\n\t\t$this->google->AdvancedSearch->SearchOperator2 = @$filter[\"w_google\"];\n\t\t$this->google->AdvancedSearch->Save();\n\n\t\t// Field instagram\n\t\t$this->instagram->AdvancedSearch->SearchValue = @$filter[\"x_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchOperator = @$filter[\"z_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchCondition = @$filter[\"v_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchValue2 = @$filter[\"y_instagram\"];\n\t\t$this->instagram->AdvancedSearch->SearchOperator2 = @$filter[\"w_instagram\"];\n\t\t$this->instagram->AdvancedSearch->Save();\n\n\t\t// Field account_type\n\t\t$this->account_type->AdvancedSearch->SearchValue = @$filter[\"x_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchOperator = @$filter[\"z_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchCondition = @$filter[\"v_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchValue2 = @$filter[\"y_account_type\"];\n\t\t$this->account_type->AdvancedSearch->SearchOperator2 = @$filter[\"w_account_type\"];\n\t\t$this->account_type->AdvancedSearch->Save();\n\n\t\t// Field logo\n\t\t$this->logo->AdvancedSearch->SearchValue = @$filter[\"x_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchOperator = @$filter[\"z_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchCondition = @$filter[\"v_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchValue2 = @$filter[\"y_logo\"];\n\t\t$this->logo->AdvancedSearch->SearchOperator2 = @$filter[\"w_logo\"];\n\t\t$this->logo->AdvancedSearch->Save();\n\n\t\t// Field profilepic\n\t\t$this->profilepic->AdvancedSearch->SearchValue = @$filter[\"x_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchOperator = @$filter[\"z_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchCondition = @$filter[\"v_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchValue2 = @$filter[\"y_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->SearchOperator2 = @$filter[\"w_profilepic\"];\n\t\t$this->profilepic->AdvancedSearch->Save();\n\n\t\t// Field mailref\n\t\t$this->mailref->AdvancedSearch->SearchValue = @$filter[\"x_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchOperator = @$filter[\"z_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchCondition = @$filter[\"v_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchValue2 = @$filter[\"y_mailref\"];\n\t\t$this->mailref->AdvancedSearch->SearchOperator2 = @$filter[\"w_mailref\"];\n\t\t$this->mailref->AdvancedSearch->Save();\n\n\t\t// Field deleted\n\t\t$this->deleted->AdvancedSearch->SearchValue = @$filter[\"x_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchOperator = @$filter[\"z_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchCondition = @$filter[\"v_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchValue2 = @$filter[\"y_deleted\"];\n\t\t$this->deleted->AdvancedSearch->SearchOperator2 = @$filter[\"w_deleted\"];\n\t\t$this->deleted->AdvancedSearch->Save();\n\n\t\t// Field deletefeedback\n\t\t$this->deletefeedback->AdvancedSearch->SearchValue = @$filter[\"x_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchOperator = @$filter[\"z_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchCondition = @$filter[\"v_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchValue2 = @$filter[\"y_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->SearchOperator2 = @$filter[\"w_deletefeedback\"];\n\t\t$this->deletefeedback->AdvancedSearch->Save();\n\n\t\t// Field account_id\n\t\t$this->account_id->AdvancedSearch->SearchValue = @$filter[\"x_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchOperator = @$filter[\"z_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchCondition = @$filter[\"v_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchValue2 = @$filter[\"y_account_id\"];\n\t\t$this->account_id->AdvancedSearch->SearchOperator2 = @$filter[\"w_account_id\"];\n\t\t$this->account_id->AdvancedSearch->Save();\n\n\t\t// Field start_date\n\t\t$this->start_date->AdvancedSearch->SearchValue = @$filter[\"x_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchOperator = @$filter[\"z_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchCondition = @$filter[\"v_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchValue2 = @$filter[\"y_start_date\"];\n\t\t$this->start_date->AdvancedSearch->SearchOperator2 = @$filter[\"w_start_date\"];\n\t\t$this->start_date->AdvancedSearch->Save();\n\n\t\t// Field end_date\n\t\t$this->end_date->AdvancedSearch->SearchValue = @$filter[\"x_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchOperator = @$filter[\"z_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchCondition = @$filter[\"v_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchValue2 = @$filter[\"y_end_date\"];\n\t\t$this->end_date->AdvancedSearch->SearchOperator2 = @$filter[\"w_end_date\"];\n\t\t$this->end_date->AdvancedSearch->Save();\n\n\t\t// Field year_moth\n\t\t$this->year_moth->AdvancedSearch->SearchValue = @$filter[\"x_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchOperator = @$filter[\"z_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchCondition = @$filter[\"v_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchValue2 = @$filter[\"y_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->SearchOperator2 = @$filter[\"w_year_moth\"];\n\t\t$this->year_moth->AdvancedSearch->Save();\n\n\t\t// Field registerdate\n\t\t$this->registerdate->AdvancedSearch->SearchValue = @$filter[\"x_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchOperator = @$filter[\"z_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchCondition = @$filter[\"v_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchValue2 = @$filter[\"y_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchOperator2 = @$filter[\"w_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->Save();\n\n\t\t// Field login_type\n\t\t$this->login_type->AdvancedSearch->SearchValue = @$filter[\"x_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchOperator = @$filter[\"z_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchCondition = @$filter[\"v_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchValue2 = @$filter[\"y_login_type\"];\n\t\t$this->login_type->AdvancedSearch->SearchOperator2 = @$filter[\"w_login_type\"];\n\t\t$this->login_type->AdvancedSearch->Save();\n\n\t\t// Field accountstatus\n\t\t$this->accountstatus->AdvancedSearch->SearchValue = @$filter[\"x_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchOperator = @$filter[\"z_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchCondition = @$filter[\"v_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchValue2 = @$filter[\"y_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->SearchOperator2 = @$filter[\"w_accountstatus\"];\n\t\t$this->accountstatus->AdvancedSearch->Save();\n\n\t\t// Field ispay\n\t\t$this->ispay->AdvancedSearch->SearchValue = @$filter[\"x_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchOperator = @$filter[\"z_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchCondition = @$filter[\"v_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchValue2 = @$filter[\"y_ispay\"];\n\t\t$this->ispay->AdvancedSearch->SearchOperator2 = @$filter[\"w_ispay\"];\n\t\t$this->ispay->AdvancedSearch->Save();\n\n\t\t// Field profilelink\n\t\t$this->profilelink->AdvancedSearch->SearchValue = @$filter[\"x_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchOperator = @$filter[\"z_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchCondition = @$filter[\"v_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchValue2 = @$filter[\"y_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->SearchOperator2 = @$filter[\"w_profilelink\"];\n\t\t$this->profilelink->AdvancedSearch->Save();\n\n\t\t// Field source\n\t\t$this->source->AdvancedSearch->SearchValue = @$filter[\"x_source\"];\n\t\t$this->source->AdvancedSearch->SearchOperator = @$filter[\"z_source\"];\n\t\t$this->source->AdvancedSearch->SearchCondition = @$filter[\"v_source\"];\n\t\t$this->source->AdvancedSearch->SearchValue2 = @$filter[\"y_source\"];\n\t\t$this->source->AdvancedSearch->SearchOperator2 = @$filter[\"w_source\"];\n\t\t$this->source->AdvancedSearch->Save();\n\n\t\t// Field agree\n\t\t$this->agree->AdvancedSearch->SearchValue = @$filter[\"x_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchOperator = @$filter[\"z_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchCondition = @$filter[\"v_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchValue2 = @$filter[\"y_agree\"];\n\t\t$this->agree->AdvancedSearch->SearchOperator2 = @$filter[\"w_agree\"];\n\t\t$this->agree->AdvancedSearch->Save();\n\n\t\t// Field balance\n\t\t$this->balance->AdvancedSearch->SearchValue = @$filter[\"x_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchOperator = @$filter[\"z_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchCondition = @$filter[\"v_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchValue2 = @$filter[\"y_balance\"];\n\t\t$this->balance->AdvancedSearch->SearchOperator2 = @$filter[\"w_balance\"];\n\t\t$this->balance->AdvancedSearch->Save();\n\n\t\t// Field job_title\n\t\t$this->job_title->AdvancedSearch->SearchValue = @$filter[\"x_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchOperator = @$filter[\"z_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchCondition = @$filter[\"v_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchValue2 = @$filter[\"y_job_title\"];\n\t\t$this->job_title->AdvancedSearch->SearchOperator2 = @$filter[\"w_job_title\"];\n\t\t$this->job_title->AdvancedSearch->Save();\n\n\t\t// Field projects\n\t\t$this->projects->AdvancedSearch->SearchValue = @$filter[\"x_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchOperator = @$filter[\"z_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchCondition = @$filter[\"v_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchValue2 = @$filter[\"y_projects\"];\n\t\t$this->projects->AdvancedSearch->SearchOperator2 = @$filter[\"w_projects\"];\n\t\t$this->projects->AdvancedSearch->Save();\n\n\t\t// Field opportunities\n\t\t$this->opportunities->AdvancedSearch->SearchValue = @$filter[\"x_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchOperator = @$filter[\"z_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchCondition = @$filter[\"v_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchValue2 = @$filter[\"y_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->SearchOperator2 = @$filter[\"w_opportunities\"];\n\t\t$this->opportunities->AdvancedSearch->Save();\n\n\t\t// Field isconsaltant\n\t\t$this->isconsaltant->AdvancedSearch->SearchValue = @$filter[\"x_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchOperator = @$filter[\"z_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchCondition = @$filter[\"v_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchValue2 = @$filter[\"y_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->SearchOperator2 = @$filter[\"w_isconsaltant\"];\n\t\t$this->isconsaltant->AdvancedSearch->Save();\n\n\t\t// Field isagent\n\t\t$this->isagent->AdvancedSearch->SearchValue = @$filter[\"x_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchOperator = @$filter[\"z_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchCondition = @$filter[\"v_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchValue2 = @$filter[\"y_isagent\"];\n\t\t$this->isagent->AdvancedSearch->SearchOperator2 = @$filter[\"w_isagent\"];\n\t\t$this->isagent->AdvancedSearch->Save();\n\n\t\t// Field isinvestor\n\t\t$this->isinvestor->AdvancedSearch->SearchValue = @$filter[\"x_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchOperator = @$filter[\"z_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchCondition = @$filter[\"v_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchValue2 = @$filter[\"y_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->SearchOperator2 = @$filter[\"w_isinvestor\"];\n\t\t$this->isinvestor->AdvancedSearch->Save();\n\n\t\t// Field isbusinessman\n\t\t$this->isbusinessman->AdvancedSearch->SearchValue = @$filter[\"x_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchOperator = @$filter[\"z_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchCondition = @$filter[\"v_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchValue2 = @$filter[\"y_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->SearchOperator2 = @$filter[\"w_isbusinessman\"];\n\t\t$this->isbusinessman->AdvancedSearch->Save();\n\n\t\t// Field isprovider\n\t\t$this->isprovider->AdvancedSearch->SearchValue = @$filter[\"x_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchOperator = @$filter[\"z_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchCondition = @$filter[\"v_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchValue2 = @$filter[\"y_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->SearchOperator2 = @$filter[\"w_isprovider\"];\n\t\t$this->isprovider->AdvancedSearch->Save();\n\n\t\t// Field isproductowner\n\t\t$this->isproductowner->AdvancedSearch->SearchValue = @$filter[\"x_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchOperator = @$filter[\"z_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchCondition = @$filter[\"v_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchValue2 = @$filter[\"y_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->SearchOperator2 = @$filter[\"w_isproductowner\"];\n\t\t$this->isproductowner->AdvancedSearch->Save();\n\n\t\t// Field states\n\t\t$this->states->AdvancedSearch->SearchValue = @$filter[\"x_states\"];\n\t\t$this->states->AdvancedSearch->SearchOperator = @$filter[\"z_states\"];\n\t\t$this->states->AdvancedSearch->SearchCondition = @$filter[\"v_states\"];\n\t\t$this->states->AdvancedSearch->SearchValue2 = @$filter[\"y_states\"];\n\t\t$this->states->AdvancedSearch->SearchOperator2 = @$filter[\"w_states\"];\n\t\t$this->states->AdvancedSearch->Save();\n\n\t\t// Field cities\n\t\t$this->cities->AdvancedSearch->SearchValue = @$filter[\"x_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchOperator = @$filter[\"z_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchCondition = @$filter[\"v_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchValue2 = @$filter[\"y_cities\"];\n\t\t$this->cities->AdvancedSearch->SearchOperator2 = @$filter[\"w_cities\"];\n\t\t$this->cities->AdvancedSearch->Save();\n\n\t\t// Field offers\n\t\t$this->offers->AdvancedSearch->SearchValue = @$filter[\"x_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchOperator = @$filter[\"z_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchCondition = @$filter[\"v_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchValue2 = @$filter[\"y_offers\"];\n\t\t$this->offers->AdvancedSearch->SearchOperator2 = @$filter[\"w_offers\"];\n\t\t$this->offers->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}", "public function filterAfterAll($filter);", "private function filters() {\n\n\n\t}", "public function _add_incident_filters()\n\t{\n\t\t$params = Event::$data;\n\t\t$params = array_merge($params, $this->params);\n\t\tEvent::$data = $params;\n\t}", "function edit() {\n $this->wireframe->print_button = false;\n \n \tif($this->active_filter->isNew()) {\n \t $this->httpError(HTTP_ERR_NOT_FOUND);\n \t} // if\n \t\n \tif(!$this->active_filter->canEdit($this->logged_user)) {\n \t $this->httpError(HTTP_ERR_FORBIDDEN);\n \t} // if\n \t\n \t$filter_data = $this->request->post('filter');\n \tif(!is_array($filter_data)) {\n \t $filter_data = array(\n \t 'name' => $this->active_filter->getName(),\n \t 'group_name' => $this->active_filter->getGroupName(),\n \t 'is_private' => $this->active_filter->getIsPrivate(),\n \t 'user_filter' => $this->active_filter->getUserFilter(),\n \t 'user_filter_data' => $this->active_filter->getUserFilterData(),\n \t 'date_filter' => $this->active_filter->getDateFilter(),\n \t 'date_from' => $this->active_filter->getDateFrom(),\n \t 'date_to' => $this->active_filter->getDateTo(),\n \t 'status_filter' => $this->active_filter->getStatusFilter(),\n \t 'project_filter' => $this->active_filter->getProjectFilter(),\n \t 'project_filter_data' => $this->active_filter->getProjectFilterData(),\n \t 'order_by' => $this->active_filter->getOrderBy(),\n \t 'objects_per_page' => $this->active_filter->getObjectsPerPage(),\n \t );\n \t} // if\n \t\n \t$this->smarty->assign('filter_data', $filter_data);\n \t\n \tif($this->request->isSubmitted()) {\n \t $old_name = $this->active_filter->getName();\n \t \n \t $this->active_filter->setAttributes($filter_data);\n \t \n \t $save = $this->active_filter->save();\n \t if($save && !is_error($save)) {\n \t flash_success(\"Filter ':name' has been updated\", array('name' => $old_name));\n \t $this->redirectToUrl($this->active_filter->getUrl());\n \t } else {\n \t $this->smarty->assign('errors', $save);\n \t } // if\n \t} // if\n }", "public function CleanFilter(){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t}", "public function edit(Filter $filter)\n {\n //\n }", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(@$_POST[\"filter\"], TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field id\n\t\t$this->id->AdvancedSearch->SearchValue = @$filter[\"x_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator = @$filter[\"z_id\"];\n\t\t$this->id->AdvancedSearch->SearchCondition = @$filter[\"v_id\"];\n\t\t$this->id->AdvancedSearch->SearchValue2 = @$filter[\"y_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator2 = @$filter[\"w_id\"];\n\t\t$this->id->AdvancedSearch->Save();\n\n\t\t// Field fecha_tamizaje\n\t\t$this->fecha_tamizaje->AdvancedSearch->SearchValue = @$filter[\"x_fecha_tamizaje\"];\n\t\t$this->fecha_tamizaje->AdvancedSearch->SearchOperator = @$filter[\"z_fecha_tamizaje\"];\n\t\t$this->fecha_tamizaje->AdvancedSearch->SearchCondition = @$filter[\"v_fecha_tamizaje\"];\n\t\t$this->fecha_tamizaje->AdvancedSearch->SearchValue2 = @$filter[\"y_fecha_tamizaje\"];\n\t\t$this->fecha_tamizaje->AdvancedSearch->SearchOperator2 = @$filter[\"w_fecha_tamizaje\"];\n\t\t$this->fecha_tamizaje->AdvancedSearch->Save();\n\n\t\t// Field id_centro\n\t\t$this->id_centro->AdvancedSearch->SearchValue = @$filter[\"x_id_centro\"];\n\t\t$this->id_centro->AdvancedSearch->SearchOperator = @$filter[\"z_id_centro\"];\n\t\t$this->id_centro->AdvancedSearch->SearchCondition = @$filter[\"v_id_centro\"];\n\t\t$this->id_centro->AdvancedSearch->SearchValue2 = @$filter[\"y_id_centro\"];\n\t\t$this->id_centro->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_centro\"];\n\t\t$this->id_centro->AdvancedSearch->Save();\n\n\t\t// Field apellidopaterno\n\t\t$this->apellidopaterno->AdvancedSearch->SearchValue = @$filter[\"x_apellidopaterno\"];\n\t\t$this->apellidopaterno->AdvancedSearch->SearchOperator = @$filter[\"z_apellidopaterno\"];\n\t\t$this->apellidopaterno->AdvancedSearch->SearchCondition = @$filter[\"v_apellidopaterno\"];\n\t\t$this->apellidopaterno->AdvancedSearch->SearchValue2 = @$filter[\"y_apellidopaterno\"];\n\t\t$this->apellidopaterno->AdvancedSearch->SearchOperator2 = @$filter[\"w_apellidopaterno\"];\n\t\t$this->apellidopaterno->AdvancedSearch->Save();\n\n\t\t// Field apellidomaterno\n\t\t$this->apellidomaterno->AdvancedSearch->SearchValue = @$filter[\"x_apellidomaterno\"];\n\t\t$this->apellidomaterno->AdvancedSearch->SearchOperator = @$filter[\"z_apellidomaterno\"];\n\t\t$this->apellidomaterno->AdvancedSearch->SearchCondition = @$filter[\"v_apellidomaterno\"];\n\t\t$this->apellidomaterno->AdvancedSearch->SearchValue2 = @$filter[\"y_apellidomaterno\"];\n\t\t$this->apellidomaterno->AdvancedSearch->SearchOperator2 = @$filter[\"w_apellidomaterno\"];\n\t\t$this->apellidomaterno->AdvancedSearch->Save();\n\n\t\t// Field nombre\n\t\t$this->nombre->AdvancedSearch->SearchValue = @$filter[\"x_nombre\"];\n\t\t$this->nombre->AdvancedSearch->SearchOperator = @$filter[\"z_nombre\"];\n\t\t$this->nombre->AdvancedSearch->SearchCondition = @$filter[\"v_nombre\"];\n\t\t$this->nombre->AdvancedSearch->SearchValue2 = @$filter[\"y_nombre\"];\n\t\t$this->nombre->AdvancedSearch->SearchOperator2 = @$filter[\"w_nombre\"];\n\t\t$this->nombre->AdvancedSearch->Save();\n\n\t\t// Field ci\n\t\t$this->ci->AdvancedSearch->SearchValue = @$filter[\"x_ci\"];\n\t\t$this->ci->AdvancedSearch->SearchOperator = @$filter[\"z_ci\"];\n\t\t$this->ci->AdvancedSearch->SearchCondition = @$filter[\"v_ci\"];\n\t\t$this->ci->AdvancedSearch->SearchValue2 = @$filter[\"y_ci\"];\n\t\t$this->ci->AdvancedSearch->SearchOperator2 = @$filter[\"w_ci\"];\n\t\t$this->ci->AdvancedSearch->Save();\n\n\t\t// Field fecha_nacimiento\n\t\t$this->fecha_nacimiento->AdvancedSearch->SearchValue = @$filter[\"x_fecha_nacimiento\"];\n\t\t$this->fecha_nacimiento->AdvancedSearch->SearchOperator = @$filter[\"z_fecha_nacimiento\"];\n\t\t$this->fecha_nacimiento->AdvancedSearch->SearchCondition = @$filter[\"v_fecha_nacimiento\"];\n\t\t$this->fecha_nacimiento->AdvancedSearch->SearchValue2 = @$filter[\"y_fecha_nacimiento\"];\n\t\t$this->fecha_nacimiento->AdvancedSearch->SearchOperator2 = @$filter[\"w_fecha_nacimiento\"];\n\t\t$this->fecha_nacimiento->AdvancedSearch->Save();\n\n\t\t// Field dias\n\t\t$this->dias->AdvancedSearch->SearchValue = @$filter[\"x_dias\"];\n\t\t$this->dias->AdvancedSearch->SearchOperator = @$filter[\"z_dias\"];\n\t\t$this->dias->AdvancedSearch->SearchCondition = @$filter[\"v_dias\"];\n\t\t$this->dias->AdvancedSearch->SearchValue2 = @$filter[\"y_dias\"];\n\t\t$this->dias->AdvancedSearch->SearchOperator2 = @$filter[\"w_dias\"];\n\t\t$this->dias->AdvancedSearch->Save();\n\n\t\t// Field semanas\n\t\t$this->semanas->AdvancedSearch->SearchValue = @$filter[\"x_semanas\"];\n\t\t$this->semanas->AdvancedSearch->SearchOperator = @$filter[\"z_semanas\"];\n\t\t$this->semanas->AdvancedSearch->SearchCondition = @$filter[\"v_semanas\"];\n\t\t$this->semanas->AdvancedSearch->SearchValue2 = @$filter[\"y_semanas\"];\n\t\t$this->semanas->AdvancedSearch->SearchOperator2 = @$filter[\"w_semanas\"];\n\t\t$this->semanas->AdvancedSearch->Save();\n\n\t\t// Field meses\n\t\t$this->meses->AdvancedSearch->SearchValue = @$filter[\"x_meses\"];\n\t\t$this->meses->AdvancedSearch->SearchOperator = @$filter[\"z_meses\"];\n\t\t$this->meses->AdvancedSearch->SearchCondition = @$filter[\"v_meses\"];\n\t\t$this->meses->AdvancedSearch->SearchValue2 = @$filter[\"y_meses\"];\n\t\t$this->meses->AdvancedSearch->SearchOperator2 = @$filter[\"w_meses\"];\n\t\t$this->meses->AdvancedSearch->Save();\n\n\t\t// Field sexo\n\t\t$this->sexo->AdvancedSearch->SearchValue = @$filter[\"x_sexo\"];\n\t\t$this->sexo->AdvancedSearch->SearchOperator = @$filter[\"z_sexo\"];\n\t\t$this->sexo->AdvancedSearch->SearchCondition = @$filter[\"v_sexo\"];\n\t\t$this->sexo->AdvancedSearch->SearchValue2 = @$filter[\"y_sexo\"];\n\t\t$this->sexo->AdvancedSearch->SearchOperator2 = @$filter[\"w_sexo\"];\n\t\t$this->sexo->AdvancedSearch->Save();\n\n\t\t// Field discapacidad\n\t\t$this->discapacidad->AdvancedSearch->SearchValue = @$filter[\"x_discapacidad\"];\n\t\t$this->discapacidad->AdvancedSearch->SearchOperator = @$filter[\"z_discapacidad\"];\n\t\t$this->discapacidad->AdvancedSearch->SearchCondition = @$filter[\"v_discapacidad\"];\n\t\t$this->discapacidad->AdvancedSearch->SearchValue2 = @$filter[\"y_discapacidad\"];\n\t\t$this->discapacidad->AdvancedSearch->SearchOperator2 = @$filter[\"w_discapacidad\"];\n\t\t$this->discapacidad->AdvancedSearch->Save();\n\n\t\t// Field id_tipodiscapacidad\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->SearchValue = @$filter[\"x_id_tipodiscapacidad\"];\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->SearchOperator = @$filter[\"z_id_tipodiscapacidad\"];\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->SearchCondition = @$filter[\"v_id_tipodiscapacidad\"];\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->SearchValue2 = @$filter[\"y_id_tipodiscapacidad\"];\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_tipodiscapacidad\"];\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->Save();\n\n\t\t// Field resultado\n\t\t$this->resultado->AdvancedSearch->SearchValue = @$filter[\"x_resultado\"];\n\t\t$this->resultado->AdvancedSearch->SearchOperator = @$filter[\"z_resultado\"];\n\t\t$this->resultado->AdvancedSearch->SearchCondition = @$filter[\"v_resultado\"];\n\t\t$this->resultado->AdvancedSearch->SearchValue2 = @$filter[\"y_resultado\"];\n\t\t$this->resultado->AdvancedSearch->SearchOperator2 = @$filter[\"w_resultado\"];\n\t\t$this->resultado->AdvancedSearch->Save();\n\n\t\t// Field resultadotamizaje\n\t\t$this->resultadotamizaje->AdvancedSearch->SearchValue = @$filter[\"x_resultadotamizaje\"];\n\t\t$this->resultadotamizaje->AdvancedSearch->SearchOperator = @$filter[\"z_resultadotamizaje\"];\n\t\t$this->resultadotamizaje->AdvancedSearch->SearchCondition = @$filter[\"v_resultadotamizaje\"];\n\t\t$this->resultadotamizaje->AdvancedSearch->SearchValue2 = @$filter[\"y_resultadotamizaje\"];\n\t\t$this->resultadotamizaje->AdvancedSearch->SearchOperator2 = @$filter[\"w_resultadotamizaje\"];\n\t\t$this->resultadotamizaje->AdvancedSearch->Save();\n\n\t\t// Field tapon\n\t\t$this->tapon->AdvancedSearch->SearchValue = @$filter[\"x_tapon\"];\n\t\t$this->tapon->AdvancedSearch->SearchOperator = @$filter[\"z_tapon\"];\n\t\t$this->tapon->AdvancedSearch->SearchCondition = @$filter[\"v_tapon\"];\n\t\t$this->tapon->AdvancedSearch->SearchValue2 = @$filter[\"y_tapon\"];\n\t\t$this->tapon->AdvancedSearch->SearchOperator2 = @$filter[\"w_tapon\"];\n\t\t$this->tapon->AdvancedSearch->Save();\n\n\t\t// Field tipo\n\t\t$this->tipo->AdvancedSearch->SearchValue = @$filter[\"x_tipo\"];\n\t\t$this->tipo->AdvancedSearch->SearchOperator = @$filter[\"z_tipo\"];\n\t\t$this->tipo->AdvancedSearch->SearchCondition = @$filter[\"v_tipo\"];\n\t\t$this->tipo->AdvancedSearch->SearchValue2 = @$filter[\"y_tipo\"];\n\t\t$this->tipo->AdvancedSearch->SearchOperator2 = @$filter[\"w_tipo\"];\n\t\t$this->tipo->AdvancedSearch->Save();\n\n\t\t// Field repetirprueba\n\t\t$this->repetirprueba->AdvancedSearch->SearchValue = @$filter[\"x_repetirprueba\"];\n\t\t$this->repetirprueba->AdvancedSearch->SearchOperator = @$filter[\"z_repetirprueba\"];\n\t\t$this->repetirprueba->AdvancedSearch->SearchCondition = @$filter[\"v_repetirprueba\"];\n\t\t$this->repetirprueba->AdvancedSearch->SearchValue2 = @$filter[\"y_repetirprueba\"];\n\t\t$this->repetirprueba->AdvancedSearch->SearchOperator2 = @$filter[\"w_repetirprueba\"];\n\t\t$this->repetirprueba->AdvancedSearch->Save();\n\n\t\t// Field observaciones\n\t\t$this->observaciones->AdvancedSearch->SearchValue = @$filter[\"x_observaciones\"];\n\t\t$this->observaciones->AdvancedSearch->SearchOperator = @$filter[\"z_observaciones\"];\n\t\t$this->observaciones->AdvancedSearch->SearchCondition = @$filter[\"v_observaciones\"];\n\t\t$this->observaciones->AdvancedSearch->SearchValue2 = @$filter[\"y_observaciones\"];\n\t\t$this->observaciones->AdvancedSearch->SearchOperator2 = @$filter[\"w_observaciones\"];\n\t\t$this->observaciones->AdvancedSearch->Save();\n\n\t\t// Field id_apoderado\n\t\t$this->id_apoderado->AdvancedSearch->SearchValue = @$filter[\"x_id_apoderado\"];\n\t\t$this->id_apoderado->AdvancedSearch->SearchOperator = @$filter[\"z_id_apoderado\"];\n\t\t$this->id_apoderado->AdvancedSearch->SearchCondition = @$filter[\"v_id_apoderado\"];\n\t\t$this->id_apoderado->AdvancedSearch->SearchValue2 = @$filter[\"y_id_apoderado\"];\n\t\t$this->id_apoderado->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_apoderado\"];\n\t\t$this->id_apoderado->AdvancedSearch->Save();\n\n\t\t// Field id_referencia\n\t\t$this->id_referencia->AdvancedSearch->SearchValue = @$filter[\"x_id_referencia\"];\n\t\t$this->id_referencia->AdvancedSearch->SearchOperator = @$filter[\"z_id_referencia\"];\n\t\t$this->id_referencia->AdvancedSearch->SearchCondition = @$filter[\"v_id_referencia\"];\n\t\t$this->id_referencia->AdvancedSearch->SearchValue2 = @$filter[\"y_id_referencia\"];\n\t\t$this->id_referencia->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_referencia\"];\n\t\t$this->id_referencia->AdvancedSearch->Save();\n\t}", "public function saveConditions()\n {\n foreach($this->reportsConditions as $k => $v) {\n $v->save();\n }\n }", "public function _report_filters_ui()\n\t{\n\t\t$filter = View::factory('actionable_filter');\n\t\t$filter->render(TRUE);\n\t}", "protected function form_add_filter_dialog( $filter, &$form ) {\n\t}", "function genesisawesome_custom_filters( $filters ) {\n\n\t$filters['email'] = 'sanitize_email';\n\t$filters['integer'] = 'genesisawesome_intval';\n\n\treturn $filters;\n\n}", "public function applyFilters() {\n\t\tforeach ($this->filters as $filter) {\n\t\t\t$filter->apply($this);\n\t\t}\n\t\t$this->removeFilters();\n\t}", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(ew_StripSlashes(@$_POST[\"filter\"]), TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field id\n\t\t$this->id->AdvancedSearch->SearchValue = @$filter[\"x_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator = @$filter[\"z_id\"];\n\t\t$this->id->AdvancedSearch->SearchCondition = @$filter[\"v_id\"];\n\t\t$this->id->AdvancedSearch->SearchValue2 = @$filter[\"y_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator2 = @$filter[\"w_id\"];\n\t\t$this->id->AdvancedSearch->Save();\n\n\t\t// Field detail_jenis_spp\n\t\t$this->detail_jenis_spp->AdvancedSearch->SearchValue = @$filter[\"x_detail_jenis_spp\"];\n\t\t$this->detail_jenis_spp->AdvancedSearch->SearchOperator = @$filter[\"z_detail_jenis_spp\"];\n\t\t$this->detail_jenis_spp->AdvancedSearch->SearchCondition = @$filter[\"v_detail_jenis_spp\"];\n\t\t$this->detail_jenis_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_detail_jenis_spp\"];\n\t\t$this->detail_jenis_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_detail_jenis_spp\"];\n\t\t$this->detail_jenis_spp->AdvancedSearch->Save();\n\n\t\t// Field id_jenis_spp\n\t\t$this->id_jenis_spp->AdvancedSearch->SearchValue = @$filter[\"x_id_jenis_spp\"];\n\t\t$this->id_jenis_spp->AdvancedSearch->SearchOperator = @$filter[\"z_id_jenis_spp\"];\n\t\t$this->id_jenis_spp->AdvancedSearch->SearchCondition = @$filter[\"v_id_jenis_spp\"];\n\t\t$this->id_jenis_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_id_jenis_spp\"];\n\t\t$this->id_jenis_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_jenis_spp\"];\n\t\t$this->id_jenis_spp->AdvancedSearch->Save();\n\n\t\t// Field status_spp\n\t\t$this->status_spp->AdvancedSearch->SearchValue = @$filter[\"x_status_spp\"];\n\t\t$this->status_spp->AdvancedSearch->SearchOperator = @$filter[\"z_status_spp\"];\n\t\t$this->status_spp->AdvancedSearch->SearchCondition = @$filter[\"v_status_spp\"];\n\t\t$this->status_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_status_spp\"];\n\t\t$this->status_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_status_spp\"];\n\t\t$this->status_spp->AdvancedSearch->Save();\n\n\t\t// Field no_spp\n\t\t$this->no_spp->AdvancedSearch->SearchValue = @$filter[\"x_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchOperator = @$filter[\"z_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchCondition = @$filter[\"v_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->Save();\n\n\t\t// Field tgl_spp\n\t\t$this->tgl_spp->AdvancedSearch->SearchValue = @$filter[\"x_tgl_spp\"];\n\t\t$this->tgl_spp->AdvancedSearch->SearchOperator = @$filter[\"z_tgl_spp\"];\n\t\t$this->tgl_spp->AdvancedSearch->SearchCondition = @$filter[\"v_tgl_spp\"];\n\t\t$this->tgl_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_tgl_spp\"];\n\t\t$this->tgl_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_tgl_spp\"];\n\t\t$this->tgl_spp->AdvancedSearch->Save();\n\n\t\t// Field keterangan\n\t\t$this->keterangan->AdvancedSearch->SearchValue = @$filter[\"x_keterangan\"];\n\t\t$this->keterangan->AdvancedSearch->SearchOperator = @$filter[\"z_keterangan\"];\n\t\t$this->keterangan->AdvancedSearch->SearchCondition = @$filter[\"v_keterangan\"];\n\t\t$this->keterangan->AdvancedSearch->SearchValue2 = @$filter[\"y_keterangan\"];\n\t\t$this->keterangan->AdvancedSearch->SearchOperator2 = @$filter[\"w_keterangan\"];\n\t\t$this->keterangan->AdvancedSearch->Save();\n\n\t\t// Field jumlah_up\n\t\t$this->jumlah_up->AdvancedSearch->SearchValue = @$filter[\"x_jumlah_up\"];\n\t\t$this->jumlah_up->AdvancedSearch->SearchOperator = @$filter[\"z_jumlah_up\"];\n\t\t$this->jumlah_up->AdvancedSearch->SearchCondition = @$filter[\"v_jumlah_up\"];\n\t\t$this->jumlah_up->AdvancedSearch->SearchValue2 = @$filter[\"y_jumlah_up\"];\n\t\t$this->jumlah_up->AdvancedSearch->SearchOperator2 = @$filter[\"w_jumlah_up\"];\n\t\t$this->jumlah_up->AdvancedSearch->Save();\n\n\t\t// Field bendahara\n\t\t$this->bendahara->AdvancedSearch->SearchValue = @$filter[\"x_bendahara\"];\n\t\t$this->bendahara->AdvancedSearch->SearchOperator = @$filter[\"z_bendahara\"];\n\t\t$this->bendahara->AdvancedSearch->SearchCondition = @$filter[\"v_bendahara\"];\n\t\t$this->bendahara->AdvancedSearch->SearchValue2 = @$filter[\"y_bendahara\"];\n\t\t$this->bendahara->AdvancedSearch->SearchOperator2 = @$filter[\"w_bendahara\"];\n\t\t$this->bendahara->AdvancedSearch->Save();\n\n\t\t// Field nama_pptk\n\t\t$this->nama_pptk->AdvancedSearch->SearchValue = @$filter[\"x_nama_pptk\"];\n\t\t$this->nama_pptk->AdvancedSearch->SearchOperator = @$filter[\"z_nama_pptk\"];\n\t\t$this->nama_pptk->AdvancedSearch->SearchCondition = @$filter[\"v_nama_pptk\"];\n\t\t$this->nama_pptk->AdvancedSearch->SearchValue2 = @$filter[\"y_nama_pptk\"];\n\t\t$this->nama_pptk->AdvancedSearch->SearchOperator2 = @$filter[\"w_nama_pptk\"];\n\t\t$this->nama_pptk->AdvancedSearch->Save();\n\n\t\t// Field nip_pptk\n\t\t$this->nip_pptk->AdvancedSearch->SearchValue = @$filter[\"x_nip_pptk\"];\n\t\t$this->nip_pptk->AdvancedSearch->SearchOperator = @$filter[\"z_nip_pptk\"];\n\t\t$this->nip_pptk->AdvancedSearch->SearchCondition = @$filter[\"v_nip_pptk\"];\n\t\t$this->nip_pptk->AdvancedSearch->SearchValue2 = @$filter[\"y_nip_pptk\"];\n\t\t$this->nip_pptk->AdvancedSearch->SearchOperator2 = @$filter[\"w_nip_pptk\"];\n\t\t$this->nip_pptk->AdvancedSearch->Save();\n\n\t\t// Field kode_program\n\t\t$this->kode_program->AdvancedSearch->SearchValue = @$filter[\"x_kode_program\"];\n\t\t$this->kode_program->AdvancedSearch->SearchOperator = @$filter[\"z_kode_program\"];\n\t\t$this->kode_program->AdvancedSearch->SearchCondition = @$filter[\"v_kode_program\"];\n\t\t$this->kode_program->AdvancedSearch->SearchValue2 = @$filter[\"y_kode_program\"];\n\t\t$this->kode_program->AdvancedSearch->SearchOperator2 = @$filter[\"w_kode_program\"];\n\t\t$this->kode_program->AdvancedSearch->Save();\n\n\t\t// Field kode_kegiatan\n\t\t$this->kode_kegiatan->AdvancedSearch->SearchValue = @$filter[\"x_kode_kegiatan\"];\n\t\t$this->kode_kegiatan->AdvancedSearch->SearchOperator = @$filter[\"z_kode_kegiatan\"];\n\t\t$this->kode_kegiatan->AdvancedSearch->SearchCondition = @$filter[\"v_kode_kegiatan\"];\n\t\t$this->kode_kegiatan->AdvancedSearch->SearchValue2 = @$filter[\"y_kode_kegiatan\"];\n\t\t$this->kode_kegiatan->AdvancedSearch->SearchOperator2 = @$filter[\"w_kode_kegiatan\"];\n\t\t$this->kode_kegiatan->AdvancedSearch->Save();\n\n\t\t// Field kode_sub_kegiatan\n\t\t$this->kode_sub_kegiatan->AdvancedSearch->SearchValue = @$filter[\"x_kode_sub_kegiatan\"];\n\t\t$this->kode_sub_kegiatan->AdvancedSearch->SearchOperator = @$filter[\"z_kode_sub_kegiatan\"];\n\t\t$this->kode_sub_kegiatan->AdvancedSearch->SearchCondition = @$filter[\"v_kode_sub_kegiatan\"];\n\t\t$this->kode_sub_kegiatan->AdvancedSearch->SearchValue2 = @$filter[\"y_kode_sub_kegiatan\"];\n\t\t$this->kode_sub_kegiatan->AdvancedSearch->SearchOperator2 = @$filter[\"w_kode_sub_kegiatan\"];\n\t\t$this->kode_sub_kegiatan->AdvancedSearch->Save();\n\n\t\t// Field tahun_anggaran\n\t\t$this->tahun_anggaran->AdvancedSearch->SearchValue = @$filter[\"x_tahun_anggaran\"];\n\t\t$this->tahun_anggaran->AdvancedSearch->SearchOperator = @$filter[\"z_tahun_anggaran\"];\n\t\t$this->tahun_anggaran->AdvancedSearch->SearchCondition = @$filter[\"v_tahun_anggaran\"];\n\t\t$this->tahun_anggaran->AdvancedSearch->SearchValue2 = @$filter[\"y_tahun_anggaran\"];\n\t\t$this->tahun_anggaran->AdvancedSearch->SearchOperator2 = @$filter[\"w_tahun_anggaran\"];\n\t\t$this->tahun_anggaran->AdvancedSearch->Save();\n\n\t\t// Field jumlah_spd\n\t\t$this->jumlah_spd->AdvancedSearch->SearchValue = @$filter[\"x_jumlah_spd\"];\n\t\t$this->jumlah_spd->AdvancedSearch->SearchOperator = @$filter[\"z_jumlah_spd\"];\n\t\t$this->jumlah_spd->AdvancedSearch->SearchCondition = @$filter[\"v_jumlah_spd\"];\n\t\t$this->jumlah_spd->AdvancedSearch->SearchValue2 = @$filter[\"y_jumlah_spd\"];\n\t\t$this->jumlah_spd->AdvancedSearch->SearchOperator2 = @$filter[\"w_jumlah_spd\"];\n\t\t$this->jumlah_spd->AdvancedSearch->Save();\n\n\t\t// Field nomer_dasar_spd\n\t\t$this->nomer_dasar_spd->AdvancedSearch->SearchValue = @$filter[\"x_nomer_dasar_spd\"];\n\t\t$this->nomer_dasar_spd->AdvancedSearch->SearchOperator = @$filter[\"z_nomer_dasar_spd\"];\n\t\t$this->nomer_dasar_spd->AdvancedSearch->SearchCondition = @$filter[\"v_nomer_dasar_spd\"];\n\t\t$this->nomer_dasar_spd->AdvancedSearch->SearchValue2 = @$filter[\"y_nomer_dasar_spd\"];\n\t\t$this->nomer_dasar_spd->AdvancedSearch->SearchOperator2 = @$filter[\"w_nomer_dasar_spd\"];\n\t\t$this->nomer_dasar_spd->AdvancedSearch->Save();\n\n\t\t// Field tanggal_spd\n\t\t$this->tanggal_spd->AdvancedSearch->SearchValue = @$filter[\"x_tanggal_spd\"];\n\t\t$this->tanggal_spd->AdvancedSearch->SearchOperator = @$filter[\"z_tanggal_spd\"];\n\t\t$this->tanggal_spd->AdvancedSearch->SearchCondition = @$filter[\"v_tanggal_spd\"];\n\t\t$this->tanggal_spd->AdvancedSearch->SearchValue2 = @$filter[\"y_tanggal_spd\"];\n\t\t$this->tanggal_spd->AdvancedSearch->SearchOperator2 = @$filter[\"w_tanggal_spd\"];\n\t\t$this->tanggal_spd->AdvancedSearch->Save();\n\n\t\t// Field id_spd\n\t\t$this->id_spd->AdvancedSearch->SearchValue = @$filter[\"x_id_spd\"];\n\t\t$this->id_spd->AdvancedSearch->SearchOperator = @$filter[\"z_id_spd\"];\n\t\t$this->id_spd->AdvancedSearch->SearchCondition = @$filter[\"v_id_spd\"];\n\t\t$this->id_spd->AdvancedSearch->SearchValue2 = @$filter[\"y_id_spd\"];\n\t\t$this->id_spd->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_spd\"];\n\t\t$this->id_spd->AdvancedSearch->Save();\n\n\t\t// Field kode_rekening\n\t\t$this->kode_rekening->AdvancedSearch->SearchValue = @$filter[\"x_kode_rekening\"];\n\t\t$this->kode_rekening->AdvancedSearch->SearchOperator = @$filter[\"z_kode_rekening\"];\n\t\t$this->kode_rekening->AdvancedSearch->SearchCondition = @$filter[\"v_kode_rekening\"];\n\t\t$this->kode_rekening->AdvancedSearch->SearchValue2 = @$filter[\"y_kode_rekening\"];\n\t\t$this->kode_rekening->AdvancedSearch->SearchOperator2 = @$filter[\"w_kode_rekening\"];\n\t\t$this->kode_rekening->AdvancedSearch->Save();\n\n\t\t// Field nama_bendahara\n\t\t$this->nama_bendahara->AdvancedSearch->SearchValue = @$filter[\"x_nama_bendahara\"];\n\t\t$this->nama_bendahara->AdvancedSearch->SearchOperator = @$filter[\"z_nama_bendahara\"];\n\t\t$this->nama_bendahara->AdvancedSearch->SearchCondition = @$filter[\"v_nama_bendahara\"];\n\t\t$this->nama_bendahara->AdvancedSearch->SearchValue2 = @$filter[\"y_nama_bendahara\"];\n\t\t$this->nama_bendahara->AdvancedSearch->SearchOperator2 = @$filter[\"w_nama_bendahara\"];\n\t\t$this->nama_bendahara->AdvancedSearch->Save();\n\n\t\t// Field nip_bendahara\n\t\t$this->nip_bendahara->AdvancedSearch->SearchValue = @$filter[\"x_nip_bendahara\"];\n\t\t$this->nip_bendahara->AdvancedSearch->SearchOperator = @$filter[\"z_nip_bendahara\"];\n\t\t$this->nip_bendahara->AdvancedSearch->SearchCondition = @$filter[\"v_nip_bendahara\"];\n\t\t$this->nip_bendahara->AdvancedSearch->SearchValue2 = @$filter[\"y_nip_bendahara\"];\n\t\t$this->nip_bendahara->AdvancedSearch->SearchOperator2 = @$filter[\"w_nip_bendahara\"];\n\t\t$this->nip_bendahara->AdvancedSearch->Save();\n\n\t\t// Field no_spm\n\t\t$this->no_spm->AdvancedSearch->SearchValue = @$filter[\"x_no_spm\"];\n\t\t$this->no_spm->AdvancedSearch->SearchOperator = @$filter[\"z_no_spm\"];\n\t\t$this->no_spm->AdvancedSearch->SearchCondition = @$filter[\"v_no_spm\"];\n\t\t$this->no_spm->AdvancedSearch->SearchValue2 = @$filter[\"y_no_spm\"];\n\t\t$this->no_spm->AdvancedSearch->SearchOperator2 = @$filter[\"w_no_spm\"];\n\t\t$this->no_spm->AdvancedSearch->Save();\n\n\t\t// Field tgl_spm\n\t\t$this->tgl_spm->AdvancedSearch->SearchValue = @$filter[\"x_tgl_spm\"];\n\t\t$this->tgl_spm->AdvancedSearch->SearchOperator = @$filter[\"z_tgl_spm\"];\n\t\t$this->tgl_spm->AdvancedSearch->SearchCondition = @$filter[\"v_tgl_spm\"];\n\t\t$this->tgl_spm->AdvancedSearch->SearchValue2 = @$filter[\"y_tgl_spm\"];\n\t\t$this->tgl_spm->AdvancedSearch->SearchOperator2 = @$filter[\"w_tgl_spm\"];\n\t\t$this->tgl_spm->AdvancedSearch->Save();\n\n\t\t// Field status_spm\n\t\t$this->status_spm->AdvancedSearch->SearchValue = @$filter[\"x_status_spm\"];\n\t\t$this->status_spm->AdvancedSearch->SearchOperator = @$filter[\"z_status_spm\"];\n\t\t$this->status_spm->AdvancedSearch->SearchCondition = @$filter[\"v_status_spm\"];\n\t\t$this->status_spm->AdvancedSearch->SearchValue2 = @$filter[\"y_status_spm\"];\n\t\t$this->status_spm->AdvancedSearch->SearchOperator2 = @$filter[\"w_status_spm\"];\n\t\t$this->status_spm->AdvancedSearch->Save();\n\n\t\t// Field nama_bank\n\t\t$this->nama_bank->AdvancedSearch->SearchValue = @$filter[\"x_nama_bank\"];\n\t\t$this->nama_bank->AdvancedSearch->SearchOperator = @$filter[\"z_nama_bank\"];\n\t\t$this->nama_bank->AdvancedSearch->SearchCondition = @$filter[\"v_nama_bank\"];\n\t\t$this->nama_bank->AdvancedSearch->SearchValue2 = @$filter[\"y_nama_bank\"];\n\t\t$this->nama_bank->AdvancedSearch->SearchOperator2 = @$filter[\"w_nama_bank\"];\n\t\t$this->nama_bank->AdvancedSearch->Save();\n\n\t\t// Field nomer_rekening_bank\n\t\t$this->nomer_rekening_bank->AdvancedSearch->SearchValue = @$filter[\"x_nomer_rekening_bank\"];\n\t\t$this->nomer_rekening_bank->AdvancedSearch->SearchOperator = @$filter[\"z_nomer_rekening_bank\"];\n\t\t$this->nomer_rekening_bank->AdvancedSearch->SearchCondition = @$filter[\"v_nomer_rekening_bank\"];\n\t\t$this->nomer_rekening_bank->AdvancedSearch->SearchValue2 = @$filter[\"y_nomer_rekening_bank\"];\n\t\t$this->nomer_rekening_bank->AdvancedSearch->SearchOperator2 = @$filter[\"w_nomer_rekening_bank\"];\n\t\t$this->nomer_rekening_bank->AdvancedSearch->Save();\n\n\t\t// Field npwp\n\t\t$this->npwp->AdvancedSearch->SearchValue = @$filter[\"x_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchOperator = @$filter[\"z_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchCondition = @$filter[\"v_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchValue2 = @$filter[\"y_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchOperator2 = @$filter[\"w_npwp\"];\n\t\t$this->npwp->AdvancedSearch->Save();\n\n\t\t// Field pimpinan_blud\n\t\t$this->pimpinan_blud->AdvancedSearch->SearchValue = @$filter[\"x_pimpinan_blud\"];\n\t\t$this->pimpinan_blud->AdvancedSearch->SearchOperator = @$filter[\"z_pimpinan_blud\"];\n\t\t$this->pimpinan_blud->AdvancedSearch->SearchCondition = @$filter[\"v_pimpinan_blud\"];\n\t\t$this->pimpinan_blud->AdvancedSearch->SearchValue2 = @$filter[\"y_pimpinan_blud\"];\n\t\t$this->pimpinan_blud->AdvancedSearch->SearchOperator2 = @$filter[\"w_pimpinan_blud\"];\n\t\t$this->pimpinan_blud->AdvancedSearch->Save();\n\n\t\t// Field nip_pimpinan\n\t\t$this->nip_pimpinan->AdvancedSearch->SearchValue = @$filter[\"x_nip_pimpinan\"];\n\t\t$this->nip_pimpinan->AdvancedSearch->SearchOperator = @$filter[\"z_nip_pimpinan\"];\n\t\t$this->nip_pimpinan->AdvancedSearch->SearchCondition = @$filter[\"v_nip_pimpinan\"];\n\t\t$this->nip_pimpinan->AdvancedSearch->SearchValue2 = @$filter[\"y_nip_pimpinan\"];\n\t\t$this->nip_pimpinan->AdvancedSearch->SearchOperator2 = @$filter[\"w_nip_pimpinan\"];\n\t\t$this->nip_pimpinan->AdvancedSearch->Save();\n\n\t\t// Field no_sptb\n\t\t$this->no_sptb->AdvancedSearch->SearchValue = @$filter[\"x_no_sptb\"];\n\t\t$this->no_sptb->AdvancedSearch->SearchOperator = @$filter[\"z_no_sptb\"];\n\t\t$this->no_sptb->AdvancedSearch->SearchCondition = @$filter[\"v_no_sptb\"];\n\t\t$this->no_sptb->AdvancedSearch->SearchValue2 = @$filter[\"y_no_sptb\"];\n\t\t$this->no_sptb->AdvancedSearch->SearchOperator2 = @$filter[\"w_no_sptb\"];\n\t\t$this->no_sptb->AdvancedSearch->Save();\n\n\t\t// Field tgl_sptb\n\t\t$this->tgl_sptb->AdvancedSearch->SearchValue = @$filter[\"x_tgl_sptb\"];\n\t\t$this->tgl_sptb->AdvancedSearch->SearchOperator = @$filter[\"z_tgl_sptb\"];\n\t\t$this->tgl_sptb->AdvancedSearch->SearchCondition = @$filter[\"v_tgl_sptb\"];\n\t\t$this->tgl_sptb->AdvancedSearch->SearchValue2 = @$filter[\"y_tgl_sptb\"];\n\t\t$this->tgl_sptb->AdvancedSearch->SearchOperator2 = @$filter[\"w_tgl_sptb\"];\n\t\t$this->tgl_sptb->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}", "protected function prepareFilter()\n\t{\n\t\tglobal $USER;\n\t\tglobal $DB;\n\n\t\t$arFilter = array();\n\t\t$arFilter[\"USER_ID\"] = $USER->GetID();\n\t\t$arFilter[\"LID\"] = SITE_ID;\n\n\t\tif (strlen($_REQUEST[\"filter_id\"]))\n\t\t{\n\t\t\tif ($this->options['USE_ACCOUNT_NUMBER'])\n\t\t\t\t$arFilter[\"ACCOUNT_NUMBER\"] = $_REQUEST[\"filter_id\"];\n\t\t\telse\n\t\t\t\t$arFilter[\"ID\"] = intval($_REQUEST[\"filter_id\"]);\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_date_from\"]))\n\t\t\t$arFilter[\"DATE_FROM\"] = trim($_REQUEST[\"filter_date_from\"]);\n\t\tif (strlen($_REQUEST[\"filter_date_to\"]))\n\t\t{\n\t\t\t$arFilter[\"DATE_TO\"] = trim($_REQUEST[\"filter_date_to\"]);\n\n\t\t\tif ($arDate = ParseDateTime(trim($_REQUEST[\"filter_date_to\"]), $this->dateFormat))\n\t\t\t{\n\t\t\t\tif (StrLen(trim($_REQUEST[\"filter_date_to\"])) < 11)\n\t\t\t\t{\n\t\t\t\t\t$arDate[\"HH\"] = 23;\n\t\t\t\t\t$arDate[\"MI\"] = 59;\n\t\t\t\t\t$arDate[\"SS\"] = 59;\n\t\t\t\t}\n\n\t\t\t\t$arFilter[\"DATE_TO\"] = date($DB->DateFormatToPHP($this->dateFormat), mktime($arDate[\"HH\"], $arDate[\"MI\"], $arDate[\"SS\"], $arDate[\"MM\"], $arDate[\"DD\"], $arDate[\"YYYY\"]));\n\t\t\t}\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_status\"]))\n\t\t\t$arFilter[\"STATUS_ID\"] = trim($_REQUEST[\"filter_status\"]);\n\n\t\tif (strlen($_REQUEST[\"filter_payed\"]))\n\t\t\t$arFilter[\"PAYED\"] = trim($_REQUEST[\"filter_payed\"]);\n\n\t\tif(!isset($_REQUEST['show_all']) || $_REQUEST['show_all'] == 'N')\n\t\t{\n\t\t\tif($_REQUEST[\"filter_history\"]!=\"Y\")\n\t\t\t\t$arFilter[\"!@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\n\t\t\tif(isset($_REQUEST[\"filter_history\"]) && $_REQUEST[\"filter_history\"] == \"Y\")\n\t\t\t\t$arFilter[\"@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_canceled\"]))\n\t\t\t$arFilter[\"CANCELED\"] = trim($_REQUEST[\"filter_canceled\"]);\n\n\t\t$this->filter = $arFilter;\n\t}", "private function _applyFilter($filter)\n\t{\n\t\tglobal $context, $scripturl;\n\n\t\tif (isset($filter['variable']))\n\t\t{\n\t\t\t$context['filter'] = &$filter;\n\n\t\t\t// Set the filtering context.\n\t\t\tswitch ($filter['variable'])\n\t\t\t{\n\t\t\t\tcase 'id_member':\n\t\t\t\t\t$id = $filter['value']['sql'];\n\t\t\t\t\tMembersList::load($id, false, 'minimal');\n\t\t\t\t\t$name = MembersList::get($id)->real_name;\n\t\t\t\t\t$context['filter']['value']['html'] = '<a href=\"' . getUrl('profile', ['action' => 'profile', 'u' => $id, 'name' => $name]) . '\">' . $name . '</a>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'url':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars((substr($filter['value']['sql'], 0, 1) === '?' ? $scripturl : '') . $filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array('\\_' => '_')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'message':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\t$context['filter']['value']['html'] = preg_replace('~&amp;lt;span class=&amp;quot;remove&amp;quot;&amp;gt;(.+?)&amp;lt;/span&amp;gt;~', '$1', $context['filter']['value']['html']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'error_type':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$context['filter']['value']['html'] = &$filter['value']['sql'];\n\t\t\t}\n\t\t}\n\t}", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "private function store()\n {\n $db = DataAccess::getInstance();\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n $columns = \"value_scalar\";\n $values = \"?\";\n if ($this->isLeveled()) {\n $data = array($this->value['id']);\n } else {\n $data = array($this->value);\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n $columns = \"value_range_low, value_range_high\";\n $values = \"?,?\";\n $data = array($this->value['low'], $this->value['high']);\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n $session = geoSession::getInstance()->initSession();\n $sql = \"REPLACE INTO \" . geoTables::browsing_filters . \" (session_id, target, category, $columns) VALUES ('$session','{$this->target}','\" . self::getActiveCategory() . \"', $values)\";\n $db->Execute($sql, $data);\n }", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(@$_POST[\"filter\"], TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field id\n\t\t$this->id->AdvancedSearch->SearchValue = @$filter[\"x_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator = @$filter[\"z_id\"];\n\t\t$this->id->AdvancedSearch->SearchCondition = @$filter[\"v_id\"];\n\t\t$this->id->AdvancedSearch->SearchValue2 = @$filter[\"y_id\"];\n\t\t$this->id->AdvancedSearch->SearchOperator2 = @$filter[\"w_id\"];\n\t\t$this->id->AdvancedSearch->Save();\n\n\t\t// Field nombre_contacto\n\t\t$this->nombre_contacto->AdvancedSearch->SearchValue = @$filter[\"x_nombre_contacto\"];\n\t\t$this->nombre_contacto->AdvancedSearch->SearchOperator = @$filter[\"z_nombre_contacto\"];\n\t\t$this->nombre_contacto->AdvancedSearch->SearchCondition = @$filter[\"v_nombre_contacto\"];\n\t\t$this->nombre_contacto->AdvancedSearch->SearchValue2 = @$filter[\"y_nombre_contacto\"];\n\t\t$this->nombre_contacto->AdvancedSearch->SearchOperator2 = @$filter[\"w_nombre_contacto\"];\n\t\t$this->nombre_contacto->AdvancedSearch->Save();\n\n\t\t// Field name\n\t\t$this->name->AdvancedSearch->SearchValue = @$filter[\"x_name\"];\n\t\t$this->name->AdvancedSearch->SearchOperator = @$filter[\"z_name\"];\n\t\t$this->name->AdvancedSearch->SearchCondition = @$filter[\"v_name\"];\n\t\t$this->name->AdvancedSearch->SearchValue2 = @$filter[\"y_name\"];\n\t\t$this->name->AdvancedSearch->SearchOperator2 = @$filter[\"w_name\"];\n\t\t$this->name->AdvancedSearch->Save();\n\n\t\t// Field lastname\n\t\t$this->lastname->AdvancedSearch->SearchValue = @$filter[\"x_lastname\"];\n\t\t$this->lastname->AdvancedSearch->SearchOperator = @$filter[\"z_lastname\"];\n\t\t$this->lastname->AdvancedSearch->SearchCondition = @$filter[\"v_lastname\"];\n\t\t$this->lastname->AdvancedSearch->SearchValue2 = @$filter[\"y_lastname\"];\n\t\t$this->lastname->AdvancedSearch->SearchOperator2 = @$filter[\"w_lastname\"];\n\t\t$this->lastname->AdvancedSearch->Save();\n\n\t\t// Field email\n\t\t$this->_email->AdvancedSearch->SearchValue = @$filter[\"x__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator = @$filter[\"z__email\"];\n\t\t$this->_email->AdvancedSearch->SearchCondition = @$filter[\"v__email\"];\n\t\t$this->_email->AdvancedSearch->SearchValue2 = @$filter[\"y__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator2 = @$filter[\"w__email\"];\n\t\t$this->_email->AdvancedSearch->Save();\n\n\t\t// Field address\n\t\t$this->address->AdvancedSearch->SearchValue = @$filter[\"x_address\"];\n\t\t$this->address->AdvancedSearch->SearchOperator = @$filter[\"z_address\"];\n\t\t$this->address->AdvancedSearch->SearchCondition = @$filter[\"v_address\"];\n\t\t$this->address->AdvancedSearch->SearchValue2 = @$filter[\"y_address\"];\n\t\t$this->address->AdvancedSearch->SearchOperator2 = @$filter[\"w_address\"];\n\t\t$this->address->AdvancedSearch->Save();\n\n\t\t// Field phone\n\t\t$this->phone->AdvancedSearch->SearchValue = @$filter[\"x_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator = @$filter[\"z_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchCondition = @$filter[\"v_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchValue2 = @$filter[\"y_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator2 = @$filter[\"w_phone\"];\n\t\t$this->phone->AdvancedSearch->Save();\n\n\t\t// Field cell\n\t\t$this->cell->AdvancedSearch->SearchValue = @$filter[\"x_cell\"];\n\t\t$this->cell->AdvancedSearch->SearchOperator = @$filter[\"z_cell\"];\n\t\t$this->cell->AdvancedSearch->SearchCondition = @$filter[\"v_cell\"];\n\t\t$this->cell->AdvancedSearch->SearchValue2 = @$filter[\"y_cell\"];\n\t\t$this->cell->AdvancedSearch->SearchOperator2 = @$filter[\"w_cell\"];\n\t\t$this->cell->AdvancedSearch->Save();\n\n\t\t// Field created_at\n\t\t$this->created_at->AdvancedSearch->SearchValue = @$filter[\"x_created_at\"];\n\t\t$this->created_at->AdvancedSearch->SearchOperator = @$filter[\"z_created_at\"];\n\t\t$this->created_at->AdvancedSearch->SearchCondition = @$filter[\"v_created_at\"];\n\t\t$this->created_at->AdvancedSearch->SearchValue2 = @$filter[\"y_created_at\"];\n\t\t$this->created_at->AdvancedSearch->SearchOperator2 = @$filter[\"w_created_at\"];\n\t\t$this->created_at->AdvancedSearch->Save();\n\n\t\t// Field id_sucursal\n\t\t$this->id_sucursal->AdvancedSearch->SearchValue = @$filter[\"x_id_sucursal\"];\n\t\t$this->id_sucursal->AdvancedSearch->SearchOperator = @$filter[\"z_id_sucursal\"];\n\t\t$this->id_sucursal->AdvancedSearch->SearchCondition = @$filter[\"v_id_sucursal\"];\n\t\t$this->id_sucursal->AdvancedSearch->SearchValue2 = @$filter[\"y_id_sucursal\"];\n\t\t$this->id_sucursal->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_sucursal\"];\n\t\t$this->id_sucursal->AdvancedSearch->Save();\n\n\t\t// Field tipoinmueble\n\t\t$this->tipoinmueble->AdvancedSearch->SearchValue = @$filter[\"x_tipoinmueble\"];\n\t\t$this->tipoinmueble->AdvancedSearch->SearchOperator = @$filter[\"z_tipoinmueble\"];\n\t\t$this->tipoinmueble->AdvancedSearch->SearchCondition = @$filter[\"v_tipoinmueble\"];\n\t\t$this->tipoinmueble->AdvancedSearch->SearchValue2 = @$filter[\"y_tipoinmueble\"];\n\t\t$this->tipoinmueble->AdvancedSearch->SearchOperator2 = @$filter[\"w_tipoinmueble\"];\n\t\t$this->tipoinmueble->AdvancedSearch->Save();\n\n\t\t// Field id_ciudad_inmueble\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->SearchValue = @$filter[\"x_id_ciudad_inmueble\"];\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->SearchOperator = @$filter[\"z_id_ciudad_inmueble\"];\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->SearchCondition = @$filter[\"v_id_ciudad_inmueble\"];\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->SearchValue2 = @$filter[\"y_id_ciudad_inmueble\"];\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_ciudad_inmueble\"];\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->Save();\n\n\t\t// Field id_provincia_inmueble\n\t\t$this->id_provincia_inmueble->AdvancedSearch->SearchValue = @$filter[\"x_id_provincia_inmueble\"];\n\t\t$this->id_provincia_inmueble->AdvancedSearch->SearchOperator = @$filter[\"z_id_provincia_inmueble\"];\n\t\t$this->id_provincia_inmueble->AdvancedSearch->SearchCondition = @$filter[\"v_id_provincia_inmueble\"];\n\t\t$this->id_provincia_inmueble->AdvancedSearch->SearchValue2 = @$filter[\"y_id_provincia_inmueble\"];\n\t\t$this->id_provincia_inmueble->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_provincia_inmueble\"];\n\t\t$this->id_provincia_inmueble->AdvancedSearch->Save();\n\n\t\t// Field tipovehiculo\n\t\t$this->tipovehiculo->AdvancedSearch->SearchValue = @$filter[\"x_tipovehiculo\"];\n\t\t$this->tipovehiculo->AdvancedSearch->SearchOperator = @$filter[\"z_tipovehiculo\"];\n\t\t$this->tipovehiculo->AdvancedSearch->SearchCondition = @$filter[\"v_tipovehiculo\"];\n\t\t$this->tipovehiculo->AdvancedSearch->SearchValue2 = @$filter[\"y_tipovehiculo\"];\n\t\t$this->tipovehiculo->AdvancedSearch->SearchOperator2 = @$filter[\"w_tipovehiculo\"];\n\t\t$this->tipovehiculo->AdvancedSearch->Save();\n\n\t\t// Field id_ciudad_vehiculo\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->SearchValue = @$filter[\"x_id_ciudad_vehiculo\"];\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->SearchOperator = @$filter[\"z_id_ciudad_vehiculo\"];\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->SearchCondition = @$filter[\"v_id_ciudad_vehiculo\"];\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->SearchValue2 = @$filter[\"y_id_ciudad_vehiculo\"];\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_ciudad_vehiculo\"];\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->Save();\n\n\t\t// Field id_provincia_vehiculo\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->SearchValue = @$filter[\"x_id_provincia_vehiculo\"];\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->SearchOperator = @$filter[\"z_id_provincia_vehiculo\"];\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->SearchCondition = @$filter[\"v_id_provincia_vehiculo\"];\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->SearchValue2 = @$filter[\"y_id_provincia_vehiculo\"];\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_provincia_vehiculo\"];\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->Save();\n\n\t\t// Field tipomaquinaria\n\t\t$this->tipomaquinaria->AdvancedSearch->SearchValue = @$filter[\"x_tipomaquinaria\"];\n\t\t$this->tipomaquinaria->AdvancedSearch->SearchOperator = @$filter[\"z_tipomaquinaria\"];\n\t\t$this->tipomaquinaria->AdvancedSearch->SearchCondition = @$filter[\"v_tipomaquinaria\"];\n\t\t$this->tipomaquinaria->AdvancedSearch->SearchValue2 = @$filter[\"y_tipomaquinaria\"];\n\t\t$this->tipomaquinaria->AdvancedSearch->SearchOperator2 = @$filter[\"w_tipomaquinaria\"];\n\t\t$this->tipomaquinaria->AdvancedSearch->Save();\n\n\t\t// Field id_ciudad_maquinaria\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->SearchValue = @$filter[\"x_id_ciudad_maquinaria\"];\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->SearchOperator = @$filter[\"z_id_ciudad_maquinaria\"];\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->SearchCondition = @$filter[\"v_id_ciudad_maquinaria\"];\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->SearchValue2 = @$filter[\"y_id_ciudad_maquinaria\"];\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_ciudad_maquinaria\"];\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->Save();\n\n\t\t// Field id_provincia_maquinaria\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->SearchValue = @$filter[\"x_id_provincia_maquinaria\"];\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->SearchOperator = @$filter[\"z_id_provincia_maquinaria\"];\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->SearchCondition = @$filter[\"v_id_provincia_maquinaria\"];\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->SearchValue2 = @$filter[\"y_id_provincia_maquinaria\"];\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->SearchOperator2 = @$filter[\"w_id_provincia_maquinaria\"];\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->Save();\n\n\t\t// Field tipomercaderia\n\t\t$this->tipomercaderia->AdvancedSearch->SearchValue = @$filter[\"x_tipomercaderia\"];\n\t\t$this->tipomercaderia->AdvancedSearch->SearchOperator = @$filter[\"z_tipomercaderia\"];\n\t\t$this->tipomercaderia->AdvancedSearch->SearchCondition = @$filter[\"v_tipomercaderia\"];\n\t\t$this->tipomercaderia->AdvancedSearch->SearchValue2 = @$filter[\"y_tipomercaderia\"];\n\t\t$this->tipomercaderia->AdvancedSearch->SearchOperator2 = @$filter[\"w_tipomercaderia\"];\n\t\t$this->tipomercaderia->AdvancedSearch->Save();\n\n\t\t// Field documento_mercaderia\n\t\t$this->documento_mercaderia->AdvancedSearch->SearchValue = @$filter[\"x_documento_mercaderia\"];\n\t\t$this->documento_mercaderia->AdvancedSearch->SearchOperator = @$filter[\"z_documento_mercaderia\"];\n\t\t$this->documento_mercaderia->AdvancedSearch->SearchCondition = @$filter[\"v_documento_mercaderia\"];\n\t\t$this->documento_mercaderia->AdvancedSearch->SearchValue2 = @$filter[\"y_documento_mercaderia\"];\n\t\t$this->documento_mercaderia->AdvancedSearch->SearchOperator2 = @$filter[\"w_documento_mercaderia\"];\n\t\t$this->documento_mercaderia->AdvancedSearch->Save();\n\n\t\t// Field tipoespecial\n\t\t$this->tipoespecial->AdvancedSearch->SearchValue = @$filter[\"x_tipoespecial\"];\n\t\t$this->tipoespecial->AdvancedSearch->SearchOperator = @$filter[\"z_tipoespecial\"];\n\t\t$this->tipoespecial->AdvancedSearch->SearchCondition = @$filter[\"v_tipoespecial\"];\n\t\t$this->tipoespecial->AdvancedSearch->SearchValue2 = @$filter[\"y_tipoespecial\"];\n\t\t$this->tipoespecial->AdvancedSearch->SearchOperator2 = @$filter[\"w_tipoespecial\"];\n\t\t$this->tipoespecial->AdvancedSearch->Save();\n\n\t\t// Field email_contacto\n\t\t$this->email_contacto->AdvancedSearch->SearchValue = @$filter[\"x_email_contacto\"];\n\t\t$this->email_contacto->AdvancedSearch->SearchOperator = @$filter[\"z_email_contacto\"];\n\t\t$this->email_contacto->AdvancedSearch->SearchCondition = @$filter[\"v_email_contacto\"];\n\t\t$this->email_contacto->AdvancedSearch->SearchValue2 = @$filter[\"y_email_contacto\"];\n\t\t$this->email_contacto->AdvancedSearch->SearchOperator2 = @$filter[\"w_email_contacto\"];\n\t\t$this->email_contacto->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}", "function add() {\n $this->wireframe->print_button = false;\n \n if(!AssignmentFilter::canAdd($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n \t$filter_data = $this->request->post('filter');\n \tif(!is_array($filter_data)) {\n \t $filter_data = array(\n \t 'user_filter' => USER_FILTER_LOGGED_USER,\n \t 'objects_per_page' => 30,\n \t );\n \t} // if\n \t$this->smarty->assign('filter_data', $filter_data);\n \t\n \tif($this->request->isSubmitted()) {\n \t $this->active_filter = new AssignmentFilter();\n \t $this->active_filter->setAttributes($filter_data);\n \t \n \t $save = $this->active_filter->save();\n \t if($save && !is_error($save)) {\n \t flash_success(\"Filter ':name' has been created\", array('name' => $this->active_filter->getName()));\n \t $this->redirectToUrl($this->active_filter->getUrl());\n \t } else {\n \t $this->smarty->assign('errors', $save);\n \t } // if\n \t} // if\n }", "public function create() {\n\n if(\\Gate::denies('save', new \\Corp\\Filter())) {\n abort(403);\n }\n\n $this->title = 'New Filter';\n\n $this->content = view(config('settings.theme').'.admin.filter_create_content')->render();\n\n return $this->renderOutput();\n\n }", "public function setFilter(string $filter);", "public function alm_filters_updated(){\n\t \tif( isset( $_GET[\"filter_updated\"] ) ) {\n\t\t \t$this->alm_filters_add_admin_notice('<i class=\"fa fa-check-square\" style=\"color: #46b450\";></i>&nbsp; '.__('Filter successfully updated.', 'ajax-load-more-filters'), 'success');\n\t\t }\n\t }", "function AdminListAddFilter($entityId, &$arFilter)\n\t{\n\t\t$arUserFields = $this->GetUserFields($entityId);\n\t\tforeach($arUserFields as $fieldName => $arUserField)\n\t\t{\n\t\t\tif(\n\t\t\t\t$arUserField['SHOW_FILTER'] != 'N' &&\n\t\t\t\t$arUserField['USER_TYPE']['BASE_TYPE'] == 'datetime'\n\t\t\t)\n\t\t\t{\n\t\t\t\t$value1 = $GLOBALS['find_' . $fieldName . '_from'];\n\t\t\t\t$value2 = $GLOBALS['find_' . $fieldName . '_to'];\n\t\t\t\tif($this->IsNotEmpty($value1) && \\Bitrix\\Main\\Type\\Date::isCorrect($value1))\n\t\t\t\t{\n\t\t\t\t\t$date = new \\Bitrix\\Main\\Type\\Date($value1);\n\t\t\t\t\t$arFilter['>=' . $fieldName] = $date;\n\t\t\t\t}\n\t\t\t\tif($this->IsNotEmpty($value2) && \\Bitrix\\Main\\Type\\Date::isCorrect($value2))\n\t\t\t\t{\n\t\t\t\t\t$date = new \\Bitrix\\Main\\Type\\Date($value2);\n\t\t\t\t\tif($arUserField['USER_TYPE_ID'] != 'date')\n\t\t\t\t\t{\n\t\t\t\t\t\t$date->add('+1 day');\n\t\t\t\t\t}\n\t\t\t\t\t$arFilter['<=' . $fieldName] = $date;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = $GLOBALS['find_' . $fieldName];\n\t\t\t}\n\t\t\tif(\n\t\t\t\t$arUserField['SHOW_FILTER'] != 'N'\n\t\t\t\t&& $arUserField['USER_TYPE']['BASE_TYPE'] != 'file'\n\t\t\t\t&& $this->IsNotEmpty($value)\n\t\t\t)\n\t\t\t{\n\t\t\t\tif($arUserField['SHOW_FILTER'] == 'I')\n\t\t\t\t{\n\t\t\t\t\t$arFilter['=' . $fieldName] = $value;\n\t\t\t\t}\n\t\t\t\telseif($arUserField['SHOW_FILTER'] == 'S')\n\t\t\t\t{\n\t\t\t\t\t$arFilter['%' . $fieldName] = $value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$arFilter[$fieldName] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function register_filters() {\n\n\t\t}", "function submitFeedback($data, $filter, $map_coordinates, $fossil_selection){\n $where = [];\n $i = 0;\n \n $where[$i] = \"genus = '\" . $filter['genus'].\"'\";\n $i += 1;\n\n\n $where[$i] = \"age_min = \" . $filter['age_min'];\n $i += 1;\n\n $where[$i] = \"age_max = \" . $filter['age_max'];\n $i += 1;\n \n\n $where[$i] = \"collector = '\" . $filter['collector'].\"'\";\n $i += 1;\n\n $where[$i] = \"\";\n\n $where_string = \"\";\n\n if ($i != 0)\n {\n for ($j=0; $j<$i-1; $j++)\n {\n $where_string .= $where[$j] . \" AND \";\n }\n \n $where_string .= $where[$i-1]; \n }\n else {\n $where_string = \" 1\";\n }\n\n $filter_id = -1;\n //$map_coordinates_id = -1;\n\n //querying the database to find the filter id\n $query_filter = $this->db->query('SELECT filter_id FROM filter WHERE '.$where_string);\n\n\n if ($query_filter->num_rows() > 0)\n {\n //if we found a matching filter we get its id to save the new feddback\n $temp = $query_filter->row_array();\n $filter_id = $temp['filter_id'];\n\n } else {\n //if not we create this new filter before inserting the new feedback\n if($this->db->insert('filter', $filter))\n {\n $query_filter_second = $this->db->query('SELECT filter_id FROM filter WHERE '.$where_string);\n if ($query_filter_second->num_rows() > 0)\n {\n $temp = $query_filter_second->row_array();\n $filter_id = $temp['filter_id'];\n }\n }\n\n }\n\n $data['filter_id'] = $filter_id;\n $data['map_coordinates_id'] = 0;\n\n //adding the map_coordinates\n if($this->db->insert('map_coordinates', $map_coordinates)){\n \n $query_map_coord = $this->db->query(\"SELECT map_coordinates_id FROM map_coordinates WHERE map_lat_ne='\".$map_coordinates['map_lat_ne'].\"' and map_lng_ne='\".$map_coordinates['map_lng_ne'].\"' and map_lat_sw='\".$map_coordinates['map_lat_sw'].\"' and map_lng_sw='\".$map_coordinates['map_lng_sw'].\"' and map_center_lat='\".$map_coordinates['map_center_lat'].\"' and map_center_lng='\".$map_coordinates['map_center_lng'].\"'and map_zoom='\".$map_coordinates['map_zoom'].\"'\");\n if($query_map_coord->num_rows() > 0){\n $temp=$query_map_coord->row_array();\n $data['map_coordinates_id'] = $temp[\"map_coordinates_id\"];\n }\n }\n\n if($this->db->insert('feedback', $data))\n {\n $query_feedback = $this->db->query(\"SELECT feedback_id FROM feedback WHERE user_id='\".$data['user_id'] . \"' and time='\" . $data['time'].\"' and message='\" . $data['message']. \"' and filter_id='\" . $data['filter_id'].\"' and map_coordinates_id='\" . $data['map_coordinates_id'].\"'\");\n\n if ($query_feedback->num_rows() > 0)\n {\n $temp = $query_feedback->row_array();\n $feedback_id = $temp['feedback_id'];\n\n foreach ($fossil_selection as $fossil) {\n $data = array(\n 'feedback_id' => $feedback_id,\n 'data_table' => \"project_1_data\",\n 'data_id' => $fossil\n );\n $this->db->insert(\"feedback_fossil\", $data);\n }\n }\n }\n }", "function save($data, $orderingFilter = '', $ignore = ''){\n \t\t$this->bind($data); \t\n// \t\tdebug($this);die;\n \t\tif(!$this->check()){\n \t\t\treturn false;\n \t\t}\n \t\treturn $this->store();\t\t\n\t}", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(@$_POST[\"filter\"], TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field tanggal\n\t\t$this->tanggal->AdvancedSearch->SearchValue = @$filter[\"x_tanggal\"];\n\t\t$this->tanggal->AdvancedSearch->SearchOperator = @$filter[\"z_tanggal\"];\n\t\t$this->tanggal->AdvancedSearch->SearchCondition = @$filter[\"v_tanggal\"];\n\t\t$this->tanggal->AdvancedSearch->SearchValue2 = @$filter[\"y_tanggal\"];\n\t\t$this->tanggal->AdvancedSearch->SearchOperator2 = @$filter[\"w_tanggal\"];\n\t\t$this->tanggal->AdvancedSearch->Save();\n\n\t\t// Field auc_number\n\t\t$this->auc_number->AdvancedSearch->SearchValue = @$filter[\"x_auc_number\"];\n\t\t$this->auc_number->AdvancedSearch->SearchOperator = @$filter[\"z_auc_number\"];\n\t\t$this->auc_number->AdvancedSearch->SearchCondition = @$filter[\"v_auc_number\"];\n\t\t$this->auc_number->AdvancedSearch->SearchValue2 = @$filter[\"y_auc_number\"];\n\t\t$this->auc_number->AdvancedSearch->SearchOperator2 = @$filter[\"w_auc_number\"];\n\t\t$this->auc_number->AdvancedSearch->Save();\n\n\t\t// Field start_bid\n\t\t$this->start_bid->AdvancedSearch->SearchValue = @$filter[\"x_start_bid\"];\n\t\t$this->start_bid->AdvancedSearch->SearchOperator = @$filter[\"z_start_bid\"];\n\t\t$this->start_bid->AdvancedSearch->SearchCondition = @$filter[\"v_start_bid\"];\n\t\t$this->start_bid->AdvancedSearch->SearchValue2 = @$filter[\"y_start_bid\"];\n\t\t$this->start_bid->AdvancedSearch->SearchOperator2 = @$filter[\"w_start_bid\"];\n\t\t$this->start_bid->AdvancedSearch->Save();\n\n\t\t// Field close_bid\n\t\t$this->close_bid->AdvancedSearch->SearchValue = @$filter[\"x_close_bid\"];\n\t\t$this->close_bid->AdvancedSearch->SearchOperator = @$filter[\"z_close_bid\"];\n\t\t$this->close_bid->AdvancedSearch->SearchCondition = @$filter[\"v_close_bid\"];\n\t\t$this->close_bid->AdvancedSearch->SearchValue2 = @$filter[\"y_close_bid\"];\n\t\t$this->close_bid->AdvancedSearch->SearchOperator2 = @$filter[\"w_close_bid\"];\n\t\t$this->close_bid->AdvancedSearch->Save();\n\n\t\t// Field lot_number\n\t\t$this->lot_number->AdvancedSearch->SearchValue = @$filter[\"x_lot_number\"];\n\t\t$this->lot_number->AdvancedSearch->SearchOperator = @$filter[\"z_lot_number\"];\n\t\t$this->lot_number->AdvancedSearch->SearchCondition = @$filter[\"v_lot_number\"];\n\t\t$this->lot_number->AdvancedSearch->SearchValue2 = @$filter[\"y_lot_number\"];\n\t\t$this->lot_number->AdvancedSearch->SearchOperator2 = @$filter[\"w_lot_number\"];\n\t\t$this->lot_number->AdvancedSearch->Save();\n\n\t\t// Field chop\n\t\t$this->chop->AdvancedSearch->SearchValue = @$filter[\"x_chop\"];\n\t\t$this->chop->AdvancedSearch->SearchOperator = @$filter[\"z_chop\"];\n\t\t$this->chop->AdvancedSearch->SearchCondition = @$filter[\"v_chop\"];\n\t\t$this->chop->AdvancedSearch->SearchValue2 = @$filter[\"y_chop\"];\n\t\t$this->chop->AdvancedSearch->SearchOperator2 = @$filter[\"w_chop\"];\n\t\t$this->chop->AdvancedSearch->Save();\n\n\t\t// Field grade\n\t\t$this->grade->AdvancedSearch->SearchValue = @$filter[\"x_grade\"];\n\t\t$this->grade->AdvancedSearch->SearchOperator = @$filter[\"z_grade\"];\n\t\t$this->grade->AdvancedSearch->SearchCondition = @$filter[\"v_grade\"];\n\t\t$this->grade->AdvancedSearch->SearchValue2 = @$filter[\"y_grade\"];\n\t\t$this->grade->AdvancedSearch->SearchOperator2 = @$filter[\"w_grade\"];\n\t\t$this->grade->AdvancedSearch->Save();\n\n\t\t// Field estate\n\t\t$this->estate->AdvancedSearch->SearchValue = @$filter[\"x_estate\"];\n\t\t$this->estate->AdvancedSearch->SearchOperator = @$filter[\"z_estate\"];\n\t\t$this->estate->AdvancedSearch->SearchCondition = @$filter[\"v_estate\"];\n\t\t$this->estate->AdvancedSearch->SearchValue2 = @$filter[\"y_estate\"];\n\t\t$this->estate->AdvancedSearch->SearchOperator2 = @$filter[\"w_estate\"];\n\t\t$this->estate->AdvancedSearch->Save();\n\n\t\t// Field sack\n\t\t$this->sack->AdvancedSearch->SearchValue = @$filter[\"x_sack\"];\n\t\t$this->sack->AdvancedSearch->SearchOperator = @$filter[\"z_sack\"];\n\t\t$this->sack->AdvancedSearch->SearchCondition = @$filter[\"v_sack\"];\n\t\t$this->sack->AdvancedSearch->SearchValue2 = @$filter[\"y_sack\"];\n\t\t$this->sack->AdvancedSearch->SearchOperator2 = @$filter[\"w_sack\"];\n\t\t$this->sack->AdvancedSearch->Save();\n\n\t\t// Field netto\n\t\t$this->netto->AdvancedSearch->SearchValue = @$filter[\"x_netto\"];\n\t\t$this->netto->AdvancedSearch->SearchOperator = @$filter[\"z_netto\"];\n\t\t$this->netto->AdvancedSearch->SearchCondition = @$filter[\"v_netto\"];\n\t\t$this->netto->AdvancedSearch->SearchValue2 = @$filter[\"y_netto\"];\n\t\t$this->netto->AdvancedSearch->SearchOperator2 = @$filter[\"w_netto\"];\n\t\t$this->netto->AdvancedSearch->Save();\n\n\t\t// Field open_bid\n\t\t$this->open_bid->AdvancedSearch->SearchValue = @$filter[\"x_open_bid\"];\n\t\t$this->open_bid->AdvancedSearch->SearchOperator = @$filter[\"z_open_bid\"];\n\t\t$this->open_bid->AdvancedSearch->SearchCondition = @$filter[\"v_open_bid\"];\n\t\t$this->open_bid->AdvancedSearch->SearchValue2 = @$filter[\"y_open_bid\"];\n\t\t$this->open_bid->AdvancedSearch->SearchOperator2 = @$filter[\"w_open_bid\"];\n\t\t$this->open_bid->AdvancedSearch->Save();\n\n\t\t// Field last_bid\n\t\t$this->last_bid->AdvancedSearch->SearchValue = @$filter[\"x_last_bid\"];\n\t\t$this->last_bid->AdvancedSearch->SearchOperator = @$filter[\"z_last_bid\"];\n\t\t$this->last_bid->AdvancedSearch->SearchCondition = @$filter[\"v_last_bid\"];\n\t\t$this->last_bid->AdvancedSearch->SearchValue2 = @$filter[\"y_last_bid\"];\n\t\t$this->last_bid->AdvancedSearch->SearchOperator2 = @$filter[\"w_last_bid\"];\n\t\t$this->last_bid->AdvancedSearch->Save();\n\n\t\t// Field highest_bid\n\t\t$this->highest_bid->AdvancedSearch->SearchValue = @$filter[\"x_highest_bid\"];\n\t\t$this->highest_bid->AdvancedSearch->SearchOperator = @$filter[\"z_highest_bid\"];\n\t\t$this->highest_bid->AdvancedSearch->SearchCondition = @$filter[\"v_highest_bid\"];\n\t\t$this->highest_bid->AdvancedSearch->SearchValue2 = @$filter[\"y_highest_bid\"];\n\t\t$this->highest_bid->AdvancedSearch->SearchOperator2 = @$filter[\"w_highest_bid\"];\n\t\t$this->highest_bid->AdvancedSearch->Save();\n\n\t\t// Field enter_bid\n\t\t$this->enter_bid->AdvancedSearch->SearchValue = @$filter[\"x_enter_bid\"];\n\t\t$this->enter_bid->AdvancedSearch->SearchOperator = @$filter[\"z_enter_bid\"];\n\t\t$this->enter_bid->AdvancedSearch->SearchCondition = @$filter[\"v_enter_bid\"];\n\t\t$this->enter_bid->AdvancedSearch->SearchValue2 = @$filter[\"y_enter_bid\"];\n\t\t$this->enter_bid->AdvancedSearch->SearchOperator2 = @$filter[\"w_enter_bid\"];\n\t\t$this->enter_bid->AdvancedSearch->Save();\n\n\t\t// Field auction_status\n\t\t$this->auction_status->AdvancedSearch->SearchValue = @$filter[\"x_auction_status\"];\n\t\t$this->auction_status->AdvancedSearch->SearchOperator = @$filter[\"z_auction_status\"];\n\t\t$this->auction_status->AdvancedSearch->SearchCondition = @$filter[\"v_auction_status\"];\n\t\t$this->auction_status->AdvancedSearch->SearchValue2 = @$filter[\"y_auction_status\"];\n\t\t$this->auction_status->AdvancedSearch->SearchOperator2 = @$filter[\"w_auction_status\"];\n\t\t$this->auction_status->AdvancedSearch->Save();\n\n\t\t// Field gross\n\t\t$this->gross->AdvancedSearch->SearchValue = @$filter[\"x_gross\"];\n\t\t$this->gross->AdvancedSearch->SearchOperator = @$filter[\"z_gross\"];\n\t\t$this->gross->AdvancedSearch->SearchCondition = @$filter[\"v_gross\"];\n\t\t$this->gross->AdvancedSearch->SearchValue2 = @$filter[\"y_gross\"];\n\t\t$this->gross->AdvancedSearch->SearchOperator2 = @$filter[\"w_gross\"];\n\t\t$this->gross->AdvancedSearch->Save();\n\n\t\t// Field row_id\n\t\t$this->row_id->AdvancedSearch->SearchValue = @$filter[\"x_row_id\"];\n\t\t$this->row_id->AdvancedSearch->SearchOperator = @$filter[\"z_row_id\"];\n\t\t$this->row_id->AdvancedSearch->SearchCondition = @$filter[\"v_row_id\"];\n\t\t$this->row_id->AdvancedSearch->SearchValue2 = @$filter[\"y_row_id\"];\n\t\t$this->row_id->AdvancedSearch->SearchOperator2 = @$filter[\"w_row_id\"];\n\t\t$this->row_id->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}", "function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(ew_StripSlashes(@$_POST[\"filter\"]), TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field tgl\n\t\t$this->tgl->AdvancedSearch->SearchValue = @$filter[\"x_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchOperator = @$filter[\"z_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchCondition = @$filter[\"v_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchValue2 = @$filter[\"y_tgl\"];\n\t\t$this->tgl->AdvancedSearch->SearchOperator2 = @$filter[\"w_tgl\"];\n\t\t$this->tgl->AdvancedSearch->Save();\n\n\t\t// Field no_spp\n\t\t$this->no_spp->AdvancedSearch->SearchValue = @$filter[\"x_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchOperator = @$filter[\"z_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchCondition = @$filter[\"v_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_no_spp\"];\n\t\t$this->no_spp->AdvancedSearch->Save();\n\n\t\t// Field jns_spp\n\t\t$this->jns_spp->AdvancedSearch->SearchValue = @$filter[\"x_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchOperator = @$filter[\"z_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchCondition = @$filter[\"v_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchValue2 = @$filter[\"y_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->SearchOperator2 = @$filter[\"w_jns_spp\"];\n\t\t$this->jns_spp->AdvancedSearch->Save();\n\n\t\t// Field kd_mata\n\t\t$this->kd_mata->AdvancedSearch->SearchValue = @$filter[\"x_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchOperator = @$filter[\"z_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchCondition = @$filter[\"v_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchValue2 = @$filter[\"y_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->SearchOperator2 = @$filter[\"w_kd_mata\"];\n\t\t$this->kd_mata->AdvancedSearch->Save();\n\n\t\t// Field urai\n\t\t$this->urai->AdvancedSearch->SearchValue = @$filter[\"x_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchOperator = @$filter[\"z_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchCondition = @$filter[\"v_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchValue2 = @$filter[\"y_urai\"];\n\t\t$this->urai->AdvancedSearch->SearchOperator2 = @$filter[\"w_urai\"];\n\t\t$this->urai->AdvancedSearch->Save();\n\n\t\t// Field jmlh\n\t\t$this->jmlh->AdvancedSearch->SearchValue = @$filter[\"x_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh\"];\n\t\t$this->jmlh->AdvancedSearch->Save();\n\n\t\t// Field jmlh1\n\t\t$this->jmlh1->AdvancedSearch->SearchValue = @$filter[\"x_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh1\"];\n\t\t$this->jmlh1->AdvancedSearch->Save();\n\n\t\t// Field jmlh2\n\t\t$this->jmlh2->AdvancedSearch->SearchValue = @$filter[\"x_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh2\"];\n\t\t$this->jmlh2->AdvancedSearch->Save();\n\n\t\t// Field jmlh3\n\t\t$this->jmlh3->AdvancedSearch->SearchValue = @$filter[\"x_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh3\"];\n\t\t$this->jmlh3->AdvancedSearch->Save();\n\n\t\t// Field jmlh4\n\t\t$this->jmlh4->AdvancedSearch->SearchValue = @$filter[\"x_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchOperator = @$filter[\"z_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchCondition = @$filter[\"v_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchValue2 = @$filter[\"y_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->SearchOperator2 = @$filter[\"w_jmlh4\"];\n\t\t$this->jmlh4->AdvancedSearch->Save();\n\n\t\t// Field nm_perus\n\t\t$this->nm_perus->AdvancedSearch->SearchValue = @$filter[\"x_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchOperator = @$filter[\"z_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchCondition = @$filter[\"v_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchValue2 = @$filter[\"y_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->SearchOperator2 = @$filter[\"w_nm_perus\"];\n\t\t$this->nm_perus->AdvancedSearch->Save();\n\n\t\t// Field alamat\n\t\t$this->alamat->AdvancedSearch->SearchValue = @$filter[\"x_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchOperator = @$filter[\"z_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchCondition = @$filter[\"v_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchValue2 = @$filter[\"y_alamat\"];\n\t\t$this->alamat->AdvancedSearch->SearchOperator2 = @$filter[\"w_alamat\"];\n\t\t$this->alamat->AdvancedSearch->Save();\n\n\t\t// Field npwp\n\t\t$this->npwp->AdvancedSearch->SearchValue = @$filter[\"x_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchOperator = @$filter[\"z_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchCondition = @$filter[\"v_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchValue2 = @$filter[\"y_npwp\"];\n\t\t$this->npwp->AdvancedSearch->SearchOperator2 = @$filter[\"w_npwp\"];\n\t\t$this->npwp->AdvancedSearch->Save();\n\n\t\t// Field pimpinan\n\t\t$this->pimpinan->AdvancedSearch->SearchValue = @$filter[\"x_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchOperator = @$filter[\"z_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchCondition = @$filter[\"v_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchValue2 = @$filter[\"y_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->SearchOperator2 = @$filter[\"w_pimpinan\"];\n\t\t$this->pimpinan->AdvancedSearch->Save();\n\n\t\t// Field bank\n\t\t$this->bank->AdvancedSearch->SearchValue = @$filter[\"x_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchOperator = @$filter[\"z_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchCondition = @$filter[\"v_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchValue2 = @$filter[\"y_bank\"];\n\t\t$this->bank->AdvancedSearch->SearchOperator2 = @$filter[\"w_bank\"];\n\t\t$this->bank->AdvancedSearch->Save();\n\n\t\t// Field rek\n\t\t$this->rek->AdvancedSearch->SearchValue = @$filter[\"x_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchOperator = @$filter[\"z_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchCondition = @$filter[\"v_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchValue2 = @$filter[\"y_rek\"];\n\t\t$this->rek->AdvancedSearch->SearchOperator2 = @$filter[\"w_rek\"];\n\t\t$this->rek->AdvancedSearch->Save();\n\n\t\t// Field nospm\n\t\t$this->nospm->AdvancedSearch->SearchValue = @$filter[\"x_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchOperator = @$filter[\"z_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchCondition = @$filter[\"v_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchValue2 = @$filter[\"y_nospm\"];\n\t\t$this->nospm->AdvancedSearch->SearchOperator2 = @$filter[\"w_nospm\"];\n\t\t$this->nospm->AdvancedSearch->Save();\n\n\t\t// Field tglspm\n\t\t$this->tglspm->AdvancedSearch->SearchValue = @$filter[\"x_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchOperator = @$filter[\"z_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchCondition = @$filter[\"v_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchValue2 = @$filter[\"y_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->SearchOperator2 = @$filter[\"w_tglspm\"];\n\t\t$this->tglspm->AdvancedSearch->Save();\n\n\t\t// Field ppn\n\t\t$this->ppn->AdvancedSearch->SearchValue = @$filter[\"x_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchOperator = @$filter[\"z_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchCondition = @$filter[\"v_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchValue2 = @$filter[\"y_ppn\"];\n\t\t$this->ppn->AdvancedSearch->SearchOperator2 = @$filter[\"w_ppn\"];\n\t\t$this->ppn->AdvancedSearch->Save();\n\n\t\t// Field ps21\n\t\t$this->ps21->AdvancedSearch->SearchValue = @$filter[\"x_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchOperator = @$filter[\"z_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchCondition = @$filter[\"v_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchValue2 = @$filter[\"y_ps21\"];\n\t\t$this->ps21->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps21\"];\n\t\t$this->ps21->AdvancedSearch->Save();\n\n\t\t// Field ps22\n\t\t$this->ps22->AdvancedSearch->SearchValue = @$filter[\"x_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchOperator = @$filter[\"z_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchCondition = @$filter[\"v_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchValue2 = @$filter[\"y_ps22\"];\n\t\t$this->ps22->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps22\"];\n\t\t$this->ps22->AdvancedSearch->Save();\n\n\t\t// Field ps23\n\t\t$this->ps23->AdvancedSearch->SearchValue = @$filter[\"x_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchOperator = @$filter[\"z_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchCondition = @$filter[\"v_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchValue2 = @$filter[\"y_ps23\"];\n\t\t$this->ps23->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps23\"];\n\t\t$this->ps23->AdvancedSearch->Save();\n\n\t\t// Field ps4\n\t\t$this->ps4->AdvancedSearch->SearchValue = @$filter[\"x_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchOperator = @$filter[\"z_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchCondition = @$filter[\"v_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchValue2 = @$filter[\"y_ps4\"];\n\t\t$this->ps4->AdvancedSearch->SearchOperator2 = @$filter[\"w_ps4\"];\n\t\t$this->ps4->AdvancedSearch->Save();\n\n\t\t// Field kodespm\n\t\t$this->kodespm->AdvancedSearch->SearchValue = @$filter[\"x_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchOperator = @$filter[\"z_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchCondition = @$filter[\"v_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchValue2 = @$filter[\"y_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->SearchOperator2 = @$filter[\"w_kodespm\"];\n\t\t$this->kodespm->AdvancedSearch->Save();\n\n\t\t// Field nambud\n\t\t$this->nambud->AdvancedSearch->SearchValue = @$filter[\"x_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchOperator = @$filter[\"z_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchCondition = @$filter[\"v_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchValue2 = @$filter[\"y_nambud\"];\n\t\t$this->nambud->AdvancedSearch->SearchOperator2 = @$filter[\"w_nambud\"];\n\t\t$this->nambud->AdvancedSearch->Save();\n\n\t\t// Field nppk\n\t\t$this->nppk->AdvancedSearch->SearchValue = @$filter[\"x_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchOperator = @$filter[\"z_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchCondition = @$filter[\"v_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchValue2 = @$filter[\"y_nppk\"];\n\t\t$this->nppk->AdvancedSearch->SearchOperator2 = @$filter[\"w_nppk\"];\n\t\t$this->nppk->AdvancedSearch->Save();\n\n\t\t// Field nipppk\n\t\t$this->nipppk->AdvancedSearch->SearchValue = @$filter[\"x_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchOperator = @$filter[\"z_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchCondition = @$filter[\"v_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchValue2 = @$filter[\"y_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->SearchOperator2 = @$filter[\"w_nipppk\"];\n\t\t$this->nipppk->AdvancedSearch->Save();\n\n\t\t// Field prog\n\t\t$this->prog->AdvancedSearch->SearchValue = @$filter[\"x_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchOperator = @$filter[\"z_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchCondition = @$filter[\"v_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchValue2 = @$filter[\"y_prog\"];\n\t\t$this->prog->AdvancedSearch->SearchOperator2 = @$filter[\"w_prog\"];\n\t\t$this->prog->AdvancedSearch->Save();\n\n\t\t// Field prog1\n\t\t$this->prog1->AdvancedSearch->SearchValue = @$filter[\"x_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchOperator = @$filter[\"z_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchCondition = @$filter[\"v_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchValue2 = @$filter[\"y_prog1\"];\n\t\t$this->prog1->AdvancedSearch->SearchOperator2 = @$filter[\"w_prog1\"];\n\t\t$this->prog1->AdvancedSearch->Save();\n\n\t\t// Field bayar\n\t\t$this->bayar->AdvancedSearch->SearchValue = @$filter[\"x_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchOperator = @$filter[\"z_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchCondition = @$filter[\"v_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchValue2 = @$filter[\"y_bayar\"];\n\t\t$this->bayar->AdvancedSearch->SearchOperator2 = @$filter[\"w_bayar\"];\n\t\t$this->bayar->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}", "public function getFilter(){ }", "protected function hook_afterSave(){}", "public function saveFilter($filterData, $filterType, $pricemonitorId)\n {\n $filter = $this->getPopulatedFilter($filterData, $filterType);\n\n $filterRepository = new FilterRepository();\n $filterRepository->saveFilter($pricemonitorId, $filter);\n\n return $filter;\n }", "function add_filters()\n {\n }", "public function appendRule( $filter )\n {\n $this->rules[] = $filter;\n $this->clearCache();\n }", "public function createFilters() {\n $module_handler = \\Drupal::moduleHandler();\n if (!$module_handler->moduleExists('dfs_obio')) {\n return;\n }\n\n \\Drupal::configFactory()\n ->getEditable('acquia_contenthub_subscriber.contenthub_filter.location_filter')\n ->setData([\n 'uuid' => 'e152efcf-ad24-44a8-91da-f4e1630178c2',\n 'langcode' => 'en',\n 'dependencies' => [],\n 'author' => 1,\n 'tags' => '',\n 'source' => '',\n 'to_date' => '',\n 'from_date' => '',\n 'search_term' => 'location',\n 'publish_setting' => 'publish',\n 'name' => 'Location Filter',\n 'id' => 'location_filter',\n 'status' => TRUE,\n ])\n ->save();\n\n \\Drupal::logger('as_lift')->debug(dt('created default Content Hub filters'));\n return TRUE;\n }", "abstract public function addStoreFilter($store, $withAdmin = true);", "abstract protected function getFilters();", "public function setFilter(?WorkbookFilter $value): void {\n $this->getBackingStore()->set('filter', $value);\n }", "public function collectFilterValues ($save_filters=true )\n\t{\n\t\tparent::collectFilterValues($save_filters);\n\t\tif (!isset($this->page->value)) {\n\t\t\t$this->page->value = 1;\n\t\t}\n\t\tif (!isset($this->listingsLength->value)) {\n\t\t\t$this->listingsLength->value = $this->DEFAULT_PAGE_LEN();\n\t\t}\n\t\tif ($this->next->value==\"\") {\n\t\t\t$this->next->value = \"view\";\n\t\t}\n\t\t$this->gallery->collectFilterValues($save_filters);\n\t}", "public static function filter($rules)\n\t{ \n\t\tstatic::$filters[] = $rules;\n\t}", "public function filterAfter($criteria, $filter);", "function beforeFilter() {\r\n $this->Auth->mapActions(\r\n array(\r\n 'create' => array('index', 'save_api', 'setGeneralOption'),\r\n )\r\n );\r\n parent::beforeFilter();\r\n }", "public function action_filter()\n\t{\n\t\tif (Input::post()){\n\t\t\tif (Input::post('filter')){\n\n\t\t\t\trequire APPPATH.'likestv.php';\n\n\t\t\t\ttry {\n\n\t\t\t\t// Retrieve profile information since user is logged in\n\t\t\t\t\t$user_profile = $facebook->api('/me');\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t} catch (FacebookApiException $e) {\n\n\t\t\t\t error_log($e);\n\t\t\t\t $user = null;\n\n\t\t\t\t}\n\t\t\t\t$addfilter = Input::post('filter');\n\n\t\t\t\t// Creates database entry to be added to the database\n\t\t\t\t$preference = Model_Preference::forge(array(\n\t\t\t\t\t'username' => $user_profile[\"username\"],\n\t\t\t\t\t'filter' => $addfilter,\n\t\t\t\t));\n\t\t\t\t$preference and $preference->save();\n\t\t\t\t$this->template->title = 'Channel Filter';\n\t\t\t\t$this->template->content = View::forge('channels/filter');\n\t\t\t\tResponse::redirect('channels/');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// Filter redirects to channels if there is no post\n\t\t\tResponse::redirect('channels/');\n\t\t}\n\t}", "public function setAdditionalFilter($dataProvider, $filter);", "public function save(array $newValues, array $filter = null)\n {\n // When appointment id is not set, then check for existing instances of\n // this appointment using the source information\n if ((!isset($newValues['gap_id_appointment'])) &&\n isset($newValues['gap_id_in_source'], $newValues['gap_id_organization'], $newValues['gap_source'])) {\n\n $sql = \"SELECT gap_id_appointment\n FROM gems__appointments\n WHERE gap_id_in_source = ? AND gap_id_organization = ? AND gap_source = ?\";\n\n $id = $this->db->fetchOne(\n $sql,\n array($newValues['gap_id_in_source'], $newValues['gap_id_organization'], $newValues['gap_source'])\n );\n\n if ($id) {\n $newValues['gap_id_appointment'] = $id;\n }\n }\n\n $oldChanged = $this->getChanged();\n\n $returnValues = parent::save($newValues, $filter);\n\n if ($this->getChanged() && ($this->getChanged() !== $oldChanged)) {\n if ($this->isAutoTrackUpdate()) {\n $appointment = $this->loader->getAgenda()->getAppointment($returnValues);\n\n $this->_changedTokenCount += $appointment->updateTracks();\n }\n }\n // \\MUtil_Echo::track($this->_changedTokenCount);\n\n return $returnValues;\n }", "function dblog_filter_form_submit($form, &$form_state) {\n $op = $form_state['values']['op'];\n $filters = dblog_filters();\n switch ($op) {\n case t('Filter'):\n foreach ($filters as $name => $filter) {\n if (isset($form_state['values'][$name])) {\n $_SESSION['dblog_overview_filter'][$name] = $form_state['values'][$name];\n }\n }\n break;\n case t('Reset'):\n $_SESSION['dblog_overview_filter'] = array();\n break;\n }\n return 'admin/reports/dblog';\n}", "public function afterRegistry()\n {\n parent::afterRegistry();\n\n $setOnSave = \\MUtil_Model_ModelAbstract::SAVE_TRANSFORMER;\n $switches = $this->getTextSettings();\n\n // Make sure the calculated name is saved\n if (! isset($switches['gaf_calc_name'], $switches['gaf_calc_name'][$setOnSave])) {\n $switches['gaf_calc_name'][$setOnSave] = array($this, 'calcultateAndCheckName');\n }\n\n // Make sure the class name is always saved\n $className = $this->getFilterClass();\n $switches['gaf_class'][$setOnSave] = $className;\n\n // Check all the fields\n for ($i = 1; $i <= $this->_fieldCount; $i++) {\n $field = 'gaf_filter_text' . $i;\n if (! isset($switches[$field])) {\n $switches[$field] = array('label' => null, 'elementClass' => 'Hidden');\n }\n }\n\n $this->addSwitches(array($className => $switches));\n }", "function performRedirect() {\n // Append the Data Scrubber Filter ID to the redirect\n\n if(isset($this->request->data['DataScrubberFilterAttribute']['data_scrubber_filter_id']))\n $dsfid = $this->request->data['DataScrubberFilterAttribute']['data_scrubber_filter_id'];\n elseif(isset($this->request->params['named']['datascrubberfilter']))\n $dsfid = filter_var($this->request->params['named']['datascrubberfilter'],FILTER_SANITIZE_SPECIAL_CHARS);\n\n $this->redirect(array(\n 'plugin' => 'data_scrubber_filter',\n 'controller' => 'data_scrubber_filter_attributes',\n 'action' => 'index',\n 'datascrubberfilter' => $dsfid)\n );\n }", "function moveAssignmentFilters() {\n try {\n $assignment_filters_table = TABLE_PREFIX . 'assignment_filters';\n $data_filters_table = TABLE_PREFIX . 'data_filters';\n $homescreen_tabs_table = TABLE_PREFIX . 'homescreen_tabs';\n\n DB::beginWork('Move assignment filters to the new storage @ ' . __CLASS__);\n\n $assignment_filters = DB::execute(\"SELECT * FROM $assignment_filters_table\");\n if($assignment_filters) {\n $assignment_filter_tabs_map = $this->getTabsThatUseAssignmentFilters();\n\n foreach($assignment_filters as $filter) {\n $old_assignment_filter_id = (integer) $filter['id'];\n\n DB::execute(\"INSERT INTO $data_filters_table (type, name, raw_additional_properties, created_on, created_by_id, created_by_name, created_by_email, is_private) VALUES ('AssignmentFilter', ?, ?, ?, ?, ?, ?, ?)\", $filter['name'], $filter['raw_additional_properties'], $filter['created_on'], $filter['created_by_id'], $filter['created_by_name'], $filter['created_by_email'], $filter['is_private']);\n\n $new_assignmnet_filter_id = DB::lastInsertId();\n\n if(isset($assignment_filter_tabs_map[$old_assignment_filter_id]) && count($assignment_filter_tabs_map[$old_assignment_filter_id])) {\n DB::execute(\"UPDATE $homescreen_tabs_table SET raw_additional_properties = ? WHERE id IN (?)\", serialize(array('assignment_filter_id' => $new_assignmnet_filter_id)), $assignment_filter_tabs_map[$old_assignment_filter_id]);\n } // if\n } // foreach\n } // if\n\n DB::commit('Assignment filters moved to the new storage @ ' . __CLASS__);\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n try {\n $table_list = DB::listTables(TABLE_PREFIX);\n\n if(in_array($assignment_filters_table, $table_list)) {\n DB::execute(\"DROP TABLE $assignment_filters_table\");\n } // if\n\n if(in_array(TABLE_PREFIX . 'milestone_filters', $table_list)) {\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'milestone_filters');\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function getFilter();", "public function getFilter();", "function beforeFilter() {\n }", "protected static function loadFiltersData()\n {\n self::$filtersData = (array) $GLOBALS['TSFE']->fe_user->getKey('ses', 'filters');\n }", "protected function addFilter(array $filter) {\n $this->filter = array_merge($this->filter, array_flip($filter));\n }", "public function store(Request $request)\n {\n\n $requestData = $request->all();\n\n Filter::create($requestData);\n\n return redirect('admin/filters');\n }", "public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}", "function setFilter($filter) {\n\t\t$this->_filter = $filter;\n\t}", "abstract public function filters();", "protected function setParamsFilters()\n {\n if ($this->arParams['IBLOCK_TYPE'])\n {\n $this->filterParams['IBLOCK_TYPE'] = $this->arParams['IBLOCK_TYPE'];\n }\n\n if ($this->arParams['IBLOCK_ID'])\n {\n $this->filterParams['IBLOCK_ID'] = $this->arParams['IBLOCK_ID'];\n }\n\n if ($this->arParams['SECTION_CODE'])\n {\n $this->filterParams['SECTION_CODE'] = $this->arParams['SECTION_CODE'];\n }\n elseif ($this->arParams['SECTION_ID'])\n {\n $this->filterParams['SECTION_ID'] = $this->arParams['SECTION_ID'];\n }\n\n if ($this->arParams['INCLUDE_SUBSECTIONS'] === 'Y')\n {\n $this->filterParams['INCLUDE_SUBSECTIONS'] = 'Y';\n }\n\n if ($this->arParams['ELEMENT_CODE'])\n {\n $this->filterParams['CODE'] = $this->arParams['ELEMENT_CODE'];\n }\n elseif ($this->arParams['ELEMENT_ID'])\n {\n $this->filterParams['ID'] = $this->arParams['ELEMENT_ID'];\n }\n\n if ($this->arParams['CHECK_PERMISSIONS'])\n {\n $this->filterParams['CHECK_PERMISSIONS'] = $this->arParams['CHECK_PERMISSIONS'];\n }\n\n if (!isset($this->filterParams['ACTIVE']))\n {\n $this->filterParams['ACTIVE'] = 'Y';\n }\n\n if (strlen($this->arParams['EX_FILTER_NAME']) > 0\n && preg_match(\"/^[A-Za-z_][A-Za-z01-9_]*$/\", $this->arParams['EX_FILTER_NAME'])\n && is_array($GLOBALS[$this->arParams['EX_FILTER_NAME']])\n )\n {\n $this->filterParams = array_merge_recursive($this->filterParams, $GLOBALS[$this->arParams['EX_FILTER_NAME']]);\n\n $this->addCacheAdditionalId($GLOBALS[$this->arParams['EX_FILTER_NAME']]);\n }\n }", "private static function _getFilter() {}", "protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }", "protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }", "public function filters()\n {\n return [\n \n ];\n }", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif ($SF[\"id_min\"]) \t\t\t\t$sql .= \" AND id >= \".intval($SF[\"id_min\"]).\" \\r\\n\";\n\t\tif ($SF[\"id_max\"])\t\t\t \t$sql .= \" AND id <= \".intval($SF[\"id_max\"]).\" \\r\\n\";\n\t\tif ($SF[\"date_min\"]) \t\t\t$sql .= \" AND add_date >= \".strtotime($SF[\"date_min\"]).\" \\r\\n\";\n\t\tif ($SF[\"date_max\"])\t\t\t$sql .= \" AND add_date <= \".strtotime($SF[\"date_max\"]).\" \\r\\n\";\n\t\tif ($SF[\"user_id\"])\t\t\t \t$sql .= \" AND user_id = \".intval($SF[\"user_id\"]).\" \\r\\n\";\n\t\tif ($SF[\"cat_id\"])\t\t\t \t$sql .= \" AND cat_id = \".intval($SF[\"cat_id\"]).\" \\r\\n\";\n\t\tif (strlen($SF[\"title\"]))\t\t$sql .= \" AND title LIKE '\"._es($SF[\"title\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"summary\"]))\t\t$sql .= \" AND summary LIKE '\"._es($SF[\"summary\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND full_text LIKE '\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (!empty($SF[\"status\"]) && isset($this->_articles_statuses[$SF[\"status\"]])) {\n\t\t \t$sql .= \" AND status = '\"._es($SF[\"status\"]).\"' \\r\\n\";\n\t\t}\n\t\tif (strlen($SF[\"nick\"]) || strlen($SF[\"account_type\"])) {\n\t\t\tif (strlen($SF[\"nick\"])) \t$users_sql .= \" AND nick LIKE '\"._es($SF[\"nick\"]).\"%' \\r\\n\";\n\t\t\tif ($SF[\"account_type\"])\t$users_sql .= \" AND `group` = \".intval($SF[\"account_type\"]).\" \\r\\n\";\n\t\t}\n\t\t// Add subquery to users table\n\t\tif (!empty($users_sql)) {\n\t\t\t$sql .= \" AND user_id IN( SELECT id FROM \".db('user').\" WHERE 1=1 \".$users_sql.\") \\r\\n\";\n\t\t}\n\t\t// Sorting here\n\t\tif ($SF[\"sort_by\"])\t\t\t \t$sql .= \" ORDER BY \".$this->_sort_by[$SF[\"sort_by\"]].\" \\r\\n\";\n\t\tif ($SF[\"sort_by\"] && strlen($SF[\"sort_order\"])) \t$sql .= \" \".$SF[\"sort_order\"].\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}", "public function store(Request $request)\n {\n\n $data =$request->all();\n //dd($data);\n $filter = new Filter();\n $filter->title = $data['title'];\n $filter->save();\n\n if (isset($data['title_item'])) {\n foreach ($data['title_item'] as $items) {\n $child = new FilterItem();\n $child->title_item = $items;\n $child->filter_id = $filter->id;\n $child->save();\n }\n }\n return redirect('admin/filters');\n }", "public function onFilterArticle(\\Enlight_Event_EventArgs $args)\n {\n $subject = $args->getSubject();\n $filterBy = $subject->Request()->getParam('filterBy');\n\n list($sqlParams, $filterSql, $categorySql, $imageSQL, $order) = $args->getReturn();\n\n if ($filterBy === 'connect') {\n $imageSQL = '\n LEFT JOIN s_plugin_connect_items as connect_items\n ON connect_items.article_id = articles.id\n ';\n\n $filterSql .= ' AND connect_items.shop_id > 0 ';\n }\n\n return [$sqlParams, $filterSql, $categorySql, $imageSQL, $order];\n }" ]
[ "0.6091528", "0.59271336", "0.56344527", "0.56189823", "0.5597894", "0.5525014", "0.54244274", "0.54023933", "0.5392126", "0.53837526", "0.53649545", "0.5356674", "0.5328125", "0.5310929", "0.5293916", "0.52564037", "0.5155366", "0.5154153", "0.51470804", "0.51440495", "0.51357764", "0.51110274", "0.51065934", "0.51059276", "0.5099537", "0.50767016", "0.50718516", "0.5062728", "0.50592965", "0.5052273", "0.50261104", "0.50203353", "0.4989915", "0.49744532", "0.49728498", "0.4971971", "0.4950242", "0.49496165", "0.48986718", "0.4881216", "0.48786205", "0.48669192", "0.48521402", "0.4851753", "0.48452255", "0.48284665", "0.48275644", "0.48226228", "0.48224163", "0.48123688", "0.48080653", "0.4804268", "0.47834018", "0.4778662", "0.47774953", "0.4766744", "0.47541428", "0.47500604", "0.4724438", "0.47227487", "0.47197562", "0.47193074", "0.46992394", "0.46973228", "0.46930602", "0.46911937", "0.46838588", "0.4681", "0.4671905", "0.465799", "0.46479008", "0.4643545", "0.46406564", "0.4639062", "0.46197674", "0.46190393", "0.46166056", "0.4613684", "0.46119413", "0.46035144", "0.4603245", "0.46023905", "0.45887655", "0.4585725", "0.4585725", "0.45694605", "0.4565352", "0.45637104", "0.45601755", "0.455143", "0.45491514", "0.45478588", "0.4544654", "0.45353013", "0.45296988", "0.45296988", "0.4528476", "0.45252463", "0.4518632", "0.45106733" ]
0.68354917
0
The protected method save_alerts_user saves an alert's user
protected function save_alerts_user($alert_id, $user_id) { // Create user's activity for alert $user_activity = array( 'alert_id' => $alert_id, 'user_id' => $user_id, 'page_seen' => 0, 'deleted' => 0, 'updated' => time(), 'created' => time() ); // Save the alert's user if ( $this->CI->base_model->insert('notifications_alerts_users', $user_activity) ) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saving(User $user)\n {\n //\n }", "public function saved(User $user)\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->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "public function superadmin_save($user_id) {\n }", "function save_user_object($user){\r\n\r\n}", "public static function save(User $user)// statiska funkcija, lai nevajadzetu taisit klases objektu\n {\n }", "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 }", "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 save(User $user){\n return $user->save();\n }", "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 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 }", "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 actionCreateAlertUser($idAlert, $idUser, $action)\n {\n $date = new DateTime('now');\n $newAlertUser = new \\Business\\AlertUser();\n $newAlertUser->idAlert = $idAlert;\n $newAlertUser->idUser = $idUser;\n $newAlertUser->creationDate = $date->format('Y-m-d H:i:s');\n $newAlertUser->action = $action;\n\n if ($newAlertUser->save()) {\n print_r(\"OK! Saved.\");\n } else {\n echo '<pre>';\n print_r($newAlertUser->attributes);\n }\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 save( $seller_id = false ) {\n\t\t// prepare user object and permission objects\n\t\t$seller_data = array();\n\n\t\t// save username\n\t\tif ( $this->has_data( 'seller_name' )) {\n\t\t\t$seller_data['seller_name'] = $this->get_data( 'seller_name' );\n\t\t}\n\n\t\t\n\t\tif( $this->has_data( 'seller_email' )) {\n\t\t\t$seller_data['seller_email'] = $this->get_data( 'seller_email' );\n\t\t}\n\t\t\n\t\tif( $this->has_data( 'seller_phone' )) {\n\t\t\t$seller_data['seller_phone'] = $this->get_data( 'seller_phone' );\n\t\t}\n\n\n\t\t// user_address\n\t\tif ( $this->has_data( 'seller_address' )) {\n\t\t\t$seller_data['seller_address'] = $this->get_data( 'seller_address' );\n\t\t}\n\n\t\t// save city\n\t\tif( $this->has_data( 'city' )) {\n\t\t\t$seller_data['city'] = $this->get_data( 'city' );\n\t\t}\n\n\t\t// save user_about_me\n\t\tif( $this->has_data( 'seller_about_me' )) {\n\t\t\t$seller_data['seller_about_me'] = $this->get_data( 'seller_about_me' );\n\t\t}\n\n\t\t// $permissions = ( $this->get_data( 'permissions' ) != false )? $this->get_data( 'permissions' ): array();\n\n\t\t// save data\n\t\t// print_r($user_data);die;\n\t\tif ( ! $this->Seller->save( $seller_data, $seller_id )) {\n\t\t// if there is an error in inserting user data,\t\n\n\t\t\t$this->set_flash_msg( 'error', get_msg( 'err_model' ));\n\t\t} else {\n\t\t// if no eror in inserting\n\n\t\t\tif ( $seller_id ) {\n\t\t\t// if user id is not false, show success_add message\n\t\t\t\t\n\t\t\t\t$this->set_flash_msg( 'success', get_msg( 'success_user_edit' ));\n\t\t\t} else {\n\t\t\t// if user id is false, show success_edit message\n\n\t\t\t\t$this->set_flash_msg( 'success', get_msg( 'success_user_add' ));\n\t\t\t}\n\t\t}\n\n\t\tredirect( $this->module_site_url());\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}", "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 }", "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}", "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 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 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 addNewAlert($user_id) {\n\n \n /* @var $user \\User\\Entity\\User */\n $user = $this->entityManager->getRepository(User::class)->findOneById($user_id); \n \n $alert = new Alert();\n //$alert->setUserId($user_id);\n $alert->setUser($user);\n $alert->setIsActive(true);\n\n $aktualni_datum = new \\DateTime(\"now\");\n $aktualni_datum->format('Y-m-d H:i:s');\n $alert->setCasStart($aktualni_datum);\n\n // Add the entity to entity manager.\n $this->entityManager->persist($alert);\n\n // Apply changes to database.\n $this->entityManager->flush();\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_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 save(User $model);", "public function save(CreateUserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $pass = $this->get_password($request);\n $user = User::create([\n 'name' => $request->input('name'),\n 'phone_number' => $request->input('phone_number'),\n 'email' => $request->input('email'),\n 'password' => bcrypt($pass),\n 'role_id' => $request->input('role_id', 3)\n ]);\n\n $user->notify(new AdminUserCreated($user, $pass));\n\n return redirect()->route('active_user', $user->id);\n }", "public function onUserAfterSave($user, $isNew, $success, $msg)\n\t{\n\t\tif (!$success)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Clear access rights in case user groups were changed.\n\t\t$userObject = new User($user['id']);\n\t\t$userObject->clearAccessRights();\n\t\t$authorised = $userObject->authorise('core.admin');\n\n\t\t$query = $this->db->getQuery(true)\n\t\t\t->select('COUNT(*)')\n\t\t\t->from($this->db->quoteName('#__action_logs_users'))\n\t\t\t->where($this->db->quoteName('user_id') . ' = ' . (int) $user['id']);\n\n\t\ttry\n\t\t{\n\t\t\t$exists = (bool) $this->db->setQuery($query)->loadResult();\n\t\t}\n\t\tcatch (JDatabaseExceptionExecuting $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// If preferences don't exist, insert.\n\t\tif (!$exists && $authorised && isset($user['actionlogs']))\n\t\t{\n\t\t\t$values = array((int) $user['id'], (int) $user['actionlogs']['actionlogsNotify']);\n\t\t\t$columns = array('user_id', 'notify');\n\n\t\t\tif (isset($user['actionlogs']['actionlogsExtensions']))\n\t\t\t{\n\t\t\t\t$values[] = $this->db->quote(json_encode($user['actionlogs']['actionlogsExtensions']));\n\t\t\t\t$columns[] = 'extensions';\n\t\t\t}\n\n\t\t\t$query = $this->db->getQuery(true)\n\t\t\t\t->insert($this->db->quoteName('#__action_logs_users'))\n\t\t\t\t->columns($this->db->quoteName($columns))\n\t\t\t\t->values(implode(',', $values));\n\t\t}\n\t\telseif ($exists && $authorised && isset($user['actionlogs']))\n\t\t{\n\t\t\t// Update preferences.\n\t\t\t$values = array($this->db->quoteName('notify') . ' = ' . (int) $user['actionlogs']['actionlogsNotify']);\n\n\t\t\tif (isset($user['actionlogs']['actionlogsExtensions']))\n\t\t\t{\n\t\t\t\t$values[] = $this->db->quoteName('extensions') . ' = ' . $this->db->quote(json_encode($user['actionlogs']['actionlogsExtensions']));\n\t\t\t}\n\n\t\t\t$query = $this->db->getQuery(true)\n\t\t\t\t->update($this->db->quoteName('#__action_logs_users'))\n\t\t\t\t->set($values)\n\t\t\t\t->where($this->db->quoteName('user_id') . ' = ' . (int) $user['id']);\n\t\t}\n\t\telseif ($exists && !$authorised)\n\t\t{\n\t\t\t// Remove preferences if user is not authorised.\n\t\t\t$query = $this->db->getQuery(true)\n\t\t\t\t->delete($this->db->quoteName('#__action_logs_users'))\n\t\t\t\t->where($this->db->quoteName('user_id') . ' = ' . (int) $user['id']);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$this->db->setQuery($query)->execute();\n\t\t}\n\t\tcatch (JDatabaseExceptionExecuting $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function save() {\n\n $result = parent::save();\n\n // if this user has a new email we send an email to confirm\n if($this->new_email) {\n $this->email_verified = 'False';\n $this->sendConfirmEmail();\n }\n\n // make sure the user has the login role\n $login_role = new Model_Role(array('name' =>'login'));\n if(!$this->has('roles', $login_role)) {\n $this->add('roles',$login_role);\n }\n return $result;\n }", "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 function save(User $user) {\n\t\tif (!empty($user->getGroup())){\n\t\t\t$groupId = $user->getGroup()->getId();\n\t\t} else {\n\t\t\t$groupId = NULL;\n\t\t}\n\n\t\t$userData = array(\n\t\t\t'txtUserName' => $user->getUsername(),\n\t\t\t'txtUserMail' => $user->getMail(),\n\t\t\t'txtUserRole' => $user->getRole(),\n\t\t\t'idGroup' => $groupId\n\t\t);\n\n\t\t// Si le password est fourni, il faut l'inclure dans la modification\n\t\tif (!empty($user->getPassword())){\n\t\t\t$userData['txtUserPassword'] = $user->getPassword();\n\t\t\t$userData['txtUserSalt'] = $user->getSalt();\n\t\t}\n\n\t\t// Si un avatar est fourni\n\t\tif (!empty($user->getPassword())){\n\t\t\t$userData['txtUserImgPath'] = $user->getImgPath();\n\t\t}\n\t\t\n\t\tif ($user->getId()) {\n\t\t\t// The user has already been saved : update it\n\t\t\t$this->getDb()->update('t_user', $userData, array('idUser' => $user->getId()));\n\t\t} else {\n\t\t\t// The user has never been saved : insert it\n\t\t\t$this->getDb()->insert('t_user', $userData);\n\t\t\t// Get the id of the newly created user and set it on the entity.\n\t\t\t$id = $this->getDb()->lastInsertId();\n\t\t\t$user->setId($id);\n\t\t}\n\t}", "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 }", "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}", "private function saveUser($user = NULL) {\n\n\t\t$fromDB = $this->getUserByEmail($user['email']);\n\t\tif(empty($fromDB)) {\n\n\t\t\t// set vars to save\n\t\t\tunset($user['password2']);\n\t\t\t$user['password'] = $this->hashPassword($user['password']);\n\t\t\t$user['lastlogin'] = new MongoDate();\n\t\t\t$user['created'] = new MongoDate();\n\n\n\t\t\t// save\n\t\t\ttry {\n\n\t\t\t\t// saving in 'users'\n\t\t\t\tif($this->collection->insert($user)) {\n\n\t\t\t\t\t$userTokens['email'] = $user['email'];\n\t\t\t\t\t$userTokens['userId'] = $user['_id']->{'$id'};\n\t\t\t\t\t$userTokens['logintokens'] = array();\n\n\t\t\t\t\t// saving in 'usertokens'\n\t\t\t\t\t$this->collection = $this->DB->selectCollection($this->config['database'], 'usertokens');\n\t\t\t\t\t$this->collection->insert($userTokens);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\n\t\t\t\tdumper($e->getMessage());\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t// redirect\n\t\t\theader('Location: http://' . $_SERVER['HTTP_HOST'] . '/users/login/');\n\t\t\treturn TRUE;\n\t\t} else {\n\n\t\t\t$ret['invalid']['email'] = _('This Email address is already used!');\n\t\t\treturn $ret;\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "public function store()\n {\n if( Session::get('level') == '1' && Session::get('fingerprint') == md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR']) )\n { \n $postData = Input::All();\n\n $messages = [\n 'fullname.required' => 'กรุณากรอก', \n 'username.required' => 'กรุณากรอก', \n 'password.required' => 'กรุณากรอก', \n ];\n\n $rules = [\n 'fullname' => 'required', \n 'username' => 'required',\n 'password' => 'required',\n ];\n\n $validator = Validator::make($postData, $rules, $messages);\n if ($validator->fails()) { \n return Redirect::route('user.create')->withInput()->withErrors($validator);\n }\n else\n {\n $data = Request::all(); \n\n if($this->checkuser($data['username']) == 0){\n $user = new User();\n $user->fullname = $data['fullname'];\n $user->username = $data['username'];\n $user->password = Hash::make($data['password']);\n $user->id_dep = $data['id_dep'];\n $user->level = $data['level'];\n $user->activated = $data['activated'];\n\n DB::transaction(function() use ($user) {\n $user->save(); \n }); \n\n Session::flash( 'savedata', save_data );\n }else{\n Session::flash( 'nosavedata', \"\" );\n }\n\n return Redirect::to('user');\n }\n }\n else\n {\n return Redirect::to('/');\n }\n }", "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 saved(User $user)\n {\n // $his->name = \"mr.\".$user->name;\n // $his->save();\n }", "function saveUser() {\n\n //datos desde el formulario\n $nombres = $this->input->post('nombres');\n $apellidos = $this->input->post('apellidos');\n $email = $this->input->post('email');\n $marca_favorita = $this->input->post('marca_favorita');\n $modelo_favorito = $this->input->post('modelo');\n $profesion = $this->input->post('profesion');\n $pais = $this->input->post('pais');\n $telefono = $this->input->post('telefono');\n\n //re-verificamos si el user existe\n $exi = $this->Secure_model->checkEmail($email);\n if ($exi == TRUE) {\n redirect(base_url() . 'index.php/site/aviso/2');\n }\n //se enviara a usuario\n //$temp_clave = \"hola\";\n $temp_clave = $this->Secure_model->generateClave($nombres);\n $clave = md5(utf8_encode($temp_clave));\n $tipo_usuario = '2';\n $estado = md5($email);\n $datos = array(\n 'nombres' => $nombres,\n 'apellidos' => $apellidos,\n 'email' => $email,\n 'pais' => $pais,\n 'clave' => $clave,\n 'tipo_usuario' => $tipo_usuario,\n 'estado' => $estado,\n 'primium' => '0',\n 'fecha_registro' => date('Y-m-d'),\n );\n //$this->session->set_userdata('temp_data',$datos);\n // GUARDAMOS QUE ACABAMOS DE CREAR Y OBTENEMOS EL ULTIMO ID\n $last_id = $this->savedata_model->guardar('cq_usuario', $datos);\n //Guardamos numero de telefono\n $dato_tel = array(\n //'id_telefono' => '',\n 'id_usuario' => $last_id,\n 'telefono' => $telefono,\n 'codigo_pais' => $pais\n );\n\n $this->savedata_model->guardar('cq_telefonos', $dato_tel);\n\n // EVIAMOS NOTIFICACION DE CORREO\n $nombre = $nombres . \" \" . $apellidos;\n\n $datos = array('tipo' => 'registro',\n 'to' => $email,\n 'clave' => $temp_clave,\n 'nombre' => $nombre);\n\n\n if ($this->function_model->enviarMail($datos)) {\n\n redirect(base_url() . 'index.php/site/aviso/1');\n } else {\n redirect(base_url() . 'index.php/site/aviso/3');\n }\n }", "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 users_save() {\n if ($this->id) {\n return $this->users_update();\n } else {\n return $this->users_insert();\n }\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 }", "function save_user_info ()\n{\n if (check_user_info()){\n $feedback = array ();\n // Retrieve datas from form\n $user_name = filter_var($_POST['user_name'],\n FILTER_SANITIZE_STRING);\n //$user_password = $_POST['user_password'];\n $user_email = filter_var($_POST['user_email'], \n FILTER_SANITIZE_EMAIL);\n $user_birthday = filter_var($_POST['user_birthday'], \n FILTER_SANITIZE_STRING);\n $user_nationality = utf8_encode(filter_var($_POST['user_nationality'], \n FILTER_SANITIZE_STRING));\n $user_lastname = utf8_encode(filter_var($_POST['user_lastname'], \n FILTER_SANITIZE_STRING));\n $user_firstname = utf8_encode(filter_var($_POST['user_firstname'], \n FILTER_SANITIZE_STRING));\n $user_gender = utf8_encode(filter_var($_POST['user_gender'], \n FILTER_SANITIZE_STRING));\n $user_password_hash = \n $_SESSION['user']->get_string_attribute('user_password_hash');\n \n /*if (isset($_POST['user_password_new'])) {\n $user_password_hash = password_hash($_POST['user_password_new'],\n PASSWORD_DEFAULT);\n }else {\n $user_password_hash = \n $_SESSION['user']->get_string_attribute('user_password_hash');\n }*/\n \t\n //Create an user object with it\n $parameters = array ('user_id' =>\n $_SESSION['user']->get_string_attribute('user_id'),\n\t\t\t'user_name' => $user_name,\n\t\t\t'user_email' => $user_email,\n\t\t\t'user_birthday' => $user_birthday,\n\t\t\t'user_nationality' => $user_nationality,\n\t\t\t'user_lastname' => $user_lastname,\n\t\t\t'user_firstname' => $user_firstname,\n 'user_password_hash' => $user_password_hash,\n \t'user_gender' => $user_gender);\n $user = new User ($parameters);\n \t\n // save new datas in database;\n if ($user->update_user_data()) {\n // Save them in the user session\n $_SESSION['user'] = $user;\n $feedback ['status'] = true;\n $_SESSION['feedback'] = $feedback;\n return true;\n } else {\n $feedback ['msg'] = 'The update of your profile information has failed';\n $feedback ['status'] = false;\n $_SESSION['feedback'] = $feedback;\n return false;\n }\n }else {\n return false;\n }\n}", "public function save(User $user) {\n $userData = array(\n 'user_email' => $user->getEmail(),\n 'user_salt' => $user->getSalt(),\n 'user_password' => $user->getPassword(),\n 'user_role' => $user->getRole(),\n 'user_lastname' => $user->getLastname(),\n 'user_firstname' => $user->getFirstname(),\n 'user_address' => $user->getAddress(),\n 'user_town' => $user->getTown(),\n 'user_zipcode' => $user->getZipcode()\n );\n\n if ($user->getId()) {\n $this->getDb()->update('user', $userData, array('user_id' => $user->getId()));\n } else {\n // The user has never been saved : insert it\n $this->getDb()->insert('user', $userData);\n // Get the id of the newly created user and set it on the entity.\n // $id = $this->getDb()->lastInsertId();\n $user->setEmail($user->getEmail());\n }\n }", "public function storeFromUser()\n\t{\n\t\t$user = Auth::user();\n\n\t\t// If the user is already registered, delete their LanAttendee entry\n\t\tif ($this->lanAttendee->checkByUserId($user->id))\n\t\t{\n\t\t\t$this->lanAttendee->where('user_id', $user->id)->delete();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->lanAttendee->createFromUser($user);\n\t\t}\n\n\t\treturn Redirect::back();\n\t}", "public function save($userid)\n {\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 save(UserRequest $request){\r\n \t$view = self::checkLoginAdmin();\r\n \tif(isset($view))\r\n \t\treturn $view;\r\n \t$user = new User();\r\n \t$user->name = $request->input('name');\r\n \t$user->email = $request->input('email');\r\n \t$user->admin = $request->input('admin') || 0;\r\n $user->moderator = $request->input('moderator') || 0;\r\n $user->author = $request->input('author') || 0;\r\n $password = env(\"USER_DEFAULT_PASSWORD\", str_random(12));\r\n \t$user->password = Hash::make($password);\r\n\t\tif(User::where('email', $user->email)->count() > 0)\r\n\t\t\treturn redirect()->back()->withErrors(['O Email já esta em uso']);\r\n\t\t$user->save();\r\n EmailUtils::sendWelcomeMail($user->name, $user->email, $password);\r\n Session::flash('success', 'Usuário criado com sucesso'); \r\n \treturn redirect()->route('admin');\r\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(UpdateUserRequest $request, User $user) {\n $original = [\"user\" => $user->getOriginal(), \"role\" => $user->role];\n $request->commit($user);\n\n //Trigger user edited event\n event(new UserEdited($user, $original));\n\n //Reloads page\n return redirect()->action('Platform\\UserController@edit', $user)->with('alert', [\n 'type' => 'success',\n 'message' => 'User saved'\n ]);\n }", "public function save($user)\n {\n $userData = array(\n 'first_name' => $user->getFirstName(),\n 'last_name' => $user->getLastName(),\n 'password' => $user->getPassword(),\n 'phone' => $user->getphone(),\n 'mail' => $user->getMail(),\n 'birthdate' => $user->getBirthdate(),\n 'address_street_1' => $user->getAddressStreet1(),\n 'address_street_2' => $user->getAddressStreet2(),\n 'city' => $user->getCity(),\n 'zip' => $user->getZip(),\n 'gender' => $user->getGender(),\n 'photo' => $user->getPhoto(),\n 'sponsor_id' => $user->getSponsor(),\n 'comment' => $user->getComment(),\n 'failed_logins' => $user->getFailedLogins(),\n 'last_seen' => $user->getLastSeen(),\n 'last_ip' => $user->getLastIP(),\n 'deleted_at' => $user->getDeletedAt()\n );\n\n if ($user->getId()) {\n $this->db->update('users', $userData, array('id' => $user->getId()));\n\n if ($user->getUserLevel()) {\n $this->db->delete('users_access', array('user_id' => $user->getId()));\n $this->db->insert('users_access', array('user_id' => $user->getId(), 'user_level' => $user->getUserLevel()));\n }\n } else {\n $this->db->insert('users', $userData);\n $user->setId($this->db->lastInsertId());\n\n if ($user->getUserLevel()) {\n $this->db->insert('users_access', array('user_id' => $user->getId(), 'user_level' => $user->getUserLevel()));\n }\n }\n }", "public function onUserAfterSave($user, $isnew, $success, $msg)\n\t{\n\t\terror_log(\"\\ninside onUserAfterSave plugin... for user: \" . $user['id'] . \"\\n\", 3, \"../logs/salonbook.log\");\n\n\t\t$app = JFactory::getApplication();\n\t\terror_log(\"\\ngot the Application object\\n\", 3, \"../logs/salonbook.log\");\n\n\t\t// the user parameters passed to the event:\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\t$uid = $user['id'];\n\t\t\n\t\t$model = new SalonBooksModelUsers;\n\t\t$model->getCopyUsers($uid);\n\t\terror_log(\"ran the copyUsers method now \\n\", 3, \"../logs/salonbook.log\");\n\t}", "public function saveProfile()\n {\n if ($this->validate()) {\n $user = $this->user;\n\n $graph = Yii::$container\n ->get(\\common\\components\\Graph::class, [$this->user]);\n\n if ($this->timezone) {\n $user->timezone = $this->timezone;\n }\n if ($this->expose_graph) {\n $user->expose_graph = true;\n\n // generate behaviors graph image\n $checkins_last_month = (Yii::$container->get(\\common\\interfaces\\UserBehaviorInterface::class))\n ->getCheckInBreakdown();\n\n // if they haven't done a check-in in the last month this will explode\n // because $checkins_last_month is an empty array\n if ($checkins_last_month) {\n $graph->create($checkins_last_month, true);\n }\n } else {\n $user->expose_graph = false;\n // remove behaviors graph image\n $graph->destroy();\n }\n\n if ($this->send_email) {\n $user->send_email = true;\n $user->email_category = $this->email_category;\n $user->partner_email1 = $this->partner_email1;\n $user->partner_email2 = $this->partner_email2;\n $user->partner_email3 = $this->partner_email3;\n } else {\n $user->send_email = false;\n $user->email_category = 4; // default to \"Speeding Up\"\n $user->partner_email1 = null;\n $user->partner_email2 = null;\n $user->partner_email3 = null;\n }\n $user->save();\n return $user;\n }\n\n return null;\n }", "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 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}", "protected function saveProfile($user)\n\t{\n\t}", "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 store()\n {\n $objUser = new User;\n \n $objUser->doSave($_POST);\n \n return Redirect::to('/admin/manage_user');\n }", "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 }", "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 }", "public function saveTrustee($user, $id_1, $id_2) {\n\t\t# Assume User is Logged in, $user -> User Object\n\t\t$this->_sql->raw_query('INSERT INTO epi_trustees VALUES (NULL, '. $user->_id .', '. $id_1 .', '. $id_2 .') ON DUPLICATE KEY UPDATE primary = '. $id_1 .', secondary = '. $id_2 .';');\n\t}", "protected function saveUser()\n {\n\n $validation = \\Validator::make(\\Input::all(), with(new UserValidation)->getRules());\n\n if ($validation->fails()) {\n return redirect()->route('extensionsvalley.admin.adduser',['accesstoken'=>\\Input::get('accesstoken')])->withErrors($validation)->withInput();\n }\n\n $user_name = \\Input::get('name');\n $user_email = \\Input::get('email');\n $user_password = \\Input::get('password');\n $status = \\Input::get('status');\n $group = \\Input::get('groups');\n\n\n $result = User::create([\n 'name' => $user_name,\n 'email' => $user_email,\n 'status' => $status,\n 'groups' => $group,\n 'password' => bcrypt($user_password),\n ]);\n\n\n //Send Registarion Email with queue\n ##$emailq_id = $this->sendEmail(['name' => $user_name, 'email' => $user_email, 'password' => $user_password]);\n\n\n return redirect('admin/ExtensionsValley/dashboard/list/users')->with(['message' => 'User Details added successfully!']);\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 save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}", "function saveUser(UserEntity $user, string $hashedPwd);", "public function saveUser(UserInterface $user)\n\t{\n\t\tthrow new \\RuntimeException('Use the Joomla! API to save a user');\n\t}", "public function save()\n {\n date_default_timezone_set(\"Asia/Ho_Chi_Minh\");\n $usid = $this->input->post('id');\n $id = 0;\n $data = $this->admin_model->array_from_post(array(\n 'user_role','user_firstname', 'user_lastname', \n 'user_username', 'user_password',\n 'user_email'));\n //$email = $data['email'];\n //$result = $this->admin_m->get($this->table, array('where' => \"email='$email'\", 'result' => 0));\n $password = $data['user_password'];\n if($data['user_password'] == NULL) {\n unset($data['user_password']);\n } else {\n $data['user_password'] = md5(md5($data['user_password']));\n }\n $id = $this->admin_model->save(array(\n 'table' => $this->table_name,\n 'data' => $data,\n 'primary' => $this->primary,\n 'id' => (isset($id) ? $id : NULL)\n ));\n redirect('admin/user');\n }", "public function store()\n\t{\n\t\t// save the new user\n\t\t// TODO : limit the admin to 3 accounts only\n\t\t$this->user->create(array(\n\t\t\t\t\t\t\t\t\t'user_username' =>\tInput::get('user_username'),\n\t\t\t\t\t\t\t\t\t'user_password_md5' => \tmd5(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'password' => \tHash::make(Input::get('user_password')),\n\t\t\t\t\t\t\t\t\t'user_role' \t=>\tInput::get('user_role')\n\t\t\t\t\t\t\t));\n\n\t\t$users = $this->user->all();\n\t\treturn Redirect::to('settings/system-users')\n\t\t\t\t\t\t->with('users',$users)\n\t\t\t\t\t\t->with('flash_msg','User has been successfully created !');\n\t}", "function saveUser(UserAbstract $user) {\n\t\treturn $this->_storage->saveUserToken($user);\n\t}", "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 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 }", "function save() {\n $modified_fields = $this->modified_fields;\n $is_new = $this->isNew();\n\n if($is_new && ($this->getToken() == '')) {\n $this->resetToken();\n } // if\n\n $save = parent::save();\n if($save && !is_error($save)) {\n if($is_new || in_array('email', $modified_fields) || in_array('first_name', $modified_fields) || in_array('last_name', $modified_fields)) {\n $content = $this->getEmail();\n if($this->getFirstName() || $this->getLastName()) {\n $content .= \"\\n\\n\" . trim($this->getFirstName() . ' ' . $this->getLastName());\n } // if\n\n search_index_set($this->getId(), 'User', $content);\n cache_remove_by_pattern('object_assignments_*_rendered');\n } // if\n\n // Role changed?\n if(in_array('role_id', $modified_fields)) {\n clean_user_permissions_cache($this);\n } // if\n } // if\n\n return $save;\n }", "public function postSaveuser(){\n\n $validator4 = Validator::make(Input::all(), User::$userRules);\n $userMail = Input::get('useremail');\n \n if ($validator4->passes()) {\n $user = new User;\n $user->email = Input::get('useremail');\n $user->fullname = Input::get('fullname');\n $user->userType = \"user\";\n $user->save();\n\n return Redirect::to('admin/userlist')->with('message', 'User added succesfully!');\n }else{\n return Redirect::to('admin/newuser')->with('message', 'The following errors occurred')\n ->withErrors($validator4)->withInput(); \n }\n }", "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() {\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}", "protected function afterUserSave(DeveloperToUserConversionResult $result) : void {}", "public function save()\n {\n\t\t$result = false;\n\t\t\n\t\t//set data in model\n $model = new AdminUsers();\n $model->username = $this->username;\n $model->email = $this->email;\n $model->group_id = $this->group_id;\n $model->status = self::STATUS_ACTIVE;\n $model->created_at = time();\n $model->setPassword($this->password);\n $model->generateAuthKey();\n \n //save data on model\n if($model->save(false))\n {\t\n\t\t\t$userID = $model->id;\n\t\t\t\n\t\t\tif($userID > 0)\n\t\t\t{\t\n\t\t\t\t$authAssignmentModel = new AuthAssignment();\n\t\t\t\t\n\t\t\t\tif($authAssignmentModel->setRole($userID))\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$result = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n return $result;\n }", "function email_revalidate_user_settings_save() {\n\t$email = get_input('email');\n\t$user_id = get_input('guid');\n\n\tif (!$user_id) {\n\t\t$user = elgg_get_logged_in_user_entity();\n\t} else {\n\t\t$user = get_entity($user_id);\n\t}\n\n\tif (!is_email_address($email)) {\n\t\tregister_error(elgg_echo('email:save:fail'));\n\t\treturn false;\n\t}\n\n\tif ($user) {\n\t\tif (strcmp($email, $user->email) != 0) {\n\t\t\tif (!get_user_by_email($email)) {\n\t\t\t\t$user->new_email = $email;\n\t\t\t\tset_input('email', $user->email);\n\t\t\t\temail_revalidate_request_validation($user->guid);\n\t\t\t} else {\n\t\t\t\tregister_error(elgg_echo('registration:dupeemail'));\n\t\t\t}\n\t\t} else {\n\t\t\tunset($user->new_email);\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tregister_error(elgg_echo('email:save:fail'));\n\t}\n\treturn false;\n}", "public function saveSuccessLogin($user)\n\t{\n\t\t$ip = $this->request->getClientAddress();\n\t\t$agent = $this->request->getUserAgent();\n\t\t$hash = $this->md5($agent);\n\t\t\n\t\t$ua_id = $this->getUserAgentId($hash);\n\t\t\n $successLogin = new \\Manafx\\Models\\User_Success_Logins();\n $successLogin->success_login_user_id = $user->user_id;\n $successLogin->success_login_ip_address = $ip;\n $successLogin->success_login_user_agent_id = $ua_id;\n if (!$successLogin->save()) {\n\t $messages = $successLogin->getMessages();\n\t throw new Exception($messages[0]);\n }\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}", "public function activate_user(){\n\t\t\t\n\t\t\t//escaping the post values\n\t\t\t$uid = html_escape($this->input->post('userID'));\n\t\t\t$id = preg_replace('#[^0-9]#i', '', $uid); // filter everything but numbers\n\n\t\t\t$detail = $this->db->select('*')->from('temp_users')->where('id',$id)->get()->row();\n\t\t\t\n\t\t\tif($detail){\n\n\t\t\t\t\t$temp_user_id = $detail->id;\n\t\t\t\t\t\n\t\t\t\t\t$activate = array(\n\t\t\t\t\t\t'first_name' => $detail->first_name,\n\t\t\t\t\t\t'last_name' => $detail->last_name,\n\t\t\t\t\t\t'email_address' => $detail->email_address,\n\t\t\t\t\t\t'telephone' => $detail->telephone,\n\t\t\t\t\t\t'password' => $detail->password,\t\t\t\t\t\t\n\t\t\t\t\t\t'date_created' => $detail->date_created,\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif($this->db->insert('users', $activate)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->where('id', $temp_user_id);\n\t\t\t\t\t\t$this->db->delete('temp_users');\n\t\t\t\t\t\t\n\t\t\t\t\t\t//SET DEFAULT ALERT SETTING TO ON\n\t\t\t\t\t\t$alert_data = array(\n\t\t\t\t\t\t\t'status' => '1',\n\t\t\t\t\t\t\t'email' => strtolower($detail->email_address),\n\t\t\t\t\t\t\t'last_updated' => '0000-00-00 00:00:00',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//INSERT IN DB\n\t\t\t\t\t\t$this->Email_alerts->insert_alert($alert_data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data['success'] = true;\n\t\t\t\t\t\t$data['notif'] = '<div class=\"alert alert-success text-center\" role=\"alert\"> <i class=\"fa fa-check-circle\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button> User has been activated!</div>';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$data['success'] = false;\n\t\t\t\t\t\t$data['notif'] = '<div class=\"alert alert-danger text-center\" role=\"alert\"><i class=\"fa fa-ban\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button> Can\\'t activate user. DB Error!</div>';\n\t\t\t\t\t}\n\n\t\t\t}else {\n\t\t\t\t$data['success'] = false;\n\t\t\t\t$data['notif'] = '<div class=\"alert alert-danger text-center\" role=\"alert\"><i class=\"fa fa-ban\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button> No such user!</div>';\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}", "public function afterSave() {\n\t\t$setting = GPrivacySetting::model ()->cache ( 500 )->findByPk ( $this->id );\n\t\tif (! $setting) {\n\t\t\t$setting = new GPrivacySetting ();\n\t\t\t$setting->userId = $this->id;\n\t\t\t$setting->save ();\n\t\t}\n\t\t\n\t\tif ($this->isNewRecord) {\n\t\t\tG::log ( G::t ( 'A user has been created: user: {user}', array (\n\t\t\t\t\t'{user}' => CJavaScript::jsonEncode ( $this->attributes ) \n\t\t\t) ) );\n\t\t}\n\t\treturn parent::afterSave ();\n\t}", "public function saveUser($user)\n {\n $sql = \"UPDATE `\".DB::TBL_USERS.\"` \".\n \"SET `fio`=?,`login`=?,`loginHash`=?,`phone`=?,\".\n \"`email`=?, `emailHash`=?,`pass`=?,`photo`=? \".\n \"WHERE `id`=?\";\n $st = $this->MySQL->getConn()->prepare($sql);\n $st->execute([\n $user->fio, $user->login, $user->loginHash,\n $user->phone, $user->email, $user->emailHash,\n $user->pass, $user->photo, $user->id,\n ]);\n }", "public function saveWireTransferToDB($wire_transfer, $user_obj) {\n $em = $this->getDoctrine()->getManager();\n $wire_transfer->setPortalUser($user_obj);\n\n $em->persist($wire_transfer);\n $em->flush();\n }", "public function save(UserInterface $user)\n {\n $this->_em->persist($user);\n $this->_em->flush($user);\n }", "public static function saveUserSession(){\n\t\t$_SESSION['user']=self::$_leuser;\n\t}", "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 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 save()\n\t\t{\n\t\treturn isset($this->userguid) ? $this->update() : $this->create();\n\t\t}", "function __saveLog() {\n $this->__UserLog->save($this->__UserLog->data,false);\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 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 saveUser($nome,$email,$senha){\n \t$id = time();\n $nome = parent::escapeString($nome);\n $senha = md5(parent::escapeString($senha));\n $email = parent::escapeString($email);\n \t//fazer uma validação para ver se o usuario já não está cad\n \t$sql = \"insert into `usuarios` ( `id`,`nome`, `email`, `senha` ) values ('$id','$nome', '$email', '$senha')\"; \n return parent::executaQuery($sql);\n }", "function save()\n {\n $user_meta = get_user_meta(get_current_user_id(), self::USER_META_KEY, true);\n\n if ($user_meta) {\n $result = true;\n\n $user_meta[ $this->id ] = [\n 'name' => $this->name,\n 'artifacts' => $this->artifacts,\n ];\n\n if (get_user_meta(get_current_user_id(), self::USER_META_KEY, true) !== $user_meta) {\n $result = update_user_meta(get_current_user_id(), self::USER_META_KEY, $user_meta);\n }\n\n return $result;\n } else {\n throw new Exception(\"Unable to save collection '$id'.\");\n }\n }", "public function save()\n {\n $this->user->setCulture($this->getValue('language'));\n }", "public function store()\n\t{\n\t\t$activate_data = array(\n\t\t\t\"activate\" => 1,\n\t\t\t\"activated_at\" => $this->datetime->format(\"Y-m-d H:i:s\")\n\t\t);\n\n\t\t$user = $this->user->create(array_merge(Input::all(), $activate_data));\n\n\t\tif($user)\n\t\t{\n\t\t\treturn Redirect::route(\"users.index\");\n\t\t}\n\n\t\treturn Redirect::back()->withInput()->withErrors($this->user->errors());\n\t}", "public function store() \n\t{\n\t\t$input = Input::all();\n\t\t$validation = $this->validator->on('create')->with($input);\n\n\t\tif ($validation->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles(\"orchestra::users/create\"))\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($validation);\n\t\t}\n\n\t\t$user = App::make('orchestra.user');\n\t\t$user->status = User::UNVERIFIED;\n\t\t$user->password = $input['password'];\n\n\t\t$this->saving($user, $input, 'create');\n\n\t\treturn Redirect::to(handles('orchestra::users'));\n\t}", "public function store(Request $request)\n {\n\n $validatedData = $request->validate([\n 'AlertDateEvent' => 'after_or_equal:AlertDateNotifi',\n ], ['AlertDateEvent.after_or_equal' => 'El campo Fecha Evento debe ser una fecha posterior o igual a Fecha de notificación.'\n ]);\n\n /*return $request;*/\n $alert = new Alerts();\n $alert->AlertName = $request->input('AlertName');\n $alert->AlertDateEvent = $request->input('AlertDateEvent');\n $alert->AlertDescription = $request->input('AlertDescription');\n $alert->AlertDateNotifi = $request->input('AlertDateNotifi');\n $alert->AlertType = $request->input('AlertType');\n $alert->AlertNotification = 0;\n $alert->AlertRealizado = 0;\n $alert->AlertPercentage = 100;\n $alert->user_id = Auth::user()->id;\n $alert->save();\n\n $usuario = User::where('id', $alert->user_id)->first();\n $areadelusuario = Areas::where('id', $usuario->areas_id)->first();\n $jefearea = User::with(['areas', 'roles' => function ($query) {\n $query->where('name', 'JefeArea');\n }])\n ->role('JefeArea')\n ->where('areas_id', $areadelusuario->id)->first();\n\n switch ($alert->AlertType) {\n case 'Global':\n Mail::to(User::all())->queue(new NewAlert($alert));\n break;\n\n case 'Sede':\n $areaUsuario = Areas::where('id', Auth::user()->id)->first();\n $areasdeSede = Areas::where('AreaSede', $areaUsuario->AreaSede)->get('id');\n $destinatariosSede = User::whereIn('areas_id', $areasdeSede)\n ->with('areas')\n ->get();\n Mail::to($destinatariosSede)->queue(new NewAlert($alert));\n break;\n\n case 'Area':\n $area = Areas::where('id', Auth::user()->id)->with('users')->first();\n Mail::to($area->users)->queue(new NewAlert($alert));\n break;\n\n case 'Personal':\n Mail::to($request->user())->queue(new NewAlert($alert));\n break;\n \n default:\n Mail::to($request->user())->queue(new NewAlert($alert));\n break;\n }\n\n return redirect()->route('alerts.index')->withStatus(__('Alerta creada correctamente'));\n }", "public function save(Application_Model_User $users)\r\n {\r\n $data = array(\r\n 'login' => $users->getLogin(),\r\n 'pass' => $users->getPass()\r\n );\r\n\r\n if (null === ($id = $users->getId())) {\r\n unset($data['id']);\r\n $this->getDbTable()->insert($data);\r\n } else {\r\n $this->getDbTable()->update($data, array('id = ?' => $id));\r\n }\r\n }", "function subsite_manager_login_shutdown_hook(ElggUser $user){\n\n if(!empty($user) && elgg_instanceof($user, \"user\", null, \"ElggUser\")){\n $user->save();\n }\n }" ]
[ "0.6659774", "0.6607691", "0.65940225", "0.65059215", "0.6499467", "0.6397574", "0.6364595", "0.6348377", "0.6338866", "0.62932944", "0.6261112", "0.62482023", "0.6216686", "0.6213203", "0.61952806", "0.61512583", "0.61137706", "0.6107725", "0.60996836", "0.6092934", "0.60866624", "0.60813534", "0.6050545", "0.6033604", "0.603128", "0.6015008", "0.6011899", "0.5990647", "0.5983862", "0.5961837", "0.59591657", "0.5950882", "0.5948769", "0.5942162", "0.5939325", "0.5934577", "0.5931639", "0.5930225", "0.5922608", "0.59225535", "0.59182966", "0.5908248", "0.5901113", "0.5900049", "0.5895625", "0.58826107", "0.5882125", "0.588205", "0.58636975", "0.58491224", "0.58430296", "0.5839303", "0.583075", "0.5813238", "0.58043003", "0.57893336", "0.57838064", "0.5763805", "0.5758393", "0.5757888", "0.5749391", "0.57473505", "0.5744211", "0.57391906", "0.5730937", "0.571836", "0.5693815", "0.56894624", "0.5683438", "0.566177", "0.5661725", "0.565896", "0.565414", "0.56461906", "0.5638518", "0.56371105", "0.5630757", "0.56071746", "0.56032217", "0.560094", "0.55915695", "0.5588733", "0.55811584", "0.5579977", "0.5569283", "0.5568877", "0.5568233", "0.55608135", "0.5550678", "0.55477655", "0.5542828", "0.55370945", "0.5533799", "0.5529813", "0.55262977", "0.55101097", "0.5507889", "0.5504377", "0.55015266", "0.5498357" ]
0.760509
0
IMPROTANT: header.php must be included before this file
function printRecommendedQuestions() { //print recommended questions from the current database connection $rec_questions = mysql_query("SELECT question,question_name,answer FROM intro WHERE recommend = 1"); while($row = mysql_fetch_array($rec_questions)) { if(!$row['question_name']) { $row['question_name'] = "שאלה"; } if($row['question']) { echo "<a href=\"{$row['question']}\">{$row['question_name']}</a> - <a href=\"{$row['answer']}\">פתרון</a><br />"; } else { echo "<a href=\"{$row['answer']}\">{$row['question_name']} - השאלה והפתרון</a><br />"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function includeHead()\n {\n require_once __DIR__ . '/templates/head.php';\n }", "public function addHeader()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/header.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/header.php\");\n }\n }", "public static function head()\n {\n require_once(getcwd() . \"/views/Template/head.php\");\n }", "public function initPageHeaders()\n\t{\n\t\tinclude_once('view/main_page_header.php');\n\t}", "public static function header_logged_in()\n {\n require_once(getcwd() . \"/views/Template/header-logged-in.php\");\n }", "public static function show_header() {\n require_once Config::get('prefix') . '/templates/header.inc.php';\n }", "public function includeHeadAdmin()\n {\n require_once __DIR__ . '/templates/head-admin.php';\n }", "function getHeader(){\n include_once ('header.php');\n}", "public function addHead()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/head.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/head.php\");\n }\n }", "function build_header() {\r\n include 'header.php';\r\n\r\n}", "function get_header($args = null){\n\trequire_once(GENERAL_DIR.'header.php');\n}", "public function _assign_xoops_header()\n {\n $header_class = webphoto_xoops_header::getInstance($this->_DIRNAME, $this->_TRUST_DIRNAME);\n $header_class->set_flag_css(true);\n $header_class->assign_for_main();\n }", "function my_header()\r\n{\r\n ?>\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n <meta charset=\"UTF-8\">\r\n <title>Trump Pursuit</title>\r\n <link rel=\"stylesheet\" href=\"./asset/css/reset.css\">\r\n <link rel=\"stylesheet\" href=\"./asset/css/style.css\">\r\n</head>\r\n<?php\r\n}", "protected function output_header() {\n include dirname( __FILE__ ) . '/views/html-csv-import-header.php';\n }", "protected function header()\n {\n\n }", "function in_admin_header()\n {\n }", "function opinionstage_settings_load_header(){\n}", "function common_pre_header() {\r\n global $current_screen;\r\n\r\n $browser = WPI_Functions::browser();\r\n $screen_id = $current_screen->id;\r\n\r\n if (!$screen_id) {\r\n return;\r\n }\r\n\r\n //* Load Global Script and CSS Files */\r\n if (file_exists(WPI_Path . '/core/css/jquery-ui-1.8.21.custom.css')) {\r\n wp_register_style('wpi-custom-jquery-ui', WPI_URL . '/core/css/jquery-ui-1.8.21.custom.css');\r\n }\r\n\r\n if (file_exists(WPI_Path . '/core/css/wpi-admin.css')) {\r\n wp_register_style('wpi-admin-css', WPI_URL . '/core/css/wpi-admin.css', array(), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load Page Conditional Script and CSS Files if they exist*/\r\n if (file_exists(WPI_Path . \"/core/css/{$screen_id}.css\")) {\r\n wp_register_style('wpi-this-page-css', WPI_URL . \"/core/css/{$screen_id}.css\", array('wpi-admin-css'), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load IE 7 fix styles */\r\n if (file_exists(WPI_Path . \"/core/css/ie7.css\") && $browser['name'] == 'ie' && $browser['version'] == 7) {\r\n wp_register_style('wpi-ie7', WPI_URL . \"/core/css/ie7.css\", array('wpi-admin-css'), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load Page Conditional Script and CSS Files if they exist*/\r\n if (file_exists(WPI_Path . \"/core/js/{$screen_id}.js\")) {\r\n wp_register_script('wpi-this-page-js', WPI_URL . \"/core/js/{$screen_id}.js\", array('wp-invoice-events'), WP_INVOICE_VERSION_NUM);\r\n }\r\n\r\n //* Load Conditional Metabox Files */\r\n if (file_exists(WPI_Path . \"/core/ui/metabox/{$screen_id}.php\")) {\r\n include_once WPI_Path . \"/core/ui/metabox/{$screen_id}.php\";\r\n }\r\n }", "function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}", "function getHeader(){\n\t\trequire 'pages/headerfooter/header.html';\n\t}", "abstract protected function header();", "function get_header(){\n\t\tglobal $FANNIE_ROOT;\n\t\tob_start();\n\t\t$page_title = $this->title;\n\t\t$header = $this->header;\n\t\tinclude($FANNIE_ROOT.'src/header_install.html');\n\t\treturn ob_get_clean();\n\n\t}", "public function phead($scripts = []) {\n include(dirname(dirname(__FILE__)) . '/ui/header.php');\n }", "public static function printHead() {\n header('Content-Type: text/html; charset='.CHARSET);\n // Checking Bootsprap is enabled\n if(BOOTSTRAP_ON === TRUE){\n //Bootstrap include\n echo BS_DOCTYPE5;\n echo '<html lang=\"'.LANG.'\">';\n echo '<head>';\n echo '<meta charset=\"'.CHARSET.'\">';\n echo '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">';\n echo '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">';\n \n // HTML Title\n echo '<title>'.HTML_TITLE.'</title>';\n // Bootstrapping via CDN\n echo '<link rel=\"stylesheet\" href=\"'.BOOTSTRAP_CSS_CDN.'\">';\n echo '<link rel=\"stylesheet\" href=\"'.BOOTSTRAP_CSSTHEME_CDN.'\">';\n echo '<link rel=\"stylesheet\" href=\"'.MY_CSS.'\">';\n\n }\n elseif(BOOTSTRAP_ON === 5){\n echo BS_DOCTYPE5;\n echo '<html>';\n echo '<html lang=\"'.LANG.'\">';\n echo '<title>'.HTML_TITLE.'</title>';\n echo '<meta charset=\"'.CHARSET.'\">';\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n .PROJECT_HTTP_ROOT.'/inc/css/default.css\">';\n echo '<script src=\"'.PROJECT_HTTP_ROOT.'/js/default.js\" '\n .'type=\"text/javascript\"></script>';\n } \n else {\n echo BS_DOCTYPE401;\n echo '<html>';\n echo '<head>';\n echo '<title>'.HTML_TITLE.'</title>';\n echo '<meta http-equiv=\"content-type\" content=\"text/html; '\n .'charset='.CHARSET.'\">'.\"\\n\";\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n .PROJECT_HTTP_ROOT.'/inc/css/default.css.php\">';\n echo '<script src=\"'.PROJECT_HTTP_ROOT.'/js/default.js\" '\n .'type=\"text/javascript\"></script>';\n }\n \n echo '<meta name=\"description\" content=\"'.META_DESCRIPTION.'\">';\n echo '<meta name=\"author\" content=\"'.META_AUTHOR.'\">';\n echo '<meta name=\"keywords\" content=\"'.META_KEYWORDS.'\">';\n echo '<meta name=\"date\" content=\"'.META_DATE.'\">';\n echo '</head>';\n }", "public static function header_logged_out()\n {\n require_once(getcwd() . \"/views/Template/header-logged-out.php\");\n }", "function html_header()\n{\n\techo \"<html>\\n<head>\\n\";\n\techo \"\\t<title>CalDAVTester GUI</title>\\n\";\n\tif (file_exists(__DIR__.'/jquery.js'))\n\t{\n\t\techo \"\\t<script src='jquery.js'></script>\\n\";\n\t}\n\telse\n\t{\n\t\techo \"\\t<script src='https://code.jquery.com/jquery-2.2.4.min.js' integrity='sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=' crossorigin='anonymous'></script>\\n\";\n\t}\n\techo \"\\t<script src='gui.js'></script>\\n\";\n\techo \"\\t<link type='text/css' href='gui.css' rel='StyleSheet'/>\\n\";\n\techo \"</head>\\n<body>\\n\";\n}", "function Header(){\n\t\t}", "public function printHeader() {\n\t\t$template = self::$templates[$this->templateName];\n\t\trequire_once $template['path'] . $template['file-header'];\n\t}", "public function header()\n {\n echo \"<!doctype html>\\n<html lang='pt'>\\n<head>\\n\";\n echo \"\\t<meta charset='UTF-8'>\\n\";\n echo \"\\t<title>{$this->controller->getTitle()}</title>\\n\";\n $this->links();\n echo \"</head>\\n<body>\\n\";\n }", "function print_header()\n{\n print '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\";\n print '<!DOCTYPE XHTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" ';\n print '\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> ' . \"\\n\";\n print '<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">' . \"\\n\";\n print \"<head>\\n\";\n include_once( \"google_analytics.php\" );\n print \" <title>Tom H.'s Photos</title>\\n\";\n print ' <link rel=\"stylesheet\" href=\"../../basic_styles.css\">\\n';\n print ' <link rel=\"stylesheet\" href=\"local_styles.css\">\\n';\n print \"</head>\\n\";\n print \"<body>\\n\";\n}", "static function header() {\n $url = $GLOBALS[\"path\"] ? $GLOBALS[\"path\"] : \"http://localhost:8000/\";\n echo '<script src=\"'.$url.'pontoon.js\"></script>'.\"\\n\";\n }", "public function require_wordpress_header() {\n\t\tglobal $post;\n\t\t\\set_current_screen( 'revision' );\n\t\t// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- The revision screen expects $post to be set.\n\t\t$post = $this->post;\n\t\trequire_once ABSPATH . 'wp-admin/admin-header.php';\n\t}", "public function add_header() {\n }", "private function do_header() {\n $m_header = '';\n $m_header .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />';\n $m_header .= '<meta http-equiv=\"Content-Language\" content=\"en-gb\" />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/reset.css type=text/css />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/style.css type=text/css />';\n $this->c_header = $m_header;\n }", "function add_admin_header() {\n }", "function loadInHeader() {\n $this->metaData();\n//\t\t$this->loadAddOns();\n $this->onHead(\"onHead\"); // call back to onHead in extensions things js, etc in head\n $this->onEditor(\"onHead\"); // only when login to admin, for fck to work??\n //If not in admin, blank initEditor\n if (!isset($_SESSION['name'])) { // not sure what this does??\n print \"<script type=\\\"text/javascript\\\">function initeditor(){}</script>\\n\";\n }\n }", "abstract public function header();", "public function prePageHeader();", "function index(){\r\n \r\n require_once 'view/layout/header.php';\r\n require_once 'view/error.php';\r\n require_once 'view/layout/footer.php';\r\n }", "public function template_header() {\n\t\tget_header( 'course' );\n\t}", "function get_header($file=''){\n global $config;\n static $header_loaded = false;\n if($file == ''){//load included file\n if(!$header_loaded)\n {//header loads first time\n $file = 'header.php'; \n $header_loaded = true;\n }else{\n $file = 'footer.php';\n }\n \n }\n \n $file = $config->physical_path . '/themes/' . $config->theme . '/' . $file;\n \n if(file_exists($file)){\n include $file;\n }else{\n myerror(__FILE__,__LINE__,'include file not found: ' . $file);\n }\n }", "function html_header()\r\n\t{\r\n?>\r\n\t\t<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n\t\t\t\"http://www.w3.org/TR/html4/loose.dtd\">\r\n\t\t<html>\r\n\r\n\t\t<head>\r\n\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8;\">\r\n\t\t\t<title>Exam Reservation System</title>\r\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"testres.css\"> \r\n\t\t</head>\r\n\t\t<body>\r\n<?php\r\n\t}", "function displayHtmlHeader() {\n\t\tglobal $page;\n\t\t\n\t\techo \"<!DOCTYPE html5>\";\n\t\techo \"<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='fr'>\";\n\t\t\n\t\t\techo \"<head>\";\n\t\t\t\t\n\t\t\t\t//Encodage et zoom\n\t\t\t\techo \"<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\";\n\t\t\t\techo \"<meta name='viewport' content='width=device-width, initial-scale=1.0' />\";\n\t\t\t\techo \"<meta http-equiv='X-UA-Compatible' content='IE=edge' />\";\n\t\t\t\t\n\t\t\t\t//Titre de la page\n\t\t\t\techo \"<title>Gestion maintenances | Best Engines Inc.</title>\";\n\t\t\t\t\n\t\t\t\t//Description et auteur de la page\n\t\t\t\techo \"<meta name='description' content='Application de gestion des maintenances de la société Best Engines Inc.' />\";\n\t\t\t\techo \"<meta name='author' content='Best Engines Inc.' />\";\n\t\t\t\t\n\t\t\t\t//Fichiers CSS\n\t\t\t\techo \"<link href='config/css/bootstrap.min.css' rel='stylesheet' />\";\n\t\t\t\techo \"<link href='config/css/animate.css' rel='stylesheet' />\";\n\t\t\t\techo \"<link href='config/css/styles.css' rel='stylesheet' />\";\n\t\t\t\t\n\t\t\t\t//Formulaire d'authentification\n\t\t\t\tif($page == \"authentification\") {\n\t\t\t\t\techo \"<link rel='stylesheet' href='config/font-awesome/css/font-awesome.min.css' />\";\n\t\t\t\t\techo \"<link rel='stylesheet' href='config/css/authentification/form-elements.css' />\";\n\t\t\t\t\techo \"<link rel='stylesheet' href='config/css/authentification/style.css' />\";\n\t\t\t\t\t\n\t\t\t\t\techo \"<!--[if lt IE 9]>\";\n\t\t\t\t\t\techo \"<script src='https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js'></script>\";\n\t\t\t\t\t\techo \"<script src='https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js'></script>\";\n\t\t\t\t\techo \"<![endif]-->\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Font\n\t\t\t\techo \"<link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Montserrat' />\";\n\t\t\t\t\n\t\t\t\t//Favicon\n\t\t\t\techo \"<link href='doc/img/favicon/favicon.png' rel='shortcut icon' />\";\n\n\t\t\techo \"</head>\";\t\t\t\n\t\t\techo \"<body>\";\n\t}", "function get_header() {\n\tif ( file_exists( TEMPLATEPATH . '/header.php') )\n\t\tload_template( TEMPLATEPATH . '/header.php');\n\telse\n\t\tload_template( ABSPATH . 'wp-content/themes/default/header.php');\n}", "public function header() {\n\t}", "function header() {\n?>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\n<?php \n // load the javascripts -- this is a little confusing and could be done more better.\n $this->jscript_list();\n $this->css_list();\n?> \n <Title><?php echo $this->title; ?></Title>\n</head>\n\n<?php \n }", "function header() {\n }", "function admin_page_header()\n\t\t{\n\t\t\t$permissions = $this->permissions_check();\n\n\t\t\t$out = '';\n\t\t\t$out .= '<h1>WP Volunteer Manager</h1>';\n\n\t\t\t$out .= $this->render_messages();\n\t\t\t$out .= $this->admin_notices();\n\n\t\t\techo $out;\n\n\t\t\tif(!$permissions) { wp_die(); }\n\t\t}", "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 }", "function rd_do_header()\n{\n\techo <<<END\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"EN\">\n\t<head>\n\t\t<title>ocPortal rootkit detector</title>\n\t\t<link rel=\"icon\" href=\"http://ocportal.com/favicon.ico\" type=\"image/x-icon\" />\n\t\t<style type=\"text/css\">\nEND;\n@print(preg_replace('#/\\*\\s*\\*/\\s*#','',str_replace('url(\\'\\')','none',str_replace('url(\"\")','none',preg_replace('#\\{\\$[^\\}]*\\}#','',file_get_contents($GLOBALS['FILE_BASE'].'/themes/default/css/global.css'))))));\necho <<<END\n\t\t\t.main_page_title { text-decoration: underline; display: block; background: url('themes/default/images/bigicons/ocp-logo.png') top left no-repeat; min-height: 42px; padding: 3px 0 0 60px; }\n\t\t\ta[target=\"_blank\"], a[onclick$=\"window.open\"] { padding-right: 0; }\n\t\t</style>\n\t</head>\n\t<body class=\"re_body\"><div class=\"global_middle\">\n\t\t<h1 class=\"main_page_title\">ocPortal rootkit detector</h1>\n\t\t<form title=\"Proceed\" action=\"rootkit_detection.php?type=go\" method=\"post\">\nEND;\n}", "public function hookHeader()\n {\n // $this->context->controller->addJS('http://code.jquery.com/jquery-2.1.4.min.js');\n // $this->context->controller->addJS($this->_path.'views/js/bootstrap.min.js');\n $this->context->controller->addJS($this->_path.'views/js/front.js');\n $this->context->controller->addCSS($this->_path.'views/css/front.css');\n\n $this->context->controller->addJS($this->_path.'views/js/responsiveslides.js');\n $this->context->controller->addCSS($this->_path.'views/css/responsiveslides.css');\n $this->context->controller->addCSS($this->_path.'views/css/themes.css');\n }", "function includes() {\r\n\t\t\trequire_once( trailingslashit( RV_PORTFOLIO_DIR ) . 'inc/public/class-rv-portfolio-registration.php' );\r\n\t\t}", "function printHeader()\n\t{\n\t\t$_SESSION['last_page'] = $_SERVER['QUERY_STRING'];\n\t\tif( isset($_SESSION['admin']) && $_SESSION['admin'])\n\t\t{\n\t\t\t$this->admin_nav = \"<a class=\\\"button\\\" href=\\\"?section=project_management\\\" title=\\\"Go to project management\\\">Project Management</a>\\n\n\t\t\t\t\\t\\t<a class=\\\"button\\\" href=\\\"?section=reference_value_management\\\" title=\\\"Go to reference value management\\\">Reference Value Management</a>\\n\n\t\t\t\t\\t\\t<a class=\\\"button\\\" href=\\\"?section=user_management\\\" title=\\\"Go to user management\\\">User Management</a>\\n\";\n\t\t}\n\t\t$this->initSessionVariables();\n\t\tinclude 'View/Header.html';\n\t}", "function myheader($additionalHeaderContent = NULL) {\n\t\tprint '<html>';\n\t\t\tprint '<head>';\n\t\t\t\tprint '<title>';\n\t\t\t\t\tif (defined('TITLE')) {\n\t\t\t\t\t\tprint TITLE;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tprint 'MiddleClik';\n\t\t\t\t\t}\n\t\t\t\tprint '</title>';\n\t\t\t\tprint \"<meta http-equiv=\\\"content-type\\\" content=\\\"text/html; charset=utf-8\\\" />\";\n\t\t\t\tprint $additionalHeaderContent;\n\t\t\t\tprint \"<style type=\\\"text/css\\\">\";\n\t\t\t\t\tprint '//this is where my css, js goes';\n\t\t\t\tprint \"</style>\";\n\t\t\tprint '</head>';\n\t}", "function opinionstage_help_resource_load_header(){\n}", "public function header()\n {\n }", "public static function start_head()\n\t{\n\t\t?>\n\t\t<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n\t\t<head>\n\t\t<title></title>\n\t\t<link rel=\"shortcut icon\" href=\"favicon.ico\" />\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t<meta http-equiv=\"content-language\" content=\"fr\" />\n\t\t<link href=\"style.css\"\ttitle=\"Défaut\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n\t\t\n <?php\n\t}", "private function displayHeader(){\n\t\t\t$html = '<!doctype html>'.\"\\n\";\n\t\t\t$html .= '<!--[if LT IE 9]>'.\"\\n\";\n\t\t\t$html .= '<html class=\"ie\">'.\"\\n\";\n\t\t\t$html .= '<![endIF]-->'.\"\\n\";\n\t\t\t$html .= '<!--[if !IE]><!-->'.\"\\n\";\n\t\t\t$html .= '<html>'.\"\\n\";\n\t\t\t$html .= '<!--<![endif]-->'.\"\\n\";\n\t\t\t$html .= '<head>'.\"\\n\";\n\t\t\t$html .= '<title> PCInsight | ' .$this->pageInfo['pageTitle'].'</title>'.\"\\n\";\n\t\t\t$html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"scripts/loadCSS.php\" />'.\"\\n\";\n\t\t\t$html .= '<link rel=\"shortcut icon\" type=\"image/png\" href=\"resources/images/favicon.png\" />'.\"\\n\";\n\t\t\t$html .= '<link rel=\"icon\" type=\"image/x-icon\" href=\"resources/images/favicon.ico\" />'.\"\\n\";\n\t\t\t$html .= '<meta charset=\"UTF-8\" />'.\"\\n\";\n\t\t\t$html .= '<meta name=\"description\" content=\"'.$this->pageInfo['pageDescription'].'\" />'.\"\\n\";\n\t\t\t$html .= '<script src=\"resources/lib/jquery-1.10.2.min.js\" type=\"text/javascript\"></script>'.\"\\n\";\n\t\t\t$html .= '<script src=\"resources/js/main.js\" type=\"text/javascript\"></script>'.\"\\n\";\n\t\t\t$html .= '</head>'.\"\\n\";\n\t\t\t$html .= '<body class=\"nojs\">'.\"\\n\";\n\t\t\t$html .= '<div id=\"topbar\" class=\"clearfix\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"wrapper\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"left\">'.\"\\n\";\n\t\t\t$html .= '<h1 class=\"mainHeader\"><a href=\"index.php\"><span> PC</span>insight </a></h1>'.\"\\n\";\n\t\t\t$html .= '<nav>'.\"\\n\";\n\t\t\t$html .= '<ul>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php\" accesskey=\"1\"> Home </a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=9\" accesskey=\"2\"> Articles </a></li>'.\"\\n\";\t\t\n\t\t\t$html .= '<li><a href=\"index.php?p=10\" accesskey=\"3\"> About </a></li>'.\"\\n\";\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '</nav>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '<div class=\"mobilenav\">'.\"\\n\";\n\t\t\t$html .= '<span class=\"mobileNavBu\"></span>'.\"\\n\";\n\t\t\t$html .= '<div class=\"menu\">'.\"\\n\";\n\t\t\t$html .= '<ul>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php\"> Home </a></li>'.\"\\n\"; \n\t\t\t$html .= '<li><a href=\"index.php?p=9\"> Articles </a></li>'.\"\\n\"; \t\t\t\n\t\t\t$html .= '<li><a href=\"index.php?p=10\"> About </a></li>'.\"\\n\";\n\t\t\tif (!(isset($_SESSION['username']))){\n\t\t\t\t$html .= '<li><a href=\"index.php?p=2\" accesskey=\"4\"> Login </a></li>'.\"\\n\";\n\t\t\t\t$html .= '<li><a href=\"index.php?p=3\" accesskey=\"5\"> Register </a></li>'.\"\\n\";\n\t\t\t} else {\n\t\t\t\tif ($this->model->isAdmin()){\n\t\t\t\t\t$html .= '<li><a href=\"admin/\"> Admin </a></li>'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= '<li><a href=\"index.php?p=5\" accesskey=\"6\"> Logout </a></li>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '<form action=\"index.php\" method=\"get\">'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"p\" value=\"7\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"text\" class=\"search\" placeholder=\"Search\" name=\"q\" value=\"'.$_GET['q'].'\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"submit\" class=\"btn blue small\" value=\"search\"/>'.\"\\n\";\n\t\t\t$html .= '</form>'.\"\\n\";\t\t\t\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '<div class=\"right\">'.\"\\n\";\n\t\t\tif (!(isset($_SESSION['username']))){\n\t\t\t\t$html .= '<div class=\"login\">'.\"\\n\";\n\t\t\t\t$html .= '<a href=\"index.php?p=2\"> Login </a>'.\"\\n\";\n\t\t\t\t$html .= '<a href=\"index.php?p=3\"> Register </a>'.\"\\n\";\n\t\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t} else {\n\t\t\t\t$html .= '<div class=\"login\">'.\"\\n\";\n\t\t\t\t$html .= '<a href=\"index.php?p=5\"> Logout </a>'.\"\\n\";\n\t\t\t\tif ($this->model->isAdmin()){\n\t\t\t\t\t$html .= '<a href=\"admin/\"> Admin </a>'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '<div class=\"search\">'.\"\\n\";\n\t\t\t$html .= '<form action=\"index.php\" method=\"get\">'.\"\\n\"; \n\t\t\t$html .= '<input type=\"hidden\" name=\"p\" value=\"7\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"text\" class=\"search\" placeholder=\"Search\" name=\"q\" value=\"'.$_GET['q'].'\"/>'.\"\\n\";\n\t\t\t$html .= '<input type=\"submit\" class=\"btn blue small\" value=\"Search\" />'.\"\\n\";\n\t\t\t$html .= '</form>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\tif (!$this->db->isRegistered()){\n\t\t\t\t$html .= '<div class=\"register\"><p> Please register your account <a href=\"index.php?p=13\">here</a></p></div>';\n\t\t\t}\n\t\t\treturn $html;\n\t\t}", "function bb_header()\n{\n\tdo_action('bb_header');\n}", "function build_header()\n{\n global $displayName;\n\n include 'header.php';\n}", "function bj_header2_setup(){\n\tif(function_exists('the_custom_header')){\n\t\tthe_custom_header();\n\t}\n}", "public function includes() {\n\t\trequire_once( 'metabox.php' );\n\t}", "public function settings_header() {\n\t\t$this->include_template('wp-admin/settings/header.php');\n\t}", "function msdlab_pre_header(){\n print '<div class=\"pre-header\">\n <div class=\"wrap\">';\n do_action('msdlab_pre_header');\n print '\n </div>\n </div>';\n }", "function admin_head()\n {\n }", "function display_portal_header()\r\n {\r\n Display :: header(null);\r\n }", "public static function after_header() {\r\n\r\n\t}", "function do_signup_header()\n {\n }", "public function hookHeader()\n {\n $language_code = $this->context->language->language_code;\n $this->context->controller->addJS($this->_path . '/views/js/front.js');\n $this->context->controller->addCSS($this->_path . '/views/css/front.css');\n if (version_compare(_PS_VERSION_, '1.6.1.0', '>=')) {\n Media::addJsDef(\n array(\n 'wi_weather_provider' => Configuration::get('WI_WEATHER_PROVIDER'),\n 'wi_weather_url' => $this->getUrl(),\n 'wi_weather_city' => $this->getCity($language_code)\n )\n );\n } else {\n $this->context->smarty->assign(\n array(\n 'wi_weather_provider' => Configuration::get('WI_WEATHER_PROVIDER'),\n 'wi_weather_url' => $this->getUrl(),\n 'wi_weather_city' => $this->getCity($language_code)\n )\n );\n\n return $this->context->smarty->fetch(\n _PS_MODULE_DIR_ . $this->name\n . DIRECTORY_SEPARATOR . 'views'\n . DIRECTORY_SEPARATOR . 'templates'\n . DIRECTORY_SEPARATOR . 'front'\n . DIRECTORY_SEPARATOR . 'javascript.tpl'\n );\n }\n }", "function display_header() {}", "function rst_intro_page()\n{\n require_once('inc/inc.info.php');\n}", "function header($title=false) {\n\t\tif(!$title) {\n\t\t\t$title = 'Beerlogger';\n\t\t}\n\t\tob_start();\n\t\tinclude('templates/header.php');\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "function wellcome_page() {\n\tif (!defined('APP_DEFAULT') || strcmp(trim(APP_DEFAULT), \"\") == 0) {\n\t\tinclude 'libs/wellcome.php';\n\t} else {\n\t\theader(\"Location: \" . APP_DEFAULT); \n\t}\n}", "function head(){\n\t?><head>\n\t<meta charset=\"UTF-8\">\n\t<title>EEMS</title>\n\t<link rel=\"stylesheet\" href=\"css/style_web.css\" type=\"text/css\">\n\t</head><?php\n}", "function get_header(){\n\t$theme_path = get_theme_path();\n\t$header \t= $theme_path . '/header.php';\n\n\tif ( !file_exists($header) )\n\t\tdie( 'Header file does not exist.' );\n\n\treturn require_once( $header );\n}", "function print_html_header() {\n?><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 TRANSITIONAL//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<title>lint_php</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n\t<meta name=\"generator\" content=\"kate\">\n\t<meta name=\"description\" content=\"An online tool to compute PHP code McCabe's cyclomatic complexity\">\n\t<meta name=\"keywords\" content=\"PHP, McCabe, Cyclomatic complexity, GPL, Pasquale Ceres, Caposele\">\n</head>\n<body>\n<?php\n}", "public function afficheHead() {\n\t\t?>\n\t\t<!DOCTYPE html>\n\t\t<html lang=\"fr\">\n\t\t\n\t\t<head>\n\t\t <title>L'art public à Montréal - admin</title>\n\t\t <meta charset=\"utf-8\">\n\t\t <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n\t\t <meta name=\"description\" content=\"\">\n\t\t <meta name=\"viewport\" content=\"width=device-width\">\n\t\t \n\t\t <link rel=\"stylesheet\" href=\"<?php echo BASE_URL.\"css/flex.css\"?>\" type=\"text/css\" media=\"screen\">\n\t\t <link rel=\"stylesheet\" href=\"<?php echo BASE_URL.\"css/adminmain.css\"?>\" type=\"text/css\" media=\"screen\">\n\t\t \n\t\t <script src=\"<?php echo BASE_URL.\"js/define.js\"?>\"></script>\n\t\t <script src=\"<?php echo BASE_URL.\"js/admin.js\"?>\"></script>\n\t\t</head>\n\t\t<?php\n\t\t\n\t}", "function add_header_stuff() {\n\n echo '<meta charset=\"utf-8\" />';\n\n echo '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />';\n\n// include( 'assets/images/sprite/sprite.svg' ); // Include generated SVG Sprite\n// \n// include( 'parts/header-meta' ); // Include additional meta information in the header\n}", "function additionalHeaderStuff() {\n return;\n }", "public function motivation() {\n\t\t$pageTitle = 'Motivation';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/motivation.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function lightseek_homepage_header() {\n\techo '<header class=\"entry-header\">';\n\t\tlightseek_post_header();\n\techo '</header>';\n}", "public function hookHeader()\n\t{\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\n\t\t/* Continue only if we are in the checkout process */\n\t\tif (Tools::getValue('controller') != 'order-opc' && (!($_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order.php' || $_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order-opc.php' || Tools::getValue('controller') == 'order' || Tools::getValue('controller') == 'orderopc' || Tools::getValue('step') == 3)))\n\t\t\treturn;\n\n\t\t/* Load JS and CSS files through CCC */\n\t\t$this->context->controller->addCSS($this->_path.'views/css/stripe-prestashop.css');\n\t\t\n\t\treturn '<script src=\"https://checkout.stripe.com/checkout.js\"></script>';\n\t}", "function Header()\n\t{\n\t\t$this->cabecera_esp();\n\t\t$this->Ln();\n\t}", "function head() { /*{{{*/\n\techo \"\n<HTML><HEAD>\n<META http-equiv=Content-Type content='text/html; charset=utf-8' />\n<title>admin</title>\n</HEAD>\n<link rel='stylesheet' type='text/css' href='css/css.css'>\n<link rel='stylesheet' type='text/css' href='css/datepicker.css' />\n<script type='text/javascript' src='js/jquery.js'></script>\n<script type='text/javascript' src='js/taffy-min.js'></script>\n<script type='text/javascript' src='js/moment.min.js'></script>\n<script type='text/javascript' src='js/datepicker.js'></script>\n<script type='text/javascript' src='js/script.js'></script>\n\";\n}", "public function addHeader()\n {\n }", "function top() {\n\t\trequire ('views/partial/top.php');\n\t}", "public function hookHeader()\n\t{\n\t\t$this->context->controller->addJS($this->_path.'/views/js/front.js');\n\t\t$this->context->controller->addCSS($this->_path.'/views/css/front.css');\n\t}", "function showHead($title='') {\n\tglobal $template, $config;\n?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head>\n<title><?=$title?></title>\n<link href=\"<?=joinPath($config['site_absolute_url'],'/')?>css/style.css\" rel=\"stylesheet\" type=\"text/css\" />\n<script src=\"<?=joinPath($config['site_absolute_url'],'/')?>js/JSL.js\" type=\"text/javascript\"></script>\n<script src=\"<?=joinPath($config['site_absolute_url'],'/')?>js/application.js\" type=\"text/javascript\"></script>\n<?=implode($template->includes,\"\\n\");?>\n<?php\n}", "public static function headerDeclarations()\n {\n if (self::$loaded) {\n return;\n }\n\n $app = JFactory::getApplication();\n $doc = JFactory::getDocument();\n\n $siteUrl = JURI::root(true);\n\n $baseSite = 'components/' . COM_PAPIERSDEFAMILLES;\n $baseAdmin = 'administrator/components/' . COM_PAPIERSDEFAMILLES;\n\n $componentUrl = $siteUrl . '/' . $baseSite;\n $componentUrlAdmin = $siteUrl . '/' . $baseAdmin;\n\n JHtml::_('jquery.framework');\n JHtml::_('formbehavior.chosen', 'select');\n\n //JDom::_('framework.hook');\n JDom::_('html.icon.glyphicon');\n\n\n //Load the jQuery-Validation-Engine (MIT License, Copyright(c) 2011 Cedric Dugas http://www.position-absolute.com)\n self::addScript($baseAdmin, 'js/jquery.validationEngine.js');\n self::addStyleSheet($baseAdmin, 'css/validationEngine.jquery.css');\n PapiersdefamillesHelperHtmlValidator::loadLanguageScript();\n PapiersdefamillesHelperHtmlValidator::attachForm();\n\n\n //CSS\n if ($app->isAdmin()) {\n\n\n self::addStyleSheet($baseAdmin, 'css/papiersdefamilles.css');\n self::addStyleSheet($baseAdmin, 'css/toolbar.css');\n\n } else {\n if ($app->isSite()) {\n self::addStyleSheet($baseSite, 'css/papiersdefamilles.css');\n self::addStyleSheet($baseSite, 'css/toolbar.css');\n\n }\n }\n\n\n self::$loaded = true;\n }", "function sloodle_print_header()\r\n {\r\n global $CFG;\r\n $navigation = \"<a href=\\\"{$CFG->wwwroot}/mod/sloodle/view.php?_type=course&id={$this->course->id}\\\">\".get_string('courseconfig', 'sloodle').\"</a>\";\r\n\r\n\r\n sloodle_print_header_simple(get_string('courseconfig','sloodle'), \"&nbsp;\", $navigation, \"\", \"\", true, '', navmenu($this->course));\r\n }", "function getHeader(string $title, string $description, array $stylesheets = []) {\n require_once 'layout/header.php';\n}", "public function includes() {\n\t\t\t//require_once(ABSPATH . 'wp-admin/includes/nav-menu.php');\n\t\t}", "function print_header()\n{\n echo '<html><body>';\n}", "protected function setHeaders() {\n\t\tif(!self::$headerIncluded) {\n\n\t\t\tif($this->settings['includes']['jquery'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></script>');\n\n if($this->settings['includes']['mediaelement'])\n\t\t\t $this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelement-and-player.min.js\"></script>');\n\n\t\t\tif($this->settings['includes']['jquery-resize'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/jquery.ba-resize.min.js\"></script>');\n\t\t\tif($this->settings['includes']['modernizr'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/modernizr-2.5.3.js\"></script>');\n\t\t\t\t\t\t\n\t\t\tif($this->settings['includes']['css'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/CSS/tx-vibeo.css\" />');\n\n if($this->settings['includes']['mediaelement-css'])\n\t\t\t $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelementplayer.css\" />');\n\n if($this->settings['includes']['mediaelement-skin-css'])\n $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/skin-gray.css\" />');\n\n\t\t\tself::$headerIncluded = true;\n\t\t}\n\t}", "function globalHeader($siteName, $css_array, $js_array, $body, $leftside, $rightside, $beforePage, $metaOthers, $headerMisc) {\n \n GLOBAL $XSY_SESS_ADMINLEVEL, $zToolsRoot, $website;\n $currentPage = $_SERVER['PHP_SELF'];\n \n// ------------------------------------- header ----------------------------------- //\n// echo(\"<!DOCTYPE html>\");\necho('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">'.\"\\n\");\necho('<html xmlns=\"http://www.w3.org/1999/xhtml\">'.\"\\n\");\necho(\"\n<!-- ========================= HEADER ============================== -->\n\n<head>\n <meta name='author' content='Xsylum' />\n <meta name='keywords' content='Xsylum' />\n <meta name='description' content='Xsylum website' />\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n <!--<meta charset='UTF-8' />-->\n$metaOthers\n <title>$siteName</title>\n$headerMisc\n\");\n\n\n// ---------------------------------------- CSS FILES ---------------------------------- //\n\n// jquery Lightbox css\necho(\" <link rel='stylesheet' type = 'text/css' title='Design' media='screen' href='\".$zToolsRoot.\"/Ztools/sql_manager.css' /> \\n\");\necho(\" <link rel='stylesheet' type = 'text/css' title='Design' media='screen' href='\".$zToolsRoot.\"/Ztools/libraries/jquery.fs.scroller.css' /> \\n\");\n \n// css files\nforeach($css_array as $key => $cssfile) {\necho(\" <link rel='stylesheet' type='text/css' title='Design' media='screen' href='$cssfile' />\\n\");\n}\n// if($_SESSION['UserLevel'] == $XSY_SESS_ADMINLEVEL){\n // echo(\" <link rel='stylesheet' type='text/css' title='Design' media='screen' href='\".$zToolsRoot.\"/Ztools/admin_page.css' />\\n\");\n// }\n \n \n// --------------------------------------- JS FILES ------------------------------------ //\n\n // Jquery updated on 21/08/2014\n echo(\" <script type='text/javascript' src='\".$zToolsRoot.\"/Ztools/libraries/jquery-1.11.1.min.js'> </script>\\n\");\n // echo(\" <script type='text/javascript' src='\".$zToolsRoot.\"/Ztools/libraries/jquery-1.10.2.min.js'> </script>\\n\");\n\n echo(\" <script type='text/javascript' src='\".$zToolsRoot.\"/Ztools/libraries/jquery-ui-1.10.3.custom.min.js'> </script>\\n\");\n\n // For custom scrolling\n echo(\" <script type='text/javascript' src='\".$zToolsRoot.\"/Ztools/libraries/jquery.fs.scroller.js'> </script>\\n\");\n\n // for table administration :)\n echo(\" <script type='text/javascript' src='\".$zToolsRoot.\"/Ztools/sql_manager.js'> </script>\\n\");\n\n // external js files\n foreach($js_array as $key => $jsfile) {\n echo(\" <script type='text/javascript' src='$jsfile'></script>\\n\");\n }\n // if($_SESSION['UserLevel'] == $XSY_SESS_ADMINLEVEL){\n // echo(\" <script type='text/javascript' src='\".$zToolsRoot.\"/Ztools/admin_page.js'> </script>\\n\");\n // }\n\n\n// ----------------------------------- GOOGLE ANALYTICS --------------------------------- //\n// for http://xsylum.fr only\necho(\" <script type='text/javascript'>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-16260825-4', 'auto');\n ga('send', 'pageview');\n\n</script>\n</head>\n\n<!-- ====================== BODY =================================== -->\n\n\");\n\n// ----------------------------------- BODY ------------------------------------------- //\n$body = ($body == \"\") ? \"<body>\" : \"<body $body>\";\necho(\"$body\\n\");\n\n\n\n// --------------------------- PRIORITY TO SQL FORMS ---------------------------------- //\necho(\" <div id='Xsy_Sql_Popup'>\n <div id='Xsy_Sql_Modal'>\n </div>\n </div>\\n\");\n\n\n// --------------------------------- LEFT SIDE ---------------------------------------- //\necho(\"\n <div id='Xsy_Glob_Left'>\n <div id='homepage'>\n <a href = '\".$website.\"'><img src = '\".$zToolsRoot.\"/Accueil/img/Accueil_ban.png' title = 'Main Home' alt = 'Main Home'/></a>\n </div>\n\");\n\nif ($_SESSION['UserAdmin']){\necho(\"\n <div Id='SiteAdmin'>\n <div class='AdminLink'> <a href='http://localhost/phpmyadmin/index.php'> PhpMyAdmin Local </a> </div>\n <div class='AdminLink'> <a href='https://pf3.free-h.org:8443/domains/databases/phpMyAdmin/index.php?pleskStartSession'> PhpMyAdmin Free-h </a> </div>\n <div class='AdminLink'> <a href='http://www.xsylum.fr:2082/cpsess3133118438/3rdparty/phpMyAdmin/index.php'> PhpMyAdmin Ex2 </a> </div>\n <div class='AdminLink'> <a href='https://pf3.free-h.org:8443/login_up.php3'> Admin Free-h</a> </div>\n <div class='AdminLink'> <a href='http://xsylum.fr:2082/'> Admin Ex2 </a> </div>\n </div>\n\");\n}\n\n // ---- LEFT ITEM\n foreach($leftside as $key => $leftItem){\n\n $extension = substr($leftItem, -4);\n if ($extension == \".php\" || $extension == \".htm\"){\n include($leftItem);\n }\n else{\n echo($leftItem);\n } \n }\n\necho(\" </div><!-- end class='left' -->\n\");\n \n// --------------------------------- RIGHT SIDE ---------------------------------------- //\necho(\" <div id='Xsy_Glob_Right'>\\n\");\n\n$langPanel = Xsy_Glob_LangPanel($siteName);\necho($langPanel);\nif($_SESSION['UserAdmin']) {echo(\" <p class='Xsy_Admin_CheckLanguage'> session language is \".$_SESSION['UserLang'].\" </p>\");}\n\n // ---- LOGIN \n include_once('session_login_form.php');\n \n // ---- RIGHT ITEM\n foreach($rightside as $key => $rightItem){\n $extension = substr($rightItem, -4);\n if ($extension == \".php\" || $extension == \".htm\"){\n include($root.$rightItem);\n }\n else{\n echo($rightItem);\n }\n }\n\n\necho(\" </div><!-- end class='right' --> \n$beforePage\n\n<!-- ============================= PAGE =============================== --> \n\n<div id='Xsy_Glob_Page'>\");\n}", "public function addScriptToHeader($context)\n\t\t{\n\t\t\tif(!empty(Symphony::Engine()->Author))\n\t\t\t{\n\t\t\t\tif(Symphony::Engine()->Author->isDeveloper())\n\t\t\t\t{\n\t\t\t\t\t$context['output'] = str_replace('</head>', '\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen,tv,projection\" href=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.css\" />\n\t\t\t\t\t\t<script type=\"text/javascript\" src=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.js\"></script>\n\t\t\t\t\t\t</head>', $context['output']);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "protected function htmlHead() {\n echo \"<!DOCTYPE html>\\n\";\n echo \"<html>\\n\";\n echo str_repeat(\"\\t\",1) . \"<head>\\n\";\n echo str_repeat(\"\\t\",2) . \"<title>Евиденција волонтера</title>\\n\";\n echo str_repeat(\"\\t\",2) . \"<meta charset=\\\"UTF-8\\\">\\n\";\n echo str_repeat(\"\\t\",2) . \"<link rel=\\\"stylesheet\\\" href=\\\"css/style.css\\\">\\n\";\n if( !is_null($this->cssfile) ) {\n echo str_repeat(\"\\t\",2) . \"<link rel=\\\"stylesheet\\\" href=\\\"css/{$this->cssfile}\\\">\\n\";\n }\n echo str_repeat(\"\\t\",1) . \"</head>\\n\";\n }", "public function hookHeader()\n {\n $this->context->controller->addJS($this->_path.'/views/js/owl.carousel.min.js');\n $this->context->controller->addCSS($this->_path.'/views/css/owl.carousel.min.css');\n\n $this->context->controller->addJS($this->_path.'/views/js/mf.custom.js');\n $this->context->controller->addCSS($this->_path.'/views/css/mf.theme.default.css');\n\n }", "public function wordpress_default_header(){\n\t\tif(is_home() && $this->_template_builder->get_specific_option('carousel_global')){\r\n\t\t\tif(!$this->_template_builder->get_specific_option('jumbotron')){\r\n\t\t\t\t$this->_build_header();\r\n\t\t\t}else{\r\n\t\t\t\t$this->_template_builder->render_view('jumbotron');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($this->_template_builder->get_specific_option('socialbar')){\r\n\t\t\t\t$this->_template_builder->render_view('socialbar');\t\r\n\t\t\t}\r\n\t\t}\n\t}", "public function hookHeader()\n {\n $this->context->controller->addCSS($this->_path.'/views/css/front.css');\n }" ]
[ "0.79905194", "0.7795883", "0.75689375", "0.7565234", "0.75190717", "0.7513202", "0.74508893", "0.74261117", "0.74253476", "0.73423725", "0.73238593", "0.71939546", "0.71516037", "0.7126483", "0.70870703", "0.7084342", "0.700917", "0.70050484", "0.70017695", "0.69795233", "0.6973331", "0.6930482", "0.6890315", "0.6882799", "0.68572253", "0.6848937", "0.6847235", "0.68337137", "0.6830056", "0.6809006", "0.6805757", "0.67877567", "0.67714477", "0.67549396", "0.6743553", "0.6742792", "0.670933", "0.6704231", "0.66983336", "0.6685766", "0.6684168", "0.6681849", "0.66742754", "0.66713774", "0.6666155", "0.666373", "0.66343945", "0.662824", "0.66262054", "0.6606104", "0.6599692", "0.65773684", "0.65580916", "0.6556983", "0.65534747", "0.6552561", "0.6547445", "0.6533261", "0.65292084", "0.6513498", "0.6510003", "0.6459483", "0.6456086", "0.6454439", "0.64310634", "0.6402934", "0.6395171", "0.63934076", "0.6389642", "0.6383985", "0.6383971", "0.6383659", "0.6380497", "0.63740665", "0.6373882", "0.6373052", "0.63498735", "0.6343981", "0.63400346", "0.6338394", "0.6332046", "0.6304936", "0.62982786", "0.628592", "0.6285231", "0.6270608", "0.62607193", "0.62577176", "0.6256906", "0.6256718", "0.6253394", "0.62447864", "0.6242864", "0.6238922", "0.6237363", "0.6233822", "0.6229433", "0.62284374", "0.62167954", "0.62136585", "0.6198787" ]
0.0
-1
///////////////////// Function name: db_to_arr Description: take a column from table "intro" (specific to this implemntation), and create from it a string of comma seperated values. The values are the fields in the column. This is used to make an array in javasScript. Paramerters: column name Return value: none /////////////////////
function db_to_arr($column_name) { $i = 0; //count lines $db_handle = mysql_query("SELECT {$column_name} FROM intro "); while($row = mysql_fetch_array($db_handle)) { if($row[$column_name] && $row[$column_name] != "0000") //if not null, 0000 is default for year { if(strrpos($row[$column_name], ",")) //if field is seperated by commas { $data_csv = explode("," , $row[$column_name]); for($s = 0; $s < sizeof($data_csv)-1; $s++) { echo "\"" . addslashes(trim($data_csv[$s])) . "\", "; } echo "\"" . addslashes(trim($data_csv[$s])) . "\""; } else { echo "\"" . addslashes(trim($row[$column_name])) . "\""; } $i++; if($i < mysql_num_rows($db_handle)) //if not last field { echo ","; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToArray()\n {\n $row = [];\n foreach (array_keys($this->columns) as $column) {\n $row[$column] = trim($this->getColumnValue($column));\n }\n return $row;\n }", "function db_tableby_to_sqladd($arr){\t\n\tif ( is_array( $arr ) ) {\n\t\t$s='';\n\t\tforeach ( $arr as $k => $v ) {\n\t\t\t$s.=DB_PRE.$k.' as '.$v.',';\n\t\t}\n\t\treturn $s;\n\t}elseif(strpos( $arr,',' )>0) \t{\n\t\treturn DB_PRE.str_replace(',',','.DB_PRE,$arr);\t\t\n\t}else {\n\t\tif (strpos( $arr,DB_PRE )>0){\n\t\t\treturn $arr;\n\t\t}else{\n\t\t\treturn DB_PRE.$arr;\n\t\t}\t\t\n\t}\n}", "function fromDbToArray($conn, $stmSql, $stmArgs) {\r\n $tempArray = array();\r\n \r\n for($argsIndex = 0; $argsIndex < count($stmArgs); $argsIndex++) {\r\n $stmSql = preg_replace('/:var/', $stmArgs[$argsIndex], $stmSql, 1);\r\n }\r\n \r\n try {\r\n $stm = $conn -> prepare($stmSql);\r\n $stm->execute();\r\n } catch(PDOException $e) {\r\n echo(\"Failed to Query: \" . $e -> getMessage());\r\n die($e -> getMessage());\r\n }\r\n \r\n while($row = $stm -> fetch()) {\r\n $tempArray[$row[1]] = intval($row[0]);\r\n }\r\n \r\n return $tempArray;\r\n }", "function convert_array($in_array, $start_pos)\n{\n\t$string1 = \"\";\n\t$string2 = \"\";\n\t$total = count($in_array);\n\twhile ($start_pos < $total)\n\t{\n\t\t$string1 = $string1 . \"`\" . $in_array[$start_pos] . \"`\";\n\t\t$start_pos++;\n\t\t$string2 = $string2 . \"\\\"\" . $in_array[$start_pos] . \"\\\"\";\n\t\t$start_pos++;\n\t\tif ($start_pos < $total)\n\t\t{\n\t\t\t$string1 = $string1 . \", \";\n\t\t\t$string2 = $string2 . \", \";\n\t\t}\n\t}\n\tif ($start_pos == 2)\n\t{\t$return_string = \"(clanid, \" . $string1 . \") values (0, \" . $string2 . \")\";\t}\n\telse\n\t{\t$return_string = \"(\" . $string1 . \") values (\" . $string2 . \")\";\t}\n\treturn $return_string;\n}", "function sqlToArray($sqlResult){\n $arr = [];\n while ($line = mysqli_fetch_array($sqlResult)) {\n $arr [] = $line[0];\n }\n return $arr;\n}", "function dbgetarray() {\n\t$output = array();\n\t\n\t$args = func_get_args();\n\t$result = call_user_func_array('dbquery', $args);\n\t$query = array_shift($args);\n\n\t// this only applies to SELECT queries!\n\tif (preg_match('/^SELECT/i', $query)) {\n\t\twhile ($result && $row = dbfetch($result, DB_NUM)) {\n\t\t\tif (count($row) == 1) { // use integer keys\n\t\t\t\t$output[] = $row[0];\n\t\t\t} else if (count($row) == 2) { // use first column keys\n\t\t\t\t$output[$row[0]] = $row[1];\n\t\t\t} else { // use integer keys and array values\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t}\n\t\tdbfree($result);\n\t} else {\n\t\tEWarning(EC_REALS_DATABASE, \"dbgetarray called with non-SELECT query!\", \"Non-select query\");\n\t}\n\n\treturn $output;\n}", "function db_array_to_insert_sqladd( $arr ) {\n\t$s = '';\n\tif ( DB_TYPE == 'access' )$arr = toutf( $arr );\n\t$keys = array();\n\t$values = array();\n\tforeach ( $arr as $k => $v ) {\n\t\t$k = ( $k );\n\t\t$v = ( $v );\n\t\t$keys[] = '`' . $k . '`';\n is_array( $v ) || is_object( $v ) and $v=tojson($v);\n\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t$values[] = $v;\n\t}\n\t$keystr = implode( ',', $keys );\n\t$valstr = implode( ',', $values );\n\t$sqladd = \"($keystr) VALUES ($valstr)\";\n\treturn $sqladd;\n}", "public static function toArray() {\n $str = \"\n SELECT id, firstName, lastName, email, password\n FROM indPrj_persons\";\n \n // Obtain an array of persons records.\n $records = Database::query($str);\n \n // Push each row into a new array to be outputted.\n $x = 0;\n $output = array();\n while($row = mysql_fetch_array($records)){\n $output[$x]['id'] = $row['id'];\n $output[$x]['firstName'] = $row['firstName'];\n $output[$x]['lastName'] = $row['lastName'];\n $output[$x]['email'] = $row['email'];\n $output[$x]['password'] = $row['password'];\n $x++;\n }\n \n return $output;\n }", "function string_to_array($array)\n{\n $arr = explode(',', $array);\n foreach($arr as $item)\n $result[$item] = $item;\n\n return $result;\n}", "function db_result_to_array($result){\n\t\t\t\t\t\t\t$res_array = array();\n\n\t\t\t\t\t\t\tfor($count=0; $row= @mysql_fetch_array($result); $count++)\n\t\t\t\t\t\t\t\t$res_array[$count] = $row;\n\t\t\t\t\t\t\treturn $res_array;\n\t\t\t\t\t\t}", "abstract public function to_array();", "function get($table,$col){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT * FROM $table\";\n foreach ($conn->query($query)as $row){\n array_push($array,$row[$col]);\n }\n return $array;\n }", "function array_to_sql($table, $rows){\n $sql = \"INSERT INTO `$table` (\" . implode_padded(array_keys(current($rows))) . \") VALUES \\n\";\n $count = count($rows) - 1;\n $i = 0;\n foreach ($rows as $row) {\n $sql .= '(' . implode_padded($row, ',', \"'\") . ')';\n if ($i != $count) $sql .= \",\";\n $sql .= \"\\n\";\n ++$i;\n }\n $sql .= \";\\n\\n\";\n\n return $sql;\n}", "function generate2dArrayFromDB($tableName, $columnNames, $where) {\n\n //creates a connection with the Database\n $conn = connect();\n\n //Generates SELECT sql part\n $commaSeperatedcolumnNames = $columnNames[0];\n for ($i=1; $i<count($columnNames); $i++) {\n $commaSeperatedcolumnNames .= \", \" . $columnNames[$i];\n }\n\n //combines SELECT $tableName and WHERE parts to form sql query\n $sql = \"SELECT $commaSeperatedcolumnNames\n FROM $tableName\n $where\";\n\n //saves query results\n $result = $conn->query($sql);\n //if there are result continue\n if ($result !== FALSE) {\n if ($result->num_rows > 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n } else {\n return 'Fout in programmatuur';\n }\n $conn->close();\n}", "function implode_column_quoted($glue, $column, $arr, $quote =\"'\") {\n $values = array();\n foreach ($arr as $row) {\n $value = lavnn($column, $row, '');\n if ($value != '')\n $values[] = $value;\n }\n return $quote . implode($quote . $glue . $quote, $values) . $quote;\n}", "function sql_new_fetch_into_array($query) {\n\treturn sql_fetch_column($query);\n}", "function db_array_to_update_sqladd( $arr ) {\n\t$s = '';\n\tif ( DB_TYPE == 'access' ) $arr = toutf( $arr );\n\tif ( is_array( $arr ) ) {\n\t\tforeach ( $arr as $k => $v ) {\n\t\t\t$v = ( $v );\n\t\t\t$op = substr( $k, -1 );\n\t\t\tif ( $op == '+' || $op == '-' ) {\n\t\t\t\t$k = substr( $k, 0, -1 );\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$k$op$v,\";\n\t\t\t} else {\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$v,\";\n\t\t\t}\n\t\t}\n\t\treturn substr( $s, 0, -1 );\n\t} else {\n\t\treturn $arr;\n\t}\n}", "function data_from_ASSOC() {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t// SQL - REQ -------------------------------------------\n\t$stmt = $dbh->query('SELECT ID, SAMPLE_ID, ARTIST_ID FROM SAMPLES_ARTISTS');\n\n\t// ENREGISTREMENT DES DONNÉES DANS UN ARRAY\n\t$assoc = [];\n\twhile ($data = $stmt->fetch()) {\n\t\tarray_push($assoc, ['ID' => $data['ID'], 'SAMPLE_ID' => $data['SAMPLE_ID'], 'ARTIST_ID' => $data['ARTIST_ID']]);\n\t}\n\n\treturn $assoc;\n}", "abstract public function getRowAsArray();", "function implode_column($glue, $column, $arr) {\n $values = array();\n foreach ($arr as $row) {\n $value = lavnn($column, $row, '');\n if ($value != '')\n $values[] = $value;\n }\n return implode($glue, $values);\n}", "function array_to_sqladd($arr) {\n\t$s = '';\n\tforeach($arr as $k=>$v) {\n\t\t$v = addslashes($v);\n\t\t$op = substr($k, -1);\n\t\tif($op == '+' || $op == '-') {\n\t\t\t$k = substr($k, 0, -1);\n\t\t\t$s .= \"`$k`=`$k`$op'$v',\";\n\t\t} else {\n\t\t\t$s .= \"`$k`='$v',\";\n\t\t}\n\t}\n\treturn substr($s, 0, -1);\n}", "function get_ArregloAlumnos(){\n\t\t$query_2 = $this->db->query('SELECT rut, id_clase FROM datos_alumnos');\n\t\t\n\t\tif ($query_2->num_rows() > 0){\n\t\t\t//se guarda los datos en arreglo bidimensional\n\t\t\tforeach($query_2->result() as $row)\n\t\t\t$arrDatos_2[htmlspecialchars($row->rut, ENT_QUOTES)]=htmlspecialchars($row->rut,ENT_QUOTES);\n\t\t\t$query_2->free_result();\n\t\t\treturn $arrDatos_2;\n\t\t}\t\n\t\t\n\t}", "public function toArray($renameColumns=null){ }", "public static function toArray($values)\n {\n $values = preg_replace('#[^0-9]*#i', '', $values);\n\n // Create the rows\n $values = str_split($values, 9);\n\n // Create the columns\n foreach ($values as &$row) {\n $row = str_split($row);\n }\n\n return $values;\n }", "function arrayToSQLString ($arr) {\r\n $sql = \"\";\r\n foreach ($arr as $key => $value) {\r\n $sql = $sql . $value . ',';\r\n }\r\n $sql = rtrim($sql,',');\r\n return $sql;\r\n}", "function mysql06($campo,$tabla){\n $query1=\"SELECT \".$campo.\" FROM \".$tabla;\n $query2=mysql_query($query1);\n $i = 0;\n while( $rec = mysql_fetch_row($query2) ){\n $array[$i] = $rec[0];\n $i++;\n }\n return $array;\n}", "public function toArray() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = array();\n\t\t\t\n\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t$result[$column->name] = $this->_data[$column->name];\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('There was a problem converting the Record to an array.');\n\t\t}\n\t}", "function arrayIntoString_sql(array $arr)\n {\n $str = \"\";\n foreach ($arr as $k => $v) {\n $str .= (count($arr) - 1 != $k)\n ? \"'\". $v . \"', \"\n : \"'\". $v . \"'\";\n }\n return $str;\n }", "function db2value($rec)\n {\n $languages = $this->getLanguages();\n if($this->isMlNode())\n {\n if(is_array($rec[$this->fieldName()]))\n {\n foreach($rec[$this->fieldName()] as $lng=>$value)\n {\n $result[$lng]=stripslashes($value);\n }\n } else $result = stripslashes($rec[$this->fieldName()]);\n }\n else\n {\n for ($i=0,$_i=count($languages);$i<$_i;$i++)\n {\n $result[$languages[$i]] = stripslashes($rec[$this->fieldName().'_'.$languages[$i]]);\n }\n }\n return $result;\n }", "function csv_to_array($csv, $delimiter = ',', $enclosure = '\"', $escape = '\\\\', $terminator = \"\\n\") { \r\n $r = array(); \r\n $rows = explode($terminator,trim($csv)); \r\n $names = array_shift($rows); \r\n $names = str_getcsv($names,$delimiter,$enclosure,$escape); \r\n $nc = count($names); \r\n foreach ($rows as $row) { \r\n if (trim($row)) { \r\n $values = str_getcsv($row,$delimiter,$enclosure,$escape); \r\n if (!$values) $values = array_fill(0,$nc,null); \r\n $r[] = array_combine($names,$values); \r\n } \r\n } \r\n return $r; \r\n}", "function ConvertirArray($result){\n\t\t \t$arreglo = array(); \n\t\t \tforeach ($result as $row){\n\t\t\t\t$arreglo[] = $row;\n\t\t \t}\n\t\t \treturn $arreglo;\n\t\t}", "function db_result_to_array($result) {\n $res_array = array();\n\n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n\n return $res_array;\n}", "public function toArray($columns=null) {}", "function vcex_string_to_array( $value = array() ) {\n\n\tif ( empty( $value ) && is_array( $value ) ) {\n\t\treturn null;\n\t}\n\n\tif ( ! empty( $value ) && is_array( $value ) ) {\n\t\treturn $value;\n\t}\n\n\t$items = preg_split( '/\\,[\\s]*/', $value );\n\n\tforeach ( $items as $item ) {\n\t\tif ( strlen( $item ) > 0 ) {\n\t\t\t$array[] = $item;\n\t\t}\n\t}\n\n\treturn $array;\n\n}", "function insertArray($data) {\n\t\t$ar = array();\n\t\t$str = '';\n\t\t$str1 = '';\n\t\tforeach($data as $key=>$value)\n\t\t{\n\t\t\tif(empty($str))\n\t\t\t{\n\t\t\t\t$str1 = $key;\n\t\t\t\t$str = '\"'.strip_tags(trim($value)).'\"';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$str1 = ','.$key;\n\t\t\t\t$str .=' ,\"'.strip_tags(trim($value)).'\"';\n\t\t\t}\n\t\t}\n\t\t$ar['fields'] = $str1;\n\t\t$ar['values'] = $str;\n\t\treturn $ar;\n\t}", "function db_result_to_array($result) {\r\n $res_array = array();\r\n\r\n for ($count = 0; $row = $result->fetch_assoc(); $count++) {\r\n $res_array[$count] = $row;\r\n }\r\n return $res_array;\r\n }", "function toArray() ;", "function toArray() ;", "final protected function getSqlRow() {\n\t\t$myArray = array ();\n\t\tforeach ( $this as $key => $value ) {\n\t\t\t$value = addslashes ( $value );\n\t\t\t$myArray [\"$key\"] = \"$value\";\n\t\t}\n\t\treturn $myArray;\n\t}", "function resultToArray($result,$fields,$encoding='')\r\n\t{\r\n\t\t$result_array = array();\r\n\t\twhile ($one_row=mysql_fetch_assoc($result))\r\n\t\t\t\t$result_array[]=$one_row;\r\n\t\treturn $result_array;\r\n\t}", "function db_result_to_array($result) {\n $res_array = array();\n \n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n \n return $res_array;\n }", "function getJoin($table,$col,$join){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT $table.$col FROM $join\";\n foreach ($conn->query($query)as $row){\n array_push($array,$row[$col]);\n }\n return $array;\n }", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "function obtenerArray(){\r\n\t\treturn mysql_fetch_array( $this->rs() );\r\n\t}", "function resultSet2array($myrst) {\n $resultset = null;\n $row = 0;\n while ($myrow = mysql_fetch_array($myrst)) {\n $col = 0;\n foreach ($myrow as $column) {\n $resultset[$row][$col]=$myrow[$col++];\n }\n $row++;\n }\n return $resultset;\n}", "function db_get_data2($str){ \n $rows=array();\n $result=$this->con->query($str);\n //only returns the associate array not MYSQLI_NUM type\n $rows = mysqli_fetch_all($result,MYSQLI_ASSOC);\n // print_r($rows);\n return $rows;\n }", "public function toColumn(): array\n {\n return $this->pdoStatement->fetchAll(\\PDO::FETCH_COLUMN, 0);\n }", "function toArray();", "function makearray($mstrg) {\n\t\t// check if values are separated by comma ','.\n\t if ($this->havecomma($mstrg)) {\n\t \t$marr = explode(\",,\", $mstrg);\n\t }\n\t\treturn $marr;\n\t}", "function bi_column($con, $query, &$arr_data){\r\n\r\n\t$arr_data = array();\r\n\r\n\t$res = $con->query($query);\r\n\t$arr = $res->fetchAll(2);\r\n\r\n\tif(FALSE && count($arr) > 0){\r\n\t\t$a = $arr[0][\"a\"];\r\n\t\t// Verifica se \"a\" esta no formato: \"99 - 99\" (hora em hora)\r\n\t\tif(substr($a, -1) == \"h\" && !is_null(value_numeric(substr($a, 0, (strlen($a) - 1))))){\r\n\t\t\t// Preenche os valores restantes, para ir de 00 ate 23\r\n\t\t\tfor($i = 0; $i <= 23; $i++){\r\n\t\t\t\t$achou = false;\r\n\t\t\t\tforeach($arr as $row){\r\n\t\t\t\t\tif($i == (float) substr($row[\"a\"], 0, (strlen($row[\"a\"]) - 1))){\r\n\t\t\t\t\t\t$achou = TRUE;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!$achou){\r\n\t\t\t\t\t$arr[] = array(\r\n\t\t\t\t\t\t\"a\" => str_pad($i, 2, \"0\", STR_PAD_LEFT).\"h\",\r\n\t\t\t\t\t\t\"y\" => 0\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Reordena o array\r\n\t\t\t$arr_aux = array();\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$arr_aux[$row[\"a\"]] = $row;\r\n\t\t\t}\r\n\t\t\tksort($arr_aux);\r\n\t\t\t$arr = array();\r\n\t\t\tforeach($arr_aux as $row){\r\n\t\t\t\t$arr[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tforeach($arr as $row){\r\n\t\t$arr_data[] = array(\r\n\t\t\t\"label\" => $row[\"a\"],\r\n\t\t\t\"value\" => $row[\"y\"]\r\n\t\t);\r\n\t}\r\n}", "private function sqlResToArray($res) { //appends sql query result to php array\n\t\t$phpArray = array();\n\t\t$res->data_seek(0);\n while ($row = $res->fetch_assoc()) {\n $phpArray[] = $row;\n }\n\t\treturn $phpArray;\n\t}", "function allNoteAlumns(){\n $array_notes = [];\n $mysqli = new mysqli\n ( \"localhost\" , \"root\" , \"adminuser\" , \"ESCOLA_DB\");\n if ($mysqli -> connect_errno) {\n echo \"problema al connectar MySQL: \" . $mysqli -> connect_error;\n }\n $resultat = $mysqli -> query(\"SELECT NOTA from NOTA\" );\n while($fila=$resultat->fetch_assoc()){\n array_push($array_notes, $fila[\"NOTA\"]);\n }\n declaraGlobals($array_notes);\n\n}", "function db_fetch_array($db_query) {\n return mysql_fetch_array($db_query, MYSQL_ASSOC);\n }", "function sql2arr2($results){\n while ($row = $results->fetchArray(SQLITE3_ASSOC)) {\n $arrayResult[]=$row;\n }\n if ($arrayResult) {\n return $arrayResult;\n } else {\n return false;\n }\n}", "function toIdArray($inArray,$idField,$valueField){\n\n if(isset($inArray)) {\n foreach ($inArray as $row) {\n $outArray[$row->$idField]=$row->$valueField;\n //print_r($row->hotel_Id);\n }\n }\n return $outArray;\n }", "function insertArr($tableName, $insData, $mylink)\n {\n\t$columns = implode(\", \",array_keys($insData));\n\n array_walk(array_values($insData), function(&$string) use ($mylink) { \n $string = mysqli_real_escape_string($mylink, $string);\n });\n\t$escaped_values = array_values($insData);\n\n\tforeach ($escaped_values as $idx=>$data) $escaped_values[$idx] = '\"'.$data.'\"';\n\t$values = implode(\", \", $escaped_values);\n\treturn $query = \"INSERT INTO $tableName ($columns) VALUES ($values)\";\n }", "function getCamposToQuery($nombre_tabla, $key_value, $as_tabla=\"\"/*, ...*/){\r\n $cadena=\"\";\r\n global $$nombre_tabla;//si o si para que el array se pueda usar en esta funcion\r\n if($key_value=='key'){\r\n foreach ($$nombre_tabla as $key => $value) { $cadena.=$as_tabla.$key.\",\"; }\r\n }\r\n if($key_value=='value'){\r\n foreach ($$nombre_tabla as $key => $value) { $cadena.=$as_tabla.$value.\",\"; }\r\n }\r\n $cadena=trim($cadena,\",\");\r\n return $cadena;\r\n}", "function getArraySQL($sql){\n //Creamos la conexión\n $conexion = $this->conectarBD();\n //generamos la consulta\n if(!$result = mysqli_query($conexion, $sql)) die();\n\n $rawdata = array();\n //guardamos en un array multidimensional todos los datos de la consulta\n $i=0;\n while($row = mysqli_fetch_array($result))\n {\n //guardamos en rawdata todos los vectores/filas que nos devuelve la consulta\n $rawdata[$i] = $row;\n $i++;\n }\n //Cerramos la base de datos\n $this->desconectarBD($conexion);\n //devolvemos rawdata\n return $rawdata;\n }", "abstract public function data2Array($data);", "function obtener_registros($tabla, $campo, $id = false)\n {\n $conexion_bd = conectar_bd();\n $array = \"\";\n $consulta = 'SELECT '.$campo.' FROM '.$tabla;\n if($id){\n $consulta .= ' ORDER BY '.$campo;\n }\n $resultados = $conexion_bd->query($consulta);\n while ($row = mysqli_fetch_array($resultados, MYSQLI_BOTH)){\n $array .= $row[\"$campo\"].\",\";\n }\n mysqli_free_result($resultados);\n desconectar_bd($conexion_bd);\n $array = explode(\",\", $array);\n return $array;\n }", "function createQuery($arr) {\n $printArray = \"\";\n for ($i = 0; $i < sizeof($arr); $i++) {\n if ($i == sizeof($arr) - 1) $printArray = $printArray .'\\'' . $arr[$i] . '\\'';\n else $printArray = $printArray . '\\'' . $arr[$i] . '\\'' . \", \";\n } \n return $printArray;\n}", "abstract protected function columns(): array;", "function fetchQueryToArray($sql, $link = 0) {\n $this->link = $link ? $link : $this->link;\n $q = $this->query($sql, $this->link);\n $array = array();\n while ($row = $this->fetchArray($q)) $array[] = $row;\n $this->freeResult($q);\n return $array;\n }", "function csv_to_array($input, $delimiter=',') { \n $header = null; \n $data = array(); \n $csvData = str_getcsv($input, \"\\n\"); \n \n foreach($csvData as $csvLine){ \n if(is_null($header)) $header = explode($delimiter, $csvLine); \n else{ \n \n $items = explode($delimiter, $csvLine); \n \n for($n = 0, $m = count($header); $n < $m; $n++){ \n $prepareData[$header[$n]] = $items[$n]; \n } \n \n $data[] = $prepareData; \n } \n } \n \n return $data; \n}", "function csv_to_array($input, $delimiter=',') { \n $header = null; \n $data = array(); \n $csvData = str_getcsv($input, \"\\n\"); \n \n foreach($csvData as $csvLine){ \n if(is_null($header)) $header = explode($delimiter, $csvLine); \n else{ \n \n $items = explode($delimiter, $csvLine); \n \n for($n = 0, $m = count($header); $n < $m; $n++){ \n $prepareData[$header[$n]] = $items[$n]; \n } \n \n $data[] = $prepareData; \n } \n } \n \n return $data; \n}", "public function toArray($keyColumn, $valueColumn)\n\t{\n\t\t// Execute query and call the 'toArray' function on the ResultSet\n\t\t$result = $this->execute();\n\t\treturn ($result !== false) ? $result->toArray($keyColumn, $valueColumn) : array();\n\t}", "function csvToArray($file, $delimiter) { \n if (($handle = fopen($file, 'r')) !== FALSE) { \n $i = 0; \n while (($lineArray = fgetcsv($handle, 4000, $delimiter, '\"')) !== FALSE) { \n for ($j = 0; $j < count($lineArray); $j++) { \n $arr[$i][$j] = $lineArray[$j]; \n } \n $i++; \n } \n fclose($handle); \n } \n return $arr; \n}", "function toPostgresArray($set) {\n settype($set, 'array'); // can be called with a scalar or array\n $result = array();\n foreach ($set as $t) {\n if (is_array($t)) {\n $result[] = toPostgresArray($t);\n } else {\n $t = str_replace('\"', '\\\\\"', $t); // escape double quote\n if (! is_numeric($t)) // quote only non-numeric values\n $t = '\"' . $t . '\"';\n $result[] = $t;\n }\n }\n return '{' . implode(\",\", $result) . '}'; // format\n }", "function convertToArray( $result ){\n $resultArray = array();\n\n for( $count=0; $row = $result->fetch_assoc(); $count++ ) {\n $resultArray[$count] = $row;\n }\n\n return $resultArray;\n }", "private function toSqlCols($cols)\r\n\t{\r\n\t\tif (is_array($cols)) {\r\n\t\t\t$c = array();\r\n\t\t\tforeach ($cols as $col)\r\n\t\t\t\t$c[] = \"[$col]\";\r\n\t\t\t$cols = implode(', ', $c);\r\n\t\t}\r\n\r\n\t\treturn $cols;\r\n\t}", "function get_datas(){\r\n//\t$sql = \"select * from partition_invoice\";\r\n//\t$rlts=pg_query($sql);\r\n\t$array = array();\r\n//\twhile ($line=pg_fetch_array($rlts,null,PGSQL_ASSOC)){\r\n//\t\t$array[] = $line;\r\n//\t}\r\n//\tpg_free_result($rlts);\r\n\treturn $array;\r\n}", "function mc_csv_to_array( $csv, $delimiter = ',', $enclosure = '\"', $escape = '\\\\', $terminator = \"\\n\" ) {\n\t$r = array();\n\t$rows = explode( $terminator, trim( $csv ) );\n\tforeach ( $rows as $row ) {\n\t\tif ( trim( $row ) ) {\n\t\t\t$values = explode( $delimiter, $row );\n\t\t\t$r[ $values[0] ] = ( isset( $values[1] ) ) ? str_replace( array( $enclosure, $escape ), '', $values[1] ) : $values[0];\n\t\t}\n\t}\n\n\treturn $r;\n}", "public function toArray(\\Nette\\Database\\Table\\Selection $source,$fields=\"\"){\n if($fields!=\"\"){\n $source->select($fields); \n }\n else{\n $source->select(\"*\"); \n }\n return array_map('iterator_to_array', $source->fetchAll());\n }", "function db_fetch_array($db_query) {\n\treturn mysql_fetch_array($db_query, MYSQL_ASSOC);\n}", "function select_convert($arr) {\n\t$result = array();\n\tforeach($arr as $k => $v) {\n\t\t$result[] = array(\"fid\" => $k, \"fcaption\" => $v);\n\t}\n\treturn $result;\n}", "function sqlingData(array $data)\n{\n\n $keys = \"(\" . implode(\",\", array_keys($data)) . \")\";\n $values = \"('\" . implode(\"','\", array_values($data)) . \"')\";\n\n return $keys . 'Values' . $values;\n}", "function db2data($data=null)\n\t{\n\t\tif (($intern = !is_array($data)))\n\t\t{\n\t\t\t$data =& $this->data;\n\t\t}\n\t\t// explode comma-separated grants and scopes\n\t\tforeach(['client_grants', 'client_scopes'] as $name)\n\t\t{\n\t\t\tif (isset($data[$name]))\n\t\t\t{\n\t\t\t\t$data[$name] = explode(',', $data[$name]);\n\t\t\t}\n\t\t}\n\t\treturn parent::db2data($intern ? null : $data);\t// important to use null, if $intern!\n\t}", "public function AsArray();", "function DBfetchArray($cursor) {\n\t$result = array();\n\twhile ($row = DBfetch($cursor)) {\n\t\t$result[] = $row;\n\t}\n\treturn $result;\n}", "function sqlArray ($query)\r\n {\r\n $result = mysql_query($query);\r\n $array = mysql_fetch_array($result);\r\n return $array;\r\n }", "public function get_column_array($a_id)\n\t{\n\t\t$this->column_array=array('*');\n\t\t//initialise column array\n\n\t\t/*--------------- open the file by -------------*/\n\t\t$ass_query=mysqli_query($this->con, \"SELECT * FROM Assessments WHERE ass_id=$a_id\");\n\t\t//fetch assessment data by id\n\t\t$ass_row = mysqli_fetch_array($ass_query);\n\t\t//push results into an array\n\t\t$this->txt_file = $ass_row['ass_filepath'];\n\t\t//fetch file path\n\t\t$file=fopen($this->txt_file, \"r\") or die(\"Unable to open file!\"); \n\t\t//open txt file - read only - file must exist / print error message if unable to open\n\t\t\n\t\tif ($file!=NULL)\n\t\t{\n\t\t\t/*---------------Prepare variables for data read -------------*/\n\t\n\t\t\t$field=\"question\";\n\t\t\t//type of value contained in the field\n\t\t\t$question=\"\";\n\t\t\t//form question\n\t\t\t$input=\"\";\n\t\t\t//form input type\n\n\t\t\t/*---------------Read data from file -------------*/\n\t\t\twhile (!feof($file)) \n\t\t\t{\n\t\t\t\t$line = fgets($file);\n\t\t\t\t//read a line of text\n\t\t\t\t$row_item = strtok($line, \"^\");\n\t\t\t\t//tokenise first item in line of text\n\n\n\t\t\t\twhile ($row_item !== false) \n\t\t\t\t{\n\t\t\t\t //assign row_item to correct variable\n\t\t\t\t if($field==\"question\")\n\t\t\t\t {\n\t\t\t\t \t$question=$row_item;\n\t\t\t\t \t//get question\n\t\t\t\t \t$field=\"input\";\n\t\t\t\t \t//toggle field value\n\t\t\t\t }\n\t\t\t\t else if ($field==\"input\")\n\t\t\t\t {\n\t\t\t\t \t$input=$row_item;\n\t\t\t\t \t//get input type\n\t\t\t\t \t$input=$input[0].$input[1]; //*******\n\t\t\t\t \t//extract first two characters\n\t\t\t\t \tarray_push($this->column_array, $input);\n\t\t\t\t \t//push input type into column array (for later use)\n\t\t\t\t \t$field=\"question\";\n\t\t\t\t \t//toggle field value\n\t\t\t\t }\n\t\t\t\t $row_item = strtok(\"^\");\n\t\t\t\t //get next token\n\n\t\t\t\t}//END inner WHILE\n\n\t\t\t}//END outer WHILE\n\t\t\t/*----------------------------*/\n\t\t\treturn $this->column_array; //note: number of questions = length of array-1\n\t\t\t//return html string\n\t\t}\n\t}", "function getvalMultiple($con,$table,$field,$where,$space)\n{\n\tif($where != \"\")\n\t $sql = \"select $field from $table where $where\";\n\telse\n\t $sql = \"select $field from $table\";\n\t \n\t//echo $sql;\n\t$getvalue = mysqli_query($con,$sql);\n\t$getval=\"\";\n\twhile($row = mysqli_fetch_row($getvalue))\n\t{\n\t\tif($getval == \"\")\n\t\t$getval = $row[0];\n\t\telse\n\t\t{\n\t\t\tif($space==true)\n\t\t\t$getval .= \", \". $row[0];\n\t\t\telse\n\t\t\t$getval .= \",\". $row[0];\n\t\t}\n\t}\n\treturn $getval;\n}", "public function getArrayValues($sql,$params = null){\n $result = $this->getResult($sql,$params);\n $arr = [];\n while ($row = $result->fetch_row()) {\n $arr[] = $row[0];\n }\n\n $result->close();\n\n return $arr;\n }", "function convertArrayIntoString($array) {\n foreach ($array as $value)\n $string .= \"'$value,'\";\n $string = trim($string, ',');\n return $string;\n}", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();" ]
[ "0.61560994", "0.61430556", "0.608588", "0.6003343", "0.59100807", "0.57980317", "0.57403976", "0.5653186", "0.56228435", "0.5618131", "0.55655426", "0.55507976", "0.55346394", "0.5534168", "0.5511066", "0.5497335", "0.54643434", "0.5436971", "0.5373393", "0.536549", "0.5363739", "0.53548396", "0.5346593", "0.5337114", "0.53370607", "0.53339446", "0.533358", "0.5324092", "0.5320655", "0.53116703", "0.53112954", "0.52959514", "0.5292422", "0.5291008", "0.52838737", "0.5283183", "0.52816844", "0.52816844", "0.5280192", "0.5279493", "0.5273753", "0.5266146", "0.5251303", "0.5251303", "0.5251303", "0.5251303", "0.5251303", "0.5251303", "0.52336913", "0.52334625", "0.52313393", "0.5228487", "0.5226537", "0.5214163", "0.52042353", "0.5199521", "0.5192021", "0.51892734", "0.51847893", "0.5180173", "0.5176049", "0.5173201", "0.51697105", "0.51500064", "0.5147754", "0.5142455", "0.5131649", "0.51314855", "0.51252735", "0.51252735", "0.51179403", "0.5116403", "0.511553", "0.5108637", "0.51014847", "0.50988245", "0.50880903", "0.5077685", "0.50770175", "0.50762564", "0.5067914", "0.50663334", "0.5061422", "0.50557464", "0.5055629", "0.50534666", "0.5047911", "0.5045509", "0.5038317", "0.5034435", "0.5034435", "0.5034435", "0.5034435", "0.5034435", "0.5034435", "0.5034435", "0.5034435", "0.5034435", "0.5034435", "0.5034435" ]
0.7806577
0
Check Module is Enable
public function isNewsletterPopUpEnable() { return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isModuleEnable()\n {\n return $this->helperData->getEnabled();\n }", "public function _isEnable(){\n return true;\n if(!array_key_exists('enable', $this->moduleConfig)) return false;\n return $this->moduleConfig['enable'];\n }", "function ju_module_enabled(string $m):bool {return ju_module_m()->isEnabled($m);}", "public function _isEnabledModule()\r\n {\r\n return ($this->scopeConfig->getValue(self::ENABLE_MODULE)) ? true:false ;\r\n }", "protected function _isModuleEnabled()\n {\n return $this->_helper->isEnabled();\n }", "public function isModuleEnabled()\r\n {\r\n return $this->moduleHelper->isModuleEnabled();\r\n }", "public static function is_enable() {\n\t\treturn true;\n\t}", "public function enabled(Module $module);", "public function is_enabled()\n {\n }", "public function is_enabled()\n {\n }", "function ModuleEnabled( $module ) {\n return esf_Extensions::checkState( esf_Extensions::MODULE, $module, esf_Extensions::BIT_ENABLED );\n}", "public function enable(): bool {}", "public function isEnabled($moduleName);", "public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function isModuleEnabled()\n {\n return $this->scopeConfig->isSetFlag(\n self::AJAXLOGIN_POPUP_XML_PATH,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "function _checkForModule($strModuleName) {\r\n global $objDatabase;\r\n if (($objRS = $objDatabase->SelectLimit(\"SELECT `status` FROM \".DBPREFIX.\"modules WHERE name = '\".$strModuleName.\"' AND `is_active` = '1' AND `is_licensed` = '1'\", 1)) != false) {\r\n if ($objRS->RecordCount() > 0) {\r\n if ($objRS->fields['status'] == 'n') {\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n return true;\r\n }", "public function isEnabled()\n {\n return $this->getStoreConfig(self::MODULE_ENABLED);\n }", "public static function isEnabled()\n\t{\n\t\treturn Main\\ModuleManager::isModuleInstalled('recyclebin');\n\t}", "public function is_enableable();", "public function isModuleActive()\n {\n return Mage::getConfig()\n ->getModuleConfig(self::MODULE_NAME)\n ->is('active', 'true');\n }", "public function enabled();", "public function enabled();", "public function enabled();", "public function enabled();", "function moduleActive($module) {\n return Module::find($module)->enabled();\n }", "public function isModuleActived($name) {\n\t\t$result = Yii::app()->db->createCommand(\"SELECT * FROM {$this->_moduleTableName} WHERE enabled=1 AND name= :name\")->queryRow(true, array(\n\t\t\t':name' => trim(strtolower($name)))\n\t\t);\n\n\t\tif($result === false)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "function erp_is_module_active( $module_key ) {\n $modules = get_option( 'erp_modules', [] );\n\n return isset( $modules[ $module_key ] );\n}", "public function canBeEnabled();", "public function hasModule(){\n return $this->_has(1);\n }", "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 }", "public function isEnabled()\n {\n\t\tif($this->actif == 1) return true;\n \telse return false;\n }", "public function isModuleEnabled($module_name) {\r\n return Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled($module_name);\r\n }", "private function pageEnabled() {\r\n\t\t//Check if the plugin is valid and exits \t\r\n\t\tif (isset ( $_POST ['enable_module'] ) || strlen ( $_POST ['enable_module'] ) < 1 || ! ereg ( \"[a-zA-Z]+\", $_POST ['enable_module'] )) {\r\n\t\t\tthrow new Exception ( \"Invalid plugin name {$_POST['enable_module']}\" );\r\n\t\t}\r\n\t\t\r\n\t\t$plugin = $this->data->xpath ( \"plugin[@name='{$_POST ['enable_module']}']\" );\r\n\t\t\r\n\t\t//Check if there where any plugins found with that name\r\n\t\tif (! is_array ( $plugin ) || empty ( $plugin [0] )) {\r\n\t\t\tthrow new Exception ( \"The plugin {$_POST['enable_module']} could not be found.\" );\r\n\t\t}\r\n\t\t\r\n\t\tLogger::getRootLogger ()->info ( \"Changing status of module {$_POST ['enable_module']} to {$_POST ['enable']}\" );\r\n\t\t\r\n\t\t//Enable/disbale the plugin in XML\r\n\t\tif ($_POST ['enable'] == 'true' || $_POST ['enable'] == '1') {\r\n\t\t\t$plugin [0] ['enabled'] = \"true\";\r\n\t\t} elseif ($_POST ['enable'] == 'false' || $_POST ['enable'] == '0') {\r\n\t\t\t\r\n\t\t\t//Try to stop the plugin, when going from enabled to disabled.\r\n\t\t\t$plugin_object = $this->framework->getPlugin ( ( string ) $plugin [0] ['name'] );\r\n\t\t\tif (isset ( $plugin_object ) && $plugin_object->isService () && ( string ) $plugin [0] ['enabled'] == \"true\") {\r\n\t\t\t\t$plugin_object->stop ();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$plugin [0] ['enabled'] = \"false\";\r\n\t\t} else {\r\n\t\t\tthrow new Exception ( \"Invalid status option for a plugin. Did not disable/enable {$_POST ['enable_module']}.\" );\r\n\t\t}\r\n\t\t\r\n\t\t//Save config and print the changed plugin\r\n\t\tif ($this->config->saveConfig ()) {\r\n\t\t\techo \"<reply action=\\\"ok\\\"><plugin\";\r\n\t\t\tforeach ( $plugin [0]->attributes () as $name => $value ) {\r\n\t\t\t\techo \" $name = \\\"$value\\\"\";\r\n\t\t\t}\r\n\t\t\techo \"/></reply>\";\r\n\t\t} else {\r\n\t\t\tthrow new Exception ( \"Error, could not save configuration file.\" );\r\n\t\t}\r\n\t}", "public function CheckModule()\r\n\t{\r\n\t\tif($this->settings['API_KEY'] != $this->API_Key)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function isEnabled()\n\t{\n\t\treturn $this->checkComponent('com_ssrrn_msc');\n\t}", "protected function checkModules()\n\t{\n\t\tif (Loader::includeModule('imconnector'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tShowError(Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_MODULE_NOT_INSTALLED_MSGVER_1'));\n\n\t\t\treturn false;\n\t\t}\n\t}", "function HasModuleAccess()\n {\n $res=$this->CaravansObj()->HasModuleAccess();\n\n return $res;\n }", "public function isEnabled() {}", "public function isModuleEnabled($name)\n {\n if (version_compare(_PS_VERSION_, '1.5', '>=')) {\n if (Module::isEnabled($name)) {\n $module = Module::getInstanceByName($name);\n\n return $module->isRegisteredInHook('home');\n } else {\n return false;\n }\n } else {\n $module = Module::getInstanceByName($name);\n\n return $module && $module->active === true;\n }\n }", "public function checkModules() : bool\n {\n if (method_exists($this, 'modules') && ! empty($this->modules())) {\n return true;\n }\n\n return false;\n }", "protected function enabled()\n {\n }", "public static function moduleEnabled($moduleName) {\n\n // Load Drupal core status via Drush.\n /** @var \\Thunder\\Robo\\Utility\\Drush $drush */\n $drush = Robo::getContainer()->get('drush');\n $output = $drush->exec()\n ->arg('pm-list')\n ->option('format=json')\n ->silent(TRUE)\n ->run()\n ->getMessage();\n\n\n // Unable to parse Drupal module info JSON.\n if (!($status = @json_decode($output))) {\n print $output;\n\n throw new \\Exception(__CLASS__ . ' - Unable to parse module information.');\n }\n if (array_key_exists($moduleName, $status)) {\n return $status->$moduleName->status == 'enabled';\n }\n else {\n return FALSE;\n }\n }", "public function isEnabled(): bool;", "public function isEnabled(): bool;", "public function isEnabled(): bool;", "function isEnabled();", "function isEnabled();", "public function isEnable ()\n {\n return $this->scopeConfig->isSetFlag(\n self::SYSTEM_CONFIG_GENERAL_ENABLE,\n ScopeInterface::SCOPE_STORE\n );\n }", "public function hasLoadModule(){\n return $this->_has(6);\n }", "public function enable();", "public function enable();", "public function enabled()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->issetCustomExec())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->fields['USE']->getValue() == 'Y';\n\t}", "public function isEnabled()\n\t{\n\t\t// note: don't use $this->_main->.. as it might not exist when this func is called.\n\t\treturn Mage::helper('shoptimally_upsalecoupons/main')->isEnabled();\n\t}", "public function is_enabled(){\n\t\treturn !!$this->_enabled;\n\t}", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function isEnabled();", "public function hasModuleSettings()\n {\n return true;\n }", "public function canBeDisabledAndEnabled() {}", "function is_module($mod_name) {\n return (isset($this->Modules[$mod_name]));\n }", "public function get_enable()\n\t{\n\t\treturn $this->enable;\n\t}", "function isEnabled ();", "private function _checkEnable() {\r\n if ($this->_isEnabled === true) {\r\n throw new Exception('Profiler is still enabled.');\r\n }\r\n }", "public static function installerEnabled()\n {\n /** @var \\Nwidart\\Modules\\Module $installer */\n $installer = Module::find('installer');\n if (!$installer) {\n return false;\n }\n\n return $installer->isEnabled();\n }", "public function checkFundraisingPlugin() {\r\n\t\t$module = 'ynfundraising';\r\n\t\t$modulesTable = Engine_Api::_ ()->getDbtable ( 'modules', 'core' );\r\n\t\t$mselect = $modulesTable->select ()->where ( 'enabled = ?', 1 )->where ( 'name = ?', $module );\r\n\t\t$module_result = $modulesTable->fetchRow ( $mselect );\r\n\t\tif (count ( $module_result ) > 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static function enable(){\n self::$enabled = true; \n self::$disabled=false;\n }", "public function hasModule($name);", "public function _checkConfig(){\n return true;\n if(count($this->moduleConfig) > 0) return true;\n return false;\n }", "public function isEnable() {\n\t\treturn self::$isEnable && session_id() != '';\n\t}", "public static function isEnabled()\n {\n $class = self::className();\n foreach (\\Yii::$app->modules as $module => $params) {\n switch (gettype($params)) {\n case 'array' : if ($class == @$params['class']) return true;\n break;\n case 'object': if ($class == get_class($params)) return true;\n break;\n default : if ($class == $params) return true;\n }\n if ($module == $class || (isset($module['class']) && $module['class'] == $class)) {\n return true;\n }\n }\n return false;\n }", "public function isEnabled()\n {\n return Mage::getStoreConfigFlag('training_layred/catalog/enabled');\n }", "public function is_enabled($name)\n\t{\n\t\treturn isset($this->extensions[$name]['ext_active']) && $this->extensions[$name]['ext_active'];\n\t}", "public function isEnabled()\n {\n return true;\n\n }", "public function isEnabled()\n {\n if ((string)$this->global->enabled === \"1\") {\n return true;\n }\n return false;\n }", "public function enabled()\n {\n return (bool) Mage::getStoreConfig('actions/settings/enabled');\n }", "public function isEnabled()\n {\n return Mage::getStoreConfig('refersion/refersion_settings/refersion_active');\n }", "public function isEnabled()\n {\n return $this->_helperData->isEnabled();\n }", "public static function enable()\n {\n self::$_enabled = TRUE;\n }", "public function isEnabled()\n {\n return true;\n }", "public function isEnabled()\n {\n return true;\n }", "public function isEnabled()\n {\n return true;\n }", "public function isEnabled()\n {\n return true;\n }", "public function isEnabled()\n {\n return true;\n }", "public static function enable() {\n\t\tself::$enabled = true;\n\t}", "protected function _isAllowed()\r\n\t{\r\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('system/tools/modulesmanager');\r\n\t}", "public function isEnabled()\n {\n return $this->helper->isEnabled();\n }", "public function hasModules()\n {\n return !empty($this->modules);\n }", "public function isEnabled()\n {\n return (bool)Mage::helper('mobweb_captcha/config')->isEnabled();\n }", "public function isModuleAvailable($module = '')\n {\n /* listing is always enabled */\n if ('listing' == $module) {\n return true;\n }\n\n /* @var $row Setting */\n try {\n $row = $this->getSetting(sprintf($this->module_placeholder, $module));\n } catch (\\Exception $e) {\n $row = false;\n }\n\n return $row && $row == 'on' ? true : false;\n }", "public function isEnabled()\n {\n return (bool)Mage::helper('Core')->isModuleEnabled('Faonni_AccountNavigation') && \n\t\t\tMage::getStoreConfig('faonni_accountnavigation/general/active');\n }", "private function isEnabled()\n {\n return $this->getConfigBool('enable', false);\n }" ]
[ "0.8145094", "0.79904133", "0.7949739", "0.7949195", "0.7932023", "0.7697166", "0.761754", "0.7530346", "0.74950945", "0.74838865", "0.7449572", "0.7448233", "0.7435554", "0.7335271", "0.7335271", "0.7321042", "0.7278288", "0.7209463", "0.7203031", "0.71536416", "0.7085769", "0.7085769", "0.7085769", "0.7085769", "0.7082815", "0.69911444", "0.69621396", "0.69570255", "0.69395185", "0.691989", "0.686536", "0.68467206", "0.68237394", "0.6808482", "0.68011814", "0.679161", "0.6790715", "0.67905676", "0.6786693", "0.67562085", "0.67551005", "0.6727502", "0.6696107", "0.6696107", "0.6696107", "0.66844857", "0.66844857", "0.6682902", "0.6660399", "0.66543615", "0.66543615", "0.6631937", "0.66253465", "0.66226286", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66195786", "0.66173387", "0.6612173", "0.6598872", "0.65621006", "0.65589166", "0.6558259", "0.65530956", "0.65518576", "0.6550729", "0.6516789", "0.65068877", "0.65039414", "0.6487695", "0.64841545", "0.6482799", "0.6476906", "0.6467884", "0.6462883", "0.64579445", "0.6455303", "0.6451007", "0.64418876", "0.64418876", "0.64418876", "0.64418876", "0.64418876", "0.6438207", "0.64377344", "0.64334834", "0.6429653", "0.6421939", "0.6416882", "0.64073664", "0.6396143" ]
0.0
-1
Get Cookie TIme Out
public function getCookiesTimeOut() { $cookiesTimeout = Mage::getStoreConfig(self::XML_PATH_COOKIES_TIMEOUT); return $cookiesTimeout; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCookie()\n {\n return $this->cookie;\n }", "public function getCookie() {\n return $this->cookie;\n }", "public function getCookie()\n {\n return $this->getHeaders()->get('Cookie');\n }", "public function get_cookies()\n {\n }", "public function getCookie(): ParameterBag { return $this->cookie; }", "public function getCookie(): array;", "public function cookieValue() {\n return $this->cookie;\n }", "public function cookieValue() {\n\t\treturn $this->cookie;\n\t}", "function getCookies(){\n\t\treturn $this->_HTTPCookies;\n\t}", "public function get()\n {\n return $this->cookieManager->getCookie(self::COOKIE_NAME);\n }", "public function readCookie() {\n\t\treturn unserialize($_COOKIE[$this->cookieName]);\n\t}", "public function getCookies()\n {\n\n }", "public function currentCookieInfo() {\n if ($this->isLoggedIn()) {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n return $this->cookieInfo($auth_cookie);\n }\n }", "public function getCookie()\n {\n if (!isset($this->_cookie)) {\n $this->_cookie = new \\Yana\\Http\\Requests\\ValueWrapper();\n }\n return $this->_cookie;\n }", "public function getCookie() {\n\t\t$ret_val = false;\n\t\tif ($this->_cookie instanceof Http\\Cookie\\Iface\\Base) {\n\t\t\t$ret_val = $this->_cookie;\n\t\t}\n\t\treturn $ret_val;\n\t}", "function getCookieData() {\n\t\t$oEncrypt = utilityEncrypt::factory(file_get_contents(system::getConfig()->getPathData().'/dash.session.key'));\n\t\treturn utilityEncrypt::toUriString(\n\t\t\t$oEncrypt->encrypt(\n\t\t\t\tserialize(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => $this->getUser()->getID(),\n\t\t\t\t\t\t'email' => $this->getUser()->getEmail(),\n\t\t\t\t\t\t'expiry' => strtotime('+72 hours'),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "static function viaRemember()\n\t{\n\t\treturn self::$cookie;\n\t}", "public function get_cookies() {\n return $this->_cookies;\n }", "public function getCookieVariables();", "public function getCookies()\n {\n return $this->__getCookies();\n }", "public function getCookies(){\n\t\treturn $this->cookies;\n\t}", "public function getResponseCookies(){\n\t\treturn $this->response->getCookies();\n\t}", "public function toCookieString()\n {\n return $this->format(\\DateTime::COOKIE);\n }", "function getCookiesInfo(){\n\techo \"Cookies information: <br>\";\n\n\tif( isset($_COOKIE[\"name\"])){\n\t\techo \"_COOKIE[\\\"name\\\"]: \" . $_COOKIE[\"name\"] . \"<br />\";\n\t}\n\telse{\n\t\techo \"Sorry... _COOKIE[\\\"name\\\"] is not set yet !\" . \"<br />\";\n\t}\n\n\t//echo \"HTTP_COOKIE_VARS[\\\"name\\\"]: \" . $HTTP_COOKIE_VARS[\"name\"]. \"<br />\";\n\t//echo \"_COOKIE[\\\"age\\\"]: \" . $_COOKIE[\"age\"] . \"<br />\";\n\t//echo \"HTTP_COOKIE_VARS[\\\"name\\\"]: \" . $HTTP_COOKIE_VARS[\"name\"] . \"<br />\";\n}", "function get_cookie() {\n\tglobal $_COOKIE;\n\t// $_COOKIE['main_user_id_1'] = '22760600|2c3a1c1487520d9aaf15917189d5864';\n\t$hid = explode ( \"|\", $_COOKIE ['main_tcsso_1'] );\n\t$handleName = $_COOKIE ['handleName'];\n\t// print_r($hid);\n\t$hname = explode ( \"|\", $_COOKIE ['direct_sso_user_id_1'] );\n\t$meta = new stdclass ();\n\t$meta->handle_id = $hid [0];\n\t$meta->handle_name = $handleName;\n\treturn $meta;\n}", "public function cookie()\n {\n// $a = $abc->getCookieCollection();\n $abc = $this->request->getCookieCollection();\n $abc = new Collection($abc);\n\n $token = $abc->first()->getValue();\n return $this->responseJson(['csrfToken'=>$token]);\n }", "function getCookies() {\n\t\treturn $this->cookies;\n\t}", "public function get_cookie() {\r\n\t\tforeach ($this->cookies as $key => $this_cookie) {\r\n\t\t\tif ($this_cookie[\"expires\"] < time()) { unset($this->cookies[$key]); }\r\n\t\t}\r\n\t\treturn $this->cookies;\r\n\t}", "public function getCOOKIE($name) { return $this->getGLOBAL('_COOKIE', $name); }", "public function getCookies()\n {\n return $this->cookies;\n }", "public function cookies()\n\t{\n\t\treturn $this->connection()->get('cookies');\n\t}", "public function get () {\n\t\treturn ($this->value === \"\" && isset($_COOKIES[$this->name])) ? $_COOKIES[$this->name] : $this->value;\n\t}", "public function cookies()\n {\n return $this->response_cookies;\n }", "public function get_cookie($name){\n\t\t$this->load->helper('cookie');\n\t\tif ($this->input->cookie($name,true)!=NULL) {\n\t\t\techo $this->input->cookie($name,true);\n\t\t}else{\n\t\t\techo \"no cookie\";\n\t\t}\n\t}", "public function cookies() {\n return $this->cookies;\n }", "abstract public function getCookie($skin);", "public function get($cookieName);", "function myGetcookie($name){\r\n\t\tif(isset($_COOKIE[$name])){\r\n\t\t\treturn urldecode($_COOKIE[$name]);\r\n\t\t}else{\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public function getCookie($index=null){\n $result = null;\n if (isset($index)){\n $result = $_COOKIE[$index];\n }else{\n $result = $_COOKIE; \n }\n return $result;\n }", "public function cookies()\r\n {\r\n return $this->cookies;\r\n }", "public function cookies()\r\n {\r\n return $this->cookies;\r\n }", "function cookie ($name) {\n\t\treturn @$this->cookie[$name];\n\t}", "private function get_nonce () {\n return @$_COOKIE['sso_nonce'];\n }", "public function getCookies()\n {\n return $this->_getCookies();\n }", "public static function getCookieName() {}", "public static function getCookieName() {}", "public function getCookieTime(){\r\n return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_COOKIE_TIME,ScopeInterface::SCOPE_WEBSITE);\r\n }", "public function getCookies()\n {\n return $this->cookies;\n }", "public function getCookie($link): string;", "public function getCookie($name){\n\n return self::$oCRNRSTN_ENV->oCOOKIE_MGR->getCookie($name);\n\n }", "function wpgplus_get_cookie($name) {\n\t$my_cookie = get_transient('wpgplus_cookie_'. $name);\n\t// wpgplus_debug(\"\\nCookie is \" . print_r($my_cookie,true) . \"\\n\");\n\t// Cookies which have an expiration date and it is passed should not be returned\n\tif(!$my_cookie || ((!empty($my_cookie->expires)) && ($my_cookie->expires < time()))) {\n\t\t//wpgplus_debug(\"\\nNo cookies found for \". $name . \"\\n\");\n\t\treturn false;\n\t} else {\n\t\t//wpgplus_debug(\"\\nGetting cookie for \". $my_cookie->name . \"\\n\");\n\t\treturn $my_cookie;\n\t}\n}", "static public function getCookie($name= null)\n {\n if ($name) $name = static::$COOKIE_PREFIX . $name;\n return empty($name) ? $_COOKIE : (isset($_COOKIE[$name]) ? $_COOKIE[$name] : '');\n }", "public function getCookies() {\n return $this->cookies;\n }", "public function get($name)\n {\n return $this->cookieManager->getCookie($name);\n }", "function getcookie(string $name = null) {\n return !empty($name) ?\n !empty($_COOKIE[$name])\n ? $_COOKIE[$name] : null \n : $_COOKIE;\n }", "function getcookie(string $name = null) {\n return !empty($name) ?\n !empty($_COOKIE[$name])\n ? $_COOKIE[$name] : null \n : $_COOKIE;\n }", "public function getCookies()\n {\n return $this->cookiesRequested;\n }", "public function getTokenPassCookie()\n {\n return $_COOKIE[$this->tokenPass];\n }", "public static function logout() {\n\t\tif (isset($_COOKIE['sm_constitid'])) {\n\t\t\tsetrawcookie('sm_constitid', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['ERIGHTS'])) {\n\t\t\tsetrawcookie('ERIGHTS', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['JSESSIONID'])) {\n\t\t\tsetrawcookie('JSESSIONID', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['emeta_id'])) {\n\t\t\tsetrawcookie('emeta_id', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['first_name'])) {\n\t\t\tsetrawcookie('first_name', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['last_name'])) {\n\t\t\tsetrawcookie('last_name', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['is_org'])) {\n\t\t\tsetrawcookie('is_org', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['email'])) {\n\t\t\tsetrawcookie('email', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['status'])) {\n\t\t\tsetrawcookie('status', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\t\texit;\n\t}", "public function getCookieParams(): array;", "public function getCookie($name)\n {\n\n }", "function save_cookie_from_browser($domain = \"\")\n\t{\n\t\t// .meonyou.com TRUE / FALSE 0 PHPSESSID 8p47p0c8g65kjtfnl7gjs4u5k2\n\t\t// www.meonyou.com FALSE / FALSE 1267546450 track a%3A4%3A%7Bs%3A12%3A%22affiliate_id%22%3Bs%3A1%3A%221%22%3Bs%3A10%3A\n\n\t}", "public function getCookieParams() {}", "public function cookie($name);", "public function getCookie(): Cookie\n {\n $cookie = new Cookie();\n $cookie->expire = strtotime('+20 years');\n $cookie->httpOnly = true;\n return $cookie;\n }", "function get_cookie($name)\n{\n if (isset($_COOKIE[$name])) {\n return json_decode(base64_decode(stripslashes($_COOKIE[$name])), true);\n }\n\n return array();\n}", "private function get_auth_cookie() {\r\n $postfields = http_build_query([\r\n 'username' => $this->username,\r\n 'password' => $this->password,\r\n 'csrfmiddlewaretoken' => $this->csrf_token\r\n ]);\r\n curl_setopt_array($this->curl_handle, [\r\n CURLOPT_URL => $this->auth_url,\r\n CURLOPT_COOKIEJAR => self::COOKIE_FILE,\r\n CURLOPT_COOKIEFILE => self::COOKIE_FILE,\r\n CURLOPT_POST\t => false,\r\n CURLOPT_POSTFIELDS => $postfields,\r\n CURLOPT_FAILONERROR => true,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_REFERER => $this->auth_url,\r\n CURLOPT_AUTOREFERER => true,\r\n CURLOPT_HTTPHEADER => ['User-Agent: '.self::USER_AGENT],\r\n //CURLOPT_VERBOSE => true,\r\n CURLOPT_RETURNTRANSFER => true\r\n ]);\r\n\r\n curl_exec($this->curl_handle);\r\n }", "function WebDPCookie(){\r\n $cookie = [\r\n \"sessionid=\",\r\n \"sessionid=\",\r\n \"sessionid=\"\r\n ];\r\n \r\n return $cookie[mt_rand(0, count($cookie) - 1)];\r\n}", "private static function getTokenFromCookie()\n {\n if (isset($_COOKIE[self::ACCESS_TOKEN_COOKIE_KEY]) ?? $_COOKIE[self::ACCESS_TOKEN_COOKIE_KEY] != '') {\n $cookieValue = $_COOKIE[self::ACCESS_TOKEN_COOKIE_KEY];\n return self::convertToInstance($cookieValue);\n }\n \n return null;\n }", "function getCookieValue($name)\n{\n $token = null;\n if (array_key_exists($name, $_COOKIE) == true) {\n $token = $_COOKIE[$name];\n }\n\n return $token;\n}", "public function getCookies()\n {\n return $this->wrapped->getCookies();\n }", "function GetCookie($var, $default='')\n{\n\treturn GetRequest($_COOKIE, $var, $default);\n}", "function getCookies($host) {\n //I will use alredy saved cookies\n global $cookies; \n\n $result=array();\n foreach ($cookies as $cookie) {\n if (strpos($host,$cookie->Dom)!==FALSE) {\n $result[]=\"\".$cookie->Tit.$cookie->Val; \n }\n }\n return implode(\"; \", $result);\n}", "public function getSessionIdFromCookie();", "public function getCookie($name){\n if(isset($this->cookie[$name])){\n return $this->cookie[$name];\n }else{\n return null;\n }\n }", "public function getCookies()\n\t{\n\t\treturn $this->cookies->all();\n\t}", "public static function get($name){\n\t\treturn $_COOKIE[$name];\n\t}", "private static function cookieLifetime()\n {\n return time() + (self::ACCESS_TOKEN_EXPIRES_DAYS * 24 * 60 * 60);\n }", "public function getCookieParams()\n {\n }", "protected function _getCookie()\n {\n if (!is_null($this->content))\n {\n return $this->content;\n }\n\n $cookie = null;\n $this->content = new \\stdClass;\n\n if (!empty($_COOKIE[$this->name]))\n {\n $cookie = $_COOKIE[$this->name];\n }\n\n if (!empty($cookie) && (substr_count($cookie, '|') >= 2))\n {\n list($digest, $expire, $data) = explode('|', $cookie, 3);\n\n // Check data expiration and integrity\n if (!empty($digest) && !empty($data) && !empty($expire) \n && ($expire > round((time() - $this->start_timestamp) / 60))\n && hash_equals($digest, hash_hmac($this->digest_method, $expire . '|' . $data, $this->secret)))\n {\n if (substr($data, 0, 1) == '{')\n {\n $this->content = (object) json_decode($data, true);\n }\n elseif (function_exists('msgpack_unpack'))\n {\n $this->content = (object) msgpack_unpack($data);\n }\n\n // If the cookie will expire soon we try to renew it first\n if ($this->auto_renew && ($expire - round((time() - $this->start_timestamp)/60) <= $this->auto_renew))\n {\n $this->save();\n }\n }\n else\n {\n // Invalid cookie: just remove it\n $this->save();\n }\n }\n\n return $this->content;\n }", "public function getQueuedCookies();", "public function cookie($name) {\n return isset($this->cookies[$name])? $this->cookies[$name] : null;\n }", "#[Pure]\n public function getCookies() {}", "public static function getSystemCookie (){\n if (isset($_COOKIE['system_cookie'])){\n return $_COOKIE['system_cookie'];\n } else {\n return false;\n }\n }", "function getCookie($username, $pass) {\n\t\t\t\tglobal $botinfo, $clientinfo, $Crono;\n\t\tconsole( \"Attempting to get Certificate.. \", \"Core\");\n\t\t// Method to get the cookie! Yeah! :D\n\t\t// Our first job is to open an SSL connection with our host.\n\t\t$this->socket = fsockopen(\"ssl://www.deviantart.com\", 443);\n\t\tconsole( \"[Cookie] - Opened socket!\", \"Core\");\n\t\t// If we didn't manage that, we need to exit!\n\t\tif($this->socket === false) {\n\t\tconsole( \"Error: Please check your internet connection!\", \"Core\");\n\t\t}\n\t\t// Fill up the form payload\n\t\t$POST = '&username='.urlencode($username);\n\t\t$POST.= '&password='.urlencode($pass);\n\t\t$POST.= '&remember_me=1';\n\t\t// And now we send our header and post data and retrieve the response.\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"www.deviantart.com\",\n\t\t\t\"/users/login\",\n\t\t\t\"http://www.deviantart.com/users/rockedout\",\n\t\t\t$POST\n\t\t);\n\t \n\t\t// Now that we have our data, we can close the socket.\n\t\tfclose ($this->socket);\n\t\t// And now we do the normal stuff, like checking if the response was empty or not.\n\t\tif(empty($response))\n\t\treturn 'No response returned from the server';\n\t\tif(stripos($response, 'set-cookie') === false)\n\t\treturn 'No cookie returned';\n\t\t// Grab the cookies from the header\n\t\t$response=explode(\"\\r\\n\", $response);\n\t\t$cookie_jar = array();\n\t\tforeach ($response as $line)\n\t\t\tif (strpos($line, \"Set-Cookie:\")!== false)\n\t\t\t\t$cookie_jar[] = substr($line, 12, strpos($line, \"; \")-12);\n\n\t\t// Using these cookies, we're gonna go to chat.deviantart.com and get\n\t\t// our authtoken from the dAmn client.\n\t\tif (($this->socket = @fsockopen(\"ssl://www.deviantart.com\", 443)) == false)\n\t\t return 'Could not open an internet connection';\n\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"chat.deviantart.com\",\n\t\t\t\"/chat/\",\n\t\t\t\"http://chat.deviantart.com\",\n\t\t\tnull,\n\t\t\t$cookie_jar\n\t\t);\n\n\t\t// Now search for the authtoken in the response\n\t\t$cookie = null;\n\t\tif (($pos = strpos($response, \"dAmn_Login( \")) !== false)\n\t\t{\n\t\t\t$response = substr($response, $pos+12);\n\t\t\t$cookie = substr($response, strpos($response, \"\\\", \")+4, 32);\n\t\t}\n\t\telse return 'No authtoken found in dAmn client';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t// Because errors still happen, we need to make sure we now have an array!\n\t\tif(!$cookie)\n\t\treturn 'Malformed cookie returned';\n\t\t// We got a valid cookie!\n\t\tglobal $dAmn, $running;\n\t\t$running = true;\n\t\t$dAmn->cookie = $cookie;\n\t\treturn $cookie;\n\t\tconsole( \"Cookie: \".$cookie, \"Connection\"\t\t);\n\t}", "function getLastTime(){\n\t \t if (!empty($_COOKIE['lastVisit'])) {\n\t\techo \"你上次登陆的时间是:\".$_COOKIE['lastVisit'];\n\t}else{\n\t\techo \"你是第一次登陆\";\n\t}\n\t\tsetCookie(\"lastVisit\",date(\"Y-m-d : H:i:s\"),time()+24*3600*30);\n }", "function cookie($get = null, $set = null)\n {\n if ($get !== null && $set === null) {\n return Cookie::get($get);\n } elseif ($get !== null && $set !== null) {\n return Cookie::set($get, $set);\n } else {\n return App::make('cookie');\n }\n }", "protected function _getSessionFromCookie(){\n\t\n\t\tif (isset($_COOKIE) && isset($_COOKIE[$this->_cookie_var_name])){\n\t\t\treturn json_decode($_COOKIE[$this->_cookie_var_name], true);\n\t\t} else\n\t\t\treturn array();\n\t\n\t}", "function getCookie($key)\n{\n $key = str_rot13(\"$key\");\n if(isset($_COOKIE[\"$key\"])) return str_rot13($_COOKIE[\"$key\"]);\n return \"\";\n}", "function cookie(string $name, $default = null)\n\t\t{\n\t\t\treturn request()->getCookies()->get($name, $default);\n\t\t}", "public function decodeCookie()\n {\n return json_decode($_COOKIE[self::SITE_USER]);\n }", "public function getUsernameCookie()\n {\n return $_COOKIE[$this->username];\n }", "function getFromCookies() {\r\n\t\t//Data stored in cache as a cookie.\r\n\t\t$this->phone_number = $_COOKIE['phoneNumber'];\r\n\t\t$this->email = $_COOKIE['email'];\r\n\t}", "public function cookie($name='') {\n\t\t$this->cookie[$name] = (isset($_COOKIE[$name])) ?\n\t\t\t$_COOKIE[$name] : NULL;\n\t\t\t\n\t\treturn $this->cookie;\n\t}", "public function getCookie($name)\n\t{\n\t\treturn $this->cookies->get($name);\n\t}", "protected function getSwarmCookie()\n {\n return $this->getSession()->getCookie('SwarmDataPath');\n }", "public function getCookieParams()\n {\n return $this->cookies;\n }", "function doCookies() {\r\n setcookie(\"cli_num\", 123456789, time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_fname\", $_POST['first_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_lname\", $_POST['last_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_dob\", $_POST['dob'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_email\", $_POST['email'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_phone\", $_POST['phone'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_add\", $_POST['address'], time() + (86400 * 1), \"/\");\r\n \r\n /* //print the cookies\r\n echo \"Value is: \" . $_COOKIE[\"cli_num\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_fname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_lname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_dob\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_email\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_phone\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_add\"];*/\r\n \r\n}", "public static function all(){\n return $_COOKIE;\n }", "private function getCookie() {\n $Cookie = filter_input(INPUT_COOKIE, 'useronline', FILTER_DEFAULT);\n if (!$Cookie):\n return FALSE;\n else:\n return TRUE;\n endif;\n setcookie(\"useronline\", base64_encode(\"ccs\"), time() + 86400);\n }", "function wp_get_cookie_login()\n {\n }" ]
[ "0.7493923", "0.7437117", "0.7419855", "0.72679216", "0.71183133", "0.7101316", "0.70763874", "0.7074329", "0.70560503", "0.7042476", "0.6908957", "0.69062", "0.68493104", "0.6787301", "0.677887", "0.6773986", "0.6712738", "0.67079455", "0.6703224", "0.6691989", "0.666987", "0.6669214", "0.66680735", "0.6660566", "0.6654332", "0.66466576", "0.66217047", "0.6591045", "0.6589998", "0.655957", "0.6542212", "0.65399", "0.65354395", "0.6510555", "0.6501877", "0.6495262", "0.64935595", "0.64919746", "0.64804655", "0.6479587", "0.6479587", "0.64793074", "0.64652705", "0.6458354", "0.6453308", "0.6452763", "0.64454585", "0.6433173", "0.6421825", "0.64014894", "0.63983345", "0.6379749", "0.6372951", "0.6354195", "0.635272", "0.635272", "0.6324114", "0.6321215", "0.6309957", "0.6309211", "0.62959325", "0.6289559", "0.62825084", "0.6268931", "0.6262481", "0.62525713", "0.6249467", "0.6241624", "0.6241004", "0.6205047", "0.62043214", "0.61991435", "0.61939174", "0.6192256", "0.6187668", "0.61795974", "0.6175351", "0.6172278", "0.6168771", "0.6161027", "0.6145607", "0.6142075", "0.6131935", "0.6125724", "0.61124706", "0.6110403", "0.61023206", "0.6093737", "0.6085156", "0.6080533", "0.60801023", "0.607601", "0.60681415", "0.60663474", "0.6049316", "0.6048878", "0.6039274", "0.60379034", "0.6023694", "0.60208136", "0.6019328" ]
0.0
-1
Convert Day in seconds params int days
public function getCookieTimeInSeconds($days) { $cookiesValueInSecond = (84600 * $days); return $cookiesValueInSecond; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertDays($days){\n\t\treturn $seconds = $days * 86400;\n\t}", "public static function getSecondsToWholeDays($seconds) {\n\t\treturn round($seconds / (3600 * 24));\n\t}", "public static function convertSecondsToDays($seconds) {\n\t\t$minutes = $seconds / 24;\n\t\t$days = $minutes / 3600;\n\t\t$exactDays = intval($days);\n\t\treturn $exactDays;\n\t}", "public static function secondsToDays($secs)\n {\n return $secs / self::NUM_SECONDS_IN_DAY;\n }", "function convertSeconds($seconds)\n{\n\t$date1 = new DateTime(\"@0\");\n\t$date2 = new DateTime(\"@$seconds\");\n\treturn $date1->diff($date2)->format(\"%a days, %h hours, %i minutes and %s seconds\");\n}", "function days($day, $month, $year) {\n\t\t// Hour, Minute, Second, Month, Day, Year\n\t\t$target = mktime(0, 0, 0, $month, $day, $year);\n\t\t$today = time();\n\t\t$difference = ($target - $today);\n\t\t$days = (int)($difference/86400); // 86400 being the number of seconds in a day\n\t\t\n\t\t// Make sure that we show the correct number of zeros when the number gets smaller\n\t\t// + if the date passes then we don't show a minus value\n\t\tif ($days < 0) {\n\t\t\t$days = '000';\n\t\t} else if ($days < 10) {\n\t\t\t$days = '00'.$days;\n\t\t} else if ($days < 100) {\n\t\t\t$days = '0'.$days;\n\t\t} \n\t\t\n\t\t// Needs to be returned as a String so we can split it into individual characters\n\t\treturn (String)$days;\n\t}", "public static function toSecondsUsingDays(\\DateInterval $interval)\n {\n $seconds = (string)$interval->s;\n\n if ($interval->i) {\n $seconds = bcadd($seconds, bcmul($interval->i, self::SECONDS_MINUTE));\n }\n\n if ($interval->h) {\n $seconds = bcadd($seconds, bcmul($interval->h, self::SECONDS_HOUR));\n }\n\n if ((false !== $interval->days) && (0 <= $interval->days)) {\n $seconds = bcadd($seconds, bcmul($interval->days, self::SECONDS_DAY));\n } else {\n throw new \\InvalidArgumentException('The \"days\" property is not set.');\n }\n\n return $seconds;\n }", "function TimeToDays($num) {\n\t$dateVal = $num/86400;\n\nreturn $dateVal;\n}", "public function allToSeconds($days, $hours, $minutes, $seconds)\n {\n $tatalseconds = 0;\n if($days != 0)\n $tatalseconds+= $days*24*60*60;\n if($hours != 0)\n $tatalseconds+= $hours*60*60;\n if($minutes != 0)\n $tatalseconds+= $minutes*60;\n if($seconds != 0)\n $tatalseconds+= $seconds;\n\n return $tatalseconds;\n }", "public static function secondsToDaypartsString(int $seconds): string {\r\n\r\n $dayparts = self::secondsToDaypartsArray($seconds);\r\n\r\n $string = '';\r\n if ($dayparts['days'] > 0) {\r\n $string .= \"{$dayparts['days']}d \";\r\n }\r\n if ($dayparts['hours'] > 0) {\r\n $string .= \"{$dayparts['hours']}h \";\r\n }\r\n if ($dayparts['minutes'] > 0) {\r\n $string .= \"{$dayparts['minutes']}m \";\r\n }\r\n if ($dayparts['seconds'] > 0) {\r\n $string .= \"{$dayparts['seconds']}s \";\r\n }\r\n\r\n return trim($string);\r\n }", "function seconds_to_time($inputSeconds)\n {\n\n $secondsInAMinute = 60;\n $secondsInAnHour = 60 * $secondsInAMinute;\n $secondsInADay = 24 * $secondsInAnHour;\n\n // extract days\n $days = floor($inputSeconds / $secondsInADay);\n\n // extract hours\n $hourSeconds = $inputSeconds % $secondsInADay;\n $hours = floor($hourSeconds / $secondsInAnHour);\n\n // extract minutes\n $minuteSeconds = $hourSeconds % $secondsInAnHour;\n $minutes = floor($minuteSeconds / $secondsInAMinute);\n\n // extract the remaining seconds\n $remainingSeconds = $minuteSeconds % $secondsInAMinute;\n $seconds = ceil($remainingSeconds);\n\n // return the final array\n return [\n 'd' => (int)$days,\n 'H' => (int)$hours,\n 'i' => (int)$minutes,\n 's' => (int)$seconds,\n ];\n }", "public function days($days)\n {\n $days = is_array($days) ? $days : func_get_args();\n\n return $this->spliceIntoPosition(5, implode(',', $days));\n }", "function day($day= 1)\n{\n return $day * 24 * 60 *60;\n}", "public static function secondsToDaypartsArray(int $seconds): array {\r\n\r\n $seconds = abs($seconds);\r\n\r\n return [\r\n 'days' => (int) floor($seconds / 86400),\r\n 'hours' => (int) floor(($seconds % 86400) / 3600),\r\n 'minutes' => (int) floor((($seconds % 86400) % 3600) / 60),\r\n 'seconds' => (int) floor((($seconds % 86400) % 3600) % 60)\r\n ];\r\n }", "function fromDays( $days ) {\n\t\t\n\t\t$days -= 1721119;\n\t\t$century = floor( ( 4 * $days - 1) / 146097 );\n\t\t$days = floor( 4 * $days - 1 - 146097 * $century );\n\t\t$day = floor( $days / 4 );\n\t\t\n\t\t$year = floor( ( 4 * $day + 3) / 1461 );\n\t\t$day = floor( 4 * $day + 3 - 1461 * $year );\n\t\t$day = floor( ($day + 4) / 4 );\n\t\t\n\t\t$month = floor( ( 5 * $day - 3) / 153 );\n\t\t$day = floor( 5 * $day - 3 - 153 * $month );\n\t\t$day = floor( ($day + 5) / 5 );\n\t\t\n\t\tif ($month < 10) {\n\t\t\t$month +=3;\n\t\t} else {\n\t\t\t$month -=9;\n\t\t\tif ($year++ == 99) {\n\t\t\t\t$year = 0;\n\t\t\t\t$century++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->day = $day;\n\t\t$this->month = $month;\n\t\t$this->year = $century*100 + $year;\n\t}", "function int_to_day($int){\n\tglobal $days;\n\treturn $days[$int];\n}", "public function diffDays($days){\n\t\t$this->_timestamp = self::_sub($this->_timestamp, self::_mul($days, 86400));\n\t\t$this->_setDate();\n\t\treturn $this->_date;\n\t}", "function secondsToWords($seconds)\n {\n $ret = \"\";\n\n /*** get the days ***/\n $days = intval(intval($seconds) / (3600*24));\n if($days> 0)\n {\n $ret .= \"$days days \";\n }\n\n /*** get the hours ***/\n $hours = (intval($seconds) / 3600) % 24;\n if($hours > 0)\n {\n $ret .= \"$hours hours \";\n }\n\n /*** get the minutes ***/\n $minutes = (intval($seconds) / 60) % 60;\n if($minutes > 0)\n {\n $ret .= \"$minutes minutes \";\n }\n\n /*** get the seconds ***/\n $seconds = intval($seconds) % 60;\n if ($seconds > 0) {\n $ret .= \"$seconds seconds\";\n }\n\n return $ret;\n }", "public function subDays(int $days)\n {\n $time = clone $this;\n\n return $time->sub(DateInterval::createFromDateString(\"{$days} days\"));\n }", "public static function getDateFromSeconds($scd) {\n $date = date('m/d/Y h:i:s', time());\n $stamp = strtotime($date) - $scd;\n return date(\"d/m/y\", $stamp);\n }", "private function toSeconds(\\DateInterval $step): int {\n\t\tif ($this->convertible($step))\n\t\t\treturn $step->h * 3600 + $step->i * 60 + $step->s;\n\t\tthrow new \\InvalidArgumentException(\n\t\t\t'For time intervals are allowed only seconds, minutes and hours'\n\t\t);\n\t}", "function secondsTodayshours($ss) {\n $arr = array();\n $s = $ss%60;\n $m = floor(($ss%3600)/60);\n $h = floor(($ss%86400)/3600);\n $d = floor(($ss%2592000)/86400);\n $M = floor($ss/2592000);\n $arr['months'] = $M;\n $arr['days'] = $d;\n $arr['hours'] = $h;\n $arr['minutes'] = $m;\n $arr['seconds'] = $s;\n // return \"$M months, $d days, $h hours, $m minutes, $s seconds\";\n return $arr;\n }", "public function getTimeIn($numDays){\n return time() + ($numDays * 24 * 60 * 60);\n }", "function sec2time($sec){\n\t// Parameters:\t$sec\n\t//\t\t\t\tType: integer\n\t// Returns:\t\tstring\n\t$returnstring = \" \";\n\t$days = intval($sec/86400);\n\t$hours = intval ( ($sec/3600) - ($days*24));\n\t$minutes = intval( ($sec - (($days*86400)+ ($hours*3600)))/60);\n\t$seconds = $sec - ( ($days*86400)+($hours*3600)+($minutes * 60));\n\t// if($seconds =='') $seconds = '00';\n\n\t$returnstring .= ($days)?(($days == 1) ? \"1 Day \" : sprintf(\"%02d\", $days). \" Days \") : \"\";\n\t$returnstring .= ($days && $hours && !$minutes && !$seconds) ? \"\" : \"\";\n\t$returnstring .= ($days > 0 && $hours == 0)? \"00:\": \"\";\n\t$returnstring .= ($hours)?( ($hours == 1) ? \"01:\" : sprintf(\"%02d\", $hours) .\":\") : \"00:\";\n\t$returnstring .= (($days || $hours) && ($minutes && !$seconds))?\"\":\"\";\n\t$returnstring .= ($minutes)?( ($minutes == 1)?\"1:\": sprintf(\"%02d\", $minutes) .\":\"):\"00:\";\n\t$returnstring .= (($days || $hours || $minutes) && $seconds)?\"\":\"\";\n\t$returnstring .= ($seconds) ? (($seconds == 1)? \"1\" : sprintf(\"%02d\", $seconds)):\"00\";\n\tif ($returnstring != \" \") return ($returnstring);\n}", "function seconds_to_string($sec)\n {\n $hms = \"\";\n\t\t\n\t\t// for days\n\t\t$days = intval(intval($sec) / 86400);\n\t\t\n\t\t$hms .= ($days > 0) ? $days. \"d - \" : \"\";\n \n // do the hours first: there are 3600 seconds in an hour, so if we divide\n // the total number of seconds by 3600 and throw away the remainder, we're\n // left with the number of hours in those seconds\n $hours = intval(intval($sec / 3600) % 24);\n \n // add hours to $hms (with a leading 0 if asked for)\n $hms .= ($days == 0 && $hours == 0) ? \"\" : $hours. \"h - \";\n \n // dividing the total seconds by 60 will give us the number of minutes\n // in total, but we're interested in *minutes past the hour* and to get\n // this, we have to divide by 60 again and then use the remainder\n $minutes = intval(($sec / 60) % 60); \n \n // add minutes to $hms (with a leading 0 if needed) but only if minutes are not 0\n $hms .= ($days == 0 && $hours == 0 && $minutes == 0) ? \"\" : $minutes.\"m\";\n \n // seconds past the minute are found by dividing the total number of seconds\n // by 60 and using the remainder\n //$seconds = intval($sec % 60); \n \n // add seconds to $hms (with a leading 0 if needed)\n //$hms .= $seconds.\"s\";\n \n // if the total time is 0, show so\n\t\t$hms = empty($hms) ? 0 : $hms;\n\t\t\n\t\t// done!\n return $hms;\n }", "public static function Seconds($Seconds) {\n $Minutes = floor($Seconds/60);\n $Hours = floor($Seconds/60/24);\n $Days = floor($Seconds/60/60/24);\n $Weeks = floor($Seconds/60/60/24/7);\n $Months = floor($Seconds/60/60/24/30);\n $Years = floor($Seconds/60/60/24/365);\n\n if ($Seconds < 60)\n return sprintf(Plural($Seconds, '%s second', '%s seconds'), $Seconds);\n elseif ($Minutes < 60)\n return sprintf(Plural($Minutes, '%s minute', '%s minutes'), $Minutes);\n elseif ($Hours < 24)\n return sprintf(Plural($Hours, '%s hour', '%s hours'), $Hours);\n elseif ($Days < 7)\n return sprintf(Plural($Days, '%s day', '%s days'), $Days);\n elseif ($Weeks < 4)\n return sprintf(Plural($Weeks, '%s week', '%s weeks'), $Weeks);\n elseif ($Months < 12)\n return sprintf(Plural($Months, '%s month', '%s months'), $Months);\n else\n return sprintf(Plural($Years, '%s year', '%s years'), $Years);\n }", "protected function dateIntervalSeconds($dateInterval){\n $hourSeconds = $dateInterval->h * 60 * 60;\n $minuteSeconds = $dateInterval->i * 60;\n\n return $dateInterval->s + $minuteSeconds + $hourSeconds; \n }", "public static function expiry_day($days=1) {\n\t\t\treturn self::expiry_hour($days*24);\n\t\t}", "public function ntc_days ($input) {\n $this->days_input = substr($input, 0, 2);\n return $this->days_output = date('d') - $this->days_input;\n }", "function sumDayToDate($date,$days){\n\t$date = date_create($date);\n\tdate_add($date, date_interval_create_from_date_string($days));\n\t\n\treturn date_format($date, 'Y-m-d H:i:s');\n}", "function toDays( $day=0, $month=0, $year=0) {\n\t\tif (!$day) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$day = $this->day;\n\t\t\t} else {\n\t\t\t\t$day = date( \"d\" );\n\t\t\t}\n\t\t}\n\t\tif (!$month) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$month = $this->month;\n\t\t\t} else {\n\t\t\t\t$month = date( \"m\" );\n\t\t\t}\n\t\t}\n\t\tif (!$year) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$year = $this->year;\n\t\t\t} else {\n\t\t\t\t$year = date( \"Y\" );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$century = floor( $year / 100 );\n\t\t$year = $year % 100;\n\t\t\n\t\tif($month > 2) {\n\t\t\t$month -= 3;\n\t\t} else {\n\t\t\t$month += 9;\n\t\t\tif ($year) {\n\t\t\t\t$year--;\n\t\t\t} else {\n\t\t\t\t$year = 99;\n\t\t\t\t$century --;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ( floor( (146097 * $century) / 4 ) +\n\t\tfloor( (1461 * $year) / 4 ) +\n\t\tfloor( (153 * $month + 2) / 5 ) +\n\t\t$day + 1721119\n\t\t);\n\t}", "function dias_transcurridos($fecha_i,$fecha_f)\n{\n\t$dias\t= (strtotime($fecha_i)-strtotime($fecha_f))/86400;\n\t$dias \t= abs($dias); $dias = floor($dias);\t\t\n\treturn $dias;\n}", "protected function secondsToTime($seconds) {\n $dtF = new \\DateTime(\"@0\");\n $dtT = new \\DateTime(\"@$seconds\");\n return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');\n }", "protected function _secondsToTime($seconds) {\n\t\t\t$dtF = new DateTime(\"@0\");\n\t\t\t$dtT = new DateTime(\"@$seconds\");\n\t\t\t$msgid = '%a days, %h hours, %i minutes and %s seconds';\n\t\t\treturn $dtF->diff($dtT)->format( __( $msgid ) );\n\t\t}", "public function setDays($days) {\r\n\t\t$this->days = $days;\r\n\t}", "private function getDayDate($day)\n {\n $day = intval($day);\n $y = $this->year;\n $m = intval($this->month);\n $m = $m < 10 ? '0' . $m : $m;\n $d = intval($day);\n $d = $d < 10 ? '0' . $d : $d;\n $date = $y . '-' . $m . '-' . $d;\n return $date;\n }", "function addDays ($days) {\n return date('Y-m-d', strtotime(\"+\" . $days . \" days\"));\n }", "function unix_to_jd($t) {\n\t\treturn ( UNIX_EPOCH + t / SECS_IN_DAY);\n\t}", "function dateDiffInDays($date11, $date22) \n {\n $diff = strtotime($date22) - strtotime($date11); \n \n // 1 day = 24 hours \n // 24 * 60 * 60 = 86400 seconds \n return abs(round($diff / 86400)); \n }", "function dateDiffInDays($date11, $date22) \n {\n $diff = strtotime($date22) - strtotime($date11); \n \n // 1 day = 24 hours \n // 24 * 60 * 60 = 86400 seconds \n return abs(round($diff / 86400)); \n }", "function hms2sec ($hms) {\n\tlist($h, $m, $s) = explode (\":\", $hms);\n\t$seconds = 0;\n\t$seconds += (intval($h) * 3600);\n\t$seconds += (intval($m) * 60);\n\t$seconds += (intval($s));\n\treturn $seconds;\n}", "function jd_to_unix($jd) {\n\t\t$val=(($jd-UNIX_EPOCH) * SECS_IN_DAY * 1000);\n\t\treturn ( round($val/1000) ) ;\n\t}", "public static function days(int $days)\n {\n $endDate = Carbon::now();\n $startDate = Carbon::today()->subDays($days)->startofDay();\n return new static($startDate, $endDate, $days);\n }", "function diasvenc($fechamov,$diascred){\n\t\t$a=ceil((time() - (strtotime($fechamov)))/(60* 60*24))-$diascred;\n\t\t//if($a>0){$amod=$a;}else{$amod=0;}\n\t\t$amod = ($a < 0 ? 0 : $a);\n\t\treturn $amod;\n\t}", "function getdays($date1,$date2)\r\n {\r\n return round((strtotime($date2)-strtotime($date1))/(24*60*60),0);\r\n }", "protected function toSeconds(DateInterval $diff)\n {\n if ($diff->m > 0 || $diff->y > 0) {\n throw new Exception('I don\\'t handle reminders larger than a month.');\n }\n $seconds = $diff->d * 86400\n + $diff->h * 3600\n + $diff->i * 60\n + $diff->s;\n return $seconds;\n }", "function convertMonths($months){\n\t\treturn $seconds = $months * 2635200; // Seconds for 30.5 days\n\t}", "function format($seconds) {\r\n\t$days = floor($seconds / 86400);\r\n\tif ($days > 0) {\r\n\t\t$seconds -= $days * 86400;\r\n\t}\r\n\t$hours = floor($seconds / 3600);\r\n\tif ($days > 0 || $hours > 0) {\r\n\t\t$seconds -= $hours * 3600;\r\n\t}\r\n\t$minutes = floor($seconds / 60);\r\n\tif ($days > 0 || $hours > 0 || $minutes > 0) {\r\n\t\t$seconds -= $minutes * 60;\r\n\t}\r\n\tif ($hours < 10) $hours = '0'. $hours;\r\n\tif ($minutes < 10) $minutes = '0'.$minutes;\r\n\tif ($seconds < 10) $seconds = '0'.$seconds;\r\n\tif ($days > 0) {\r\n\t\treturn sprintf('%sj %sh %sm %ss', (string)$days, (string)$hours, (string)$minutes, (string)$seconds);\r\n\t} elseif ($hours > 0) {\r\n\t\treturn sprintf('%sh %sm %ss', (string)$hours, (string)$minutes, (string)$seconds);\r\n\t} elseif ($minutes > 0) {\r\n\t\treturn sprintf('%sm %ss', (string)$minutes, (string)$seconds);\r\n\t} else {\r\n\t\treturn sprintf('%ss', (string)$seconds);\r\n\t}\r\n}", "function getTotalDays();", "function num_to_days($array){\n foreach ($array as $key => $value){\n $array[$key] = date('D', strtotime(\"Sunday +{$value} days\"));\n }\n return $array;\n }", "function somarDatas($data,$dias){\n\t$data_final = date('Y-m-d', strtotime(\"$dias days\",strtotime($data)));\t\n\treturn $data_final;\n\t\n}", "public static function getDaySecondsOfDateTime(\\DateTimeInterface $dateTime): int\n {\n $hours = (int)$dateTime->format('G');\n $minutes = $hours * self::SECONDS_MINUTE + (int)$dateTime->format('i');\n\n return $minutes * self::SECONDS_MINUTE + (int)$dateTime->format('s');\n }", "function addDayswithdate($date,$days){\n $date = new DateTime($date);\n $date->add(new DateInterval('P'.$days.'D'));\n return $date->format('Y-m-d');\n }", "function date_day($date_or_day,$lang='en') {\n\t\tif(!is_string($date_or_day) OR !is_numeric($date_or_day)) {\n\t\t\t//convert date to days difference\n\t\t}\n\t\tif($date_or_day == 0) {\n\t\t\treturn ($lang=='en')? \"today\" : \"hoy\";\n\t\t} elseif($date_or_day == -1) {\n\t\t\treturn ($lang=='en')? \"yesterday\" : \"ayer\";\n\t\t} elseif($date_or_day == 1) {\n\t\t\treturn ($lang=='en')? \"tomorrow\" : \"mañana\";\n\t\t} elseif($date_or_day < 0) {\n\t\t\tif($lang=='en') {\n\t\t\t\treturn abs($date_or_day).\" days ago\";\n\t\t\t} else {\n\t\t\t\treturn \"hace \".abs($date_or_day).\" días\";\n\t\t\t}\n\t\t} else {\n\t\t\tif($lang=='en') {\n\t\t\t\treturn \"in \".$date_or_day.\" days\";\n\t\t\t} else {\n\t\t\t\treturn \"en \".$date_or_day.\" días\";\n\t\t\t}\n\t\t}\n\t}", "function date2jd()\n{\n\t@list($y,$m,$d,$h,$i,$s) = func_get_args();\n\n\tif( $m < 3.0 ) {\n\t\t$y -= 1.0;\n\t\t$m += 12.0;\n\t}\n\n\t$jd = (int)( 365.25 * $y );\n\t$jd += (int)( $y / 400.0 );\n\t$jd -= (int)( $y / 100.0 );\n\t$jd += (int)( 30.59 * ( $m-2.0 ) );\n\t$jd += 1721088;\n\t$jd += $d;\n\n\t$t = $s / 3600.0;\n\t$t += $i /60.0;\n\t$t += $h;\n\t$t = $t / 24.0;\n\n\t$jd += $t;\n\treturn( $jd );\n}", "function diffInDays ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\t$dayInSecs = 60 * 60 * 24;\n\t\treturn ($diff/$dayInSecs);\n\t}", "function convert_seconds_to_dhms($sec, $showhoursonly = false) {\n\tif (!is_numericint($sec)) {\n\t\treturn '-';\n\t}\n\t// FIXME: When we move to PHP 7 we can use \"intdiv($sec % X, Y)\" etc\n\tlist($d, $h, $m, $s) = array(\t(int)($showhoursonly ? 0 : $sec/86400),\n\t\t\t\t\t(int)(($showhoursonly ? $sec : $sec % 86400)/3600),\n\t\t\t\t\t(int)(($sec % 3600)/60),\n\t\t\t\t\t$sec % 60\n\t\t\t\t);\n\treturn ($d > 0 ? $d . 'd ' : '') . sprintf('%02d:%02d:%02d', $h, $m, $s);\n}", "private function days_to_years( $days ) {\n\t\treturn floor( $days / 365 );\n\t}", "function convertSecond2Time($seconds, $formatTime = 'H:i:s')\n {\n $result = date($formatTime, mktime(0, 0, $seconds));\n return $result;\n }", "function dateDiffDay ($d1, $d2) {\n// Return the number of days between the two dates:\n\n return round(abs(strtotime($d1)-strtotime($d2))/(DAY_VAL));\n\n}", "function getIdDay($Day){\n switch ($Day) {\n case 'Sat':\n return 1;\n break;\n case 'Sun':\n return 2;\n break;\n case 'Mon':\n return 3;\n break;\n case 'Tue':\n return 4;\n break;\n case 'Wed':\n return 5;\n break;\n case 'Thu':\n return 6;\n break;\n case 'Fri':\n return 7;\n break;\n }\n}", "function GetDiffDays($dt1, $dt2){\n \n list($dia1, $mes1, $anio1) = explode( '/', $dt1); \n list($dia2, $mes2, $anio2) = explode( '/', $dt2);\n \n //calculo timestam de las dos fechas \n $timestamp1 = mktime(0,0,0,$mes1,$dia1,$anio1); \n $timestamp2 = mktime(4,12,0,$mes2,$dia2,$anio2); \n\n //resto a una fecha la otra \n $segundos_diferencia = $timestamp1 - $timestamp2; \n //echo $segundos_diferencia; \n\n //convierto segundos en días \n $dias_diferencia = $segundos_diferencia / (60 * 60 * 24); \n\n //obtengo el valor absoulto de los días (quito el posible signo negativo) \n $dias_diferencia = abs($dias_diferencia); \n\n //quito los decimales a los días de diferencia \n $dias_diferencia = floor($dias_diferencia); \n\n return $dias_diferencia; \n}", "private function datetime2second($date)\n {\n return intval($date->format('G'))*3600+intval($date->format('i'))*60+intval($date->format('s'));\n }", "function SecondsToEnglishString($Seconds)\n {\n $Second = $Seconds % 60;\n $Minute = ($Seconds - $Second) / 60 % 60;\n $Hour = (($Seconds - $Second) / 60 / 60) % 24;\n $Day = (($Seconds - $Second) / 60 / 60 / 24) % 7;\n $Week = floor(($Seconds - $Second) / 60 / 60 / 24 / 7);\n\n $Array = [];\n\n # Week\n if ($Week > 1)\n {\n $Array[] = $Week . ' weeks';\n }\n else if ($Week > 0)\n {\n $Array[] = $Week . ' week';\n }\n\n # Day\n if ($Day > 1)\n {\n $Array[] = $Day . ' days';\n }\n else if ($Day > 0)\n {\n $Array[] = $Day . ' day';\n }\n\n # Hour\n if ($Hour > 1)\n {\n $Array[] = $Hour . ' hours';\n }\n else if ($Hour > 0)\n {\n $Array[] = $Hour . ' hour';\n }\n\n # Minute\n if ($Minute > 1)\n {\n $Array[] = $Minute . ' minutes';\n }\n else if ($Minute > 0)\n {\n $Array[] = $Minute . ' minute';\n }\n\n # Second\n if ($Second > 1)\n {\n $Array[] = $Second . ' seconds';\n }\n else if ($Second > 0)\n {\n $Array[] = $Second . ' second';\n }\n\n $String = implode(', ', $Array);\n $String = preg_replace('/, ([^,]+)$/', ' and $1', $String);\n\n return $String;\n }", "function DayDiff($StartDate, $StopDate)\n{\n // to the approriate days using 86400 seconds for a day\n //\n return (date('U', strtotime($StopDate)) - date('U', strtotime($StartDate))) / 86400; //seconds a day\n}", "function getDays($start,$end) {\n return (int)((strtotime($start) - strtotime($end))/(60*60*24*30.44*12));\n }", "function fechaDesdeUnix($fecha){\n\t$fecha2 = date('Y-m-d H:i:s', $fecha);\n\treturn $fecha2;\n}", "static function restaFechas($dFecIni, $dFecFin) {\n //86400 es el numero de segundos que hay en 1 dia\n return (strtotime($dFecFin) - strtotime($dFecIni)) / 86400;\n }", "public function addDays(int $days)\n {\n $time = clone $this;\n\n return $time->add(DateInterval::createFromDateString(\"{$days} days\"));\n }", "public function toSeconds($time) {\n \treturn intval($time / 1000) % 60;\n }", "public static function countDays($range) {\n return round(self::countSeconds($range) / self::DAY);\n}", "function deg2dec($deg,$min,$sec){\n\treturn frac($deg)+(frac($min)/60)+(frac($sec)/3600);\n}", "public function __construct($days = 1)\n {\n $this->days = $days;\n }", "function dateDiffInDays($date1, $date2) \n\t{\n\t\t$diff = strtotime($date2) - strtotime($date1); \n\t\t \n\t\t// 1 day = 24 hours \n\t\t// 24 * 60 * 60 = 86400 seconds \n\t\treturn abs(round($diff / 86400)); \n\t}", "function period2seconds($period_name,$span) {\n\tif (!$period_name || $period_name==\"lifespan\") {\n\t\treturn \"\";\n\t}\n\n\tif (!is_int ($span) || !$span) $span=1;\n\n\tif ($period_name==\"day\") {\n\t\treturn 60*60*24*$span;\n\t} elseif ($period_name==\"week\") {\n\t\treturn 60*60*24*7*$span;\n\t} elseif ($period_name==\"month\") {\n\t\treturn 60*60*24*30*$span;\n\t} elseif ($period_name==\"year\") {\n\t\treturn 60*60*24*365*$span;\n\t} else {\n\t\treturn $span;\n\t}\n}", "public function addDays($days){\n\t\t$this->_timestamp = self::_add($this->_timestamp, self::_mul($days, 86400));\n\t\t$this->_setDate();\n\t\treturn $this->_date;\n\t}", "public static function days( $time )\n\t{\n\t\treturn self::hours( $time ) * 24;\n\t}", "function DateTimeToInt ($s) {\n\tGlobal $iTimeType;\n\t\n\t$y = (int)substr($s, 0, 4);\t\t// year\n\t$m = (int)substr($s, 4, 2);\t\t// month\n\t$d = (int)substr($s, 6, 2);\t\t// day\n\t$h = (int)substr($s, 8, 2);\t\t// hour\n\t$n = (int)substr($s,10, 2);\t\t// minute\n\t\n\tif ($m < 1) $m = 1;\n\tif (12 < $m) $m = 12;\n\tif ($d < 1) $d = 1;\n\tif (31 < $d) $d = 31;\n\tif ($h < 0) $h = 0;\n\tif (23 < $h) $h = 23;\n\tif ($n < 0) $n = 0;\n\tif (59 < $n) $n = 59;\n\t\n\tif ($iTimeType == 1) {\n\t\t$z = (int)substr($s,12, 2);\t// second\n\t\tif ($y < 1970) $y = 1970;\n\t\tif (2037 < $y) $y = 2037;\n\t\tif ($z < 0) $z = 0;\n\t\tif (59 < $z) $z = 59;\n\t\treturn mktime($h,$n,$z,$m,$d,$y);\n\t}\n\t\n\t$y -= 2000;\n\tif ($y < 0) $y = 0;\n\tif (213 < $y) $y = 213;\n\treturn ($y*10000000)+((50+$m*50+$d)*10000) + ($h*100) + $n;\t// 3+3+2+2\n}", "function fixday($s,$i){\n\treturn $n = mktime(0,0,0,date(\"m\",$s) ,date(\"d\",$s)+$i,date(\"Y\",$s));\n}", "function getTimeFromSeconds($seconds = '') {\n\n\t\t$hours = floor($seconds / 3600);\n\t\t$mins = floor($seconds / 60 % 60);\n\t\t$secs = floor($seconds % 60);\n\n\t\t$timeFormat = sprintf('%02d:%02d:%02d', $hours, $mins, $secs);\n\n\t\treturn $timeFormat;\n\t}", "function dayToNumber(string $day): int\n {\n $day = strtolower($day);\n switch($day)\n {\n case 'monday':\n return 1;\n break;\n \n case 'tuesday':\n return 2;\n break;\n\n case 'wednesday':\n return 3;\n break;\n\n case 'thursday':\n return 4;\n break;\n\n case 'friday':\n return 5;\n break;\n\n case 'saturday':\n return 6;\n break;\n\n case 'sunday':\n return 7;\n break;\n }\n }", "function convTimeToSeconds($Time){\n#DEBUG\tvar_dump($Time);\n\t$rc = strpos($Time, \".\");\n\tif ($rc == false){\n\t\t$newstring = $Time;\n\t}else{\n\t\t$newstring = substr($Time, 0, $rc);\n\t}\n\t$tarray = explode(\":\", $newstring);\n\tif(count($tarray) > 3 || count($tarray) < 2){\n\t\tprint \"Error on string conversion: \".$newstring.\"\\n\";\n\t\treturn -1;\n\t}\n\tif(count($tarray) == 3){\n\t\t$seconds = $tarray[0]*3600 + $tarray[1]*60 + $tarray[2];\n\t\treturn $seconds;\n\t}\n\tif(count($tarray) == 2){\n\t\t$seconds = $tarray[0]*60 + $tarray[1];\n\t\treturn $seconds;\n\t}\n}", "public static function offsetSec2His( $seconds ) {\n static $FMT = '%02d';\n switch( substr( $seconds, 0, 1 )) {\n case util::$MINUS :\n $output = util::$MINUS;\n $seconds = substr( $seconds, 1 );\n break;\n case util::$PLUS :\n $output = util::$PLUS;\n $seconds = substr( $seconds, 1 );\n break;\n default :\n $output = util::$PLUS;\n break;\n }\n $output .= sprintf( $FMT, ((int) floor( $seconds / 3600 ))); // hour\n $seconds = $seconds % 3600;\n $output .= sprintf( $FMT, ((int) floor( $seconds / 60 ))); // min\n $seconds = $seconds % 60;\n if( 0 < $seconds )\n $output .= sprintf( $FMT, $seconds ); // sec\n return $output;\n }", "function get_time_description($seconds)\r\n{\r\n $weeks = (int) ($seconds / 604800);\r\n $weeks_p = $weeks > 1 ? 'weeks' : 'week';\r\n $days=(int)($seconds/86400);\r\n $days_p = $days > 1 ? 'days' : 'day';\r\n $hours = (int)(($seconds-($days*86400))/3600);\r\n $mins = (int)(($seconds-$days*86400-$hours*3600)/60);\r\n $secs = (int)($seconds - ($days*86400)-($hours*3600)-($mins*60));\r\n\r\n //build a string\r\n $ret = \"$secs sec\";\r\n if ($mins > 0 && $sec >= 0)\r\n $ret = \"$mins min $ret\";\r\n if ($hours > 0 && $min >= 0 && sec >=0)\r\n $ret = \"$hours hours $ret\";\r\n if ($days > 0 && $hours >= 0 && $min >= 0 && sec >= 0)\r\n $ret = \"$days $days_p $ret\";\r\n\r\n return $ret;\r\n}", "function getDays($selDay=\"\"){\n\t\t$strDays = \"\";\n\t\t$strDays = \"<option value=''>00</option>\";\n\t\tfor($ind=1;$ind<=31;$ind++){\n\t\t\tif($ind == $selDay)\n\t\t\t\t$strSel = \"selected\";\n\t\t\telse\n\t\t\t\t$strSel = \"\";\n\t\t\t\t\n\t\t\t$strDays.=\"<option value=\".$ind.\" $strSel>\".(strlen($ind)==1?\"0\".$ind:$ind).\"</option>\";\n\t\t}\n\t\t\n\t\treturn $strDays;\n\t}", "protected function getDay(string $day) {\n return $day;\n }", "public function ntc_seconds($input) {\n $this->seconds_input = substr(-5, 2);\n return $this->seconds_output = date('s') - $this->seconds_input;\n }", "public static function millisToDaypartsArray(int $millis): array {\r\n\r\n $millis = abs($millis);\r\n $seconds = $millis / 1000;\r\n\r\n return [\r\n 'days' => (int) floor($seconds / 86400),\r\n 'hours' => (int) floor(($seconds % 86400) / 3600),\r\n 'minutes' => (int) floor((($seconds % 86400) % 3600) / 60),\r\n 'seconds' => (int) floor((($seconds % 86400) % 3600) % 60),\r\n 'millis' => (int) floor(((($millis % 86400000) % 3600000) % 60000) % 1000),\r\n ];\r\n }", "public static function millisToDaypartsString(int $millis): string {\r\n\r\n $dayparts = self::millisToDaypartsArray($millis);\r\n\r\n $string = '';\r\n if ($dayparts['days'] > 0) {\r\n $string .= \"{$dayparts['days']}d \";\r\n }\r\n if ($dayparts['hours'] > 0) {\r\n $string .= \"{$dayparts['hours']}h \";\r\n }\r\n if ($dayparts['minutes'] > 0) {\r\n $string .= \"{$dayparts['minutes']}m \";\r\n }\r\n if ($dayparts['seconds'] > 0 || $dayparts['millis'] > 0) {\r\n $shortMillis = sprintf('%03d', $dayparts['millis']);\r\n $string .= \"{$dayparts['seconds']}.{$shortMillis}s \";\r\n }\r\n\r\n return trim($string);\r\n }", "function diffInSeconds ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\treturn $diff;\n\t}", "public static function timeElapsedInDays($time){\n $date_time = date_create($time);\n $diff = time() - $date_time->format('U');\n return floor($diff/ (60*60*24));\n }", "public static function smartDaysAgo($days) {\n\t\t$r = '';\n\t\tif($days == 1) {\n\t\t\t$r .= 'yesterday';\n\t\t} else {\n\t\t\t$r .= qstr::smartPlural($days, 'days') . ' ago';\n\t\t}\n\t\treturn $r;\n\t}", "static public function intervalToSeconds($interval)\n\t{\n\t\tif ( (string) (int) $interval === (string) $interval)\n\t\t{\n\t\t\t// It's already an integer... \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$intervals = array(\n\t\t\t\t'second' => 1, \n\t\t\t\t'minute' => 60, \n\t\t\t\t'hour' => 60 * 60, \n\t\t\t\t'day' => 60 * 60 * 24, \n\t\t\t\t'week' => 60 * 60 * 24 * 7, \n\t\t\t\t'month' => 60 * 60 * 24 * 30, \n\t\t\t\t'year' => 60 * 60 * 24 * 365,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t$interval = strtolower(trim($interval));\n\t\t\t\t\n\t\t\t$justletters = true;\n\t\t\t$count = strlen($interval);\n\t\t\tfor ($i = 0; $i < $count; $i++)\n\t\t\t{\n\t\t\t\tif (ord($interval{$i}) < 97 or ord($interval{$i}) > 122)\n\t\t\t\t{\n\t\t\t\t\t$justletters = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\tif ($justletters)\n\t\t\t{\n\t\t\t\t$interval = '1 ' . $interval;\n\t\t\t}\n\t\t\t\t\n\t\t\tforeach ($intervals as $str => $multiplier)\n\t\t\t{\n\t\t\t\tif (false !== strpos($interval, ' ' . $str))\n\t\t\t\t{\n\t\t\t\t\t$interval = ((int) $interval) * $multiplier;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If it's not an integer yet, cast it!\n\t\treturn (int) $interval;\n\t}", "public function getDayOrdinal()\r\n\t{\r\n\t\treturn $this->format('jS');\r\n\t}", "public function addDays($day, $format = self::datePattern) {\r\n $date = new DateTime($this->parmDate());\r\n if($day < 0)\r\n {\r\n $date->sub(new DateInterval(\"P\".abs($day).\"D\"));\r\n }\r\n else\r\n {\r\n $date->add(new DateInterval(\"P\".$day.\"D\"));\r\n }\r\n return $date->format($format); \r\n }", "public function getDays() {\r\n\t\treturn $this->days;\r\n\t}", "public function getDay() : int \n {\n return $this->day;\n }", "public function setDays(array $days)\n\t{\n\t\t$this->days = $days;\n\t}", "function dow($d) {\n\treturn date('D', strtotime(\"Sunday +{$d} days\"));\n}", "public function getSecondsAsTextExtended($seconds)\n {\n $seconds = floatval($seconds);\n $result = [];\n\n $steps = [\n 'days' => 86400,\n 'hours' => 3600,\n 'minutes' => 60,\n 'seconds' => 1,\n ];\n\n foreach ($steps as $stepName => $stepDivider) {\n $stepCount = floor($seconds / $stepDivider);\n if (0 < $stepCount) {\n $result[] = sprintf('%d %s', $stepCount, $this->getTranslator()->transChoice($stepName, $stepCount));\n $seconds = $seconds - ($stepCount * $stepDivider);\n }\n }\n\n return implode(' ', $result);\n }" ]
[ "0.83918726", "0.6851078", "0.6806338", "0.6575244", "0.6513164", "0.64557457", "0.6365059", "0.63537365", "0.6241212", "0.61108685", "0.59729165", "0.5959296", "0.58203626", "0.5819785", "0.5805486", "0.580538", "0.574473", "0.57312465", "0.57231075", "0.57030773", "0.56107116", "0.5566459", "0.5565524", "0.5552438", "0.55147785", "0.54453105", "0.5430094", "0.54177135", "0.5413946", "0.5398566", "0.53984535", "0.53821564", "0.5381672", "0.53805983", "0.5372596", "0.5366519", "0.53642887", "0.535389", "0.53509974", "0.53509974", "0.53444374", "0.5333441", "0.5305102", "0.52927095", "0.52773696", "0.52770895", "0.5262251", "0.5261565", "0.52356964", "0.522842", "0.5225689", "0.52176374", "0.5168604", "0.5166687", "0.5160152", "0.5144512", "0.51435256", "0.5134727", "0.513106", "0.5122835", "0.51183796", "0.50945556", "0.5093092", "0.50755954", "0.5068986", "0.5066978", "0.5059001", "0.5052586", "0.5043934", "0.50432014", "0.50346637", "0.50321585", "0.50313866", "0.5021013", "0.50121915", "0.500726", "0.50051117", "0.49949238", "0.4969168", "0.49656522", "0.49540022", "0.49428552", "0.49402204", "0.49255234", "0.49219245", "0.49208847", "0.4918211", "0.4916892", "0.49147084", "0.4910019", "0.4903262", "0.4899744", "0.48993218", "0.489347", "0.48920852", "0.48897365", "0.48897132", "0.48762354", "0.48621088", "0.48509" ]
0.6288069
8
TODO: Add support for starting multiple downloads at the same time, like the upload feature in the WebInterface of Transmission Check RPC api or WebInterface code TODO: This should execute in a transaction block make all methods not doing flush, commits
public function startDownload(Torrent $torrent, $isFromFile = false) { // Ensure transmission has the right configuration (cache this to not call every time) if (!$this->transmissionConfigured) { $this->configureTransmission(); $this->transmissionConfigured = true; } $magnetLink = $torrent->getMagnetLink(); $filenameParameter = $magnetLink; if ($isFromFile) { $filenameParameter = $torrent->getTorrentFileLink(); } if ($filenameParameter == null || strlen($filenameParameter) == 0) { $message = "Provided torrent magnet link or file is null or blank: $filenameParameter"; $this->transmissionLogger->error($message); throw new \Exception($message, 400, null); } // Add the torrent $requestPayload = array( "method" => "torrent-add", "arguments" => array("paused" => false, "filename" => $filenameParameter) ); $jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES); $this->transmissionLogger->debug("[TRANSMISSION-TORRENT-ADD] The payload to send to transmission API is $jsonRequest"); try { $result = $this->executeTransmissionApiCall($jsonRequest); // Need to do this to be able to access the property with PHP -> operator $result = str_replace("torrent-added", "torrentadded", json_encode($result)); $resultAsArray = json_decode($result); if (strpos($resultAsArray->result, "duplicate") !== false) { $this->logger->debug("[START-DOWNLOAD] Duplicated torrent: " . $torrent->getTitle() . ", skipping it"); //TODO: it can be started / retrieved if needed using the id provided in the response $this->torrentService->delete($torrent); } else { $this->logger->debug("[START-DOWNLOAD] Successful call to Transmission -- torrent added: " . $torrent->getTitle()); $torrentInfo = $resultAsArray->arguments->torrentadded; $nameAdded = str_replace('+', '.', $torrentInfo->name); $nameAdded = str_replace(' ', '.', $nameAdded); $transmissionId = $torrentInfo->id; $hash = $torrentInfo->hashString; //TODO: Get also torrent seeds and size if not present $existingTorrent = $this->torrentService->findTorrentByHash($hash); if ($existingTorrent !== null) { $torrent = $existingTorrent; $this->logger->info("[STARTING-DOWNLOAD] Found torrent already in DB with the hash $hash -- " . $existingTorrent->getTorrentName()); } $torrent->setHash($hash); $torrent->setTransmissionId($transmissionId); $torrent->setDateStarted(new \DateTime()); if ($torrent->getTorrentName() == null) { $torrent->setTorrentName($nameAdded); } if ($torrent->getTitle() === "Unknown" || $torrent->getTitle() == null) { $torrent->setTitle($nameAdded); } $torrent->setTitle($this->torrentService->clearSpecialChars($torrent->getTitle())); $torrent->setTorrentName($this->torrentService->clearSpecialChars($torrent->getTorrentName())); // Relocate based on hash $newLocation = $this->relocateTorrent($torrent->getTorrentName(), $hash); $torrent->setFilePath($newLocation); $this->createOrUpdateTorrentData($torrent, TorrentState::DOWNLOADING); } } catch (\Exception $e) { $this->logger->error("[START-DOWNLOAD] Could not start downloading torrent, marking torrent as FAILED_DOWNLOAD -- " .$torrent->getTitle() . " - " . $e->getMessage()); $this->createOrUpdateTorrentData($torrent,TorrentState::FAILED_DOWNLOAD_ATTEMPT); } return $torrent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function download() {\t\t}", "public function download()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\tif($this->auth_requirement != 0)\n\t\t{\n\t\t\tif($sfUsers::translateAuthLevelString($sfUsers::getUserAuthLevel()) < $this->auth_requirement)\n\t\t\t{\n\t\t\t\tthrow new sfAuthorizationException();\n\t\t\t}\n\t\t}\n\n\t\t$update = sfCore::db->query(\"UPDATE `swoosh_file_storage` SET `downloads` = `downloads`+1 WHERE `id` = '%i' LIMIT 1;\",\n\t\t\t$this->id);\n\t\tfSession::close();\n\t\t$this->fFile->output(true, true);\n\t}", "public function postProcessDownload()\n {\n }", "public function downloadAction() {}", "public function start() {\t\t$resumeFromBytes = $this->resumeFrom();\n\t\tif($resumeFromBytes == false) { // create new temporary file\n\t\t\t$this->fileHandle = $this->tmpFileIn($this->getBaseDirectory(), \"xb\");\n\t\t\tif($this->fileHandle == false) {\n\t\t\t\tthrow new RuntimeException(\"Could not create temporary download file\");\n\t\t\t}\n\t\t} else { // reuse old temporary file\n\t\t\t// beware: server may not support resuming\n\t\t\t// use hasCorrectSize() to check a finished download after resuming\n\t\t\t$this->fileHandle = $this->tmpFileIn($this->getBaseDirectory(), \"ab\");\n\t\t\tif($this->fileHandle == false) {\n\t\t\t\tthrow new RuntimeException(\"Could not open temporary download file for writing\");\n\t\t\t}\n\t\t}\n\t\t// set up and call cURL\n\t\t$curl = curl_init($this->getURL());\n\t\tcurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);\n\t\tcurl_setopt($curl, CURLOPT_FILE, $this->fileHandle);\n\t\tif($resumeFromBytes != false) {\n\t\t\tcurl_setopt($curl, CURLOPT_RANGE, $resumeFromBytes . \"-\");\n\t\t}\n\t\tcurl_setopt($curl, CURLOPT_HEADER, false);\n\t\tcurl_setopt($curl, CURLOPT_NOPROGRESS, false);\n\t\tcurl_setopt($curl, CURLOPT_PROGRESSFUNCTION, \"Download::setProgress\");\n\t\t$response = curl_exec($curl);\n\t\t/*\n\t\t * Would be nice to have that, but the current cURL API in PHP does not\n\t\t * allow this to be implemented in a proper way due to the fact that\n\t\t * the HTTP request header cannot be retrieved seperatly from the data.\n\t\t * Stripping the header from the data while writing if using\n\t\t * CURLOPT_WRITEFUNCTION also isn't possible, as this would require the\n\t\t * header size to be available when writing, but curl_getinfo does not\n\t\t * report the corret value when the download has not finished yet.\n\t\t *\n\t\t * So just use the URL path basename as the filename.\n\t\t *\n\t\t// try to extract the filename from the HTTP header \n\t\t$this->requestHeaderSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\n\t\t$this->requestHeader = substr($response, 0, $this->requestHeaderSize);\n\t\techo \"header: \" . $this->requestHeader . \"\\n\";\n\t\t$filename = null;\n\t\tif(preg_match(\"/^Content-Disposition: attachment; filename=(.+)$/\", $this->requestHeader, $matches)) {\n\t\t\t$filename = $matches[0];\n\t\t} else { // fall back to the URL path basename\n\t\t\t$filename = basename($this->getURL());\n\t\t}\n\t\t*/\n\t\t$filename = basename($this->getURL());\n\t\tcurl_close($curl);\n\t\t// rename the temporary file\n\t\t$metadata = stream_get_meta_data($this->fileHandle);\n\t\tfclose($this->fileHandle);\n\t\trename($metadata['uri'], $this->getDownloadDirectoryIn($this->getBaseDirectory()) . \"/\" . $filename);\n\t}", "public function InitiateDownload()\n\t{\n\t\t//Register the download\n\t\t$pdo = new Database();\n\t\t$statement = $pdo->prepare('INSERT INTO download_log SET DownloadID=?');\n\t\t$statement->bindParam(1, $this->ID);\n\t\t$statement->execute();\n\n\t\tif (preg_match('/http(s{0,1}):\\/\\/(.*)/', $this->Link))\n\t\t{\n\t\t\theader('location: ' . $this->Link);\n\t\t}\n\t\telse if (substr($this->Link, 0, 1) == '?')\n\t\t{\n\t\t\t//Get a name to call the file.\n\t\t\t$filePath = dirname(__FILE__) . '/../downloads/' . substr($this->Link, 1);\n\t\t\t$pathInfo = pathinfo($filePath);\n\t\t\t$downloadName = empty($pathInfo['extension']) ?\n\t\t\t\t$this->Name : sprintf('%s.%s', $this->Name, $pathInfo['extension']);\n\n\t\t\t//Transfer the file.\n\t\t\t$stream = fopen($filePath, 'rb');\n\t\t\tDownload::TransferDownload($stream, $downloadName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Unknown download link');\n\t\t}\n\t}", "public function startDownload() {\n if (!isset($this->destPath)) {\n throw new SFException( 'No destination path. Use setDestinationPath()', ERR_REPORT_APP );\n }\n\n $this->callMethod( 'startDownload', array( $this->destPath, ($this->data == NULL)) );\n }", "public function startDownload()\n {\n // use RabbitMQ for send queue.\n $this->channel->queue_declare('downloader', 'fanout', false, false, false);\n\n $callback = function($msg) {\n echo \" [x] Received \", $msg->body, \"\\n\";\n sleep(1);\n\n // print_r($msg::get_properties());\n\n\n $id = new ImageDownloader($msg);\n try\n {\n $queue = $id->download();\n }\n catch (\\Exception $e)\n {\n $queue = new Queue($msg->body);\n $queue->setStatus(Queue::FAILED);\n }\n\n\n // exchange w messenger for save status.\n $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);\n };\n\n $this->channel->basic_qos(null, 1, null);\n $this->channel->basic_consume('downloader', '', false, true, false, false, $callback);\n\n while(count($this->channel->callbacks)) {\n $this->channel->wait();\n }\n\n // return $queue;\n }", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "public function startDownload() {\n if (empty($this->url) || empty($this->destPath)) {\n throw new SFException('No URL or path given. Use setPaths()', ERR_REPORT_APP);\n }\n\n $this->callMethod('startDownload', array($this->destPath, $this->url));\n }", "public function download() {\n\n $this->loginToWigle();\n $query = $this->downloadQueue->getRandomNotDownloadedRecord();\n if(!$query) {\n return;\n }\n $id_download_request = $query->id_download_request;\n $coords = new Coords($query['lat_start'],$query['lat_end'],$query['lon_start'],$query['lon_end']);\n $results = $this->getDataFromWigle($coords, (int) $query[\"from\"]);\n $results_decoded = json_decode($results,true);\n if($results_decoded[\"success\"] == true) {\n\n // rozparsovat data\n $data = $this->parseData($results_decoded);\n $mac_addresses = array();\n // vybrat vsechny mac adresy a body nastavit jako hrube\n foreach($data as $w) {\n $mac_addresses[] = $w->getMac();\n $w->setCalculated(1);\n }\n\n // ulozit mac adresy k dalsimu zpracovani\n $this->saveAll2WigleAps($query['id'],$mac_addresses);\n // ulozit vypoctene body\n $this->saveAll($data);\n\n // transakcne vlozime\n $this->database->beginTransaction();\n $query->update(array(\n \"downloaded\"=>1,\n \"downloaded_nets_count\"=>count($mac_addresses),\n \"count_downloaded_observations\"=>0,\n ));\n\n if((int)$results_decoded[\"resultCount\"] >= self::WIGLE_MAXIMUM_ROWS) {\n $this->downloadQueue->addRecord($coords, 0, $id_download_request, (int)$results_decoded[\"last\"]);\n $this->database->table('download_request')\n ->where('id',$id_download_request)\n ->update(array('total_count'=>new SqlLiteral('total_count + 1')));\n }\n $this->database->commit();\n }\n else {\n $this->logger->addLog(new Log(Log::TYPE_WARNING,'WIGLE DOWNLOAD','moc pozadavku'));\n }\n }", "public function test_it_downloads_files()\n {\n // using a real url I suppose, so I'm just going to\n // make sure it constructs for now\n // @todo see if there is a better test for this\n $FileDownloader = new FileDownloader;\n }", "public function Download(){\n\t\t\n\t\t\n\t}", "public function startDownload() {\n if (!isset($this->destPath) || !isset($this->filePath)) {\n throw new SFException( 'No file path or name given. Use setPaths()', ERR_REPORT_APP );\n }\n\n $this->callMethod( 'startDownload', array( $this->destPath, $this->destPathRelativeToTmp ) );\n }", "protected function downloadFiles() {\n $aFiles = $this->aFiles;\n\n foreach($aFiles as $aFile) {\n\n $sFile = $this->sDirectory . $aFile;\n if (!Storage::disk('local')->exists($sFile)) {\n\n // Option to switch s3 to local\n $sStorageType = \"local\"; // \"s3\", \"local\"\n\n switch ($sStorageType) {\n case \"s3\":\n // Retrieving Files from AWS S3 bucket\n $file = base64_decode($aFile);\n $name = basename($aFile);\n $oRaw = Storage::disk('s3')->download($file, $name);\n // Writing S3 files to local storage\n Storage::disk('local')->put($sFile, $oRaw);\n break;\n case \"local\":\n // Writing dummy files to local storage\n Storage::disk('local')->put($sFile, 'Contents');\n break;\n default:\n break;\n }\n // sleep(10);\n }\n }\n }", "public function fetch() {\r\n if (empty($this->id)) {\r\n throw new Exception(\"Cannot fetch download object - no download ID given\"); \r\n }\r\n \r\n $query = \"SELECT d.*, UNIX_TIMESTAMP(d.date) AS date_unix FROM download_items AS d WHERE d.id = ?\";\r\n \r\n $row = $this->db->fetchRow($query, $this->id);\r\n \r\n if (!is_array($row) || count($row) === 0) {\r\n throw new Exception(\"Requested download not found\");\r\n }\r\n \r\n // Populate the vars\r\n $this->name = $row['title']; \r\n $this->desc = $row['description']; \r\n $this->url_file = $row['url']; \r\n $this->filename = empty($row['filename']) ? basename($row['url']) : $row['filename']; \r\n $this->Date = new DateTime($row['date'], new DateTimeZone(\"Australia/Melbourne\"));\r\n $this->hits = $row['hits'];\r\n $this->filesize = isset($row['filesize']) && $row['filesize'] > 0 ? formatBytes($row['filesize']) : \"Unknown\";\r\n $this->user_id = $row['user_id'];\r\n $this->filepath = $row['filepath'];\r\n \r\n $this->object_id = $row['object_id'];\r\n $this->approved = $row['approved'];\r\n $this->active = $row['active'];\r\n $this->extra_data = $row['extra_data'];\r\n $this->mime = $row['mime'];\r\n \r\n if (empty($this->filepath) && !empty($this->url_file)) {\r\n $pathinfo = parse_url($this->url_file); \r\n $this->filepath = str_replace(\"/uploads/\", \"\", $pathinfo['path']);\r\n \r\n try {\r\n $this->commit(); \r\n } catch (Exception $e) {\r\n // Do nothing\r\n }\r\n }\r\n \r\n if (!preg_match(\"@^(http|https)://@\", $this->url_file)) {\r\n $this->url_file = parent::DOWNLOAD_HOST . parent::DOWNLOAD_DIR . $this->url_file; \r\n }\r\n \r\n if ($row['date'] == \"0000-00-00 00:00:00\") {\r\n $this->Date = new DateTime(\"now\", new DateTimeZone(\"Australia/Melbourne\")); \r\n $this->commit();\r\n }\r\n \r\n if (empty($this->user_id) && !empty($row['submitter'])) {\r\n $this->submitter = $row['submitter'];\r\n }\r\n \r\n /**\r\n * Load the category this download belongs to\r\n */\r\n \r\n $this->Category = new Category($row['category_id']); \r\n \r\n /**\r\n * Load the author\r\n */\r\n \r\n $this->Author = UserFactory::CreateUser($this->user_id);\r\n \r\n if (empty($this->mime) && file_exists(RP_DOWNLOAD_DIR . $this->filepath)) {\r\n $finfo = finfo_open(FILEINFO_MIME_TYPE); \r\n $this->mime = finfo_file($finfo, RP_DOWNLOAD_DIR . $this->filepath);\r\n $this->commit(); \r\n }\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n }", "protected function downloadFiles() {\n\t\t// Metadata.\n\t\t$metadataFile = $this->jobDir() . '/metadata.json';\n\t\tif ( !file_exists( $metadataFile ) ) {\n\t\t\t$this->log->info( \"Saving IA metadata to $metadataFile\" );\n\t\t\t$metadata = $this->iaClient->fileDetails( $this->itemId );\n\t\t\tfile_put_contents( $metadataFile, \\GuzzleHttp\\json_encode( $metadata ) );\n\t\t}\n\t\tif ( !isset( $metadata ) ) {\n\t\t\t$metadata = \\GuzzleHttp\\json_decode( file_get_contents( $metadataFile ), true );\n\t\t}\n\n\t\t// Other files (JP2 and DjVu XML).\n\t\t$filesToDownload = preg_grep( '/.*(_djvu.xml|_jp2.zip)/', array_keys( $metadata['files'] ) );\n\t\tforeach ( $filesToDownload as $file ) {\n\t\t\tif ( !file_exists( $this->jobDir() . $file ) ) {\n\t\t\t\t$this->log->info( \"Downloading $this->itemId$file\" );\n\t\t\t\t$this->iaClient->downloadFile( $this->itemId . $file, $this->jobDir() . $file );\n\t\t\t}\n\t\t}\n\t}", "public function startDownload() {\n if ((!isset($this->destPath)) || $this->data === NULL) {\n throw new SFException( 'No destination path or data. Use setDestinationPath() and setData()', ERR_REPORT_APP );\n }\n\n $this->callMethod( 'startDownload', array( $this->destPath ) );\n }", "public function downloadFile();", "public function downloadFiles()\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n\r\n $access_full_path = $this->_get_access_full_path();\r\n $filenames = $this->input->get_post('filenames');\r\n $filenames_arr = json_decode($filenames);\r\n $targetname = $this->input->get_post('targetname');\r\n\r\n // insert userlog\r\n $gid = $this->input->get_post('gid');\r\n if (substr($gid, 0, 1) === 's')\r\n {\r\n $b36_sid = substr($gid, 1);\r\n $share = $this->login->get_share_access($b36_sid);\r\n $gid = $share['gid'];\r\n $folder_name = $share['name'];\r\n }\r\n else\r\n {\r\n $folder_name = $this->login->get_group_name($gid);\r\n }\r\n if (count($filenames_arr) == 1)\r\n {\r\n $fileinode = $this->files_model->fileinode($access_full_path .'/'. $filenames_arr[0]);\r\n $target = str_replace('/'. $folder_name, '', $access_full_path, $cnt = 1) .'/'. $filenames_arr[0];\r\n $details = '';\r\n }\r\n else\r\n {\r\n $fileinode = 0;\r\n $target = $this->files_model->get_utf8_basename($access_full_path) . '.zip';\r\n $details = $filenames;\r\n }\r\n $user = $this->login->get_user();\r\n $this->userlog_model->insert(\r\n $user['id'],\r\n $user['name'],\r\n Userlog_model::FILE_DOWNLOAD,\r\n $gid,\r\n $folder_name,\r\n $fileinode,\r\n $target,\r\n $details\r\n );\r\n\r\n $this->files_model->download_files($access_full_path, $filenames_arr, $targetname);\r\n }", "public function execute()\n {\n $localFiles = $this->traversePath($this->basePath);\n\n $this->remoteFiles->rewind();\n $this->remoteFiles->populateAll();\n\n $entities = array();\n $requests = array();\n $deletePaths = array();\n\n // Handle PUT requests (create/update files)\n foreach ($localFiles as $filename) {\n $remoteFilename = $this->targetDir ? $this->targetDir . '/' . $filename : $filename;\n\n $callback = $this->getCallback($remoteFilename);\n $filePath = rtrim($this->basePath, '/') . '/' . $filename;\n\n if (!is_readable($filePath)) {\n continue;\n }\n\n $entities[] = $entityBody = EntityBody::factory(fopen($filePath, 'r+'));\n\n if (false !== ($remoteFile = $this->remoteFiles->search($callback))) {\n // if different, upload updated version\n if ($remoteFile->getEtag() != $entityBody->getContentMd5()) {\n $requests[] = $this->container->getClient()->put(\n $remoteFile->getUrl(),\n $remoteFile->getMetadata()->toArray(),\n $entityBody\n );\n }\n } else {\n // upload new file\n $url = clone $this->container->getUrl();\n $url->addPath($remoteFilename);\n\n $requests[] = $this->container->getClient()->put($url, array(), $entityBody);\n }\n }\n\n // Handle DELETE requests\n foreach ($this->remoteFiles as $remoteFile) {\n $remoteName = $remoteFile->getName();\n if (!in_array($remoteName, $localFiles)) {\n $deletePaths[] = sprintf('/%s/%s', $this->container->getName(), $remoteName);\n }\n }\n\n // send update/create requests\n if (count($requests)) {\n $this->container->getClient()->send($requests);\n }\n\n // bulk delete\n if (count($deletePaths)) {\n $this->container->getService()->bulkDelete($deletePaths);\n }\n\n // close all streams\n if (count($entities)) {\n foreach ($entities as $entity) {\n $entity->close();\n }\n }\n }", "public function download()\n {\n //Download default css\n $this->_downloadCss();\n\n $stores = Mage::app()->getStores();\n\n if (Mage::app()->isSingleStoreMode()) {\n // only update one store's blocks. The blocks may be assigned\n // to either the default store (id 0) or the single store.\n // Note that if you edit a block of default store in single store mode,\n // magento will change its store id to the single store's id\n $singleStore = reset($stores);\n $storeId = $singleStore->getId();\n if (Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $storeId)) {\n $errors = $this->_updateAllContent($storeId, true);\n } else {\n $errors = array();\n }\n } else {\n // first fetch content for the default store\n // note: this just creates blocks for all texts in default scope to\n // prevent errors due to missing blocks. We therefor do not check if\n // synchronization is enabled in global (default) scope in the configuration.\n // (using the block is another -- independent -- topic)\n $errors = $this->_updateAllContent(0);\n /* @var $store Mage_Core_Model_Store */;\n foreach ($stores as $store) {\n $storeId = $store->getId();\n if (!Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $storeId)) {\n continue;\n }\n $e = $this->_updateAllContent($storeId);\n $errors = array_merge($errors, $e);\n }\n }\n\n $this->_getHelper()->printErrors($errors);\n if ($errors) {\n Mage::log($errors, Zend_Log::ERR);\n }\n Mage::log('Done downloading (synchronizing) of contents from janolaw.');\n $this->_storeLastSyncState($errors);\n }", "public function run()\n {\n $file = new OrderFile();\n $file->order_id = '1';\n $file->url = 'test.jpg';\n $file->save();\n\n $file = new OrderFile();\n $file->order_id = '1';\n $file->url = 'test2.jpg';\n $file->save();\n\n $file = new OrderFile();\n $file->order_id = '1';\n $file->url = 'test3.jpg';\n $file->save();\n }", "function test_deferred_download() {\n\t\t$dowload = $this->api->deferred_download( 12345 );\n\t\t$this->assertContains( 'deferred_download=1', $dowload );\n\t\t$this->assertContains( 'item_id=12345', $dowload );\n\t}", "protected function checkDownloadsPossible() {}", "public function downloadAction()\n {\n $user = $this->getConnectedUser();\n\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->get('request');\n\n if ($request->getMethod() == 'POST') {\n $foldersId = $request->request->get('foldersId');\n $foldersId = json_decode($foldersId);\n $filesId = $request->request->get('filesId');\n $filesId = json_decode($filesId);\n\n if ((!is_null($filesId) && sizeof($filesId) > 0) ||\n (!is_null($foldersId) && sizeof($foldersId) > 0)) {\n $filesToDownload = $em->getRepository('TimeBoxMainBundle:Version')->getLastestFileVersion($user, $filesId);\n $foldersToDownload = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(array(\n 'id' => $foldersId,\n 'user' => $user\n ));\n\n if (!is_null($filesToDownload)) {\n // One file and no folder is requested\n if (sizeof($filesToDownload) == 1 && sizeof($foldersToDownload) == 0) {\n $version = $filesToDownload[0];\n $file = $version->getFile();\n\n $filePath = $version->getAbsolutePath();\n $filename = $file->getName();\n $type = $file->getType();\n if (!is_null($type)) {\n $filename .= '.'.$type;\n }\n\n if (!file_exists($filePath)) {\n throw $this->createNotFoundException();\n }\n\n // Trigger file download\n $response = new Response();\n $response->headers->set('Content-type', 'application/octet-stream');\n $response->headers->set('Content-Disposition', sprintf('attachment; filename=\"%s\"', $filename));\n $response->setContent(file_get_contents($filePath));\n return $response;\n }\n\n // Create zip folder on server if not exist\n $zipFolder = $this->get('kernel')->getRootDir() . '/../web/uploads/zip/';\n if (!file_exists($zipFolder)) {\n mkdir($zipFolder, 0755, true);\n }\n\n // Create zip archive\n $zip = new ZipArchive();\n $zipName = 'TimeBoxDownloads-'.time().'.zip';\n $zipPath = $zipFolder . $zipName;\n $zip->open($zipPath, ZipArchive::CREATE);\n\n // Fill zip with folders\n foreach($foldersToDownload as $folder){\n $this->addFolderToZip($folder, $zip);\n }\n\n // Fill zip with files\n foreach ($filesToDownload as $f) {\n $version = $f;\n $file = $version->getFile();\n\n $filePath = $version->getAbsolutePath();\n $filename = $file->getName();\n $type = $file->getType();\n if (!is_null($type)) {\n $filename .= '.'.$type;\n }\n\n $zip->addFile($filePath, $filename);\n }\n\n $zip->close();\n\n // Trigger file download\n $response = new Response();\n $response->headers->set('Content-type', 'application/octet-stream');\n $response->headers->set('Content-Disposition', sprintf('attachment; filename=\"%s\"', $zipName));\n $response->setContent(file_get_contents($zipPath));\n return $response;\n }\n }\n }\n return new Response('An error has occured.');\n }", "public function download(): void\n\t{\n\t\t/** @var ExtensionModel $model */\n\t\t$model = $this->getModel();\n\t\t$id = $this->input->getInt('id');\n\t\t$fileDetails = $model->getFilename($id);\n\n\t\tif (!file_exists($fileDetails->file))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(Text::sprintf('COM_JED_EXTENSIONS_DOWNLOAD_NOT_FOUND',\n\t\t\t\t$fileDetails->file));\n\t\t}\n\n\t\theader('Content-type: application/zip');\n\t\theader('Content-Disposition: attachment; filename=' . $fileDetails->originalFile);\n\t\theader('Content-length: ' . filesize($fileDetails->file));\n\t\theader('Pragma: no-cache');\n\t\theader('Expires: 0');\n\t\treadfile($fileDetails->file);\n\n\t\tFactory::getApplication()->close();\n\t}", "protected function _init_transfers()\n {\n foreach ($this->_files as $_k => $_file) {\n if (!$_file instanceof File) {\n continue;\n }\n $connection = ftp_connect(\n $this->_options['hostname'], \n $this->_options['port'], \n $this->_options['timeout']\n );\n if (false === $connection) {\n break;\n }\n $login = ftp_login(\n $connection, \n $this->_options['username'], \n $this->_options['password']\n );\n if ($login === false) {\n ftp_close($connection);\n break;\n }\n if (!file_exists($_file->get_full_path())) {\n emit(\n $this->_sig_failure,\n new EV_Failure($_file)\n );\n } else {\n $transfer = ftp_nb_put(\n $connection,\n $_file->get_name(),\n $_file->get_full_path(),\n $_file->get_transfer_mode()\n );\n if ($transfer === FTP_MOREDATA) {\n $this->_uploading[] = [\n $connection,\n $_file\n ];\n } else {\n if ($transfer == FTP_FINISHED) {\n emit(\n $this->_sig_complete,\n new EV_Complete($_file)\n );\n // Close the FTP connection to that file\n ftp_close($connection);\n $this->_uploaded[] = $_file;\n } else {\n emit(\n $this->_sig_failure,\n new EV_Failure($_file)\n );\n // Close the FTP connection to that file\n ftp_close($connection);\n }\n }\n }\n unset($this->_files[$_k]);\n }\n }", "public function getDownloadcounter() {}", "function downloadFiles()\n\t{\n\t\t$appointment = $this->appointment;\n\n\t\t//calendar in the sidebar (marginal calendar)\n\t\tif(empty($appointment))\n\t\t{\n\t\t\t$entry_id = (int)$_GET['app_id'];\n\t\t\t$entry = new ilCalendarEntry($entry_id);\n\t\t\t//if the entry exists\n\t\t\tif($entry->getStart())\n\t\t\t{\n\t\t\t\t$appointment = array(\n\t\t\t\t\t\"event\" => $entry,\n\t\t\t\t\t\"dstart\" => $entry->getStart(),\n\t\t\t\t\t\"dend\"\t=> $entry->getEnd(),\n\t\t\t\t\t\"fullday\" => $entry->isFullday()\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendFailure($this->lng->txt(\"obj_not_found\"), true);\n\t\t\t\t$this->ctrl->returnToParent($this);\n\t\t\t}\n\t\t}\n\n\t\tinclude_once './Services/Calendar/classes/BackgroundTasks/class.ilDownloadFilesBackgroundTask.php';\n\t\t$download_job = new ilDownloadFilesBackgroundTask($this->user->getId());\n\n\t\t$download_job->setBucketTitle($this->lng->txt(\"cal_calendar_download\").\" \".$appointment['event']->getTitle());\n\t\t$download_job->setEvents(array($appointment));\n\t\t$download_job->run();\n\n\t\t$this->ctrl->returnToParent($this);\n\t}", "public function execute()\n {\n $this->_productOfferExportQueueHandler->execute();\n }", "public function downloadAction(){\n //These are the files that are downloadable.\n $pathToDocs = RAIZ. \"/docs\";\n $param_to_file = array( \"milestone1\" => $pathToDocs . \"/milestone 1/group13-milestone1.pdf\",\n \"milestone2\" => $pathToDocs . \"/milestone 2/group13-milestone2.pdf\",\n \"milestone2-revision1\" => $pathToDocs . \"/milestone 2/group13-milestone2-comments.pdf\",\n \"milestone2-presentation\" => $pathToDocs . \"/milestone 2/group13-milestone2-presentation.pptx\");\n $file = $param_to_file[$this->_getParam('file')];\n //If we are being ask for a file that is not in the previous array, throw an Exception.\n if(is_null($file)){\n throw new Exception(\"Unknown file\");\n }\n //Disable view and layout\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n //The file is in the previous array. So, fetch it and force the download.\n if (file_exists($file) && is_file($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($file));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }else{\n echo \"<pre style='color:red'>The file does not exists</pre>\";\n } \n }", "public function getAlldownloadcounter() {}", "public function downloadAction() {\r\n $file_id = $this->getRequest()->getParam('file_id');\r\n $chanelphoto = Engine_Api::_()->getItem('sesvideo_chanelphoto', $this->getRequest()->getParam('photo_id'));\r\n if (!$chanelphoto)\r\n return;\r\n $chanelphoto->download_count = $chanelphoto->download_count + 1;\r\n $chanelphoto->save();\r\n $file_id = $chanelphoto->file_id;\r\n if ($file_id == '' || intval($file_id) == 0)\r\n return;\r\n $storageTable = Engine_Api::_()->getDbTable('files', 'storage');\r\n $select = $storageTable->select()->from($storageTable->info('name'), array('storage_path', 'name'))->where('file_id = ?', $file_id);\r\n $storageData = $storageTable->fetchRow($select);\r\n $storageData = (object) $storageData->toArray();\r\n if (empty($storageData->name) || $storageData->name == '' || empty($storageData->storage_path) || $storageData->storage_path == '')\r\n return;\r\n //Get base path\r\n $basePath = APPLICATION_PATH . '/' . $storageData->storage_path;\r\n @chmod($basePath, 0777);\r\n header(\"Content-Disposition: attachment; filename=\" . urlencode(basename($storageData->name)), true);\r\n header(\"Content-Transfer-Encoding: Binary\", true);\r\n header(\"Content-Type: application/force-download\", true);\r\n header(\"Content-Type: application/octet-stream\", true);\r\n header(\"Content-Type: application/download\", true);\r\n header(\"Content-Description: File Transfer\", true);\r\n header(\"Content-Length: \" . filesize($basePath), true);\r\n readfile(\"$basePath\");\r\n exit();\r\n // for safety resason double check\r\n return;\r\n }", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "public function run()\n {\n $this->consoleOutputService->writeln('Start fetching attachments...');\n\n try {\n $attachments = $this->fromClient->fetchAttachments($this->allowedMimeTypes);\n $this->notifier->notify('Notifying first user that '. count($attachments) .' of his attachments fetched');\n } catch (\\Exception $e) {\n dump($e->getMessage());\n exit;\n }\n\n $this->consoleOutputService->writeln('Start uploading files to storage...');\n\n try {\n /** @var Attachment $file */\n $storage = $this->toClient->getStorage();\n foreach ($attachments as $file) {\n $storage->uploadFile($file);\n }\n\n $this->notifier->notify(\n 'Notifying second user that he got ' . count($attachments) . ' new attachments in his storage'\n );\n\n } catch (\\Exception $e) {\n dump('Something when wrong while uploading attachments to storage');\n dump($e->getMessage());\n exit;\n }\n\n }", "public function download(){\n\t\t$lang = \"En\";\n\t\tif (isset ( $_SESSION [\"user_settings\"] [\"language\"] )) {\n\t\t\t$lang = $_SESSION [\"user_settings\"] [\"language\"];\n\t\t}\n\t\t\n\t\t// get form posts\n\t\t$localurl = $this->request->getParameter(\"localurl\");\n\t\t$filename = $this->request->getParameter(\"filename\");\n\t\t\n\t\t// get the user login\n\t\t$idUser = $_SESSION[\"id_user\"];\n\t\t$modelUser = new User();\n\t\t$userlogin = $modelUser->userLogin($idUser);\n\t\t\n\t\t// parse the files names\n\t\t$filename = str_replace(\"__--__\", \".\", $filename);\n\t\t$filename = str_replace(\"__---__\", \" \", $filename);\n\t\t$filename = str_replace(\"__----__\", \"/\", $filename);\n\t\t$localurl = str_replace(\"\\\\\", \"/\" , $localurl) . \"/\" . basename($filename);\n\t\t$fileName = \"./\" . $userlogin .\"/\".basename($filename);\n\t\t\n\t\t// refuse to download if the quotas is over\n\t\t$modelQuotas = new StUserQuota();\n\t\t$userQuotas = $modelQuotas->getQuota($idUser); // in GB\n\t\t$modelUploader = new StUploader();\n\t\t$usage = $modelUploader->getUsage($userlogin);\n\t\t$usage = $usage/1000000000; \n\t\t\n\t\tif ($usage >= $userQuotas){\n\t\t\t$this->index( StTranslator::QuotasHoverMessage($lang) . $localurl);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// download\n\t\t$modelFiles = new StUploader();\n\t\t$modelFiles->downloadFile($localurl, $fileName);\n\t\t\n\t\t\n\t\t// view\n\t\t$this->index( StTranslator::DownloadMessage($lang) . $localurl);\n\t\treturn;\n\t}", "function executeDownload($e){\n $url = \"app/info/exportRequestHistory.php?account=\" . $this->account->intVal();\n $html = '<iframe src=\"'.$url.'\" width=\"1\" height=\"1\" style=\"position:absolute;visibility:hidden;\"></iframe>';\n $this->downloadFrame->html($html);\n $this->downloadFrame->updateClient();\n }", "function tdc_do_download($file_name){\n $database = tdc_open_database(TDC_DATABASE_FILE);\n $filenode = tdc_find_filenode($database, $file_name);\n\n if($filenode != null){\n $file_path = TDC_DOC_ROOT . tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n if(tdc_send_file($file_path, $file_name)){\n tdc_update_count($database, $filenode, TDC_DATABASE_FILE);\n }\n }\n}", "public function commit() {\r\n \r\n $this->validate();\r\n \r\n $data = array(\r\n \"category_id\" => $this->Category instanceof Category ? $this->Category->id : 10,\r\n \"title\" => $this->name,\r\n \"url\" => $this->url_file,\r\n \"filename\" => $this->filename,\r\n \"mime\" => $this->mime,\r\n \"description\" => $this->desc,\r\n \"date\" => $this->Date->format(\"Y-m-d h:i:s\"),\r\n \"hits\" => $this->hits,\r\n \"user_id\" => $this->user_id,\r\n \"filepath\" => $this->filepath,\r\n \"object_id\" => filter_var($this->object_id, FILTER_VALIDATE_INT) ? $this->object_id : 0,\r\n \"approved\" => $this->approved,\r\n \"active\" => $this->active,\r\n \"extra_data\" => json_encode($this->extra_data),\r\n \"url\" => $this->approved ? str_replace(dirname(dirname(__FILE__)), RP_PROTOCOL.\"://\" . RP_HOST, $this->filepath) : \"\"\r\n );\r\n \r\n /**\r\n * Commit the changes\r\n */\r\n \r\n if (empty($this->id)) {\r\n $data['active'] = 1;\r\n $data['category_id'] = $this->cat_id;\r\n $data['filesize'] = empty($this->filesize) ? 0 : $this->filesize; \r\n \r\n $this->db->insert(\"download_items\", $data);\r\n $this->id = $this->db->lastInsertId();\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n return $this->id;\r\n }\r\n \r\n $where = array(\r\n \"id = ?\" => $this->id\r\n );\r\n \r\n $this->db->update(\"download_items\", $data, $where);\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n }", "public function run() {\n $this->cleanupFilesystem();\n $this->downloadCommunityRegistry();\n $this->downloadAllCommunityDefinitions();\n $this->saveCommunicationDetails();\n }", "public function onDownloaded()\n {\n }", "public function onDownloaded()\n {\n }", "public function run()\r\r\n\t{\r\r\n\t\t// Make sure there are no attempts to hack the file system\r\r\n\t\tif (preg_match('@^\\.+@i', $this->strFile) || preg_match('@\\.+/@i', $this->strFile) || preg_match('@(://)+@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid file name');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Limit downloads to the tl_files directory\r\r\n\t\tif (!preg_match('@^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '@') . '@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid path');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Check whether the file exists\r\r\n\t\tif (!file_exists(TL_ROOT . '/' . $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('File not found');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if there is no token or if the tokens do not match\r\r\n\t\tif (!strlen($this->Input->get('token')) || !is_array($_SESSION['downloadToken']) || !in_array($this->Input->get('token'), $_SESSION['downloadToken']))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie('Invalid download token');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if the file is not allowed\r\r\n\t\tif (!is_array($_SESSION['downloadFiles']) || !in_array($this->strFile, $_SESSION['downloadFiles']) || !preg_match('/^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '/') . '\\//i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('Download of file \"%s\" is not allowed', $this->strFile));\r\r\n\t\t}\r\r\n\r\r\n\t\t$objFile = new File($this->strFile);\r\r\n\t\t$arrAllowedTypes = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));\r\r\n\r\r\n\t\tif (!in_array($objFile->extension, $arrAllowedTypes))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('File type \"%s\" is not allowed', $objFile->extension));\r\r\n\t\t}\r\r\n\r\r\n\t\t// Open the \"save as...\" dialogue\r\r\n\t\theader('Content-Type: ' . $objFile->mime);\r\r\n\t\theader('Content-Transfer-Encoding: binary');\r\r\n\t\theader('Content-Disposition: attachment; filename=\"'.$objFile->basename.'\"');\r\r\n\t\theader('Content-Length: '.$objFile->filesize);\r\r\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0'); \r\r\n\t\theader('Pragma: public');\r\r\n\t\theader('Expires: 0');\r\r\n\r\r\n\t\t$resFile = fopen(TL_ROOT . '/' . $this->strFile, 'rb');\r\r\n\t\tfpassthru($resFile);\r\r\n\t\tfclose($resFile);\r\r\n\r\r\n\t\t// HOOK: post download callback\r\r\n\t\tif (array_key_exists('postDownload', $GLOBALS['TL_HOOKS']) && is_array($GLOBALS['TL_HOOKS']['postDownload']))\r\r\n\t\t{\r\r\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['postDownload'] as $callback)\r\r\n\t\t\t{\r\r\n\t\t\t\t$this->import($callback[0]);\r\r\n\t\t\t\t$this->$callback[0]->$callback[1]($this->strFile);\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}", "public function run()\n {\n // free transactions due to user downloads (e.g. logged in user or other reason for free download)\n factory('App\\DownloadTransaction', 10)->create([\n 'quantity' => 0,\n 'download_credit_id' => null,\n ]);\n\n\n // paid transactions due to user downloads\n factory('App\\DownloadTransaction', 30)->create([\n 'quantity' => -1,\n 'downloading_user_id' => null,\n 'download_credit_id' => null,\n ]);\n }", "public function downloads(): Collection;", "public function run()\n {\n //\n DB::statement('SET CONSTRAINTS ALL DEFERRED;');\n \\App\\ExistingPdf::truncate();\n DB::statement('SET CONSTRAINTS ALL IMMEDIATE;');\n\n $workbooks = \\App\\Workbook::all();\n\n foreach ($workbooks as $wb) {\n for($i = 0; $i < 2; $i++){\n $existpdf = \\App\\ExistingPdf::create([\n \"type\" => !$i ? 'q':'a',\n \"existing\" => Utils::checkExistFileDownloadInWorkbook(!$i ? 'q':'a',$wb),\n \"workbook_id\" => $wb->id,\n ]);\n $existpdf->save();\n }\n }\n }", "public static function zipAll()\n {\n require_once __DIR__ . '/../../../vendor/autoload.php';\n require_once __DIR__ . '/../../function.php';\n\n $transmission = transmissionConnection();\n $torrents = $transmission->all();\n $torrentCtrl = new TorrentController();\n\n foreach( $torrents as $torrent ){\n if( $torrent->isFinished() && ! file_exists( $torrent->getDownloadDir() . '/' . $torrent->getName() . '.zip' ) ){\n $torrentCtrl->zipTorrent($torrent);\n }\n }\n }", "function top_downloads()\r\n\t{\r\n\t\t\r\n\t\tdefine( 'IDM_PATH', ROOT_PATH.'modules/downloads/' );\r\n\t\t\r\n\t\t$this->ipsclass->load_language( 'lang_downloads' );\r\n\t\t$this->ipsclass->load_template( 'skin_downloads_external' );\r\n\r\n\t\t//-----------------------------------------\r\n\t\t// Get gallery library and API\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\tif( !class_exists( 'api_idm' ) )\r\n\t\t{\r\n\t\t\trequire_once( ROOT_PATH.'sources/api/api_core.php' );\r\n\t\t\trequire_once( ROOT_PATH . 'sources/api/idm/api_idm.php' );\r\n\t\t}\r\n\t\t\r\n\t\t//-----------------------------------------\r\n\t\t// Create API Object\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$idm_api = new api_idm;\r\n\t\t$idm_api->ipsclass = $this->ipsclass;\r\n\r\n\t\t//-----------------------------------------\r\n\t\t// Get images\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$files = array();\r\n\t\t$files = $idm_api->return_idm_data( $member['id'], 10, 1, 'f.file_downloads DESC' );\r\n\t\t\r\n\t\t//-----------------------------------------\r\n\t\t// Ready to pull formatted stuff?\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$data = array();\r\n\t\t\r\n\t\tif( count($files) )\r\n\t\t{\r\n\t\t\tforeach( $files as $row )\r\n\t\t\t{\r\n\t\t\t\t$row['css'] = $row['file_open'] == 1 ? 'row2' : 'row2shaded';\r\n\t\t\t\t\r\n\t\t\t\t$row['file_submitteddis'] = $this->ipsclass->get_date( $row['file_submitted'], 'LONG' );\r\n\t\t\t\t\r\n\t\t\t\tif( $row['file_updated'] > $row['file_submitted'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['file_updateddis'] = \"<strong>\".$this->ipsclass->lang['catdis_updated'].\"</strong>\".$this->ipsclass->get_date( $row['file_updated'], 'LONG' );\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$row['file_updateddis'] = \"&nbsp;\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $row['file_submitter'] == 0 OR !$row['members_display_name'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['members_display_name'] = $this->ipsclass->lang['idm_guestlang'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$row['submitter'] = $this->ipsclass->make_profile_link( $row['members_display_name'], $row['file_submitter'] );\r\n\t\t\t\t$row['filename'] = $this->ipsclass->compiled_templates['skin_downloads_external']->file_link( $row['file_name'], $row['file_id'] );\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$data[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\t$output = $this->ipsclass->compiled_templates['skin_downloads_external']->portal_block( $this->ipsclass->lang['top_downloads'], $data, 1 );\r\n\r\n\t\treturn $output;\r\n\t}", "private function delivered ()\n {\n $cursor = null;\n $has_more = true;\n $contentsDelete = array();\n $contentsDirs = array();\n $contentsFiles = array();\n if ( CACHE_ENABLED === true ) {\n $cursor = $this->cache->fetch( CACHE_ID_CURSOR );\n $cursor = $cursor === false ? null : $cursor;\n while ( $has_more ) {\n $delta = $this->dbxClient->getDelta( $cursor, DBX_SYNC_REMOTE );\n foreach ( $delta['entries'] as $entry ) {\n if ( $entry[1] === null ) {\n $contentsDelete[] = array( $entry[0], null, null, null, null );\n } else {\n $contents =\n array(\n $entry[0], // Dropbox entry\n $entry[1]['path'], // CaSe SENSITIVE path\n strtotime( $entry[1]['modified'] ), // Unix time of modifcation\n $entry[1]['is_dir'], // If this is a directory\n $entry[1]['rev'] // Dropbox revision code\n );\n if ( $contents[3] === true ) {\n $contentsDirs[] = $contents;\n } else {\n $contentsFiles[] = $contents;\n }\n }\n }\n usort( $contentsDelete, array( $this, 'sortCaseSensitvePath' ) );\n usort( $contentsDirs, array( $this, 'sortCaseSensitvePath' ) );\n usort( $contentsFiles, array( $this, 'sortCaseSensitvePath' ) );\n $this->imYours( $contentsDelete );\n $this->imYours( $contentsDirs );\n $this->imYours( $contentsFiles );\n $cursor = $delta['cursor'];\n $this->cache->save( CACHE_ID_CURSOR, $cursor );\n $has_more = $delta['has_more'];\n }\n } else {\n if ( file_exists( CURSOR_FILE ) && file_get_contents( CURSOR_FILE ) !== '' ) {\n $cursor = file_get_contents( CURSOR_FILE );\n while ( $has_more ) {\n $delta = $this->dbxClient->getDelta( $cursor, DBX_SYNC_REMOTE );\n foreach ( $delta['entries'] as $entry ) {\n if ( $entry[1] === null ) {\n $contentsDelete[] = array( $entry[0], null, null, null, null );\n } else {\n $contents =\n array(\n $entry[0], // Dropbox entry\n $entry[1]['path'], // CaSe SENSITIVE path\n strtotime( $entry[1]['modified'] ), // Unix time of modifcation\n $entry[1]['is_dir'], // If this is a directory\n $entry[1]['rev'] // Dropbox revision code\n );\n if ( $contents[3] === true ) {\n $contentsDirs[] = $contents;\n } else {\n $contentsFiles[] = $contents;\n }\n }\n }\n usort( $contentsDelete, array( $this, 'sortCaseSensitvePath' ) );\n usort( $contentsDirs, array( $this, 'sortCaseSensitvePath' ) );\n usort( $contentsFiles, array( $this, 'sortCaseSensitvePath' ) );\n $this->imYours( $contentsDelete );\n $this->imYours( $contentsDirs );\n $this->imYours( $contentsFiles );\n $cursor = $delta['cursor'];\n $this->createLocal( \"file\", CURSOR_FILE, \"put\", $cursor );\n $has_more = $delta['has_more'];\n }\n }\n }\n }", "public function download()\n\t{\n\t\tR::selectDatabase('oxid');\n\t\t$files = $this->getFilesByName(Flight::request()->query->file);\n\t\tif (empty($files)) $this->redirect('/');\n\t\t$file = reset($files);\n\t\t$dwnloadDir = substr($file['OXSTOREHASH'], 0, 2);\n\t\t$dwnloadFile = Flight::get('oxid_dir_downloads').$dwnloadDir.'/'.$file['OXSTOREHASH'];\n\t\tif ( ! is_file($dwnloadFile)) $this->redirect('/');\n\t\t//error_log($dwnloadFile);\n\t\theader('Content-type: application/pdf');\n\t\theader('Content-Disposition: inline; filename=\"'.$file['OXFILENAME'].'\"');\n\t\t@readfile($dwnloadFile);\n\t}", "private function updateRows()\n {\n $path = $this->getVar('upload_folder');\n $rows = $this->entityManager->getRepository('Downloads_Entity_Download')->findAll();\n $count = 0;\n foreach ($rows as $row) {\n $parts = explode('.', $row->getUrl());\n if (is_numeric($parts[0]) && ((int)$parts[0] == (int)$row->getLid())) {\n // this section renames numeric filenames to strings and attempts to\n // rename the actual file it also corrects the url for local files\n $filenameParts = explode('.', $row->getFilename());\n $newname = DataUtil::formatForURL($filenameParts[0]) . '.' . array_pop($filenameParts);\n $newurl = \"$path/$newname\";\n $oldurl = $path . '/' . $row->getUrl();\n if (@rename(DataUtil::formatForOS($oldurl), DataUtil::formatForOS($newurl))) {\n // update DB\n $row->setUrl($newurl);\n $row->setFilename($newname);\n } else {\n // update DB\n $row->setUrl($oldurl);\n $row->setFilename($newname);\n }\n } else {\n // this section simply renames filenames to only have one extension\n // old versions of the module somehow added double extensions\n $filenameParts = explode('.', $row->getFilename());\n if (count($filenameParts) > 2) {\n $newname = DataUtil::formatForURL($filenameParts[0]) . '.' . array_pop($filenameParts);\n // update DB\n $row->setFilename($newname);\n }\n }\n $this->entityManager->persist($row);\n if ($count > 20) {\n $this->entityManager->flush();\n $count = 0;\n } else {\n $count++;\n }\n }\n // clean up leftovers\n $this->entityManager->flush();\n }", "protected function setupBulkDownloadDefaults()\n {\n $this->crud->allowAccess('download');\n\n $this->crud->operation('list', function () {\n $this->crud->enableBulkActions();\n $this->crud->addButton('bottom', 'bulk_download', 'view', 'backpack.downloadoperation::buttons.bulk_download');\n });\n }", "function download() {\r\n $this->zip->read_dir('./uploads/',FALSE);\r\n // create zip file on server\r\n $this->zip->archive('./downloads/'.'images.zip');\r\n // prompt user to download the zip file\r\n $this->zip->download('images.zip');\r\n }", "function download_deliveries_on_ftp()\n{\n\tglobal $conf;\n\t\n\t$fp = fopen($conf['log_file'],\"a\");\n\t\n\t$conn_id = ftp_connect($conf['ftp_server'],$conf['ftp_port']); \n\t$login_result = ftp_login($conn_id,$conf['ftp_login'],$conf['ftp_password']); \n\tif ((!$conn_id) || (!$login_result)) \n\t{\n\t\tfwrite($fp,date(\"Ymd H:i:s\").\" ===> The ftp connection to the Sony server failed.\\r\\n\");\t\t\n\t}\t\t\n\telse\n\t{\n\t\tftp_pasv($conn_id, true); \n\t}\t\t\n\tftp_chdir($conn_id, $conf['repertoire_ftp_general']);\n\n\t$liste_repertoire_generale = ftp_nlist($conn_id, \".\");\n\t$max = count($liste_repertoire_generale);\n\t\n\t//Vérification de la présence du répertoire complete\n\t\t$liste_batch = array();\n\t\tfor($element=0;$element<$max;$element++)\n\t\t{\n\t\t\tftp_chdir($conn_id,$conf['repertoire_ftp_general'].\"/\".$liste_repertoire_generale[$element]);\n\t\t\t$contenu_repertoire = ftp_nlist($conn_id, \".\");\n\t\t\t$key = array_search(\"complete\", $contenu_repertoire);\n\t\t\tif($key==\"0\")\n\t\t\t{\n\t\t\t\tarray_push($liste_batch,$liste_repertoire_generale[$element]);\t\t\t\n\t\t\t\t$destination = $conf['main_directory'].\"\\\\todo\\\\\".$liste_repertoire_generale[$element];\n\t\t\t\t@mkdir($destination,0777,true);\n\t\t\t\t$contenu_batch = ftp_nlist($conn_id,\".\");\n\t\t\t\techo \"contenu_batch : \\r\\n\";\n\t\t\t\techo \"<pre>\";\n\t\t\t\tprint_r($contenu_batch);\n\t\t\t\techo \"</pre>\";\n\t\t\t\n\t\t\t\tfor($i=0;$i<count($contenu_batch);$i++)\n\t\t\t\t{\t\n\t\t\t\t\tftp_get($conn_id,$destination.\"\\\\\".$contenu_batch[$i],$contenu_batch[$i],FTP_BINARY);\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t$nb_fichiers = count($liste_batch);\n\t\tftp_close($conn_id);\n\t\t\n\t\tfwrite($fp,date(\"Ymd H:i:s\").\" ===> \".$nb_fichiers.\" batchs have been downloaded.\\r\\n\");\n\t\tfclose($fp);\n}", "public function downloadMultipleIdms(Request $request) {\n\n $selection = $this->tempStore->get($this->currentUser()->id());\n\n $builder = $this->idmsBuilderManager->createInstance('embedded');\n\n $zip = new \\ZipArchive();\n $zipFilename = tempnam(file_directory_temp(), \"zip\");\n\n $date = $this->dateFormatter->format(time(), 'long');\n $rootFolder = 'Idms - ' . $date;\n\n if ($zip->open($zipFilename, \\ZipArchive::CREATE) !== TRUE) {\n throw new \\Exception($this->t('Not possible to create zip archive'));\n }\n else {\n $zip->addEmptyDir($rootFolder);\n\n foreach ($selection as $id => $langcodes) {\n /** @var \\Drupal\\thunder_print\\Entity\\PrintArticleInterface $print_article */\n $print_article = $this->entityTypeManager()\n ->getStorage('print_article')\n ->load($id);\n\n $content = $builder->getContent($print_article);\n $filename = $builder->getFilename($print_article);\n\n $dir = $rootFolder . DIRECTORY_SEPARATOR . $id . ' - ' . $print_article->label();\n $zip->addEmptyDir($dir);\n $zip->addFromString($dir . DIRECTORY_SEPARATOR . $filename, $content);\n $zip->addFromString($dir . DIRECTORY_SEPARATOR . 'metadata.yml', Yaml::dump($print_article->getMetadata()));\n }\n }\n\n $zip->close();\n $content = file_get_contents($zipFilename);\n unlink($zipFilename);\n\n $this->tempStore->delete($this->currentUser()->id());\n\n $response = new StreamedResponse(\n function () use ($content) {\n echo $content;\n });\n\n $response->headers->set('Content-Type', 'application/zip');\n $response->headers->set('Cache-Control', '');\n $response->headers->set('Content-Length', strlen($content));\n $response->headers->set('Last-Modified', gmdate('D, d M Y H:i:s'));\n $contentDisposition = $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $rootFolder . '.zip');\n $response->headers->set('Content-Disposition', $contentDisposition);\n $response->prepare($request);\n\n return $response;\n }", "function instant_download($product_id, $ftype=null) {\n \n if (!$filetype = GetReq('filetype'))\n $filetype = $ftype ? $ftype : $this->ftype;\n \n \t //extra security set form must be filled as session param\n\t //to prevent cmd instant download without it.\n\t if ((GetSessionParam('FORMSUBMITED')) || GetSessionParam(\"CODESUBMITED\")) {\t \n \n $file = $this->wherethefileis . $product_id . $this->file_epithema . $filetype;\t \n\t //$file = \"c:\\\\php\\\\webos2\\\\projects\\\\re-coding-official\\\\demo\\\\delphi2java_shareware.zip\";\n\t //echo \"DOWNLOAD:\",$file;\n\t //die();\n $downloadfile = new DOWNLOADFILE($file);\n\t \n /*$this->tell_by_mail(\"demo file downloaded\",\n\t '[email protected]',\n\t\t '[email protected]',\n\t\t\t\t\t\t $file);\t\n\t\t\t\t\t\t \n $this->tell_by_sms(\"$product_id demo file downloaded.\");*/\t\n\t\t \n\t //inform bt mail and sms\n\t $this->send_downloaded_mail($product_id);\t\t\t\t\t \n\t \n if (!$downloadfile->df_download()) {\n\t //echo \"Sorry, we are experiencing technical difficulties downloading this file. Please report this error to Technical Support.\";\t \t \n\t\t$m = paramload('RCDOWNLOAD','error');\t\n\t\t$ff = $this->prpath.$m;\n\t\tif (is_file($ff)) {\n\t\t $ret = file_get_contents($ff);\n\t\t}\n\t\telse\n\t\t $ret = $m; //plain text\t\t \n\t }\n\t //else\n\t // $ret = \"OK\";\t\n\t }\n\t else\n\t $ret = \"Prohibited area!\"; \n\t\t \t \n\t return ($ret);\n\t \n\t \n\t //use download2.lib\n\t //$dFile = new Download_file($this->prpath . paramload('RCDOWNLOAD','dirsource') , $product_id . $this->ftype);\n }", "function save_items_as_downloads_ajax() {\n\t\t$path = str_replace( '\\\\\\\\', '\\\\', $_POST['path'] );\n\t\t$date = $_POST['selection_date'];\n\t\tif ( isset( $_POST['selected_files'] ) ) {\n\t\t\t$files = $this->edde_selected_files_to_array( $_POST['selected_files'] );\n\t\t} else {\n\t\t\t$files = false;\n\t\t}\n\n\t\t$result = new Import_From_Uploads( $path, $files, $date);\n\t\tif ( $result ) {\n\t\t\techo 'Success!';\n\t\t} else {\n\t\t\techo 'Something went wrong =(';\n\t\t}\n\t\twp_die();\n\t}", "function CI_Filedownload()\r\t{\r\t\t$this->CI =& get_instance();\t\r\t\tlog_message('debug', \"Download Class Initialized\");\r\t}", "public function download($id);", "private function _waitForExportRunToComplete() {\n $this->_channelRunDataUrl = null;\n\n do {\n sleep(5);\n $exportRun = $this->_doSalsifyRequest($this->_channelRunUrl());\n $status = $exportRun['status'];\n if ($status === 'completed') {\n $this->_channelRunDataUrl = $exportRun['product_export_url'];\n } elseif ($status === 'failed') {\n // this would be an internal error in Salsify\n throw new Exception('Salsify failed to produce an export.');\n }\n } while (!$this->_channelRunDataUrl);\n\n return $this;\n }", "abstract function download_asynch($rempath, $locpath, $mode = 'auto');", "public function handleDownload() {\n $tables = DB::select('SHOW TABLES');\n foreach ($tables as $table) {\n $this->storeDatabaseTable($table->Tables_in_spoferan_blog);\n }\n\n $this->storeUploads();\n $date = date('Y-m-d');\n $path = storage_path($date . $this->archive_download_name);\n $filename = sprintf('%s.zip', $path);\n $zip = new \\ZipArchive();\n $zip->open($filename, \\ZipArchive::CREATE);\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($path),\n \\RecursiveIteratorIterator::LEAVES_ONLY\n );\n foreach ($files as $name => $file) {\n if (!$file->isDir()) {\n $filePath = $file->getRealPath();\n $relativePath = substr($filePath, strlen($path) + 1);\n $zip->addFile($filePath, $relativePath);\n }\n }\n $zip->close();\n \\File::deleteDirectory(storage_path($date . $this->archive_download_name));\n\n return response()->download(storage_path($date . '_' . $this->archive_download_name . '.zip'))->deleteFileAfterSend(true);\n }", "function sl_download_files(){\n\terror_reporting(-1); //turn on error reporting here only\n\tset_time_limit(0); //make sure script load time is off\n\tglobal $woocommerce;\n\t$timerstart = microtime(true); //start the function timer\n\t//log file\n\t$logfile = plugin_dir_path( __FILE__ ) . \"/log.txt\";\n\n\t$logdata = '';\n $logdata .= '////////////////////////////////// '. date(\"Y/m/d\") . \" - \" .date(\"h:i:sa\") . \"//////////////////////////////////\\n\";\n\n\t$server \t= get_option(\"zanders_ftp_server\");\n\t$port \t\t= get_option(\"zanders_ftp_port\");\n\t$username \t= get_option(\"zanders_ftp_username\");\n\t$password \t= get_option(\"zanders_ftp_password\");\n\t$remotefolder = get_option(\"zanders_ftp_remote_folder\");\n\t$localfolder = get_option(\"zanders_ftp_local_folder\");\n\t$filelist \t= get_option('zanders_file_list');\n\n\t//set default folder paths if there are not any specified\n\t$remotefolder ? $remotefolder = strtolower($remotefolder) : $remotefolder = '/inventory/';\n\t!$localfolder ? $localfolder = $_SERVER['DOCUMENT_ROOT'] . \"/wp-content/uploads/gzandersftp/\" : \"\";\n\n\t//if there is a file list to download then lets download them\n\tif($filelist):\n\t\t$myconn = new shalako_FtpConnection($server, $username, $password, true, $port, 10 );\n\t\t$myconn->remotefolder = $remotefolder;\n\t\t$myconn->localfolder = $localfolder;\n\t\t$myconn->filelist = $filelist;\n\n\t\tif($myconn->connect()):\n\t\t\tforeach($myconn->filelist as $file):\n\t\t\t\t$downloadStart = microtime(true);\n\t\t\t\t$status = $myconn->downloadfile($file);\n\t\t\t\t$downloadTime = number_format((microtime(true)-$downloadStart),4);\n\t\t\t\tif($status):\n\t\t\t\t\t$logdata .= date(\"Y/m/d\"). \" - \" .date(\"h:i:sa\") . \" - Sucessfully downloaded {$file} in {$downloadTime} seconds \\n\";\n\t\t\t\telse:\n\t\t\t\t\t$logdata .= date(\"Y/m/d\"). \" - \" .date(\"h:i:sa\") . \" - Failed to download {$file} in {$downloadTime} seconds \\n\";\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\telse:\n\t\t\t$logdata .= date(\"Y/m/d\"). \" - \" .date(\"h:i:sa\") . \" - Failed to Connect to FTP Server! \\n\";\n\n\t\tendif;\n\tendif;\n\n\t$myxml = load_xmldata($localfolder.\"liveinv.xml\");\n\t$myxmlobject = array();\n\n\tforeach($myxml as $xmlnode):\n\t\t$itemno = (string)$xmlnode->ITEMNO;\n\t\t$qty = (string)$xmlnode->AVAILABLE;\n\t\t$price = (string)$xmlnode->ITEMQTYPRICING->ITEMPRICE;\n\t\t$myxmlobject[$itemno]['price'] = $price;\n\t\t$myxmlobject[$itemno]['qty'] = $qty;\n\tendforeach;\n\n\t//get array of sku ready for sql \n\t$myxmlarray = array_map(function($item) {\n\t\treturn \"'\".$item.\"'\";\n\t}, array_keys($myxmlobject));\n\t//get list of products that match data from the xml\n\t$myproducts = get_products_array($myxmlarray);\n\t$changedrecordcounter = 0;\n\tforeach($myproducts as $product):\n\t\t//print_r($product); //debuggins\n\t\t$product_id = $product->post_id;\n\t\t$sku = $product->meta_value;\n\t\t$updatedprice = $myxmlobject[$sku]['price'];\n\t\t$updatedqty = $myxmlobject[$sku]['qty'];\n\n\t\t$myproduct = new WC_Product($product_id); // get the woocommerce product\n\t\t//############################## UPDATING PRICING ##############################\n\t\t$currentprice = get_post_meta($product_id, \"_regular_price\", true);\n\t\tif($updatedprice != $currentprice ):\n\t\t\t$result = update_post_meta($product_id, '_regular_price', $updatedprice);\n\t\t\tif($result):\n\t\t\t\t$changedrecordcounter++;\n\t\t\t\t$logdata .= date(\"Y/m/d\"). \" - \" .date(\"h:i:sa\") . \" - updated product #\" . $myproduct->id . \" price from $\" .$currentprice . \" to $\" . $updatedprice . \"\\n\";\n\t\t\tendif;\n\t\tendif;\n\n\t\t//############################## UPDATING INVENTORY ##############################\n\n\t\t//###### update the stock quantity ########//\n\t\tif($updatedqty != $myproduct->stock):\n\t\t\t//also need to set the stock status here (instock || outofstock)\n\t\t\t$newqty = update_post_meta($product_id, '_stock', $updatedqty);\n\t\t\tif($newqty):\n\t\t\t\t$changedrecordcounter++;\n\t\t\t\t$logdata .= date(\"Y/m/d\"). \" - \" .date(\"h:i:sa\") .\" - updated product #\" . $myproduct->id . \" stock from \" .$myproduct->stock . \" to \" . $updatedqty . \"\\n\";\n\t\t\tendif;\n\t\tendif;\n\n\t\t//###### update the stock status ########//\n\t\t$stockstatus = get_post_meta($product_id, \"_stock_status\", true);\n\n\t\tif($updatedqty > 0): //new stock is instock\n\t\t\tif($stockstatus == 'outofstock'):\n\t\t\t\t$newstockstatus = update_post_meta($product_id, \"_stock_status\", \"instock\");\n\t\t\telse:\n\t\t\t\t$newstockstatus = false;\n\t\t\tendif;\n\n\t\t\tif($newstockstatus):\n\t\t\t\t$changedrecordcounter++;\n\t\t\t\t$logdata .= date(\"Y/m/d\"). \" - \" .date(\"h:i:sa\") .\" - changed product #{$product_id} stock status from {$stockstatus} to in stock \\n\";\n\t\t\tendif;\n\t\telse: //outofstock\n\t\t\tif($stockstatus = 'instock'):\n\t\t\t\t$newstockstatus = update_post_meta($product_id, \"_stock_status\", \"outofstock\"); \n\t\t\telse: \n\t\t\t\t$newstockstatus = false;\n\t\t\tendif;\n\t\t\tif($newstockstatus):\n\t\t\t\t$changedrecordcounter++;\n\t\t\t\t$logdata .= date(\"Y/m/d\"). \" - \" .date(\"h:i:sa\") .\" - changed product #{$product_id} stock status from {$stockstatus} to out of stock \\n\";\n\t\t\tendif;\n\t\tendif;\n\n\tendforeach;\n\n\t$totalfunctiontime = microtime(true) - $timerstart;\n\n $logdata .= '//////////////// Processed ' . count($myproducts) .' products ('.$changedrecordcounter.' modified) in '. number_format($totalfunctiontime,4) . \" seconds /////////////////\\n\\n\\n\\n\";\n\t//write the log data to the file\t\n\tfile_put_contents($logfile, $logdata, FILE_APPEND | LOCK_EX);\n\t//set the xml to nothing\n\t$myxml = null;\n}", "function checkFiles($task) {\n \n global $jlistConfig, $lang;\n \n $limits = remove_server_limits();\n if (!$limits){\n echo '<p>';\n echo '*******************************************************';\n echo '<br />Note: The time limit on the server could not be changed/increased!<br />';\n echo '*******************************************************';\n echo '</p>';\n }\n \n ignore_user_abort(true);\n // ob_flush();\n flush();\n\n $model_category = JModelLegacy::getInstance( 'Category', 'jdownloadsModel' );\n $model_download = JModelLegacy::getInstance( 'Download', 'jdownloadsModel' );\n \n jimport('joomla.filesystem.folder');\n jimport('joomla.filesystem.file');\n \n $db = JFactory::getDBO();\n $lang = JFactory::getLanguage();\n $lang->load('com_jdownloads', JPATH_SITE.DS);\n \n //check if all files and dirs in the uploaddir directory are listed\n if($jlistConfig['files.autodetect'] || $task == 'restore.run' || $task == 'scan.files'){\n \n if(file_exists($jlistConfig['files.uploaddir']) && $jlistConfig['files.uploaddir'] != ''){\n $startdir = $jlistConfig['files.uploaddir'].'/';\n $dir_len = strlen($startdir);\n\n // define the params for scan_dir() results\n $dir = $startdir;\n $only = FALSE;\n $type = array();\n if ($jlistConfig['all.files.autodetect']){\n $allFiles = true;\n } else { \n $allFiles = FALSE;\n $type = explode(',', $jlistConfig['file.types.autodetect']);\n } \n $recursive = TRUE; \n $onlyDir = TRUE; \n $files = array();\n $file = array();\n\n \n $dirlist = array();\n \n $new_files = 0;\n $new_dirs_found = 0;\n $new_dirs_create = 0;\n $new_dirs_errors = 0;\n $new_dirs_exists = 0;\n $new_cats_create = 0;\n $log_message = '';\n $success = FALSE; \n \n $log_array = array(); \n \n // ******************************************** \n // first search new categories\n // ******************************************** \n \n clearstatcache();\n $jd_root = $jlistConfig['files.uploaddir'].'/';\n $temp_dir = $jd_root.$jlistConfig['tempzipfiles.folder.name'].'/';\n $uncat_dir = $jd_root.$jlistConfig['uncategorised.files.folder.name'].'/';\n $preview_dir = $jd_root.$jlistConfig['preview.files.folder.name'].'/';\n $private_dir = $jd_root.$jlistConfig['private.area.folder.name'].'/';\n \n $except_folders = array($temp_dir, $uncat_dir, $preview_dir, $private_dir);\n \n $searchdirs = array();\n $dirlist = JDownloadsHelper::searchdir($jd_root, -1, 'DIRS', 0, $except_folders);\n \n $no_writable = 0;\n for ($i=0; $i < count($dirlist); $i++) {\n // no tempzifiles directory\n if(strpos($dirlist[$i], $jlistConfig['private.area.folder.name'].'/') === FALSE) {\n if (!is_writable($dirlist[$i])){\n $no_writable++;\n }\n $dirlist[$i] = str_replace($jd_root, '', $dirlist[$i]);\n // delete last slash /\n if ($pos = strrpos($dirlist[$i], '/')){\n $searchdirs[] = substr($dirlist[$i], 0, $pos);\n }\n }\n } \n unset($dirlist);\n \n $count_cats = count($searchdirs);\n \n // first progressbar for cats\n $title1 = JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO3');\n $bar = new ProgressBar();\n $bar->setMessage($title1);\n $bar->setAutohide(false);\n $bar->setSleepOnFinish(0);\n $bar->setPrecision(100);\n $bar->setForegroundColor('#990000');\n $bar->setBackgroundColor('#CCCCCC');\n $bar->setBarLength(300);\n $bar->initialize($count_cats-1); // print the empty bar\n\n for ($i=0; $i < count($searchdirs); $i++) {\n $dirs = explode('/', $searchdirs[$i]);\n $sum = count($dirs);\n \n // check that folder exist\n if ($sum == 1){\n $db->setQuery(\"SELECT COUNT(*) FROM #__jdownloads_categories WHERE cat_dir = \".$db->quote( $db->escape( $searchdirs[$i] ), false ));\n $cat_dir_parent_value = '';\n $cat_dir_value = $dirs[0];\n } else {\n $pos = strrpos($searchdirs[$i], '/');\n $cat_dir_parent_value = substr($searchdirs[$i], 0, $pos);\n $cat_dir_value = substr($searchdirs[$i], $pos +1); \n $db->setQuery(\"SELECT COUNT(*) FROM #__jdownloads_categories WHERE cat_dir = \".$db->quote( $db->escape( $cat_dir_value ), false ). \" AND cat_dir_parent = \".$db->quote( $db->escape( $cat_dir_parent_value ), false )); \n } \n $cat_exist = $db->loadResult(); \n \n // when not exist - add it\n if (!$cat_exist) {\n $new_dirs_found++;\n $parent_cat = '';\n \n // get the right parent_id value\n if ($sum == 1){\n // we have a new root cat\n $parent_id = 1;\n } else {\n // find the parent category and get the cat ID\n $pos = strrpos($cat_dir_parent_value, '/');\n\n if ($pos){\n // we have NOT a first level sub category\n $cat_dir_parent_value2 = substr($cat_dir_parent_value, 0, $pos);\n $cat_dir_value2 = substr($cat_dir_parent_value, $pos +1);\n $db->setQuery(\"SELECT * FROM #__jdownloads_categories WHERE cat_dir = \".$db->quote( $db->escape( $cat_dir_value2 ), false ).\" AND cat_dir_parent = \".$db->quote( $db->escape( $cat_dir_parent_value2 ), false )); \n \n } else {\n // we have a first level sub category\n $cat_dir_parent_value2 = $cat_dir_parent_value;\n $cat_dir_value2 = $cat_dir_value;\n $db->setQuery(\"SELECT * FROM #__jdownloads_categories WHERE cat_dir = \".$db->quote( $db->escape( $cat_dir_parent_value2 ), false ). \" AND cat_dir_parent = ''\"); \n } \n \n $parent_cat = $db->loadObject(); \n if ($parent_cat){\n $parent_id = $parent_cat->id;\n } else {\n // can not found the parents category for the new child\n $log_array[] = JText::_('Abort. Can not find parents category for the new folder: ').' <b>'.$searchdirs[$i].'</b><br />';\n break;\n } \n }\n \n //$cat_dir_value = utf8_encode($cat_dir_value);\n \n // we need the original folder title as category title\n $original_folder_name = $cat_dir_value;\n \n // check the founded folder name \n $checked_cat_dir = JDownloadsHelper::getCleanFolderFileName( $cat_dir_value, true );\n \n // check the folder name result \n if ($cat_dir_value != $checked_cat_dir){\n // build path\n if ($parent_cat){\n if ($parent_cat->cat_dir_parent){ \n $cat_dir_path = $jd_root.$parent_cat->cat_dir_parent.'/'.$parent_cat->cat_dir.'/'.$checked_cat_dir;\n $new_cat_dir_name = $parent_cat->cat_dir_parent.'/'.$parent_cat->cat_dir.'/'.$checked_cat_dir;\n } else {\n $cat_dir_path = $jd_root.$parent_cat->cat_dir.'/'.$checked_cat_dir;\n $new_cat_dir_name = $parent_cat->cat_dir.'/'.$checked_cat_dir;\n } \n } else {\n $cat_dir_path = $jd_root.$checked_cat_dir;\n $new_cat_dir_name = $checked_cat_dir;\n }\n \n // rename the folder - when he already exist: make it unique!\n $num = 1;\n while (JFolder::exists($cat_dir_path)){\n $cat_dir_path = $cat_dir_path.$num;\n $checked_cat_dir = $checked_cat_dir.$num;\n $num++;\n }\n \n if (!JFolder::exists($cat_dir_path)){\n $copied = JFolder::move($jd_root.$searchdirs[$i], $cat_dir_path);\n if ($copied !== true){\n $log_array[] = JText::_('Error! Can not change folder name: ').' <b>'.$searchdirs[$i].'</b><br />';\n }\n } else {\n $log_array[] = JText::_('Error! A folder with the same (cleaned) name exist already: ').' <b>'.$searchdirs[$i].'</b><br />';\n }\n $cat_dir_value = $checked_cat_dir; \n \n // update the name in the folder list\n $searchdirs[$i] = $new_cat_dir_name;\n }\n \n // set access \n if ($parent_cat){\n $access = $parent_cat->access;\n } else {\n $access = 1;\n }\n\n // set alias\n $alias = JApplication::stringURLSafe($cat_dir_value);\n\n // set note hint\n $note = JText::_('COM_JDOWNLOADS_RUN_MONITORING_NOTE_TEXT');\n\n // build table array\n $data = array (\n 'id' => 0,\n 'parent_id' => $parent_id,\n 'title' => $original_folder_name,\n 'alias' => $alias,\n 'notes' => $note,\n 'description' => '',\n 'cat_dir' => $cat_dir_value,\n 'cat_dir_parent' => $cat_dir_parent_value,\n 'pic' => $jlistConfig['cat.pic.default.filename'],\n 'published' => (int)$jlistConfig['autopublish.founded.files'],\n 'access' => $access,\n 'metadesc' => '',\n 'metakey' => '',\n 'created_user_id' => '0',\n 'language' => '*',\n 'rules' => array(\n 'core.create' => array(),\n 'core.delete' => array(),\n 'core.edit' => array(),\n 'core.edit.state' => array(),\n 'core.edit.own' => array(),\n 'download' => array(),\n ),\n 'params' => array(),\n ); \n \n // create new cat in table\n $create_result = $model_category->createAutoCategory( $data );\n if (!$create_result){\n // error message\n $log_array[] = JText::_('Error! Can not create new category for: ').' <b>'.$searchdirs[$i].'</b><br />';\n }\n \n $new_cats_create++;\n // copy index.html to the new folder\n $index_copied = JFile::copy(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_jdownloads'.DS.'index.html', $jlistConfig['files.uploaddir'].DS.$searchdirs[$i].DS.'index.html');\n $log_array[] = JText::_('COM_JDOWNLOADS_AUTO_CAT_CHECK_ADDED').' <b>'.$searchdirs[$i].'</b><br />';\n }\n\n $bar->increase(); // calls the bar with every processed element \n }\n echo '<small><br />'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_SUM_FOLDERS').' '.count($searchdirs).'<br /><br /></small>'; \n ob_flush();\n flush(); \n \n unset($dirs);\n unset($searchdirs);\n \n // ********************************************\n // Exists all published category folders?\n // ********************************************\n \n $mis_cats = 0;\n // get all published categories but not the root\n $db->setQuery(\"SELECT * FROM #__jdownloads_categories WHERE published = 1 AND id > 1\");\n $cats = $db->loadObjectList();\n \n $count_cats = count($cats);\n // first progressbar for cats\n $bar = new ProgressBar();\n $title2 = JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO4'); \n $bar->setMessage($title2);\n $bar->setAutohide(false);\n $bar->setSleepOnFinish(0);\n $bar->setPrecision(100);\n $bar->setForegroundColor('#990000');\n $bar->setBarLength(300);\n $bar->initialize($count_cats); // print the empty bar \n \n foreach($cats as $cat){\n\n if ($cat->cat_dir_parent != ''){\n $cat_dir = $jd_root.$cat->cat_dir_parent.'/'.$cat->cat_dir;\n } else {\n $cat_dir = $jd_root.$cat->cat_dir;\n }\n \n // when it not exist, we must unpublish the category\n if(!JFolder::exists($cat_dir)){\n $db->setQuery(\"UPDATE #__jdownloads_categories SET published = 0 WHERE id = '$cat->id'\");\n $db->execute();\n $mis_cats++;\n $log_array[] = '<font color=\"red\">'.JText::_('COM_JDOWNLOADS_AUTO_CAT_CHECK_DISABLED').' <b>'.$cat->cat_dir.'</b></font><br />';\n } \n $bar->increase(); // calls the bar with every processed element \n }\n echo '<br /><br />'; \n \n unset($cats);\n \n // ********************************************************* \n // Check all files and create for new founded new Downloads\n // *********************************************************\n \n unset($except_folders[1]);\n \n $all_dirs = JDownloadsHelper::scan_dir($dir, $type, $only, $allFiles, $recursive, $onlyDir, $except_folders, $jd_root, $files);\n \n if ($all_dirs != FALSE) {\n\n $count_files = count($files);\n \n // first progressbar for cats\n $bar = new ProgressBar();\n $title3 = JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO5'); \n $bar->setMessage($title3);\n $bar->setAutohide(false);\n $bar->setSleepOnFinish(0);\n $bar->setPrecision(100);\n $bar->setForegroundColor('#990000');\n $bar->setBarLength(300);\n $bar->initialize($count_files); // print the empty bar \n \n reset ($files);\n $new_files = 0;\n \n foreach($files as $key3 => $array2) {\n \n $filename = $files[$key3]['file'];\n \n if ($filename != '') {\n $dir_path_total = $files[$key3]['path'];\n $restpath = substr($files[$key3]['path'], $dir_len);\n $only_dirs = substr($restpath, 0, strlen($restpath) - 1);\n $upload_dir = $jlistConfig['files.uploaddir'].'/'.$only_dirs.'/';\n\n $pos = strrpos($only_dirs, '/');\n if ($pos){\n $cat_dir_parent_value = substr($only_dirs, 0, $pos);\n $cat_dir_value = substr($only_dirs, $pos +1);\n } else {\n $cat_dir_parent_value = '';\n $cat_dir_value = $only_dirs;\n } \n \n // exist still a Download with this filename?\n $exist_file = false;\n $db->setQuery(\"SELECT cat_id FROM #__jdownloads_files WHERE url_download = '\".$db->escape($filename).\"'\");\n $row_file_exists = $db->loadObjectList();\n\n foreach ($row_file_exists as $row_file_exist) {\n if (!$exist_file) { \n if ($row_file_exist->cat_id > 1){\n // could be in a normal category\n $db->setQuery(\"SELECT COUNT(*) FROM #__jdownloads_categories WHERE id = '$row_file_exist->cat_id' AND cat_dir = \".$db->quote( $db->escape( $cat_dir_value ), false )\n . \" AND cat_dir_parent = \".$db->quote( $db->escape( $cat_dir_parent_value ), false )); \n } else {\n // alternate an uncategorised\n if ($cat_dir_value == $jlistConfig['uncategorised.files.folder.name']){\n $db->setQuery(\"SELECT COUNT(*) FROM #__jdownloads_categories WHERE id = '$row_file_exist->cat_id' AND cat_dir = ''\");\n } else {\n // not existent so we need as result zero\n $db->setQuery(\"SELECT COUNT(*) FROM #__jdownloads_categories WHERE id = '0'\");\n }\n } \n $row_cat_find = $db->loadResult(); \n if ($row_cat_find) {\n $exist_file = true;\n } \n }\n } \n \n // Add the file here in a new Download\n if(!$exist_file) {\n // not check the filename when restore backup file\n if ($task != 'restore.run'){ \n \n // reset images var\n $images = '';\n \n $only_name = JFile::stripExt($filename);\n $file_extension = JFile::getExt($filename); \n\n $title = JFilterInput::getInstance(null, null, 1, 1)->clean($only_name, 'STRING');\n \n // check filename \n $filename_new = JDownloadsHelper::getCleanFolderFileName( $only_name, true ).'.'.$file_extension; \n \n if ($only_name == ''){\n echo \"<script> alert('Error: Filename empty after cleaning: \".$dir_path_total.\"'); </script>\\n\";\n continue; // go to next foreach item\n }\n \n if ($filename_new != $filename){\n $source = $startdir.$only_dirs.'/'.$filename;\n $target = $startdir.$only_dirs.'/'.$filename_new;\n $success = @rename($source, $target); \n if ($success === true) {\n $filename = $filename_new; \n } else {\n // could not rename filename\n echo \"<script> alert('Error: Could not rename $filename'); </script>\\n\";\n continue; // go to next foreach item\n }\n } \n }\n \n $target_path = $upload_dir.$filename;\n \n // find the category for the new founded file in this folder\n $db->setQuery(\"SELECT * FROM #__jdownloads_categories WHERE cat_dir = \".$db->quote( $db->escape( $cat_dir_value ), false ). \" AND cat_dir_parent = \".$db->quote( $db->escape( $cat_dir_parent_value ), false )); \n $cat = $db->loadObject();\n \n if ($cat){\n $id = $cat->id;\n $access = $cat->access;\n } else {\n // it seems that we have a new file in 'uncategorised' folder found\n $id = 1;\n $access = 1;\n } \n \n $date = JFactory::getDate();\n $tz = JFactory::getConfig()->get( 'offset' );\n $date->setTimezone(new DateTimeZone($tz));\n \n $file_extension = JFile::getExt($filename);\n \n // set file size\n $file_size = $files[$key3]['size'];\n \n // set note hint\n $note = JText::_('COM_JDOWNLOADS_RUN_MONITORING_NOTE_TEXT');\n \n // set creation date\n $creation_date = JFactory::getDate()->toSql();\n \n // set file mime pic\n $picpath = strtolower(JPATH_SITE.'/images/jdownloads/fileimages/'.$file_extension.'.png');\n if(file_exists($picpath)){\n $file_pic = $file_extension.'.png';\n } else {\n $file_pic = $jlistConfig['file.pic.default.filename'];\n }\n \n // create thumbs form pdf\n if ($jlistConfig['create.pdf.thumbs'] && $jlistConfig['create.pdf.thumbs.by.scan'] && $file_extension == 'pdf'){\n $thumb_file_type = strtolower($jlistConfig['pdf.thumb.image.type']);\n \n // make sure that we have an uniqe filename for the new pic\n $thumb_path = JPATH_SITE.'/images/jdownloads/screenshots/thumbnails/';\n $screenshot_path = JPATH_SITE.'/images/jdownloads/screenshots/';\n $picfilename = JFile::getName($target_path);\n $only_name = JFile::stripExt($picfilename);\n $file_extension = JFile::getExt($picfilename);\n \n $thumbfilename = $thumb_path.$only_name.'.'.$thumb_file_type;\n \n $num = 1;\n while (JFile::exists($thumbfilename)){\n $picfilename = $only_name.$num.'.'.$thumb_file_type;\n $thumbfilename = $thumb_path.$picfilename;\n $num++;\n }\n // create now the new pdf thumbnail\n $only_name = JFile::stripExt($picfilename);\n $pdf_thumb_name = jdownloadsHelper::create_new_pdf_thumb($target_path, $only_name, $thumb_path, $screenshot_path);\n if ($pdf_thumb_name){\n $images = $pdf_thumb_name; \n } \n } \n \n // create auto thumb when founded file is an image\n if ($jlistConfig['create.auto.thumbs.from.pics'] && $jlistConfig['create.auto.thumbs.from.pics.by.scan']){\n if ($file_is_image = JDownloadsHelper::fileIsPicture($filename)){\n // make sure that we have an uniqe filename for the new pic\n $thumbpath = JPATH_SITE.'/images/jdownloads/screenshots/thumbnails/';\n $picfilename = JFile::getName($target_path);\n $only_name = JFile::stripExt($picfilename);\n $file_extension = JFile::getExt($picfilename);\n \n $thumbfilename = $thumbpath.$picfilename;\n \n $num = 1;\n while (JFile::exists($thumbfilename)){\n $picfilename = $only_name.$num.'.'.$file_extension;\n $thumbfilename = $thumbpath.$picfilename;\n $num++;\n }\n // create now the new thumbnail\n $thumb_created = jdownloadsHelper::create_new_thumb($target_path, $picfilename); \n if ($thumb_created){\n $images = $picfilename;\n // create new big image for full view\n $image_created = jdownloadsHelper::create_new_image($target_path, $picfilename);\n }\n } \n }\n \n $sha1_value = sha1_file($target_path);\n $md5_value = md5_file($target_path); \n \n // build data array\n $data = array (\n 'file_id' => 0,\n 'cat_id' => $id,\n 'file_title' => $title,\n 'file_alias' => '',\n 'notes' => $note,\n 'url_download' => $filename,\n 'size' => $file_size,\n 'description' => JDownloadsHelper::getOnlyLanguageSubstring($jlistConfig['autopublish.default.description']), \n 'file_pic' => $file_pic,\n 'images' => $images,\n 'date_added' => $creation_date,\n 'file_date' => $creation_date,\n 'sha1_value' => $sha1_value,\n 'md5_value' => $md5_value, \n 'published' => (int)$jlistConfig['autopublish.founded.files'],\n 'access' => $access,\n 'metadesc' => '',\n 'metakey' => '',\n 'created_user_id' => '0',\n 'language' => '*',\n 'rules' => array(\n 'core.create' => array(),\n 'core.delete' => array(),\n 'core.edit' => array(),\n 'core.edit.state' => array(),\n 'core.edit.own' => array(),\n 'download' => array(),\n ),\n 'params' => array(),\n ); \n \n // create new download in table\n $create_result = $model_download->createAutoDownload( $data );\n if (!$create_result){\n // error message\n $log_array[] = '<font color=\"red\"><b>Error: Could not add Download for: '.$only_dirs.'/'.$filename.'</b></font><br />';\n } else {\n \t$new_files++;\n \t$log_array[] = JText::_('COM_JDOWNLOADS_AUTO_FILE_CHECK_ADDED').' <b>'.$only_dirs.'/'.$filename.'</b><br />';\n\t\t\t\t\t\t\t }\n } \n }\n $bar->increase(); // calls the bar with every processed element\n } \n } \n echo '<small><br />'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_SUM_FILES').' '.count($files).'<br /><br /></small>'; \n unset($files);\n flush();\n\n // **************************************************** \n // Check whether the assigned files from all published downloads exists\n // - otherwise unpublish this downloads\n // ****************************************************\n \n $mis_files = 0;\n $db->setQuery(\"SELECT * FROM #__jdownloads_files WHERE published = 1\");\n $files = $db->loadObjectList();\n \n $count_files = count($files);\n \n // first progressbar for cats\n $bar = new ProgressBar();\n $title4 = JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO6');\n $bar->setMessage($title4);\n $bar->setAutohide(false);\n $bar->setSleepOnFinish(0);\n $bar->setPrecision(100);\n $bar->setForegroundColor('#990000');\n $bar->setBarLength(300);\n $bar->initialize($count_files); // print the empty bar\n\n foreach($files as $file){\n \n // we checked only intern stored files\n if ($file->url_download <> ''){ \n \n // get the category path only, when we have not an 'uncategorised' Download \n if ($file->cat_id > 1){\n $db->setQuery(\"SELECT cat_dir, cat_dir_parent FROM #__jdownloads_categories WHERE id = '$file->cat_id'\");\n $cat = $db->loadObject();\n if ($cat->cat_dir_parent != ''){\n $cat_dir_path = $cat->cat_dir_parent.'/'.$cat->cat_dir;\n } else {\n $cat_dir_path = $cat->cat_dir;\n }\n $file_path = $jd_root.$cat_dir_path.'/'.$file->url_download;\n $cat_dir = $cat->cat_dir.'/'.$file->url_download;\n } else {\n // file in 'uncategorised' folder\n $file_path = $uncat_dir.$file->url_download;\n $cat_dir = $file_path;\n }\n\n if(!file_exists($file_path)){\n $db->setQuery(\"UPDATE #__jdownloads_files SET published = 0 WHERE file_id = '$file->file_id'\");\n $db->execute();\n $mis_files++;\n $log_array[] = '<font color=\"red\">'.JText::_('COM_JDOWNLOADS_AUTO_FILE_CHECK_DISABLED').' <b>'.$cat_dir.'</b></font><br />';\n } \n }\n $bar->increase(); // calls the bar with every processed element \n }\n \n \n echo '<br /><br />';\n echo '<div style=\"font-family:Verdana; font-size:10\"><b>'.JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO7').'</b><br /><br /></div>';\n flush(); \n \n // build log message\n if (count($log_array) > 0){\n array_unshift($log_array, date(JText::_('DATE_FORMAT_LC2')).':<br />');\n } \n \n foreach ($log_array as $log) {\n $log_message .= $log;\n }\n\n // when we have changed anything, we store it in the config\n if ($log_message != ''){\n $db->setQuery(\"UPDATE #__jdownloads_config SET setting_value = \".$db->quote( $db->escape( $log_message ), false ).\" WHERE setting_name = 'last.log.message'\");\n $db->execute();\n } \n \n if ($task == 'scan.files') {\n echo '<table width=\"100%\"><tr><td><font size=\"1\" face=\"Verdana\">'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_TITLE').'</font><br />';\n if ($new_cats_create > 0){\n echo '<font color=\"#FF6600\" size=\"1\" face=\"Verdana\"><b>'.$new_cats_create.' '.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_NEW_CATS').'</b></font><br />';\n } else {\n echo '<font color=\"green\" size=\"1\" face=\"Verdana\"><b>'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_NO_NEW_CATS').'</b></font><br />';\n }\n \n if ($new_files > 0){\n echo '<font color=\"#FF6600\" size=\"1\" face=\"Verdana\"><b>'.$new_files.' '.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_NEW_FILES').'</b></font><br />';\n } else {\n echo '<font color=\"green\" size=\"1\" face=\"Verdana\"><b>'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_NO_NEW_FILES').'</b></font><br />';\n } \n \n if ($mis_cats > 0){\n echo '<font color=\"#990000\" size=\"1\" face=\"Verdana\"><b>'.$mis_cats.' '.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_MISSING_CATS').'</b></font><br />';\n } else {\n echo '<font color=\"green\" size=\"1\" face=\"Verdana\"><b>'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_NO_MISSING_CATS').'</b></font><br />';\n } \n \n if ($mis_files > 0){\n echo '<font color=\"#990000\" size=\"1\" face=\"Verdana\"><b>'.$mis_files.' '.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_MISSING_FILES').'</b><br /></td></tr></table>';\n } else {\n echo '<font color=\"green\" size=\"1\" face=\"Verdana\"><b>'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_NO_MISSING_FILES').'</b><br /></td></tr></table>';\n }\n \n if ($log_message) echo '<table width=\"100%\"><tr><td><font size=\"1\" face=\"Verdana\">'.JText::_('COM_JDOWNLOADS_BACKEND_AUTOCHECK_LOG_TITLE').'<br />'.$log_message.'</font></td></tr></table>';\n\n } \n } else {\n // error upload dir not exists\n echo '<font color=\"red\"><b>'.JText::sprintf('COM_JDOWNLOADS_AUTOCHECK_DIR_NOT_EXIST', $jlistConfig['files.uploaddir']).'<br /><br />'.JText::_('COM_JDOWNLOADS_AUTOCHECK_DIR_NOT_EXIST_2').'</b></font>';\n }\n } \n}", "public function downloadAction()\n\t{\n\t\t$settings = $this->getProgressParameters();\n\n\t\tif (!empty($settings['downloadParams']['filePath']) && !empty($settings['downloadParams']['fileName']))\n\t\t{\n\t\t\t$file = new Main\\IO\\File($settings['downloadParams']['filePath']);\n\t\t\tif ($file->isExists())\n\t\t\t{\n\t\t\t\t$response = new Main\\Engine\\Response\\File(\n\t\t\t\t\t$file->getPath(),\n\t\t\t\t\t$settings['downloadParams']['fileName'],\n\t\t\t\t\t$settings['downloadParams']['fileType']\n\t\t\t\t);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Error('File not found'));\n\t}", "public function downloadTask()\n\t{\n\t\t$filters = array(\n\t\t\t'event_id' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.event_id',\n\t\t\t\t'id',\n\t\t\t\tarray()\n\t\t\t),\n\t\t\t'search' => urldecode(Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.search',\n\t\t\t\t'search',\n\t\t\t\t''\n\t\t\t)),\n\t\t\t// Get sorting variables\n\t\t\t'sort' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sort',\n\t\t\t\t'filter_order',\n\t\t\t\t'registered'\n\t\t\t),\n\t\t\t'sort_Dir' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sortdir',\n\t\t\t\t'filter_order_Dir',\n\t\t\t\t'DESC'\n\t\t\t)\n\t\t);\n\n\t\t$query = Respondent::all();\n\n\t\tif ($filters['search'])\n\t\t{\n\t\t\t$query->whereLike('first_name', strtolower((string)$filters['search']), 1)\n\t\t\t\t->orWhereLike('last_name', strtolower((string)$filters['search']), 1)\n\t\t\t\t->resetDepth();\n\t\t}\n\n\t\tif ($filters['event_id'])\n\t\t{\n\t\t\tif (!is_array($filters['event_id']))\n\t\t\t{\n\t\t\t\t$filters['event_id'] = array($filters['event_id']);\n\t\t\t}\n\t\t\tif (!empty($filters['event_id']))\n\t\t\t{\n\t\t\t\t$query->whereIn('event_id', $filters['event_id']);\n\t\t\t}\n\t\t}\n\n\t\t$rows = $query\n\t\t\t->order($filters['sort'], $filters['sort_Dir'])\n\t\t\t->paginated('limitstart', 'limit')\n\t\t\t->rows();\n\n\t\tCsv::downloadlist($rows, $this->_option);\n\t}", "public function actionDownloadedit() {\n\n $model = $this->loadModel();\n if (isset($_POST['file_index'])) { //download file from file_bytes \t\t\n CActiveForm::validate($model);\n /**\n *\n */\n $model->validate();\n /**\n *\n */\n $attachment_id = $_POST['file_index'];\n /**\n *\n */\n if ($attachment_id == '1') {\n $file_name = $model->attachment1_file_name;\n $file_type = $model->attachment1_file_type;\n $content = base64_decode($model->attachment1_file_bytes);\n } else if ($attachment_id == '2') {\n $file_name = $model->attachment2_file_name;\n $file_type = $model->attachment2_file_type;\n $content = base64_decode($model->attachment2_file_bytes);\n } else if ($attachment_id == '3') {\n $file_name = $model->attachment3_file_name;\n $file_type = $model->attachment3_file_type;\n $content = base64_decode($model->attachment3_file_bytes);\n }\n /**\n *\n */\n header('Content-Type: ' . $file_type);\n header('Content-Disposition: attachment;filename=\"' . $file_name . '\"');\n header('Cache-Control: max-age=0');\n echo $content;\n } else {\n //download file from host\n $attachment_id = 0;\n if (isset($_GET['1'])) {\n $attachment_id = 1;\n } else if (isset($_GET['2'])) {\n $attachment_id = 2;\n } else if (isset($_GET['3'])) {\n $attachment_id = 3;\n }\n if ($attachment_id != 0) {\n $file_name = Yii::app()->db->createCommand()\n ->select('attachment' . $attachment_id)\n ->from('hobby_new')\n ->where('id=:id', array('id' => $_GET['id']))\n ->queryScalar();\n if ($file_name != \"\" && file_exists(Yii::getPathOfAlias('webroot') . $file_name)) {\n Yii::import('ext.helpers.EDownloadHelper');\n EDownloadHelper::download(Yii::getPathOfAlias('webroot') . $file_name);\n }\n }\n }\n exit;\n }", "function downloadFile($data){\r\n\r\n $dao = new \\PNORD\\Model\\MaintenanceDAO($this->app); \r\n $info = $dao->getMaintenance($data); \r\n $this->app->log->info('****info **** -> '.$this->dumpRet($info));\r\n\r\n\r\n if (file_exists($info['FILES'])) {\r\n\r\n // header('Content-Description: File Transfer');\r\n header('Content-Type: application/zip');\r\n $name = split('maintenances/', $info['FILES']);\r\n $this->app->log->info('****name **** -> '.$this->dumpRet($name));\r\n $this->app->log->info('****info Files **** -> '.$this->dumpRet($info['FILES']));\r\n $this->app->log->info('****filesize(info[FILES]) **** -> '.$this->dumpRet(filesize($info['FILES'])));\r\n header('Content-Disposition: inline; filename='.basename($name[1]));\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($info['FILES']));\r\n ob_clean();\r\n flush();\r\n readfile($info['FILES']);\r\n exit;\r\n\r\n } \r\n\r\n }", "function zip_download_alternative($files)\r\n{\r\n\tglobal $_course;\r\n\tglobal $_user;\r\n\r\n\t$temp_zip_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\";\r\n\r\n\t// Step 1: create the overview file and add it to the zip\r\n\t$overview_file_content=generate_html_overview($files, array('filename'), array('title'));\r\n\t$overview_file=$temp_zip_dir.'overview'.$_user['firstname'].$_user['lastname'].'.html';\r\n\t$handle=fopen($overview_file,'w');\r\n\tfwrite($handle,$overview_file_content);\r\n\t// todo: find a different solution for this because even 2 seconds is no guarantee.\r\n\tsleep(2);\r\n\r\n\t// Step 2: we copy all the original dropbox files to the temp folder and change their name into the original name\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\t$value['title']=check_file_name($value['title']);\r\n\t\t$files[$value['filename']]['title']=$value['title'];\r\n\t\tcopy(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox/\".$value['filename'], api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\".$value['title']);\r\n\t}\r\n\r\n\t// Step 3: create the zip file and add all the files to it\r\n\t$temp_zip_file=$temp_zip_dir.'/dropboxdownload-'.$_user['user_id'].'-'.mktime().'.zip';\r\n\t$zip_folder=new PclZip($temp_zip_file);\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\t$zip_folder->add(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\".$value['title'],PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp\");\r\n\t}\r\n\r\n\t// Step 4: we add the overview file\r\n\t$zip_folder->add($overview_file,PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp\");\r\n\r\n\t// Step 5: send the file for download;\r\n\tDocumentManager::file_send_for_download($temp_zip_file,true,$name);\r\n\r\n\t// Step 6: remove the files in the temp dir\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\tunlink(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\".$value['title']);\r\n\t}\r\n\t//unlink($overview_file);\r\n\r\n\texit;\r\n}", "public function perTransfer()\n\t{\n\t\t$this->restart( 'shop/finish' );\n\t}", "public function fullDownload(){ \n Artisan::call('backup:run');\n }", "public function download_new_update($token, $app_ver)\n {\n $file_size = $this->input->post('file_size');\n if ($this->checker->is_admin())\n {\n if ($token == $this->session->userdata('CSRF'))\n {\n $this->activity_log->create_activity_log('download_update', 'Mengunduh Pembaharuan', null, $this->session->userdata('admin_login'));\n // if app version in server greater than current version\n if ($app_ver > $this->aboutapp->get_version())\n {\n //$url = 'http://muramasa.hol.es/app-updates/simakwapp';\n $url = $this->_update_app_host . '/updates';\n $url .= '/asmp-v' . $app_ver . '.zip';\n $path = '../asmp-v' . $app_ver . '.zip';\n $newfname = $path;\n set_time_limit(0);\n $file = fopen($url, 'rb');\n if ($file)\n {\n $newf = fopen($newfname, 'wb');\n if ($newf)\n {\n while (!feof($file))\n {\n fwrite($newf, fread($file, 1024 * 8), 1024 * 8);\n }\n }\n }\n if ($file)\n {\n $status_file1 = true;\n fclose($file);\n }\n if ($newf)\n {\n $status_file2 = true;\n fclose($newf);\n }\n\n if (file_exists('../asmp-v' . $app_ver . '.zip'))\n {\n echo 'complete';\n }\n else\n {\n $this->activity_log->create_activity_log('download_update_failed', 'Gagal Mengunduh Pembaharuan', null, $this->session->userdata('admin_login'));\n echo 'failed';\n }\n }\n else\n {\n echo 'failed-versi aplikasi sama';\n }\n }\n else\n {\n echo 'failed-token tidak sama';\n }\n }\n else\n {\n redirect('login/login_required', 'refresh');\n }\n }", "public function download() : bool {\t\n\t\t$req = self::init_req( ( (object) self::$URLS )->download );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tcurl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "public function execute() {\n $taskstable = Engine_Api::_()->getDbtable('tasks', 'core');\n $rtasksName = $taskstable->info('name');\n $taskstable_result = $taskstable->select()\n\t\t\t\t ->from($rtasksName, array('started_last'))\n\t\t\t\t ->where('title = ?', \"Background Automatically Delete Site's Files' Backups\")\n\t\t\t\t ->where('plugin = ?', 'Dbbackup_Plugin_Task_Dbbackfilesdelete')\n\t\t\t\t ->limit(1);\n\t\t\t\t \n $value = $taskstable->fetchRow($taskstable_result);\n $old_started_last = Engine_Api::_()->getApi('settings', 'core')->getSetting('dbbackupdeletefiles.startedlast', 0);\n \n\t\t$coremodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('core');\n $coreversion = $coremodule->version;\n if(!($coreversion < '4.1.0')) {\n\t\t\tif(!Engine_Api::_()->dbbackup()->canRunTask(\"dbbackup\",\"Dbbackup_Plugin_Task_Dbbackfilesdelete\", $old_started_last)){\n\t\t\t\treturn;\n\t\t\t}\n \t}\n \tEngine_Api::_()->getApi('settings', 'core')->setSetting('dbbackupdeletefiles_startedlast', $value['started_last']);\n\t\t\n\t\tif(Engine_Api::_()->getApi('settings', 'core')->dbbackup_deletecodeoptions) {\n\t\t\t$deletefiles = Engine_Api::_()->dbbackup()->deletebackupfiles();\n\t\t}\n }", "public function downloader()\n {\n if ( CKFinderDownloadCommand::ckfinderExists() === true ) {\n return;\n }\n\n Artisan::call('ckfinder:download');\n }", "public function downloadFile()\n { \n $urls = [];\n $file = a2_path('workflows/downloadable-urls.yaml');\n $response = json_decode(file_get_contents('php://input'), true);\n \n if(!file_exists($file)){\n file_put_contents($file, '');\n }\n\n if(isset($response['urls'])){\n $urls = $response['urls'];\n file_put_contents($file, Yaml::dump($urls));\n }\n\n if(isset($response['sync'])){\n $urls = Yaml::parseFile($file );\n\n }\n\n $client = new Client();\n foreach ($urls as $key => $url) {\n $res = $client->request('GET', $urls[$key], ['headers' => array(\n 'A2-TECHNOLOGY' => getenv('A2_TECHNOLOGY'),\n 'A2-TOKEN' => getenv('A2_TOKEN'),\n 'Content-Type: text/plain'\n )]);\n if ($res->getStatusCode() == 200) {\n\n $path = \\explode('?path=', $urls[$key])[1];\n if(!file_exists($path=base_path($path))){\n \\file_put_contents($path, $res->getBody());\n }\n unset($urls[$key]);\n }\n }\n // save data\n if(count($urls)){\n file_put_contents($file, Yaml::dump($urls));\n }else {\n file_put_contents($file, '');\n }\n }", "abstract protected function doUpload();", "public function testFullFileDownload()\n {\n\n // dd($command);\n }", "private function product_batch()\n\t{\n\t\t// add call to trigger datagrab here\n\t\t//file_get_contents(ee()->config->item('base_url') . '?ACT=25&id=9');\n\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\t\t$update_count = ee()->sync_db->count_all_results('products');\n\n\t\tif($update_count > 0)\n\t\t{\t\n\t\t\t// create curl resource \n\t $ch = curl_init(); \n\n\t // set url \n\t curl_setopt($ch, CURLOPT_URL, ee()->config->item('base_url') . '?ACT=25&id=' . ee()->config->item('integration_product_import_id')); \n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); \n\t curl_setopt($ch, CURLOPT_TIMEOUT, 300); \n\t curl_exec($ch); \n\t curl_close($ch);\n \t}\n\t}", "public function getFileDownloadParams()\n {\n // TODO: Implement getFileDownloadParams() method.\n }", "public function run()\n {\n if (!GOOGLE_APPENGINE) { // GAE has its own external task queue\n require_code('tasks');\n\n $task_rows = $GLOBALS['SITE_DB']->query_select('task_queue', array('*'), array('t_locked' => 0));\n foreach ($task_rows as $task_row) {\n $GLOBALS['SITE_DB']->query_update('task_queue', array(\n 't_locked' => 1,\n ), array(\n 'id' => $task_row['id'],\n ), '', 1);\n\n require_code('files');\n //$url = find_script('tasks') . '?id=' . strval($task_row['id']) . '&secure_ref=' . urlencode($task_row['t_secure_ref']);\n //http_download_file($url);\n execute_task_background($task_row);\n }\n }\n }", "public function uploadAction()\n\t{\n\t\t$chunkSize = $this->getSizeTempFile();\n\n\t\t$isUploadStarted = ($this->uploadedPart > 0);\n\t\tif (!$isUploadStarted)\n\t\t{\n\t\t\t$reservedSize = round($chunkSize * ceil($this->totalItems / $this->pageSize) * 1.5);\n\n\t\t\t$this->uploadPath = $this->generateUploadDir(). $this->fileName;\n\n\t\t\t$this->findInitBucket(array(\n\t\t\t\t'fileSize' => $reservedSize,\n\t\t\t\t'fileName' => $this->uploadPath,\n\t\t\t));\n\n\t\t\tif ($this->checkCloudErrors())\n\t\t\t{\n\t\t\t\t$this->saveProgressParameters();\n\n\t\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\tif(!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->addError(new Error('File exists in a cloud.'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->instanceBucket();\n\n\t\t\t$this->checkCloudErrors();\n\t\t}\n\n\n\t\tif (!file_exists($this->filePath))\n\t\t{\n\t\t\t$this->addError(new Error('Uploading file not exists.'));\n\t\t}\n\n\t\tif (count($this->getErrors()) > 0)\n\t\t{\n\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t}\n\n\n\t\t$isSuccess = false;\n\n\t\tif ($this->isExportCompleted && !$isUploadStarted)\n\t\t{\n\t\t\t// just only one file\n\t\t\t$uploadFile = array(\n\t\t\t\t'name' => $this->fileName,\n\t\t\t\t'size' => $this->fileSize,\n\t\t\t\t'type' => $this->fileType,\n\t\t\t\t'tmp_name' => $this->filePath,\n\t\t\t);\n\n\t\t\tif ($this->bucket->SaveFile($this->uploadPath, $uploadFile))\n\t\t\t{\n\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t$isSuccess = true;\n\t\t\t\t$this->isUploadFinished = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->addError(new Error('Uploading error.'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$uploader = new \\CCloudStorageUpload($this->uploadPath);\n\t\t\tif (!$uploader->isStarted())\n\t\t\t{\n\t\t\t\tif (!$uploader->Start($this->bucketId, $reservedSize, $this->fileType))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Start uploading error.'));\n\n\t\t\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$part = $this->getContentTempFile();\n\n\t\t\twhile ($uploader->hasRetries())\n\t\t\t{\n\t\t\t\tif ($uploader->Next($part, $this->bucket))\n\t\t\t\t{\n\t\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t\t$isSuccess = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($part);\n\n\t\t\t// finish\n\t\t\tif ($isSuccess && $this->isExportCompleted)\n\t\t\t{\n\t\t\t\tif ($uploader->Finish())\n\t\t\t\t{\n\t\t\t\t\t$this->isUploadFinished = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('FILE_UNKNOWN_ERROR'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($isSuccess)\n\t\t{\n\t\t\t$this->dropTempFile();\n\t\t}\n\n\t\t// Save progress\n\t\t$this->saveProgressParameters();\n\n\t\t// continue export into temporally file\n\t\t$result = $this->preformAnswer(self::ACTION_UPLOAD);\n\t\t$result['STATUS'] = self::STATUS_PROGRESS;\n\n\t\treturn $result;\n\t}", "public function download()\n {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . $this->getFilename());\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . $this->getSize());\n \\Oka\\Web\\Buffer::Clean();\n\n $this->read();\n exit;\n }", "private function processDownloads(array $downloads) {\n $result = [];\n $media_ref_field = 'field_asset';\n foreach ($downloads as $download) {\n $file = NULL;\n if (!empty($download->get('field_download_dam_media')->referencedEntities())) {\n $media_references = $download->get('field_download_dam_media')->referencedEntities();\n if (!empty($media_references) && is_array($media_references) && !empty($media_references[0])) {\n $media = $media_references[0];\n unset($media_references);\n }\n if (!empty($media) && $media->hasField($media_ref_field)\n && !empty($media->{$media_ref_field})\n && !empty($media->{$media_ref_field}->entity)\n ) {\n $file = $media->{$media_ref_field}->entity;\n unset($media);\n }\n }\n if (!isset($file) && !empty($download->get('field_file')->entity)) {\n $file = $download->get('field_file')->entity;\n }\n if (!$file) {\n continue;\n }\n $filesize = format_size($file->filesize->value);\n $language = '';\n if (!$download->get('field_language')->isEmpty()) {\n $languageEntity = $download->get('field_language')->entity;\n $language = $languageEntity->label();\n }\n $filePathInfo = pathinfo($file->filename->value);\n $isDownloadble = FALSE;\n $target = '';\n if ($download->get('field_gated_content')->value) {\n $url = $download->toUrl()->toString();\n $target = '_blank';\n }\n else {\n $url = file_create_url($file->get('uri')->value);\n $isDownloadble = TRUE;\n }\n $result[] = [\n 'isDownloadType' => 'true',\n 'contentType' => 'download',\n 'title' => $download->getTitle(),\n 'fileExtension' => $filePathInfo['extension'],\n 'fileLanguage' => $language,\n 'fileSize' => $filesize,\n 'url' => $url,\n 'target' => $target,\n 'isDownloadble' => $isDownloadble,\n ];\n unset($file);\n }\n return $result;\n }", "public function action_doc_quick_download()\n\t{\n\t\t$document_id = $this->request->param('id');\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t$kt_connection->initSession($knowledgetree_data['username'], $knowledgetree_data['password']);\n\t\t$kt_connection->downloadDocument($document_id);\n\t}", "public function execute() {\n //the request map that maps the request queue to request curl handles\n $requests_map = [];\n $multi_handle = curl_multi_init();\n $num_outstanding = 0;\n\n //start processing the initial request queue\n $num_initial_requests = min($this->_maxConcurrent, count($this->requests));\n for($i = 0; $i < $num_initial_requests; $i++) {\n $this->init_request($i, $multi_handle, $requests_map);\n $num_outstanding++;\n }\n\n do{\n do{\n $mh_status = curl_multi_exec($multi_handle, $active);\n } while($mh_status == CURLM_CALL_MULTI_PERFORM);\n if($mh_status != CURLM_OK) {\n break;\n }\n\n //a request is just completed, find out which one\n while($completed = curl_multi_info_read($multi_handle)) {\n $this->process_request($completed, $multi_handle, $requests_map);\n $num_outstanding--;\n\n //try to add/start a new requests to the request queue\n while(\n $num_outstanding < $this->_maxConcurrent && //under the limit\n $i < count($this->requests) && isset($this->requests[$i]) // requests left\n ) {\n $this->init_request($i, $multi_handle, $requests_map);\n $num_outstanding++;\n $i++;\n }\n }\n\n usleep(15); //save CPU cycles, prevent continuous checking\n } while ($active || count($requests_map)); //End do-while\n\n $this->reset();\n curl_multi_close($multi_handle);\n }", "public function run() {\n // Run every network connectors sending & receiving packets\n foreach($this->getNetwork()->getNetworkConnectors() as $network_connector) {\n $network_connector->run();\n }\n\n /////////////////////////////////////////\n // Blockchain sync\n if (!$this->getNetwork()->getSynchronized()) {\n if (!$this->_waiting_headers && count($this->_sync_headers) == 0) {\n /////////////////////////////////\n // We need to request more headers\n\n $last_block = $this->getNetwork()->getLastBlock();\n\n $getheaders_packet = $this->createPacket('getheaders');\n\n if (!($getheaders_packet->payload instanceof GetHeaders)) {\n throw new Exception(\"Payload type mismatch\");\n }\n\n $getheaders_packet->payload->version = $this->getNetwork()->getProtocolVersion();\n $getheaders_packet->payload->block_locator_hashes = $this->getNetwork()->getStore()->blockLocator($last_block->block_hash);\n $getheaders_packet->payload->hash_stop = new Hash(hex2bin('0000000000000000000000000000000000000000000000000000000000000000'));\n try {\n $this->getNetwork()->getNetworkConnectors()[0]->writePacket($getheaders_packet);\n\n $this->_waiting_headers = true;\n } catch (Exception $e) {\n /* Exception inhibitor */\n }\n } else if (count($this->_sync_headers) > 0 && count($this->_waited_block) == 0) {\n /////////////////////////////////////\n // Handle block headers : request block content\n $getdata_packet = $this->createPacket('getdata');\n if (!($getdata_packet->payload instanceof GetData)) {\n throw new Exception(\"Payload type mismatch\");\n }\n $getdata_packet->payload->inventory = array();\n foreach($this->_sync_headers as $header) {\n // Max 3 per request\n if (count($getdata_packet->payload->inventory) >= 3) {\n continue;\n }\n\n // Create a new vector\n $inv_vect = new InvVect();\n $inv_vect->hash = $header->block_hash;\n $inv_vect->type = InvVect::OBJECT_MSG_BLOCK;\n\n // Add a new vector to the list\n $getdata_packet->payload->inventory[] = $inv_vect;\n\n // We are awiting for this block\n $this->_waited_block[] = $header->block_hash->value;\n }\n\n // Slice the header array\n $this->_sync_headers = array_slice($this->_sync_headers, count($getdata_packet->payload->inventory));\n\n $this->getNetwork()->getNetworkConnectors()[0]->writePacket($getdata_packet);\n }\n }\n }", "private function setDownloadOptions() {\n // If this is a recrawl, reset download settings.\n if ($this->getSaverData()->isRecrawl()) {\n $this->product->set_downloadable(false);\n $this->product->set_download_limit('');\n $this->product->set_download_expiry('');\n $this->product->set_downloads([]);\n }\n\n $isDownloadable = $this->wcData->isDownloadable();\n\n $this->product->set_downloadable($isDownloadable);\n $this->product->set_download_limit($this->wcData->getDownloadLimit());\n $this->product->set_download_expiry($this->wcData->getDownloadExpiry());\n\n // If the product is not downloadable, no need to save the files.\n if (!$isDownloadable) return;\n\n // Prepare downloadable file information in the format WooCommerce wants\n $downloadables = array_map(function($mediaFile) {\n /** @var MediaFile $mediaFile */\n return [\n 'file' => $mediaFile->getLocalUrl(),\n 'name' => $mediaFile->getMediaTitle() ?: $mediaFile->getBaseName(),\n ];\n }, $this->wcData->getDownloadableMediaFiles());\n\n // Set the downloads to the product\n $this->product->set_downloads($downloadables);\n }", "function ft_hook_download($dir, $file) {}", "public function testComAdobeCqSocialFilelibraryClientEndpointsFilelibraryDownloadGe()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.filelibrary.client.endpoints.FilelibraryDownloadGetServlet';\n\n $crawler = $client->request('POST', $path);\n }", "public function run()\n {\n \tDB::beginTransaction();\n\n Excel::import(new PageImport, storage_path('imports/pages.xls'));\n Excel::import(new PageItemImport, storage_path('imports/page_items.xls'));\n\n DB::commit();\n }", "public function download()\n {\n\n $hashes = explode(',', $this->request->get('hashes'));\n $ids = array_map(function($hash) {\n return $this->fileEntry->decodeHash($hash);\n }, $hashes);\n\n $entries = $this->fileEntry->whereIn('id', $ids)->get();\n\n // TODO: refactor file entry policy to accent multiple IDs\n $entries->each(function($entry) {\n $this->authorize('show', [FileEntry::class, $entry]);\n });\n\n if ($entries->count() === 1 && $entries->first()->type !== 'folder') {\n $entry = $entries->first();\n\n $disk = $entry->getDisk();\n $stream = $disk->readStream($entry->getStoragePath());\n\n return response()->stream(function() use($stream) {\n fpassthru($stream);\n }, 200, [\n \"Content-Type\" => $entry->mime,\n \"Content-Length\" => $disk->size($entry->getStoragePath()),\n \"Content-disposition\" => \"attachment; filename=\\\"\" . $entry->name . \"\\\"\",\n ]);\n } else {\n $path = $this->createZip($entries);\n $timestamp = Carbon::now()->getTimestamp();\n return response()->download($path, \"download-$timestamp.zip\");\n }\n }", "function downloadDocumentAction()\n\t{\n\t\t$request = $this->_request->getParams();\n\t\t$this->_redirect(\"/BO/download-quote.php?type=\".$request['type'].\"&mission_id=\".$request['mission_id'].\"&index=\".$request['index'].\"&quote_id=\".$request['quote_id'].\"&logid=\".$request['logid'].\"&filename=\".$request['filename']);\n\t}", "public function downloadAction()\n {\n $url = $this->getRequest()->REQUEST_URI;\n $url = str_replace('/stream/download/', '/', '../data/uploads/images' . $url);\n $this->download($url, null, 'application/jpg');\n $this->view->message = \"Download erfolgreich.\";\n }", "public function run()\n {\n //\n set_time_limit(0);\n $this->call(UploadChannelItemsTableSeeder::class);\n $this->call(UploadChannelAssormentTableSeeder::class);\n \n $hash = UpdateHash::find(1);\n if(empty($hash)){\n UpdateHash::create(['hash' => \\Hash::make(date('Y-m-d H:i:s'))]);\n }else{\n $hash->hash = md5(date('Y-m-d H:i:s'));\n $hash->update();\n }\n }", "public function getDownloadCount()\n\t{\n\t\treturn $this->downloads;\n\t}", "public function execute()\n {\n $data = [];\n /** @var \\Magento\\Framework\\Controller\\Result\\Json $json */\n $json = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n\n try {\n $uploader = $this->uploaderFactory->create([\n 'fileId' => 'file_upload',\n 'validator' => $this->validator\n ]);\n\n $media = $this->fileSystem->getDirectoryRead(DirectoryList::MEDIA);\n $uploader->setAllowRenameFiles(true);\n $uploader->setFilesDispersion(true);\n\n $extension = $uploader->getFileExtension();\n if (in_array($extension, ['tar', 'gz'])) {\n $uploader->skipDbProcessing(true);\n }\n\n $data = $uploader->save($media->getAbsolutePath(self::PATH));\n\n if (in_array($extension, ['tar', 'gz'])) {\n $phar = new \\PharData($data['path'] . $data['file']);\n $phar->extractTo($data['path'], null, true);\n $fileName = $phar->getFilename();\n $data['type'] = $phar->getExtension();\n $data['file'] = $fileName;\n $data['path'] = $data['path'];\n $data['size'] = $phar->getSize();\n } elseif ($extension == 'zip') {\n $file = $data['path'] . $data['file'];\n $open = $this->archive->open($file);\n if (true === $open) {\n $archiveFileName = $this->archive->getNameIndex(0);\n $extension = $this->getExtension($archiveFileName);\n $newFileName = preg_replace('/\\.zip$/i', '.' . $extension, $file);\n $newArchiveFileName = basename($newFileName);\n\n if ($this->archive->renameIndex(0, $newArchiveFileName)) {\n $this->archive->extractTo(dirname($newFileName), $newArchiveFileName);\n }\n $this->archive->close();\n }\n\n $data['type'] = $extension;\n $data['file'] = dirname($data['file']) . '/' . $newArchiveFileName;\n }\n\n $data['url'] = $this->getTmpMediaUrl($data['file']);\n $data['path'] = $this->fileSystem->getDirectoryRead(DirectoryList::ROOT)\n ->getRelativePath($data['path']);\n\n unset($data['tmp_name']);\n } catch (\\Exception $e) {\n $data = [\n 'error' => $e->getMessage(),\n 'errorcode' => $e->getCode()\n ];\n }\n return $json->setData($data);\n }", "function durp_queue_import() {\n $url = variable_get('durp_manifest', '');\n if (!strstr($url, '://')) {\n $filename = $url;\n }\n else {\n // Given URI is an URL, download this file first.\n $filename = 'temporary://import_' . md5(time() . $url) . '.xml';\n if (!$data = drupal_http_request($url)) {\n watchdog('durp', 'Could not retrieve data to !url', array('!url' => $url), WATCHDOG_ERROR);\n return FALSE;\n }\n if ($data->code != 200) {\n watchdog('durp', 'Wrong response code for !url: !code', array('!url' => $url, '!code' => $data->code), WATCHDOG_ERROR);\n return FALSE;\n }\n if (!$fp = fopen($filename, 'w')) {\n watchdog('durp', 'Could not write data to !file', array('!file' => $filename), WATCHDOG_ERROR);\n return FALSE;\n }\n fwrite($fp, $data->data);\n fclose($fp);\n // Sleep 1s to wait for filesystem\n sleep(1);\n }\n\n $xmlReader = new XMLReader;\n $xmlReader->open($filename);\n\n // Move to the first <Dossier /> node.\n while ($xmlReader->read() && $xmlReader->name !== 'Dossier');\n\n $queue = DrupalQueue::get('durp');\n while ($xmlReader->name === 'Dossier') {\n $item = new stdClass();\n $item->id = $xmlReader->getAttribute('Id');\n $item->xml = $xmlReader->readOuterXml();\n $queue->createItem($item);\n $xmlReader->next('Dossier');\n }\n}", "public function downloadAssetsAction() {\n try {\n if ($this->statistics) {\n $statisticsAssets = new StatisticsDownloads();\n $statisticsAssets\n ->setStatistics($this->statistics)\n ->setAction($this->type)\n ->setMySessionId($this->sessionId)\n ->setIp(@$_SERVER['REMOTE_ADDR'])\n ->setAssetDownloads(1);\n $this->em->persist($statisticsAssets);\n $this->em->flush();\n return new JsonResponse(array('success' => true, 'msg' => 'Assets download stats successufly added'));\n } else {\n throw new \\Exception('Cant find statistics for this session id and app id!');\n }\n } catch (\\Exception $e) {\n return new JsonResponse(array('success' => false, 'msg' => 'An error occured', 'error' => $e->getMessage()));\n }\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }" ]
[ "0.68274873", "0.67517537", "0.66597253", "0.6356853", "0.63506293", "0.62954503", "0.6221843", "0.6185686", "0.61268", "0.61208314", "0.60984415", "0.60567784", "0.6046374", "0.60021764", "0.59464", "0.59306806", "0.59191114", "0.5917274", "0.5894191", "0.57990116", "0.5790259", "0.57810384", "0.5773913", "0.57575375", "0.5754602", "0.56903464", "0.5671982", "0.5655573", "0.5625213", "0.5611126", "0.56057787", "0.56015706", "0.55763197", "0.5560577", "0.5559962", "0.5554325", "0.5542236", "0.5538793", "0.5527253", "0.5527065", "0.5526825", "0.5515267", "0.5515267", "0.5512017", "0.55070347", "0.54695", "0.54658896", "0.54413074", "0.5428483", "0.54201365", "0.5392071", "0.53751725", "0.53464705", "0.53430605", "0.5329287", "0.5311555", "0.52964246", "0.5292573", "0.5292346", "0.527664", "0.5250605", "0.5243977", "0.52430403", "0.5237718", "0.5234767", "0.5221863", "0.5215925", "0.5214571", "0.5185695", "0.5178893", "0.51775235", "0.51758736", "0.51595324", "0.5156275", "0.51543874", "0.51469153", "0.514147", "0.5141191", "0.513325", "0.5132231", "0.51299846", "0.5129797", "0.5129054", "0.5125982", "0.5121298", "0.5112102", "0.51041114", "0.5100782", "0.5097884", "0.50953", "0.5094312", "0.5094247", "0.5093602", "0.5082159", "0.5081545", "0.50767577", "0.5075109", "0.5072306", "0.5056386", "0.50520843", "0.5046145" ]
0.0
-1
Poll Transmission for status of current torrents. The database is updated with current status of torrents.
public function checkTorrentsStatus() { // Percent done is a number between 0 and 1 $requestPayload = array( "method" => "torrent-get", "arguments" => array("fields" => array("id", "name", "totalSize", "percentDone", "hashString", "torrentFile", "magnetLink", "rateDownload")) ); $jsonRequest = json_encode($requestPayload); $result = $this->executeTransmissionApiCall($jsonRequest); $this->transmissionLogger->debug("[TRANSMISSION-API-CALL] Result of torrents query is: ". json_encode($result->arguments->torrents)); $updatedTorrents = $this->torrentService->updateDataForTorrents($result->arguments->torrents); return $updatedTorrents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refreshTaskStatus(){\n\n $webCronResult = $this->webCronResults()->orderBy('code', 'desc')->first();\n\n if ($webCronResult) {\n\n if ($webCronResult->code >= 300) {\n // bad status\n $this->status = 0 ;\n }else{\n // good status\n $this->status = 2 ;\n };\n\n $this->save();\n\n };\n\n }", "public static function poll( ) {\n\t\t\t\t\n\t\tforeach(Config::get('nagios:status') as $chrURL){\n\t\t\t\n\t\t\t$objStatus = new NagiosStatus($chrURL);\n\n\t\t}\n\t\t\n\t\tdisplay(\"Total of \" . DB::count() . \" database queries executed\");\n\t\t\t\n\t\treturn true;\n\t\t\t\n\t}", "private function updateStatus()\n {\n $this->setStatus(\n socket_get_status(pfsockopen($this->uri, $this->port))\n );\n }", "private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }", "public function update_status();", "private function fetchStatuses()\n {\n // if the tag indicates that we should archive the statuses, it's a waste of an SQL\n // call otherwise.\n if ($this->archive) {\n $limit_clause = \" LIMIT \";\n if($this->paging) {\n $limit_clause .= ($this->page * $this->limit).\",\";\n }\n $limit_clause .= $this->limit;\n\n $query = sprintf(\"SELECT * FROM `%s` WHERE id IN (SELECT status_id FROM `%s` WHERE search_id = %s)%s\",\n TasForWp::$StatusByIdTableName,\n TasForWp::$StatusSearchTableName,\n $this->_id,\n $limit_clause\n );\n $rows = $this->_wpdb->get_results($query);\n $this->_nextPage = (count($rows) < $this->limit) ? null : true;\n foreach ($rows as $row) {\n $status_obj = new TwitterStatus($row->id);\n $status_obj->load_json($row->status_json);\n #$status_obj->process_entities();\n $this->_statuses[] = $status_obj;\n }\n } else {\n try {\n $params = array('q' => $this->term, 'include_entities' => 1);\n if($this->limit > 0) {\n $params['rpp'] = $this->limit;\n }\n if(isset($this->page)) {\n $params['page'] = $this->page;\n }\n if(isset($this->max_status_id)) {\n $params['max_id'] = $this->max_status_id;\n }\n $response = $this->tapi->search($params);\n\n $this->_nextPage = $response->next_page;\n $this->_refresh_url = $response->refresh_url; \n\n foreach($response->results as $result)\n {\n $status_obj = new TwitterStatus($this->_wpdb, $this->tapi);\n $status_obj->load_json($result);\n #$status_obj->process_entities();\n $this->_statuses[] = $status_obj;\n }\n } catch (Exception $e) {\n // TODO: Should elegantly inform the user\n }\n }\n }", "private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['t']) && !empty($data['list'])) $result = $this->_bid->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The bid status has been changed.': 'ERROR: The bid status could not be changed.';\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "private function checkStatus()\n {\n $res = $this->parseBoolean(\n json_encode($this->getStatus()[\"timed_out\"])\n );\n\n if ($this->getStatus() == null)\n $this->setOnline(false);\n else if ($res)\n $this->setOnline(false);\n else\n $this->setOnline(true);\n }", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "function changeStatus() {\n\n $newStatus = $_GET['newstatus'];\n\n foreach ($_POST['status'] as $key => $val) {\n \n DB::update(CFG::$tblPrefix . \"ticket\", array(\"status\" => $newStatus), \" id=%d \", $key);\n \n }\n }", "public function getUpdatesFromPolling() {\n $updateIdCachePath = __DIR__ . '/last-update-id.txt';\n\n if (file_exists ($updateIdCachePath)) {\n $lastUpdate = file_get_contents($updateIdCachePath);\n $updates = $this->api->getUpdates((int)$lastUpdate + 1);\n } else {\n $updates = $this->api->getUpdates();\n }\n\n $maxUpdateId = 0;\n\n foreach ($updates as $update) {\n $this->processUpdate($update);\n\n $maxUpdateId = $maxUpdateId > $update->getUpdateId() ? $maxUpdateId : $update->getUpdateId();\n }\n\n if ($maxUpdateId) {\n file_put_contents($updateIdCachePath, $maxUpdateId);\n }\n }", "public function testStoreStatuses()\n\t{\n\t\t$host = 'my_host';\n\t\t$xml = <<<XML\n<?xml version=\"1.0\" ?>\n<monitor>\n\t<scrubber>\n\t\t<module>clk</module>\n\t\t<last_update>2009-06-03 12:00:00</last_update>\n\t</scrubber>\n</monitor>\nXML;\n\t\t\n\t\t$reader = new XMLReader();\n\t\t$reader->XML($xml);\n\t\t\n\t\t$monitor = new Monitor();\n\t\t$monitor->storeStatuses($reader, $host);\n\t\t\n\t\t$array = array(\n\t\t\t$host => array(\n\t\t\t\t'clk' => '2009-06-03 12:00:00'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->assertEquals($array, $monitor->getRunningScrubbers());\n\t}", "protected function getRemainingUpdatesStatus() {}", "private function load_status() {\n // New ID\n if (!isset($this->id) || $this->id === 0)\n return;\n $col = $this->get_col_pfx();\n $table = $this->table;\n $sql = \"SELECT * FROM $table WHERE ${col}id = :id\";\n $db_result = $this->db->query($sql, array(\":id\" => $this->id));\n if (!$db_result || !isset($db_result[0]))\n throw new \\RuntimeException(\"No ID found $this->id\");\n $db_result = $db_result[0];\n $this->status = $db_result[$col . \"status\"];\n $this->time_created = $db_result[$col . \"time_created\"];\n $this->time_started = $db_result[$col . \"time_started\"];\n $this->time_completed = $db_result[$col . \"time_completed\"];\n }", "public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}", "public function run()\n {\n Status::insert($this->statusLists);\n }", "function refreshTorrents()\n{\n $ids = array();\n global $torrents;\n \n //Grab the ID of every available torrent into a array\n $idArray = generateQuery('-l | sed \\'s/ */ /g\\' | cut -d\\' \\' -f2');\n \n //move the array ids into a ordered array.\n foreach($idArray as $counter=>$index)\n {\n //Dont include the first and last rows of torrent information, they're just header/footer rows.\n if($counter != 0 && $counter != count($idArray)-1)\n $ids[$counter-1].=$index;\n }\n \n //create torrent objects based off the available ids\n foreach($ids as $counter=>$newTor)\n $torrents[$counter] = new Torrent($newTor);\n}", "public function poll()\n {\n }", "public function getStatus() {\n\t\tif(!$this->server) {\n\t\t\treturn false;\n\t\t}\n\t\tif(!$this->status_new) {\n\t\t\t$this->update();\n\t\t}\n\t\treturn $this->status_new;\n\t}", "public function getStatus()\n {\n return $this->query('mnsync status');\n }", "public function updateStatusFinish()\n {\n $this->resetStatuses();\n }", "public function actionDownloadTaskStatusChanged()\n {\n $taskId = Yii::app()->request->getQuery('task_id', 0);\n $status = Yii::app()->request->getQuery('task_status', '');\n if (empty($taskId) || !in_array($status, Task::$statuses))\n return;\n \n $task = Task::model()->findByPk($taskId);\n if ($task instanceof Task) {\n if ($task->isDownload())\n $this->logFileDownload($task->id, '', '', $status);\n }\n\n $file_name = Yii::app()->request->getPost('file_name');\n if ($file_name) {\n $project = NetflixBacklotProject::model()->findByAttributes(['download_task_id' => $taskId]);\n if ($project instanceof NetflixBacklotProject) {\n $project->video_file_name = $file_name;\n }\n }\n }", "public function updateFeedsStatusesFile()\n {\n $data = json_encode($this->last_feeds_statuses);\n return file_put_contents($this->feeds_statuses_file, $data);\n }", "function getStatus()\n {\n if (!isset($this->bstatus) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->bstatus;\n }", "function getStatus()\n {\n if (!isset($this->bstatus) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->bstatus;\n }", "public function fetchStatus()\n { \n $quoteId = $this->_orderItem->getQuoteId();\n \n $quote = Mage::getModel('sales/quote');\n $quote->loadByIdWithoutStore($quoteId);\n\n $order = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('quote_id', $quoteId)->getFirstItem();\n\n if ($order->getId() > 0) {\n return 'completed';\n }\n\n $forgottenCollection = Mage::getResourceModel('reports/quote_collection');\n $forgottenCollection->addFieldToFilter('main_table.entity_id', $quoteId);\n\n $timeoutLimit = new DateTime();\n $timeoutInterval = new DateInterval(\"PT\".(int)(Mage::helper('marketingsoftware/config')->getAbandonedTimeout()).\"M\");\n $timeoutInterval->invert = 1;\n $timeoutLimit->add($timeoutInterval);\n\n $forgottenCollection->addFieldToFilter('main_table.updated_at', array('lt' => $timeoutLimit->format(\"Y-m-d H:i:s\")));\n $forgottenCollection->prepareForAbandonedReport(array());\n\n if (count($forgottenCollection)) {\n return 'abandoned'; \n }\n\n return 'basket';\n }", "public function stale_users() {\n\t\tif (!$this->get_settings()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$http = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\t\ttry {\n\t\t\t$results = $http->get($this->settings['hostname.mbd'].'/panelists/stale?X-ApiKey='.$this->settings['mbd.api_key'], array(), $this->options);\n\t\t} catch (Exception $e) {\n\t\t\t$this->out('Stale Api endpoint failed.');\n\t\t\treturn;\n\t\t}\n\n\t\t$results = json_decode($results['body'], true);\n\t\tCakeLog::write('mbd.stale', print_r($results, true));\n\t\tprint_r($results);\n\t}", "public function updateStatusOnNewDay() {\n // Update advs\n UIAdv::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update advgroups\n UIAdvGroup::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update campaign\n UICampaign::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update project\n UIProject::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n }", "public function updateStatusStart()\n {\n $this->resetStatuses();\n $this->pubDirectory->touch($this->getRelativeFilePath(self::IMPORT_STATUS_BUSY));\n }", "function checkWPTStatus() {\n\t// Query the status table to get wpt id list\n\tglobal $gStatusTable, $gErrBase;\n\n\t$wptServer = wptServer();\n\t$result = obtainTestsWithCode(SUBMITTED);\n\n\tif ( $result ) {\n\t\t$nNoResult = 0;\n\t\twhile ( $row = mysqli_fetch_assoc($result) ) {\n\t\t\t$request = $wptServer . \"testStatus.php?f=xml&test=\" . $row['wptid'];\n\t\t\t$doc = new DOMDocument();\n\t\t\tif ( $doc ) {\n\t\t\t\t$response = fetchUrl($request);\n\t\t\t\tif ( strlen($response) ) {\n\t\t\t\t\t$doc->loadXML($response);\n\t\t\t\t\t$nodes = $doc->getElementsByTagName('statusCode');\n\t\t\t\t\t$code = (int)trim($nodes->item(0)->nodeValue);\n\t\t\t\t\tunset($doc);\n\n\t\t\t\t\tif ( 200 == $code ) {\n\t\t\t\t\t\t$nNoResult = 0; // reset\n\t\t\t\t\t\tsetStatus($row['statusid'], SUBMIT_DONE);\n\t\t\t\t\t} \n\t\t\t\t\telseif ( 400 <= $code || 100 > $code ) {\n\t\t\t\t\t\t$nNoResult = 0; // reset\n\t\t\t\t\t\tsetStatus($row['statusid'], SUBMITTED + $gErrBase);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$nNoResult++;\n\t\t\t\t\t\tif ( $nNoResult > 2000 ) {\n\t\t\t\t\t\t\t// Quick bail:\n\t\t\t\t\t\t\t// If we've exhausted all the completed results we do NOT want\n\t\t\t\t\t\t\t// to continue checking EVERY remaining test. So instead we bail\n\t\t\t\t\t\t\t// after seeing many (50?) incomplete tests.\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}\n}", "public function status ()\n {\n if ( empty($this->_status) ) {\n $recent = $this->get_recent_moves(20);\n if ( count(array_filter($recent)) == 0 ) {\n $this->_status = 'inactive';\n }\n else if ( count(array_filter(array_slice($recent, 0, 5))) == 0 ) {\n $this->_status = 'disabled';\n }\n else {\n $this->_status = 'active';\n }\n }\n return $this->_status;\n }", "protected function pollRunning()\n {\n // but when you do foreach it copies the array before iterating\n foreach ($this->threads as $threadId => $_) {\n $task = $this->threads[$threadId];\n\n if (false !== $task && ! $task->heartbeat()) {\n $this->threads[$threadId] = false;\n $this->runningThreads--;\n $this->dispatchEvent(self::EVENT_TASK_FINISHED, $task, $threadId);\n }\n }\n }", "public static function syncActiveJobs()\n {\n $hosts = Host::getAll();\n\n foreach ($hosts as $Host) {\n\n // Get pending jobs for host\n $pendingJobs = static::getAllByWhere([\n 'Status' => 'pending',\n 'HostID' => $Host->ID\n ]);\n\n if (!$pendingJobs) {\n continue;\n }\n\n // Get active jobs from host\n $activeJobs = $Host->executeRequest('/jobs', 'GET')['jobs'];\n\n // Search active jobs for pending jobs to find updates\n foreach ($pendingJobs as $PendingJob) {\n\n // Update any lost jobs\n if (empty($activeJobs[$PendingJob->Site->Handle])) {\n $PendingJob->Status = 'failed';\n $PendingJob->Result = 'lost on server';\n if ($PendingJob->Site) {\n $PendingJob->Site->Updating = false;\n }\n $PendingJob->save();\n continue;\n }\n\n $activeJob = $activeJobs[$PendingJob->Site->Handle][$PendingJob->UID];\n\n if ($activeJob && $activeJob['status'] !== 'pending') {\n\n // Update job\n $PendingJob->Status = $activeJob['status'];\n if (!empty($activeJob['started'])) {\n $PendingJob->Started = $activeJob['started'] / 1000;\n }\n if (!empty($activeJob['completed'])) {\n $PendingJob->Completed = $activeJob['completed'] / 1000;\n }\n\n if (!empty($activeJob['command']['result'])) {\n if (strlen(json_encode($activeJob['command']['result'])) > 60000) {\n $PendingJob->Result = 'Output too long';\n } else {\n $PendingJob->Result = $activeJob['command']['result'];\n }\n } elseif (!empty($activeJob['message'])) {\n $PendingJob->Result = $activeJob['message'];\n }\n $PendingJob->save();\n\n // Update site on vfs update\n if ($PendingJob->Action == 'vfs-update') {\n\n // Get updated site record\n $Site = Site::getByID($PendingJob->SiteID);\n\n // Skip vfs-update actions on failed job\n if ($PendingJob->Status == 'failed') {\n $Site->Updating = false;\n $Site->save();\n continue;\n }\n\n // Update pending job's site\n $initialUpdate = !boolval($Site->ParentCursor);\n $Site->ParentCursor = $activeJob['command']['result']['parentCursor'];\n $Site->LocalCursor = $activeJob['command']['result']['localCursor'];\n $Site->Updating = false;\n $Site->save();\n\n // Conditionally update child site\n if (!empty($activeJob['command']['updateChild']) && $activeJob['command']['updateChild'] === true) {\n $childSites = Site::getAllByField('ParentSiteID', $Site->ID);\n foreach ($childSites as $ChildSite) {\n $ChildSite->requestFileSystemUpdate();\n }\n }\n\n // Fire initial vfs update event\n if ($initialUpdate) {\n \\Emergence\\EventBus::fireEvent(\n 'afterInitialVFSUpdate',\n $Site->getRootClass(),\n [\n 'Record' => $Site,\n 'Job' => $PendingJob\n ]\n );\n }\n }\n }\n }\n }\n }", "function rstatus() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t$remoteCmd = 'cd '.$versionPath.' && hg status';\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function updateStatus($force = false) {\n \n $attributesOptions = Mage::getSingleton('connector/content_attributes_options');\n $contentCollection = $this->buildColection();\n \n if(!$contentCollection) return false;\n \n Mage::dispatchEvent('smartling_check_statuses_before', \n array(\n 'collection' => $contentCollection\n ));\n \n if($this->isLocked()) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('connector')->__('Sorry, check status process is locked')\n );\n return false;\n } else {\n $this->lock();\n }\n \n foreach ($contentCollection as $item) {\n \n $cmsContentModel = Mage::getSingleton($item->getModelClass());\n \n Mage::register('content_translate_row_data', $item->getData());\n \n try {\n \n /** @var Smartling_Connector_Model_Translator */\n $connector = Mage::getModel('connector/translator', \n array(\n 'apiKey' => $item['api_key'], \n 'projectId' => $item['project_code'],\n 'project_id' => $item['project_id']\n )\n );\n \n // check status of translation\n $statusResponse = $connector->checkStatus($item['filename'], $item['locale']);\n \n // check of unexpected format\n if (!Mage::helper('connector')->isJson($statusResponse)) {\n Mage::throwException(\n Mage::helper('connector')\n ->__('Invalid response. Expected type is JSON. Received: ') \n . $statusResponse\n );\n } else {\n $statusResponseData = json_decode($statusResponse, true);\n $responseData = array();\n \n if(isset($statusResponseData['response'])) { \n $responseData = $statusResponseData['response'];\n }\n \n if(isset($responseData['messages']) && $responseData['code'] != 'SUCCESS') {\n Mage::throwException(implode('; ', $responseData['messages']));\n }\n \n $percent = \n Mage::helper('connector')->calculatePercent(\n @$responseData['data']['completedStringCount'], \n @$responseData['data']['stringCount']\n );\n \n $item->setPercent($percent);\n }\n \n if($force === true || $percent == 100) {\n \n $response = $connector->downloadTranslatedContent($item['filename'], \n $item['locale'], \n array('retrievalType' => $item['retrieval_type'])\n );\n \n $translatedContent = $cmsContentModel->getTranslatedContent($response);\n\n $newContent = $cmsContentModel\n ->createContent(\n $translatedContent, \n $item['origin_content_id'], \n $item['store_id']\n );\n\n Mage::dispatchEvent('smartling_apply_content_after', \n array(\n 'new_content' => $newContent,\n 'cms_content_model_instanse' => $cmsContentModel,\n 'item' => $item,\n 'response' => $response,\n ));\n }\n \n } catch (Mage_Core_Exception $e) {\n Mage::helper('connector')->log($e->getMessage(), Zend_log::ERR);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('connector')->__($e->getMessage())\n );\n } catch (Exception $e) {\n Mage::helper('connector')->log($e->getMessage(), Zend_log::ERR);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('connector')->__($e->getMessage())\n );\n }\n \n Mage::unregister('content_translate_row_data'); \n }\n \n Mage::dispatchEvent('smartling_check_statuses_after', \n array(\n 'attributes_options_instanse' => $attributesOptions,\n 'items_collection' => $contentCollection\n ));\n \n return true;\n }", "function updateLiveStreamStatus($id, $status) {\nglobal $app, $debug, $jconf, $myjobid;\n\n\tif ( empty($status) ) return false;\n\n $values = array(\n\t\t'status' => $status\n\t);\n\n $converterNodeObj = $app->bootstrap->getModel('livefeed_streams');\n $converterNodeObj->select($id);\n $converterNodeObj->updateRow($values);\n \n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid . \".log\", \"[INFO] Live stream id#\" . $id . \" status changed to '\" . $status . \"'.\", $sendmail = false);\n \n\treturn true;\n}", "function updateFeed(){\r\n //Here we go \r\n $check = \"SELECT * FROM `feeds` WHERE `area_id` = :c_area_id ORDER BY `id` DESC\";\r\n $check_stmt = $this->conn->prepare($check);\r\n $check_stmt->bindParam(\":c_area_id\", $this->area_id);\r\n $check_stmt->execute();\r\n $get = $check_stmt->fetch(PDO:: FETCH_ASSOC);\r\n //Converting the DateTime of `created` to Unix time stamp\r\n $created = strtotime($get['created']);\r\n $last_reported_status = $get['light_on'];\r\n $c_user_id = $get['user_id'];\r\n $feed_id = $get['id'];\r\n\r\n $check_status_query = \"SELECT `status` FROM `areas` WHERE `id` = $this->area_id\";\r\n $check_status = $this->conn->prepare($check_status_query);\r\n $check_status->execute();\r\n $fetch_status = $check_status->fetch(PDO:: FETCH_ASSOC);\r\n $area_status = $fetch_status['status'];\r\n // if($area_status == $this->status){\r\n // //300 seconds = 5 minutes\r\n // if($created < $created + 300){\r\n // if($status == $this->light_on){\r\n // $t_name = \"update\";\r\n // }\r\n // }else{\r\n // if($status == $this->light_on){\r\n // $t_name = \"update\";\r\n // }\r\n // }\r\n // }\r\n if($this->light_on == $last_reported_status){\r\n if($created < $created+300){\r\n $query = \"INSERT INTO `update` SET `user` = :user_id, `feed_id` = :feed_id, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":feed_id\", $this->feed_id);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }else{\r\n if($this->light_on != $area_status){\r\n $query = \"INSERT INTO `feeds` SET `user_id` = :user_id, `light_on` = :light_on, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":light_on\", $this->light_on);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }else{\r\n $query = \"INSERT INTO `update` SET `user` = :user_id, `feed_id` = :feed_id, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":feed_id\", $this->feed_id);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }\r\n }\r\n }else{\r\n $query = \"INSERT INTO `feeds` SET `user_id` = :user_id, `light_on` = :light_on, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":light_on\", $this->light_on);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }\r\n }", "function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse mŒ fjernes nŒr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }", "function getStatus(){\n $this->status = 'Unknown';\n if($this->finAid == 1 && $this->totalOwed != 0){\n if($this->finaidQuestion[1] == ''){\n $this->status = 'Waiting for finaid application';\n return;\n }else{\n $this->status = 'Waiting for finaid decision';\n return;\n }\n }\n if($this->schoolFeeOwed != 0){\n $this->status = 'Waiting for school fee payment';\n return;\n }\n if($this->countryId[1] == 0){\n $this->status = 'Waiting for country preferences';\n return;\n }\n if($this->countryId[1] != 0 && $this->countryConfirm != 1){\n $this->status = 'Waiting for country assignments';\n return;\n }\n if($this->delegateFeeOwed != 0){\n $this->status = 'Waiting for delegate fee payment';\n return;\n }\n if(sizeof($this->attendees) == 0){\n $this->status = 'Waiting for attendee info';\n return;\n }\n if($this->totalOwed < 0){\n $this->status = 'Need Refund';\n return;\n }\n if(sizeof($this->attendees) == $this->totalAttendees && $this->totalOwed == 0){\n $this->status = 'Ready';\n return;\n }\n }", "public function getUpdateStatus() {\n return $this->_statusManager->getStatus ();\n }", "public function updateStatuses()\n {\n $affected = DB::update('UPDATE los_orders SET status_code=1 WHERE status_code=0 AND order_date IN (SELECT provide_date FROM los_lunchdates WHERE orders_placed IS NOT NULL)');\n $affected = DB::update('UPDATE los_orders SET status_code=0 WHERE status_code=1 AND order_date IN (SELECT provide_date FROM los_lunchdates WHERE orders_placed IS NULL)');\n }", "protected function checkStatus()\n {\n $status = $this->autoTestController->checkStatus(Tools::getValue('queueItemId', 0));\n\n if ($status['finished']) {\n $this->autoTestController->stop(\n function () {\n return LoggerService::getInstance();\n }\n );\n }\n\n PacklinkPrestaShopUtility::dieJson($status);\n }", "public function getStatus()\n {\n $status = $this->sendrequest('status', null);\n\n $result = [];\n\n $result['queue']['status'] = 'Active';\n\n $result['queue']['paused'] = false;\n if ($status['speedlimit_enabled'] != 0) {\n $result['queue']['speedlimit'] = $status['speedlimit'];\n } else {\n $result['queue']['speedlimit'] = 0;\n }\n $result['queue']['freediskspace'] = '-';\n $result['queue']['totaldiskspace'] = '-';\n $result['queue']['bytepersec'] = $status['speed'];\n $result['queue']['mbsize'] = 0;\n $result['queue']['mbremaining'] = 0;\n\n $secondsremaining = 0;\n $result['queue']['secondsremaining'] = (int) $secondsremaining;\n\n $downloads = [];\n $i = 0;\n $isPaused = false;\n foreach ($status['nzbs'] as $nzb) {\n $downloads[$i]['paused'] = $nzb['isPaused'];\n $isPaused = $isPaused | $nzb['isPaused'];\n $downloads[$i]['id'] = $nzb['id'];\n $downloads[$i]['filename'] = $nzb['uiTitle'];\n $downloads[$i]['category'] = $nzb['groupName'];\n $downloads[$i]['mbsize'] = round($nzb['totalDownloadSize'] / 1024 / 1024);\n $downloads[$i]['mbremaining'] = round(($nzb['totalDownloadSize'] - $nzb['downloadedSize']) / 1024 / 1024);\n $result['queue']['mbremaining'] = $result['queue']['mbremaining'] + $downloads[$i]['mbremaining'];\n $downloads[$i]['percentage'] = $nzb['progress'];\n $result['queue']['mbsize'] = $result['queue']['mbsize'] + $downloads[$i]['mbsize'];\n $i = $i + 1;\n }\n $result['queue']['paused'] = $isPaused;\n $result['queue']['slots'] = $downloads;\n $result['queue']['nrofdownloads'] = count($downloads);\n\n return $result;\n }", "abstract public static function getStatuses();", "function waitServerReady() {\n\n\t\t$this->client->query('GetStatus');\n\t\t$status = $this->client->getResponse();\n\t\tif ($status['Code'] != 4) {\n\t\t\t$this->console(\"Waiting for dedicated server to reach status 'Running - Play'...\");\n\t\t\t$this->console('Status: ' . $status['Name']);\n\t\t\t$timeout = 0;\n\t\t\t$laststatus = $status['Name'];\n\t\t\twhile ($status['Code'] != 4) {\n\t\t\t\tsleep(1);\n\t\t\t\t$this->client->query('GetStatus');\n\t\t\t\t$status = $this->client->getResponse();\n\t\t\t\tif ($laststatus != $status['Name']) {\n\t\t\t\t\t$this->console('Status: ' . $status['Name']);\n\t\t\t\t\t$laststatus = $status['Name'];\n\t\t\t\t}\n\t\t\t\tif (isset($this->server->timeout) && $timeout++ > $this->server->timeout)\n\t\t\t\t\ttrigger_error('Timed out while waiting for dedicated server!', E_USER_ERROR);\n\t\t\t}\n\t\t}\n\t}", "public function ticketActive() {\n if (func_num_args() > 0):\n $tid = func_get_arg(0);\n try {\n $data = array('status' => '1');\n $result = $this->update($data, 'ticket_id = \"' . $tid . '\"');\n } catch (Exception $e) {\n throw new Exception($e);\n }\n if ($result):\n return $result;\n else:\n return 0;\n endif;\n else:\n throw new Exception('Argument Not Passed');\n endif;\n }", "public function pollLast();", "function monitor_list_statuses() {\n $query = \"select distinct(`wf_status`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_status'];\n }\n return $ret;\n }", "private function getConnectStatus () \n\t\t{\t\n\t\t\t$status_data = file ( $this->config['status'] ) ;\n\t\t\t$i = 0;\n\t\t\twhile ( $i < count ( $status_data ) ) {\n\t\t\t\t$buffer = explode (\",\" , $status_data [$i] ) ;\n\t\t\t\tif ( count ( $buffer ) == 4) { /* part private ip and public ip */\n\t\t\t\t\tif ( strstr( $status_data[$i], $this->c ) ) {\n\t\t\t\t\t\t$status_info = explode (\",\" , $status_data[$i] );\n\t\t\t\t\t\t$this->result['data']['id'] = $this->c;\n\t\t\t\t\t\t$this->result['data']['status'] = \"Connected\";\n\t\t\t\t\t\t$this->result['data']['private_ip'] = trim($status_info[0]);\t\n\t\t\t\t\t\t$this->result['data']['public_ip'] = trim($status_info[2]);\t\n\t\t\t\t\t\t$this->result['data']['connect_date'] = trim($status_info[3]);\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t} /* Not found in openvpn-status.log */\n\t\t\tif ( ! isset( $this->result['data']['status'] ) ) \n\t\t\t\t$this->result['data']['result'] = \"Offline [note: status.log refresh every 1 minute.]\";\n\t\t\treturn;\n\t\t}", "public function testFilterStatusesReadyStatus()\r\n {\r\n $statusList = [\r\n $this->Artifacts::READY\r\n ];\r\n $result = $this->Artifacts->filterStatuses($statusList);\r\n $this->assertEquals($this->Artifacts::READY, $result);\r\n }", "public function syncStripeStatus()\n {\n $subscription = $this->asStripeSubscription();\n\n $this->stripe_status = $subscription->status;\n\n $this->save();\n }", "function GetUpdatesList($updates_dir)\n\t{\n\t\t$updates = $this->GetUpdatesFilesList($updates_dir);\n\t\t\n\t\t// get statuses from database\n\t\t$this->db->q('SELECT * FROM #_PREF_updates');\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$u_id = $item['rev_num'].'-'.strtoupper($item['type']);\n\t\t\tif (isset($updates[$u_id])) {\n\t\t\t\t$updates[$u_id]['status'] = $item['status'];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tforeach ($updates as $k=>$update) {\n\t\t\t// remove update\n\t\t\tif ($this->do_not_show_included_updates && $update['rev_num'] <= $this->current_revision) {\n\t\t\t\tunset($updates[$k]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// set update status\n\t\t\tif (empty($updates[$k]['status'])) {\n\t\t\t\tif ($update['rev_num'] <= $this->current_revision) $updates[$k]['status'] = 'included';\n\t\t\t\telse $updates[$k]['status'] = 'not applied';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($update['rev_num'] <= $this->current_revision) $updates[$k]['status'] = 'included';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tswitch ($updates[$k]['status']) {\n\t\t\t\tcase 'ok': $updates[$k]['status_html'] = '<span style=\"color: green; font-weight: bold;\">Ok</span>'; break;\n\t\t\t\tcase 'included': $updates[$k]['status_html'] = '<span style=\"color: silver; font-weight: bold;\">Included</span>'; break;\n\t\t\t\tcase 'not applied': $updates[$k]['status_html'] = '<span style=\"color: #D2D200; font-weight: bold;\">Not Applied</span>'; break;\n\t\t\t\tcase 'error': $updates[$k]['status_html'] = '<span style=\"color: red; font-weight: bold;\">Error!</span>'; break;\n\t\t\t\tdefault: \n\t\t\t\t\t$updates[$k]['status_html'] = $updates[$k]['status'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tuksort($updates, \"compare_updates\");\n\t\t\n\t\t/*echo \"<pre>\";\n\t\tvar_dump($updates);\n\t\techo \"</pre>\";*/\n\t\t\t\t\n\t\treturn $updates;\n\t}", "protected function fetchStatus()\n {\n return $this->fetch([\n 'model' => Status::class,\n 'query' => function ($model) {\n return $model->orderBy('name', 'ASC');\n },\n ]);\n }", "protected function _saveStatus()\n {\n try {\n\n /**\n * update task statuses with completion days\n */\n foreach( $this->_status as $key => $val ) {\n\n if ( in_array( $key, $this->_tasks ) ) {\n $task = Mage::getModel('jirafe_analytics/install')\n ->getCollection()\n ->addFieldToFilter( 'task', $key )\n ->getFirstItem();\n\n $task->setCompletedDt( $val );\n $task->save();\n }\n }\n\n /**\n * refresh status values in cache\n *\n */\n $this->_saveStatusToCache();\n\n return true;\n\n } catch (Exception $e) {\n Mage::helper('jirafe_analytics')->log('ERROR', 'Jirafe_Analytics_Model_Installer::_saveStatus()', $e->getMessage(), $e);\n return false;\n }\n }", "public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}", "public function statusAction()\n {\n //pobranie elemntu po polu hash\n $this->sliderCategory = SliderCategory::findOneByHash($this->_getParam('hash'));\n //sprawdzenie czy dany element istnieje\n $this->forward404Unless($this->sliderCategory, 'Slider category NOT Exists (' . $this->_getParam('hash') . ')');\n //sprawdzenie praw do elementu\n $this->forward403Unless(\n $this->getSelectedBaseUser()->hasAccess($this->sliderCategory),\n [$this->getSelectedBaseUser()->getId(), $this->sliderCategory->getId()]\n );\n\n //zmiana statusu\n $this->sliderCategory->is_active = !(bool) $this->sliderCategory->is_active;\n //zapis do bazy\n $this->sliderCategory->save();\n //przekierowanie na podstronę listy\n $this->_redirector->gotoRouteAndExit([], 'admin_slider-category');\n }", "public function poll()\n {\n return false;\n }", "private function updateTracking () {\n\t\t$this->newTrackingTable(); //create table if not exist\n\t\t$query = \"SELECT DISTINCT hostname FROM a2_posts\"; //get all hostnames to loop through.\n\t\t$res = $this->sqlResToArray($this->sendQuery($query));\n\t\t//loop through each hostname stored.\n\t\tforeach ($res as $temp) { //look through each hostname\n\t\t\t$hostname = $temp[\"hostname\"];\n\t\t\t// query tumblr for updated info\n\t\t\t$jsonData = file_get_contents(\"http://api.tumblr.com/v2/blog/\".$hostname.\"/likes?api_key=X4OwRgt85WvYhvIF8vFT4GeU8olMvf3HWKZvS6OKaMbeHBoXtG\");\n\t\t\t$newData = json_decode($jsonData);\n\n\t\t\t//loop through each post liked by blog (hostname)\n\t\t\tforeach ($newData->response->liked_posts as $post) {\n\t\t\t\t$query = \"DROP VIEW IF EXISTS temp\"; //drop previous temp view\n\t\t\t\t$this->sendQuery($query);\t\t\n\t\t\t\t//query the most recent tracking for this post from a2_tracking\n\t\t\t\t$query = \"CREATE VIEW temp AS SELECT * FROM a2_tracking WHERE url = '\".$post->post_url.\"'\"; \n\t\t\t\t$this->sendQuery($query);\n\t\t\t\t//most recent tracking has max id #; due to sync.\n\t\t\t\t$query = \"SELECT t1.* FROM temp t1 LEFT OUTER JOIN temp t2 ON (t1.url = t2.url AND t1.id < t2.id) WHERE t2.url IS NULL\";\n\t\t\t\t$res = $this->sendQuery($query);\n\t\t\t\t$previousTracking = $this->sqlResToArray($res);\n\t\t\t\t$timestamp = date(\"Y-m-d h:i:s a\", time()); //get timestamp\n\t\t\t\t\n\t\t\t\t//check if there is previous tracking, if not create new tracking entry\n\t\t\t\tif (!$previousTracking) { //no tracking exists, insert as the first\n\t\t\t\t\t$query = \"INSERT INTO a2_tracking (hostname, url, timestamp, sequence, increment, count) VALUES ('\".$hostname.\"', '\".$post->post_url.\"', '\".$timestamp.\"', 1, 0, '\".$post->note_count.\"')\";\n\t\t\t\t\t$this->sendQuery($query);\n\t\t\t\t} else { //tracking exists, need to update.\n\t\t\t\t\t//calculate new values\n\t\t\t\t\t$newSequence = $previousTracking[0][\"sequence\"] + 1;\n\t\t\t\t\t$newCount = $post->note_count;\n\t\t\t\t\t$increment = $newCount - $previousTracking[0][\"count\"];\n\t\t\t\t\t// insert new tracking entry\n\t\t\t\t\t$query = \"INSERT INTO a2_tracking (hostname, url, timestamp, sequence, increment, count) VALUES ('\".$hostname.\"', '\".$post->post_url.\"', '\".$timestamp.\"', '\".$newSequence.\"', '\".$increment.\"', '\".$newCount.\"')\";\n\t\t\t\t\t$this->sendQuery($query);\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "public function getTxStatus()\n {\n return $this->tx_status;\n }", "function SwissPostApiGetTransferStatus(Varien_Event_Observer $observer){\n $result = $observer->getData('result');\n $order_refs = $observer->getData('order_refs');\n if($result && $result->getValues()){\n $values = $result->getValues();\n foreach ($order_refs as $order_ref){\n foreach ($values as $status){\n if(stripos($status['order_ref'], $order_ref) !== false){ \n $order = Mage::helper('swisspostsales/Order')->__fromOrderRef($order_ref);\n if($order){\n Mage::helper('swisspostsales/Order')->processTransferStatus($order, $status);\n // set final status\n if(Mage::helper('swisspostsales/Order')->isCompleted($order)){\n Mage::helper('swisspostsales/Order')->__toCompleted($order);\n }\n }\n }\n }\n }\n }\n }", "protected function useTorrent() {\n return $this->config->getTorrentPaths()->match($this->getLocalPath());\n }", "function updateLiveFeedStatus($id, $status) {\nglobal $app, $debug, $jconf, $myjobid;\n\n\tif ( empty($status) ) return false;\n\n $values = array(\n\t\t'status' => $status\n\t);\n\n $converterNodeObj = $app->bootstrap->getModel('livefeeds');\n $converterNodeObj->select($id);\n $converterNodeObj->updateRow($values);\n \n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid . \".log\", \"[INFO] Livefeed id#\" . $id . \" status changed to '\" . $status . \"'.\", $sendmail = false);\n \n\treturn true;\n}", "public function UserListChangeStatus(): void{\n \n if(!ArtworkVerifier::setStatusList($_POST) || !Session::isLogin()){\n exit;\n }\n \n if(isset(UserList::where('user_list.user_id', Session::getUser()['id'])->where('user_list.artwork_id', $_POST['artwork_id'])->getOne()->id)){\n UserList::values([ 'user_list.status' => $_POST['status'] ])\n ->where('user_id' ,Session::getUser()['id'])\n ->where('artwork_id', $_POST['artwork_id'])\n ->update();\n exit;\n }\n }", "public static function sortByStatus(){\n $db = Db::getConnection();\n \n $result = $db->query('SELECT * FROM task ORDER BY status DESC');\n \n return $result->fetchAll();\n }", "public function status() {\n \n if(!$this->isReady()) {\n $this->error(\"status() - not ready.\");\n return false;\n }\n \n /* get the status */\n \n $details = $this->doCommand(\"status\");\n \n if(!$details) {\n $this->error(\"status() - could not get status: \".$this->getError());\n return false;\n }\n \n if(count($details) < 7) {\n $this->error(\"status() - missing status lines.\");\n return false;\n }\n \n /* we want the 'value' of each line */\n \n for($i=0; $i<7; $i++) {\n \n $item = trim($details[$i]);\n $matches = array();\n \n if(empty($item)) {\n continue;\n }\n \n if(!preg_match('/^[^:]+:\\s+(.*)$/', $item, $matches)) {\n $this->error(\"status() - can't match status line: $item\");\n return false;\n }\n $details[$i] = $matches[1];\n } \n \n /* convert to a PHP object */\n \n $result = (object)array(\n \"status\" => $details[0],\n \"reads\" => $details[1],\n \"writes\" => $details[2],\n \"uptime\" => $details[3],\n \"uphours\" => sprintf(\"%02d hours %02d min %02d sec\", floor($details[3]/3600), ($details[3]/60)%60, $details[3]%60),\n \"cmds\" => $details[4],\n \"config\" => $details[5],\n \"log\" => $details[6],\n );\n \n /* all done */\n \n return $result;\n }", "public function RelayStat($id)\n {\n return exec('tail -n 1 /home/pi/Desktop/Przyklad/blind_status.txt');\n }", "public function run()\n {\n $statuses = [\n ['name' => 'On track', 'value' => 'on-track', 'color' => '#00423f', 'bg' => '#00d4c8'],\n ['name' => 'At risk', 'value' => 'at-risk', 'color' => '#574500', 'bg' => '#ffd100'],\n ['name' => 'On track', 'value' => 'off-track', 'color' => '#fff', 'bg' => '#fb5779'],\n ];\n\n Status::insert($statuses);\n }", "public function status () {\n\n //GETS CURRENT NOTEPADID FROM REQUEST AND STORES IN VARIABLE\n $NotepadID = request('NotepadID');\n \n //FINDS TASK RECORD WITH ID REQUEST AND STORES IN OBJECT\n $data=Tasks::find(request('id'));\n \n //IF TASK STATUS EQUALS TRUE, THEN SET FALSE AND IF TASK STATUS\n //EQUALS FALSE THEN SET TRUE\n if ($data->status) {\n $data->status=0;\n } \n else {\n $data->status=1;\n }\n\n //SAVE DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$NotepadID\");\n }", "public static function updateStatus() {\n $status = lC_Products_Admin::updateStatus($_GET['pid'], $_GET['val']);\n \n if ($status) {\n lC_Cache::clear('category_tree');\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n } \n\n echo json_encode($result);\n }", "static public function status()\n {\n $GLOBALS['notification']->notify(array('listeners' => array('status', 'audio')));\n }", "public function getStatuses() {\n\t}", "public function updateAngelThumpChannels(): void\n {\n echo \"Updating Angel Thump Channels...\\n\";\n\n // Get all twitch channels from the database\n $angelThumpChannels = $this->channelRepository->getChannelsForService('angelthump');\n\n $usernames = [];\n\n foreach ($angelThumpChannels as $angelThumpChannel) {\n $usernames[] = $angelThumpChannel->name;\n }\n\n $liveStreamsMap = [];\n $offlineUsersMap = [];\n\n // Get current streams\n $streams = $this->angelThump->getStreams();\n\n $liveUsernames = [];\n\n foreach ($streams as $stream) {\n $liveStreamsMap[$stream->user->username] = $stream;\n $liveUsernames[] = $stream->user->username;\n }\n\n // For not live channels get the user information\n $offlineUsernames = array_values(array_diff($usernames, $liveUsernames));\n\n foreach($offlineUsernames as $offlineUsername) {\n $user = $this->angelThump->getUser($offlineUsername);\n\n if ($user === null) {\n continue;\n }\n\n $offlineUsersMap[$user->username] = $user;\n }\n\n $currentStreams = $this->streamRepository->getCurrentStreams();\n\n /** @var Stream[] */\n $currentStreamMap = [];\n\n // Create map of channel ID to stream\n foreach ($currentStreams as $currentStream) {\n $currentStreamMap[$currentStream->channelId] = $currentStream;\n }\n\n // Update database with updated info\n foreach($angelThumpChannels as $angelThumpChannel) {\n echo \"Updating database record for $angelThumpChannel->name...\\n\";\n\n // If the channel is live on AngelThump\n if (array_key_exists($angelThumpChannel->name, $liveStreamsMap)) {\n $stream = $liveStreamsMap[$angelThumpChannel->name];\n $angelThumpChannel->lastUpdated = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $angelThumpChannel->title = $stream->user->title;\n $angelThumpChannel->subtitle = '';\n $angelThumpChannel->image = $stream->thumbnail_url;\n $angelThumpChannel->live = true;\n $angelThumpChannel->viewers = $stream->viewer_count;\n\n // If stream doesn't exist make it\n if (!array_key_exists($angelThumpChannel->getId(), $currentStreamMap)) {\n $started = new DateTimeImmutable($stream->createdAt);\n $currentStream = new Stream($angelThumpChannel->getId(), $stream->id, $stream->user->title, $started);\n $angelThumpChannel->lastStream = $started;\n $this->streamRepository->save($currentStream);\n }\n\n $this->channelRepository->saveChannel($angelThumpChannel);\n \n\n // If the channel is not live on AngelTHump and there was user info\n } elseif (array_key_exists($angelThumpChannel->name, $offlineUsersMap)) {\n $user = $offlineUsersMap[$angelThumpChannel->name];\n $angelThumpChannel->lastUpdated = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $angelThumpChannel->title = $user->display_name;\n $angelThumpChannel->subtitle = '';\n $angelThumpChannel->image = $user->offline_banner_url !== '' ? $user->offline_banner_url : $user->profile_logo_url;\n $angelThumpChannel->live = false;\n $angelThumpChannel->viewers = 0;\n\n // If current stream exists, make it is stopped\n if (array_key_exists($angelThumpChannel->getId(), $currentStreamMap)) {\n $currentStream = $currentStreamMap[$angelThumpChannel->getId()];\n $currentStream->stoppedAt = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $this->streamRepository->save($currentStream);\n }\n $this->channelRepository->saveChannel($angelThumpChannel);\n }\n }\n }", "public function changeStatus(): void\n {\n if ('online' === $this->online_status) {\n if ($this->reference_id > 0) {\n $query = 'UPDATE '. rex::getTablePrefix() .'d2u_references_references '\n .\"SET online_status = 'offline' \"\n .'WHERE reference_id = '. $this->reference_id;\n $result = rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'offline';\n } else {\n if ($this->reference_id > 0) {\n $query = 'UPDATE '. rex::getTablePrefix() .'d2u_references_references '\n .\"SET online_status = 'online' \"\n .'WHERE reference_id = '. $this->reference_id;\n $result = rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'online';\n }\n\n // Don't forget to regenerate URL cache to make online machine available\n if (rex_addon::get('url')->isAvailable()) {\n d2u_addon_backend_helper::generateUrlCache('reference_id');\n d2u_addon_backend_helper::generateUrlCache('tag_id');\n }\n }", "public static function changeStatus($params)\n {\n $status = $params['status'] == 'offline' ? '0' : '1';\n $q = Doctrine_Query::create()->update('EmailLightBox')\n ->set('status', $status)\n ->where('id=?', $params['id'])\n ->execute();\n }", "private function initCurrentlyBeingDone() {\n global $wpdb;\n $tableUrls = Factory::databaseService()->getDbTableUrlsName();\n\n // URLs currently being crawled\n $resultsBeingCrawled = $wpdb->get_results(\"SELECT * FROM {$tableUrls}\n WHERE is_locked = TRUE\n AND saved_at IS NULL\n AND saved_post_id IS NULL\n AND recrawled_at IS NULL\n ORDER BY created_at ASC\n \");\n\n $this->urlsCurrentlyBeingCrawled = $this->addSiteDataToUrlTuples($resultsBeingCrawled);\n\n // Posts currently being recrawled\n $resultsBeingRecrawled = $wpdb->get_results(\"SELECT * FROM {$tableUrls}\n WHERE is_locked = TRUE\n AND saved_at IS NOT NULL\n AND saved_post_id IS NOT NULL\n ORDER BY updated_at ASC\n \");\n\n $this->postsCurrentlyBeingSaved = $this->getPostsFromUrlTuples($resultsBeingRecrawled);\n }", "private function refresh() {\r\n\r\n // try & catch wär zwar besser, funktioniert aber bei fsockopen leider nicht.. deshalb das unschöne @\r\n $this->socket = @fsockopen($this->ts3_host, $this->ts3_query, $errno, $errstr, $this->socket_timeout);\r\n\r\n if ($errno > 0 && $errstr != '') {\r\n $this->errors[] = 'fsockopen connect error: ' . $errno;\r\n return false;\r\n }\r\n\r\n if (!is_resource($this->socket)) {\r\n $this->errors[] = 'socket recource not exists';\r\n return false;\r\n }\r\n\r\n stream_set_timeout($this->socket, $this->socket_timeout);\r\n\r\n if (!empty($this->serverlogin) && !$this->sendCmd('login', $this->serverlogin['login'] . ' ' . $this->serverlogin['password'])) {\r\n $this->errors[] = 'serverlogin as \"' . $this->serverlogin['login'] . '\" failed';\r\n return false;\r\n }\r\n\r\n if (!$this->sendCmd(\"use \" . ( $this->ts3_sid ? \"sid=\" . $this->ts3_sid : \"port=\" . $this->ts3_port ))) {\r\n $this->errors[] = 'server select by ' . ( $this->ts3_sid ? \"ID \" . $this->ts3_sid : \"UDP Port \" . $this->ts3_port ) . ' failed';\r\n return false;\r\n }\r\n\r\n if (!$sinfo = $this->sendCmd('serverinfo')) {\r\n return false;\r\n }\r\n else {\r\n $this->sinfo = $this->splitInfo($sinfo);\r\n $this->sinfo['cachetime'] = time();\r\n\r\n if (substr($this->sinfo['virtualserver_version'], strpos($this->sinfo['virtualserver_version'], 'Build:') + 8, -1) < 11239) { // beta23 build is required\r\n $this->errors[] = 'your TS3Server build is to low..';\r\n return false;\r\n }\r\n }\r\n\r\n if (!$clist = $this->sendCmd('channellist', '-topic -flags -voice -limits')) {\r\n return false;\r\n }\r\n else {\r\n $clist = $this->splitInfo2($clist);\r\n foreach ($clist as $var) {\r\n $this->clist[] = $this->splitInfo($var);\r\n }\r\n }\r\n\r\n if (!$plist = $this->sendCmd('clientlist', '-away -voice -groups')) {\r\n $this->errors[] = 'playerlist not readable';\r\n return false;\r\n }\r\n else {\r\n $plist = $this->splitInfo2($plist);\r\n foreach ($plist as $var) {\r\n if (strpos($var, 'client_type=0') !== FALSE) {\r\n $this->plist[] = $this->splitInfo($var);\r\n }\r\n }\r\n\r\n if (!empty($this->plist)) {\r\n foreach ($this->plist as $key => $var) {\r\n $temp = '';\r\n if (strpos($var['client_servergroups'], ',') !== FALSE) {\r\n $temp = explode(',', $var['client_servergroups']);\r\n }\r\n else {\r\n $temp[0] = $var['client_servergroups'];\r\n }\r\n $t = '0';\r\n foreach ($temp as $t_var) {\r\n if ($t_var == '6') {\r\n $t = '1';\r\n }\r\n }\r\n if ($t == '1') {\r\n $this->plist[$key]['s_admin'] = '1';\r\n }\r\n else {\r\n $this->plist[$key]['s_admin'] = '0';\r\n }\r\n }\r\n\r\n usort($this->plist, array($this, \"cmp2\"));\r\n usort($this->plist, array($this, \"cmp1\"));\r\n }\r\n }\r\n\r\n fputs($this->socket, \"quit\\n\");\r\n\r\n $this->close();\r\n\r\n return true;\r\n }", "function pollTwitter(){\n\t/* make sure they're defined in config.php */\n $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET);\n \n $connection->format = 'json';\n \n if ($this->screen_name){\n $content = $connection->get('statuses/user_timeline', array('screen_name' => $this->screen_name));\n } else {\n die(MISSING_SCREEN_NAME);\n }\n \n $twitterRSSFeed = new TwitterRSSWriter($content);\n $twitterRSSFeed->populateHeadData();\n $twitterRSSFeed->createHead();\n $twitterRSSFeed->writeItems();\n \n // print_r($twitterRSSFeed);\n \n $rssContent = $twitterRSSFeed->returnXML();\n \n $fileHandle = fopen($this->feedfileName, \"w\");\n fwrite($fileHandle, $rssContent);\n fclose($fileHandle);\n \n header(\"Content-type: text/xml\");\n echo $rssContent;\n die();\n \n }", "public function update_status() {\n\t\tif ($_POST) {\n\t\t\t$data = array(\n\t\t\t\t'pos_id' => Arr::get($_POST,'pos_id'),\n\t\t\t\t'session_id' => Arr::get($_POST,'session_id'),\n\t\t\t\t'ts' => Arr::get($_POST,'ts'),\n\t\t\t);\n\t\t\t\n\t\t\tif ($this->_check_sig(Arr::get($_POST,'sig'), $data)) {\n\t\t\t\treturn $this->_get_status();\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "private function site_status_check() {\n\t\t$this->level = 4;\n\t\tEE::log( 'Checking and verifying site-up status. This may take some time.' );\n\t\t$httpcode = '000';\n\t\t$ch = curl_init( $this->site_name );\n\t\tcurl_setopt( $ch, CURLOPT_HEADER, true );\n\t\tcurl_setopt( $ch, CURLOPT_NOBODY, true );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, 10 );\n\n\t\t$i = 0;\n\t\ttry {\n\t\t\twhile ( 200 !== $httpcode && 302 !== $httpcode ) {\n\t\t\t\tcurl_exec( $ch );\n\t\t\t\t$httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\t\t\techo '.';\n\t\t\t\tsleep( 2 );\n\t\t\t\tif ( $i ++ > 60 ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( 200 !== $httpcode && 302 !== $httpcode ) {\n\t\t\t\tthrow new Exception( 'Problem connecting to site!' );\n\t\t\t}\n\t\t}\n\t\tcatch ( Exception $e ) {\n\t\t\t$this->catch_clean( $e );\n\t\t}\n\n\t}", "public function execute()\n {\n if (!$this->getName() || $this->getName() == $this->getPreviousName()) {\n Log::debug('Status skipped');\n return;\n }\n $this->save();\n\n $modelStrat = $this->getModelStrategy();\n if (!$modelStrat instanceof StatusStrategyInterface) {\n Log::warning(get_class($modelStrat) . ' does not implement StatusStrategyInterface');\n return;\n }\n\n // Trigger mail event depending on the model\n if ($modelStrat->triggerStatusChange($this)) {\n if (!$this->getEvent()) {\n $this->setEvent($this->makeEventName());\n $this->save();\n }\n // Trigger Event\n $e = new StatusEvent($this);\n if ($this->getConfig()->getEventDispatcher()) {\n // Fire event to setup status mail messages\n $this->getConfig()->getEventDispatcher()->dispatch(StatusEvents::STATUS_CHANGE, $e);\n // Trigger status events for system wide processing. EG: 'status.placement.not approved', status.placementrequest.pending'\n $this->getConfig()->getEventDispatcher()->dispatch($this->getEvent(), $e);\n // Fire the event to send those messages\n $this->getConfig()->getEventDispatcher()->dispatch(StatusEvents::STATUS_SEND_MESSAGES, $e);\n }\n }\n }", "public function StatusUpdate()\n {\n \n $fb = new Facebook\\Facebook([\n\t\t\t'app_id' => $this->conf_array['appId'],\n\t\t\t'app_secret' => $this->conf_array['secret'],\n\t\t\t'default_graph_version' => 'v2.6'\n\t\t]);\n\t\t\n\t$linkData = [\n 'message' => $this->text,\n ];\n\ttry \n\t{\n // Returns a `Facebook\\FacebookResponse` object\n $response = $fb->post('/me/feed', $linkData, $this->conf_array['accessToken']);\n $graphNode = $response->getGraphNode();\n return 'success';\n\t} \n\tcatch(Facebook\\Exceptions\\FacebookResponseException $e) \n\t{\n return 'error';\n \n\t} \n\tcatch(Facebook\\Exceptions\\FacebookSDKException $e)\n\t{\n return 'error';\n\t}\n \n\t\t\n\t\t\n }", "public static function munim_schedule_status_update() {\n\t\tif ( ! wp_next_scheduled( 'munim_update_estimate_status' ) ) {\n\t\t\twp_schedule_event( time(), 'daily', 'munim_update_estimate_status' );\n\t\t}\n\t}", "private function transferAllPlaylists($status)\n {\n // all of them have to be waived before playlists can be transferred\n $allWpWaived = \\array_reduce(\n $this->wpPlaylistRepo->getByIdList($status->wpOnlyPlaylistIdList),\n function($carry, $wpPl) {\n return $carry && $wpPl->waiveMatch;\n },\n true\n );\n if ($allWpWaived) {\n $ytPlaylists = \\array_map(array($this->ytPlaylistRepo, 'getById'), $status->ytOnlyPlaylistIdList);\n foreach ($ytPlaylists as $ytPl) {\n $this->transferPlaylist($ytPl);\n }\n }\n }", "function process_status_change ()\n{\n // Only the bid chair has privilege to access this page\n\n if (! user_has_priv (PRIV_BID_COM))\n return display_access_error ();\n\n // Check for a sequence error\n\n if (out_of_sequence ())\n return display_sequence_error (false);\n\n // Extract the BidId\n\n $BidId = intval (trim ($_REQUEST['BidId']));\n if (0 == $BidId)\n return display_error (\"BidId not specified!\");\n\n $Status = trim ($_POST['Status']);\n if (1 == get_magic_quotes_gpc())\n $Status = stripslashes ($Status);\n\n // Fetch the status to see if this is really a change\n\n $sql = \"SELECT Title, Status, EventId From Bids WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query failed for BidId $BidId\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find BidId $BidId\");\n\n if (1 != mysql_num_rows ($result))\n return display_error (\"Found multiple entries for BidId $BidId\");\n\n $row = mysql_fetch_object ($result);\n\n if ($row->Status == $Status)\n display_error (\"Status unchanged for $row->Title\");\n\n // Update the bid status\n\n $sql = \"UPDATE Bids SET Status='$Status' WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Failed to update status for BidId $BidId\");\n\n // Handle dropped bids\n\n if ('Dropped' == $Status)\n return drop_bid ($BidId, $row->EventId);\n\n // Bids that have moved to Under Review need to have a discussion entry\n // added\n\n if ('Under Review' == $Status)\n return create_feedback_forum ($BidId);\n\n // If the status isn't accepted, we're done\n\n if ('Accepted' != $Status)\n return TRUE;\n\n // Fetch the bid information and stuff it into the $_POST array so we\n // so we can write it into the User and Event tables\n\n $sql = \"SELECT * FROM Bids WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query failed for BidId $BidId\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find BidId $BidId\");\n\n if (1 != mysql_num_rows ($result))\n return display_error (\"Found multiple entries for BidId $BidId\");\n\n $row = mysql_fetch_array ($result, MYSQL_ASSOC);\n\n foreach ($row as $key => $value)\n {\n if (1 == get_magic_quotes_gpc())\n $_POST[$key] = mysql_real_escape_string ($value);\n else\n $_POST[$key] = $value;\n }\n\n// dump_array (\"_POST\", $_POST);\n\n // If the EventId is 0, create an event\n\n if (0 != $row['EventId'])\n $EventId = intval ($row['EventId']);\n else\n {\n $EventId = add_event ($row);\n if (! is_int ($EventId))\n return FALSE;\n\n // Update the bid with the event ID\n\n $sql = \"UPDATE Bids SET EventId='$EventId' WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Failed to update EventId for BidId $BidId\");\n }\n\n // If the submitter is unpaid, comp him or her now\n\n $UserId = intval ($_POST['UserId']);\n\n // Let the submitter deal with who's comped\n/*\n $sql = \"SELECT CanSignup FROM Users WHERE UserId=$UserId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query for user payment status failed for UserId $UserId\");\n $row = mysql_fetch_object ($result);\n if (! $row)\n return display_error (\"Failed to find user for UserId $UserId\");\n\n if (is_unpaid ($row->CanSignup))\n comp_user ($UserId, $EventId);\n*/\n // Add the lead GM as a GM for the game\n\n $sql = \"INSERT INTO GMs SET EventId=$EventId, UserId=$UserId,\";\n $sql .= ' Submitter=\"Y\", ReceiveConEMail=\"Y\",';\n $sql .= ' UpdatedById=' . $_SESSION[SESSION_LOGIN_USER_ID];\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"GM insertion failed\");\n\n return TRUE;\n}", "function process_status_change ()\n{\n // Only the bid chair has privilege to access this page\n\n if (! user_has_priv (PRIV_BID_COM))\n return display_access_error ();\n\n // Check for a sequence error\n\n if (out_of_sequence ())\n return display_sequence_error (false);\n\n // Extract the BidId\n\n $BidId = intval (trim ($_REQUEST['BidId']));\n if (0 == $BidId)\n return display_error (\"BidId not specified!\");\n\n $Status = trim ($_POST['Status']);\n if (1 == get_magic_quotes_gpc())\n $Status = stripslashes ($Status);\n\n // Fetch the status to see if this is really a change\n\n $sql = \"SELECT Title, Status, EventId From Bids WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query failed for BidId $BidId\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find BidId $BidId\");\n\n if (1 != mysql_num_rows ($result))\n return display_error (\"Found multiple entries for BidId $BidId\");\n\n $row = mysql_fetch_object ($result);\n\n if ($row->Status == $Status)\n display_error (\"Status unchanged for $row->Title\");\n\n // Update the bid status\n\n $sql = \"UPDATE Bids SET Status='$Status' WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Failed to update status for BidId $BidId\");\n\n // Handle dropped bids\n\n if ('Dropped' == $Status)\n return drop_bid ($BidId, $row->EventId);\n\n // Bids that have moved to Under Review need to have a discussion entry\n // added\n\n if ('Under Review' == $Status)\n return create_feedback_forum ($BidId);\n\n // If the status isn't accepted, we're done\n\n if ('Accepted' != $Status)\n return TRUE;\n\n // Fetch the bid information and stuff it into the $_POST array so we\n // so we can write it into the User and Event tables\n\n $sql = \"SELECT * FROM Bids WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query failed for BidId $BidId\");\n\n if (0 == mysql_num_rows ($result))\n return display_error (\"Failed to find BidId $BidId\");\n\n if (1 != mysql_num_rows ($result))\n return display_error (\"Found multiple entries for BidId $BidId\");\n\n $row = mysql_fetch_array ($result, MYSQL_ASSOC);\n\n foreach ($row as $key => $value)\n {\n if (1 == get_magic_quotes_gpc())\n $_POST[$key] = mysql_real_escape_string ($value);\n else\n $_POST[$key] = $value;\n }\n\n// dump_array (\"_POST\", $_POST);\n\n // If the EventId is 0, create an event\n\n if (0 != $row['EventId'])\n $EventId = intval ($row['EventId']);\n else\n {\n $EventId = add_event ($row);\n if (! is_int ($EventId))\n return FALSE;\n\n // Update the bid with the event ID\n\n $sql = \"UPDATE Bids SET EventId='$EventId' WHERE BidId=$BidId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Failed to update EventId for BidId $BidId\");\n }\n\n // If the submitter is unpaid, comp him or her now\n\n $UserId = intval ($_POST['UserId']);\n\n // Let the submitter deal with who's comped\n/*\n $sql = \"SELECT CanSignup FROM Users WHERE UserId=$UserId\";\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error (\"Query for user payment status failed for UserId $UserId\");\n $row = mysql_fetch_object ($result);\n if (! $row)\n return display_error (\"Failed to find user for UserId $UserId\");\n\n if (is_unpaid ($row->CanSignup))\n comp_user ($UserId, $EventId);\n*/\n\n // Add the submitter as a teacher for the class\n // if this is a panel, don't add, they have to be selected later.\n if ($row['GameType'] != 'Panel')\n {\n add_gm($EventId, $UserId, \"teacher\");\n }\n return TRUE;\n}", "public function retrieveReactorStatus()\n {\n return $this->start()->uri(\"/api/reactor\")\n ->get()\n ->go();\n }", "public function mark_stale_entities() {\n $this->update_by('active', TRUE, array('scrape_status' => self::ENTITY_IS_STALE));\n }", "public function updateStatus(): void\n {\n $data = json_encode($this->getStatus(), JSON_PRETTY_PRINT);\n File::put(public_path(self::STATUS_FILE_NAME), $data);\n }", "function checkLastUpdated() {\r\n $conn = mysql_connect($this->mysql_host,$this->mysql_user,$this->mysql_pass);\r\n \r\n $rs = mysql_select_db($this->mysql_db,$conn);\r\n \r\n $sql = \"SHOW TABLE STATUS FROM \".$this->mysql_db.\" LIKE '\".$this->mysql_table.\"'\";\r\n \r\n $rs = mysql_query($sql,$conn);\r\n \r\n if(mysql_num_rows($rs) == 0 ) {\r\n \r\n $this->createTable();\r\n } else {\r\n $row = mysql_fetch_array($rs);\r\n if(time() > (strtotime($row[\"Update_time\"])+(12*60*60)) ) {\r\n \r\n $this->downloadExchangeRates();\r\n }\r\n }\r\n }", "public static function statusUpdate(Bot $bot)\n {\n // Setting OAuth parameters\n self::setOAuth($bot);\n\n $random = rand(0, 8);\n switch ($random) {\n\n // Retweet from the database\n case 0:\n\n if ($tweet = Tweet::getNext($bot)) {\n \\Log::info('[' . $bot->screen_name . '] Retweeting and liking from the DB : ' . html_entity_decode($tweet->text));\n\n try {\n \\Twitter::postRt($tweet->id);\n \\Twitter::postFavorite(['id' => $tweet->id]);\n Tweet::flagRetweeted($tweet->id);\n Bot::isFine($bot);\n } catch (\\Exception $e) {\n \\Log::error('[' . $bot->screen_name . '] Retweeting and liking from the DB : ' . $e->getMessage());\n Bot::addError($bot);\n\n // Try again\n self::statusUpdate($bot);\n }\n }\n\n break;\n\n // Tweeting original content\n case 1:\n case 2:\n case 3:\n case 4:\n\n $tweets = self::getRandomTweets($bot);\n $tweet = $tweets[(rand(0, 10))];\n\n \\Log::info('[' . $bot->screen_name . '] Tweeting something interesting : ' . html_entity_decode($tweet['text']));\n self::runRequest($bot, 'postTweet', ['status' => html_entity_decode($tweet['text'])]);\n\n break;\n\n // Retweeting\n case 5:\n case 6:\n case 7:\n case 8:\n\n $tweets = self::getRandomTweets($bot);\n $tweet = $tweets[(rand(0, 10))];\n\n \\Log::info('[' . $bot->screen_name . '] Retweeting and liking something interesting : ' . html_entity_decode($tweet['text']));\n\n try {\n \\Twitter::postRt($tweet['id']);\n \\Twitter::postFavorite(['id' => $tweet['id']]);\n Bot::isFine($bot);\n } catch (\\Exception $e) {\n \\Log::error('[' . $bot->screen_name . '] Retweeting and liking something interesting : ' . $e->getMessage());\n Bot::addError($bot);\n\n // Try again\n self::statusUpdate($bot);\n }\n\n break;\n }\n }", "function practice_status()\n {\n $query = \"UPDATE\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tSET\n\t\t\t\t\tStatus = :status\n\t\t\t\tWHERE\n\t\t\t\t\tid = :id AND Viewer_ID = :vid\";\n\n $stmt = $this->conn->prepare($query);\n\t\t\n\t\t$stmt->bindParam(':status', $this->status);\n $stmt->bindParam(':id', $this->id);\n\t\t$stmt->bindParam(':vid', $this->Viewer_ID);\n\n // execute the query\n if ($stmt->execute()) {\n return true;\n } else {\n return false;\n }\n }", "public function statusUpdate($theTweet,$shrinkURLs=true){\n\t\tif(true===$shrinkURLs){\t\t\t\n\t\t\t$regex = '@((https?://)?([-\\w]+\\.[-\\w\\.]+)+\\w(:\\d+)?(/([-\\w/_\\.]*(\\?\\S+)?)?)*)@';\n\t\t\t$theTweet = preg_replace_callback($regex, array(&$this, 'createTinyURLCallback'), $theTweet);\n\t\t}\n\t\t\n\t\tif(Configure::read('debug') == 0) $this->save(array('status' => $theTweet));\n\t\telse debug($theTweet);\n\t}", "public function updateUrgencyStatuses() {\n\n\n $deadlineOverdue = date('Y-m-d H:i:s', strtotime('-' . Configure::read('TICKET.OVERDUE_DAYS') . ' days'));\n $overdueTickets = $this->getPendingTicketsByAge($deadlineOverdue);\n\n foreach ($overdueTickets as $i => $overdueTicket) {\n\n $this->id = $overdueTicket['Ticket']['ticket_id'];\n $overdueTicket['Ticket']['status'] = 'Overdue';\n $this->save($overdueTicket, array('validate' => false, 'modified' => false, 'callbacks' => false));\n }\n\n\n $deadlineUrgend = date('Y-m-d H:i:s', strtotime('-' . Configure::read('TICKET.URGEND_DAYS') . ' days'));\n $urgendTickets = $this->getPendingTicketsByAge($deadlineUrgend, array('New', 'Requested'));\n\n foreach ($urgendTickets as $i => $urgendTicket) {\n\n $this->id = $urgendTicket['Ticket']['ticket_id'];\n $urgendTicket['Ticket']['status'] = 'Urgend';\n $this->save($urgendTicket, array('validate' => false, 'modified' => false, 'callbacks' => false));\n }\n\n }", "public function getStatusData()\r\n\t{\r\n\t\t$data = array(\r\n\t\t\t'source' => array(\r\n\t\t\t\t'a' => array(\r\n\t\t\t\t\t'selected' => false,\r\n\t\t\t\t\t'preferred' => false,\r\n\t\t\t\t\t'voltage' => false,\r\n\t\t\t\t\t'frequency' => false,\r\n\t\t\t\t\t'status' => false,\r\n\t\t\t\t),\r\n\t\t\t\t'b' => array(\r\n\t\t\t\t\t'selected' => false,\r\n\t\t\t\t\t'preferred' => false,\r\n\t\t\t\t\t'voltage' => false,\r\n\t\t\t\t\t'frequency' => false,\r\n\t\t\t\t\t'status' => false,\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t'phaseSynchronization' => false,\r\n\t\t\t'totalLoad' => false,\r\n\t\t\t'totalPower' => false,\r\n\t\t\t'peakLoad' => false,\r\n\t\t\t'energy' => false,\r\n\t\t\t'powerSupplyStatus' => false,\r\n\t\t\t'communicationStatus' => false,\r\n\t\t);\r\n\r\n\t\t$this->hr->get('/status_update.html');\r\n\r\n\t\tif ($this->hr->result) {\r\n\t\t\t// selected source\r\n\t\t\tif (preg_match('/selected source<\\/span>\\s*<span class=\"txt\">source\\s+([a-z])/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$source = strtolower($matches[1]);\r\n\t\t\t\t$data['source'][$source]['selected'] = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// preferred source\r\n\t\t\tif (preg_match('/preferred source<\\/span>\\s*<span class=\"txt\">source\\s+([a-z])/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$source = strtolower($matches[1]);\r\n\t\t\t\t$data['source'][$source]['preferred'] = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// source voltage\r\n\t\t\tif (preg_match('/source voltage \\(a\\/b\\)<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)\\s*\\/?\\s*([0-9\\.]*)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['source']['a']['voltage'] = $matches[1];\r\n\t\t\t\t$data['source']['b']['voltage'] = $matches[2];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// frequency\r\n\t\t\tif (preg_match('/source frequency \\(a\\/b\\)<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)\\s*\\/?\\s*([0-9\\.]*)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['source']['a']['frequency'] = $matches[1];\r\n\t\t\t\t$data['source']['b']['frequency'] = $matches[2];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// status\r\n\t\t\tif (preg_match('/source status \\(a\\/b\\)<\\/span>\\s*<span class=\"txt\">([a-z]+)\\s*\\/?\\s*([a-z]*)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['source']['a']['status'] = ($matches[1] == 'OK') ? true : false;\r\n\t\t\t\t$data['source']['b']['status'] = ($matches[2] == 'OK') ? true : false;\r\n\t\t\t}\r\n\r\n\t\t\t// phase sync\r\n\t\t\tif (preg_match('/phase synchronization<\\/span>\\s*<span class=\"txt\">([a-z]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['phaseSynchronization'] = ($matches[1] == 'No') ? false : true;\r\n\t\t\t}\r\n\r\n\t\t\t// total load\r\n\t\t\tif (preg_match('/total\\s+load<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['totalLoad'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// total power\r\n\t\t\tif (preg_match('/total\\s+power<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['totalPower'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// peak load\r\n\t\t\tif (preg_match('/peak\\s+load<\\/span>\\s*<span class=\"l2b txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['peakLoad'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// energy\r\n\t\t\tif (preg_match('/energy<\\/span>\\s*<span class=\"l2b txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['energy'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// PS status\r\n\t\t\tif (preg_match('/power supply status<\\/span>\\s*<span class=\"txt\">([a-z]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['powerSupplyStatus'] = ($matches[1] == 'OK') ? true : false;\r\n\t\t\t}\r\n\r\n\t\t\t// comm status\r\n\t\t\tif (preg_match('/communication status<\\/span>\\s*<span class=\"txt\">([a-z]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['communicationStatus'] = ($matches[1] == 'OK') ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "function updateStatus() {\n global $status, $spambotDataLoc;\n return file_put_contents( $spambotDataLoc.'sbstatus', serialize($status) ); \n}", "public function updateTwitchChannels(): void\n {\n echo \"Updating twitch channels...\\n\";\n\n // Get all twitch channels from the database\n $twitchChannels = $this->channelRepository->getChannelsForService('twitch');\n\n $twitchUsernames = [];\n\n foreach ($twitchChannels as $twitchChannel) {\n $twitchUsernames[] = $twitchChannel->name;\n }\n\n $liveStreamsMap = [];\n $offlineUsersMap = [];\n\n // Get current streams\n $streams = $this->twitch->getStreams($twitchUsernames);\n\n $liveUsernames = [];\n\n foreach ($streams as $stream) {\n $liveStreamsMap[$stream->user_login] = $stream;\n $liveUsernames[] = $stream->user_login;\n }\n\n // For not live channels get the user information\n $offlineUsernames = array_values(array_diff($twitchUsernames, $liveUsernames));\n $users = $this->twitch->getUsers($offlineUsernames);\n\n foreach ($users as $user) {\n $offlineUsersMap[$user->login] = $user;\n }\n\n $currentStreams = $this->streamRepository->getCurrentStreams();\n\n /** @var Stream[] */\n $currentStreamMap = [];\n\n // Create map of channel ID to stream\n foreach ($currentStreams as $currentStream) {\n $currentStreamMap[$currentStream->channelId] = $currentStream;\n }\n\n // Update database with updated info\n foreach($twitchChannels as $twitchChannel) {\n echo \"Updating database record for $twitchChannel->name...\\n\";\n\n // If the channel is live on twitch\n if (array_key_exists($twitchChannel->name, $liveStreamsMap)) {\n $stream = $liveStreamsMap[$twitchChannel->name];\n $thumbnail = str_replace('{width}x{height}', '320x180', $stream->thumbnail_url);\n $twitchChannel->lastUpdated = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $twitchChannel->title = $stream->title;\n $twitchChannel->subtitle = $stream->game_name;\n $twitchChannel->image = $thumbnail;\n $twitchChannel->live = true;\n $twitchChannel->viewers = $stream->viewer_count;\n\n // If stream doesn't exist make it\n if (!array_key_exists($twitchChannel->getId(), $currentStreamMap)) {\n $started = new DateTimeImmutable($stream->started_at);\n $currentStream = new Stream($twitchChannel->getId(), $stream->id, $stream->title, $started);\n $twitchChannel->lastStream = $started;\n $this->streamRepository->save($currentStream);\n }\n\n $this->channelRepository->saveChannel($twitchChannel);\n \n\n // If the channel is not live on twitch and there was user info\n } elseif (array_key_exists($twitchChannel->name, $offlineUsersMap)) {\n $user = $offlineUsersMap[$twitchChannel->name];\n $twitchChannel->lastUpdated = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $twitchChannel->title = $user->display_name;\n $twitchChannel->subtitle = '';\n $twitchChannel->image = $user->offline_image_url !== '' ? $user->offline_image_url : $user->profile_image_url;\n $twitchChannel->live = false;\n $twitchChannel->viewers = 0;\n\n // If current stream exists, make it is stopped\n if (array_key_exists($twitchChannel->getId(), $currentStreamMap)) {\n $currentStream = $currentStreamMap[$twitchChannel->getId()];\n $currentStream->stoppedAt = new DateTimeImmutable('now', new DateTimeZone('UTC'));\n $this->streamRepository->save($currentStream);\n }\n\n $this->channelRepository->saveChannel($twitchChannel);\n }\n }\n }", "public function status() { \n\n\t\t$track = $this->_mpd->current_track_id;\n\n\t\t/* Construct the Array */\n\t\t$array['state'] \t= $this->_mpd->state;\n\t\t$array['volume']\t= $this->_mpd->volume;\n\t\t$array['repeat']\t= $this->_mpd->repeat;\n\t\t$array['random']\t= $this->_mpd->random;\n\t\t$array['track']\t\t= $track+1;\n\t\t\n\t\t$url_data = $this->parse_url($this->_mpd->playlist[$track]['file']);\n\t\t$song = new Song($url_data['oid']);\n\t\t$array['track_title'] \t= $song->title;\n\t\t$array['track_artist'] \t= $song->get_artist_name();\n\t\t$array['track_album']\t= $song->get_album_name();\n\n\t\treturn $array;\n\n\t}", "public function update()\n {\n \n foreach($this->feed->sources as $source){\n \n //Find the right source handler.\n switch($source->type->get()){\n \n case 'TWITTER_TIMELINE':\n $handler = new TwitterTimelineSourceHandler($source);\n break;\n \n case 'TWITTER_SEARCH':\n $handler = new TwitterSearchSourceHandler($source);\n break;\n \n }\n \n //Query for new messages.\n $messages = $handler->query();\n \n //Save those messages.\n mk('Logging')->log('Message board', 'New messages', $messages->size());\n foreach($messages as $message){\n $message\n ->save()\n ->save_webpages()\n ->save_images();\n }\n \n }\n \n }" ]
[ "0.5726237", "0.56728107", "0.56569445", "0.5596818", "0.5439202", "0.53294647", "0.5262726", "0.51956004", "0.51908374", "0.5182938", "0.51614743", "0.50909156", "0.50010246", "0.49920884", "0.49708086", "0.49579227", "0.49475378", "0.49447253", "0.49428353", "0.49179494", "0.49040398", "0.49017963", "0.49006158", "0.4891864", "0.4882337", "0.4839825", "0.4839825", "0.48396435", "0.48291603", "0.48190796", "0.48005953", "0.47799286", "0.47788486", "0.4777013", "0.47625864", "0.47566307", "0.47555622", "0.47359216", "0.47133946", "0.4712971", "0.47052088", "0.47029296", "0.4700468", "0.4689015", "0.46844146", "0.46827236", "0.46774745", "0.46725813", "0.46572566", "0.46553913", "0.4653109", "0.4640373", "0.46380007", "0.462299", "0.46214473", "0.46209228", "0.4619765", "0.461444", "0.46122614", "0.4611438", "0.4610336", "0.46094036", "0.4606187", "0.46046552", "0.45968562", "0.4596227", "0.4590526", "0.457746", "0.45713848", "0.45673478", "0.4564294", "0.45601898", "0.45582643", "0.4556986", "0.4552533", "0.45484707", "0.45454344", "0.45367324", "0.45348537", "0.4534467", "0.45338088", "0.4527242", "0.4526063", "0.45243606", "0.45191908", "0.45148408", "0.45148408", "0.4510088", "0.4508229", "0.4507203", "0.45067123", "0.4504843", "0.44904566", "0.44782576", "0.44741926", "0.44738668", "0.44736847", "0.44719046", "0.44672418", "0.4457592" ]
0.7297865
0
TODO: use memcached here!
public function getSessionIdHeader(TransmissionSettings $transmissionSettings, $forceRenewal = false) { if (!isset($this->sessionIdHeader) || $forceRenewal) { $host = $transmissionSettings->getIpOrHost(); $port = $transmissionSettings->getPort(); $username = $transmissionSettings->getUsername(); $password = $transmissionSettings->getPassword(); $credentials = "$username:$password"; $endpoint = "http://$host:$port/transmission/rpc"; $headers = array( 'Content-Type: application/json', "Authorization: Basic " . base64_encode($credentials) ); //TODO: factorize in a method -- prepareApiCall... $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $endpoint, CURLOPT_HTTPHEADER => $headers )); $result = curl_exec($curl); $this->transmissionLogger->debug("[TRANSMISSION-SESSIONID] The result of invoking transmission for header is: \n $result \n "); $sessionIdHeader = null; $matches = array(); if (preg_match('/^(.*<code>)(.*)(<\/code>.*)$/', $result, $matches)) { // 0-> everything, 1 -> first (), 2 -> second () $sessionIdHeader = $matches[2]; $this->transmissionLogger->debug("[TRANSMISSION-SESSIONID] The session id header is ". $sessionIdHeader); $this->sessionIdHeader = $sessionIdHeader; } curl_close($curl); } return $this->sessionIdHeader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function cacheData();", "protected function saveToCache() {}", "public function saveToCacheForever();", "public function memCached() { return true; }", "function cache();", "protected function getMemoryCache() {}", "abstract function cache_output();", "public function cacheGet() {\n }", "public function getFromCache() {}", "protected function loadFromCache() {}", "private function cacheThis()\n\t{\n\t\t$q = 'UPDATE twitterSearch SET searchResults = \"' .addslashes($this->_results) .'\" WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\t$r = mysql_query($q, CONN) or die('could not update the results in the database for caching');\n\t}", "function &createCache() {}", "public function updateCache();", "function get ($key) {\n return $this->memcached->get($key);\n }", "public function startCache() {}", "public function getCache();", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "public function cache() {\n $this->select(null,null,'slug asc');\n\t\tforeach ($this->cursor as $rec) {\n\t\t\t$this->cache[$rec->slug] = $rec->value;\n\t\t}\n\t}", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "public function setUpCache();", "public function cache_gc() {\n // TO DO!!!!!\n }", "protected function initCaches() {}", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$steamIds)) {\n self::$steamIds[$this->steamId64] = $this;\n if(!empty($this->customUrl) &&\n !array_key_exists($this->customUrl, self::$steamIds)) {\n self::$steamIds[$this->customUrl] = $this;\n }\n }\n }", "protected function initializeCache() {}", "protected function initializeCache() {}", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "abstract public function installMemcached();", "public function makeCacheHash() {}", "public static function getCache() {}", "function start_cache()\r\n\t{\r\n\t\t$this->db->start_cache();\r\n\t}", "public function saveToCache(){\r\n\t\t$n = \"hotspot_\" . $this->id;\r\n\r\n\t\t\\CacheHandler::setToCache($n,$this,20*60);\r\n\t}", "private function get_cache() {\n exit(file_get_contents($this->cache_file));\n }", "protected function isMemcachedUsed() {}", "protected function isMemcachedUsed() {}", "function __construct() {\n $this->_cache = [];\n }", "protected function obtainCacheDependentData()\n\t{\n\t}", "function cache_get($cid, $table = 'cache') {\n global $trampoline_cache;\n\n //Use a simple variable based cache.\n //Cache will automatically expire after request completion\n if (is_array($trampoline_cache) && array_key_exists($table . '_' . $cid, $trampoline_cache) && $trampoline_cache[$table.'_'.$cid]) {\n return array('data' => $trampoline_cache[$table.'_'.$cid]);\n } else {\n return FALSE;\n }\n}", "protected function _clearDataCache() {}", "protected function saveToPackageCache() {}", "private function readCache(): void{\n //stdClass é uma classe predefinido ou dinamica\n $this->cache = new stdClass();\n if(file_exists('cache.cache')){\n $this->cache = json_decode(file_get_contents('cache.cache'));\n }\n }", "function training_performance_callback() {\n global $user;\n $obj = new stdClass();\n $obj->some_var = rand(1, 500);\n $cid = 'cache_for_user_' . $user->uid;\n cache_set($cid, $obj, 'cache_training_performance', CACHE_PERMANENT);\n //cache_clear_all($cid, 'cache_training_performance');\n dpm(cache_get($cid, 'cache_training_performance'));\n $output = 'Test cache!' . rand(1, 500);\n\n return array(\n array(\n '#type' => 'markup',\n '#markup' => $output,\n ),\n );\n}", "public function cacheAll()\n {\n $data = $this->resource->get()->wait();\n\n $this->client->pipeline(function ($pipe) use ($data) {\n foreach ( $data->result->result as $k => $v ) {\n $pipe->set($this->keyPrefix . $v->id, serialize($v));\n }\n });\n\n return;\n }", "protected function extractDataFromCache()\n\t{\n\t\treturn false;\n\t}", "protected function printCachedInfo() {}", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public function realPageCacheContent() {}", "static function cached_all(){\n return static::get_cache();\n }", "public function index()\n {\n //\n\n// cache()->remember('artists', now()->addSeconds(4), function (){\n// $artists=Artist::with('songs')->paginate();\n// return ArtistIndexResource::collection($artists);\n// });\n// if ($response=cache()->pull('artists')){\n\n // return $response;}\n $artists=Artist::with('songs')->paginate();\n $response= ArtistIndexResource::collection($artists);\n cache()->put('artists',$response,now()->addSeconds(10));\n return $response;\n }", "function _prime_network_caches($network_ids)\n {\n }", "abstract public function retrieve();", "public function isCached() {}", "abstract protected function clearCache();", "protected function getRuntimeCache() {}", "function testRedis(){\n// Cache::remember('demo_redis_3',60,function(){\n// return 'hello redis';\n// });\n// Cache::forget('demo_redis_3');\n }", "public function get_test_persistent_object_cache()\n {\n }", "public function test_page_cache()\n {\n }", "protected function fetch_data(&$cache)\n {\n }", "function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL) {\n global $trampoline_cache;\n\n //Use a simple variable based cache.\n //Cache will automatically expire after request completion\n if (!isset($trampoline_cache)) {\n $trampoline_cache = array();\n }\n $trampoline_cache[$table.'_'.$cid] = $data;\n}", "function markup_from_cache();", "public function getObjFromCache($key);", "public function testCacheGet() \n\t{\n\t\t$key = uniqid('key_');\n\t\t$value = uniqid('value_');\n\t\t$this->assertFalse(\\Cache\\Cache::get($key));\n\n\t\t\\Cache\\Cache::set($key, $value);\n\t\t$this->assertEquals(\\Cache\\Cache::get($key), $value);\n\t}", "public function testGetHit()\n {\n $key = \"unique\";\n $item = $this->cache->getItem($key);\n $item->set(\"content\");\n\n $res = $item->get();\n $this->assertNull($res, \"Should not be able to find a value\");\n\n $this->cache->save($item);\n $res = $item->get();\n $this->assertTrue(!is_null($res), \"Should have a value\");\n }", "private function setup_cache() {\n // Set up non-persistent object caching groups\n wp_cache_add_non_persistent_groups( [ '_np_pedestal' ] );\n }", "public static function getCacheControl() {}", "private function _store()\n {\n return $this->redis->redis->set($this->clientPrefix, json_encode($this->cache));\n }", "function cacheThisImage($img)\n{\n\trequire_once 'externalLibraries/ImageCache.php';\n\t$baseurl=base_url();\n\t$imagecache = new ImageCache();\n\t//$imagecache->cached_image_directory = $baseurl. 'entreprenity/api/cachedImages/';\n\t$imagecache->cached_image_directory = dirname(__FILE__) . '/cachedImages';\n\n\t$cached_src_one = $imagecache->cache($img);\n\t//return $imagecache->cached_image_directory;\n\treturn $cached_src_one;\n\n}", "function memcache_status()\r\n\t{\r\n// \t\t{\r\n// \t\t\theader(\"Location:\".BASE_URL.\"/administration/\");\r\n// \t\t\tdie;\t\t\t\r\n// \t\t}\r\n\t\t$data = $this->data;\r\n\t\t$memcache = new memcache;\r\n\t\t$host = 'localhost';\r\n \t\t$port = $this->config->item('memcache_port');\r\n\t\t$memcache ->connect($host, $port);\r\n\t\tif($this->input->get(\"action\") ==\"flush\")\r\n\t\t{\r\n\t\t\t$memcache->flush();\r\n\t\t\theader(\"Location:\".BASE_URL.\"/administration/memcache_status/\");\r\n\t\t\tdie;\r\n\t\t}elseif($this->input->get(\"action\") ==\"init\")\r\n\t\t{\r\n\t\t\tfile_get_contents(BASE_URL.\"/sort_data/initMem\");\r\n\t\t\theader(\"Location:\".BASE_URL.\"/administration/memcache_status/\");\r\n\t\t\tdie;\r\n\t\t}\r\n\t\t$data ['sys'] = $memcache->getStats();\r\n\t\t$data ['sys'] ['剩余容量'] = round(($data ['sys']['limit_maxbytes'] - $data ['sys']['bytes'])/(1024*1024),5) . \"M\";\r\n\t\t$data ['cur_nav'] = \"memcache状态\";\r\n\t\t$items=$memcache->getExtendedStats ('items');\r\n\t\t/*\r\n\t\t$data ['sys'] ['关系缓存'] = 0;\r\n\t\t$data ['sys'] ['列表页缓存'] = 0;\r\n\t\t$data ['sys'] ['人名缓存'] = 0;\r\n\t\t$data ['sys'] ['热门缓存'] = 0;\r\n\t\tif(isset($items[\"$host:$port\"]['items'])){\r\n\t\t$items=$items[\"$host:$port\"]['items'];\r\n\t\tforeach($items as $key=>$values){\r\n\t\t\t$number=$key;\r\n\t\t\t$str=$memcache->getExtendedStats (\"cachedump\",$number,0);\r\n\t\t\t$line=$str[\"$host:$port\"];\r\n\t\t\tif( is_array($line) && count($line)>0){\r\n\t foreach($line as $key=>$value){\r\n\t $line[$key]=$memcache->get($key);\r\n\t if(strpos($key,\"relation\")!==false)\r\n\t {\r\n\t \t\t$data ['sys'] ['关系缓存'] ++;\r\n\t }else if(strpos($key,\"list\")!==false)\r\n\t {\r\n\t \t\t$data ['sys'] ['列表页缓存'] ++;\r\n\t }else if(strpos($key,\"hot_page_\")!==false)\r\n\t {\r\n\t \t\t$data ['sys'] ['热门缓存'] ++;\r\n\t }else{\r\n\t \t\t$data ['sys'] ['人名缓存'] ++;\r\n\t }\r\n\t }\r\n\t\t\t}\r\n\t\t}\r\n\t\t}else{\r\n\t\t\t$data ['data'] = array();\r\n\t\t}\r\n\t\t*/\r\n// \t\t$data ['sys'] ['列表页缓存'] = isset($data ['data'] ['list'])? count($data ['data'] ['list']):0;\r\n// \t\t$data ['sys'] ['关系缓存'] = isset($data ['data'] ['relation'])? count($data ['data'] ['relation']):0;\r\n// \t\t$data ['sys'] ['人名缓存'] = isset($data ['data'] ['screen_name'])? count($data ['data'] ['screen_name']):0;\r\n// \t\t$data ['sys'] ['热门缓存'] = isset($data ['data'] ['hot'])? count($data ['data'] ['hot']):0;\r\n\t\t$memcache ->close();\r\n\t\t$this->output('admin/mem_status.tpl',$data);\r\n\t}", "public function isCached(): bool;", "public function testCacheFlushByName()\n {\n }", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "public function fetch();", "function testContentLocallyCached() {\n\t\t$this->cache\n\t\t\t->expects( $this->once() ) // <-- the assert\n\t\t\t->method( 'get' )\n\t\t\t->will( $this->returnValue( $this->statusSchema ) );\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t}", "public function __construct() {\n if (preg_match('|mysql://([^:]*):([^@]*)@([^/]*)/(.*)|', $connection, $matches)) {\n //Array ( [0] => mysql://user:password@server/database [1] => user [2] => password [3] => server [4] => database ) \n $db = mysql_connect($matches[3], $matches[1], $matches[2]);\n mysql_select_db($matches[4], $db);\n\n /*\n * If high performance is crucial, you can easily comment\n * out this query once you've created your database table.\n */\n mysql_query(\"CREATE TABLE IF NOT EXISTS `$this->table` (\n `request` CHAR( 35 ) NOT NULL ,\n `response` MEDIUMTEXT NOT NULL ,\n `expiration` DATETIME NOT NULL ,\n INDEX ( `request` )\n ) TYPE = MYISAM\n\t\t\t\", $db);\n\n $result = mysql_query(\"SELECT COUNT(*) FROM $this->table\", $db);\n $result = mysql_fetch_row($result);\n if ($result[0] > $this->max_cache_rows) {\n mysql_query(\"DELETE FROM $table WHERE expiration < DATE_SUB(NOW(), INTERVAL $cache_expire second)\", $db);\n mysql_query('OPTIMIZE TABLE ' . $this->cache_table, $db);\n }\n $this->cache = 'db';\n $this->cache_db = $db;\n $this->cache_table = $table;\n }\n }", "abstract public function fetch();", "abstract public function fetch();", "function _write_cache($output){\n return false;\n\n return parent::_write_cache($output);\n }", "public function tempPageCacheContent() {}", "function checkKeys()\n{\n $cache = Cache::get()->first();\n\n if (!$cache) {\n $cache = new Cache();\n refreshKeys($cache);\n }\n else { \n if (time() > $cache->timeout){\n refreshKeys($cache);\n }\n }\n}", "function __construct() {\n $this->mem = new Memcache();\n //$this->mem->connect('118.178.182.224','18392'); //写入缓存地址,端口\n// $this->mem->addServer('118.178.182.224','18392');\n $this->mem->addServer('localhost','3306');\n }", "function cache_users($user_ids)\n {\n }", "function safe_scrape_cached($url){\n\n\t\t$cache = cache::factory();\n\n\t\t$cached = $cache->get($url);\n\t\tif (isset($cached) && $cached !== false) {\n\t\t\treturn $cached;\n\t\t}else{\n\t\t\t$page = safe_scrape($url);\n\t\t $cache->set($url, $page, \"safe_scrape\");\t\n\t\t\treturn $page;\n\t\t}\n\t\t\n\t}", "function get($key) {\n return $this->memcached->get($key);\n }", "public function preRetrieve();", "function mgd_cache_invalidate()\n{\n}", "public function getCacheAdapter();", "function wp_cache_add_non_persistent_groups($groups)\n{\n global $wp_object_cache;\n\n $wp_object_cache->add_non_persistent_groups($groups);\n}", "public function load()\n\t{\n\t\tif (!$this->cache->contains($this->cache_id)) {\n\t\t\t$this->generateCacheList();\n\t\t}\n\n\t\t$this->list = $this->cache->fetch($this->cache_id);\n\n\t\t$this->num = count($this->list);\n\t\t$this->unique = (boolean)($this->num == 1);\n\t}", "public function cache() {\n\t\treturn $this->_cache;\n\t}", "function _prime_site_caches($ids, $update_meta_cache = \\true)\n {\n }", "public function send_cached_file($video)\n {\n $id=$video[\"id\"];\n\n //\n // Open cache file.\n //\n bench(\"start\");\n if (($fp = fopen($this->cache_filename, 'rb')) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot open cache file: [{$this->cache_filename}]\");\n return FALSE;\n }\n // Log it.\n $this->log(1,__FUNCTION__,\"Cache file opened for reading\");\n // Insert visit into db.\n $this->add_visit($id,filesize($this->cache_filename));\n $this->file_access_time=bench();\n \n //\n // Read headers using fgets\n //\n $hs=unserialize($video[\"reply_headers\"]);\n/*\n $hs = array();\n while (!feof($fp)) {\n if (($ln = fgets($fp)) === FALSE)\n $this->logdie(2,__FUNCTION__,\"Cannot read cache file: [{$this->cache_filename}]\");\n else if (($ln = rtrim($ln)) == '')\n break;\n else if (!preg_match('/^([^:]+): *(.*)$/', $ln, $mo))\n $this->logdie(2,__FUNCTION__,\"Invalid cached header in [{$this->cache_filename}]: [{$ln}]\");\n else\n $hs[$mo[1]] = $mo[2];\n }\n*/\n // Range request\n if (isset($this->client_request_headers['Range'])) {\n $range = $this->client_request_headers['Range'];\n if (!preg_match('/bytes[=\\s]+([0-9]+)/', $range, $mo))\n $this->log(2,__FUNCTION__,\"Unsupported Range header value: [{$range}]\");\n else {\n $firstbyte = $mo[1];\n $size = $hs['Content-Length'];\n $lastbyte = $size - $firstbyte - 1;\n $hs['Content-Range'] = \"bytes $firstbyte-$lastbyte/$size\";\n $hs['Content-Length'] -= $firstbyte;\n header('HTTP/1.0 206 Partial Content');\n if (fseek($fp, $firstbyte, SEEK_CUR))\n $this->log(2,__FUNCTION__,\"Cannot seek to position $firstbyte: [{$this->cache_filename}]\");\n }\n } // range\n // Set headers\n foreach ($hs as $n => $v) {\n header(\"$n: $v\");\n $this->log(0,__FUNCTION__,\"Cached header > client: [$n: $v]\");\n }\n $this->send_dynamic_headers_to_client();\n\n //\n // Send content.\n //\n // 'fpassthru($fp)' seems to attempt to mmap the file, and hits the PHP memory limit.\n // As a workaround, use a 'feof / fread / echo' loop.\n //\n\n $transferred=0;$tcount=0;\n bench(\"start\");\n while (!feof($fp)) {\n if (($data = fread($fp, $this->chunksize)) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot read cache file: [{$this->cache_filename}]\");\n fclose($fp);\n return FALSE;\n } else {\n $transferred+=strlen($data);$tcount++;\n if ($tcount==1) //first packet\n if (substr($data,0,4)==chr(0x12).chr(00).chr(03).chr(0x4b)) //header missing, try to fix it\n $data=\"FLV\".chr(0x01).chr(0x05).chr(00).chr(00).chr(00).chr(0x09).chr(00).chr(00).chr(00).chr(00).$data;\n echo $data;\n }\n }\n fclose($fp);\n $transfer_time=bench();\n if ($transfer_time<1) $transfer_time=1;\n $bytes_per_sec=ROUND($transferred/ROUND($transfer_time/1000));\n $this->troughput_local=$bytes_per_sec;\n $this->log(1,__FUNCTION__,\"Served request {$this->cache_request} from cache, {$transferred} bytes transferred\");\n return true;\n }", "private function inCache()\n\t{\n\t\t$content = $this->_cache->retrieve($this->redditid); //faster if we have it in cache already\n\t\treturn $content;\n\t}", "public function should_suggest_persistent_object_cache()\n {\n }", "function apc_cache_get_keyword_infos($info, $keyword) {\n\t// Store in cache\n\tapc_store(apc_cache_get_keyword_key($keyword), $info, APC_CACHE_READ_TIMEOUT);\n\treturn $info;\n}" ]
[ "0.67626816", "0.6619213", "0.6523593", "0.62975526", "0.6284893", "0.62574077", "0.6232034", "0.61794627", "0.6140814", "0.60984117", "0.6052232", "0.604884", "0.6013344", "0.59933007", "0.5992823", "0.595712", "0.59391624", "0.592325", "0.59112257", "0.588854", "0.5876936", "0.5864879", "0.58402544", "0.58326495", "0.5786637", "0.5781236", "0.57630664", "0.5760065", "0.57473975", "0.57347125", "0.57140595", "0.56926346", "0.5686876", "0.5650241", "0.5650241", "0.5647759", "0.5639959", "0.56237924", "0.5594809", "0.5581025", "0.5570669", "0.5559432", "0.5553884", "0.55392265", "0.5537215", "0.5526687", "0.551669", "0.5513467", "0.5500336", "0.5479386", "0.5476635", "0.5475453", "0.54712677", "0.5467718", "0.54563487", "0.5449888", "0.54435915", "0.5443287", "0.5424884", "0.54219496", "0.5401478", "0.53938204", "0.5384487", "0.5374984", "0.53716034", "0.5370371", "0.53581375", "0.5357666", "0.53553593", "0.53524435", "0.53488135", "0.53488135", "0.53488135", "0.53488135", "0.53488135", "0.53488135", "0.53488135", "0.53488135", "0.53488135", "0.53369224", "0.5336157", "0.533428", "0.533428", "0.53327435", "0.53194964", "0.53165644", "0.53135586", "0.5311479", "0.53074145", "0.5306468", "0.5304719", "0.5296499", "0.52958375", "0.5294004", "0.5293037", "0.52919024", "0.5286613", "0.5286419", "0.52792436", "0.527685", "0.5276467" ]
0.0
-1
Delete torrent and data in Transmission. Update DB to DELETED state This will allow to readd the torrent and download it again.
public function deleteTorrent($torrentHash) { $requestPayload = array( "method" => "torrent-remove", "arguments" => array("ids" => array($torrentHash), "delete-local-data" => true) ); $jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES); $this->transmissionLogger->debug("[TRANSMISSION-DELETE-TORRENT] The payload to send to transmission API is $jsonRequest"); $result = $this->executeTransmissionApiCall($jsonRequest); $this->transmissionLogger->debug("[TRANSMISSION-DELETE-TORRENT] The result after deletion is: ". json_encode($result)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletetorrent ($id, $permission = false)\n {\n global $torrent_dir;\n global $usergroups;\n if ((($permission OR is_mod ($usergroups)) AND is_valid_id ($id)))\n {\n $id = intval ($id);\n $file = TSDIR . '/' . $torrent_dir . '/' . $id . '.torrent';\n if (@file_exists ($file))\n {\n $image_types = array ('gif', 'jpg', 'png');\n foreach ($image_types as $image)\n {\n if (@file_exists (TSDIR . '/' . $torrent_dir . '/images/' . $id . '.' . $image))\n {\n @unlink (TSDIR . '/' . $torrent_dir . '/images/' . $id . '.' . $image);\n continue;\n }\n }\n\n @unlink ($file);\n }\n\n @sql_query ('DELETE FROM peers WHERE torrent = ' . @sqlesc ($id));\n @sql_query ('DELETE FROM comments WHERE torrent = ' . @sqlesc ($id));\n @sql_query ('DELETE FROM bookmarks WHERE torrentid = ' . @sqlesc ($id));\n @sql_query ('DELETE FROM snatched WHERE torrentid = ' . @sqlesc ($id));\n @sql_query ('DELETE FROM torrents WHERE id=' . @sqlesc ($id));\n @sql_query ('DELETE FROM ts_torrents_details WHERE tid=' . @sqlesc ($id));\n @sql_query ('DELETE FROM ts_thanks WHERE tid=' . @sqlesc ($id));\n @sql_query ('DELETE FROM ratings WHERE type=\\'1\\' AND rating_id=' . @sqlesc ($id));\n @sql_query ('DELETE FROM reports WHERE type=\\'torrent\\' AND votedfor = ' . @sqlesc ($id));\n @sql_query ('DELETE FROM ts_nfo WHERE id = ' . @sqlesc ($id));\n return null;\n }\n\n print_no_permission (true);\n }", "public function destroy(torrent $torrent)\n {\n\n //торрент успешно загружен\n\n }", "function delete(){\n\t\t$sql = \"DELETE FROM `tours` WHERE `id`='\".addslashes($this->id).\"'\";\n\n\t\t$this->connection->send_query($sql);\n\t}", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public function deleteUnused()\n\t{\n\t\t/*$file = Engine_Api::_()->getItem('storage_file', $this->file_id);\n\t\t if ($file) {\n\t\t $table = Engine_Api::_()->getDbtable('albumSongs', 'mp3music');\n\t\t $select = $table->select()\n\t\t ->where('file_id = ?', $file->getIdentity())\n\t\t ->limit(1);\n\t\t $count = count( $table->fetchAll($select) );\n\t\t if ($count >= 0)\n\t\t $file->delete();\n\t\t }\n\t\t $this->delete();*/\n\t\t$table = Engine_Api::_() -> getDbtable('albumSongs', 'mp3music');\n\t\t$data = array('is_delete' => 1, );\n\t\t$where = $table -> getAdapter() -> quoteInto('song_id = ?', $this -> song_id);\n\t\t$table -> update($data, $where);\n\t}", "public function deleteAnnouncement(){\n $this->status = 0;\n $this->announcement = null;\n $this->save();\n }", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function delete_data_to_tombstone(){\n }", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "function undelete() {\n\t\t$query = \"UPDATE \".$this->table.\" SET \".$this->deleted_field.\" = '0'\".$this->where_this();\n\n\t\t$this->db->query($query);\n\n\t}", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "protected function afterDelete()\n {\n parent::afterDelete();\n //Comment::model()->deleteAll('post_id='.$this->id);\n VideoTag::model()->updateFrequency($this->tags, '');\n }", "function delete() {\n\t\t\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t\n\t\t$id = $this->Session->read('Member.memberid');\n\t\t\n\t\t// id 4 means trash\n\t\t\n\t\t$activeid = 4;\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.active' => \"'\" . $activeid . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $id\n\t\t\t));\n\t\t\n\t\techo \"deleted\";\n\t\t\t\n\t\n\t/*\tif ($id) {\n\t\t\t\n\t\t\t$delete = $this->Member->delete($id);\n\t\t\t\n\t\t \tif ($delete) {\n\t\t\t\t$meta = $this->userMeta->deleteAll(array(\n\t\t\t\t\t'userMeta.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$course = $this->TutCourse->deleteAll(array(\n\t\t\t\t\t'TutCourse.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$event = $this->TutEvent->deleteAll(array(\n\t\t\t\t\t'TutEvent.tutor_id' => $id\n\t\t\t\t));\n\t\t\t\t$image = $this->UserImage->deleteAll(array(\n\t\t\t\t\t'UserImage.user_id' => $id\n\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t\tif ($meta) {\n\t\t\t\techo \"deleted\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} */\n\t\t\n\t\t\n\t\n\t\n\t}", "function deleteUnsaveNode()\n {\n //vymaze az po 2 hodinach ak sa nezmeni stav\n $list = $this->getFluent()->where(\"status = 'not_in_system' AND add_date < ( NOW() - 60*2 )\")->fetchAll();\n\n if (!empty($list)) {\n\n foreach ($list as $l) {\n\n $this->delete($l['id_node']);\n\n $module_name = $this->context->getService('ModuleContainer')->fetch($l['id_type_module'])->service_name;\n\n $this->context->getService($module_name)->delete($l['id_node']);\n }\n }\n }", "function deleteArticleTree() {\n\t\tparent::rmtree($this->filesDir);\n\t}", "protected function runTransactionDestroy()\n {\n $this->request->transaction->destroy(); /* Unlink the transaction file */\n unset($this->request->transaction); /* Destroy the pointer in memory */\n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function eraseData()\n {\n $s = 'DELETE FROM `commitMessage` WHERE `user`=\"%s\"';\n $params = array($this->vcsLogin);\n $this->conn->query($s, $params);\n\n $s = 'DELETE FROM `work` WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n\n $s = 'DELETE FROM `patches` WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n\n $s = 'DELETE FROM `users` WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n }", "function cms_delete($id) {\n GLOBAL $db;\n// удаление данных о статье\n $db -> query(\"DELETE FROM content WHERE id='$id'\");\n $db -> query(\"DELETE FROM content WHERE pid = '$id'\");\n// удаление информации о статьях из \"связанных\" таблиц\n $db -> query(\"UPDATE items SET article=REPLACE(article,'|\".$id.\"|','|') WHERE article LIKE '%|\".$id.\"|%'\");\n $db -> query(\"UPDATE spec SET article=REPLACE(article,'|\".$id.\"|','|') WHERE article LIKE '%|\".$id.\"|%'\");\n\n}", "public function DeleteArticleRevisions() {\n\t\t\t$this->objArticleRevisions->Delete();\n\t\t}", "public function delete()\n {\n // If deposit is existing, will get database ID removed.\n $this->dbID = $this->db->deleteDeposit($this);\n }", "public function postDelete() {\n if ($server = $this->server()) {\n if ($server->enabled) {\n $server->removeIndex($this);\n }\n // Once the index is deleted, servers won't be able to tell whether it was\n // read-only. Therefore, we prefer to err on the safe side and don't call\n // the server method at all if the index is read-only and the server\n // currently disabled.\n elseif (empty($this->read_only)) {\n $tasks = variable_get('search_api_tasks', array());\n $tasks[$server->machine_name][$this->machine_name] = array('remove');\n variable_set('search_api_tasks', $tasks);\n }\n }\n\n // Stop tracking entities for indexing.\n $this->dequeueItems();\n }", "function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AlternativeCurrency WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n\r\n \r\n }", "public function action_Delete()\n\t{\n\t\t// load item\n\t\t$item = ORM::factory('Ticket', $this->request->param('id'));\n\n\t\tif ( ! $item->loaded())\n\t\t\t$this->not_found('Could not find ticket to delete. Already deleted maybe?');\n\n\t\t$item->deleted_at = date('Y-m-d H:i:s');\n\t\t$item->save();\n\n\t\tHTTP::redirect('Ticket');\n\t}", "function delete() {\n\t\tif (!forge_check_perm ('tracker', $this->Artifact->ArtifactType->getID(), 'tech')) {\n\t\t\t$this->setPermissionDeniedError();\n\t\t\treturn false;\n\t\t}\n\t\t$res = db_query_params ('DELETE FROM artifact_file WHERE id=$1',\n\t\t\t\t\tarray ($this->getID())) ;\n\t\tif (!$res || db_affected_rows($res) < 1) {\n\t\t\t$this->setError('ArtifactFile: Unable to Delete');\n\t\t\treturn false;\n\t\t} else {\n\t\t\tArtifactStorage::instance()->delete($this->getID())->commit();\n\n\t\t\t$this->Artifact->addHistory('File Deleted',$this->getID().': '.$this->getName());\n\t\t\treturn true;\n\t\t}\n\t}", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "function edithistory_delete_thread($tid)\n{\n\tglobal $db, $mybb;\n\t$db->delete_query(\"edithistory\", \"tid='{$tid}'\");\n}", "public function delete() {\n $this->remove_content();\n\n parent::delete();\n }", "function delete( )\n {\n $this->dbInit();\n $this->Database->query( \"DELETE FROM eZLink_Hit WHERE Link='$this->ID'\" ); \n $this->Database->query( \"DELETE FROM eZLink_Link WHERE ID='$this->ID'\" );\n }", "protected function _postDelete() {}", "public function delete () {\n $this->db->delete('turmas', array('idturma' => $this->idturma));\n }", "protected function _postDelete() {}", "protected function afterDelete()\n {\n parent::afterDelete();\n self::extraAfterDelete($this);\n \n\t\t\t\n\t\t//Implements to delete The Term Relation Ship\t\t\n }", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "function ajaxdeletefile($filename = null){\n\n\t\t$filename = base64_decode(urldecode($filename));\n\n\t\t//Delete uploaddir\n\t\tif(file_exists($this->uploaddir.$filename)){\n\t\t\tunlink($this->uploaddir.$filename);\n\t\t}\n\n\t\t//Delete torrent\n\t\tif(file_exists($this->torrentdir.$filename.'.torrent')){\n\t\t\tunlink($this->torrentdir.$filename.'.torrent');\n\t\t}\n\n\t\t//Delete from DB\n\t\t$this->Torrent->deleteAll(array('name'=>$filename));\n\n\t\t$this->autoRender = false; //Dont render view. Complete action will update screen\n\t}", "public function beforeDelete()\n\t{\n\t\t foreach ($this->towns as $towns){\n\t\t \t$towns->delete();\n\t\t }\n\t}", "protected function _delete()\r\n\t{\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from favorite table\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from rating table\r\n\t\tEngine_Api::_() -> getDbTable('ratings', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from watchlater table\r\n\t\tEngine_Api::_() -> getDbTable('watchlaters', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// update video count in signature table\r\n\t\t$signatureTbl = Engine_Api::_() -> getDbTable('signatures', 'ynvideo');\r\n\t\t$signature = $signatureTbl -> fetchRow($signatureTbl -> select() -> where('user_id = ?', $this -> owner_id));\r\n\t\tif ($signature)\r\n\t\t{\r\n\t\t\t$signature -> video_count = new Zend_Db_Expr('video_count - 1');\r\n\t\t}\r\n\t\t$signature -> save();\r\n\r\n\t\t// remove video from playlists\r\n\t\t$playlistAssocTbl = Engine_Api::_() -> getDbTable('playlistassoc', 'ynvideo');\r\n\t\t$playlistAssocs = $playlistAssocTbl -> fetchAll($playlistAssocTbl -> select() -> where('video_id = ?', $this -> getIdentity()));\r\n\t\tforeach ($playlistAssocs as $playlistAssoc)\r\n\t\t{\r\n\t\t\t$playlistAssoc -> delete();\r\n\t\t}\r\n\r\n\t\tparent::_delete();\r\n\t}", "public function delete($transport_id) {\n\t\t$this->db->where ( 'transport_id', $transport_id );\n\t\t$this->db->trans_begin ();\n\t\t$this->db->delete ( self::TABLE_NAME );\n\t\t$logs = new Logs ( );\n\t\t$mywhere = 'where transport_id = ' . $transport_id;\n\t\t$myquery = $logs->sqldelete ( self::TABLE_NAME, $mywhere );\n\t\t$logs->write ( self::TABLE_NAME, 'DELETE', $myquery );\n\t\t\n\t\tif ($this->db->trans_status () === FALSE) {\n\t\t\t$this->db->trans_rollback ();\n\t\t} else {\n\t\t\t$this->db->trans_commit ();\n\t\t}\n\t\t\n\t}", "public function delete() {\r\n\r\n\t\t// Does the Genre object have an ID?\r\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Genre::delete(): Attempt to delete an Genre object that does not have its ID property set.\", E_USER_ERROR );\r\n\r\n\t\t// Delete the Article\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$st = $conn->prepare ( \"DELETE FROM :table WHERE id = :id LIMIT 1\" );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->execute();\r\n\t\t$conn = null;\r\n\t}", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "function delete(){\n\t\t$eventDet = $this->get_full_details();\n\t\t//print_r($eventDet);\n\t\t#unlink all images for the event\n\t\tif ($eventDet->news_image_logo) { \n\t\t\t//unlink($this->imgPath.$eventDet->news_image_logo);\n\t\t}\n\t\tif ($eventDet->news_photo1) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo1);\n\t\t}\n\t\tif ($eventDet->news_photo2) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo2);\n\t\t}\n\t\tif ($eventDet->news_photo3) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo3);\n\t\t}\t\t\t\t\t\t\n\t\t\n\t\t#remove event entry from the db\n\t\tglobal $db;\n\t\t$sQl = \"delete from cms_news where id = '\".$this->event_id.\"'\";\n\t\tif ($db->query($sQl)){\n\t\t\t$this->message = \"Event \".$eventDet->news_title.\" deleted successfully\";\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error = \"Cannot delete Event \".$eventDet->news_title.\"\";\n\t\t\treturn false;\n\t\t}\n\t}", "public function afterDeleteCommit(): void\n {\n }", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public static function delete() {\n\t\tself::$_db->delete()->from('baskets')->where(array('slug' => self::$_slug))->go();\n\t\tSession::destroy('dime_basket');\n\t}", "function delete_attachment_data()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->hard_delete['p']))\r\n\t\t{\r\n\t\t\t$num_files = $config['num_files'];\r\n\r\n\t\t\t$sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . '\r\n\t\t\t\tWHERE ' . $db->sql_in_set('post_msg_id', $this->hard_delete['p']) . '\r\n\t\t\t\t\tAND in_message = 0\r\n\t\t\t\t\tAND topic_id != 0';\r\n\t\t\t$result = $db->sql_query($sql);\r\n\t\t\twhile ($row = $db->sql_fetchrow($result))\r\n\t\t\t{\r\n\t\t\t\t@unlink($phpbb_root_path . $config['upload_path'] . '/' . $row['physical_filename']);\r\n\t\t\t\t$num_files--;\r\n\t\t\t}\r\n\r\n\t\t\tif ($num_files != $config['num_files'])\r\n\t\t\t{\r\n\t\t\t\tset_config('num_files', $num_files, true);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '\r\n\t\t\t\tWHERE ' . $db->sql_in_set('post_msg_id', $this->hard_delete['p']) . '\r\n\t\t\t\t\tAND in_message = 0\r\n\t\t\t\t\tAND topic_id != 0';\r\n\t\t\t$db->sql_query($sql);\r\n\t\t}\r\n\t}", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "protected function delete() {\n\t}", "public function delete()\n\t{\n\t\t$db = App\\Db::getInstance();\n\t\t$templateId = $this->getId();\n\t\t$db->createCommand()\n\t\t\t->delete('vtiger_trees_templates', ['templateid' => $templateId])\n\t\t\t->execute();\n\t\t$db->createCommand()\n\t\t\t->delete('vtiger_trees_templates_data', ['templateid' => $templateId])\n\t\t\t->execute();\n\t\t$this->clearCache();\n\t}", "public function delete() {\n global $DB;\n foreach ($this->targets as $target) {\n $DB->delete_records('progressreview_tutor', array('id' => $target->id));\n }\n }", "public function del(){\n\t\t$this->OnlyAdmin();\n\t\tif($this->input->post()){\n\t\t$this->TicketModel->delet($this->input->post());\n\t\tredirect('index.php/ticket/lists');}\n\t}", "public function deleteDatabaseStructure( );", "protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }", "function delete(){\n // Renumber resolutions\n $resolutions = resolution::getResolutions($this->committeeId, $this->topicId);\n foreach($resolutions as $resolution){\n if($resolution->resolutionNum <= $this->resolutionNum)\n continue;\n $resolution->resolutionNum--;\n $resolution->saveInfo();\n }\n // Delete subclauses\n foreach($this->preambulatory as $clause){\n $clause->delete();\n }\n foreach($this->operative as $clause){\n $clause->delete();\n }\n // Delete resolution\n mysql_query(\"DELETE FROM resolution_list WHERE id='$this->resolutionId'\") or die(mysql_error());\n }", "public function forceDeleted(Wallet $wallet)\n {\n // midi aba gateste\n }", "public function purgeTickets()\n\t{\n\t\t$ticket_ids = $this->db->fetchAllCol(\"\n\t\t\tSELECT id FROM tickets WHERE person_id = ? AND hidden_status != 'deleted'\n\t\t\", array($this->person->getId()));\n\n\t\tif (!$ticket_ids) {\n\t\t\treturn;\n\t\t}\n\n\t\t#------------------------------\n\t\t# Insert delete logs\n\t\t#------------------------------\n\n\t\t$by_person_id = null;\n\t\tif ($this->person_context) {\n\t\t\t$by_person_id = $this->person_context->getId();\n\t\t}\n\n\t\t$date_str = date('Y-m-d H:i:s');\n\t\t$reason_str = 'User was deleted';\n\n\t\t$inserts = array();\n\n\t\tforeach ($ticket_ids as $ticket_id) {\n\t\t\t$inserts[] = array('ticket_id' => $ticket_id, 'by_person_id' => $by_person_id, 'new_ticket_id' => 0, 'date_created' => $date_str, 'reason' => $reason_str);\n\t\t}\n\n\t\t$this->db->batchInsert('tickets_deleted', $inserts);\n\n\t\t#------------------------------\n\t\t# Clear out the search tables\n\t\t#------------------------------\n\n\t\t$this->db->delete('tickets_search_active', array('person_id' => $this->person->getId()));\n\t\t$this->db->delete('tickets_search_message', array('person_id' => $this->person->getId()));\n\t\t$this->db->delete('tickets_search_message_active', array('person_id' => $this->person->getId()));\n\t\t$this->db->executeUpdate(\"DELETE FROM tickets_search_subject WHERE id IN (\" . implode(',', $ticket_ids) . \")\");\n\t}", "function RSS_delete()\n{\n // Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()\n // return arrays but we handle them differently. For pnDBGetConn()\n // we currently just want the first item, which is the official\n // database handle. For pnDBGetTables() we want to keep the entire\n // tables array together for easy reference later on\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n // Create a new data dictionary object\n $dict = NewDataDictionary($dbconn);\n\n // Drop the table - for such a simple command the advantages of separating\n // out the SQL statement from the Execute() command are minimal, but as\n // this has been done elsewhere it makes sense to stick to a single method\n // create the data dictionaries SQL array\n\n\t// This array contains all the ncessary information to execute some sql \n\t// on any of the supported dbms platforms\n $sqlarray = $dict->DropTableSQL($pntable['RSS']);\n\n // Execute the sql that has been created\n $result = $dict->ExecuteSQLArray($sqlarray);\n\n // Check for an error with the database code, and if so set an\n // appropriate error message and return\n if ($result != 2) {\n pnSessionSetVar('errormsg', _DELETETABLEFAILED);\n return false;\n }\n\n // Delete any module variables\n\tpnModDelVar('RSS', 'cachedirectory');\n pnModDelVar('RSS', 'cacheinterval');\n pnModDelVar('RSS', 'itemsperpage');\n pnModDelVar('RSS', 'openinnewwindow');\n pnModDelVar('RSS', 'bold');\n\n // Deletion successful\n return true;\n}", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tBookmark::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoCategory::model()->deleteAll( 'howto_id=' . $this->id );\n \t\tSlide::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tStep::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoTag::model()->deleteAll( 'howto_id=' . $this->id );\n\t}", "public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }", "public function DELETE() {\n #\n }", "function delete(){\r\n\t\t//Connect\r\n\t\t$sql = new DataBase;\r\n\t\t$sql->connect();\r\n\t}", "function cleanup()\n {\n $db = eZDB::instance();\n $db->begin();\n $db->query( \"DELETE FROM ezsphinx\" );\n $db->query( \"DELETE FROM ezsphinx_pathnodes\" );\n $db->commit();\n }", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function deleteDeKitDet(){\n\t\t$det_id = $this->input->post('det_id');\n\n\t\t$details = $this->db->query(\"DELETE FROM LZ_DEKIT_US_DT WHERE LZ_DEKIT_US_DT_ID = $det_id\");\n\n\t\tif($details){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\n\t\t\n\t}", "public function delete () {\n if(count($this->data[$this->id])) {\n foreach($this->data[$this->id] as $key=>$prop) {\n if($prop[\"link\"] == \"P127F\")\n $broader = $key;\n }\n }\n unset($this->data[$this->id][$broader]);\n \n // if there are still links, we must stop\n if(count($this->data[$this->id])) \n throw new Exception(\"Cannot remove because record has links! (remove them first)\");\n\n // remove table data linked to this record\n foreach($this->tables as $table) {\n $table->deleteMyData($this->id);\n }\n \n // remove link to class hierarchy and then the record itself\n IdaDb::deleteBy(\"_sys_classes_join\", array(\"subject\"=>$this->id));\n IdaDb::deleteBy(\"_sys_records\", array(\"id\"=>$this->id));\n \n }", "protected function afterDelete()\r\n {\r\n }", "function dodelete()\n\t{\n\t\tglobal $db;\n\n\t\t$sqls = array(\n\t\t\t\"DELETE FROM preorders WHERE pre_preorderID=$this->preorderID\",\n\t\t\t\"DELETE FROM preorder_customers WHERE prc_preorderID=$this->preorderID\"\n\t\t);\n\n\t\twhile (list($a,$sql) = each($sqls))\n\t\t{\n\t\t\tmysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t}\n\t}", "public function Del_activiteiten() {\n\t\t \t$this->db->query('DELETE FROM Activiteiten WHERE Datum < UNIX_TIMESTAMP(NOW())');\n\t\t \treturn $this->db->affected_rows();\n\t\t}", "public final function delete() {\n }", "protected function _postDelete()\n\t{\n\t}", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function onWikiDelete(WikiWasDeleted $event)\n {\n try {\n $this->wiki->withTrashed()->find($event->wiki['id'])->deleteFromIndex();\n } catch (\\Exception $e) {\n app('log')->warning($e->getMessage());\n }\n }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll('photo_id='.$this->id);\n\t\tTag::model()->updateFrequency($this->tags, '');\n\t}", "public function softdelete(){\n \ttry{\n\t\t\t\t$this->deleted_at=date('Y/m/d H:i:s');\n \t\t$connect=Database::connect();\n \t\t$query='UPDATE vehicles SET deleted_at = :deleted_at WHERE id = :id';\n \t\t$statement=$connect->prepare($query);\n \t\t$statement->bindParam(':deleted_at',$this->deleted_at);\n \t\t$statement->bindParam(':id', $data->id);\n \t\treturn $statement->execute();\n \t} catch(\\Exception $e) {\n\t\t\t\techo $e;\n\t\t\t}\n }", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}", "public function delete()\n\t{\n\t\t$transaction = $this->dbConnection->beginTransaction();\n\t\ttry {\n\t\t\tforeach ($this->previnterventions as $prev) {\n\t\t\t\t$prev->delete();\n\t\t\t}\n\t\t\tforeach ($this->relevantinterventions as $relv) {\n\t\t\t\t$relv->delete();\n\t\t\t}\n\t\t\tforeach ($this->deviationreasons as $devr) {\n\t\t\t\t$devr->delete();\n\t\t\t}\n\t\t\tforeach ($this->filecollection_assignments as $fca) {\n\t\t\t\t$fca->delete();\n\t\t\t}\n\t\t\tif (parent::delete()) {\n\t\t\t\t$transaction->commit();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception('unable to delete');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t}", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function delete(){\r\n\t\t$mysqli = \\Database::Instance()->get();\r\n\r\n\t\t$stmt = $mysqli->prepare(\"DELETE FROM `hotspots` WHERE `id` = ?\");\r\n\t\t$stmt->bind_param(\"i\",$this->id);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->close();\r\n\r\n\t\t\\CacheHandler::deleteFromCache(\"hotspot_\" . $this->id);\r\n\t}", "public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }", "function erase() {\n //delete * from database\n }", "public function delete()\n {\n $sql = \"DELETE FROM \" . TB_USAGE . \" WHERE mix_id = {$this->db->sqltext($this->mix_id)}\";\n $this->db->exec($sql);\n\n //\tremove everything from cache\n $cache = VOCApp::getInstance()->getCache();\n if ($cache) {\n $cache->flush();\n }\n }", "public function deleteArticle(): void\n {\n $this->articleId = $_GET['deleteId'];\n\n $this->articleModel->deleteArticle($this->articleId);\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public function delete() {}", "public function delete() {}", "public function deleteBD()\r\n {\r\n // Connexion à la base\r\n self::connexionBD();\r\n \r\n // Prépare la requête\r\n $requete = self::getBaseDeDonnees()->getCnxBD()->prepare(self::RQT_DELETE_UTIL);\r\n \r\n // Exécution de la requête avec les paramètres.\r\n return $requete->execute(array(\r\n ':login' => $this->login\r\n ));\r\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();" ]
[ "0.6143635", "0.60750335", "0.581072", "0.5759097", "0.56913894", "0.56892765", "0.567631", "0.5653643", "0.5627567", "0.5619419", "0.55606073", "0.55554616", "0.5554763", "0.5541619", "0.54822594", "0.5449505", "0.54393744", "0.5434458", "0.5418301", "0.5409442", "0.5409434", "0.5405797", "0.5387626", "0.53862274", "0.5382161", "0.5360871", "0.53600335", "0.5350127", "0.53427833", "0.5334195", "0.53286636", "0.5316204", "0.53151554", "0.52952605", "0.5295065", "0.5294132", "0.529088", "0.5290249", "0.5288655", "0.527966", "0.5278033", "0.52736026", "0.526017", "0.525542", "0.5250206", "0.52491707", "0.5245945", "0.5245528", "0.5243851", "0.52415496", "0.5230899", "0.5228767", "0.5227168", "0.5222487", "0.52201897", "0.5219248", "0.52062845", "0.5202463", "0.51765555", "0.5168726", "0.5161058", "0.5159362", "0.5158796", "0.5156993", "0.51498365", "0.514548", "0.51447415", "0.51410097", "0.5140999", "0.51376146", "0.51355016", "0.51302737", "0.5123802", "0.51171666", "0.5113679", "0.5106909", "0.5106062", "0.5104874", "0.5103201", "0.5099949", "0.50967765", "0.5094098", "0.5093009", "0.50908864", "0.50867546", "0.5086506", "0.5084187", "0.50829", "0.5077956", "0.5075939", "0.5075939", "0.50756043", "0.5074624", "0.5074542", "0.5073447", "0.5073447", "0.5073447", "0.5073447", "0.5073447", "0.5073447" ]
0.55528545
13
Sets some global session properties in Transmission Sets the downloaddir to a known path (one with the right permission) Sets the "scripttorrentdonefilename" and "scripttorrentdoneenabled" values to a script which starts renaming command TODO: cache somewhere that this has been done properly to not keep doing it every time
public function configureTransmission() { $this->transmissionLogger->info("[TRANSMISSION-CONFIGURE-SESSION] Setting up transmission session settings"); // This will prepare one script to execute a push notification from transmission when a download finishes $notificationScript = $this->processManager->prepareScriptToExecuteNotifyCall(); $baseDownloadsPath = $this->settingsService->getDefaultTransmissionSettings()->getBaseDownloadsDir(); //TODO: remove hardcoded /mediacenter -- use baseLibraryPath $requestPayload = array( "method" => "session-set", "arguments" => array("download-dir" => $baseDownloadsPath, "script-torrent-done-enabled" => true, "script-torrent-done-filename" => "/mediacenter/notify.sh", "start-added-torrents" => true) ); $jsonRequest = json_encode($requestPayload, JSON_UNESCAPED_SLASHES); $this->transmissionLogger->debug("[TRANSMISSION-CONFIGURE-SESSION] The payload to send to transmission API is $jsonRequest"); $result = $this->executeTransmissionApiCall($jsonRequest); $this->transmissionLogger->debug("[TRANSMISSION-CONFIGURE-SESSION] The result to set Session settings in Transmission is: ". json_encode($result)); $this->transmissionLogger->debug("[TRANSMISSION-CONFIGURE-SESSION] Transmission Session properties are configured"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function setScriptFilename() {\n\t\tif ( self::getIsCli() ) {\n\t\t\tself::$_ScriptFilename = basename($_SERVER['SCRIPT_NAME']);\n\t\t} else {\n\t\t\tself::$_ScriptFilename = basename($_SERVER['SCRIPT_FILENAME']);\n\t\t}\n\t}", "function initVars()\n{\n if (isset($_GET['fd']) && strlen($_GET['fd'])>0){\n if ($_GET['fd']!=\"/\" && $_GET['fd']!=\"\\\\\" && $_GET['fd']!=\".\" && $_GET['fd']!=\"..\" && is_dir(getcwd().\"/../../fc/\".html_entity_decode($_GET['fd']))){\n $_SESSION['cwd']=getcwd().\"/../../fc/\".html_entity_decode($_GET['fd']);\n }elseif (is_dir(html_entity_decode($_GET['fd']))){\n $_SESSION['cwd']=html_entity_decode($_GET['fd']);\n }\n} # END EDIT\n\n\nif (empty($_SESSION['cwd']) || @!empty($_GET['reset']))\n{\n\t$_SESSION['cwd'] = getcwd();\n\tif (\n$_SESSION['cwd']!=FALSE){\n$_SESSION['cwd']=str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME']);\n\t}\n\t$_SESSION['history'] = array();\n\t$_SESSION['output'] = '';\n\t$_REQUEST['command'] ='';\n\t$_SESSION['color'] = 'linux';\n }}", "protected function setupSession()\n\t{\n\t\t$name = $this->appType . \"id\";\n\t\tsession_name($name);\n\n\t\t$path = getenv(\"P_SESSION_DIR\") ?: $GLOBALS[\"BASE_DIR\"] . \"/session\";\n\t\tif (! is_dir($path)) {\n\t\t\tif (! mkdir($path, 0777, true))\n\t\t\t\tjdRet(E_SERVER, \"fail to create session folder: $path\");\n\t\t}\n\t\tif (! is_writeable($path))\n\t\t\tjdRet(E_SERVER, \"session folder is NOT writeable: $path\");\n\t\tsession_save_path ($path);\n\n\t\tini_set(\"session.cookie_httponly\", 1);\n\n\t\t$path = getenv(\"P_URL_PATH\");\n\t\tif ($path)\n\t\t{\n\t\t\t// e.g. path=/cheguanjia\n\t\t\tini_set(\"session.cookie_path\", $path);\n\t\t}\n\t}", "public function start()\n {\n session_name($this->getConfigVariable('name'));\n ini_set(\"session.use_only_cookies\", $this->getConfigVariable('use_only_cookies'));\n ini_set(\"session.cookie_secure\", $this->getConfigVariable('cookie_secure'));\n ini_set(\"session.hash_function\", $this->getConfigVariable('hash_function'));\n // create a private session directory so that another script\n // with a lower lifetime doesn't clean up our session\n $path = $this->getConfigVariable('save_path');\n if (!empty($path) and\n is_dir($path) and\n is_writable($path)\n ) {\n ini_set('session.save_path', $this->getConfigVariable('save_path'));\n }\n //When to destroy sessions on the filesystem\n ini_set('session.gc_maxlifetime', $this->getConfigVariable('gc_maxlifetime'));\n ini_set('session.gc_probability', $this->getConfigVariable('gc_probability'));\n ini_set('session.gc_divisor', $this->getConfigVariable('gc_divisor'));\n\n //session_set_cookie_params (lifetime,path,domain,secure)\n session_set_cookie_params(\n $this->getConfigVariable('cookie_lifetime'),\n $this->getConfigVariable('cookie_path'),\n $this->getConfigVariable('cookie_domain'),\n $this->getConfigVariable('cookie_secure')\n );\n\n //the session_cache_limiter cache-control line is there to kill a bug in\n //IE that causes the PDF not to be cached over ssl.\n //these lines allow the caching and let the file be downloaded.\n //This bug doesn't seem to affect the preview\n //it was present in IE6 and IE7\n session_cache_limiter('must-revalidate');\n\n session_start();\n //do a very small check to see if the browser is the same as the originating browser\n //this canbe fooled easily, but provides a bit of security\n if (empty($_SESSION)) {\n $this->setup();\n } elseif (empty($_SESSION['security']) or\n $_SESSION['security']['user-agent'] != md5(\n empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']\n )\n ) {\n $this->restart();\n }\n }", "public function setFilename($filename) {\n\n\t\t$basename = basename($filename); \n\n\t\tif(DIRECTORY_SEPARATOR != '/') {\n\t\t\t// To correct issue with XAMPP in Windows\n\t\t\t$filename = str_replace('\\\\' . $basename, '/' . $basename, $filename); \n\t\t}\n\t\n\t\tif($basename != $filename && strpos($filename, $this->pagefiles->path()) !== 0) {\n\t\t\t$this->install($filename); \n\t\t} else {\n\t\t\t$this->set('basename', $basename); \n\t\t}\n\n\t}", "private function setFileName() {\n $FileName = Uteis::Name($this->Name) . strrchr($this->File->name, '.');\n if (file_exists(self::$BaseDir . $this->Send . $FileName)):\n $FileName = Uteis::Name($this->Name) . '-' . time() . strrchr($this->File->name, '.');\n endif;\n $this->Name = $FileName;\n }", "private function setFileName(){\n if($this->customFileName !== ''){\n $prefix = $this->customFileName.'_';\n $this->finalFileName = uniqid($prefix).'.'.$this->fileExt;\n }else{\n $this->finalFileName = basename($this->fileName, \".\".$this->fileExt ).md5(microtime()).'.'.$this->fileExt;\n } \n }", "private static function setScriptRelativePath() {\n\t\tself::$_ScriptRelativePath = str_replace(\n\t\t\tself::getConfig()->getBasePath().self::getDirSeparator(), '', self::getScriptPath()\n\t\t);\n\t}", "private function setTempFile() {\n $this->filename = tempnam('/tmp/', 'siwiki_relplot_');\n $this->fileresource = fopen($this->filename, 'a+');\n }", "public function setSession(){\n if( $this->status === True ){\n $_SESSION['username'] = $this->username;\n $_SESSION['userlvl'] = $this->userlevel;\n $_SESSION['status'] = True;\n }else{\n $_SESSION['status'] = False;\n }\n }", "public function setScriptPath()\n\t{\n\t\t$this->scriptPath = Yii::getPathOfAlias('webroot').$this->ds.$this->suffix.$this->ds;\n\t}", "function set_ini(){\n session_name(self::_SESSION_NAME_); \n //ini_set('session.name',self::_SESSION_NAME_);\n // **PREVENTING SESSION HIJACKING**\n // Prevents javascript XSS attacks aimed to steal the session ID (jscript cant access cookies now)\n ini_set('session.cookie_httponly', 1);\n // Adds entropy into the randomization of the session ID, as PHP's random number\n // generator has some known flaws\n ini_set('session.entropy_file', self::_SESSION_ENTROPY_);\n ini_set('session.entropy_length', self::_SESSION_ENTROPY_LENGTH); \n // Uses a strong hash\n ini_set('session.hash_function', self::_SESSION_HASH_);\n // **PREVENTING SESSION FIXATION**\n // Session ID cannot be passed through URLs\n ini_set('session.use_cookies', 'true'); \n ini_set('session.use_only_cookies', 1);\n // Uses a secure connection (HTTPS) if possible\n //if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') \n //ini_set('session.cookie_secure', 1); \n session_start();\n\n }", "public function setRestorationParameters()\n\t{\t\t$procengine = JRequest::getCmd('procengine','direct');\n\n\t\t// Get the absolute path to site's root\n\t\t$siteroot = JPATH_SITE;\n\t\t\n\t\t$restoration_setup = array(\n\t\t\t'kickstart.enabled' => false,\n\t\t\t'kickstart.tuning.max_exec_time' => '5',\n\t\t\t'kickstart.tuning.run_time_bias' => '75',\n\t\t\t'kickstart.tuning.min_exec_time' => '0',\n\t\t\t'kickstart.procengine' => $procengine,\n\t\t\t'kickstart.setup.sourcefile' => $this->path,\n\t\t\t'kickstart.setup.destdir' => $siteroot,\n\t\t\t'kickstart.setup.restoreperms' => '0',\n\t\t\t'kickstart.setup.filetype' => $this->extension,\n\t\t\t'kickstart.setup.dryrun' => '0'\n\t\t);\n\n\t\tif($procengine == 'ftp')\n\t\t{\n\t\t\t$ftp_host\t= JRequest::getVar('ftp_host','');\n\t\t\t$ftp_port\t= JRequest::getVar('ftp_port', '21');\n\t\t\t$ftp_user\t= JRequest::getVar('ftp_user', '');\n\t\t\t$ftp_pass\t= JRequest::getVar('ftp_pass', '', 'default', 'none', 2); // Password should be allowed as raw mode, otherwise !@<sdf34>43H% would be trimmed to !@43H% which is plain wrong :@\n\t\t\t$ftp_root\t= JRequest::getVar('ftp_root', '');\n\t\t\t$tempdir\t= JRequest::getVar('tmp_path', '');\n\t\t\t\n\t\t\t$extraOptions = array(\n\t\t\t\t'kickstart.ftp.ssl'\t\t=> '0',\n\t\t\t\t'kickstart.ftp.passive' => '1',\n\t\t\t\t'kickstart.ftp.host'\t=> $ftp_host,\n\t\t\t\t'kickstart.ftp.port'\t=> $ftp_port,\n\t\t\t\t'kickstart.ftp.user'\t=> $ftp_user,\n\t\t\t\t'kickstart.ftp.pass'\t=> $ftp_pass,\n\t\t\t\t'kickstart.ftp.dir'\t\t=> $ftp_root,\n\t\t\t\t'kickstart.ftp.tempdir' => $tempdir\n\t\t\t);\n\t\t\t\n\t\t\t$restoration_setup = array_merge($restoration_setup, $extraOptions);\n\t\t}\n\t\t\n\t\t$json = json_encode($restoration_setup);\n\t\t\n\t\t$session = JFactory::getSession();\n\t\t$session->set('restoration_setup', $json, 'akeeba');\n\t}", "private function setup_variables() {\n\t\t$this->file = __FILE__;\n\t\t$this->basename = plugin_basename( $this->file );\n\t\t$this->plugin_dir = plugin_dir_path( $this->file );\n\t\t$this->plugin_url = plugin_dir_url( $this->file );\n\t\t$this->cron_frequency = 'twicedaily';\n\t}", "protected function _setSystem()\n { $dirs = array(\n // symlink solar\n \"/source/solar/script/solar\",\n // symlink vendor\n \"/source/{$this->_vendor}/script/{$this->_vendor}\",\n // copy solar\n \"/script/solar\",\n // copy vendor\n \"/script/{$this->_vendor}\",\n );\n\n $this->_system = false;\n $file = __FILE__;\n foreach ($dirs as $dir) {\n // make comparison windows-friendly\n $dir = str_replace('/', DIRECTORY_SEPARATOR, $dir);\n $len = -1 * strlen($dir);\n if (substr($file, $len) == $dir) {\n $this->_system = substr($file, 0, $len);\n break;\n }\n }\n }", "protected function setUp()\n {\n $_SERVER['argv'] = self::$argvOriginal;\n @unlink(self::$configFile);\n }", "private function setFilename($username){\n $file = $this->cacheDir.'/'.$username.\".json\";\n $this->cacheFile = $file;\n }", "protected function setBaseOptions(){\n $this->_options=array_merge(array(\n 'script'=>Yii::app()->getController()->createUrl(''),\n 'uploader'=>$this->getBaseUrl().'/uploadify.swf',\n 'expressInstall'=>$this->getBaseUrl().'/expressInstall.swf',\n 'cancelImg'=>$this->getBaseUrl().'/cancel.png',\n 'fileDataName'=>$this->hasModel() ? get_class($this->model).\"[{$this->attribute}]\" : $this->getInputName(),\n 'buttonText'=>Yii::t('application','上传文件'),\n 'scriptData'=>array($this->getInputName()=>' '),\n 'folder'=>$this->getBaseUrl()\n ),$this->_options);\n \n $this->_options['scriptData'][$this->sessionKey]=session_id();\n }", "function __construct() {\n\t\tkataMakeTmpPath('sessions');\n\t}", "private function setUp($config) {\r\n //print_r($config);\r\n //$this->_MYSESSION_CONF=$config;\r\n\r\n $this->db_type = $config[\"DATABASE_TYPE\"];\r\n $this->db_name = $config[\"DB_DATABASE\"];\r\n $this->db_pass = $config[\"DB_PASSWORD\"];\r\n $this->db_server = $config[\"DB_SERVER\"];\r\n $this->db_username = $config[\"DB_USERNAME\"];\r\n\r\n $this->table_name_session = $config[\"TB_NAME_SESSION\"];\r\n $this->table_name_variable = $config[\"TB_NAME_VALUE\"];\r\n $this->table_column_sid = $config[\"SID\"];\r\n $this->table_column_name = $config[\"NAME\"];\r\n $this->table_column_value = $config[\"VALUE\"];\r\n $this->table_column_fexp = $config[\"FEXP\"];\r\n $this->table_column_ua = $config[\"UA\"];\r\n $this->table_column_exp = $config[\"EXP\"];\r\n\r\n $this->sid_name = $config[\"SESSION_VAR_NAME\"];\r\n $this->overwrite = ($config[\"OVERWRITE_PHP_FUNCTION\"]=='1')?true:false;\r\n $this->sid_len = intval($config[\"SID_LEN\"]);\r\n $this->session_duration = intval($config[\"DURATION\"]);\r\n $this->session_max_duration = intval($config[\"MAX_DURATION\"]);\r\n $this->use_cookie = ($config[\"USE_COOKIE\"]=='1')?true:false;\r\n $this->encrypt_data = ($config[\"CRIPT\"]=='1')?true:false;\r\n $this->encrypt_key = $config[\"CRIPT_KEY\"];\r\n\r\n $this->hijackBlock = ($config[\"ENABLE_ANTI_HIJACKING\"]=='1')?true:false;\r\n $this->hijackSalt = $config[\"ANTI_HIJACKING_SALT\"];\r\n\r\n $this->dbConnection();\r\n $this->readSessionId();\r\n //check if i have to overwrite php\r\n if ($this->overwrite) {\r\n //yes.. i'm the best so i overwrite php function\r\n //Make sure session cookies expire when we want it to expires\r\n ini_set('session.cookie_lifetime', $this->session_duration); \r\n //set the value of the garbage collector\r\n ini_set('session.gc_maxlifetime', $this->session_max_duration);\r\n // set the session name to our fantastic name\r\n ini_set('session.name', $this->sid_name); \r\n\r\n // register the new handler\r\n session_set_save_handler(\r\n array(&$this, 'open'),\r\n array(&$this, 'close'),\r\n array(&$this, 'read'),\r\n array(&$this, 'write'),\r\n array(&$this, 'destroy'),\r\n array(&$this, 'gc')\r\n );\r\n\r\n\r\n // start the session and cross finger\r\n session_id($this->getSessionId());\r\n session_start();\r\n\r\n } \r\n\r\n \r\n //echo \"<hr>\".$this->sessionId.\"<hr>\";\r\n //if ($this->expireSession()) $this->destroy();\r\n //$_REQUEST[$this->_MYSESSION_CONF['SESSION_VAR_NAME']]=$this->sessionId;\r\n\r\n }", "function setup(){\n\t\tglobal $session;\n\t\tswitch($this->act){\n\t\tcase ACT_SAVE://when act is save, write configuration to database\n\t\t\t$this->name='System file editor';\n\t\t\t$this->ctrl |= array_sum($_POST['ctrl']);\n\t\t\tif($_POST['more']) $_POST['f'] += array($_POST['more']=>1);\n\t\t\t$this->data=serialize($_POST['f']);\n\t\t\t$this->access=0;//require access developper to run\n\t\t\t$this->save();\n\t\t\tredirect($this->makeUrl(NULL,NULL,'setup'));\n\t\tdefault:\n\t\t\t$this->cfg=unserialize($this->data);\n\t\t\tif(!$this->cfg) $this->cfg=array();\n\t\t\t$this->startPage('Root file editor setup');\n\t\t\t$this->startForm(ACT_SAVE);\n\t\t\techo '<fieldset style=\"width:800px;margin:60px auto 20px auto; \"><legend>Enable users to edit following files</legend>\n<div>PATH_ROOT: <strong>'.PATH_ROOT.'</strong></div>\n<div><input type=\"checkbox\" name=\"f['.PATH_ROOT.'robots.txt]\" value=\"1\" '.($this->cfg[PATH_ROOT.'robots.txt'] ? 'checked':'').' /> robots.txt</div>';\n\t\t\tunset($this->cfg[PATH_ROOT.'robots.txt']);\n\t\t\tforeach($this->cfg as $file=>$value)\n\t\t\t\techo '<div><input type=\"checkbox\" class=\"input\" name=\"f['.$file.']\" value=\"1\" checked />'.str_replace(PATH_ROOT,'',$file).'</div>';\n\t\t\tif($session->getAccess(SESSION_CTRL_ADMIN,MODULE_SYS,ACCESS_DEVELOPPER))\techo '<div>Other file <input type=\"text\" name=\"more\" class=\"input\" size=\"80\" value=\"\" /></div>'; \n\t\t\techo '<div><input type=\"hidden\" value=\"1\" name=\"ctrl[]\" /><input type=\"checkbox\" value=\"',0x40000000,'\" name=\"ctrl[]\" '; if($this->ctrl & 0x40000000) echo 'checked'; echo ' />Show on system menu</div>';\n\t\t\t$this->endForm();\n\t\t\techo '</fieldset><script type=\"text/javascript\">function doSave(){document.forms[0].submit();}</script>';\n\t\t\t$this->endPage();\n\t\t}\n\t}", "function transfer()\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$this->file_perms\t= 0644;\n\t\t$this->dir_perms\t= 0777;\n\n\t\t// We use the store directory as temporary path to circumvent open basedir restrictions\n\t\t$this->tmp_path = $phpbb_root_path . 'store/';\n\t}", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}", "public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/RapidShare/RenameFile/');\n }", "function SetFileName(){\n\t\t$this->FindRootFile();\n\t\t$this->BookLink = $_SERVER['DOCUMENT_ROOT'].'/'.$this->BookLink.'/'.$this->RootFile;\n\t}", "public function setup_session(){\n if(!(isset($_SESSION))){\n session_start();\n }\n\n $_SESSION['user_id'] = $this->user_id;\n $_SESSION['name'] = $this->firstname;\n\n //Remove anon flag\n if(isset($_SESSION['anon'])){\n unset($_SESSION['anon']);\n }\n\n }", "function auto_config() {\n\tglobal $tvh_user_home;\n\n\texec(\"pgrep tvheadend\", $output, $return);\n\tif ($return == 0) {\n\t\techo \"WARNING: TVHeadend detected as running. Changes are OK to go ahead with, but won't be reflected until you restart tvh\\n\\n\";\n\t\tsleep(3);\n\t};\n\n\t$fail=1;\n\tif (!$tvh_user_home) {\n\tif (file_exists(\"/etc/default/tvheadend\")) {\n\t\t// Debian or ubuntu\n\t\t$load_config=fopen(\"/etc/default/tvheadend\",\"r\");\n\t\tif ($load_config) {\n\t\t\twhile (($config_buffer = fgets($load_config, 4096)) !== false) {\n\t\t\t\tif (strpos($config_buffer, \"TVH_USER=\") !== false) {\n\t\t\t\t\t$tvhc_user=explode(\"=\",$config_buffer);\n\t\t\t\t\t$tvhc_user_value=trim(str_replace('\"','',$tvhc_user[1]));\n\n\t\t\t\t\t\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\tif ($tvhc_user_value) {\n\t\t$userhome=`grep tvheadend /etc/passwd`;\n\t\tlist($username,$na,$id,$gid,$na,$homedir,$shell)=explode(\":\",$userhome);\n\t\t$tvh_user_home=$homedir.\"/.hts/tvheadend/\";\n\t};\n\t};\n\techo \"Found TVH config at $tvh_user_home\\n\";\n\tif (file_exists($tvh_user_home.\"channels/\")) {\n\t\techo \"Found channels folder\\n\";\n\t\t$fail=0;\n\t} else {\n\t\t$fail=1;\n\t\techo \"ERROR: Cannot find channels folder. Cannot continue\\n\";\n\t\techo \"TVHeadend should have been ran and channels created before using this utility\\n\";\n\t\techo \"If your TVHeadend userhome isn't at $tvh_user_home then run this script again passing\\n\";\n\t\techo \"the TVHeadend path as first parameter.. Like this:\\n\";\n\t\techo \" ./tvheadend-logo-importer.php5 /home/myuser/.hts/tvheadend/\\n\";\n\t};\n}", "function tcupdate(){\n $settings = $this->get_settings();\n exec( $settings['CMD_SUDO'].' /usr/local/pia/include/transmission-config.sh');\n}", "function _LocalProcessor()\r\n {\r\n //init...\r\n $info=array();\r\n $info[1][0]=$this->sDir;\r\n $info[1][1]=\"?/none\";\r\n $info[1]['index']=1;\r\n $nextdir=$this->sDir;\r\n $level=1; $i=0;\r\n \r\n //$basedir=dirname($this->sDir);\r\n $basedir=($this->sDir);\r\n\r\n /*if((!$dir=opendir($this->dDir))&&($this->action==\"copy\"))\r\n {\r\n //$this->SetError(\"目标文件夹 \".$this->dDir.\" 不存在!\");return 0;\r\n }*/\r\n \r\n while($level!=0){\r\n $curdir=$nextdir;\r\n if(!$dir=@opendir($nextdir))\r\n {\r\n $this->SetError(\"can not open directory:$nextdir!!\");\r\n return 0;\r\n }\r\n \r\n $this->debug(\"Open dir:$nextdir\");\r\n\r\n if($basedir!=\"/\")\r\n {\r\n $realpath=substr($nextdir,strlen($basedir)+1);\r\n }\r\n\t else\r\n {\r\n $realpath=$nextdir;\r\n }\r\n if($this->dDir)\r\n {\r\n $destdir=$this->dDir.\"/\".$realpath;\r\n }\r\n else\r\n {\r\n $destdir=$realpath;\r\n }\r\n //=======action:begin========\r\n if($this->action=='view')\r\n {\r\n $list[$i]['name']=$nextdir;\r\n $list[$i]['folder']=1;\r\n }\r\n if($this->action==\"copy\")\r\n {\r\n if(@mkdir($destdir,0777))\r\n {\r\n $this->debug(\"$this->action::$destdir\");\r\n }\r\n else\r\n {\r\n $this->SetError(\"$this->action::can not create $destdir,continue...\");\r\n }\r\n }\r\n\t if($this->action==\"chmod\"||$this->action==\"chmoddir\")\r\n {\r\n if(@chmod($nextdir,$this->permsValue))\r\n {\r\n $this->debug(\"$this->action:$nextdir=>$this->permsValue\");\r\n }\r\n else\r\n {\r\n $this->SetError(\"Error of $this->action:$nextdir=>$this->permsValue\") ;\r\n }\r\n }\r\n if($this->action==\"remoteupload\")\r\n {\r\n if(@ftp_mkdir($this->ftpconn,$destdir))\r\n {\r\n $this->debug(\"$this->action :: create->$destdir\");\r\n }\r\n else\r\n {\r\n $this->SetError(\"Error of $this->action: create $destdir,continue...\");\r\n }\r\n }\r\n //========action:end=========\r\n $hasdir=0;\r\n $dirnum=0;\r\n\r\n while($file=readdir($dir)){\r\n\r\n if (($file != \".\") && ($file != \"..\")){\r\n if(is_dir($nextdir.\"/\".$file)){\r\n $hasdir=1;\r\n $info[$level+1][$dirnum]=$nextdir.\"/\".$file;\r\n $info[$level+1]['index']=0;\r\n $dirnum++;\r\n $this->dirnums++;\r\n }\r\n if(is_file($nextdir.\"/\".$file)){\r\n\r\n $this->filenums++;\r\n $this->totalsize=$this->totalsize+filesize($nextdir.\"/\".$file);\r\n //============action::begin=================\r\n $i++;\r\n if($this->action=='view'){\r\n $list[$i]['name']=\"$nextdir/$file\";\r\n $list[$i]['folder']=0;\r\n }\r\n if($this->action=='getfiles'){\r\n $this->files[$i]['name']=\"$nextdir/$file\";\r\n $this->files[$i]['folder']=0;\r\n }\r\n if($this->action==\"copy\"){\r\n if($this->ext==\"all\"||@in_array($this->fileext($file),$this->ext)){\r\n if(@copy($nextdir.\"/\".$file,$destdir.\"/\".$file)){\r\n $this->debug(\"copy $nextdir$file => $destdir$file \");\r\n }else{\r\n $this->SetError(\"Err:copy $nextdir$file => $destdir$file \");\r\n }\r\n }\r\n }\r\n if($this->action==\"rename\"){\r\n if($this->ext==\"all\"||@in_array($this->fileext($file),$this->ext)){\r\n $newfile=substr($file,0,strlen($file)-strlen($this->fileext($file))).$this->newext;\r\n if(@rename($nextdir.\"/\".$file,$nextdir.\"/\".$newfile)){\r\n $this->debug(\"rename $nextdir$file => $nextdir$newfile \");\r\n }\r\n else{\r\n $this->SetError(\"Error->rename $nextdir$file => $nextdir$newfile \");\r\n }\r\n }\r\n }\r\n if($this->action==\"delfile\"){\r\n if($this->ext==\"all\"||@in_array($this->fileext($file),$this->ext)){\r\n if(unlink($nextdir.\"/\".$file))\r\n $this->debug(\"delete file:\".$nextdir.$file);\r\n else\r\n $this->SetError(\"Err:delete file:\".$nextdir.$file);\r\n }\r\n }\r\n if($this->action==\"remoteupload\"){\r\n if(@in_array($this->fileext($file),$this->ext)||$this->ext=='all'){\r\n if(@ftp_put($this->ftpconn,$destdir.\"/\".$file,$nextdir.\"/\".$file,$this->ftpAsciiBinary($file)))\r\n {\r\n $this->debug(\"ftp put files:\".$nextdir.\"/\".$file.\" to \".$destdir.\"\".$file);\r\n $this->echoBar($this->totalsize,$this->filenums,$this->dirnums);\r\n }\r\n else\r\n $this->SetError(\"Error of put files:\".$nextdir.\"/\".$file.\" to \".$destdir.$file);\r\n }\r\n }\r\n\t\t\t if($this->action==\"chmod\"||$this->action==\"chmodfile\"){\r\n if(@in_array($this->fileext($file),$this->ext)||$exinfo[ext]=='all'){\r\n if(@chmod($nextdir.\"/\". $file,$this->permsValue))\r\n $this->debug(\"chmod:\".$nextdir.\"/\".$file.\"=>\".$this->permsValue);\r\n else\r\n $this->SetError(\"Error->chmod:\".$nextdir.\"/\".$file.\"=>\".$this->permsValue);\r\n }\r\n }\r\n //===============action:end=====================\r\n }\r\n }\r\n\r\n }//end read dir while\r\n $i++;\r\n closedir($dir);\r\n $noindex=$info[$level+1]['index']+1;\r\n $info[$level+1][$dirnum]=\"?/none\";\r\n\r\n if($hasdir==1){//level+1下一层次,即下一个兄弟接点是否存在\r\n $curindex=$info[$level+1]['index'];\r\n $nextdir= $info[$level+1][$curindex];\r\n $info[$level+1][\"index\"]++;\r\n $level++;\r\n }\r\n else{\r\n if($this->action==\"deldir\"){\r\n if(@rmdir($nextdir)) $this->debug( \"delete dir:\".$nextdir );\r\n else $this->SetError( \"Error->delete dir:\".$nextdir );\r\n }\r\n if($this->action=='getfiles'){\r\n $this->files[$i]['name']=\"$nextdir\";\r\n $this->files[$i]['folder']=1;\r\n }\r\n $tempflag=0;\r\n while($level!=0 && $tempflag==0){\r\n\r\n $curindex=$info[$level]['index'];\r\n if($info[$level][$curindex]!=\"?/none\") {\r\n $nextdir=$info[$level][$curindex];\r\n $info[$level]['index']++;\r\n $tempflag=1;\r\n }\r\n else{\r\n $level--;\r\n if($this->action==\"deldir\"){\r\n $curindex= $info[$level][\"index\"];\r\n $deldir= $info[$level][$curindex-1];\r\n if($deldir){\r\n if(@rmdir($deldir)) $this->debug(\"delete dir:\".$deldir);\r\n else $this->SetError(\"Err:delete dir:\".$deldir);\r\n }\r\n }\r\n if($this->action=='getfiles'){\r\n $curindex= $info[$level][\"index\"];\r\n $deldir= $info[$level][$curindex-1];\r\n $this->files[$i]['name']=$deldir;\r\n $this->files[$i]['folder']=1;\r\n }\r\n //echo \"--->level:\".$level.\"<br>\";\r\n } //end if\r\n }//end goback while\r\n }//end if\r\n\r\n }//end level while\r\n\r\n $this->dirnums++;\r\n\r\n $this->debug(\"文件夹: $this->dirnums 个;文件: $this->filenums 个.Size:$this->totalsize bytes\");\r\n\r\n if($this->action=='view') return $list;\r\n\r\n }", "public static function setSessionIni () {\n \n // session host. Use .example.com if you want to allow session\n // accross sub domains. Interesting: You can not use testserver\n // server without country part)\n \n $session_host = conf::getMainIni('session_host');\n if ($session_host){\n ini_set(\"session.cookie_domain\", $session_host);\n }\n \n \n $session_save_path = conf::getMainIni('session_save_path');\n if ($session_save_path) { \n ini_set(\"session.save_path\", $session_save_path);\n }\n \n \n \n // session time\n $session_time = conf::getMainIni('session_time');\n if (!$session_time) { \n $session_time = '0';\n }\n ini_set(\"session.cookie_lifetime\", $session_time);\n\n // session path\n $session_path = conf::getMainIni('session_path');\n if ($session_path) {\n ini_set(\"session.cookie_path\", $session_path);\n }\n\n // secure session\n $session_secure = conf::getMainIni('session_secure');\n if ($session_secure) { \n ini_set(\"session.cookie_secure\", true);\n } else {\n ini_set(\"session.cookie_secure\", false);\n }\n\n // set a session name. You need this if the session \n // should cross sub domains\n $session_name = conf::getMainIni('session_name');\n if ($session_name) { \n session_name($session_name);\n }\n }", "public function initSession() {\n if (is_writable(GLPI_SESSION_DIR)) {\n Session::setPath();\n } else {\n if (isCommandLine()) {\n die(\"Can't write in \".GLPI_SESSION_DIR.\"\\n\");\n }\n }\n Session::start();\n\n if (isCommandLine()) {\n // Init debug variable\n $_SESSION = ['glpilanguage' => (isset($this->args['lang']) ? $this->args['lang'] : 'en_GB')];\n $_SESSION[\"glpi_currenttime\"] = date(\"Y-m-d H:i:s\");\n }\n\n // Init debug variable\n // Only show errors\n Toolbox::setDebugMode(Session::DEBUG_MODE, 0, 0, 1);\n }", "function write_hardcode($con, $db_user, $db_pass, $db_prefix, $admin_pass, $use_cookie) {\n $filepath = \"../hardcode.php\";\n \n file_put_contents(\"../cache/perm/request.001\", \"0\");\n\n\n $data = '<?php\n/* Data base details */\n$dsn=\\'' . $con . '\\'; //DSN\n$db_user=\\'' . $db_user . '\\'; //DB username\n$db_pass=\\'' . $db_pass . '\\'; //DB password \n$driver=\\'' . $_SESSION[\"cms\"] . '\\'; //Integration driver\n$db_prefix=\\'' . $db_prefix . '\\'; //prefix used for tables in database\n$uid=\\'' . uniqid() . '\\'; //Any random unique number\n\n$PATH = \\'' . $_SESSION[\"freichat_renamed\"] . '/\\'; // Use this only if you have placed the freichat folder somewhere else\n$installed=true; //make it false if you want to reinstall freichat\n$admin_pswd=\\'' . $admin_pass . '\\'; //backend password \n\n$debug = false;\n$custom_error_handling=\\'NO\\'; // used during custom installation\n\n$use_cookie='.$use_cookie.';\n\n/* email plugin */\n$smtp_username = \\'\\';\n$smtp_password = \\'\\';\n\n$force_load_jquery = \\'NO\\';\n\n/* Custom driver */\n$usertable=\\'login\\'; //specifies the name of the table in which your user information is stored.\n$row_username=\\'root\\'; //specifies the name of the field in which the user\\'s name/display name is stored.\n$row_userid=\\'loginid\\'; //specifies the name of the field in which the user\\'s id is stored (usually id or userid)\n$avatar_field_name = \\'avatar\\';';\n\n file_put_contents($filepath, $data);\n}", "function setFilename($filename);", "function serendipity_installFiles($serendipity_core = '') {\n global $serendipity;\n\n // This variable is transmitted from serendipity_admin_installer. If an empty variable is used,\n // this means that serendipity_installFiles() was called from the auto-updater facility.\n if (empty($serendipity_core)) {\n $serendipity_core = $serendipity['serendipityPath'];\n }\n\n $htaccess = @file_get_contents($serendipity_core . '.htaccess');\n\n // Let this function be callable outside installation and let it use existing settings.\n $import = array('rewrite', 'serendipityHTTPPath', 'indexFile');\n foreach($import AS $key) {\n if (empty($_POST[$key]) && isset($serendipity[$key])) {\n $$key = $serendipity[$key];\n } else {\n $$key = $_POST[$key];\n }\n }\n\n if (substr(php_sapi_name(), 0, 3) == 'cgi') {\n $htaccess_cgi = '_cgi';\n } else {\n $htaccess_cgi = '';\n }\n\n /* If this file exists, a previous install failed painfully. We must consider the safer alternative now */\n if (file_exists($serendipity_core . '.installer_detection_failsafe')) {\n $htaccess_cgi = '_cgi';\n @unlink($serendipity_core . '.htaccess');\n }\n\n /* Detect comptability with php_value directives */\n if ($htaccess_cgi == '') {\n $response = '';\n $serendipity_root = dirname($_SERVER['PHP_SELF']) . '/';\n $serendipity_host = preg_replace('@^([^:]+):?.*$@', '\\1', $_SERVER['HTTP_HOST']);\n\n $old_htaccess = @file_get_contents($serendipity_core . '.htaccess');\n $fp = @fopen($serendipity_core . '.htaccess', 'w');\n if ($fp) {\n fwrite($fp, 'php_value register_globals off'. \"\\n\" .'php_value session.use_trans_sid 0');\n fclose($fp);\n\n $safeFP = @fopen($serendipity_core . '.installer_detection_failsafe', 'w');\n fclose($safeFP);\n $sock = fsockopen($serendipity_host, $_SERVER['SERVER_PORT'], $errorno, $errorstring, 10);\n if ($sock) {\n fputs($sock, \"GET {$serendipityHTTPPath} HTTP/1.0\\r\\n\");\n fputs($sock, \"Host: $serendipity_host\\r\\n\");\n fputs($sock, \"User-Agent: Serendipity/{$serendipity['version']}\\r\\n\");\n fputs($sock, \"Connection: close\\r\\n\\r\\n\");\n\n while (!feof($sock) && strlen($response) < 4096) {\n $response .= fgets($sock, 400);\n }\n fclose($sock);\n }\n\n # If we get HTTP 500 Internal Server Error, we have to use the .cgi template\n if (preg_match('@^HTTP/\\d\\.\\d 500@', $response)) {\n $htaccess_cgi = '_cgi';\n }\n\n if (!empty($old_htaccess)) {\n $fp = @fopen($serendipity_core . '.htaccess', 'w');\n fwrite($fp, $old_htaccess);\n fclose($fp);\n } else {\n @unlink($serendipity_core . '.htaccess');\n }\n\n @unlink($serendipity_core . '.installer_detection_failsafe');\n }\n }\n\n\n if ($rewrite == 'rewrite2') {\n $template = 'htaccess' . $htaccess_cgi . '_rewrite2.tpl';\n } elseif ($rewrite == 'rewrite') {\n $template = 'htaccess' . $htaccess_cgi . '_rewrite.tpl';\n } elseif ($rewrite == 'errordocs') {\n $template = 'htaccess' . $htaccess_cgi . '_errordocs.tpl';\n } else {\n $template = 'htaccess' . $htaccess_cgi . '_normal.tpl';\n }\n\n if (!($a = file(S9Y_INCLUDE_PATH . 'include/tpl/' . $template, 1))) {\n $errs[] = ERROR_TEMPLATE_FILE;\n }\n\n // When we write this file we cannot rely on the constants defined\n // earlier, as they do not yet contain the updated contents from the\n // new config. Thus we re-define those. We do still use constants\n // for backwards/code compatibility.\n\n $PAT = serendipity_permalinkPatterns(true);\n\n $content = str_replace(\n array(\n '{PREFIX}',\n '{indexFile}',\n '{PAT_UNSUBSCRIBE}', '{PATH_UNSUBSCRIBE}',\n '{PAT_ARCHIVES}', '{PATH_ARCHIVES}',\n '{PAT_FEEDS}', '{PATH_FEEDS}',\n '{PAT_FEED}',\n '{PAT_ADMIN}', '{PATH_ADMIN}',\n '{PAT_ARCHIVE}', '{PATH_ARCHIVE}',\n '{PAT_PLUGIN}', '{PATH_PLUGIN}',\n '{PAT_DELETE}', '{PATH_DELETE}',\n '{PAT_APPROVE}', '{PATH_APPROVE}',\n '{PAT_SEARCH}', '{PATH_SEARCH}',\n '{PAT_COMMENTS}', '{PATH_COMMENTS}',\n '{PAT_CSS}',\n '{PAT_JS}',\n '{PAT_PERMALINK}',\n '{PAT_PERMALINK_AUTHORS}',\n '{PAT_PERMALINK_FEEDCATEGORIES}',\n '{PAT_PERMALINK_CATEGORIES}',\n '{PAT_PERMALINK_FEEDAUTHORS}'\n ),\n\n array(\n $serendipityHTTPPath,\n $indexFile,\n trim($PAT['UNSUBSCRIBE'], '@/i'), $serendipity['permalinkUnsubscribePath'],\n trim($PAT['ARCHIVES'], '@/i'), $serendipity['permalinkArchivesPath'],\n trim($PAT['FEEDS'], '@/i'), $serendipity['permalinkFeedsPath'],\n trim(PAT_FEED, '@/i'),\n trim($PAT['ADMIN'], '@/i'), $serendipity['permalinkAdminPath'],\n trim($PAT['ARCHIVE'], '@/i'), $serendipity['permalinkArchivePath'],\n trim($PAT['PLUGIN'], '@/i'), $serendipity['permalinkPluginPath'],\n trim($PAT['DELETE'], '@/i'), $serendipity['permalinkDeletePath'],\n trim($PAT['APPROVE'], '@/i'), $serendipity['permalinkApprovePath'],\n trim($PAT['SEARCH'], '@/i'), $serendipity['permalinkSearchPath'],\n trim($PAT['COMMENTS'], '@/i'), $serendipity['permalinkCommentsPath'],\n trim(PAT_CSS, '@/i'),\n trim(PAT_JS, '@/i'),\n trim($PAT['PERMALINK'], '@/i'),\n trim($PAT['PERMALINK_AUTHORS'], '@/i'),\n trim($PAT['PERMALINK_FEEDCATEGORIES'], '@/i'),\n trim($PAT['PERMALINK_CATEGORIES'], '@/i'),\n trim($PAT['PERMALINK_FEEDAUTHORS'], '@/i')\n ),\n\n implode('', $a)\n );\n\n $fp = @fopen($serendipity_core . '.htaccess', 'w');\n if (!$fp) {\n $errs[] = sprintf(FILE_WRITE_ERROR, $serendipity_core . '.htaccess') . ' ' . FILE_CREATE_YOURSELF;\n $errs[] = sprintf(COPY_CODE_BELOW , $serendipity_core . '.htaccess', 'serendipity', serendipity_specialchars($content));\n return $errs;\n } else {\n // Check if an old htaccess file existed and try to preserve its contents. Otherwise completely wipe the file.\n if ($htaccess != '' && preg_match('@^(.*)#\\s+BEGIN\\s+s9y.*#\\s+END\\s+s9y(.*)$@isU', $htaccess, $match)) {\n // Code outside from s9y-code was found.\n fwrite($fp, $match[1] . $content . $match[2]);\n } else {\n fwrite($fp, $content);\n }\n fclose($fp);\n return true;\n }\n\n}", "function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}", "public function session_init()\n {\n // session started (Installer?)\n if (session_id())\n return;\n\n $sess_name = $this->config->get('session_name');\n $sess_domain = $this->config->get('session_domain');\n $lifetime = $this->config->get('session_lifetime', 0) * 60;\n\n // set session domain\n if ($sess_domain) {\n ini_set('session.cookie_domain', $sess_domain);\n }\n // set session garbage collecting time according to session_lifetime\n if ($lifetime) {\n ini_set('session.gc_maxlifetime', $lifetime * 2);\n }\n\n ini_set('session.cookie_secure', rcube_ui::https_check());\n ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid');\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.serialize_handler', 'php');\n\n // use database for storing session data\n $this->session = new rcube_session($this->get_dbh(), $this->config);\n\n $this->session->register_gc_handler(array($this, 'temp_gc'));\n $this->session->register_gc_handler(array($this, 'cache_gc'));\n\n // start PHP session (if not in CLI mode)\n if ($_SERVER['REMOTE_ADDR'])\n session_start();\n\n // set initial session vars\n if (!$_SESSION['user_id'])\n $_SESSION['temp'] = true;\n\n // restore skin selection after logout\n if ($_SESSION['temp'] && !empty($_SESSION['skin']))\n $this->config->set('skin', $_SESSION['skin']);\n }", "public function set_temp_dir() {\n\t\t$this->temp_dir = tempnam( $this->sys_temp_dir, \"RTV\" );\n\t\tunlink( $this->temp_dir );\n\t\tmkdir( $this->temp_dir );\n\t\techo \"Temporary dir: {$this->temp_dir}\" . PHP_EOL;\n\t}", "private static function init() {\n\t\t\tself::$_ownerName = function_exists( 'get_current_user' ) ?\n\t\t\t\tget_current_user() :\n\t\t\t\t'unknown';\n\t\t\tself::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );\n\t\t\tself::$_abspathLength = strlen( ABSPATH );\n\t\t\tself::$_processID = mt_rand( 0, 32000 );\n\n\t\t\t// Process ID may be `false` on errors.\n\t\t\tif ( ! is_numeric( self::$_processID ) ) {\n\t\t\t\tself::$_processID = 0;\n\t\t\t}\n\t\t}", "public function setFilename($filename) {\n if (is_writable(dirname($filename))) {\n $this->filename = $filename;\n } else {\n die('Directory ' . dirname($filename) . ' is not writable');\n }\n }", "public function setIdentifier(){\n\n \t$this->fileIdentifier = $this->getIdentifier();\n }", "protected function setExportTmpAndLogSettings()\n {\n $this->setExportFolderPath(\n $this->directory->getPath(DirectoryList::TMP) . DS . 'shopgate' . DS . $this->getShopNumber()\n );\n $this->createFolderIfNotExist($this->getExportFolderPath());\n\n $this->setLogFolderPath(\n $this->directory->getPath(DirectoryList::LOG) . DS . 'shopgate' . DS . $this->getShopNumber()\n );\n $this->createFolderIfNotExist($this->getLogFolderPath());\n\n $this->setCacheFolderPath(\n $this->directory->getPath(DirectoryList::TMP) . DS . 'shopgate' . DS . $this->getShopNumber()\n );\n $this->createFolderIfNotExist($this->getCacheFolderPath());\n }", "function MySessionStart() {\n\tif (defined('SET_SESSION_NAME')) session_name(SET_SESSION_NAME);\n\t\n\tif (TRACKPOINT_ISSETUP) {\n\t\tif (!defined('TABLEPREFIX')) define('TABLEPREFIX', TRACKPOINT_TABLEPREFIX);\n\t\t$ses_class = new Session();\n\t\tsession_set_save_handler(\n\t\t\tarray(&$ses_class, '_open'),\n\t\t\tarray(&$ses_class, '_close'),\n\t\t\tarray(&$ses_class, '_read'),\n\t\t\tarray(&$ses_class, '_write'),\n\t\t\tarray(&$ses_class, '_destroy'),\n\t\t\tarray(&$ses_class, '_gc')\n\t\t);\n\t} else {\n\t\tini_set('session.save_handler', 'files');\n\t\tif (defined('TEMP_DIRECTORY') && is_writable(TEMP_DIRECTORY)) ini_set('session.save_path', TEMP_DIRECTORY);\n\t}\n\tsession_start();\n}", "public static function setSessionHandler () {\n \n // use memcache if available\n $handler = conf::getMainIni('session_handler');\n if ($handler == 'memcache'){\n $host = conf::getMainIni('memcache_host');\n if (!$host) {\n $host = 'localhost';\n }\n $port = conf::getMainIni('memcache_port');\n if (!$port) {\n $port = '11211';\n }\n $query = conf::getMainIni('memcache_query');\n if (!$query) {\n $query = 'persistent=0&weight=2&timeout=2&retry_interval=10';\n }\n $session_save_path = \"tcp://$host:$port?$query, ,tcp://$host:$port \";\n ini_set('session.save_handler', 'memcache');\n ini_set('session.save_path', $session_save_path);\n }\n }", "public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }", "public function set() {\n\t\t$this->token = uniqid(rand(), true);\n\n\t\t$this->time = time();\n\n\t\t$this->$referer = $_SERVER['HTTP_REFERER'];\n\n\t\tif ($this->isEnable()) {\n\t\t\t$_SESSION['token'] = $this->token;\n\t\t\t$_SESSION['token_time'] = $this->time;\n\t\t\t$_SESSION['token_referer'] = $this->$referer;\n\t\t}\n\t}", "public function setUp()\n {\n $this->fp = fopen(static::$stream . '://' . static::$varName, 'r+');\n }", "public function __construct(){\n\t\t//e.g. /benGallery/gallery/admin.php ( after the domain in the url)\n\t\t$this->uri=substr($_SERVER['REQUEST_URI'],0,(strpos($_SERVER['REQUEST_URI'],'?')?strpos($_SERVER['REQUEST_URI'],'?'):strlen($_SERVER['REQUEST_URI'])));\n\t\t\n\t\t$this->http_server='http'.(isset($_SERVER['HTTPS']) ? 's' : '').'://'.$_SERVER['HTTP_HOST'];\n\t\t\n\t\tif(isset($_SERVER['HTTP_REFERER'])){\n\t\t\tif(substr($_SERVER['HTTP_REFERER'],0,strlen($this->http_server))==$this->http_server){\n\t\t\t\t$this->referer=substr($_SERVER['HTTP_REFERER'],strlen($this->http_server));\n\t\t\t}else{\n\t\t\t\t$this->referer=$_SERVER['HTTP_REFERER'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//e.g. /var/www/benGallery/gallery/ ( absolute path to the gallery script)\n\t\t$this->fs_path=$_SERVER['DOCUMENT_ROOT'].substr($_SERVER[\"SCRIPT_NAME\"],0,strrpos($_SERVER[\"SCRIPT_NAME\"],'/')+1);\n\t\n\t\t//load params from url\n\t\tparse_str($_SERVER['QUERY_STRING'],$this->query);\n\t\t\n\t\t//subtract query string from uri to end up with the http path to the app on this server\n\t\tif(isset($this->query['page']) && !empty($this->query['page'])){\n\t\t\t$this->root_http_path=substr($this->uri,0,-strlen(str_replace(array(' '),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('%20'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $this->query['page'])));\n\t\t}else{\n\t\t\t$this->root_http_path=$this->uri;\n\t\t}\n\t\t\n\t\t//BEGIN SESSION!\n\t\tsession_set_cookie_params(0,$this->root_http_path);\n\t\t$a = session_id();\n\t\tif ($a == '') session_start();\n\t\tif (!isset($_SESSION['safety'])) {\n\t\t\tsession_regenerate_id(true);\n\t\t\t$_SESSION['safety'] = true;\n\t\t}\n\t\t$_SESSION['sessionid'] = session_id();\n\n\t\t//LOAD CONFIGURATION\n\t\t$this->ini=parse_ini_string(file_get_contents($this->config_name),true);\n\n\t\t//determine which page to view\n\t\t$this->page=array('uri'=>$this->ini['front']['default'],'params'=>array(),'template'=>false);\n\t\tif(isset($this->query['page'])) \n\t\t\t$this->page=$this->determine_uri_split($this->query['page']);\n\t\t\t\n\t\t$this->page['template']=$this->determine_tpl($this->page['uri']);\n\t\t\n\t\t//load cascading extra config\n\t\t$this->page['extra_config']=array_reverse($this->determine_cfg($this->page['uri']));\n\t\tforeach($this->page['extra_config'] as $extra_config){\n\t\t\t$this->load_cfg($extra_config);\n\t\t}\n\t\t\n\t\t//load package configs\n\t\twhile(isset($this->ini['front']) && isset($this->ini['front']['config']) && \n\t\t\t\tis_array($this->ini['front']['config']) && count($this->ini['front']['config'])){\n\t\t\t\t\n\t\t\tforeach($this->ini['front']['config'] as $pkgId=>$pkg){\n\t\t\t\t$this->load_cfg($this->ini['front']['template_dir'].$pkg.'/'.$this->config_name);\n\t\t\t\tunset($this->ini['front']['config'][$pkgId]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//load header html code from the config file!\n\t\tif(isset($this->ini['front']['headerHTML'])) $this->page['headerHTML']=$this->ini['front']['headerHTML'];\n\t\telse $this->page['headerHTML']=array();\n\t\t\n\n\t\t//load database driver module\n\t\tif(isset($this->ini['db']['driver'])) $this->db=$this->load($this->ini['db']['driver']);\t\n\t\t\t\n\t\t//load initial modules in ascending order of keys\n\t\tksort($this->ini['init']);\n\t\tforeach($this->ini['init'] as $mod_array){\n\t\t\tforeach($mod_array as $mod){\n\t\t\t\t$this->load($mod);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private function initializeSettings() {\r\n global $config;\r\n $this->settings = $config;\r\n $this->fileUploadPath = $this->settings[\"uploadFolder\"];\r\n $this->fileSavePath = $this->settings[\"downloadFolder\"];\r\n $this->currentLang = $this->settings[\"lang\"];\r\n $this->currentpage = 1;\r\n }", "function startupHandler($param)\n {\n if (true) {\n $app = $param['source']->getApplication();\n $app->removeStyle('common/static/common.css');\n $app->addStyle('/static/tuit.css');\n\n $session_id = $_COOKIE['sessionid'];\n \n $ch = curl_init();\n $server_host = $_SERVER['SERVER_ADDR'];\n $browser_host = $_SERVER['HTTP_HOST'];\n $request_uri = $_SERVER['REQUEST_URI'];\n $server_port = $_SERVER['SERVER_PORT'];\n //\tmessage($_SERVER);\n $port_part = ($server_port != 80)?\":$server_port\":\"\";\n $port_part=\"\";\n\t \n\t \n\t //echo \"http://\" .$server_host . $port_part.\"/tuit/account/session/\";\n\t \t \n curl_setopt($ch, CURLOPT_URL, \"http://\" .$server_host . $port_part.\"/tuit/account/session/\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_COOKIE, \"sessionid=$session_id\");\n $res = curl_exec($ch);\n $info = curl_getinfo($ch);\n curl_close($ch);\n //message($_SERVER);\n\t //print_r($info);\n\t \n if ($res !== false) {\n\t \n $msg = json_decode($res);\n //message($msg);\n \n if ($msg != null && strlen($msg->username)) {\n $vg = property::get('loginTuit.viewGroup');\n $eg = property::get('loginTuit.editGroup');\n $ag = property::get('loginTuit.adminGroup');\n $can_view=$can_edit=$can_admin=0;\n if ($vg == '' || in_array($vg, $msg->groups)) {\n $can_view = 1;\n }\n if ($eg == '' || in_array($eg, $msg->groups)) {\n $can_edit = 1;\n }\n if ($ag == '' || in_array($ag, $msg->groups)) {\n $can_admin = 1;\n }\n \n //message(\"view: $can_view, edit: $can_edit, admin: $can_admin\");\n \n ciUser::setUser($msg->username,$msg->first_name . \" \" . $msg->last_name, $msg->email, $can_view, $can_edit, $can_admin);\n $param['source']->addContent('main_menu_pre',sprintf(\"<ul class='user_info'><li class='username'><a href='/tuit/account/%s'>%s - %s</a></li>\\n<li class='logout_button'><a href='/tuit/account/logout'>\"._(\"Log out\").\"</a></li></ul>\\n\",\n ciUser::$_me->username,\n ciUser::$_me->username,\n ciUser::$_me->fullname));\n \n return;\n }\n \n /* message(\"Status: \" . $info['http_code']);\n message(\"Got back \" . strlen($res) . \" characters of information\");\n message(\"Output from session query: \" . $res);\n */\n \n }\n util::redirect(\"http://\" .$browser_host .\"/tuit/account/login/?next=\" . urlencode($request_uri));\n\n }\n else {\n \n $username = $_SERVER['REMOTE_USER'];\t\n if($username) {\n ciUser::loginUser($username);\n }\n }\n \n \n }", "private function setSESSIONvariables() {\n $_SESSION['pqz_configuration'] = $this->configuration;\n $_SESSION['pqz_question'] = $this->question;\n }", "function startSession(){\r\n\r\n\t\tsession_name(\"phpBMS\".preg_replace('/\\W/',\"\",APPLICATION_NAME).\"v096ID\");\r\n\t\tsession_start();\r\n\r\n\t}", "function load_config() {\n $config_file = \"scripts/i-erp.conf\";\n $comment = \"#\";\n // open the config file\n $fp = fopen($config_file, \"r\");\n if (!$fp) {\n echo(\"Failed to open file\");\n return 0;\n }\n // loop through the file lines and pull out variables\n while (!feof($fp)) {\n $line = trim(fgets($fp));\n if ($line && $line[0] != $comment) {\n $pieces = explode(\"=\", $line);\n $option = trim($pieces[0]);\n $value = trim($pieces[1]);\n $config_values[$option] = $value;\n }\n }\n fclose($fp);\n $_SESSION['install_lib'] = $config_values['install_lib'];\n $_SESSION['server'] = $config_values['server'];\n $_SESSION['timeout'] = $config_values['timeout'];\n $_SESSION['appname'] = $config_values['appname'];\n $_SESSION['h_logo'] = $config_values['h_logo'];\n $_SESSION['si_logo'] = $config_values['si_logo'];\n $_SESSION['copyr'] = $config_values['copyr'];\n return 1;\n}", "public function setUp()\n {\n $this->fs = new Filesystem();\n $this->cacheDir = __DIR__ . '/cache';\n if ($this->fs->exists($this->cacheDir)) {\n $this->fs->remove($this->cacheDir);\n }\n\n $this->cache = new ConfigFileScriptCache($this->cacheDir, true);\n }", "public function setup()\n {\n $this->luser = $this->sessioncheck('user', FALSE); # see if there is a user variable in the session....\n foreach (getallheaders() as $k => $v)\n {\n if (self::TOKEN === strtoupper($k))\n {\n $tok = JWT::decode($v, self::KEY);\n $this->luser = $this->load('user', $tok->sub);\n $this->tokauth = TRUE;\n break;\n }\n }\n if (isset($_SERVER['REDIRECT_URL']) && !preg_match('/index.php/', $_SERVER['REDIRECT_URL']))\n {\n/**\n * Apache v 2.4.17 changed the the REDIRECT_URL value to be a full URL, so we need to strip this.\n * Older versions will not have this so the code will do nothing.\n */\n $uri = preg_replace('#^https?://[^/]+#', '', $_SERVER['REDIRECT_URL']);\n }\n else\n {\n $uri = $_SERVER['REQUEST_URI'];\n }\n if ($_SERVER['QUERY_STRING'] != '')\n { # there is a query string so get rid it of it from the URI\n list($uri) = explode('?', $uri);\n }\n $req = array_filter(explode('/', $uri)); # array_filter removes empty elements - trailing / or multiple /\n/*\n * If you know that the base directory is empty then you can delete the next test block.\n *\n * You can also optimise out the loop if you know how deep you are nested in sub-directories\n *\n * The code here is to make it easier to move your code around within the hierarchy. If you don't need\n * this then optimise the hell out of it.\n */\n if ($this->local()->base() != '')\n { # we are in at least one sub-directory\n $bsplit = array_filter(explode('/', $this->local()->base()));\n foreach (range(1, count($bsplit)) as $c)\n {\n array_shift($req); # pop off the directory name...\n }\n }\n if (!empty($req))\n { # there was something after the domain name so split it into action and rest...\n $this->reqaction = strtolower(array_shift($req));\n $this->reqrest = empty($req) ? [''] : array_values($req);\n }\n\n return $this;\n }", "function setPreventUninstallScript($state=true) {\r\n\t\t\t$this->_preventUninstallScript = $state;\r\n\t\t\treturn $this->_preventUninstallScript;\r\n\t\t}", "function init() {\n $this->properties = array();\n if(isset($_SERVER['REQUEST_METHOD'])) {\n $urlPieces = explode(\"/\", $_GET['q']);\n array_shift($urlPieces);// the way our mod_rewrite does this, it adds an empty string as an extra element on the beginning\n if($urlPieces[0] === \"a\") {// something like foo/bar/test\n $this->setProperty(\"app\", \"true\");\n $this->setProperty(\"cmd\", $urlPieces[1]);\n $this->setProperty(\"action\", $urlPieces[2]);\n } else {\n $this->setProperty(\"cmd\", $urlPieces[0]);\n $this->setProperty(\"action\", $urlPieces[1]);\n\n if(count($urlPieces) > 2) {\n for($i = 2; $i < count($urlPieces); ++$i) {\n $this->extras[] = $urlPieces[$i];\n }\n }\n }\n }\n\n if(isset($_SERVER['argv'][0])) {\n $argPieces = explode(\"&\", $_SERVER['argv'][0]);\n } else {\n $argPieces = array();\n }\n\n foreach($argPieces as $arg) {\n if(strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);// a=login <- a = 'cmd' in CommandResolver\n $this->setProperty($key, $val);\n }\n }\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 exec ()\n {\n // download and config the kitFramework\n $this->downloadAndConfigTheFramework();\n\n $relative_path = parse_url(WB_URL, PHP_URL_PATH);\n if (!empty($relative_path) && file_exists(WB_PATH.'/modules/kit_framework/Setup/htaccess.htt')) {\n $htaccess = file_get_contents(WB_PATH.'/modules/kit_framework/Setup/htaccess.htt');\n $htaccess = str_ireplace('{RELATIVE_PATH}', \"$relative_path/kit2\", $htaccess);\n file_put_contents(WB_PATH.'/kit2/.htaccess', $htaccess);\n }\n\n // download and config the Basic extension\n $this->downloadAndConfigTheBasicExtension();\n\n // add the output filter for the framework\n $this->addFilter();\n\n // copy the proxy.json\n if (file_exists(WB_PATH.'/modules/kit_framework/proxy.json')) {\n if (file_exists(WB_PATH.'/kit2/config') && !file_exists(WB_PATH.'/kit2/config/proxy.json')) {\n @copy(WB_PATH.'/modules/kit_framework/proxy.json', WB_PATH.'/kit2/config/proxy.json');\n }\n }\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('uploadUri', $this->getController()->buildUriPath(uploadController::ACTION_UPLOAD));\n\t\t$this->getEngine()->assign('doUploadUri', $this->getController()->buildUriPath(uploadController::ACTION_DO_UPLOAD));\n\t\t$this->getEngine()->assign('doMovieSave', $this->getController()->buildUriPath(uploadController::ACTION_MOVIE_SAVE));\n\t}", "protected function _initFilesystem() {\n $this->_createWriteableDir($this->getTargetDir());\n $this->_createWriteableDir($this->getQuoteTargetDir());\n\n // Directory listing and hotlink secure\n $io = new Varien_Io_File();\n $io->cd($this->getTargetDir());\n if (!$io->fileExists($this->getTargetDir() . DS . '.htaccess')) {\n $io->streamOpen($this->getTargetDir() . DS . '.htaccess');\n $io->streamLock(true);\n $io->streamWrite(\"Order deny,allow\\nAllow from all\");\n $io->streamUnlock();\n $io->streamClose();\n }\n }", "function SetScriptName ($script)\r\n {\r\n if ($script)\r\n {\r\n $this->_script = $script; \r\n }\r\n }", "private static function setScriptPath() {\n\t\tif ( self::getIsCli() ) {\n\t\t\tif ( substr($_SERVER['SCRIPT_NAME'],0,1) == self::getDirSeparator() ) {\n\t\t\t\tself::$_ScriptPath = dirname($_SERVER['SCRIPT_NAME']);\n\t\t\t} else {\n\t\t\t\tif ( isset($_SERVER['PWD']) && strpos($_SERVER['PWD'], '/cygdrive') === 0 ) {\n\t\t\t\t\t// if running under cygwin, the path is from the cygwin terminal\n\t\t\t\t\t$pwd = preg_replace('/\\/cygdrive\\/([A-Z]{1})\\//i', '\\1:/', $_SERVER['PWD']);\n\t\t\t\t\t$pwd = ucfirst(str_replace(array('\\\\', '/'), self::getDirSeparator(), $pwd));\n\t\t\t\t\t$apath = explode(self::getDirSeparator(), $pwd);\n\t\t\t\t} else {\n\t\t\t\t\tif ( isset($_SERVER['PWD']) ) {\n\t\t\t\t\t\t$apath = explode(self::getDirSeparator(), substr($_SERVER['PWD'],1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$apath = explode(self::getDirSeparator(), substr(dirname(dirname(dirname(__FILE__))),1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pos = count($apath)-1;\n\t\t\t\t$ascript = explode(self::getDirSeparator(), $_SERVER['SCRIPT_NAME']);\n\t\t\t\tforeach ($ascript as $val) {\n\t\t\t\t\tif ($val == '.') continue;\n\t\t\t\t\tif ($val == '..') {\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($pos < -1) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$apath[++$pos] = $val;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( isset($_SERVER['PWD']) && strpos($_SERVER['PWD'], '/cygdrive') === 0 ) {\n\t\t\t\t\tself::$_ScriptPath = trim(dirname(implode(self::getDirSeparator(), $apath)));\n\t\t\t\t} else {\n\t\t\t\t\tself::$_ScriptPath = trim(dirname(self::getDirSeparator().implode(self::getDirSeparator(), $apath)));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tself::$_ScriptPath = str_replace(\n\t\t\t\tarray('\\\\', '/'), self::getDirSeparator(), dirname($_SERVER['SCRIPT_FILENAME'])\n\t\t\t);\n\t\t}\n\t}", "public function __construct(){\n\n parent::__construct();\n \n $this->cfg_jsincdir=$this->getFileName($this->cfg_jsincdir);\n $this->cfg_jquerylink=$this->getFileName($this->cfg_jquerylink);\n $this->cfg_jquerylinkmin=$this->getFileName($this->cfg_jquerylinkmin);\n $this->cfg_jqueryuilink=$this->getFileName($this->cfg_jqueryuilink);\n $this->cfg_jqueryuicsslink=$this->getFileName($this->cfg_jqueryuicsslink);\n $this->cfg_dojolink=$this->getFileName($this->cfg_dojolink); \n \n }", "function setBufferFile()\r\n\t {\r\n\t \t//$this->_bufferFile = '/tmp/fabrik_package-' . $this->label . '.xml';\r\n\t\t$this->_bufferFile = JPATH_SITE . \"/administrator/components/com_fabrik/fabrik_package-\". $this->label . '.xml';\r\n\t }", "private function setSessionName(): void\n {\n $cookie = new Cookie($this->expiringTime - 1);\n if ($cookie->exists('sessionName')) {\n return;\n }\n\n // unset all session name cookies\n foreach ($_COOKIE as $key => $value) {\n if (strlen($key) === strlen($this->name)) {\n $cookie->unset($key);\n }\n }\n\n $cookie->save('sessionName', $this->name);\n }", "private function initSession()\n {\n // Start the session\n session_start();\n\n // Create session id constant\n define('SID', session_id());\n }", "public function run()\r\r\n\t{\r\r\n\t\t// Make sure there are no attempts to hack the file system\r\r\n\t\tif (preg_match('@^\\.+@i', $this->strFile) || preg_match('@\\.+/@i', $this->strFile) || preg_match('@(://)+@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid file name');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Limit downloads to the tl_files directory\r\r\n\t\tif (!preg_match('@^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '@') . '@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid path');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Check whether the file exists\r\r\n\t\tif (!file_exists(TL_ROOT . '/' . $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('File not found');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if there is no token or if the tokens do not match\r\r\n\t\tif (!strlen($this->Input->get('token')) || !is_array($_SESSION['downloadToken']) || !in_array($this->Input->get('token'), $_SESSION['downloadToken']))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie('Invalid download token');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if the file is not allowed\r\r\n\t\tif (!is_array($_SESSION['downloadFiles']) || !in_array($this->strFile, $_SESSION['downloadFiles']) || !preg_match('/^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '/') . '\\//i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('Download of file \"%s\" is not allowed', $this->strFile));\r\r\n\t\t}\r\r\n\r\r\n\t\t$objFile = new File($this->strFile);\r\r\n\t\t$arrAllowedTypes = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));\r\r\n\r\r\n\t\tif (!in_array($objFile->extension, $arrAllowedTypes))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('File type \"%s\" is not allowed', $objFile->extension));\r\r\n\t\t}\r\r\n\r\r\n\t\t// Open the \"save as...\" dialogue\r\r\n\t\theader('Content-Type: ' . $objFile->mime);\r\r\n\t\theader('Content-Transfer-Encoding: binary');\r\r\n\t\theader('Content-Disposition: attachment; filename=\"'.$objFile->basename.'\"');\r\r\n\t\theader('Content-Length: '.$objFile->filesize);\r\r\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0'); \r\r\n\t\theader('Pragma: public');\r\r\n\t\theader('Expires: 0');\r\r\n\r\r\n\t\t$resFile = fopen(TL_ROOT . '/' . $this->strFile, 'rb');\r\r\n\t\tfpassthru($resFile);\r\r\n\t\tfclose($resFile);\r\r\n\r\r\n\t\t// HOOK: post download callback\r\r\n\t\tif (array_key_exists('postDownload', $GLOBALS['TL_HOOKS']) && is_array($GLOBALS['TL_HOOKS']['postDownload']))\r\r\n\t\t{\r\r\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['postDownload'] as $callback)\r\r\n\t\t\t{\r\r\n\t\t\t\t$this->import($callback[0]);\r\r\n\t\t\t\t$this->$callback[0]->$callback[1]($this->strFile);\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\t\tConfig::getInstance()->set(array(\n\t\t\t'resource.session.test.namespace' => 'test',\n\t\t\t'resource.session.test.cookieName' => 'testSession',\n\t\t\t'resource.session.test.cookieDomain' => 'testdomain',\n\t\t\t'resource.session.test.cookiePath' => '/test',\n\n\t\t\t'resource.missingNamespace.cookieName' => 'testSession',\n\t\t));\n\t}", "protected function set_session_id() {\n $this->sessionid = static::$sessionidmockup;\n }", "function setFHtaccess($filename){\r\n\t\t$this->fHtaccess=$filename;\r\n\t}", "public static function start(): void\n {\n if (session_status() === PHP_SESSION_NONE) {\n ini_set('session.use_strict_mode', true);\n $options = [\n 'expires' => 0,\n 'path' => HTTPRequest::root(),\n 'secure' => HTTPRequest::isHTTPS(),\n 'httponly' => true,\n 'samesite' => Cookie::SAMESITE_STRICT\n ];\n if (($timeout = Formwork::instance()->option('admin.session_timeout')) > 0) {\n $options['expires'] = time() + $timeout * 60;\n }\n session_name(self::SESSION_NAME);\n session_start();\n if (!isset($_COOKIE[self::SESSION_NAME]) || $options['expires'] > 0) {\n // Send session cookie if not already sent or timeout is set\n Cookie::send(self::SESSION_NAME, session_id(), $options, true);\n } elseif ($_COOKIE[self::SESSION_NAME] !== session_id()) {\n // Remove cookie if session id is not valid\n unset($_COOKIE[self::SESSION_NAME]);\n Cookie::send(self::SESSION_NAME, '', ['expires' => time() - 3600] + $options, true);\n }\n }\n }", "function setSessionOn() {\n ini_set(\"session.cookie_lifetime\", 0);\n ini_set(\"session.use_cookies\", 1);\n ini_set(\"session.use_only_cookies\" , 1);\n ini_set(\"session.use_strict_mode\", 1);\n ini_set(\"session.cookie_httponly\", 1);\n ini_set(\"session.cookie_secure\", 1);\n ini_set(\"session.cookie_samesite\" , \"Strict\");\n ini_set(\"session.cache_limiter\" , \"nocache\");\n ini_set(\"session.sid_length\" , 48);\n ini_set(\"session.sid_bits_per_character\" , 6);\n ini_set(\"session.hash_function\" , \"sha256\");\n \n session_name(\"Authentification\");\n return session_start();\n}", "function _FTPProcessor()\r\n {\r\n //init...\r\n $info=array();\r\n $info[1][0]=$this->sDir;\r\n $info[1][1]=\"?/none\";\r\n $info[1]['index']=1;\r\n $nextdir=$info[1][0];\r\n $level=1;$deldirs=$i=0;\r\n \r\n $basedir=dirname($this->sDir);\r\n $basedir=($this->sDir);\r\n\r\n \r\n if($this->action==\"download\")\r\n {\r\n if(!$dir=opendir($this->dDir))\r\n {\r\n $this->SetError(\"target directory \".$targetdir[\"dest\"].\" doesn't exist!\");\r\n return 0;\r\n }\r\n }\r\n\r\n while($level!=0){\r\n\r\n if($this->action==\"view\"){\r\n $list[$i][name]= $nextdir;\r\n $list[$i][folder]=1;\r\n }\r\n //$files = ftp_nlist($this->ftpconn,$nextdir);\r\n $files = $this->ftp_getlist($this->ftpconn,$nextdir);\r\n\r\n $this->debug(\"Get list from $nextdir\");\r\n $hasdir=0;\r\n $dirnum=0;\r\n\r\n\t if($basedir==\"\") $realpath=$nextdir;\r\n\t else $realpath=substr($nextdir,strlen($basedir)+1);\r\n $destdir=$this->dDir.\"/\".$realpath;\r\n\r\n //=====action::begin=============\r\n if($this->action==\"download\"){\r\n if(@mkdir($destdir,0755))\r\n $this->debug(\"$this->action-> mkdir:\".$destdir);\r\n else\r\n $this->SetError(\"error of $this->action mkdir:\".$destdir);\r\n }\r\n if($this->action==\"chmod\"||$this->action==\"chmoddir\"){\r\n if(function_exists('ftp_chmod')&&ftp_chmod($this->ftpconn, $this->permsValue, $nextdir))\r\n $this->debug(\"chmod: $nextdir => $this->permsValue\");\r\n elseif(function_exists('ftp_site')&&ftp_site($this->ftpconn, \"CHMOD $this->permsValue $nextdir\"))\r\n $this->debug(\"chmod: $nextdir => $this->permsValue\");\r\n else\r\n $this->SetError(\"fail to chmod: $nextdir => $this->permsValue\");\r\n }\r\n //======action:end============\r\n\r\n if($files)\r\n foreach ($files as $key=>$fileinfo) {\r\n $isdir=$fileinfo[dirorfile];\r\n $file=$fileinfo[dirfilename];\r\n if (($file != \".\") && ($file != \"..\")){\r\n if($isdir == \"d\") { //Is a directory\r\n $hasdir=1;\r\n $info[$level+1][$dirnum]=$nextdir.'/'.$file;\r\n $info[$level+1]['index']=0;\r\n $dirnum++;\r\n $this->dirnums++;\r\n }\r\n if($isdir == \"-\") { //Is a file\r\n $this->filenums++;\r\n $i++;\r\n //=====action::begin================\r\n if($this->action==\"view\"){\r\n $list[$i][name]= $nextdir.'/'.$file;\r\n $list[$i][folder]=0;\r\n }\r\n if($this->action=='getfiles'){\r\n $this->files[$i]['name']=\"$nextdir/$file\";\r\n $this->files[$i]['folder']=0;\r\n }\r\n if($this->action==\"delfile\"){\r\n if(@in_array($this->fileext($file),$this->ext)||$this->ext=='all'){\r\n if(ftp_delete($this->ftpconn, $nextdir.'/'.$file)) $this->debug(\"delete: $file\");\r\n else $this->SetError(\"Error->delete: $file\");\r\n }\r\n }\r\n if($this->action==\"rename\"){\r\n if(@in_array($this->fileext($file),$this->ext)||$this->ext=='all'){\r\n // if(ftp_delete($this->ftpconn, $nextdir.'/'.$file)) $this->debug(\"delete: $file\");\r\n // else $this->SetError(\"Error->delete: $file\");\r\n //}\r\n $newfile=substr($file,0,strlen($file)-strlen($this->fileext($file))).$this->newext;\r\n if(@ftp_rename($this->ftpconn,$nextdir.\"/\".$file,$nextdir.\"/\".$newfile)){\r\n $this->debug(\"rename $nextdir$file => $destdir$newfile \");\r\n }\r\n else{\r\n $this->SetError(\"Error->rename $nextdir$file => $destdir$newfile \");\r\n }\r\n }\r\n }\r\n\t\t if($this->action==\"chmod\"||$this->action==\"chmodfiles\"){\r\n if(@in_array($this->fileext($file),$this->ext)||$this->ext=='all'){\r\n if(function_exists('ftp_chmod')&&ftp_chmod($this->ftpconn, $this->permsValue, $nextdir.'/'.$file))\r\n $this->debug(\"chmod: $nextdir/$file => $this->permsValue\");\r\n elseif(function_exists('ftp_site')&&ftp_site($this->ftpconn, \"CHMOD $this->permsValue $nextdir/$file\"))\r\n $this->debug(\"chmod: $nextdir/$file=>$this->permsValue\");\r\n else\r\n $this->SetError(\"Error->chmod: $nextdir/$file=>$this->permsValue\");\r\n }\r\n }\r\n if($this->action==\"download\"){\r\n if(@in_array($this->fileext($file),$this->ext)||$this->ext=='all'){\r\n if(ftp_get($this->ftpconn,$destdir.\"/\".$file,$nextdir.'/'.$file,$this->ftpAsciiBinary($file)) )\r\n $this->debug(\"download files:\".$nextdir.'/'.$file.\" -> \".$destdir.\"/\".$file);\r\n else\r\n $this->SetError(\"error of download files:\".$nextdir.'/'.$file.\" -> \".$destdir.\"/\".$file);\r\n }\r\n }\r\n //=======action:end================\r\n }\r\n $this->totalsize=$this->totalsize+$fileinfo[size];\r\n }\r\n }\r\n $i++;\r\n $info[$level+1][$dirnum]=\"?/none\";\r\n\r\n if($hasdir==1){//level+1下一层次,即下一个兄弟接点是否存在\r\n $curindex=$info[$level+1]['index'];\r\n $nextdir= $info[$level+1][$curindex];\r\n $info[$level+1][\"index\"]++;\r\n $level++;\r\n }\r\n else{\r\n if($action==\"deldir\"){\r\n if(@ftp_rmdir($this->ftpconn,$nextdir))\r\n $this->debug( \"delete dir::\".$nextdir);\r\n else\r\n $this->SetError( \"error of delete dir::\".$nextdir);\r\n $deldirs++;\r\n if($this->action=='getfiles'){\r\n $this->files[$i]['name']=$nextdir;\r\n $this->files[$i]['folder']=1;\r\n }\r\n }\r\n $tempflag=0;\r\n while($level!=0 && $tempflag==0){\r\n //echo \"curdir:\".$curdir.\"<br>\";\r\n $curindex=$info[$level]['index'];\r\n //echo \"level:\".$level.\" curindex=:\".$curindex.\"<br>\";\r\n if($info[$level][$curindex]!=\"?/none\") {\r\n $nextdir=$info[$level][$curindex];\r\n $info[$level]['index']++;\r\n $tempflag=1;\r\n //goto 1:\r\n }\r\n else{\r\n $level--;\r\n if($this->action==\"deldir\"){\r\n $curindex= $info[$level][\"index\"];\r\n $deldir= $info[$level][$curindex-1];\r\n if(@ftp_rmdir($this->ftpconn,$deldir))\r\n $this->debug(\"delete dir::\".$deldir);\r\n else\r\n $this->SetError(\"Error of delete dir::\".$deldir);\r\n if($deldir) $deldirs++;\r\n }\r\n if($this->action=='getfiles'){\r\n $curindex= $info[$level][\"index\"];\r\n $deldir= $info[$level][$curindex-1];\r\n $this->files[$i]['name']=$deldir;\r\n $this->files[$i]['folder']=1;\r\n }\r\n //echo \"--->level:\".$level.\"<br>\";\r\n } //end if\r\n //echo \"tempflag:\".$tempflag.\"<br>\";\r\n }//end while\r\n }//end if\r\n\r\n }//end while\r\n $dirnums++;\r\n\r\n $this->debug( \"文件夹: $this->dirnums 个;文件: $this->filenums 个,size:$this->totalsize bytes\");\r\n if($this->action=='view') return $list;\r\n\r\n }", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "function OnProcess() {\n\n $this->login = $this->Request->ToString(\"login\", \"\", 1, 32);\n $this->password = $this->Request->ToString(\"password\", \"\", 1, 32);\n $this->packagefrom = $this->Request->ToString(\"frompackage\", \"\");\n $this->former_query = $this->Request->ToString(\"query\", \"\");\n\n $UsersTable = new UsersTable($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"Authorization\", \"AuthorizeTable\"));\n //die(pr($UsersTable));\n $data = $UsersTable->GetByFields(array($this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_login\") => $this->login));\n\n if (!count($data) || $data[\"active\"]==0) {\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_LOGIN\");\n return;\n }\n\n $_pass = $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_password\")];\n if($this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n if($_pass != $this->password){\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_PASSWORD\");\n return;\n }\n\n if(!$this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n $this->Session = new ControlSession($this, $CookieName);\n session_start();\n $login_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\");\n $password_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\");\n\n $GLOBALS[$login_var] = $this->login;\n $GLOBALS[$password_var] = $this->password;\n\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\"), $this->login);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\"), $this->password);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_UserId\"), $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_user_id\")]);\n\n if (strlen($this->camefrom)) {\n $this->Response->Redirect($this->Kernel->Settings->GetItem(\"MODULE\",\"SiteURL\").$this->camefrom);\n } else {\n $this->Auth->DefaultRedirect(\"Frontend\");\n }\n }", "protected function setSessionData()\n {\n $responseData = $this->response->getBody();\n if (strlen($responseData) > 0) {\n $contents = str_replace('$SID', $this->session->getName() . '=' . $this->session->getId(), $responseData);\n $contents = str_replace('$SESSION_NAME', $this->session->getName(), $contents);\n $this->response->replaceBody(str_replace('$SESSION_ID', $this->session->getId(), $contents));\n }\n }", "function set_file_name($new_name = '') {\r\n\t\tif ($this->rename_file) {\r\n\t\t\tif ($this->the_file == '') return;\r\n\t\t\t$name = ($new_name == '') ? strtotime('now') : $new_name;\r\n\t\t\tsleep(3);\r\n\t\t\t$name = $name.$this->get_extension($this->the_file);\r\n\t\t} else {\r\n\t\t\t$name = str_replace(' ', '_', $this->the_file); // space will result in problems on linux systems\r\n\t\t}\r\n\t\treturn $name;\r\n\t}", "function load_default_vars()\r\n {\r\n parent::load_default_vars();\r\n $this->vars['URL_REPOS'] = '//your-private-repos-server/repos/'; // Unnecessary\r\n $this->vars['URL_RSC'] = $this->vars['URL_ASSETS'] . $this->manifest['activity_current'] . '/';\r\n }", "function init__backup()\n{\n\tglobal $STARTED_BACKUP;\n\t$STARTED_BACKUP=false;\n}", "function final_init() {\r\n\r\n if ($this->query_only) {\r\n $this->allow_new = False; # bool, True to allow new command\r\n $this->allow_edit = False; # bool, True to allow edit command\r\n $this->allow_delete = False; # bool, True to allow delete command\r\n $this->allow_view = False; # bool, True to allow view command\r\n }\r\n\r\n # give change for fields to init them self after all definitions\r\n\t\tforeach ($this->properties as $key=>$col) {\r\n $this->properties[$key]->colvarname = $key; # notify field of their called-name\r\n $this->properties[$key]->init($this);\r\n }\r\n\r\n # set session for each module's browse-mode default value\r\n if (!$this->browse_mode_forced and $_REQUEST['set_browse_mode'] != '')\r\n $_SESSION['module_browse_mode'][$this->module] = $_REQUEST['set_browse_mode'];\r\n\r\n\r\n if ($this->module == $_REQUEST['m'] and $_SERVER['REQUEST_METHOD'] == 'POST') { # only do this if I'm the currently active module in page\r\n $this->post_handler();\r\n }\r\n if ($this->module == $_REQUEST['m'] and $_SERVER['REQUEST_METHOD'] == 'GET') { # only do this if I'm the currently active module in page\r\n $this->get_handler();\r\n }\r\n\r\n }", "private function setTimeTempnameKey() {\n\t\t$this->timeTempnameKey = time() . '_' . str_replace('_', '', $this->getInputFile()->getTempFilename());\n\t}", "function ftplib()\r\n {\r\n\t $this->_debug = false;\r\n $this->_umask = 0022;\r\n $this->_timeout = 30;\r\n $this->_BINARY = 1;\r\n $this->_ASCII = 0;\r\n /*if (function_exists(\"ftp_connect\")) {\r\n \t\t$this->_use_mod_ftp = true;\r\n \t} else {*/\r\n \r\n\t\t\t$this->_use_mod_ftp = false;\r\n \t//}\r\n }", "function SetNewFileName($New = true) {\n\t\t\t// Si se va a generar un nuevo nombre\n\t\t\tif ($New) {\n\t\t\t\t$R = new Rand();\n\t\t\t\t/**\n\t\t\t\t * El metodo para generar el nombre es:\n\t\t\t\t * timestamp + nro_aleatorio + filename\n\t\t\t\t * todo esto encriptado a md5\n\t\t\t\t */\n\t\t\t\t$this->NewFileName = md5(time().$R->GetRandNumber().$this->GetFileName());\n\t\t\t// Cuando solo existirá una asignación del mismo\n\t\t\t} else {\n\t\t\t\t$this->NewFileName = $this->GetFileName();\n\t\t\t}\n\t\t}", "public function __construct(Temboo_Session $session, RapidShare_RenameFile $choreo, $inputs = array(), $async = false, $store_results = true)\n {\n parent::__construct($session, $choreo, $inputs, $async, $store_results);\n }", "public function set_defaults()\n {\n $this->dir = null;\n $this->out = 'a';\n $this->mod = false;\n $this->err = false;\n $this->nort = false;\n $this->nostd = false;\n $this->quiet = false;\n $this->werror = false;\n $this->run = false;\n $this->format = false;\n $this->check = false;\n $this->version = false;\n $this->lib_paths = [ realpath(__DIR__ . '/../lib') ]; // install dir\n $this->log_dest = null; // stderr\n $this->log_time = false;\n $this->log_width = 80;\n $this->log_level = LOG_LEVEL_WARNING;\n $this->pack = null; // defaults to \"zip\"\n $this->stub = null; // defaults to \"none\"\n }", "function Net_FTP_Observer()\n {\n $this->_id = md5(microtime());\n }", "public function initStorageName()\n\t{\n\t\t// initialize storage name only once\n\t\tif (!empty($this->getHash())) {\n\t\t\treturn;\n\t\t}\n\n\t\t$array = explode('.', $this->getOrigName());\n\t\t$extension = strtolower(end($array));\n\n\t\t$this->setHash(hash_file($this->getHashAlgorithm(), $this->getTmpPath()))\n\t\t\t->setSubDir(substr($this->getHash(), 0, 2))\n\t\t\t->setName(substr($this->getHash(), 2) . '.' . $extension)\n\t\t\t->setWwwPath($this->buildWwwPath())\n\t\t\t->setPath($this->buildPath());\n\t}", "protected function startup()\n {\n $this->init(self::INIT_WITH_DB | self::INIT_WITH_PLUGINS);\n\n // start session\n $this->session_init();\n\n // create user object\n $this->set_user(new rcube_user($_SESSION['user_id']));\n\n // configure session (after user config merge!)\n $this->session_configure();\n\n // set task and action properties\n $this->set_task(rcube_ui::get_input_value('_task', rcube_ui::INPUT_GPC));\n $this->action = asciiwords(rcube_ui::get_input_value('_action', rcube_ui::INPUT_GPC));\n\n // reset some session parameters when changing task\n if ($this->task != 'utils') {\n if ($this->session && $_SESSION['task'] != $this->task)\n $this->session->remove('page');\n // set current task to session\n $_SESSION['task'] = $this->task;\n }\n\n // init output class\n if (!empty($_REQUEST['_remote']))\n $GLOBALS['OUTPUT'] = $this->json_init();\n else\n $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed']));\n\n // load plugins\n $this->plugins->init($this, $this->task);\n $this->plugins->load_plugins((array)$this->config->get('plugins', array()), array('filesystem_attachments', 'jqueryui'));\n }", "function setVar() {\n\t\t\n\t\t$_argv = func_get_args();\n\t\t$_argc = func_num_args();\n\t\t\n\t\t// load vars\n\t\t$vars = getVars();\n\t\tif (!$_GET[\"__shared__\"][\"vars\"]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"] = array();\n\t\t}\n\t\tforeach ($vars as $varNamespace => $varArray) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$varNamespace] = $varArray;\n\t\t}\n\t\t\n\t\t// Register namespace if not existing\n\t\tif (!$_GET[\"__shared__\"][\"vars\"][$_argv[0]]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]] = array();\n\t\t}\n\t\tif ($_argc == 2) {\n\t\t\tif (is_array($_argv[1])) {\n\t\t\t\tforeach ($_argv[1] as $var => $val) {\n\t\t\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$var] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($_argc == 3) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$_argv[1]] = $_argv[2];\n\t\t}\n\t\t\n\t\t// save vars\n\t\t\n\t\tsaveVars();\n\t}", "public function __construct()\n {\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.use_trans_sid', 0);\n ini_set('session.save_handler', 'files');\n ini_set('session.gc_maxlifetime', 3600);\n\n session_name($this->sessionName);\n session_set_cookie_params(\n $this->sessionMaxLifeTime,\n $this->sessionPath,\n $this->sessionDomain,\n $this->sessionSSL,\n $this->sessionHTTPOnly\n );\n session_save_path($this->sessionSavePath);\n\n /*\n * very important : so read, write \n * can use them form my class not from SessionHandler\n * */\n session_set_save_handler($this, true);\n }", "protected function setCommandSession($sessionName){\n $obj = new \\stdClass;\n $obj->commandName = get_class($this);\n $obj->sessionName = $sessionName;\n if(!apcu_exists($this->getChatId())){\n apcu_add($this->getChatId(),json_encode($obj));\n }\n else{\n apcu_store($this->getChatId(),json_encode($obj));\n }\n }", "static public function updateScript()\n {\n if ($GLOBALS['session']->get('ingo', 'script_generate')) {\n try {\n $ingo_script = self::loadIngoScript();\n\n /* Generate and activate the script. */\n self::activateScript($ingo_script->generate(),\n false,\n $ingo_script->additionalScripts());\n } catch (Ingo_Exception $e) {\n $GLOBALS['notification']->push(_(\"Script not updated.\"), 'horde.error');\n }\n }\n }", "public function setUniqFilenames( $bool ) {\r\n\t\t\t$this->is_uniq_filenames = (boolean)$bool;\r\n\t\t}", "function cl_rhgeracaofolhaarquivo() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhgeracaofolhaarquivo\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{$server['host']}:{$server['port']}?\" . http_build_query(isset($server['params']) ? $server['params'] : array());\n\t\t\t}\n\t\t}\n\t\tif (empty($path)) {\n\t\t\tshow_error('Session save_path is empty');\n\t\t}\n\t\tini_set('session.save_path', implode(',', $path));\n\n\t\tini_set('session.gc_maxlifetime', $this->sess_expiration);\t// 过期时间\n\t\t// cookie\n\t\tini_set('session.cookie_secure', 0);\t\t// 0 http:// 1 https://\n\t\tini_set('session.cookie_httponly', 1);\t\t// 不让JS读取session的cookie\n\t\tsession_name($this->sess_cookie_name);\n\n\t\tsession_start();\n\t\t// delete old flashdata (from last request)\n\t\t$this->_flashdata_sweep();\n\t\t// mark all new flashdata as old (data will be deleted before next request)\n\t\t$this->_flashdata_mark();\n\t}", "public function preUpload()\n {\n $this->name = str_replace(' ', '-', $this->alt) . uniqid() . \".\" . $this->fichier->guessExtension();\n }", "private function setUpShell() {\n\t}", "public function setup() {\n // If .htaccess file or local settings file does not exit lets create them.\n if ((file_exists($this->getSiteRoot() . '.htaccess.default') && !file_exists($this->getSiteRoot() . '.htaccess')) || !file_exists($this->getSiteRoot() . 'sites/default/settings.local.php')) {\n $this->say(\"Missing .htaccess or settings.local.php\");\n $name = $this->confirm(\"Missing .htaccess or settings.local.php Copy the default?\");\n if ($name) {\n // Only copy the .htaccess.default if it default exists.\n if (file_exists($this->getSiteRoot() . '.htaccess.default')) {\n $this->_exec('cp ' . $this->getSiteRoot() . '.htaccess.default ' . $this->getSiteRoot() . '.htaccess');\n }\n\n $this->drupalCreateSettings();\n $this->npmInstall();\n $this->dbGet();\n $this->siteInit = TRUE;\n $this->start();\n }\n }\n else {\n $this->dbGet();\n $this->siteInit = TRUE;\n $this->start();\n }\n }", "function logonscreener_destination_prepare() {\n if (is_file(LOGONSCREENER_DESTINATION_PATH)) {\n chmod(LOGONSCREENER_DESTINATION_PATH, 0777);\n }\n else {\n $directory = dirname(LOGONSCREENER_DESTINATION_PATH);\n\n if (!is_dir($directory)) {\n mkdir($directory, 0, TRUE);\n }\n }\n}" ]
[ "0.5943358", "0.5537812", "0.54324925", "0.5187739", "0.5103848", "0.50849766", "0.50787383", "0.49930218", "0.49689224", "0.49558973", "0.49242112", "0.4904282", "0.48773706", "0.48496994", "0.48269874", "0.48029774", "0.4773754", "0.4763137", "0.47578758", "0.4757062", "0.47423646", "0.47386086", "0.4728172", "0.47237402", "0.46987802", "0.46855447", "0.46829832", "0.46801218", "0.46791798", "0.46782964", "0.46689102", "0.46669635", "0.46477696", "0.4644989", "0.4638305", "0.4618369", "0.46072942", "0.46029252", "0.46019077", "0.4598729", "0.4578132", "0.4575062", "0.45673227", "0.45638698", "0.45536494", "0.45348555", "0.4525648", "0.45201826", "0.44953948", "0.4478956", "0.4478128", "0.44761264", "0.44758904", "0.4471892", "0.4470963", "0.44641873", "0.44568256", "0.44523603", "0.44486684", "0.44429988", "0.44282934", "0.44275793", "0.44231865", "0.44123277", "0.44050413", "0.44029903", "0.43850124", "0.438033", "0.4377361", "0.43767157", "0.43735918", "0.43731868", "0.43673658", "0.43665287", "0.43665287", "0.4363455", "0.43633065", "0.43582776", "0.43533513", "0.43487424", "0.43437105", "0.43417653", "0.4340154", "0.433814", "0.43379107", "0.4333455", "0.43327338", "0.43326908", "0.4331988", "0.43284783", "0.43235195", "0.43203604", "0.43199092", "0.43196923", "0.43192682", "0.4318228", "0.431434", "0.43133393", "0.43116292", "0.43115857" ]
0.4949302
10
Create a new event instance.
public function __construct(Customer $customer) { $this->customer = $customer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createEvent()\n {\n return new Event();\n }", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "public static function createEvent(array $data)\n {\n $event = new \\echolibre\\google_wave\\Model\\Event;\n \n $event->type = $data['type'];\n $event->timestamp = $data['timestamp'];\n $event->modifiedBy = $data['modifiedBy'];\n $event->properties = new \\stdClass();\n \n if (isset($data['properties'])) {\n $event->properties = $data['properties'];\n }\n \n return $event;\n }", "public function newEvent()\n\t{\n $this->to = $this->domain;\n $this->email = $this->info_mail;\n $this->subject = 'Neue Messe gemeldet';\n $this->view = 'emails.user.new_event';\n\t\t\n\t\t$this->data = [\n\t\t\t'contact'\t\t=> \\Input::get('contact'),\n\t\t\t'email'\t\t\t=> \\Input::get('email'),\n\t\t\t'name'\t\t\t=> \\Input::get('name'),\n\t\t\t'location'\t\t=> \\Input::get('location'),\n\t\t\t'start_date'\t=> \\Input::get('start_date'),\n\t\t\t'end_date'\t\t=> \\Input::has('end_date') ? \\Input::get('end_date') : \\Input::get('start_date'),\n\t\t\t'region'\t\t=> \\Input::get('region'),\n\t\t\t'organizer'\t\t=> \\Input::get('organizer')\n\t\t];\n\n\t\treturn $this;\n\t}", "private function createinstallevent()\n {\n $cat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar/Events');\n\n $eventArray = array(\n 'title' => $this->__('PostCalendar Installed'),\n 'hometext' => ':text:' . $this->__('On this date, the PostCalendar module was installed. Thank you for trying PostCalendar! This event can be safely deleted if you wish.'),\n 'alldayevent' => true,\n 'eventstatus' => PostCalendar_Entity_CalendarEvent::APPROVED,\n 'sharing' => PostCalendar_Entity_CalendarEvent::SHARING_GLOBAL,\n 'website' => 'https://github.com/craigh/PostCalendar/wiki',\n 'categories' => array(\n 'Main' => $cat['id']));\n\n try {\n $event = new PostCalendar_Entity_CalendarEvent();\n $event->setFromArray($eventArray);\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n } catch (Exception $e) {\n return LogUtil::registerError($e->getMessage());\n }\n\n return true;\n }", "private function event(): Event\n {\n if (!$this->event) {\n $this->event = new Event($this->eventMutex(), '');\n }\n\n return $this->event;\n }", "public function createEvent(string $name): Event\n {\n if (!$this->isEventIDValid($name)) {\n throw new RuntimeException('invalid event name: ' . $name);\n }\n\n $class = $this->validEventIDs[$name];\n /** @var \\CaptainHook\\App\\Event $event */\n $event = new $class($this->io, $this->config, $this->repository);\n return $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function __construct(Event $event)\n {\n $this->event = $event;\n }", "public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }", "protected function _Build_Event($context) {\r\n $form_instance = $this->form_instance;\r\n // Retrieve the event class item\r\n $class = $context['class'];\r\n // Generate a new event class\r\n $event_instance = new $class();\r\n // Populate with the form instance\r\n $event_instance->form_instance = $form_instance;\r\n // Populate with the form instance\r\n $event_instance->type = $context['type'];\r\n // Populate with the form instance\r\n $event_instance->title = $context['title'];\r\n // Populate with the event context\r\n $event_instance->context = $context;\r\n // If the field has a sanitize method\r\n if (method_exists($event_instance,'On_Create')) { $event_instance->On_Create(); }\r\n // Fire any on create action\r\n $event_instance->Do_Action('create');\r\n // Do a wordpress hook\r\n do_action('vcff_event_create',$event_instance);\r\n // Fire any on create action\r\n $event_instance->Do_Action('after_create');\r\n // Do a wordpress hook\r\n do_action('vcff_trigger_after_create',$event_instance);\r\n // Return the event instance\r\n return $event_instance;\r\n }", "protected function __construct()\n {\n parent::__construct(\n 'Event',\n array(\n TextField::create(\n 'title',\n array(\n 'mandatory' => true,\n )\n ),\n TextareaField::create(\n 'description',\n array(\n 'use_markdown' => true,\n )\n ),\n TextField::create(\n 'date',\n array()\n ),\n ReferenceField::create(\n 'guest_lists',\n array(\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\Guestlist\\\\GuestlistModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'title',\n ),\n ),\n )\n ),\n ReferenceField::create(\n 'assignee',\n array(\n 'max' => 1,\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\User\\\\UserModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'username',\n ),\n ),\n )\n ),\n KeyValueField::create(\n 'meta',\n array(\n 'constraints' => array(\n 'value_type' => 'dynamic',\n ),\n )\n ),\n AggregateField::create(\n 'workflowTicket',\n array(\n 'modules' => array(\n '\\\\Honeybee\\\\Domain\\\\Event\\\\WorkflowTicketModule',\n ),\n )\n ),\n ),\n array(\n 'prefix' => 'event',\n 'identifier_field' => 'identifier',\n 'slugPattern' => 'event-{shortId}',\n )\n );\n }", "public function create()\n {\n return view ('event.create');\n }", "public function create()\n {\n return view(\"Event::create\");\n }", "public function create_event( $eventname )\n\t{\n\t\tCmsEvents::create_event($this->get_name(), $eventname);\n\t}", "public function createNewEvent($copyLastEvent = true, $data = array())\n\t{\n\t\t$event = new App_Model_Event();\n\n\t\t// pokud $copyLastEvent == true, vezmu data z minule udalosti a nastavim\n\t\t// je teto\n\t\tif ($copyLastEvent) {\n\t\t\t// TODO: vzit nastaveni posledni udalosti u teto akce\n\t\t}\n\n\t\t// pokud byla zaslana nejaka inicializacni data, nastavim je\n\t\tif (is_array($data) && count($data)) {\n\t\t\t$event->setPropsFromArray($data);\n\t\t}\n\n\t\t$event->setActionId($this->_actionId);\n\t\t$event->setEventNo(count($this->getAllEvents()) + 1);\n\n\t\t$event->insert();\n\n\t\t// vytvorim take prvni navrh terminu, pokud byl zaslan\n\t\tif (isset($data['dates']) && $data['dates'] != '') {\n\t\t\t$event->createNewProposal($data['dates']);\n\t\t}\n\n\t\treturn $event;\n\t}", "public function __construct($event)\n {\n $this->event = $event;\n }", "public function __construct($event)\n {\n $this->event = $event;\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n if ($this->isDirty('status') and $this->status === User::STATUS_ACTIVE) {\n $this->event_type = 'verify';\n }\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : self::URUID, // unregistered user id\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }", "public function create()\n {\n return view('events::create_event');\n }", "protected function create(array $data)\n {\n $user = Auth::user();\n $article = new Article($data);\n $article->userID = $user->userID;\n $article->ctgID = $data['category'];\n $article->updated_at = Carbon::now();\n $article->save();\n\n if (array_key_exists('image', $data)) {\n $path = $data['image']->store('articles/'.$article->artID, 'images');\n $article->image = $path;\n $article->save();\n }\n \n $event = new Event($data);\n if ($data['place'] !== 'none') {\n $event->placeID = $data['place'];\n }\n $event->artID = $article->artID;\n $event->save();\n \n return $event;\n }", "public function create()\n {\n return view('events.createevent');\n }", "public static function get_instance() \n {\n if ( ! isset(self::$instance)) \n {\n self::$instance = new Event();\n }\n\n return self::$instance;\n }", "public function __construct(NewMessageEvent $event)\n {\n $this->event = $event;\n }", "public function createEvent(Event $event)\n {\n $this->setCalendarId($event->calendar_id);\n\n /*\n * Create new google event object\n */\n $googleEvent = new \\Google_Service_Calendar_Event();\n\n /*\n * Set Details\n */\n $googleEvent->setSummary($event->title);\n $googleEvent->setDescription($event->description);\n $googleEvent->setLocation($event->location);\n\n /*\n * Set Start Date\n */\n $start = $this->createDateTime($event->start, $event->timeZone, $event->all_day);\n $googleEvent->setStart($start);\n\n /*\n * Set End Date\n */\n $end = $this->createDateTime($event->end, $event->timeZone, $event->all_day);\n $googleEvent->setEnd($end);\n\n /*\n * Set Recurrence Rule, make sure it's not empty\n */\n if ($event->rrule) {\n $googleEvent->setRecurrence([$event->rrule]);\n }\n\n /*\n * Create the event\n */\n $newGoogleEvent = $this->service->events->insert($this->calendarId, $googleEvent);\n\n return $this->createEventObject($newGoogleEvent);\n }", "public function construct(CakeEvent $event) {\n\t\t$this->__startTime = time();\n\t}", "public function create()\n {\n return view('admin.adminevent.create_event');\n }", "protected function createEvent(DateTime $dateStart, DateTime $dateEnd)\n {\n $event = new Event();\n $event->setTitle($this->title);\n $event->setDescription($this->description);\n $event->setDateStart($dateStart);\n $event->setDateEnd($dateEnd);\n\n return $event;\n }", "public function __construct(array $event = array())\n {\n $this\n ->setEvent($event);\n }", "public function create(Request $request)\n {\n $data = $request->all();\n $event = Event::make($data);\n $event->user_id = Auth::user()->id;\n $event->save();\n }", "public function create()\n {\n\n $event = new Event;\n return view('events.create',compact('event'));\n }", "public function create()\n {\n return view('event');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "protected function getRandomInstance()\n {\n $eventLine = new EventTag();\n $this->fillThing($eventLine);\n\n return $eventLine;\n }", "function create_event( $options=array() ){\n\t\t\t//length = 255, present\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'title_unique' => 1\n\t\t\t), $options\n\t\t);\n\t\t\n\t\tif( empty( $options['title'] ) or empty( $options['description'] ) or empty( $options['date'] ) ){\n\t\t\t$error = Core::error($this->errors, 1);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\t$values['title'] = $this->validate_title( array('title' => $options['title']) );\n\t\tif(Core::has_error( $values['title'] )){\n\t\t\treturn $values['title'] ;\n\t\t}\n\t\t\n\t\t$values['description'] = $this->validate_description( array('description' => $options['description']) );\n\t\tif(Core::has_error( $values['description'] )){\n\t\t\treturn $values['description'];\n\t\t}\n\t\t\n\t\t$values['date_time'] = $this->validate_event_date( array('date' => $options['date']) );\n\t\tif(Core::has_error( $values['date_time'] )){\n\t\t\treturn $values['date_time'];\n\t\t}\n\t\t\n\t\tif($options['title_unique']){\n\t\t\t//TODO:Check if the title unique\n\t\t\tif( Core::db_count( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => array(\n\t\t\t\t\t'title' => $values['title']\n\t\t\t\t)\n\t\t\t))){\n\t\t\t\t$error = Core::error($this->errors, 7);\n\t\t\t\t$error['error_msg'] .= 'Event title must be unique. ';\n\t\t\t\t$error['error_msg'] .= $error_append;\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$result = Core::db_insert( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => $values\n\t\t));\n\t\t\n\t\tif( Core::has_error($result) or empty($result) ){\n\t\t\t$result['error_msg'] .= $error_append;\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "private function create()\n {\n $events = [\n Webhook::EVENT_CONVERSATION_CREATED,\n Webhook::EVENT_CONVERSATION_UPDATED,\n Webhook::EVENT_MESSAGE_CREATED,\n Webhook::EVENT_MESSAGE_UPDATED,\n ];\n\n $chosenEvents = $this->choice(\n 'What kind of event you want to create',\n $events,\n $defaultIndex = null,\n $maxAttempts = null,\n $allowMultipleSelections = true\n );\n\n $webhookUrl = $this->ask('Please enter the webhook URL'); \n\n $webhook = new Webhook();\n $webhook->events = $chosenEvents;\n $webhook->channelId = $this->whatsAppChannelId;\n $webhook->url = $webhookUrl;\n\n try {\n $response = $this->messageBirdClient->conversationWebhooks->create($webhook);\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }", "public function createEvent(Actions $emailAction){\n $event = new Events();\n $event->type = self::$typeMap[$emailAction->type];\n $event->subtype = 'email';\n $event->associationId = $emailAction->associationId;\n $event->associationType = X2Model::getModelName($emailAction->associationType);\n $event->timestamp = time();\n $event->lastUpdated = $event->timestamp;\n $event->user = $emailAction->assignedTo;\n if($event->save())\n $this->log(Yii::t('app','Created activity feed event for the email.'));\n return $event;\n }", "function __construct($event) {\n $this->init($event);\n }", "public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\n\t\treturn view('events.create');\n\t}", "protected function initEvent()\n {\n $locales = $this->container->getParameter('event.locales');\n $event = $this->getRepository('EventEventBundle:Event')->getEvent();\n $now = new \\DateTime();\n\n if (!$event) {\n $event = new Event();\n $event\n ->setTitle('My Event')\n ->setDescription('My another awesome event!')\n ->setStartDate($now)\n ->setEndDate($now->modify('+1 day'))\n ->setVenue('Burj Khalifa Tower')\n ->setEmail('[email protected]')\n ;\n\n $speaker = new Speaker();\n $speaker\n ->setFirstName('Phill')\n ->setLastName('Pilow')\n ->setCompany('Reseach Supplier')\n ;\n\n if ($locales) {\n foreach ($locales as $locale => $title) {\n $eventTranslation = new EventTranslation();\n $eventTranslation->setEvent($event);\n $eventTranslation->setlocale($locale);\n\n $this->getManager()->persist($eventTranslation);\n\n $speakerTranslation = new SpeakerTranslation();\n $speakerTranslation->setSpeaker($speaker);\n $speakerTranslation->setlocale($locale);\n\n $this->getManager()->persist($speakerTranslation);\n }\n }\n\n $this->getManager()->persist($event);\n $this->getManager()->persist($speaker);\n $this->getManager()->flush();\n }\n }", "public function __construct($data)\n {\n $this->event = $data;\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('event::create');\n }", "public function actionCreate()\n\t{\n\t\t$model=new Event;\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['Event']))\n\t\t{\t\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\t\n\t\t\t$model->created_on = new CDbExpression('NOW()');\n\t\t\t$model->created_by=Yii::app()->user->id;\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('view', 'id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n\t ->getStateMachine()\n ->getTransition()\n ->abortTransition()\n ->isTransitionAborted()\n // EventInterface\n ->getName()\n ->setName()\n ->getTarget()\n ->setTarget()\n ->getParams()\n ->setParams()\n ->getParam()\n ->setParam()\n ->stopPropagation()\n ->isPropagationStopped();\n\n return $mock->new();\n }", "protected function newEventLogger()\n {\n return new EventLogger(static::getLogger());\n }", "public function create()\n\t{\n\t\treturn View::make('events.create');\n\t}", "public function __construct(?EventConfig $cfg = null) {}", "public function create()\n {\n $programEvent = new ProgramEvent();\n return view('program-event.create', compact('programEvent'));\n }", "public function create()\n {\n return view(\"admin.event_create\")->with([\n\n ]);\n }", "public function createEvent(Request $request)\n {\n $this->validator($request->all())->validate();\n\n $event = $this->create($request->all());\n \n return redirect('/cms/events');\n }", "public function __construct($name, $event)\n {\n $this->name = $name;\n $this->event = $event;\n }", "final private static function makeEvent(Sincronizacao $sincronizacao)\n {\n $endpoint = self::getEventEndpoint($sincronizacao->sym_table, $sincronizacao->sym_action);\n\n $dependencies = self::getDependencies($sincronizacao);\n $eventClass = self::getEventClass($endpoint);\n\n return new $eventClass($dependencies['entry'], $dependencies['extra']);\n }", "public static function create(Client $client, $data) {\n if ($data == null || is_array($data)) {\n $d = new Event($data == null ? array() : $data);\n $data = $d->jsonSerialize();\n }\n $req = $client->newRequest(\"POST\", \"/{accountname}/events\");\n $req->setBody($data, \"json\");\n\n $result = $req->run(\"json\");\n return Event::fromJson($result);\n }", "public function __construct()\n {\n parent::__construct('BaseEvent');\n }", "public function actionCreate()\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n\n\t\t$model=new Event;\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\n\t\t$attr = array(); \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['Event']))\n\t\t{\n\t\t if(isset($_POST['Event']['attributes']))\n\t\t {\n\t\t $attr = $_POST['Event']['attributes'];\n\t\t }\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save()) {\n\t\t\t\t$this->addAttributes($attr, $model);\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('create',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t\t));\n\t\t}\n\t}", "public function create()\n {\n // $crud = new Events();\n // $crud->photo ='anniv.png';\n // $crud->title = 'Sogod Founding Anniversary Concert';\n // $crud->descriptions = 'secret';\n // $crud->venue = 'Sogod Covered Court';\n // $crud->date = date('04/02/2018');\n // $crud->time = time('h:i:s');\n\n // $crud->save(); \n }", "public function create(){}", "function event(): EventEmitter\n{\n return EventEmitter::getInstance();\n}", "public function create() {}", "public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }", "public function create()\n {}", "public function user_can_create_event()\n {\n $user = User::factory()->create();\n $event = Event::factory()->make()->toArray();\n $response = $this->actingAs($user)->post('/events', $event);\n $response->assertStatus(302);\n $this->assertNotNull(Event::where('name', $event['name'])->first());\n }", "private function __construct() {\n\t\t$action = isset($_GET['action']) ? sanitize_key($_GET['action']) : '';\n\t\t$copy = isset($_GET['copy']) ? intval($_GET['copy']) : 0;\n\t\tif(!empty($copy)) {\n\t\t\t$this->copy_event = new EL_Event($copy);\n\t\t\tadd_filter('get_object_terms', array(&$this, 'set_copied_categories'));\n\t\t}\n\n\t\t$this->options = &EL_Options::get_instance();\n\t\t$this->is_new = 'edit' !== $action;\n\n\t\tadd_action('add_meta_boxes', array(&$this, 'add_eventdata_metabox'));\n\t\tadd_action('edit_form_top', array(&$this, 'form_top_content'));\n\t\tadd_action('edit_form_after_title', array(&$this, 'form_after_title_content'));\n\t\tadd_action('admin_print_scripts', array(&$this, 'embed_scripts'));\n\t\tadd_action('save_post_el_events', array(&$this, 'save_eventdata'), 10, 3);\n\t\tadd_filter('enter_title_here', array(&$this, 'change_default_title'));\n\t\tadd_filter('post_updated_messages', array(&$this, 'updated_messages'));\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 //\n return view('events.create');\n }", "public function create()\n\t{ \n\t\t# Return if just the countoff is needed\n\t\tif ($this->countoff<2) return;\n\t\t\n\t\t# Add a note on and note off for each beat in the click track\n\t\tfor($i=0; $i<$this->beatsTotal; $i++) { \n\t\t\t$vol = (($i%$this->timeSig)==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t}", "public function create()\n {\n return view('adm.events.create');\n }", "public function create()\n\t{\n\t\treturn View::make('administrator.events.create')->with('page_title','Create New Event');\n\t\t\n\t}", "public function run()\n {\n factory(TechnoEvent::class,10)->create();\n }", "protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }", "public function create(Event $event)\n {\n if ($this->shouldUseLocks($this->cache->store($this->store)->getStore())) {\n return $this->cache->store($this->store)->getStore()\n ->lock($event->mutexName(), $event->expiresAt * 60)\n ->acquire();\n }\n\n return $this->cache->store($this->store)->add(\n $event->mutexName(), true, $event->expiresAt * 60\n );\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public function create() {\n\t \n }", "public function actionCreate()\n\t{\n\t\t$model=new Events;\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->event_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "function add_new_event($eventName, $eventColor){\n\t\tif( isset($_POST[$eventName]) ){\n\t\t\tglobal $base;\n\t\t\t\n\t\t\t$title \t= $_POST[$eventName];\n\t\t\t$color \t= $_POST[$eventColor];\n\n\t\t\t$full_calendar_notifications = new full_calendar_notification();\n\n\t\t\t$full_calendar_notifications->user_id = $base->clear_string($_SESSION['user_id']);\n\t\t\t$full_calendar_notifications->notification_title = $title;\n\t\t\t$full_calendar_notifications->notification_color = $color;\n\n\t\t\t$full_calendar_notifications->create();\n\t\t}\n\t}", "public function initialize()\n {\n // attributes\n $this->setName('event');\n $this->setPhpName('Event');\n $this->setClassname('ArtRequestORM\\\\Event');\n $this->setPackage('ArtRequest');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('EVENT_ID', 'EventId', 'INTEGER', true, null, null);\n $this->addColumn('EVENT_TITLE', 'EventTitle', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_DESCRIPTION', 'EventDescription', 'LONGVARCHAR', true, null, null);\n $this->addColumn('EVENT_LOCATION', 'EventLocation', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_SPONSOR_NAME', 'EventSponsorName', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_START_TIME', 'EventStartTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_END_TIME', 'EventEndTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_START_DATE', 'EventStartDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_END_DATE', 'EventEndDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_PRICING_MEMBER', 'EventPricingMember', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STAFF', 'EventPricingStaff', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STUDENT', 'EventPricingStudent', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_PUBLIC', 'EventPricingPublic', 'DECIMAL', true, null, null);\n // validators\n }", "public static function create_event($pid, $event) \n\t\t{\t\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t\n\t\t\t// insert event\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('INSERT INTO event (title, owner, gowner, start_time, end_time, location, logo, description, category, size, tag, price) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);');\n\t\t\t$stmt->bind_param('siisssssiisd', $event['title'], $pid, $gid, $event['start_time'], $event['end_time'], $event['location'], $event['logo'], $event['description'], $event['category'], $event['size'], $event['tag'], $event['price']);\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t// get auto generated id\n\t\t\t$eid = $mysqli->insert_id;\n\t\t\t\n\t\t\t$stmt->close();\n\t\t\t\n\t\t\t// grant user host role\n\t\t\tPeopleDAO::set_event_role_pid($pid, $eid, Role::Owner);\n\t\t\treturn $eid;\n\t\t}", "public static function create_event( $module_name, $event_name )\n\t{\n\t\t$event = cms_orm('CmsDatabaseEvent')->find_by_module_name_and_event_name($module_name, $event_name);\n\t\tif ($event == null)\n\t\t{\n\t\t\t$event = new CmsDatabaseEvent();\n\t\t\t$event->module_name = $module_name;\n\t\t\t$event->event_name = $event_name;\n\t\t\treturn $event->save();\n\t\t}\n\t}", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }" ]
[ "0.8178475", "0.73455495", "0.67515916", "0.6665345", "0.66544545", "0.66479546", "0.6640835", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6543442", "0.64682955", "0.645909", "0.64520663", "0.6441302", "0.6438299", "0.63917476", "0.6371641", "0.6371641", "0.63478637", "0.63475716", "0.63285524", "0.6319918", "0.63108855", "0.6275116", "0.6206908", "0.6195245", "0.6193101", "0.61870754", "0.61810726", "0.61807376", "0.612506", "0.612064", "0.61166775", "0.6116489", "0.6116489", "0.6116489", "0.6116489", "0.6111236", "0.6099429", "0.6076598", "0.6072973", "0.6068453", "0.60566765", "0.6056391", "0.6041123", "0.6033919", "0.60277027", "0.60277027", "0.60181046", "0.6014412", "0.6007521", "0.6007521", "0.6007521", "0.5998441", "0.59855086", "0.5971869", "0.5971259", "0.59670085", "0.5959153", "0.59413785", "0.59338146", "0.5930427", "0.5917219", "0.5907522", "0.59049624", "0.58941996", "0.58838826", "0.5868322", "0.58614963", "0.58599705", "0.5856868", "0.58510625", "0.5838314", "0.58332664", "0.5826795", "0.58255696", "0.58250695", "0.5822382", "0.58223313", "0.58191884", "0.58166337", "0.5807514", "0.5798503", "0.57970744", "0.5794831", "0.5794831", "0.5794831", "0.5794831", "0.5794831", "0.5794831", "0.579301", "0.5784509", "0.5783719", "0.5780148", "0.57786983", "0.57786983", "0.57786983", "0.57786983" ]
0.0
-1
The author data for the petition.
public function author() { return $this->belongsTo(User::class, 'author_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_author_permastruct()\n {\n }", "public function author() {\n\t\t\t\n\t\t\t$output = array();\n\n\t\t\t$author = $this->post->post_author;\n\t\t\t\n\t\t\t$output['id'] = $author;\n\t\t\t$output['nicename'] = get_the_author_meta('nickname', $author);\n\t\t\t$output['name'] = get_the_author_meta('user_firstname', $author).' '.get_the_author_meta('user_lastname', $author);\n\t\t\t$output['url'] = get_author_posts_url($author);\n\t\t\t$output['description'] = get_the_author_meta('description', $author);\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "function getAuthor() \n\t{\n\t\t$author = array();\n\t\tinclude_once \"./Services/MetaData/classes/class.ilMD.php\";\n\t\t$md =& new ilMD($this->getId(), 0, $this->getType());\n\t\t$md_life =& $md->getLifecycle();\n\t\tif ($md_life)\n\t\t{\n\t\t\t$ids =& $md_life->getContributeIds();\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$md_cont =& $md_life->getContribute($id);\n\t\t\t\tif (strcmp($md_cont->getRole(), \"Author\") == 0)\n\t\t\t\t{\n\t\t\t\t\t$entids =& $md_cont->getEntityIds();\n\t\t\t\t\tforeach ($entids as $entid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$md_ent =& $md_cont->getEntity($entid);\n\t\t\t\t\t\tarray_push($author, $md_ent->getEntity());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn join($author, \",\");\n }", "public function getAuthor() {}", "public function author();", "function Submission_Author_Data()\n {\n return\n array\n (\n \"Title\",\"Name\",\"Institution\",\"Lattes\",\"Email\"\n );\n }", "public function getAuthor();", "public function getAuthor();", "public function getAuthor();", "public function getAuthor() \r\n { \r\n return $this->_author; \r\n }", "public function get_author() {\n\t\treturn $this->author();\n\t}", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function get_author()\n\t{\n\t\treturn '';\n\t}", "public function getAuthorname() {}", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "function get_the_author_aim()\n {\n }", "abstract public function getAuthor();", "function GetAuthor()\n {\n return 'calguy1000';\n }", "public function getAuthor(): string\n {\n return $this->_author;\n }", "function get_author_ID() {\n\t\treturn $this->get_data( 'user_id' );\n\t}", "public function getAuthorName()\n {\n return 'Fightmaster.publication.author.name';\n }", "private function get_article_author() {\n\n\t\tif ( ! $this->is_json_valid() )\n\t\t\treturn [];\n\n\t\tif ( ! $post = $this->get_current_post() ) {\n\t\t\t$this->invalidate( 'amp' );\n\t\t\treturn [];\n\t\t}\n\n\t\t$author = \\get_userdata( $post->post_author );\n\t\t$name = isset( $author->display_name ) ? $author->display_name : '';\n\n\t\tif ( ! $name ) {\n\t\t\t$this->invalidate( 'amp' );\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t'author' => [\n\t\t\t\t'@type' => 'Person',\n\t\t\t\t'name' => \\esc_attr( $name ),\n\t\t\t],\n\t\t];\n\t}", "public function getAuthor() {\n\t\treturn $this->author;\n\t}", "public function author() : string\n {\n if (isset($this->entity->author)) {\n return $this->entity->author->name;\n }\n\n return 'Sin autor';\n }", "public function author()\n {\n $userId = $_post['userId'];\n $userRepository = new UserRepository();\n if (!empty($userId)) {\n $author = $userRepository->getAuthor();\n }\n }", "public function getAuthor() {\n return $this->_author;\n }", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function authorId() { return $this->post->post_author; }", "private static function getAuthorInfo()\n {\n $curTimeStamp = time();\n $author = static::$appId . '-' . $curTimeStamp;\n $authorPwd = md5($curTimeStamp . static::$appSecret);\n\n return $author . ':' . $authorPwd;\n }", "public function author()\n {\n return optional($this->author);\n }", "public function getAuthor()\n {\n return $this->author = get_userdata($this->get()->post_author);\n }", "public function getAuthorId()\n {\n return $this->_authorId;\n }", "public function getAuthor() {\n return $this->randomQuote->author_name;\n }", "function get_the_author_yim()\n {\n }", "function GetAuthor()\n {\n return 'texus';\n }", "public function getAuthor_id()\n {\n return $this->author_id;\n }", "public function getAuthorID();", "public function getAuthorId() {\n\t\treturn $this->authorId;\n\t}", "public function getAuthorId() : string\n {\n return $this->authorId;\n }", "public function getAuthorUsername()\n {\n return $this->AUTHOR_USERNAME;\n }", "public function getBookAuthor()\n {\n return $this->author;\n }", "public function getAuthor() {\n\t\treturn UserManager::getFromBlid($this->blid);\n\t}", "function get_the_author_description()\n {\n }", "public function getIdAuthor()\n {\n return $this->id_author;\n }", "public function getIdAuthor()\n {\n return $this->id_author;\n }", "protected function author()\n {\n if ($this->presenter->wasByCurrentUser() || !$this->wrappedObject->user_id) {\n return 'You ';\n }\n\n if (!$this->wrappedObject->security) {\n return 'This user ';\n }\n\n return $this->presenter->author().' ';\n }", "public function getAuthor() {\n\t\t\treturn $this->MODULE_AUTHOR;\n\t\t}", "public function get_author_description() {\n\t\t\t$user = get_userdata( intval( $this->instance['user_id'] ) );\n\n\t\t\tif ( ! $user ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn sprintf(\n\t\t\t\t'<div class=\"about-author_description\">%s</div>',\n\t\t\t\twp_filter_post_kses( $user->description )\n\t\t\t);\n\t\t}", "function get_the_author_ID()\n {\n }", "public function getAuthorName() : void {\n\t\treturn $this->authorName;\n\t}", "public function add_author( $data, $post ) {\n\t\tif ( $this->context->site_represents === false ) {\n\t\t\t$data['author'] = [ '@id' => WPSEO_Schema_Utils::get_user_schema_id( $post->post_author, $this->context ) ];\n\t\t}\n\t\treturn $data;\n\t}", "function the_author_aim()\n {\n }", "public function getAutor()\n {\n return $this->autor;\n }", "public function getAutor()\n {\n return $this->autor;\n }", "public function getAutor()\n {\n return $this->autor;\n }", "public function get_autor()\n {\n return $this->_autor;\n }", "function getAuthor(){\n $author = $this->getResource('schema:author');\n if (empty($author)){\n $author = $this->getResource('schema:creator');\n }\n return $author;\n }", "public function authors() {\n return $this->connected( Person::postType() );\n }", "function get_the_author_icq()\n {\n }", "function the_author() {\n\tglobal $discussion;\n\treturn $discussion['author'];\n}", "public function authorLink() { return $this->post->post_author; }", "public function author()\n {\n $this->renderView('author.twig',['articleList' => $this->articleList]);\n }", "public function getAuthorId() {\n return (int)$this->author_id;\n }", "public function get_authors();", "function getDataAuthor($data)\n{\n\t$dataAuthor = getData($data, \"Page/Author\");\n\treturn $dataAuthor[0];\n}", "protected function _syncAuthor() {}", "function the_author_yim()\n {\n }", "public function getAuthors()\n {\n return $this->getValue('authors');\n }", "public function getAuthorName()\n\t{\n\t\tif(is_null($this->_authorName)){\n\t\t\t$this->loadData();\n\t\t}\n\t\treturn $this->_authorName;\n\t}", "public function author()\n {\n if ($this->user_id) {\n $field = config(\"binshopsblog.comments.user_field_for_author_name\",\"name\");\n return optional($this->user)->$field;\n }\n\n return $this->author_name;\n }", "function print_author_tag() {\n\t\t\n\t\techo \"<meta name='author' content='{$this->options->site_author}' />\\r\\n\";\n\t}", "public function getByAuthor()\n {\n return $this->by_author;\n }", "public function gettodoAuthor(): string {\n\t\treturn $this->todoAuthor;\n\t}", "function the_author_description()\n {\n }", "function egsr_author_cap(){\n return Array ( \n 'delete_posts' => true,\n 'delete_published_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'upload_files' => true,\n );\n}", "public function get_author($key = 0)\n {\n }", "public function get_author($key = 0)\n {\n }", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function meta_author_name()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}", "function the_author_ID()\n {\n }", "public function authorsInitials();", "public function api_getAuthorInfo($author_id = null) {\t\n\t\t$authors = $this->find('all', array(\n\t\t\t'conditions' => array('Author.author_id' => $author_id),\n\t\t\t'fields' => array('Author.document_id', 'Author.fullname'),\n\t\t\t// 'order' => array('Author.lastname' => 'asc'),\n\t\t\t// 'limit' => 3\n\t\t));\n\t\treturn $authors;\n\t}", "function GetAuthorEmail()\n {\n return '[email protected]';\n }", "public function authorDetails($id);", "function showAuthor()\n {\n $this->out->elementStart('div', 'author');\n\n $this->out->elementStart('span', 'vcard author');\n\n $attrs = array('href' => $this->profile->profileurl,\n 'class' => 'url',\n 'title' => $this->profile->nickname);\n\n $this->out->elementStart('a', $attrs);\n $this->showAvatar();\n $this->out->text(' ');\n $user = common_current_user();\n if (!empty($user) && $user->streamNicknames()) {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->nickname);\n } else {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->getBestName());\n }\n $this->out->elementEnd('a');\n\n $this->out->elementEnd('span');\n\n $this->showAddressees();\n\n $this->out->elementEnd('div');\n }" ]
[ "0.78512836", "0.7288588", "0.7119048", "0.7094514", "0.7067185", "0.7013517", "0.6980603", "0.6980603", "0.6980603", "0.68854636", "0.68354726", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68295544", "0.68218464", "0.6809175", "0.6807901", "0.6807901", "0.6807901", "0.6765666", "0.67623144", "0.6753024", "0.6751088", "0.67432034", "0.67407286", "0.67315525", "0.67311", "0.6711772", "0.6711423", "0.67066085", "0.6705314", "0.6705314", "0.6697236", "0.6697236", "0.6697236", "0.6697236", "0.6697236", "0.6697236", "0.66911197", "0.6660368", "0.6639105", "0.6581689", "0.6568796", "0.655336", "0.6501205", "0.6499788", "0.6489934", "0.6457951", "0.6456548", "0.64353263", "0.6404974", "0.63852674", "0.63838816", "0.63817894", "0.63655823", "0.63655823", "0.6365002", "0.63449943", "0.63333315", "0.6333269", "0.63235444", "0.6322131", "0.63082635", "0.62870294", "0.62870294", "0.62870294", "0.6259693", "0.62496907", "0.6248934", "0.6229395", "0.6222618", "0.62163985", "0.6210311", "0.61947465", "0.6193877", "0.61775005", "0.6175216", "0.61706585", "0.6157047", "0.61449116", "0.61410797", "0.6133482", "0.6131652", "0.6130874", "0.6102526", "0.61011684", "0.608462", "0.6082069", "0.60695887", "0.60639566", "0.6061163", "0.60561126", "0.605168", "0.60336757", "0.6030246", "0.6028539" ]
0.0
-1
The categories relationship for the petitions.
public function categories() { return $this->belongsToMany(Categories::class)->withTimestamps(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function category() {\n\t\treturn $this->belongsToMany('Category');\n\t}", "public function categories()\n {\n \treturn $this->hasMany('App\\Category');\n }", "public function getCategories()\n {\n return $this->hasMany(Category::class, ['id' => 'category_id'])\n ->viaTable('product_category', ['product_id' => 'id']);\n }", "public function categories() {\n\t\t// sukuria sasaja su Category modeliu:\n\t\treturn $this->hasOne('App\\Category', 'id', 'category');\n\t}", "public function categories()\n {\n return $this->hasMany(\\Hydrofon\\Category::class, 'parent_id');\n }", "public function categories() {\n return $this->belongsTo(\"Category\", \"category_id\", \"id\");\n }", "public function categories()\n\t{\n\t\treturn $this->belongsToMany(Category::class);\n\t}", "public function categories() {\n return $this->hasMany(Categories::class, 'parent');\n }", "public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }", "public function getCategory()\n {\n return $this->hasMany(Category::className(), ['category_id' => 'id']);\n }", "public function categories() {\n return $this->belongsToMany('App\\PodcastMetaData', 'podcast_metas', 'podcast_id', 'meta_id')->where('meta_type', 'podcast_category');\n }", "public function getCategories();", "public function getCategories();", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(self::tablePrefix().'cms_post_category', ['post_id' => 'id']);\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class);\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class);\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class);\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }", "public function categories()\n {\n return $this->belongsTo(Category::class);\n }", "public function categories()\n {\n return $this->belongsTo(Categories::class);\n }", "public function categories()\n {\n return $this->morphedByMany(\n Category::class,\n 'metable'\n );\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'company_category', 'company_id', 'category_id');\n }", "public function categories()\n {\n // belongsToMany(RelatedModel, pivotTable, thisKeyOnPivot = brand_id, otherKeyOnPivot = category_id)\n return $this->belongsToMany(Category::class);\n }", "public function categories()\n {\n return $this->belongsToMany(\n Category::class, \n 'category_ticket', \n 'ticket_id', \n 'category_id'\n );\n }", "public function categories()\n {\n return $this->belongsTo('App\\Categories', 'category_id');\n }", "public function getCategory();", "public function getCategory();", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'solution_categories', 'solution_id', 'category_id')->isParent();\n }", "public function getCategory() {}", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'category_id'])\n ->viaTable('user_category', ['user_id' => 'id']);\n }", "public function getCategory()\n {\n }", "public function category()\n {\n return $this->belongsToMany('App\\Category', 'product_category', 'pid', 'cid');\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'film_category', 'film_id', 'category_id');\n }", "public function categories()\n {\n \treturn $this->belongsTo( 'App\\Category', 'category_id');\n }", "public function categories()\n {\n \treturn $this->belongsToMany('App\\Category', 'category_post', 'post_id', 'category_id');\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Models\\Categories', 'category_article', 'article_id', 'category_id');\n }", "public function categories() {\n return $this->belongsToMany('App\\Models\\Category', 'category_post', 'post_id', 'category_id');\n }", "public function categoriesSon()\n {\n return $this->hasMany(self::class);\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function categories()\n {\n return $this->belongsToMany(BusinessCategory::class, 'business_listing_category_pivots', 'listing_id', 'category_id');\n }", "public function cats() {\n return $this->belongsToMany('App\\Models\\Pronunciation\\Cat', 'pronunciation_question_cat','question_id','cat_id');\n }", "public function category()\n {\n\n return $this->hasOne(Category::class, 'id', 'categories_id');\n }", "public function categories(){\n\t\treturn $this->belongsToMany('ProductCategory', 'product_pivot_categories');\n\t}", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'category_product');\n }", "public function getCategories() {\n return $this->categories;\n }", "public function categories()\n {\n return $this->belongsToMany(BlogCategory::class, 'blog_map_categories', 'blog_id', 'category_id');\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category', 'categories_games', 'game_id', 'categorie_id');\n }", "public function getCategories()\n {\n return Category::all();\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'posts_categories');\n }", "public function category()\n {\n // hasOne, hasMany, belongsTo, belongsToMany\n return $this->belongsTo(Category::class);\n }", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'tree_id'])->viaTable('{{%news_tree}}', ['news_id' => 'id']);\n }", "public function categories() {\n return $this->hasMany('App\\Models\\Category', 'user_id');\n }", "public function findCategories();", "public function getCategories()\n\t{\n\t\treturn $this->categories;\n\t}", "public function category()\n\t{\n\t\treturn $this->belongsTo('App\\Model\\Content\\Category');\n\t}", "public function categories(){\n return $this->belongsToMany(category::class);\n }", "public function getCategories()\n {\n return [ 'categories' => self::CATEGORIES ];\n }", "public function categories(){\n return $this->belongsTo('App\\Category');\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public function categories(){\n\n return $this->belongsTo('App\\Http\\Models\\Category');\n\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category')->withTimestamps();\n }", "public function category()\n {\n return $this->belongsTo(Categories::class);\n }", "public function categories(){\n\treturn \t$this->belongsToMany('Category')->withTimestamps();\n\t}", "public function categoryProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id)\n return $this->hasMany('App\\CategoryProductRelation','cate_id','cate_id');\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class)->withTimestamps();\n }", "public function category()\n {\n return $this->hasOne('fooCart\\src\\Category', 'category_id', 'category_id');\n }", "public function category()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Categories\\Models\\Category');\n }", "public function Category()\n {\n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }", "public function getProductCategory()\n {\n return $this->hasMany(ProductCategory::className(), ['category_id' => 'id']);\n }", "public function RelationBetweenCategory()\n {\n return $this->hasOne('App\\Models\\Category', 'id', 'category_id');\n }", "public function categorias()\n {\n return $this->belongsToMany(Categoria::class, 'medicamentos_categorias', 'medicamentos_id', 'categorias_id');\n }", "public function get_categories () {\n\t\treturn Category::all();\n\t}", "public function getAllCategories();", "public function getCategories(): Collection\n {\n return $this->model->categories()->get();\n }", "public function categories()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'category';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }", "public function category()\n\t{\n\t\treturn $this->belongsTo(Category::class);\n\t}", "public function getCategories(){\n return Category::get();\n }", "public function category() {\n\t\treturn $this->belongsTo(Category::class, 'category_id', 'id');\n\t}", "public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategories()\n {\n $categories = ClassInfo::subclassesFor('ConsultationCategory');\n return $this->Children()->filter('Classname', $categories);\n }", "protected function getCategories()\n {\n if (! is_null($this->categories)) {\n return $this->categories;\n }\n\n $categories = $this->app['sanatorium.categories.category']->findAll();\n\n foreach ($categories as $category) {\n $category->uri = $category->url === '/' ? null : $category->url;\n }\n\n return $this->categories = $categories;\n }", "public function category() {\n return $this->hasOne('App\\Models\\Category', 'id');\n }", "public function parentCategories()\n {\n return $this->hasMany(self::class, 'id', 'parent_id');\n }", "public function category()\n\t{\n\t return $this->belongsTo(Category::class);\n\t}", "public function getCategory() {\n return $this->category;\n }" ]
[ "0.73084545", "0.72652906", "0.72470623", "0.7245617", "0.71972847", "0.7189656", "0.7185332", "0.715868", "0.7149742", "0.7136953", "0.71268445", "0.71114373", "0.71114373", "0.7105843", "0.70697415", "0.70697415", "0.70697415", "0.7069422", "0.7069422", "0.7069422", "0.7045244", "0.7029368", "0.7024462", "0.7008131", "0.69427586", "0.6928585", "0.6923307", "0.69052273", "0.69052273", "0.6899148", "0.6880477", "0.6843502", "0.68391585", "0.6831318", "0.68301326", "0.68296534", "0.68294483", "0.68224543", "0.6816518", "0.6804736", "0.6798802", "0.6798802", "0.6798802", "0.6798802", "0.6798802", "0.6798802", "0.6798802", "0.6798802", "0.6798802", "0.6798802", "0.67752916", "0.6753779", "0.67435205", "0.67349035", "0.6726783", "0.6724683", "0.6723577", "0.67131793", "0.67055225", "0.66999185", "0.66991717", "0.669145", "0.66634196", "0.66618234", "0.66605955", "0.66489047", "0.6648485", "0.6647812", "0.6636072", "0.66274667", "0.66274667", "0.6620123", "0.6614413", "0.66112244", "0.66109693", "0.659952", "0.65913737", "0.6588026", "0.654805", "0.6540889", "0.65224934", "0.64961594", "0.6489703", "0.64849603", "0.6482539", "0.6481465", "0.6480915", "0.64713115", "0.64704794", "0.6455486", "0.6453036", "0.64510363", "0.6450394", "0.6450394", "0.645001", "0.6440824", "0.64390063", "0.6428914", "0.6423071", "0.6409967" ]
0.66148424
72
Create a new controller instance.
public function __construct() { parent::__construct(); }
{ "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
Run the database seeds.
public function run() { $user = User::first(); Todo::unsetEventDispatcher(); factory(Todo::class, rand(10, 20))->create([ 'user_id' => $user->id, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Dipsplay image for resizing
public function getResize() { $ratio = 1.0; $image = Input::get('img'); $dir = Input::get('dir'); $original_width = Image::make(base_path() . "/" . Config::get('lfm.images_dir') . $dir . "/" . $image)->width(); $original_height = Image::make(base_path() . "/" . Config::get('lfm.images_dir') . $dir . "/" . $image)->height(); $scaled = false; if ($original_width > 600) { $ratio = 600 / $original_width; $width = $original_width * $ratio; $height = $original_height * $ratio; $scaled = true; } else { $height = $original_height; $width = $original_width; } if ($height > 400) { $ratio = 400 / $original_height; $width = $original_width * $ratio; $height = $original_height * $ratio; $scaled = true; } return View::make('laravel-filemanager::resize') ->with('img', Config::get('lfm.images_url') . $dir . "/" . $image) ->with('dir', $dir) ->with('image', $image) ->with('height', number_format($height, 0)) ->with('width', $width) ->with('original_height', $original_height) ->with('original_width', $original_width) ->with('scaled', $scaled) ->with('ratio', $ratio); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "function show_image($image, $width, $height) { //$image_content = read_file($image); We does not want to use this as output.\n //resize image \n $image = imagecreatefromjpeg($image);\n $thumbImage = imagecreatetruecolor(50, 50);\n imagecopyresized($thumbImage, $image, 0, 0, 0, 0, 50, 50, $width, $height);\n imagedestroy($image);\n //imagedestroy($thumbImage); do not destroy before display :)\n // ob_end_clean(); // clean the output buffer ... if turned on.\n header('Content-Type: image/jpeg');\n imagejpeg($thumbImage); //you does not want to save.. just display\n }", "public function resizeImage()\n {\n \treturn view('resizeImage');\n }", "public function showImage()\n {\n }", "protected function scaleImages() {}", "public function display() { ImageLib::serve($this->source_image, $this->source_image_mimetype); }", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "function admin_cropImage()\r\n {\r\n // setting the layout for admin\r\n $this->layout = 'admin';\r\n \r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Image Crop\");\r\n \r\n }", "private function generateThumbnailImagick(){\n\t}", "public function showImage()\n {\n $gif = new AnimatedGif($this->frames, $this->delays, $this->loops);\n $gif->display();\n }", "public function drawDimensions() {\n\t\tset_image_header();\n\n\t\t$this->selectTriggers();\n\t\t$this->calcDimentions();\n\n\t\tif (function_exists('imagecolorexactalpha') && function_exists('imagecreatetruecolor')\n\t\t\t\t&& @imagecreatetruecolor(1, 1)\n\t\t) {\n\t\t\t$this->im = imagecreatetruecolor(1, 1);\n\t\t}\n\t\telse {\n\t\t\t$this->im = imagecreate(1, 1);\n\t\t}\n\n\t\t$this->initColors();\n\n\t\timageOut($this->im);\n\t}", "function save($show = false)\n {\n if ($show)\n {\n @header('Content-Type: image/' . $this->type);\n }\n \n if (!$this->width && !$this->height) \n {\n $this->width = $this->image_width;\n $this->height = $this->image_height;\n } elseif (is_numeric($this->width) && empty($this->height)) {\n $this->height = round($this->width / ($this->image_width / $this->image_height));\n \n } elseif (is_numeric($this->height) && empty($this->width)) {\n $this->width = round($this->height / ($this->image_height / $this->image_width));\n \n } else {\n if ($this->width <= $this->height) \n {\n $height = round($this->width / ($this->image_width / $this->image_height));\n if ($height != $this->height)\n {\n $percentage = ($this->image_height * 100) / $height;\n $this->image_height = round($this->height * ($percentage / 100));\n }\n } else {\n $width = round($this->height / ($this->image_height / $this->image_width));\n if ($width != $this->width)\n {\n $percentage = ($this->image_width * 100) / $width;\n $this->image_width = round($this->width * ($percentage / 100));\n }\n }\n }\n\n if ($this->crop)\n {\n $this->image_width = $this->width;\n $this->image_height = $this->height;\n }\n\n if ($this->type == 'jpeg')\n {\n $image = imagecreatefromjpeg($this->file);\n }\n \n if ($this->type == 'png')\n {\n $image = imagecreatefrompng($this->file);\n }\n \n if ($this->type == 'gif')\n {\n $image = imagecreatefromgif($this->file);\n }\n \n $new_image = imagecreatetruecolor($this->width, $this->height);\n imagecopyresampled($new_image, $image, 0, 0, \n $this->top, \n $this->left,\n $this->width, \n $this->height, \n $this->image_width,\n $this->image_height);\n\n $name = $show ? null : $this->dir . DIRECTORY_SEPARATOR . $this->name . '.' . $this->ext;\n \n if ($this->type == 'jpeg')\n {\n imagejpeg($new_image, $name, $this->quality);\n }\n \n if ($this->type == 'png')\n {\n imagepng($new_image, $name);\n }\n \n if ($this->type == 'gif')\n {\n imagegif($new_image, $name);\n }\n \n imagedestroy($image);\n imagedestroy($new_image);\n }", "function showImage()\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\timagegif($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\timagejpeg($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\timagepng($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "function show_art($file,$width,$height) {\n global $directory, $year,$media_url, $collection;\n $file = preg_replace('-\\.gif$-',\".png\",$file);\n // Scale down figures\n if ($width > 860) { $w = $width; $width = 860; $height *= 860/$w; }\n print \"<div><img src='$media_url/$collection/\" . strtolower(\"$directory/$file\") . \"'\"\n . ($width > 0 ? \" width='$width'\" : \"\")\n . ($height > 0 ? \" height='$height'\" : \"\")\n . \" /></div>\\n\";\n}", "function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}", "function ShowImage($spr = NULL, $lang_id = NULL, $img = NULL, $size = NULL, $quality = 85, $wtm = NULL, $parameters = NULL, $return_src=null)\n {\n\n $size_auto = NULL;\n $size_width = NULL;\n $size_height = NULL;\n $alt = NULL;\n $title = NULL;\n $str = NULL;\n\n $img_with_path = $this->GetImgPath($img, $spr, $lang_id);\n// echo '<br/>$img_with_path='.$img_with_path;\n $imgSmall = ImageK::getResizedImg($img_with_path, $size, $quality, null);\n //echo '<br/>$imgSmall='.$imgSmall;\n if($return_src){\n return $imgSmall;\n }else{\n return '<img src=\"'.$imgSmall.'\" '.$parameters.' />';\n }\n }", "public function makeThumbnail() {\n Image::make($this->filePath())->fit(200)->save($this->thumbnailPath());\n }", "private function generateThumbnailGD(){\n\t\t\n\t}", "function thumbnail($file,$width='120'){\n $name=$this->_dir.DS.$file.'[0]';\n $im = new imagick($name);\n $im->setImageFormat('jpg');\n $im->scaleImage($width,0);\n header('Content-Type: image/jpeg');\n echo $im;\n }", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "public function displayImage($params) { \n /// first make sure all params are valid\n $this->imgPath = realpath($this->imgDirPath . $params['src']);\n $this->validateParameters($params);\n $image = $this->getOriginalImg();\n if (isset($params['verbose'])) {\n $this->createVerboseLog();\n }\n if(isset($params['crop_to_fit']) || isset($params['height']) || isset($params['width'])) {\n $image = $this->resizeImage($params['height'], $params['width'], $params['crop_to_fit'], $image);\n }\n if (isset($params['sharpen'])) {\n $image = $this->sharpenImage($image);\n }\n $cacheFileName = $this->createCacheFileName($params);\n $this->checkCachePath($cacheFileName, $params['no_cache']);\n \n $this->saveImg($image, $cacheFileName, $params['quality']);\n $this->outputImage($cacheFileName, $this->verbose);\n }", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "protected function show()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n $this->sendHeader('gif');\n imagegif($this->image, '');\n break;\n \n case 'image/jpeg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/jpg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/png':\n $this->sendHeader('png');\n imagepng($this->image, '', round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n }", "public static function resize(){\n\n}", "private function setDimensions(){\r\n list($width, $height) = getimagesize($this->fileName);\r\n $this->imageDimensions = array('width'=>$width,\r\n 'height'=>$height);\r\n \r\n }", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "protected function widenResizeMagic(): void\n {\n $this->image->widen($this->widenResize, function ($constraint) {\n $constraint->upsize();\n });\n }", "function _createThumbnail()\r\n\t{\r\n\t\t$user=$this->auth(PNH_EMPLOYEE);\r\n\t\t$config['image_library']= 'gd';\r\n\t\t$config['source_image']= './resources/employee_assets/image/';\r\n\t\t$config['create_thumb']= TRUE;\r\n\t\t$config['maintain_ratio']= TRUE;\r\n\t\t$config['width']= 75;\r\n\t\t$config['height']=75;\r\n\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t$this->image_lib->resize();\r\n\r\n\t\tif(!$this->image_lib->resize())\r\n\t\t\techo $this->image_lib->display_errors();\r\n\t}", "public function run() {\n\n // make enough memory available to scale bigger images\n ini_set('memory_limit', $this->thumb->options['memory']);\n \n // create the gd lib image object\n switch($this->thumb->image->mime()) {\n case 'image/jpeg':\n $image = @imagecreatefromjpeg($this->thumb->image->root()); \n break;\n case 'image/png':\n $image = @imagecreatefrompng($this->thumb->image->root()); \n break;\n case 'image/gif':\n $image = @imagecreatefromgif($this->thumb->image->root()); \n break;\n default:\n raise('The image mime type is invalid');\n break;\n } \n\n // check for a valid created image object\n if(!$image) raise('The image could not be created');\n\n // cropping stuff needs a couple more steps \n if($this->thumb->options['crop'] == true) {\n\n // Starting point of crop\n $startX = floor($this->thumb->tmp->width() / 2) - floor($this->thumb->result->width() / 2);\n $startY = floor($this->thumb->tmp->height() / 2) - floor($this->thumb->result->height() / 2);\n \n // Adjust crop size if the image is too small\n if($startX < 0) $startX = 0;\n if($startY < 0) $startY = 0;\n \n // create a temporary resized version of the image first\n $thumb = imagecreatetruecolor($this->thumb->tmp->width(), $this->thumb->tmp->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n \n // crop that image afterwards \n $cropped = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $cropped = $this->keepColor($cropped);\n imagecopyresampled($cropped, $thumb, 0, 0, $startX, $startY, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->tmp->width(), $this->thumb->tmp->height()); \n imagedestroy($thumb);\n \n // reasign the variable\n $thumb = $cropped;\n\n } else {\n $thumb = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->result->width(), $this->thumb->result->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n } \n \n // convert the thumbnail to grayscale \n if($this->thumb->options['grayscale']) {\n imagefilter($thumb, IMG_FILTER_GRAYSCALE);\n }\n\n // convert the image to a different format\n if($this->thumb->options['to']) {\n\n switch($this->thumb->options['to']) {\n case 'jpg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'gif': \n imagegif($thumb, $this->thumb->root()); \n break; \n }\n\n // keep the original file's format\n } else {\n\n switch($this->thumb->image->mime()) {\n case 'image/jpeg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'image/png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'image/gif': \n imagegif($thumb, $this->thumb->root()); \n break;\n }\n\n }\n\n imagedestroy($thumb);\n \n }", "function link_block_thumb()\n{\n add_image_size('link_block_thumb', 884, 540, true); // Hard crop to exact dimensions (crops sides or top and bottom)\n}", "function image_auto_resize($file_name){\t\n\t\t$config['image_library'] = 'gd2'; \n\t\t$config['source_image'] = './assets/img/profiles/'.$file_name; \n $config['create_thumb'] = FALSE; \n $config['maintain_ratio'] = FALSE; \n $config['quality'] = '60%'; \n $config['width'] = 250; \n $config['height'] = 250; \n $config['new_image'] = './assets/img/profiles/'.$file_name; \n $this->load->library('image_lib', $config); \n\t\t$this->image_lib->resize();\n\t\t$this->image_lib->clear();\n\t}", "function rp_image_size_setup() {\n add_image_size( 'rp-md', 450, 450, array( 'center', 'center' ), false );\n\tadd_image_size( 'rp-lg', 1920, 500, array( 'center', 'center' ) );\n}", "function imagethumb( $image_src , $image_dest = NULL , $max_size = 500, $expand = FALSE, $square = FALSE )\n{\n\tif( !file_exists($image_src) ) return FALSE;\n\n\t// Récupère les infos de l'image\n\t$fileinfo = getimagesize($image_src);\n\n\techo \"file infos :\".$fileinfo[0].\"---\".$fileinfo[1];\n\t\n\tif( !$fileinfo ) return FALSE;\n\n\t$width = $fileinfo[0];\n\t$height = $fileinfo[1];\n\n\n\t$type_mime = $fileinfo['mime'];\n\n\n\t$type = str_replace('image/', '', $type_mime);\n\n\t//echo \"\\ntype_mime --> \".$type;\n\n\tif( !$expand && max($width, $height)<=$max_size && (!$square || ($square && $width==$height) ) )\n\t{\n\t\t// L'image est plus petite que max_size\n\t\tif($image_dest)\n\t\t{\n\t\t\treturn copy($image_src, $image_dest);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Type: '. $type_mime);\n\t\t\treturn (boolean) readfile($image_src);\n\t\t}\n\t}\n\n\t// Calcule les nouvelles dimensions\n\t$ratio = $width / $height;\n\n\tif( $square )\n\t{\n\t\t$new_width = $new_height = $max_size;\n\n\t\tif( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$src_y = 0;\n\t\t\t$src_x = round( ($width - $height) / 2 );\n\n\t\t\t$src_w = $src_h = $height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$src_x = 0;\n\t\t\t$src_y = round( ($height - $width) / 2 );\n\n\t\t\t$src_w = $src_h = $width;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$src_x = $src_y = 0;\n\t\t$src_w = $width;\n\t\t$src_h = $height;\n\n\t\tif ( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$new_width = $max_size;\n\t\t\t$new_height = round( $max_size / $ratio );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$new_height = $max_size;\n\t\t\t$new_width = round( $max_size * $ratio );\n\t\t}\n\t}\n\n\t// Ouvre l'image originale\n\t$func = 'imagecreatefrom' . $type;\n\tif( !function_exists($func) ) return FALSE;\n\n\t$image_src = $func($image_src);\n\t$new_image = imagecreatetruecolor($new_width,$new_height);\n\n\t// Gestion de la transparence pour les png\n\tif( $type=='png' )\n\t{\n\t\timagealphablending($new_image,false);\n\t\tif( function_exists('imagesavealpha') )\n\t\t\timagesavealpha($new_image,true);\n\t}\n\n\t// Gestion de la transparence pour les gif\n\telseif( $type=='gif' && imagecolortransparent($image_src)>=0 )\n\t{\n\t\t$transparent_index = imagecolortransparent($image_src);\n\t\t$transparent_color = imagecolorsforindex($image_src, $transparent_index);\n\t\t$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n\t\timagefill($new_image, 0, 0, $transparent_index);\n\t\timagecolortransparent($new_image, $transparent_index);\n\t}\n\n\t// Redimensionnement de l'image\n\timagecopyresampled(\n\t\t$new_image, $image_src,\n\t\t0, 0, $src_x, $src_y,\n\t\t$new_width, $new_height, $src_w, $src_h\n\t);\n\n\t// Enregistrement de l'image\n\t$func = 'image'. $type;\n\tif($image_dest)\n\t{\n\t\t$func($new_image, $image_dest);\n\t}\n\telse\n\t{\n\t\theader('Content-Type: '. $type_mime);\n\t\t$func($new_image);\n\t}\n\n\t// Libération de la mémoire\n\timagedestroy($new_image); \n\n\treturn TRUE;\n}", "function make_thumb($src,$dest) {\n try {\n // Create a new SimpleImage object\n $image = new \\claviska\\SimpleImage();\n\n // load file\n $image->fromFile($src);\n // img getMimeType\n $mime = $image->getMimeType();\n $w = $image->getWidth();\n\n // Manipulate it\n // $image->bestFit(200, 300) // proportionally resize to fit inside a 250x400 box\n // $image->flip('x') // flip horizontally\n // $image->colorize('DarkGreen') // tint dark green\n // $image->sharpen()\n // $image->border('darkgray', 1) // add a 2 pixel black border\n // $image->overlay('flag.png', 'bottom right') // add a watermark image\n // $image->toScreen(); // output to the screen\n if ($w > 1000) {\n $image->autoOrient(); // adjust orientation based on exif data\n // $image->resize($resizeWidth); // 1365\n // $image->resize(1024); // 1365\n $image->resize(800); // 1067\n }\n $image->toFile($dest,$mime,$outIMGquality);\n // echo \"mime type: \".$mime;\n } catch(Exception $err) {\n // Handle errors\n echo $err->getMessage();\n }\n}", "function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }", "function show_image ($mime_type, $image_resized, $quality, $cache_dir, $zoom_crop) {\n $is_writable = 0;\n $cache_file_name = $cache_dir . '/' . get_cache_file($quality, $zoom_crop);\n\n if( touch( $cache_file_name ) ) {\n // give 666 permissions so that the developer\n // can overwrite web server user\n chmod( $cache_file_name, 0666 );\n $is_writable = 1;\n } else {\n $cache_file_name = NULL;\n header('Content-type: ' . $mime_type);\n }\n\n if(stristr( $mime_type, 'gif' ) ) {\n imagegif( $image_resized, $cache_file_name );\n } elseif( stristr( $mime_type, 'jpeg' ) ) {\n imagejpeg( $image_resized, $cache_file_name, $quality );\n } elseif( stristr( $mime_type, 'png' ) ) {\n imagepng( $image_resized, $cache_file_name, ceil( $quality / 10 ) );\n }\n\n if( $is_writable ) { show_cache_file( $cache_dir, $quality, $zoom_crop ); }\n\n exit;\n\n}", "function mob_images() {\n\tupdate_option( 'thumbnail_size_w', 360 );\n\tupdate_option( 'thumbnail_size_h', 220 );\n\tupdate_option( 'thumbnail_crop', 1 );\n\n\tupdate_option( 'medium_size_w', 654 );\n\tupdate_option( 'medium_size_h', 9999 );\n\tupdate_option( 'medium_crop', 0 );\n\n\tupdate_option( 'medium_large_size_w', 0 );\n\tupdate_option( 'medium_large_size_h', 0 );\n\n\tupdate_option( 'large_size_w', 850 );\n\tupdate_option( 'large_size_h', 400 );\n\tupdate_option( 'large_crop', 1 );\n\n\tadd_image_size( 'archive-blog', 360, 170, true );\t\n}", "function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }", "function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "public function render()\n {\n header('Content-Type: image/png');\n\n imagepng($this->imageResource);\n imagedestroy($this->imageResource);\n }", "function showimage($img_name,$img_width,$img_height,$cropratio=NULL,$imgtitle=NULL,$round) {\r\n\r\n\tglobal $sitepath;\r\n\r\n\t$theimg.=\"<img src='$sitepath\". \"includes/image.php/$img_name[$i]?width=$img_width&amp;height=$img_height\";\r\n\r\n\tif ($cropratio) { $theimg.= \"&amp;cropratio=$cropratio\"; }\r\n\r\n\t$theimg.=\"&amp;quality=85&amp;image=$sitepath\" . \"$img_name' alt='$imgtitle' \";\r\n\r\n\t$theimg.=\" class='avatar\";\r\n\r\n\tif ($round==1) { $theimg.=\" round_1px \"; }\r\n\r\n\tif ($round==2) { $theimg.=\" round_2px \"; }\r\n\r\n\tif ($round==3) { $theimg.=\" round_3px \"; }\r\n\r\n\tif ($round==5) { $theimg.=\" round_5px \"; }\r\n\r\n\tif ($round==10) { $theimg.=\" round_10px \"; }\r\n\r\n\t$theimg.=\"' />\";\r\n\r\n\treturn $theimg;\r\n\r\n}", "abstract public function show($img);", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "function display_album($img_in_album, $title, $width, $height) {\n echo '<img id=\"imgFromAlbum\" src=\"uploads/' . $img_in_album . '\" title=\"' . $title . '\" height=\"' . $height .'\" width=\"' . $width .'\" />';\n\t}", "public function sizeImg($width, $height, $crop = true);", "function resize( $width, $height ) \r\n\t{\r\n //\t\t$new_image = imagecreatetruecolor($width, $height);\r\n //\t\t\r\n //\t\t imagesavealpha($new_image, true);\r\n //\t\t $trans_colour = imagecolorallocatealpha($new_image, 255, 255, 255, 256);\r\n //\t\t imagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t header(\"Content-type: image/png\");\r\n //\t\t imagepng($new_image);\r\n //\t\t\t\t\r\n //\t\timagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\r\n //\t\t\r\n //\t\timagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t\r\n //\t\t$this->image = $new_image;\r\n\t\t\r\n\t\t/****************/\r\n\t\t\r\n \t$image_resized = imagecreatetruecolor( $width, $height );\r\n \r\n if ( ($this->type == IMAGETYPE_GIF) || ($this->type == IMAGETYPE_PNG) ) \r\n {\r\n $transparency_index = imagecolortransparent($this->image);\r\n \r\n // If we have a specific transparent color\r\n if ($transparency_index >= 0) \r\n {\r\n // Get the original image's transparent color's RGB values\r\n $transparent_color = imagecolorsforindex($this->image, $transparency_index);\r\n \r\n // Allocate the same color in the new image resource\r\n $transparency_index = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $transparency_index);\r\n \r\n // Set the background color for new image to transparent\r\n imagecolortransparent($image_resized, $transparency_index);\r\n }\r\n elseif ($this->type == IMAGETYPE_PNG) \r\n {\r\n // Always make a transparent background color for PNGs that don't have one allocated already\r\n\r\n // Turn off transparency blending (temporarily)\r\n imagealphablending($image_resized, false);\r\n \r\n // Create a new transparent color for image\r\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $color);\r\n \r\n // Restore transparency blending\r\n imagesavealpha($image_resized, true);\r\n }\r\n }\r\n\r\n imagecopyresampled( $image_resized, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight() );\r\n \r\n $this->image = $image_resized;\r\n\t}", "private function makeImageSize(): void\n {\n list($width, $height) = getimagesize($this->getUrl());\n $size = array('height' => $height, 'width' => $width );\n\n $this->width = $size['width'];\n $this->height = $size['height'];\n }", "protected function drawImage():void{\n\t\t$this->imagickDraw = new ImagickDraw;\n\t\t$this->imagickDraw->setStrokeWidth(0);\n\n\t\tfor($y = 0; $y < $this->moduleCount; $y++){\n\t\t\tfor($x = 0; $x < $this->moduleCount; $x++){\n\t\t\t\t$this->setPixel($x, $y);\n\t\t\t}\n\t\t}\n\n\t\t$this->imagick->drawImage($this->imagickDraw);\n\t}", "public function do_profile_resize_image($data){\n\t\t//Your Image\n\t\t$imgSrc = 'public/upload/img/profile/' . $data['file'];\n\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($imgSrc);\n\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\")\n\t\t\t$myImage = imagecreatefromjpeg($imgSrc);\n\t\telse if ($data['type'] == \"png\")\n\t\t\t$myImage = imagecreatefrompng($imgSrc);\n\t\telse if ($data['type'] == \"gij\")\n\t\t\t$myImage = imagecreatefromgif($imgSrc);\n\n\t\t// calculating the part of the image to use for thumbnail\n\t\tif ($width > $height) {\n\t\t $y = 0;\n\t\t $x = ($width - $height) / 2;\n\t\t $smallestSide = $height;\n\t\t} else {\n\t\t $x = 0;\n\t\t $y = ($height - $width) / 2;\n\t\t $smallestSide = $width;\n\t\t}\n\n\t\t// copying the part into thumbnail\n\t\t$thumbSize = 300;\n\t\t$thumb = imagecreatetruecolor($thumbSize, $thumbSize);\n\t\timagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);\n\n\t\t//final output\n\t\t$thumbnail_path = 'public/upload/img/profile/thumbnail_' . $data['file'];\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\") {\n\t\t\timagejpeg($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"png\") {\n\t\t\timagepng($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"gif\") {\n\t\t\timagegif($thumb, $thumbnail_path);\n\t\t}\n\n\t}", "function add_image_size($name, $width = 0, $height = 0, $crop = \\false)\n {\n }", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "function refreshImageSize() {\n\t\tif($this->intTableKeyValue != \"\") {\n\t\t\tif ( $this->arrObjInfo['imageurl'] ) {\n\t\t\t\tif($this->arrObjInfo['imagewidth'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imagewidth'] = $imageSize[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($this->arrObjInfo['imageheight'] == 0) {\n\t\t\t\t\t$imageURL = $this->getLocalImageURL();\n\t\t\t\t\n\t\t\t\t\t$imageSize = getimagesize($imageURL);\n\t\t\t\t\t$this->arrObjInfo['imageheight'] = $imageSize[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "function createDisplayImage($filename, $file, $folder, $maxWidth, $fileType){\n\t\t//get original image size\n\t\tlist($width, $height) = getimagesize($file);\n\t\t$ratio = $width/$height;\n\t\t$newHeight = $maxWidth/$ratio;\n\t\t$thumb = imagecreatetruecolor($maxWidth, $newHeight);\n\t\tif($fileType == 'image/jpeg'){\n\t\t\t$source = imagecreatefromjpeg($file);\n\t\t}else {\n\t\t\t$source = imagecreatefrompng($file);\n\t\t}\n\n\t\timagecopyresampled($thumb, $source, 0, 0, 0, 0, $maxWidth, $newHeight, $width, $height);\n\t\t$newfilename = $folder . $filename;\n\t\tif($fileType == 'image/jpeg'){\n\t\t\timagejpeg($thumb, $newfilename, 80);\n\t\t}else {\n\t\t\timagepng($thumb, $newfilename, 8);\n\t\t}\n\t\t\n\t\timagedestroy($thumb);\n\t\timagedestroy($source);\n\t}", "public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }", "function oniros_image_support(){\n\t// add as many as the project might require\n\t// smaller images do not get resized, but largeones will get cropped.\n\n\t// name width height crop?\n\tadd_image_size( 'image_size_name', 400, 400, true);\n}", "public function reseize($path, $source, $width, $height, $nama_ori){\n \t//$source = sumber gambar yang akan di reseize\n $config['image_library'] = 'gd2';\n $config['source_image'] = $source;\n $config['new_image'] = $path.$width.'_'.$nama_ori;\n $config['overwrite'] = TRUE;\n $config['create_thumb'] = false;\n $config['width'] = $width;\n if($height>0){\n \t$config['maintain_ratio'] = false;\n \t$config['height'] = $height;\n }else{\n \t$config['maintain_ratio'] = true;\n }\n\n $this->image_lib->initialize($config);\n\n $this->image_lib->resize();\n $this->image_lib->clear();\n }", "function cilikke($src, $dest, $new_width) {\r\n\t$info = getimagesize($src);\r\n\t$mime = $info[\"mime\"];\r\n\tif( $mime == 'image/jpeg' ) $source_image = imagecreatefromjpeg($src);\r\n\telseif( $mime == 'image/png' ) $source_image = imagecreatefrompng($src);\r\n\t$width = imagesx($source_image);\r\n\t$height = imagesy($source_image);\r\n\t$new_height = floor($height * ($new_width / $width));\r\n\tif($new_width < $width && $new_height < $height)\r\n\t{\r\n\t\t$virtual_image = imagecreatetruecolor($new_width, $new_height);\t\r\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\t\timagejpeg($virtual_image, $dest);\r\n\t}else\r\n\t\tcopy($src, $dest);\r\n}", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "function shift_image_sizes() {\n\n\t// image size for members archive\n\tadd_image_size( 'shift_team_thumb', 600, 600, true );\n\n}", "function cjpopups_resize_image($src, $width, $height = null, $crop = false, $single = false){\n\trequire_once(sprintf('%s/aq_resizer.php', cjpopups_item_path('helpers_dir')));\n\t$resized = aq_resize($src, $width, $height, $crop, $single);\n\tif(!empty($resized)){\n\t\treturn $resized;\n\t}else{\n\t\t$placeholder = 'http://placehold.it/'.$width.'x'.$height.'&text=No+Thumbnail';;\n\t\tif($single){\n\t\t\t$return = $placeholder;\n\t\t}else{\n\t\t\t$return[] = $placeholder;\n\t\t\t$return[] = $width;\n\t\t\t$return[] = $height;\n\t\t}\n\t\treturn $return;\n\t}\n}", "public function gen_thumbnail()\n {\n }", "public function gen_thumbnail()\n {\n }", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }", "public function resize(IImageInformation $src, $width, $height);", "public function image_display_gd($resource)\n\t{\n\t\theader('Content-Disposition: filename='.$this->source_image.';');\n\t\theader('Content-Type: '.$this->mime_type);\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');\n\n\t\tswitch ($this->image_type)\n\t\t{\n\t\t\tcase 1\t:\timagegif($resource);\n\t\t\t\tbreak;\n\t\t\tcase 2\t:\timagejpeg($resource, NULL, $this->quality);\n\t\t\t\tbreak;\n\t\t\tcase 3\t:\timagepng($resource);\n\t\t\t\tbreak;\n\t\t\tdefault:\techo 'Unable to display the image';\n\t\t\t\tbreak;\n\t\t}\n\t}", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "public function AutoSize()\n\t{\n\t\tif ($this->img->img == null) {\n\t\t\t// The predefined left, right, top, bottom margins.\n\t\t\t// Note that the top margin might incease depending on\n\t\t\t// the title.\n\t\t\t$hadj = $vadj = 0;\n\t\t\tif ($this->doshadow) {\n\t\t\t\t$hadj = $this->shadow_width;\n\t\t\t\t$vadj = $this->shadow_width + 5;\n\t\t\t}\n\n\t\t\t$lm = $this->img->left_margin;\n\t\t\t$rm = $this->img->right_margin + $hadj;\n\t\t\t$rm += 2;\n\t\t\t$tm = $this->img->top_margin;\n\t\t\t$bm = $this->img->bottom_margin + $vadj;\n\t\t\t$bm += 2;\n\n\t\t\t// If there are any added Plot\\GanttVLine we must make sure that the\n\t\t\t// bottom margin is wide enough to hold a title.\n\t\t\t$n = safe_count($this->iObj);\n\t\t\tfor ($i = 0; $i < $n; ++$i) {\n\t\t\t\tif ($this->iObj[$i] instanceof Plot\\GanttVLine) {\n\t\t\t\t\t$bm = max($bm, $this->iObj[$i]->title->GetHeight($this->img) + 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// First find out the height\n\t\t\t$n\t = $this->GetBarMaxLineNumber() + 1;\n\t\t\t$m\t = max($this->GetMaxLabelHeight(), $this->GetMaxBarAbsHeight());\n\t\t\t$height = $n * ((1 + $this->iLabelVMarginFactor) * $m);\n\n\t\t\t// Add the height of the scale titles\n\t\t\t$h = $this->scale->GetHeaderHeight();\n\t\t\t$height += $h;\n\n\t\t\t// Calculate the top margin needed for title and subtitle\n\t\t\tif ($this->title->t != '') {\n\t\t\t\t$tm += $this->title->GetFontHeight($this->img);\n\t\t\t}\n\t\t\tif ($this->subtitle->t != '') {\n\t\t\t\t$tm += $this->subtitle->GetFontHeight($this->img);\n\t\t\t}\n\n\t\t\t// ...and then take the bottom and top plot margins into account\n\t\t\t$height += $tm + $bm + $this->scale->iTopPlotMargin + $this->scale->iBottomPlotMargin;\n\t\t\t// Now find the minimum width for the chart required\n\n\t\t\t// If day scale or smaller is shown then we use the day font width\n\t\t\t// as the base size unit.\n\t\t\t// If only weeks or above is displayed we use a modified unit to\n\t\t\t// get a smaller image.\n\t\t\tif ($this->scale->IsDisplayHour() || $this->scale->IsDisplayMinute()) {\n\t\t\t\t// Add 2 pixel margin on each side\n\t\t\t\t$fw = $this->scale->day->GetFontWidth($this->img) + 4;\n\t\t\t} elseif ($this->scale->IsDisplayWeek()) {\n\t\t\t\t$fw = 8;\n\t\t\t} elseif ($this->scale->IsDisplayMonth()) {\n\t\t\t\t$fw = 4;\n\t\t\t} else {\n\t\t\t\t$fw = 2;\n\t\t\t}\n\n\t\t\t$nd = $this->scale->GetNumberOfDays();\n\n\t\t\tif ($this->scale->IsDisplayDay()) {\n\t\t\t\t// If the days are displayed we also need to figure out\n\t\t\t\t// how much space each day's title will require.\n\t\t\t\tswitch ($this->scale->day->iStyle) {\n\t\t\t\t\tcase DAYSTYLE_LONG:\n\t\t\t\t\t\t$txt = 'Monday';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_LONGDAYDATE1:\n\t\t\t\t\t\t$txt = 'Monday 23 Jun';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_LONGDAYDATE2:\n\t\t\t\t\t\t$txt = 'Monday 23 Jun 2003';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORT:\n\t\t\t\t\t\t$txt = 'Mon';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDAYDATE1:\n\t\t\t\t\t\t$txt = 'Mon 23/6';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDAYDATE2:\n\t\t\t\t\t\t$txt = 'Mon 23 Jun';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDAYDATE3:\n\t\t\t\t\t\t$txt = 'Mon 23';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE1:\n\t\t\t\t\t\t$txt = '23/6';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE2:\n\t\t\t\t\t\t$txt = '23 Jun';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE3:\n\t\t\t\t\t\t$txt = 'Mon 23';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE4:\n\t\t\t\t\t\t$txt = '88';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_CUSTOM:\n\t\t\t\t\t\t$txt = date($this->scale->day->iLabelFormStr, strtotime('2003-12-20 18:00'));\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_ONELETTER:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$txt = 'M';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$fw = $this->scale->day->GetStrWidth($this->img, $txt) + 6;\n\t\t\t}\n\n\t\t\t// If we have hours enabled we must make sure that each day has enough\n\t\t\t// space to fit the number of hours to be displayed.\n\t\t\tif ($this->scale->IsDisplayHour()) {\n\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t// of space. We therefore create a typical string for the choosen format\n\t\t\t\t// and determine the length of that string.\n\t\t\t\tswitch ($this->scale->hour->iStyle) {\n\t\t\t\t\tcase HOURSTYLE_HMAMPM:\n\t\t\t\t\t\t$txt = '12:00pm';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_H24:\n\t\t\t\t\t\t// 13\n\t\t\t\t\t\t$txt = '24';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_HAMPM:\n\t\t\t\t\t\t$txt = '12pm';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_CUSTOM:\n\t\t\t\t\t\t$txt = date($this->scale->hour->iLabelFormStr, strtotime('2003-12-20 18:00'));\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_HM24:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$txt = '24:00';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$hfw = $this->scale->hour->GetStrWidth($this->img, $txt) + 6;\n\t\t\t\t$mw = $hfw;\n\t\t\t\tif ($this->scale->IsDisplayMinute()) {\n\t\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t\t// of space. We therefore create a typical string for the choosen format\n\t\t\t\t\t// and determine the length of that string.\n\t\t\t\t\tswitch ($this->scale->minute->iStyle) {\n\t\t\t\t\t\tcase HOURSTYLE_CUSTOM:\n\t\t\t\t\t\t\t$txt2 = date($this->scale->minute->iLabelFormStr, strtotime('2005-05-15 18:55'));\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase MINUTESTYLE_MM:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$txt2 = '15';\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$mfw = $this->scale->minute->GetStrWidth($this->img, $txt2) + 6;\n\t\t\t\t\t$n2 = ceil(60 / $this->scale->minute->GetIntervall());\n\t\t\t\t\t$mw = $n2 * $mfw;\n\t\t\t\t}\n\t\t\t\t$hfw = $hfw < $mw ? $mw : $hfw;\n\t\t\t\t$n = ceil(24 * 60 / $this->scale->TimeToMinutes($this->scale->hour->GetIntervall()));\n\t\t\t\t$hw = $n * $hfw;\n\t\t\t\t$fw = $fw < $hw ? $hw : $fw;\n\t\t\t}\n\n\t\t\t// We need to repeat this code block here as well.\n\t\t\t// THIS iS NOT A MISTAKE !\n\t\t\t// We really need it since we need to adjust for minutes both in the case\n\t\t\t// where hour scale is shown and when it is not shown.\n\n\t\t\tif ($this->scale->IsDisplayMinute()) {\n\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t// of space. We therefore create a typical string for the choosen format\n\t\t\t\t// and determine the length of that string.\n\t\t\t\tswitch ($this->scale->minute->iStyle) {\n\t\t\t\t\tcase HOURSTYLE_CUSTOM:\n\t\t\t\t\t\t$txt = date($this->scale->minute->iLabelFormStr, strtotime('2005-05-15 18:55'));\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MINUTESTYLE_MM:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$txt = '15';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$mfw = $this->scale->minute->GetStrWidth($this->img, $txt) + 6;\n\t\t\t\t$n = ceil(60 / $this->scale->TimeToMinutes($this->scale->minute->GetIntervall()));\n\t\t\t\t$mw = $n * $mfw;\n\t\t\t\t$fw = $fw < $mw ? $mw : $fw;\n\t\t\t}\n\n\t\t\t// If we display week we must make sure that 7*$fw is enough\n\t\t\t// to fit up to 10 characters of the week font (if the week is enabled)\n\t\t\tif ($this->scale->IsDisplayWeek()) {\n\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t// of space\n\t\t\t\t$fsw = strlen($this->scale->week->iLabelFormStr);\n\t\t\t\tif ($this->scale->week->iStyle == WEEKSTYLE_FIRSTDAY2WNBR) {\n\t\t\t\t\t$fsw += 8;\n\t\t\t\t} elseif ($this->scale->week->iStyle == WEEKSTYLE_FIRSTDAYWNBR) {\n\t\t\t\t\t$fsw += 7;\n\t\t\t\t} else {\n\t\t\t\t\t$fsw += 4;\n\t\t\t\t}\n\n\t\t\t\t$ww = $fsw * $this->scale->week->GetFontWidth($this->img);\n\t\t\t\tif (7 * $fw < $ww) {\n\t\t\t\t\t$fw = ceil($ww / 7);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$this->scale->IsDisplayDay() && !$this->scale->IsDisplayHour() &&\n\t\t\t\t!(($this->scale->week->iStyle == WEEKSTYLE_FIRSTDAYWNBR ||\n\t\t\t\t\t$this->scale->week->iStyle == WEEKSTYLE_FIRSTDAY2WNBR) && $this->scale->IsDisplayWeek())) {\n\t\t\t\t// If we don't display the individual days we can shrink the\n\t\t\t\t// scale a little bit. This is a little bit pragmatic at the\n\t\t\t\t// moment and should be re-written to take into account\n\t\t\t\t// a) What scales exactly are shown and\n\t\t\t\t// b) what format do they use so we know how wide we need to\n\t\t\t\t// make each scale text space at minimum.\n\t\t\t\t$fw /= 2;\n\t\t\t\tif (!$this->scale->IsDisplayWeek()) {\n\t\t\t\t\t$fw /= 1.8;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$cw = $this->GetMaxActInfoColWidth();\n\t\t\t$this->scale->actinfo->SetMinColWidth($cw);\n\t\t\tif ($this->img->width <= 0) {\n\t\t\t\t// Now determine the width for the activity titles column\n\n\t\t\t\t// Firdst find out the maximum width of each object column\n\t\t\t\t$titlewidth = max(\n\t\t\t\t\tmax(\n\t\t\t\t\t\t$this->GetMaxLabelWidth(),\n\t\t\t\t\t\t$this->scale->tableTitle->GetWidth($this->img)\n\t\t\t\t\t),\n\t\t\t\t\t$this->scale->actinfo->GetWidth($this->img)\n\t\t\t\t);\n\n\t\t\t\t// Add the width of the vertivcal divider line\n\t\t\t\t$titlewidth += $this->scale->divider->iWeight * 2;\n\n\t\t\t\t// Adjust the width by the user specified zoom factor\n\t\t\t\t$fw *= $this->iZoomFactor;\n\n\t\t\t\t// Now get the total width taking\n\t\t\t\t// titlewidth, left and rigt margin, dayfont size\n\t\t\t\t// into account\n\t\t\t\t$width = $titlewidth + $nd * $fw + $lm + $rm;\n\t\t\t} else {\n\t\t\t\t$width = $this->img->width;\n\t\t\t}\n\n\t\t\t$width = round($width);\n\t\t\t$height = round($height);\n\t\t\t// Make a sanity check on image size\n\t\t\tif ($width > MAX_GANTTIMG_SIZE_W || $height > MAX_GANTTIMG_SIZE_H) {\n\t\t\t\tUtil\\JpGraphError::RaiseL(6007, $width, $height);\n\t\t\t\t//(\"Sanity check for automatic Gantt chart size failed. Either the width (=$width) or height (=$height) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities.\");\n\t\t\t}\n\t\t\t$this->img->CreateImgCanvas($width, $height);\n\t\t\t$this->img->SetMargin($lm, $rm, $tm, $bm);\n\t\t}\n\t}", "function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}", "function _crop_image_resource($img, $x, $y, $w, $h)\n {\n }", "public function resizeEmbed($dir) {\n switch ($this->filetype) {\n case 'svg':\n $svgImage = $dir . 'image.png';\n if ($this->isTransparent($svgImage)) {\n $ext = 'png';\n } else {\n $ext = 'jpg';\n }\n break;\n case 'png':\n if ($this->isApng()) {\n $ext = 'gif';\n } else if ($this->isTransparent()) {\n $ext = 'png';\n } else {\n $ext = 'jpg';\n }\n break;\n case 'mp4':\n case 'webm':\n $ext = 'gif';\n break;\n default:\n $ext = $this->filetype;\n break;\n }\n $imageName = $dir . \"original.\" . $this->filetype;\n if ($this->filetype == 'svg') {\n $imageName = $svgImage;\n }\n $thumbnail = $dir . \"thumbnail.\" . $ext;\n if ($this->isVideo) {\n exec('ffmpeg -i ' . $this->image . ' -filter_complex \"[0:v] fps=30,scale=64:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse\" ' . $thumbnail . ' 2>&1', $output);\n FishyUtils::getInstance()->logExecError($output);\n $imageName = $thumbnail;\n }\n switch ($this->filetype) {\n case \"png\":\n exec(\"magick convert -background none $imageName -resize 64x64^ \\ -gravity center -extent 64x64 $thumbnail 2>&1\", $output);\n FishyUtils::getInstance()->logExecError($output);\n break;\n case \"jpg\":\n exec(\"magick convert $imageName -resize 64x64^ \\ -gravity center -extent 64x64 $thumbnail 2>&1\", $output);\n FishyUtils::getInstance()->logExecError($output);\n break;\n case 'mp4':\n case 'webm':\n case \"gif\":\n exec(\"magick convert $imageName -layers Coalesce -resize 64x64 -layers Optimize $thumbnail 2>&1\", $output);\n FishyUtils::getInstance()->logExecError($output);\n break;\n }\n }", "public function actionImg(){\n if (!isset($_GET['f'])) exit;\n $size = 200;\n if (isset($_GET['s'])) $size = $_GET['s'];\n $filename = Yii::app()->basePath . DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR . Yii::app()->params['coverPhotos'].substr($_GET['f'], 0, 2). DIRECTORY_SEPARATOR.$_GET['f'];\n if (!file_exists($filename)) exit;\n \n $type = exif_imagetype($filename);\n \n Yii::app()->clientScript->reset();\n $this->layout = 'none'; // template blank\n\t\tswitch ($type){\n\t\t\tcase IMAGETYPE_JPEG: header(\"Content-Type: image/jpg\"); break;\n\t\t\tcase IMAGETYPE_PNG: header(\"Content-Type: image/png\"); break;\n\t\t\tcase IMAGETYPE_GIF: header(\"Content-Type: image/gif\"); break;\n\t\t}\n\t\t\n header(\"Content-Description: Remote Image\");\n \n list($width, $height) = getimagesize($filename);\n $r = $width / $height;\n \n $oldMin = ($width > $height ? $height : $width);\n if ($oldMin > $size) {\n // don't do enything\n print file_get_contents($filename);\n exit;\n }\n \n if ($width > $height) {\n $newwidth = $size*$r;\n $newheight = $size;\n } else {\n $newheight = $size/$r;\n $newwidth = $size;\n }\n\t\t\n\t\tswitch ($type){\n\t\t\tcase IMAGETYPE_JPEG: $src = imagecreatefromjpeg($filename); break;\n\t\t\tcase IMAGETYPE_PNG: $src = imagecreatefrompng($filename); break;\n\t\t\tcase IMAGETYPE_GIF: $src = imagecreatefromgif($filename); break;\n\t\t}\n\t\t\n $dst = imagecreatetruecolor($newwidth, $newheight);\n fastimagecopyresampled($dst, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height, 2);\n \n\t\tswitch ($type){\n\t\t\tcase IMAGETYPE_JPEG: @imagejpeg($dst); break;\n\t\t\tcase IMAGETYPE_PNG: @imagepng($dst); break;\n\t\t\tcase IMAGETYPE_GIF: @imagegif($dst); break;\n\t\t}\n\t\t\n imagedestroy($dst);\n exit;\n }", "function resize_png_image($img,$newWidth,$newHeight,$target){\r\n\t\t\t//$srcImage=imagecreatefrompng('D:\\Projects\\xampp\\htdocs\\wannaquiz\\watermarks\\linkedin2.png');\r\n $srcImage=imagecreatefrompng($img);\r\n\t\t\tif($srcImage==''){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t$srcWidth=imagesx($srcImage);\r\n\t\t\t$srcHeight=imagesy($srcImage);\r\n\t\t\t$percentage=(double)$newWidth/$srcWidth;\r\n\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\tif($destHeight > $newHeight){\r\n\t\t\t\t// if the width produces a height bigger than we want, calculate based on height\r\n\t\t\t\t$percentage=(double)$newHeight/$srcHeight;\r\n\t\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\t}\r\n\t\t\t$destImage=imagecreatetruecolor($destWidth-1,$destHeight-1);\r\n\t\t\tif(!imagealphablending($destImage,FALSE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagesavealpha($destImage,TRUE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagecopyresampled($destImage,$srcImage,0,0,0,0,$destWidth,$destHeight,$srcWidth,$srcHeight)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagepng($destImage,$target)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\timagedestroy($destImage);\r\n\t\t\timagedestroy($srcImage);\r\n\t\t\treturn TRUE;\r\n\t\t}", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "public function display()\n {\n header(\"Content-Type: image/png; name=\\\"barcode.png\\\"\");\n imagepng($this->_image);\n }", "public function action_image()\n\t{\n\t\t//Image::load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')->preset('mypreset', DOCROOT.'/files/04_2021/ea7e8ed4bc9d6f7c03f5f374e30b183b.png');\n\t\t$image = Image::forge();\n\n\t\t// Or with optional config\n\t\t$image = Image::forge(array(\n\t\t\t\t'quality' => 80\n\t\t));\n\t\t$image->load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->rounded(100)\n\t\t\t\t\t->output();\n\t\t// Upload an image and pass it directly into the Image::load method.\n\t\tUpload::process(array(\n\t\t\t'path' => DOCROOT.DS.'files'\n\t\t));\n\n\t\tif (Upload::is_valid())\n\t\t{\n\t\t\t$data = Upload::get_files(0);\n\n\t\t\t// Using the file upload data, we can force the image's extension\n\t\t\t// via $force_extension\n\t\t\tImage::load($data['file'], false, $data['extension'])\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->save('image');\n\t\t} \n\t}", "private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}", "function ShowImageByPath($img_with_path = NULL, $size = NULL, $quality = NULL, $wtm = NULL, $parameters = NULL, $return_src = false)\n {\n $imgSmall = ImageK::getResizedImg($img_with_path, $size, $quality, $wtm);\n if(empty($imgSmall)){\n return false;\n }\n if($return_src){\n return $imgSmall;\n }else{\n return '<img src=\"'.$imgSmall.'\" '.$parameters.' />';\n }\n }", "public function reflectionAction()\n {\n $image = __DIR__ . '/../../../data/media/test.jpg';\n $reflection = $this->thumbnailer->createReflection(40, 40, 80, true, '#a4a4a4');\n $thumb = $this->thumbnailer->create($image, [], [$reflection]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/resized_test.jpg');\n\n return false;\n }", "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "function resizeImage($fileName, $newWidth = 100 , $newHeight = 100, $cropType = 0, $outputFileName = \"\", $quality = 75){\r\n $imgCreateFun=array(1 => \"imagecreatefromgif\", 2 => \"imagecreatefromjpeg\", 3 => \"imagecreatefrompng\");\r\n $imgOutputFun=array(1 => \"imagegif\", 2 => \"imagejpeg\", 3 => \"imagepng\");\r\n \r\n if(file_exists($fileName)){\r\n $myFileInfo = getimagesize($fileName);\r\n $imgWidth = $myFileInfo[0];\r\n $imgHeight = $myFileInfo[1];\r\n \r\n $resCords = getPropSizes($imgWidth, $imgHeight, $newWidth, $newHeight, $cropType);\r\n \r\n $imgType = $myFileInfo[2];\r\n if(in_array($imgType,array_keys($imgCreateFun))){\r\n $image_p = imagecreatetruecolor($newWidth, $newHeight);\r\n $image = $imgCreateFun[$imgType]($fileName);\r\n imagecopyresampled($image_p, $image, 0, 0, $resCords[\"srcX\"], $resCords[\"srcY\"], $newWidth, $newHeight, $resCords[\"srcW\"], $resCords[\"srcH\"]); \r\n if(!file_exists($outputFileName)){\r\n if(!$outputFileName){\r\n header(\"Content-type: \".$myFileInfo[\"mime\"]);\r\n }\r\n $imgOutputFun[$imgType]($image_p, $outputFileName, $quality);\r\n imagedestroy($image_p);\r\n imagedestroy($image); \r\n }\r\n else{\r\n imagedestroy($image_p);\r\n imagedestroy($image);\r\n die(\"Cannot write output image - Filename already exists\");\r\n }\r\n \r\n }\r\n else{\r\n die(\"Image Type not supported\");\r\n }\r\n }\r\n else{\r\n die(\"Source file not found\");\r\n }\r\n}", "function displayImage($image) {\n header(\"Content-type: image/jpg\");\n imagejpeg($image);\n imagedestroy($image);\n}", "public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }", "public function autoScale($img, $size) {\n\t// NOT YET IMPLEMENTED.\n}", "function saveResizedImage($format,$imgData,$resizedFilename){\n \tswitch( $format ){\n\t\tcase 1:\n\t\timagegif($imgData, $resizedFilename);\n\t\tbreak;\n\t\tcase 2:\n\t\timagejpeg($imgData, $resizedFilename, 75);\n\t\tbreak;\n\t\tcase 3:\n\t\timagepng($imgData, $resizedFilename, 1);\n\t}\n}", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "public function showImageFromGet() {\n\n\t\t// $imageFilename = UniteFunctionsRev::getGetVar(\"img\");\n\t\t$imageID = intval( UniteFunctionsRev::getGetVar( 'img' ) );\n\t\t$maxWidth = UniteFunctionsRev::getGetVar( 'w',-1 );\n\t\t$maxHeight = UniteFunctionsRev::getGetVar( 'h',-1 );\n\t\t$type = UniteFunctionsRev::getGetVar( 't','' );\n\n\t\t// set effect\n\t\t$effect = UniteFunctionsRev::getGetVar( 'e' );\n\t\t$effectArgument1 = UniteFunctionsRev::getGetVar( 'ea1' );\n\n\t\tif ( ! empty( $effect ) ) {\n\t\t\t$this->setEffect( $effect,$effectArgument1 ); }\n\n\t\t$this->showImageByID( $imageID );\n\t\techo 'sechs<br>';\n\t\t// $this->showImage($imageFilename,$maxWidth,$maxHeight,$type);\n\t}", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "public function setOriginalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n /*\n * get original width and height\n */\n $this->__originalImageWidth = imagesx($this->__image);\n $this->__originalImageHeight = imagesy($this->__image);\n \n }\n \n }", "protected function _createImage()\n {\n $this->_height = $this->scale * 60;\n $this->_width = 1.8 * $this->_height;\n $this->_image = imagecreate($this->_width, $this->_height);\n ImageColorAllocate($this->_image, 0xFF, 0xFF, 0xFF);\n }", "public function display_image($data) {\n global $ID;\n if (file_exists(mediaFN($ID))) {\n echo '<img class=\"proofreadpage\" alt=\"\" width=\"500\" src=\"' . ml($ID, array('w' => '500')) . '\" />';\n }\n }", "function image_display_gd($resource)\n\t{\n\t\theader(\"Content-Disposition: filename={$this->file_name};\");\n\t\theader(\"Content-Type: {$this->mime_type}\");\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Last-Modified: '.gmdate('D, d M Y H:i:s', $this->EE->localize->now).' GMT'); \n\t\n\t\tswitch ($this->image_type)\n\t\t{\n\t\t\tcase 1 \t\t:\timagegif($resource);\n\t\t\t\tbreak;\n\t\t\tcase 2\t\t:\timagejpeg($resource, '', $this->quality);\n\t\t\t\tbreak;\n\t\t\tcase 3\t\t:\timagepng($resource);\n\t\t\t\tbreak;\n\t\t\tdefault\t\t:\techo 'Unable to display the image';\n\t\t\t\tbreak;\t\t\n\t\t}\t\t\t\n\t}", "function resize($image,$x,$y=NULL,$wm=NULL,$wml='br'){\n if(!file_exists($image)){\n return false;\n }\n $images = array();\n if($wm !== '' && $wm !== NULL && file_exists($wm)){\n $images['wmimg'] = $wm;\n }\n $images['img'] = $image;\n foreach($images as $key=>$value){\n $type = substr($value,strrpos($value,'.'));\n if(stristr($type,'i')){\n $$key = imagecreatefromgif($value);\n }\n if(stristr($type,'j')){\n $$key = imagecreatefromjpeg($value);\n }\n if(stristr($type,'n')){\n $$key = imagecreatefrompng($value);\n }\n }\n $size = array();\n if($y === '' || $y === NULL){\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n if($size['x'] >= $size['y']){\n $size['dest_x'] = $x;\n $size['dest_y'] = ceil($size['y'] * ($x / $size['x']));\n }else{\n $size['dest_y'] = $x;\n $size['dest_x'] = ceil($size['x'] * ($x / $size['y']));\n }\n $dest = imageCreatetruecolor($size['dest_x'],$size['dest_y']);\n }else{\n $dest = imagecreatetrueColor($x,$y);\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n $size['dest_x'] = $x;\n $size['dest_y'] = $y;\n }\n imagecopyresized($dest, $img, 0, 0, 0, 0, $size['dest_x'], $size['dest_y'], $size['x'], $size['y']);\n if(isset($wmimg)){\n $size['wmx'] = imageSX($wmimg);\n $size['wmy'] = imageSY($wmimg);\n $size['wmh'] = strtolower($wml{0}) === 'b' ? ($size['dest_y'] - $size['wmy'] - 0) : 0;\n $size['wmw'] = strtolower($wml{1}) === 'r' ? ($size['dest_x'] - $size['wmx'] - 0) : 0;\n imagecopy($dest, $wmimg, $size['wmw'], $size['wmh'], 0, 0, $size['wmx'], $size['wmy']);\n imagedestroy($wmimg);\n }\n imagedestroy($img);\n return $dest;\n }", "public function createThumbnail($imageName,$newWidth,$newHeight) {\n $path = $this->img_dir . '/' . $imageName;\n $mime_info = getimagesize($path);\n $mime = $mime_info['mime'];\n\n $src_img = $this->image_data($path, $mime);\n if($src_img===false) return false;\n\n $old_w = imageSX($src_img);\n $old_h = imageSY($src_img);\n\n $source_aspect_ratio = $old_w / $old_h;\n $desired_aspect_ratio = $newWidth / $newHeight;\n\n if ($source_aspect_ratio > $desired_aspect_ratio) {\n /*\n * Triggered when source image is wider\n */\n $thumb_h = $newHeight;\n $thumb_w = ( int ) ($newHeight * $source_aspect_ratio);\n } else {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $thumb_w = $newWidth;\n $thumb_h = ( int ) ($newWidth / $source_aspect_ratio);\n }\n\n $dst_img = ImageCreateTrueColor($thumb_w,$thumb_h);\n\n $color = imagecolorallocatealpha($dst_img, 0, 0, 0, 127);\n imagefill($dst_img,0,0,$color);\n imagesavealpha($dst_img, true);\n\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_w, $old_h);\n\n if($this->is_crop_hard) {\n $x = ($thumb_w - $newWidth) / 2;\n $y = ($thumb_h - $newHeight) / 2;\n\n $tmp_img = imagecreatetruecolor($newWidth, $newHeight);\n $color = imagecolorallocatealpha($tmp_img, 0, 0, 0, 127);\n imagefill($tmp_img,0,0,$color);\n imagesavealpha($tmp_img, true);\n\n imagecopy($tmp_img, $dst_img, 0, 0, $x, $y, $newWidth, $newHeight);\n $dst_img = $tmp_img;\n }\n\n $new_thumb_loc = $this->thumb_dir . $imageName;\n $result = $this->save($dst_img, $new_thumb_loc, $mime);\n\n imagedestroy($dst_img);\n imagedestroy($src_img);\n return $result;\n }" ]
[ "0.7092627", "0.7031123", "0.68330747", "0.67053425", "0.6561827", "0.64876324", "0.6459978", "0.6454423", "0.6400824", "0.6396083", "0.63904625", "0.63521814", "0.6270974", "0.6262182", "0.6232434", "0.62207997", "0.62072235", "0.6189692", "0.6172086", "0.61320376", "0.6118841", "0.61039394", "0.6097381", "0.6035511", "0.6030911", "0.602404", "0.5939196", "0.5938601", "0.59292865", "0.5920732", "0.5884573", "0.5882509", "0.5873369", "0.58701646", "0.586296", "0.5862821", "0.58583224", "0.5850674", "0.58359873", "0.5831565", "0.5830831", "0.58292806", "0.5817346", "0.5813391", "0.5811668", "0.5811115", "0.58090293", "0.5807707", "0.5804208", "0.5796651", "0.57916856", "0.579046", "0.5788958", "0.5781429", "0.5778971", "0.57708746", "0.57684356", "0.5767307", "0.5759102", "0.5753578", "0.57530564", "0.5747254", "0.5745123", "0.57374823", "0.5733966", "0.5729248", "0.57209253", "0.57209253", "0.57173926", "0.5717347", "0.57128423", "0.57062703", "0.570318", "0.56991786", "0.56986666", "0.56804717", "0.56784093", "0.5673362", "0.5673271", "0.566452", "0.56641316", "0.5661126", "0.565916", "0.5658781", "0.56511694", "0.56484777", "0.5643427", "0.56420255", "0.56406254", "0.5639767", "0.56387055", "0.5637026", "0.56363666", "0.56222856", "0.56190205", "0.5617991", "0.5615067", "0.560757", "0.5597647", "0.55939" ]
0.5660515
82
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE produit (id INT AUTO_INCREMENT NOT NULL, reference VARCHAR(255) NOT NULL, designation VARCHAR(255) DEFAULT NULL, quantite INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, login VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), UNIQUE INDEX UNIQ_8D93D649AA08CB10 (login), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE emplacement (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE historique (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, produit_id INT DEFAULT NULL, date DATETIME NOT NULL, action VARCHAR(255) NOT NULL, quantite INT NOT NULL, INDEX IDX_EDBFD5ECA76ED395 (user_id), INDEX IDX_EDBFD5ECF347EFB (produit_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE historique ADD CONSTRAINT FK_EDBFD5ECA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)'); $this->addSql('ALTER TABLE historique ADD CONSTRAINT FK_EDBFD5ECF347EFB FOREIGN KEY (produit_id) REFERENCES produit (id)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n\t{\n Laravel\\Database\\Schema::create(\"orbs\", function($table){\n $table->increments(\"id\");\n $table->string(\"name\");\n $table->string(\"description\");\n $table->integer(\"coins\");\n $table->integer(\"points\");\n $table->integer(\"min_level\");\n $table->integer(\"max_level\");\n $table->integer(\"owner_character\");\n $table->integer(\"acquisition_time\");\n $table->integer(\"last_attacker\");\n $table->integer(\"last_attack_time\");\n $table->string(\"image\");\n });\n\t}" ]
[ "0.80062366", "0.79145443", "0.79145443", "0.79145443", "0.7572342", "0.756089", "0.75283176", "0.7498379", "0.7493237", "0.7453656", "0.74463314", "0.7433381", "0.74307704", "0.7427088", "0.741794", "0.73779047", "0.7374933", "0.7370453", "0.73637444", "0.73505706", "0.7329024", "0.7313519", "0.7298817", "0.72950184", "0.72917736", "0.7291469", "0.72913444", "0.72849613", "0.72839737", "0.7272078", "0.7271878", "0.72659117", "0.7262893", "0.7261672", "0.7256839", "0.72505474", "0.7249633", "0.72441125", "0.724062", "0.72376186", "0.7218244", "0.72177947", "0.72046006", "0.7203395", "0.7196059", "0.7191219", "0.7189963", "0.7177052", "0.71761394", "0.7167738", "0.7164105", "0.7164105", "0.7159096", "0.7147647", "0.7136521", "0.7129768", "0.7124664", "0.7123368", "0.71168584", "0.7104628", "0.7104628", "0.7104618", "0.7097006", "0.70931643", "0.70886755", "0.7087018", "0.7086326", "0.70830804", "0.70829463", "0.70780045", "0.70702124", "0.70690626", "0.7066111", "0.7062268", "0.7058938", "0.705882", "0.70556235", "0.70549136", "0.7054758", "0.70498437", "0.70483595", "0.7047308", "0.7045881", "0.70445794", "0.7043173", "0.703882", "0.7038126", "0.703674", "0.7033728", "0.7032356", "0.7031423", "0.70257956", "0.70142514", "0.70101255", "0.7006208", "0.6988486", "0.6984963", "0.69629973", "0.69612974", "0.69587934", "0.6957519" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE historique DROP FOREIGN KEY FK_EDBFD5ECF347EFB'); $this->addSql('ALTER TABLE historique DROP FOREIGN KEY FK_EDBFD5ECA76ED395'); $this->addSql('DROP TABLE produit'); $this->addSql('DROP TABLE user'); $this->addSql('DROP TABLE emplacement'); $this->addSql('DROP TABLE historique'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
Determine whether the user can view any models.
public function viewAny(User $user) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "private function canView(): bool\n {\n return true;\n }", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "public function authorize()\n {\n $model = $this->resource()::$model;\n\n return $this->authorizeIfPolicyExists('viewAny', $model);\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function view(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:view')\n );\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}", "public function canView()\n {\n return true;\n }", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function canManageUsers()\n {\n return true;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function canView()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'nexus' , 'transactions', 'transactions_manage' );\n\t}", "public function view(User $user, User $model)\n {\n return $user->is($model) || $user->hasPermissionTo('view users');\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "public function currentUserHasManagerAccess()\n {\n $user = Service::getCurrentUser();\n \n if (!$user) {\n return false;\n }\n \n if ($this->userManagesSite($user)) {\n return true;\n }\n \n if ($user->isAdmin()) {\n return true;\n }\n \n return false;\n }", "public function views(User $user)\n {\n \n //Check at the table level\n if(!$this->perm->can($user,'table',$this->tableSourceId,'read')){\n return false;\n }\n\n //Check at the model level\n if(!$this->modelCheckHelper($user,'read')){\n return false;\n }\n \n return true;\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function hasView()\n {\n return false;\n }", "protected function requireViewableModel($model)\n {\n if (!$model->password) {\n return true;\n }\n\n if ($this->user && $model->userId) {\n if ($this->user->userId == $model->userId) {\n return true;\n }\n }\n\n if ($this->request->has('password')) {\n $passwordHasher = \\App::make('PasswordHasher');\n if ($passwordHasher->verify($this->request->input('password'), $model, 'password')) {\n return true;\n }\n }\n\n throw new HttpException(403, \"You don't have permission to view that.\");\n }", "public function hasModel();", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function view(User $user, User $model)\n {\n return $user->hasPermissionTo('user.view');\n }", "public function view($user, $model)\n {\n if( $user->hasPermissionTo('view ' . static::$key) ) {\n return true;\n }\n\n return $user->id == $model->user_id;\n }", "public function viewAny(User $user)\n {\n return $user->hasPermission('view-any-moui-module');\n }", "public static function authorizedToViewAny(Request $request)\n {\n return $_SERVER['nova.authorize.forbidden-users'] ?? false;\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }", "function canViewActivities($user) {\n \treturn $user->isAdministrator() || $user->isProjectManager();\n }", "public function isViewable()\n\t{\n\t\treturn true;\n\t}", "public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}", "public function canView($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function IsViewable() {\r\n return false;\r\n }", "private function modelCheckHelper(User $user, $action,Model $model=null){\n //Check at the model level\n $source=Source::where('type','model')->where('name',UserGroup::class)->first();\n if($source){\n //$access_string=Source::getTypeKey().':'.$source->id;\n if(!$this->perm->can($user,Source::class,$source->id,$action,$model)){\n return false;\n }\n }\n\n return true;\n }", "public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }", "private function hasAccess() {\n\t\tif ($GLOBALS['BE_USER']->isAdmin()) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn $this->userHasAccessToPages() && $this->userHasAccessToTables();\n\t}", "public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }", "public function viewAny(User $user)\n {\n return $user->hasPermissionTo('view users');\n }", "public function viewAny()\n {\n return true;\n }", "public static function isAllowedViewSite()\n {\n if ((int) SettingService::getSetting('application_disable_site')) {\n $user = UserIdentityService::getCurrentUserIdentity();\n\n if ($user['role'] != AclBaseModel::DEFAULT_ROLE_ADMIN) {\n // get a visitor IP\n $remote = new RemoteAddress;\n $remote->setUseProxy(true);\n\n $userIp = $remote->getIpAddress();\n\n // get list of allowed ACL roles\n if (null != ($allowedAclRoles = SettingService::getSetting('application_disable_site_acl'))) {\n if (!is_array($allowedAclRoles)) {\n $allowedAclRoles = [$allowedAclRoles];\n }\n }\n\n // get list of allowed IPs\n if (null != ($allowedIps = SettingService::getSetting('application_disable_site_ip'))) {\n $allowedIps = explode(',', $allowedIps);\n }\n\n if ($allowedAclRoles || $allowedIps) {\n if (($allowedAclRoles && in_array($user['role'], $allowedAclRoles)) \n || ($allowedIps && in_array($userIp, $allowedIps))) {\n\n return true;\n }\n }\n\n return false;\n }\n }\n\n return true;\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "function can_view_report() {\n //make sure context libraries are loaded\n $this->require_dependencies();\n\n //make sure the current user can view reports in at least one course context\n $contexts = get_contexts_by_capability_for_user('cluster', $this->access_capability, $this->userid);\n return !$contexts->is_empty();\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-referral', 'manage-referral'], true);\n }", "public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n return true;\n } \n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n return Auth::user()->hasAnyRole(['kuchar', 'manager']);\n }", "public function permissions()\n\t{\n\t\t// add any additional custom permission checking here and \n\t\t// return FALSE if user doesn't have permission\n\t\n\t\treturn TRUE;\n\t}", "public function authorizeToViewAny(Request $request)\n {\n return $this->inContract($request) || parent::authorizedToView($request);\n }", "public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }", "public function viewAny($user)\n {\n return $user->hasPermissionTo('viewAny ' . static::$key);\n }", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "function canSeePrivate() {\n \treturn $this->isProjectManager() || (boolean) $this->getSystemPermission('can_see_private_objects');\n }", "public function canBeViewed() {}", "public function authorize()\n {\n return Auth::user()->type == 1;\n }", "public function viewAny(User $user)\n {\n return $user->hasPermission('view-any-moui-role');\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function viewAny(User $user)\n {\n return $user->can('read-approvals');\n }", "public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }", "public function checkModel(): bool\n {\n if (is_null($this->profile)) throw new ProfileModelNotDefined();\n else return true;\n }", "public function viewAny(User $user)\n {\n return $user->hasPermissionTo('view interview');\n }", "public function viewSites(User $user, User $model)\n {\n return $user->is($model) || $user->hasPermissionTo('view sites') || $user->hasPermissionTo('view users');\n }", "public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "public function isViewable()\n {\n return ($this->isPublished() && $this->isActive());\n }", "public function authorize()\n {\n return auth()->user()->can('manage-users');\n }", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "public function view(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.view']);\n }", "public function viewAny(User $user): bool\n {\n //\n }", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function viewAny(User $user): bool\n {\n return $user->can('Read Role');\n }", "function canViewUsers( $sessionID ){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( \"core\",\"members\" );\n\t}", "public function viewAny(User $user)\n {\n return $user->can('list users');\n }", "public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }", "public function view(User $user, Organisation $model)\n {\n return $user->hasPermissionTo('view organisations');\n }", "public function viewAny(User $user)\n {\n // if( $user->role == 2){ //if admin\n // return true;\n // }\n // else{\n // return false;\n // }\n return true;\n }", "function canAny($abilities, $model) \n{\n foreach ($abilities as $ability) {\n if (\\Gate::allows($ability, $model)) {\n return true;\n }\n }\n\n return false;\n}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function can_manage() {\n\t\t$can_manage = false;\n\t\t\n\t\t// is the user the owner of the package\n\t\tif ( ( $this->get_user_id() == get_current_user_id() ) && ( $this->status < 6 ) && ( $this->status > 0 ) ) {\n\t\t\t$can_manage = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_manage_other_packages' ) ) {\n\t\t\t\t$can_manage = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_manage;\n\t}", "public function hasAccess(CharacterModel $characterModel){\n return true;\n }", "function rordb_can_user_view_items(){\n return current_user_can('rordb_view_items');\n}", "public function hasPermissions()\n {\n return $this->roles()->count() > 1;\n }", "public function viewAny(User $user)\n {\n $permission = strpos($user->group->permission, \"rappers_view\");\n return !is_int($permission);\n }", "public function viewAny(User $user)\n {\n return $user->isAdmin() || $user->isSupervisor();\n }" ]
[ "0.6862475", "0.67325985", "0.6683704", "0.6636148", "0.65336263", "0.6531583", "0.65228844", "0.65157175", "0.65027", "0.64962524", "0.64939487", "0.6492319", "0.6490075", "0.6443429", "0.64300334", "0.64055836", "0.6399019", "0.63855416", "0.6379551", "0.6366862", "0.63624066", "0.63624066", "0.6360935", "0.6357972", "0.6348906", "0.6348447", "0.6312425", "0.6292534", "0.6271147", "0.6269476", "0.6254716", "0.6240799", "0.62226033", "0.6214963", "0.6211946", "0.62071466", "0.6205759", "0.6202069", "0.6201993", "0.6200179", "0.61919546", "0.6189515", "0.6186019", "0.6178006", "0.61664766", "0.6160421", "0.61561596", "0.61526453", "0.6151936", "0.6148093", "0.6146377", "0.6145424", "0.61438566", "0.6130618", "0.6127191", "0.6127191", "0.61110586", "0.6105159", "0.6103936", "0.6103554", "0.6096391", "0.6092569", "0.60853404", "0.60801697", "0.60801697", "0.60801697", "0.6076573", "0.60762095", "0.6062224", "0.6051013", "0.605046", "0.6049344", "0.6047687", "0.6045996", "0.6043564", "0.60428274", "0.6042124", "0.6041491", "0.6040387", "0.60373676", "0.60349464", "0.603403", "0.6032968", "0.603227", "0.6028432", "0.602575", "0.60254055", "0.60249376", "0.60245746", "0.6023685", "0.6017442", "0.60111594", "0.60106057", "0.60074675", "0.6002067", "0.599921", "0.5996921", "0.59963506", "0.5991423", "0.5990077", "0.5989528" ]
0.0
-1
Determine whether the user can view the model.
public function view(User $user) { if($user->permisos->contains('slug', 'Paciente.ver')) { return true; }elseif($user->permisos->contains('slug', 'ver.Paciente')) { return true; }elseif($user->permisos->contains('slug', 'Paciente.editar')) { return true; }elseif($user->permisos->contains('slug', 'Editar.Paciente')) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "private function canView(): bool\n {\n return true;\n }", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "public function canView()\n {\n return true;\n }", "public function view(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:view')\n );\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}", "public function authorize()\n {\n $model = $this->resource()::$model;\n\n return $this->authorizeIfPolicyExists('viewAny', $model);\n }", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "function userCanViewPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageView(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "protected function requireViewableModel($model)\n {\n if (!$model->password) {\n return true;\n }\n\n if ($this->user && $model->userId) {\n if ($this->user->userId == $model->userId) {\n return true;\n }\n }\n\n if ($this->request->has('password')) {\n $passwordHasher = \\App::make('PasswordHasher');\n if ($passwordHasher->verify($this->request->input('password'), $model, 'password')) {\n return true;\n }\n }\n\n throw new HttpException(403, \"You don't have permission to view that.\");\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }", "public function view($user, $model)\n {\n if( $user->hasPermissionTo('view ' . static::$key) ) {\n return true;\n }\n\n return $user->id == $model->user_id;\n }", "public function canView()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'nexus' , 'transactions', 'transactions_manage' );\n\t}", "public function view(User $user, User $model)\n {\n return $user->is($model) || $user->hasPermissionTo('view users');\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function view(User $user, User $model)\n {\n return $user->hasPermissionTo('user.view');\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function isViewable()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function isViewable()\n {\n return ($this->isPublished() && $this->isActive());\n }", "public function authorize()\n {\n return $this->user()->can('create', MarEntry::class);\n }", "public function canBeViewed() {}", "public function views(User $user)\n {\n \n //Check at the table level\n if(!$this->perm->can($user,'table',$this->tableSourceId,'read')){\n return false;\n }\n\n //Check at the model level\n if(!$this->modelCheckHelper($user,'read')){\n return false;\n }\n \n return true;\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\\Eadesigndev\\Pdfgenerator\\Controller\\Adminhtml\\Templates::ADMIN_RESOURCE_VIEW);\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "public function authorize()\n {\n if ($this->method() === 'POST') {\n return $this->user()->can('create', Template::class);\n }\n\n return $this->user()->can('update', Template::class);\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function view(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.view']);\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n $this->validate($this->rules());\n $user = auth()->user()->first();\n $type = ImageType::findOrFail($this->input('image_type_id'));\n $owner = $type->owner($this->owner_id)->first();\n\n return $user->can('view', $type) && $user->can('update', $owner);\n }", "public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-referral', 'manage-referral'], true);\n }", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }", "public function authorize(): bool\n {\n return Auth::check() &&\n $this->user()->tokenCan('view:store');\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function canView($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "public function authorize()\n {\n $id = $this->route('id');\n if ($id) {\n $giftList = GiftList::find($id);\n if (!$giftList || $giftList->user->id != Auth::user()->id) {\n return false;\n }\n }\n return true;\n }", "public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }", "public function authorize()\n {\n return $this->permissionGuard()->allowsCreate($this->newModelInstance());\n }", "public function can_read($model)\n {\n return true;\n }", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize()\n {\n return auth()->user()->can('manage-users');\n }", "public function authorize()\n {\n $tag = $this->route()->parameter('tag');\n return Auth::user()->can('view', [Tag::class, $tag]);\n }", "public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }", "public function canView($member = null) \n {\n return true;\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function hasAccess(CharacterModel $characterModel){\n return true;\n }", "public function isViewer()\n\t{\n\t\treturn ($this->role == self::ROLE_VIEWER);\n\t}", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "function rordb_can_user_view_items(){\n return current_user_can('rordb_view_items');\n}", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', app(Property::class));\n }", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "public function view(User $user, User $model)\n {\n return $user->hasPermissionTo('benutzer-bearbeiten');\n }", "public function canView($member = null)\n {\n return (Security::getCurrentUser() !== null);\n }", "public function canView($member = null)\n {\n return (Security::getCurrentUser() !== null);\n }" ]
[ "0.74192244", "0.73926866", "0.73587644", "0.731265", "0.72216856", "0.72160876", "0.70797694", "0.70411503", "0.7034548", "0.6997131", "0.69464743", "0.68929696", "0.68870556", "0.6883539", "0.68338764", "0.68131477", "0.68131477", "0.6810962", "0.6809471", "0.68050355", "0.6778675", "0.6776682", "0.6769641", "0.6751002", "0.67459744", "0.6738256", "0.671839", "0.6715497", "0.6679256", "0.66769505", "0.6670623", "0.6669917", "0.6667145", "0.6667145", "0.66543984", "0.6650639", "0.664146", "0.6638868", "0.6627918", "0.6627863", "0.6613269", "0.6606334", "0.659827", "0.65866125", "0.658308", "0.65741354", "0.6573719", "0.65722454", "0.65690523", "0.6563277", "0.655688", "0.6552189", "0.6551965", "0.6547505", "0.65462095", "0.65334296", "0.65296036", "0.6526925", "0.65232396", "0.6521328", "0.6520021", "0.651323", "0.6511277", "0.6506836", "0.65053463", "0.6502409", "0.6501675", "0.65014297", "0.6500006", "0.6496442", "0.64907825", "0.6488437", "0.64826775", "0.64823425", "0.64817977", "0.6478919", "0.6477755", "0.6470501", "0.6464584", "0.6463797", "0.6461785", "0.6457558", "0.6451995", "0.6445705", "0.64404637", "0.64335376", "0.6431448", "0.6430977", "0.6428819", "0.6428819", "0.6428517", "0.6414907", "0.6411258", "0.6410245", "0.6409887", "0.64035416", "0.6402577", "0.6399193", "0.6394172", "0.6393471", "0.6393471" ]
0.0
-1
Determine whether the user can create models.
public function create(User $user) { if($user->permisos->contains('slug', 'Paciente.crear')) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canCreate();", "public function canCreate();", "private function canCreate()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "protected function canCreate() {}", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "public function authorize()\n {\n return $this->permissionGuard()->allowsCreate($this->newModelInstance());\n }", "protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Site());\n }", "public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }", "public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function canCreate(){\n\t\t\tif(!isset($_POST['action'])) return false;\n\t\t\tif($_POST['action'] !== 'create_profile') return false;\n\t\t\tif($_POST['profile_folder'] === '') return false;\n\t\t\tif($_POST['profile_name'] === '') return false;\n\t\t\treturn true;\n\t\t}", "protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Container())\n && self::Guard()->Allow(BackendAction::UseIt(), new ContainerForm());\n }", "public function create()\n {\n return isAdmin();\n }", "public function authorize()\n {\n return $this->user()->can('user.create');\n }", "function canCreate() {\r\n\t\treturn !DataObject::get_one($this->class);\r\n\t}", "function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "public function authorize()\n {\n return $this->user()->can('create', MarEntry::class);\n }", "public function canCreate(string $name) : bool;", "public function canSetCreatable();", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function create(User $user)\n {\n return $user->can('create user');\n }", "public function create(User $user)\n {\n if ($user->can('create_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }", "public function authorize()\n {\n return auth()->user()->can('create', Task::class);\n }", "public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }", "public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }", "function canCreatePost() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "public function create(User $user)\n {\n return Auth()->user()->hasRole('Admin') || Auth()->user()->hasPermissionTo('Create roles');\n }", "public function canSetCreatable()\n {\n return $this->canSetCreatable;\n }", "public function create(User $user) : bool\n {\n return $user->isAdmin() || $user->hasPermission('create_user') || $user->hasPermission('create_all');\n }", "public function can_auto_create_users() {\n return (bool)$this->config['weautocreateusers'];\n }", "function userCanCreateUser( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function authorize(): bool\n {\n return $this->user()->can('create', Role::class);\n }", "public function create(User $user)\n {\n return $user->can('create-application-forms');\n }", "public function create(User $user): bool\n {\n return $user->can('Create Role');\n }", "function canCreateAccounts() {\r\n\t\treturn true;\r\n\t}", "private function canListAndCreate()\n {\n return true;\n }", "private function checkPermissions()\n {\n $hasPermission = false;\n $user = Account::checkLogin($this->getDb());\n\n if ($user) {\n $permissionObj = new Permission($this->getDb(), $user);\n $hasPermission = $permissionObj->get(\"ettcApi/project/create\");\n }\n\n return $hasPermission;\n }", "public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }", "public function create(User $user)\n {\n return $user->isManager() || $user->isAdmin();\n }", "public function testAllowCreate()\n {\n $createFalse = LogEntry::create()->canCreate(null);\n $this->assertFalse($createFalse);\n $this->logInWithPermission('ADMIN');\n $createFalse = LogEntry::create()->canCreate();\n $this->assertFalse($createFalse);\n }", "public function authorizePost()\n {\n return $this->user()->can('acme.create');\n }", "public function authorize()\n {\n $user = Auth::user();\n\n $foodAddition = new FoodAddition();\n\n if((!$user->can('create', $foodAddition)) || (!$user->can('create-food-addition'))) {\n return false;\n }\n\n return true;\n }", "public function canCreateAccounts()\n {\n return false;\n }", "public function canCreate(): bool\n {\n if (!$this->hasData('can_create')) {\n $this->setData('can_create', $this->eraseCustomerChecker->canCreate((int) $this->session->getCustomerId()));\n }\n\n return (bool) $this->_getData('can_create');\n }", "public function canManageUsers()\n {\n return true;\n }", "public function authorize(): bool\n {\n return $this->user()->can('create_contact');\n }", "protected function creatingNewUser() {\n return ($this->request_exists('user_choice') && $this->request('user_choice') == 'new' );\n }", "function get_can_create_user ()\r\n {\r\n return $_SESSION[\"can_create_user\"];\r\n }", "public function isCreatable();", "public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }", "protected function canCreate(){\n return $this->canUserModify() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_CREATE, $this->getEmptyComment());\n }", "public function authorize()\n {\n return auth()->user()->can('create-buildings');\n }", "public function authorize()\n {\n return auth()->user()->can('create', Pizza::class);\n }", "public function create($user)\n {\n return $user->hasPermissionTo('create ' . static::$key);\n }", "public function canCreatePlaces()\n\t{\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\tif( !$viewer || !$viewer->getIdentity() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Must be able to create blogs\n\t\t/*\n\t\tif( !Engine_Api::_()->authorization()->isAllowed('blog', $viewer, 'create') ) {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\treturn true;\n\t}", "public function create(User $user)\n {\n //Check at the table level\n if(!$this->perm->can($user,'table',$this->tableSourceId,'create')){\n return false;\n }\n\n //Check at the model level\n if(!$this->modelCheckHelper($user,'create')){\n return false;\n }\n \n return true;\n }", "public function authorize()\n {\n return request()->user()->tokenCan('user_create');\n }", "public function authorize() {\n\t\treturn $this->user()->can('create', Pdf::class);\n\t}", "private function beforeCreate(): bool\n {\n $event = new BuildEvent();\n $this->trigger(self::EVENT_BEFORE_CREATING, $event);\n\n return $event->canCreate;\n }", "public function create(): bool\n {\n return true;\n }", "public function authorize(): bool\n {\n return auth()->user()->can('create academic year unit levels');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function create(User $user)\n {\n return $user->isSuper() || $user->isAdmin() || $this->isAllowedFor($user, 'create');\n }", "public function authorize()\n {\n // TODO: Check if is authorized to create user\n return true;\n }", "public function create()\n {\n // Admin only\n }", "public function create(User $user)\n {\n return $user->can('create_customer');\n }", "public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }", "function CanCreateList()\n\t{\n\t\tif (!verify($this->userid)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($this->ListAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$maxlists = $this->GetMaxLists();\n\n\t\t// if there is no maximum set, double check they have permission to create a list.\n\t\tif ($maxlists == 0) {\n\t\t\tif ($this->HasAccess('Lists', 'Create')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t$mylists = count(array_keys($this->GetLists()));\n\t\tif ($mylists < $maxlists) {\n\t\t\tif ($this->HasAccess('Lists', 'Create')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t\treturn false;\n\t}", "public function create(User $user)\n {\n return $user->hasPermission('create-moui-module');\n }", "public function create(User $user)\n {\n return $user->canDo('career.job.create');\n }", "public function isCreate()\n {\n $route = request()->route();\n\n if (request()->method() != 'GET') {\n return request()->method() == 'POST'\n && count(explode('/', Str::after(request()->url(), '/api/'))) == 1;\n }\n\n return str_contains(optional($route)->getName(), '.create')\n || Str::endsWith(optional($route)->getName(), '.store');\n }", "private function canCreate(User $user, ?Place $place): bool\n {\n return true;\n }", "public function canCreateListing() {\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n if( !$viewer || !$viewer->getIdentity() ) {\r\n return false;\r\n }\r\n\t\t\r\n\t\t$listingtype_id = Engine_Api::_()->ynmultilisting()->getCurrentListingTypeId();\r\n\t\tif (!$listingtype_id) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$listingtype = Engine_Api::_()->ynmultilisting()->getCurrentListingType();\r\n if( !$listingtype->checkPermission($viewer, 'ynmultilisting_listing', 'create')) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public static function authorizedToCreate(Request $request)\n {\n return false;\n }", "function canCreateAccounts() {\n return false;\n }", "public function create(User $user)\n {\n return $user->hasPermissions(['group_create']);\n }", "public function create(User $user)\n {\n // return true;\n return $user->hasPermissionTo('create interview');\n }", "function allow_create_users() {\n\t\treturn apply_filters( 'import_allow_create_users', true );\n\t}", "public function authorize()\n {\n // return auth()->user()->can('create user');\n return true;\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "public function create(User $user)\n {\n return $user->hasPermissionTo('create llamados');\n }", "public function create(User $user)\n {\n return $this->userRoleCan($user, 'role-create');\n }", "public function create(User $user)\n {\n return $user->hasPermission('articles.create');\n }", "public function create(User $user) {\n return $user->hasPermission('articles.create');\n }", "public function create(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['create']);\n }\n }", "public function create(User $user)\n {\n return $user->hasPermissionTo('experience_create');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Pronko_TaskManagement::TaskManagement_save');\n }", "public function create(): bool;", "public function isCreator()\n {\n return $this->role == 2;\n }", "public function create(User $user)\n {\n return $user->access_level > 0;\n }", "public function canCreateSitegroups() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'create')) {\n return false;\n }\n return true;\n }", "function canAdd($user) {\n return $user->isPeopleManager();\n }", "public function create(Authenticatable $user)\n {\n return $user->canDo('setting.setting.create');\n }", "public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }", "public function create(User $user)\n {\n if ($user->can('create_tasks')) {\n return true;\n }\n }", "public function create(User $user)\n {\n $permission = strpos($user->group->permission, \"rappers_create\");\n return !is_int($permission);\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function create(User $logged_user)\n {\n return $logged_user->is_root || $logged_user->can('users.create');\n }", "public function create(User $user)\n {\n return $user->access_level > 1;\n }", "public function create(User $user)\n {\n return true; // TODO: Change as needed, but leave it true if no policy\n }", "public function create(User $user)\n {\n if($user->rols->contains('slug', 'administrador')) {\n return true;\n } elseif ($user->permisos->contains('slug', 'crear-especie')) {\n return true;\n }\n return false;\n }" ]
[ "0.7778275", "0.7778275", "0.7579488", "0.75224614", "0.751396", "0.7406157", "0.7359211", "0.71444124", "0.71313286", "0.70818734", "0.7059168", "0.70359224", "0.6997148", "0.69920594", "0.69206184", "0.6914132", "0.6859784", "0.68434596", "0.68231726", "0.6808316", "0.6803906", "0.67967695", "0.6770032", "0.6767556", "0.66509426", "0.6647209", "0.66421825", "0.6637023", "0.66324216", "0.66107285", "0.6595387", "0.65928257", "0.6581444", "0.6541037", "0.6530571", "0.65073097", "0.6496051", "0.64924586", "0.64904356", "0.64822596", "0.64680594", "0.64635843", "0.6445608", "0.64320165", "0.641257", "0.64070946", "0.6406117", "0.6397249", "0.6387814", "0.63793075", "0.6374151", "0.63711935", "0.63639313", "0.6339487", "0.6338335", "0.63382185", "0.63281685", "0.63114405", "0.63098425", "0.629682", "0.62965924", "0.6288189", "0.6283485", "0.626705", "0.6257799", "0.6256433", "0.6254994", "0.62527585", "0.6251133", "0.62511253", "0.62471896", "0.62351507", "0.62325835", "0.62300056", "0.6196142", "0.6190324", "0.6189582", "0.61825687", "0.6177146", "0.61769015", "0.61698943", "0.6167683", "0.6165778", "0.61520255", "0.614434", "0.61360556", "0.6133958", "0.612813", "0.6127293", "0.6124749", "0.61241436", "0.61129135", "0.6104468", "0.6085617", "0.60774213", "0.60771286", "0.60715216", "0.6069143", "0.6065887", "0.60634387", "0.6062726" ]
0.0
-1
Determine whether the user can update the model.
public function update(User $user, Paciente $paciente) { if($user->permisos->contains('slug','Paciente.editar')){ return true; }elseif($user->permisos->contains('slug', 'Editar.Paciente')) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function isUpdateRequired();", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function update($user, $model)\n {\n if( $user->hasPermissionTo('update ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function isUpdateSecurityRelevant() {}", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function update(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:update')\n );\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }", "protected function modelIsWritable() {\n\t\t// Check if model has method dbUpdate\n\t\t$model = $this->model;\n\t\treturn method_exists($model, \"dbUpdate\");\n\t}", "function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public function update(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.update']);\n\n }", "public function update(Request $request, object $model): bool;", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return Auth::check();\n }", "public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }", "abstract public function isUpdatableByUser(User $user);", "public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }", "public function update(User $user)\n {\n return $user->can('update_customer');\n }", "public function update(User $current, User $toUpdate = null)\n {\n if ($current->hasPermission('users.update')) return true;\n\n //no permissions and not trying to update his own model\n if ( ! $toUpdate || ($current->id !== $toUpdate->id)) return false;\n\n //user should not be able to change his own permissions or roles\n if ($this->request->get('permissions') || $this->request->get('roles')) {\n return false;\n }\n\n return true;\n }", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}", "public function update(Authenticatable $user, Model $model)\n {\n return !!$user;\n }", "public function update(User $user): bool\n {\n return $user->can('Update Role');\n }", "public function update(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-update','user-manage'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "public function update(User $user)\n {\n\t\treturn in_array('update', $user->permissibles('vip'));\n }", "public function update(User $user, Llamado $model)\n {\n return $user->hasPermissionTo('update llamados');\n }", "public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }", "public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }", "public function can_edit() {\n return true;\n }", "public function canEdit()\n {\n return true;\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}", "public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function update(User $user, User $model)\n {\n return $user->isOwnerOrAdmin($model->id);\n }", "public function isUpdatable(): bool\n {\n return true;\n }", "public function update($model) :bool;", "public function isUpdateResource();", "public function update(User $user, User $model)\n {\n if ($model->hasRole(AuthServiceProvider::SUPER)) return false;\n if ($user->hasRole(AuthServiceProvider::ADMIN)) return true;\n if ($user->hasPermissionTo('benutzer-bearbeiten')) {\n foreach ($model->homeCities as $city) {\n if ($city->administeredBy($user)) return true;\n }\n }\n return false;\n }", "protected function canEdit(Model $model)\n {\n return true;\n }", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function update(User $user, ApplicationForm $applicationForm)\n {\n return $user->can('update-application-forms');\n }", "public function canUpdate($identifier = null);", "public function authorize()\n {\n $authorized = auth()->check();\n if ($authorized) {\n $this->rules = $this->getRulesForAction(CrudAction::update());\n }\n return $authorized;\n }", "private function _update(){\n\t\tif($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){\n\t\t\t$this->read();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "public function isUpdateRequest()\n {\n return $this->isMethod('put') || $this->isMethod('patch');\n }", "protected function onUpdating()\n {\n return $this->isDataOnUpdateValid();\n }", "protected function canEdit() {}", "public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }", "public function update(?User $user, User $model)\n {\n return true;\n }", "public function update(User $user)\n {\n return $user->hasPermissionTo('experience_edit');\n }", "public function update(User $user, $model)\n {\n return false;\n }", "public function getCanModifyAttribute()\n {\n // Checks if there are any shared user permissions for this user, if not returnes false\n // If they do have permissions, it will return there modify attribute\n return (count($this->auth_user_share)) ? (bool)($this->auth_user_share[0]->pivot->modify) : false;\n }", "public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}", "public function update(User $user, Sale $model)\n {\n return $user->hasPermissionTo('update sales');\n }", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "public function update(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['update']);\n }\n }", "public function executeUpdate(): bool\n {\n $this->updateDaysallowedField();\n return true;\n }", "public function updatePolicy(User $user)\n {\n return $user->may(static::PERMISSION_UPDATE);\n }", "public function update(User $user)\n {\n if($user->can('carts-update') || $user->can('cart-update')) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }", "protected function check_update_permission($post)\n {\n }", "protected function check_update_permission($post)\n {\n }", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "function isSaveAllowed() {\n\t\t\treturn $this->isAllowedAction( 'save' );\n\t\t}" ]
[ "0.81162834", "0.781202", "0.7761809", "0.7756841", "0.7743874", "0.7647602", "0.7609891", "0.7579814", "0.75415283", "0.75036174", "0.74731016", "0.74154335", "0.7396818", "0.7354857", "0.7346884", "0.73095524", "0.7292035", "0.7230987", "0.71980274", "0.7171308", "0.71507996", "0.71306604", "0.7124282", "0.7094555", "0.7090229", "0.7065031", "0.7054136", "0.7052038", "0.7042696", "0.70095026", "0.70066977", "0.69752914", "0.6940487", "0.69343716", "0.6901618", "0.6883628", "0.6855302", "0.68480724", "0.6842233", "0.6841448", "0.6833123", "0.6811518", "0.6793768", "0.67888844", "0.676557", "0.676557", "0.676557", "0.676557", "0.676557", "0.676557", "0.676557", "0.676557", "0.676557", "0.67381907", "0.67252165", "0.67252165", "0.66910285", "0.66663474", "0.6666171", "0.6665959", "0.66499037", "0.66491973", "0.66469926", "0.66409063", "0.66230595", "0.66184634", "0.6617804", "0.661335", "0.6613006", "0.659741", "0.6593499", "0.65778553", "0.6577829", "0.6576705", "0.6571976", "0.65347457", "0.653457", "0.65273637", "0.6517034", "0.651246", "0.650719", "0.65069973", "0.65068537", "0.6503348", "0.64946103", "0.6475257", "0.64539367", "0.64534324", "0.6451713", "0.644778", "0.6445275", "0.6445275", "0.6437073", "0.6433718", "0.64155227", "0.641047", "0.64102376", "0.64095324", "0.64095324", "0.6400552", "0.63993466" ]
0.0
-1
Determine whether the user can delete the model.
public function delete(User $user, Paciente $paciente) { if($user->permisos->contains('slug','Paciente.borrar')){ return true; }elseif($user->permisos->contains('slug','borrar.Paciente')){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "public function canDelete()\n {\n return $this->canGet();\n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "function canDelete() {\n return true;\n }", "public function canDelete()\n {\n return 1;\n }", "public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }", "public function canDelete()\n {\n return in_array('delete', $this->actions);\n }", "public function authorize()\n {\n return $this->can('delete');\n }", "function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }", "function canDelete(User $user) {\n return $user->canManageTrash();\n }", "public function isDeleteGranted($entity): bool;", "private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "protected function canDelete($record) { return false; }", "public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }", "function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}", "public function delete($user, $model)\n {\n if( $user->hasPermissionTo('delete ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "public function getCanDeleteAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }", "protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }", "public function delete(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:delete')\n );\n }", "public function allowDeletion()\n {\n return $this->allowDeletion;\n }", "function canDelete(User $user) {\n return $user->isFinancialManager();\n }", "protected function canDelete($record)\n {\n return true;\n }", "public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }", "function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }", "public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }", "protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }", "public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function deleting(User $model)\n {\n return ($model->id !== \\Auth::user()->id);\n }", "public function isDeleteable()\n {\n return $this->_isDeleteable;\n }", "public function isDelete();", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public function delete(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.delete']);\n\n }", "public function authorizedToDelete(Request $request)\n {\n return false;\n }", "public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t return Factory::getUser()->authorise(\n\t\t\t\t\"core.delete\",\n\t\t\t\t\"com_dinning_philosophers.dinning_philosophers.\".$record->id\n\t\t\t);\n\t\t}\n\t}", "public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }", "public function forceDelete(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:forceDelete')\n );\n }", "public function isDeleteResource();", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}", "public function delete(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-delete','user-manage'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "abstract function allowDeleteAction();", "public function forceDelete($user, $model)\n {\n if( $user->hasPermissionTo('forceDelete ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function delete($model)\n\t{\n\t\treturn ($model->delete()) ? true : false;\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "public function canDelete($item)\n {\n return false;\n }", "public function canDelete($item)\n {\n return false;\n }", "public function delete(): bool\n {\n return $this->actionHandler->delete();\n }", "public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }", "public function delete(User $user)\n {\n return $user->can('delete_customer');\n }", "public function isDelete(): bool {}", "public function canDelete()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }", "public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }", "public function canDelete()\n {\n if ( null === $this->_canDelete )\n {\n $model = new Application_Model_AudioJobMapper();\n $results = $model->fetchAll( 'service_id = ' . $this->id );\n $this->_canDelete = !(bool) count( $results );\n }\n return $this->_canDelete;\n }", "public function isDeletable(\\Illuminate\\Database\\Eloquent\\Model $model)\n {\n// else return false;\n return true;\n }", "public function delete(User $user): bool\n {\n return $user->can('Delete Role');\n }", "public function canDelete($identifier = null);", "public function isDelete() {\n if($this->method === 'DELETE') {\n return true;\n } else {\n return false;\n }\n }", "public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }", "public function authorize()\n {\n $name = $this->relatedResource()->name();\n $model = $this->resource()->getModel();\n $relatedModel = $this->relationship()->getRelated();\n\n return parent::authorize()\n && $this->authorizeIfPolicyExists(\"detach$name\", $model, $relatedModel);\n }", "protected function canDelete($record)\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->state != -2)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$user = JFactory::getUser();\n\t\t\t\n\t\t\treturn $user->authorise('core.delete', 'com_cooltouraman.course.' . (int) $record->id);\n\t\t}\n\n\t\treturn false;\n\t}", "public function canDelete($member = null) {\n\t\treturn ($this->Code == 'DEFAULT') ? false : Permission::check('Product_CANCRUD');\n\t}", "public function delete(Authenticatable $user, Model $model)\n {\n return $user->id === $model->user_id;\n }", "protected function canDelete()\n {\n if (!Validate::isLoadedObject($this)) {\n return true;\n }\n\n /** @var Gamifications $module */\n $module = Module::getInstanceByName('gamifications');\n $em = $module->getEntityManager();\n\n /** @var GamificationsRewardRepository $rewardRepository */\n $rewardRepository = $em->getRepository(__CLASS__);\n $isInUse = $rewardRepository->isRewardInUse($this->id);\n\n return !$isInUse;\n }", "public function delete() {\n $stmt = $this->pro->prepare('delete from user where id = :id');\n $stmt->bindValue(':id', $this->id);\n return $stmt->execute() == 1;\n }", "public function delete(User $user, $model)\n {\n return $user->hasPermission('delete_settings');\n }", "protected function CanDelete(Site $site)\n {\n return self::Guard()->Allow(BackendAction::Delete(), $site);\n }", "public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }", "public function delete(User $user)\n {\n return $user->hasPermission('user-delete');\n }", "public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }", "public function isDelete() {\n return $this->method == 'DELETE';\n }", "public function forceDelete(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.forceDelete']);\n\n }", "public function delete(Model $model): ?bool;", "public function isDelete() {\n return $this->method == self::METHOD_DELETE;\n }", "public function deleteByModel(Model $model): bool;", "public function canDelete($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.tariff.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tableRoomType = $this->getTable('RoomType');\n\t\t\t$tableRoomType->load($record->room_type_id);\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $tableRoomType->reservation_asset_id);\n\t\t}\n\t}", "public function canDELETE($collection = null) {\r\n $rights = $this->getRights($collection, 'delete');\r\n return is_bool($rights) ? $rights : true;\r\n }", "public function isDelete()\n {\n return $this->method === self::METHOD_DELETE;\n }", "public function isDelete()\n\t{\n\t\treturn $this->httpMethod() == self::MethodDelete;\n\t}", "public function isDelete(): bool\n {\n return $this->getMethod() === self::METHOD_DELETE;\n }", "protected function _can_delete($delete_id) {\r\n return true;\r\n }", "public function isDelete()\n {\n return ($this->getMethod() == 'DELETE') ? true : false;\n }", "protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.reservationasset.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $record->id);\n\t\t}\n\t}", "abstract public function shouldIDelete();", "protected function isDeleting()\n {\n return $this->option('delete') == 'true';\n }", "public function delete(User $user, Llamado $model)\n {\n return $user->hasPermissionTo('delete llamados');\n }", "function userCanDeleteUser( $sessionID, $username ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function isDelete()\n {\n return $this->getMethod() === 'DELETE';\n }", "public function canDelete($userId = \"\")\n {\n\n if ($userId == \"\")\n $userId = Yii::$app->user->id;\n\n if ($this->user_id == $userId)\n return true;\n\n if (Yii::$app->user->isAdmin()) {\n return true;\n }\n\n if ($this->container instanceof Space && $this->container->isAdmin($userId)) {\n return true;\n }\n\n return false;\n }", "public function delete(CharacterModel $characterModel){\n return ($this->valid() && $this->hasAccess($characterModel)) ? $this->erase() : false;\n }", "public function deleted(User $model)\n {\n // If the User is deleted, delete your image\n \\File::delete(base_path($model->img_url));\n return true;\n }", "function canDelete(&$msg, $oid = NULL) {\n\t\t//$tables[] = array( 'label' => 'Users', 'name' => 'users', 'idfield' => 'user_id', 'joinfield' => 'user_company' );\n\t\t//return CDpObject::canDelete( $msg, $oid, $tables );\n\t\treturn true;\n\t}", "public function forceDelete(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-edit','user-forceDelete'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "function canDelete($member = NULL)\n\t{\n\t\treturn true;\n\t}", "public function delete(User $user, Sale $model)\n {\n return $user->hasPermissionTo('delete sales');\n }" ]
[ "0.78115165", "0.7799225", "0.77931285", "0.7774248", "0.7762861", "0.772955", "0.7658145", "0.76024574", "0.75723165", "0.7447689", "0.741027", "0.7360865", "0.7339668", "0.73045045", "0.7292303", "0.7275476", "0.72221464", "0.7194365", "0.7111255", "0.710949", "0.70957327", "0.70905155", "0.70816475", "0.7057204", "0.70228994", "0.6998384", "0.6988895", "0.6960694", "0.69604415", "0.69319093", "0.69051796", "0.68898606", "0.68765044", "0.6872876", "0.68701386", "0.686875", "0.68448377", "0.6810136", "0.6808629", "0.6756576", "0.67509776", "0.6747834", "0.6743452", "0.6743086", "0.6714124", "0.6704544", "0.6704343", "0.6690488", "0.6685831", "0.6685831", "0.66777956", "0.6669061", "0.66610193", "0.6652245", "0.6636485", "0.66340065", "0.66326934", "0.66306835", "0.66222423", "0.6606447", "0.6600937", "0.66007864", "0.6582779", "0.6582121", "0.6577704", "0.65619755", "0.65582716", "0.65506357", "0.6547446", "0.65449697", "0.65422934", "0.65251994", "0.65138054", "0.6509449", "0.65044236", "0.649814", "0.6491175", "0.64782643", "0.6475672", "0.6469378", "0.6464958", "0.64570254", "0.64550143", "0.6448656", "0.6440046", "0.6438612", "0.64293796", "0.6427633", "0.64271456", "0.6423097", "0.64222425", "0.6421015", "0.6412136", "0.64061886", "0.6398719", "0.6398478", "0.6397069", "0.6377073", "0.63767767", "0.63748664", "0.6368726" ]
0.0
-1
Determine whether the user can restore the model.
public function restore(User $user, Paciente $paciente) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function can_restore() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'restore' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function restore($user, $model)\n {\n\n if( $user->hasPermissionTo('restore ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function restore(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:restore')\n );\n }", "public function restore(User $user): bool\n {\n return $user->can('Restore Role');\n }", "public function restore(User $user, Sale $model)\n {\n return false;\n }", "public function restore(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.restore']);\n\n }", "public function restore(User $user, User $model)\n {\n return $user->hasPermissionTo('benutzer-bearbeiten');\n }", "protected function isRestoring()\n {\n return $this->option('restore') == 'true';\n }", "public function restore(User $user, Llamado $model)\n {\n return false;\n }", "public function restore(User $user, Organisation $model)\n {\n return false;\n }", "public function beforeRestore() : bool\n\t{\n\t\treturn true;\n\t}", "public function restore(): bool\n {\n return false;\n }", "public function restore(User $user, Interview $interview)\n {\n return $user->hasPermissionTo('restore interview');\n }", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function restore(User $user, Approval $resource)\n {\n return false;\n }", "public function restore(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-restore','user-manage'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "public function restore(User $user, Delivery $model)\n {\n return false;\n }", "public function restore(User $user, Experience $experience)\n {\n return true;\n }", "protected function onRestored()\n {\n return true;\n }", "public function afterRestore() : bool\n\t{\n\t\treturn true;\n\t}", "public function restore(User $user, Module $module)\n {\n return $user->hasPermission('restore-moui-module');\n }", "public function restore(User $user)\n {\n return config('mailcare.auth') && config('mailcare.automations');\n }", "public function restore(User $user, Formation $formation)\n {\n return $user->hasPermission('restore-organization-formation');\n }", "public function restore(User $user, Show $show): bool\n {\n return $user->isAdmin();\n }", "public function restore(User $user, Role $role)\n {\n return $user->hasPermission('restore-moui-role');\n }", "public function restore(User $user, PageUser $model)\n {\n return true;\n }", "public function restore(User $user, Order $order)\n {\n return $user->hasPermission('order.restore');\n }", "public function restore(Authorizable $user, Withdraw $withdraw)\n {\n return true;\n }", "public function restore(User $user, Composition $composition)\n {\n return $user->hasPermission('restore-organization-composition');\n }", "public function restore(User $user, User $targetUser)\n {\n return ! $user->hasRole('Banned') &&\n $user->hasPermission('restore', User::class);\n }", "public function restore(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "public function restore(User $user, User $model)\n {\n if ($user->isAdmin() || $user->isGuardian()) {\n return $this->allow();\n }\n \n return $this->deny();\n }", "public function restore(User $user, Appoientment $appoientment)\n {\n return $user->type == User::ADMIN_TYPE;\n }", "public function restore(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }", "public function restore(User $user, MeetingRoom $model)\n {\n return false;\n }", "public function restore(User $user, Document $document)\n {\n if ($user->isStaff()) {\n return true;\n }else {\n return $user->id === $document->user_id;\n }\n }", "public function restoreById(int $UserId): bool;", "public function restore($id): bool;", "public function restore(User $user, BankAccount $bankAccount)\n {\n return isAllowed($user, 'bankaccount-restore');\n }", "public function restore($id): bool\n {\n return (bool)$this->model->withTrashed()->find($id)->restore($id);\n }", "public function restore(User $user)\n {\n return $user->idquyenhan == 2;\n }", "public function restore(User $user, Employee $employee)\n {\n return $user->role == 'admin';\n }", "public function restore(User $user, Upload $upload)\n {\n if ($this->hasPrivilegedRole($user)) {\n return true;\n }\n\n if ($user->id == $upload->user_id) {\n return true;\n }\n\n return false;\n }", "public function restore(User $user, Store $store)\n {\n $admin_role = Roles::where('role_name', 'admin')->firstOrFail();\n return $user->role_id === $admin_role->id;\n }", "public function restore(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function beforeSave()\n {\n //Cannot edit role id == 1 because Supper Administrator access all permission\n $auth = Users::getCurrentUser();\n if ($this->is_super_admin == 1 && $auth['is_super_admin'] != 1) {\n return false;\n }\n return true;\n }", "public function restore(User $user, Product $checkoutProduct)\n {\n if ($user->is_admin) {\n return true;\n }\n\n return false;\n }", "public function restore(User $user, Attribute $attribute)\n {\n return false;\n }", "public function restore(User $user, Businesstype $businesstype)\n {\n return $user->role == 'admin';\n }", "public function restore(Provider $provider)\n {\n\t if (Auth::guard('provider-web')->user()->id == $provider->id) return true;\n\t return false;\n }", "public function restore(User $user, ClientPaymentDetail $clientPaymentDetail)\n {\n if ($user->can('restore client payment detail')) {\n return true;\n }\n }", "public function restore(User $user, Participant $participant)\n {\n return $user->role === 2;\n }", "public function checkIsSaved()\n {\n if (isset($this->owner->primaryKey) == false) {\n throw new ModelIsUnsaved();\n }\n }", "public function restore(User $user, Itms $itms)\n {\n return $user->isAdmin;\n }", "public function beforeSave()\n {\n if (!$this->checkPermissions()) {\n return $this->modx->lexicon('access_denied');\n }\n\n return true;\n }", "public function beforeSave()\n {\n if (!$this->checkPermissions()) {\n return $this->modx->lexicon('access_denied');\n }\n\n return true;\n }", "public function beforeSave() {\n\t\tif (!$this->checkPermissions()) {\n\t\t\treturn $this->modx->lexicon('access_denied');\n\t\t}\n\n\t\treturn true;\n\t}", "public function beforeSave()\n {\n if (!$this->checkPermissions()) {\n return $this->modx->lexicon('access_denied');\n }\n return true;\n }", "public function restore(User $user, Love $love)\n {\n //\n return $user->id === 1;\n }", "private function isRestore(array $urlParams)\n {\n return (isset($urlParams['restore']) && is_numeric($urlParams['restore']));\n }", "protected function onRestoring()\n {\n return true;\n }", "public function restore(User $user, Msg $msg)\n {\n //\n\t\tif(!isset($msg->user_id))return true;\n\t\tif( $user->hasPermission('restore.msg'))return true;\n\t\treturn $user->id == $msg->user_id;\n }", "public function restore(User $user, region $Region)\n {\n return ($user->isAdmin() || $user->isSupervisor()) && $this->trashed($Region);\n }", "public function restore(User $user, ServerAuthKey $key)\n {\n return true;\n }", "protected abstract function canSave();", "public function canRollback() {\n\t\treturn $this->bean->rollback;\n\t}", "public function restore(User $user, NovaSentMail $mail)\n {\n return false;\n }", "public function canManageBackup();", "function isSaveAllowed() {\n\t\t\treturn $this->isAllowedAction( 'save' );\n\t\t}", "public function restore(User $user, Department $department)\n {\n return false;\n }", "public function restore(User $user, Kamar $kamar)\n {\n return ($user->poli != null) && ($user->poli->id_poli == $kamar->ruang->gedung->id_poli);\n }", "public function restore(User $user, Member $member)\n {\n return $user->hasCapability('members::account::create');\n }", "public function restore(User $user, Echelonmap $echelonmap)\n {\n return $user->hasPermission('restore-reference-echelonmap');\n }", "public function restore(User $user, Company $company)\n {\n // a user that is referrenced in the company table by id is an admin and can restore that record\n $role = Role::find($user->role_id);\n if($role->name == 'Admin') {\n return $user->id === $company->user_id;\n }\n }", "public function restore(User $user, Audit $audit)\n {\n return ($user->isSystemAdmin() && $audit->activity == \"deleted\");\n }", "public function restore(User $user, Customer $customer)\n {\n return $user->client_id === $customer->client_id;\n }", "public function restore(User $user, Reply $reply)\n {\n return false;\n }", "public function restore(User $user, SurveySent $surveySent)\n {\n return $this->isAllowed($user, 'survey_sent', 'can_edit');\n }", "public function restore(User $user, Section $section)\n {\n return $user->hasPermission('restore-reference-section');\n }", "public function restore(User $user, GradeClass $gradeClass)\n {\n return false;\n }", "public function restore(User $user, BoulderProblem $boulderProblem)\n {\n return $boulderProblem->creator === $user || $user->admin;\n }", "public function restore(User $user, Body $body)\n {\n return false;\n }", "public function restore(User $user, Product $product)\n {\n return $user->client_id === $product->client_id;\n }", "public function getRestore(){\n\t\treturn $this->restore;\n\t}", "public function restore(User $user, Quotation $quotation)\n {\n return $user->hasRole('Admin');\n }", "public function restore(AuthenticatedUser $authenticatedUser, OrderType $orderType)\n {\n\n return true;\n }", "public function restorePost(User $user)\n {\n return $user->can('forum-moderate-junked-post') ? true : false;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_kst/ifeedback');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Pronko_TaskManagement::TaskManagement_save');\n }", "public function can_read($model)\n {\n return true;\n }", "protected function _isAllowed() {\r\n return Mage::getSingleton('admin/session')->isAllowed('sales/bookme/reseauchx_reservationreseau/siege');\r\n }", "public function restoring($model)\n\t{\n\t}", "public function restore(User $user, ProductCategory $productCategory)\n {\n if ($user->hasPermissionTo('delete crm product categories')) {\n return true;\n }\n }", "public function restoreAction() {\r\n\t\t$request = reqEbbs::get('post');\r\n\t\t$response = new responseEbbs();\r\n\t\t$filename = $request['filename'];\r\n\t\t$model = $this->getModel();\r\n\r\n // This block for pro-version module 'scrambler'\r\n $needKeyToDecryptDB = dispatcherEbbs::applyFilters('checkIsNeedSecretKeyToEncryptedDB', false, $filename, $request);\r\n if($needKeyToDecryptDB){\r\n $response->addData(array('need' => 'secretKey'));\r\n return $response->ajaxExec();\r\n }\r\n\r\n\t\t$result = $model->restore($filename);\r\n\r\n\t\tif (false === $result) {\r\n $errors = array_merge($model->getDatabase()->getErrors(), $model->getFilesystem()->getErrors());\r\n if (empty($errors)) {\r\n $errors = __('Unable to restore from ' . $filename, EBBS_LANG_CODE);\r\n }\r\n\t\t\t$response->addError($errors);\r\n\t\t}\r\n elseif(is_array($result) && array_key_exists('error', $result)) {\r\n $response->addError($result['error']);\r\n }\r\n elseif(is_array($result) && !empty($result)) {\r\n $content = __('Unable to restore backup files. Check folder or files writing permissions. Try to set 766 permissions to the:', EBBS_LANG_CODE) . ' <br>'. implode('<br>', $result);\r\n $response->addError($content);\r\n }\r\n\t\telse {\r\n\t\t\t$response->addData($result);\r\n\t\t\t$response->addMessage(__('Done!', EBBS_LANG_CODE));\r\n\t\t}\r\n\r\n $response->addData(array('result' => $result));\r\n return $response->ajaxExec();\r\n\t}", "public function canSave()\n {\n return $this->save;\n }", "public function restore(User $user, Student $student)\n {\n if($user->hasRole(\"admin\")){\n return Response::allow();\n }\n return Response::deny(__('message.UnauthorizedRestoreStd'),401);\n }", "public function restore(User $user, Vacancy $vacancy)\n {\n if ($user->role === User::ROLE_ADMIN) {\n return true;\n }\n }", "public function _isAllowed()\n {\n return $this->_authorization->isAllowed('Aitoc_OrdersExportImport::save');\n }", "public function restore(User $user, Admin $admin)\n {\n return $user->isAdmin() && $this->trashed($admin);\n }", "public function can_activate(): bool;", "public function restore(User $user, Facility $facility)\n {\n return \\Auth::guard('admin')->check();\n }" ]
[ "0.8035043", "0.73696864", "0.7163435", "0.6989848", "0.6810561", "0.6790965", "0.67768496", "0.6649942", "0.6633892", "0.65875465", "0.6574493", "0.6452826", "0.64325875", "0.6387501", "0.6362594", "0.6316961", "0.6275875", "0.6255632", "0.6227469", "0.6227429", "0.62272346", "0.61972684", "0.61901176", "0.61654085", "0.61521137", "0.61455566", "0.61266047", "0.6120271", "0.60603935", "0.6051968", "0.6044957", "0.6040067", "0.6017047", "0.59543705", "0.5916951", "0.5911698", "0.5883185", "0.5874022", "0.58579624", "0.5856465", "0.5853328", "0.5851311", "0.5835805", "0.58339405", "0.582472", "0.5809185", "0.5798761", "0.5781083", "0.5764896", "0.575952", "0.5753306", "0.5750995", "0.5731416", "0.5720899", "0.57147884", "0.57147884", "0.57043016", "0.5703102", "0.5694261", "0.56532204", "0.56487423", "0.562155", "0.5620978", "0.5613106", "0.5537244", "0.5536514", "0.5520383", "0.55180603", "0.55153394", "0.5513944", "0.5496509", "0.546425", "0.5458049", "0.5428511", "0.54237324", "0.5423346", "0.5414209", "0.540623", "0.5404185", "0.538837", "0.5349961", "0.5344254", "0.53267753", "0.53234273", "0.53225696", "0.53051776", "0.52990407", "0.5295078", "0.5288716", "0.5270995", "0.52652013", "0.52628607", "0.52347517", "0.5229585", "0.52267236", "0.5222231", "0.5213218", "0.5207455", "0.5203886", "0.5191965", "0.5191891" ]
0.0
-1
Determine whether the user can permanently delete the model.
public function forceDelete(User $user, Paciente $paciente) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "function canDelete() {\n return true;\n }", "public function canDelete()\n {\n return 1;\n }", "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "public function canDelete()\n {\n return $this->canGet();\n }", "function canDelete(User $user) {\n return $user->canManageTrash();\n }", "public function delete($user, $model)\n {\n if( $user->hasPermissionTo('delete ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }", "function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }", "public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }", "public function forceDelete($user, $model)\n {\n if( $user->hasPermissionTo('forceDelete ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function canDelete()\n {\n return in_array('delete', $this->actions);\n }", "public function forceDelete(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:forceDelete')\n );\n }", "public function authorize()\n {\n return $this->can('delete');\n }", "function canDelete(User $user) {\n return $user->isFinancialManager();\n }", "public function allowDeletion()\n {\n return $this->allowDeletion;\n }", "public function deleting(User $model)\n {\n return ($model->id !== \\Auth::user()->id);\n }", "public function delete(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:delete')\n );\n }", "protected function canDelete($record) { return false; }", "function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}", "protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }", "public function getCanDeleteAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }", "public function isDeleteGranted($entity): bool;", "public function delete(User $user, $model)\n {\n return $user->hasPermission('delete_settings');\n }", "protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }", "public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function forceDelete(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.forceDelete']);\n\n }", "public function isDeletable(\\Illuminate\\Database\\Eloquent\\Model $model)\n {\n// else return false;\n return true;\n }", "public function isDeleteable()\n {\n return $this->_isDeleteable;\n }", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }", "public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }", "private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function delete(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.delete']);\n\n }", "function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "public function isDelete();", "public function forceDelete(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-edit','user-forceDelete'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "public function delete($model)\n\t{\n\t\treturn ($model->delete()) ? true : false;\n\t}", "public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }", "protected function canDelete($record)\n {\n return true;\n }", "public function delete(Authenticatable $user, Model $model)\n {\n return $user->id === $model->user_id;\n }", "public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }", "public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }", "function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public function delete(Model $model): ?bool;", "public function delete(User $user, User $model)\n {\n $userAbility =\n auth()->user()->can(['user-delete','user-manage'])&&\n auth()->user()->cannot(['user-manageBan']);\n\n return $userAbility;\n }", "public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "public function isDelete(): bool {}", "public function canDelete($item)\n {\n return false;\n }", "public function canDelete($item)\n {\n return false;\n }", "public function authorizedToDelete(Request $request)\n {\n return false;\n }", "public function flagDelete()\n {\n if(!$this->getId()) {\n return false;\n }\n \n if(!$this->setProperty('delete', true)->save()) {\n return false;\n }\n \n return $this->apply();\n }", "public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }", "public function sure_delete_local(){\r\n\t\tif($this->has_admin_panel()) return $this->module_sure_delete_local();\r\n return $this->module_no_permission();\r\n\t}", "function delete() {\n\t\tif ( $this->getID() > 0 ) {\n\t\t\t$this->setActive(self::PROFILE_DISABLED);\n\t\t\treturn $this->save();\n\t\t}\n\t\treturn false;\n\t}", "public function delete(): bool\n {\n\n return false;\n }", "function userCanDeleteInterim( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 8;\r\n\t}", "public function delete() {\n return true;\n }", "public function canDelete()\n {\n if ( null === $this->_canDelete )\n {\n $model = new Application_Model_AudioJobMapper();\n $results = $model->fetchAll( 'service_id = ' . $this->id );\n $this->_canDelete = !(bool) count( $results );\n }\n return $this->_canDelete;\n }", "public function delete() {\n $stmt = $this->pro->prepare('delete from user where id = :id');\n $stmt->bindValue(':id', $this->id);\n return $stmt->execute() == 1;\n }", "public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }", "public function deleteByModel(Model $model): bool;", "public function delete(): bool\n {\n return $this->actionHandler->delete();\n }", "public function isDeleteResource();", "public function forceDelete(User $user, User $model)\n {\n return $user->hasPermissionTo('benutzer-bearbeiten');\n }", "abstract function allowDeleteAction();", "private function can_remove() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'remove' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function deleteAdmin() {\n\t\t$numRows = $this->db->delete();\n\t\tif($numRows===1) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function delete(User $user, User $model)\n {\n return false;\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t return Factory::getUser()->authorise(\n\t\t\t\t\"core.delete\",\n\t\t\t\t\"com_dinning_philosophers.dinning_philosophers.\".$record->id\n\t\t\t);\n\t\t}\n\t}", "protected function canDelete()\n {\n if (!Validate::isLoadedObject($this)) {\n return true;\n }\n\n /** @var Gamifications $module */\n $module = Module::getInstanceByName('gamifications');\n $em = $module->getEntityManager();\n\n /** @var GamificationsRewardRepository $rewardRepository */\n $rewardRepository = $em->getRepository(__CLASS__);\n $isInUse = $rewardRepository->isRewardInUse($this->id);\n\n return !$isInUse;\n }", "public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }", "public function delete(User $user)\n {\n return $user->can('delete_customer');\n }", "public function delete(User $user, User $model)\n {\n if ($model->hasRole(AuthServiceProvider::SUPER)) return false;\n if ($user->hasRole(AuthServiceProvider::ADMIN) || $user->hasPermissionTo('benutzer-bearbeiten')) {\n foreach ($model->homeCities as $city) {\n if ($city->administeredBy($user)) return true;\n }\n }\n return false;\n }", "public function delete(User $user, Sale $model)\n {\n return $user->hasPermissionTo('delete sales');\n }", "public function delete(User $user)\n {\n return $user->hasPermission('user-delete');\n }", "public function delete(CharacterModel $characterModel){\n return ($this->valid() && $this->hasAccess($characterModel)) ? $this->erase() : false;\n }", "function canTrash(User $user) {\n if ($this->object->getState() == STATE_TRASHED) {\n return false;\n } // if\n\n\t $user_id = $user->getId();\n\n\t if(!array_key_exists($user_id, $this->can_delete)) {\n\t\t if($this->object->isOwner() || $user->getCompanyId() == $this->object->getId()) {\n\t\t\t $this->can_delete[$user_id] = false;\n\t\t } else {\n\t\t\t $has_last_admin = false;\n\n\t\t\t $users = $this->object->users()->get($user);\n\t\t\t if(is_foreachable($users)) {\n\t\t\t\t foreach($users as $v) {\n\t\t\t\t\t if($v->isLastAdministrator()) {\n\t\t\t\t\t\t $this->can_delete[$user_id] = false;\n\n\t\t\t\t\t\t $has_last_admin = true;\n\t\t\t\t\t\t break;\n\t\t\t\t\t } // if\n\t\t\t\t } // foreach\n\t\t\t } // if\n\n\t\t\t if(!$has_last_admin) {\n\t\t\t\t $this->can_delete[$user_id] = $user->isPeopleManager();\n\t\t\t } // if\n\t\t } // if\n\t } // if\n\n\t return $this->can_delete[$user_id];\n }", "public function canDeleteAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && $this->auth->isSuperAdmin();\n }", "public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }", "public function delete(User $user, Llamado $model)\n {\n return $user->hasPermissionTo('delete llamados');\n }", "public function softDelete(): bool\n {\n $this->active = false;\n\n return $this->save();\n }", "public function delete(SettingModel $settingModel): bool;", "protected function isDeleting()\n {\n return $this->option('delete') == 'true';\n }", "protected function beforeDelete()\n\t{\n\t\tif(parent::beforeDelete()){\n\t\t\t$avaiable = $this->chkAvaiableDelete($this->id);\n\t\t\tif($avaiable!=''){\n\t\t\t\techo $avaiable;\n\t\t\t\treturn false;\n\t\t\t}else\n\t\t\t\treturn true;\n\t\t}else \n\t\t\treturn false;\n\t}", "public function deleted(User $model)\n {\n // If the User is deleted, delete your image\n \\File::delete(base_path($model->img_url));\n return true;\n }", "public function forceDelete(User $user, Sale $model)\n {\n return false;\n }", "public function forceDelete(User $user, $model)\n {\n return false;\n }", "public function delete(User $user)\n {\n if($user->can('carts-delete') || $user->can('cart-delete')) {\n return true;\n }\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }", "public function canDelete()\n {\n $translate = $this->getTranslate();\n\n if ($this->_usedInSales()) {\n return $translate->_('This store location cannot be removed because it is used in an invoice.');\n }\n\n return true;\n }", "public function isDelete() {\n if($this->method === 'DELETE') {\n return true;\n } else {\n return false;\n }\n }", "protected function CanDelete(Site $site)\n {\n return self::Guard()->Allow(BackendAction::Delete(), $site);\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}", "public function forceDelete(User $user, Llamado $model)\n {\n return false;\n }", "public function delete(User $user): bool\n {\n return $user->can('Delete Role');\n }", "private function isSoftDeleted(): bool\n {\n return $this->resource::softDeletes() && $this->model->trashed();\n }" ]
[ "0.7541273", "0.7426929", "0.7391456", "0.7386837", "0.73789275", "0.7325759", "0.72253746", "0.71528107", "0.7121572", "0.71149886", "0.7112128", "0.70739293", "0.7054756", "0.70251435", "0.70234054", "0.7015319", "0.69836354", "0.69265026", "0.6918295", "0.6872948", "0.68532634", "0.68486744", "0.6839044", "0.6836644", "0.6835936", "0.67655617", "0.6738511", "0.6736714", "0.673335", "0.67142886", "0.6678808", "0.66573954", "0.66561687", "0.66501606", "0.6624466", "0.66175866", "0.6616929", "0.6594799", "0.65904695", "0.65778744", "0.6560071", "0.6556229", "0.6554502", "0.6545824", "0.6527399", "0.6524297", "0.65155464", "0.65153813", "0.6510939", "0.65099996", "0.6501994", "0.65010226", "0.65010226", "0.64851606", "0.64762664", "0.6470507", "0.64198977", "0.6396437", "0.6382079", "0.6379555", "0.6351011", "0.6348771", "0.63396066", "0.6339187", "0.63338494", "0.63270265", "0.63264465", "0.63214093", "0.6320525", "0.6311575", "0.62980765", "0.62851", "0.6280828", "0.6276192", "0.6274818", "0.62660944", "0.6262662", "0.62605405", "0.6259458", "0.62593156", "0.6248871", "0.62420994", "0.62416285", "0.62331843", "0.6232273", "0.62225085", "0.62205225", "0.621768", "0.6212497", "0.6196737", "0.6190594", "0.6189865", "0.61885697", "0.61883426", "0.6179129", "0.61755425", "0.61753446", "0.61682045", "0.6154868", "0.61449105", "0.6138751" ]
0.0
-1
A basic test example.
public function testLoginUser() { $this->artisan('db:seed'); $this->visit('/login') ->type('[email protected]', 'email') ->type('123456', 'password') ->press('Login') ->seePageIs('/home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('TROLOLOLO');\n }", "public function testBasicTest()\n {\n\n }", "public function testExample()\n {\n dump(\"testExample\");\n $this->assertTrue(true);\n }", "public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public function test() {\n\n\t}", "public static function test() {\r\n echo 'this is a test';\r\n }", "public function testExample()\n {\n $this->assertTrue(true);\n \n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n // lets make it risky to destroy the green\n }", "public function testBasicExample()\n\t{\n \t$response = $this->call('GET', '/');\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testExample()\n {\n $this->visit('ticket')\n ->see('Listado de Tickets')\n ->seeLink('Ver Ticket') \n ->visit('ticket/1')\n ->see('Quod et autem sed')\n ->seeLink('Ver todos los tickets')\n ->click('Ver todos los tickets')\n ->see('Listado de Tickets')\n ->seeLink('Agregar un ticket', 'ticket/crear');\n }", "function test_sample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login to Airtel Sales Force System');\n });\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('API tester');\n }", "public function testExample()\n {\n $response = $this->get('/api/test/');\n\n $response->assertStatus(200);\n }", "public function testBasicExample()\n\t{\n\t\t$response = $this->call('GET', '/');\n\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('URL Notes');\n }", "public function testBasicTest()\n {\n $response = $this->get('/test');\n\n $response->assertStatus(200);\n\n $response->assertSeeText('小粽子');\n\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function testBasic()\n {\n $this->assertEquals(1, 1);\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/news/create')\n ->type('title', '123')\n ->type('text', 'test123')\n ->press('Добавить новость')\n\n ->assertSee('Мало букв в поле Заголовок');\n });\n }", "public function testBasicTest()\n {\n $response = $this->get('/dangthi');\n $response->assertStatus(200);\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('html');\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visitRoute('subscription', ['id' => '1'])\n ->radio('gender', 'L')\n ->type('fullName', 'GHF')\n ->type('birthdate', '04/24/1999')\n ->type('phone', '088177552')\n ->type('address', 'Bandung')\n ->press('Submit');\n });\n }", "public function testExample(): void\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->browse(function ($browser , $second) {\n $browser->visit('/')\n //->assertVueContains('name','sina','@editor');\n ->assertVue('name','sina','@editor');\n // ->pause(3000)\n // ->click('.test');\n // ->assertSee('Register')\n // ->value('#name' , 'sina')\n // ->value('#email' , Str::random(10).'@gmail.com')\n // ->value('#password' , '123456789')\n // ->value('#password-confirm' , '123456789')\n // ->click('button[type=\"submit\"]')\n // ->assertPathIs('/home')\n // ->refresh()\n // ->script('alert(\"ok\")');\n });\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->with('.special-text', function ($text) {\n $text->assertSee('title1');\n });\n\n // 確認商品數量\n $browser->click('.check_product')\n ->waitForDialog(5)\n ->assertDialogOpened('商品數量充足')\n ->acceptDialog();\n\n // 設定中斷點\n eval(\\Psy\\sh());\n });\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(\"[email protected]\")\n ->visit(\"/home\");\n });\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('React JS examples');\n });\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Laravel');\n });\n }", "public function testBasicExample()\n {\n $response = $this->call('GET', '/');\n\n $this->assertResponseOk();\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->visit('/')\n ->see('WELCOME');\n }" ]
[ "0.7977854", "0.77753335", "0.76435244", "0.7610687", "0.754975", "0.75405073", "0.75393844", "0.74867696", "0.74400353", "0.7432722", "0.7412231", "0.73547494", "0.73383486", "0.7337478", "0.7308627", "0.7305436", "0.72681046", "0.7260569", "0.72460294", "0.7215908", "0.71952444", "0.7174572", "0.71719897", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7171955", "0.7167066", "0.715222", "0.7132968", "0.7123071", "0.7119535", "0.7109628", "0.70886546", "0.70870566", "0.70733815", "0.7068619", "0.7050562", "0.7045842", "0.7031207", "0.7030824", "0.7030337", "0.70302093", "0.70302093", "0.70302093", "0.70302093", "0.70291555" ]
0.0
-1
Creates a form to delete a GrabData entity.
private function createDeleteForm(GrabRule $grabDatum) { return $this->createFormBuilder() ->setAction($this->generateUrl('admin_sa_grab-data_delete', array('id' => $grabDatum->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteForm()\n\t{\n\t\t$form = new \\IPS\\Helpers\\Form( 'form', 'delete' );\n\t\t$form->addMessage( 'node_delete_blurb_no_content' );\n\t\t\n\t\treturn $form;\n\t}", "private function createDeleteForm ( Maileguak $maileguak )\n {\n return $this->createFormBuilder()\n ->setAction( $this->generateUrl( 'maileguak_delete', array ('id' => $maileguak->getId()) ) )\n ->setMethod( 'DELETE' )\n ->getForm();\n }", "private function createDeleteForm(NatureOp $priorite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_natureop_delete', array('id' => $priorite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Indicateur $indicateur) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('indicateur_delete', array('id' => $indicateur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "function observation_delete_form($form, &$form_state, $observationdata = NULL) {\n\tassert(!empty($observationdata));\n\tdrupal_set_title(\n\t\tt(\n\t\t\t'Delete Observation @observation_organism from @observation_date.',\n\t\t\tarray('@observation_organism' => $observationdata['organism']['name_lang'] . '('\n\t\t\t\t\t\t\t. $observationdata['organism']['name_lat'] . ')',\n\t\t\t\t\t'@observation_date' => date('d.m.Y', $observationdata['observation']['date'])\n\t\t\t)));\n\n\t$question = t(\n\t\t'Are you sure that you want to delete this observation «@observation_organism»?',\n\t\tarray('@observation_organism' => $observationdata['organism']['name_lang'] . '('\n\t\t\t\t\t\t. $observationdata['organism']['name_lat'] . ')'\n\t\t));\n\t/* create a fieldset for the tabular data */\n\t$form['question'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => \"<p>$question</p>\"\n\t);\n\n\t$form['button'] = array(\n\t\t\t'#type' => 'submit',\n\t\t\t'#value' => t('Delete')\n\t);\n\treturn $form;\n}", "private function createDeleteForm(Phoneboook $phoneboook)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('phoneboook_delete', array('id' => $phoneboook->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}", "public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(voyageur $voyageur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('voyageur_delete', array('id' => $voyageur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Claim $claim)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('claim_delete', array('id' => $claim->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Proeflessen $proeflessen)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_proeflessen_delete', array('id' => $proeflessen->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new DeleteForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Delete an item\",\n ]);\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm($id) {\n $session = $this->get(\"session\");\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('hall_delete', array('id' => $id, )))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Personnage $personnage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnage_delete', array('id' => $personnage->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('behalf_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(NomDpa $nomdpa)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dpa_delete', array('id' => $nomdpa->getIddpa())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_missatges_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Annonce_appart $annonce_appart) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annonce_appart_delete', array('id' => $annonce_appart->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Hogar $hogar)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('hogar_delete', array('id' => $hogar->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(DatParteDesvio $datParteDesvio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partedesvio_delete', array('id' => $datParteDesvio->getIdparte())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder(null, array('attr' => array( 'id' => 'pts_del')))\n ->setAction($this->generateUrl('morus_accetic_inventory_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $this->get('translator')->trans('btn.delete')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detailsproduits_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "function vu_core_hubspot_map_delete_form($form, &$form_state) {\n $form['webform_field_name'] = [\n '#type' => 'textfield',\n '#title' => t('What is the webform field you want to delete?'),\n '#required' => TRUE,\n '#size' => 100,\n '#maxlength' => 100,\n ];\n\n $form['submit'] = [\n '#type' => 'submit',\n '#value' => t('Delete'),\n '#attributes' => ['onclick' => 'if(!confirm(\"Are you sure you want to delete this field?\")){return false;}'],\n ];\n\n $form['cancel'] = [\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => ['vu_core_hubspot_map_add_form_cancel'],\n '#limit_validation_errors' => [],\n ];\n\n return $form;\n}", "abstract function performDelete(Form $arg0);", "private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('picture_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('object_objecttype_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Удалить'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Plateformes $plateforme)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administration_plateformes_delete', array('id' => $plateforme->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "public function deleteFormAction($id) {\n $form = $this->createDeleteForm($id);\n $entity = $this->getItem($id);\n\n return array(\n 'form' => $form->createView(),\n 'order' => $this->getOrder(),\n 'entity' => $this->getOrder()\n );\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Facture $facture)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('facture_delete', array('id' => $facture->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger'),))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('client_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('crud_spendings_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('medicamentossuministrados_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'btn')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Beer $beer)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('beer_delete', array('id' => $beer->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Releve $releve)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('releve_delete', array('id' => $releve->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(LandingPage $landingPage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('landingPageDelete', array('id' => $landingPage->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(PhpposPeople $phpposPerson)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('phppospeople_delete', array('id' => $phpposPerson->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(frontend_about $frontend_about)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frontend_about_delete', array('id' => $frontend_about->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('localbanner_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'title.sim', 'translation_domain' => 'messagesCommonBundle', 'attr' => array('class' => 'btn btn-success btn-lg bt-delete-foto')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('picfooter_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('envase_ingreso_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('image_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "function thumbwhere_contentcollection_delete_form_wrapper($thumbwhere_contentcollection) {\n // Add the breadcrumb for the form's location.\n //thumbwhere_contentcollection_set_breadcrumb();\n return drupal_get_form('thumbwhere_contentcollection_delete_form', $thumbwhere_contentcollection);\n}", "private function genDeleteForm($id)\n {\n return $this->createFormBuilder(null, array('attr' => array( 'id' => 'ct_del_form', 'style' => 'display:none')))\n ->setAction($this->generateUrl('morus_fas_contacts_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $this->get('translator')->trans('btn.delete')))\n ->getForm();\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ProgramKsztalcenia $programKsztalcenium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('programksztalcenia_delete', array('id' => $programKsztalcenium->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder(array('id' => $id))\n ->add('id', 'hidden')\n ->setAction($this->generateUrl('chofer_destroy', ['id' => $id]))\n ->getForm()\n ;\n }", "private function createDeleteForm(SvCfgDisenio $SvCfgDisenio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Svcfgdisenio_delete', array('id' => $SvCfgDisenio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(CargoSubDivisao $vaga)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pessoal_gerenciar_vagas_delete', array('id' => $vaga->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bill_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n { \n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aulas_aula_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('whitelist_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('config_testimonial_delete', array('id' => $id)))\n ->setAttribute('enctype', 'multipart/form-data')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frontbottom_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "function thumbwhere_contentcollection_delete_form($form, &$form_state, $thumbwhere_contentcollection) {\n $form_state['thumbwhere_contentcollection'] = $thumbwhere_contentcollection;\n\n $form['#submit'][] = 'thumbwhere_contentcollection_delete_form_submit';\n\n $form = confirm_form($form,\n t('Are you sure you want to delete thumbwhere_contentcollection %name?', array('%name' => $thumbwhere_contentcollection->title)),\n 'admin/thumbwhere/thumbwhere_contentcollections/thumbwhere_contentcollection',\n '<p>' . t('This action cannot be undone.') . '</p>',\n t('Delete'),\n t('Cancel'),\n 'confirm'\n );\n\n return $form;\n}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('com_incident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array('class'=>'btn btn-danger','style'=>'width:100px;')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Babysitter $babysitter)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('babysitter_delete', array('idbabysitter' => $babysitter->getIdbabysitter())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Record $record)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eval_record_delete', array('id' => $record->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Visita $visitum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('visita_delete', array('id' => $visitum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Reglement $reglement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('reglement_delete', array('codeRegl' => $reglement->getCoderegl())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Tblyear $tblyear)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tblyear_delete', array('id' => $tblyear->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Barbeiro $barbeiro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('barbeiro_delete', array('id' => $barbeiro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('resident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('galerias_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Feature $feature)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('searchEngine_feature_delete', array('id' => $feature->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function delete(DataObject $entity){\n }", "private function createDeleteForm(Psycho $psycho)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('psycho_delete', array('id' => $psycho->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dzialy_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Usuń Dział' , 'attr' => array('class' => 'btn btn-danger' , 'icon' => 'times fa-fw')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Wino $wino)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('wino_delete', array('id' => $wino->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n // $this->enforceUserSecurity('ROLE_USER');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('slug' => $event->getSlug())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dreams_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr'=>array('class'=>'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Instrumentation $instrumentation)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('instrumentation_delete', array('code' => $instrumentation->getCode())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('social_admin_resource_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => '删除','attr'=>[\n 'class'=>'btn btn-danger'\n ]))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fluidite_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array(\n 'label' => 'Delete',\n 'attr' => array(\n 'class' => 'btn btn-danger'\n ))\n \n )\n \n \n ->getForm()\n ;\n }", "private function createDeleteForm(Demandados $demandado)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('demandados_delete', array('id' => $demandado->getIdDemandado())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('data_recipe_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clientecredito_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('grupos_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Historique $historique)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('historique_delete', array('id' => $historique->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_consulta_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "function travel_delete_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Show confirm dialog.\n $entity_uri = entity_uri('travel', $entity);\n $message = t('Are you sure you want to delete entity %title?', array('%title' => entity_label('travel', $entity)));\n return confirm_form(\n $form,\n $message,\n $entity_uri['path'],\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('endroit_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(AskInfo $askInfo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('askinfo_delete', array('id' => $askInfo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder(array('id' => $id))\r\n ->add('id', 'hidden')\r\n ->getForm()\r\n ;\r\n }", "public function save_trash_delete_form() {\n global $wpdb;\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-form-builder' !== $_GET['page'])\n return;\n\n if ('delete_form' !== $_REQUEST['action'])\n return;\n\n $id = absint($_REQUEST['form']);\n\n check_admin_referer('delete-form-' . $id);\n\n // Delete form and all fields\n $wpdb->query($wpdb->prepare(\"DELETE FROM $this->form_table_name WHERE form_id = %d\", $id));\n $wpdb->query($wpdb->prepare(\"DELETE FROM $this->field_table_name WHERE form_id = %d\", $id));\n\n // Redirect to keep the URL clean (use AJAX in the future?)\n wp_redirect(add_query_arg('action', 'deleted', 'admin.php?page=swpm-form-builder'));\n exit();\n }", "private function createDeleteForm(Acte $acte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acte_delete', array('id' => $acte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('klasses_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_partners_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array(\n 'label' => 'Supprimer',\n 'attr' => array(\n 'class' => 'btn btn-danger'\n )))\n ->getForm();\n }", "function dataform_grade_item_delete($data) {\n global $CFG;\n require_once(\"$CFG->libdir/gradelib.php\");\n\n return grade_update('mod/dataform', $data->course, 'mod', 'dataform', $data->id, 0, NULL, array('deleted'=>1));\n}", "private function createDeleteForm(Orden $orden)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('orden_delete', array('id' => $orden->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fileops_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('entreprise_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('userman_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }" ]
[ "0.6796001", "0.6518372", "0.64857924", "0.6419978", "0.64066726", "0.637552", "0.6363311", "0.6347952", "0.6329355", "0.6320336", "0.6317296", "0.6304899", "0.6270608", "0.6239076", "0.6237239", "0.6220017", "0.6208971", "0.6202587", "0.6201817", "0.6193901", "0.61895883", "0.617599", "0.61710703", "0.6170675", "0.6155254", "0.6153612", "0.615243", "0.6146159", "0.6143841", "0.613673", "0.6133634", "0.61261594", "0.61240417", "0.6121247", "0.6121196", "0.61161816", "0.61152506", "0.6111238", "0.610376", "0.61010486", "0.6100548", "0.60991657", "0.6093242", "0.6078033", "0.60749596", "0.6071115", "0.60676277", "0.6059659", "0.6059596", "0.6057706", "0.6051359", "0.6048221", "0.6047978", "0.60473174", "0.6046117", "0.60443807", "0.6043937", "0.6038861", "0.6037563", "0.6031145", "0.6028666", "0.60277265", "0.6025536", "0.6020106", "0.6019891", "0.60193115", "0.6018852", "0.6018812", "0.6018532", "0.60182154", "0.60177743", "0.6014662", "0.60118455", "0.6007192", "0.60013413", "0.6000263", "0.59982115", "0.5995739", "0.59951884", "0.59949815", "0.5989464", "0.59884155", "0.59873563", "0.59858847", "0.598509", "0.5983285", "0.59832025", "0.5981832", "0.598149", "0.59812266", "0.5973679", "0.5971205", "0.5970167", "0.5968062", "0.5968039", "0.5966319", "0.59640384", "0.5963969", "0.59638304", "0.5958973" ]
0.7199301
0
Run the database seeds.
public function run() { DB::table('pets')->insert([ 'name' => "Lolo", //Cambiar id en caso de error 'species' => "dog", 'race' => "Labrador", 'owner_id' => "3", 'sex' => "masculine", 'age' => "5", 'commentary' => "Es muy lindo", 'personality' => "calm", 'size' => "tiny", ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Display a single summary
function cbDisplaySummary($number) { global $EDIT_SUMMARY_URL; cbTrace("DISPLAYING " . $number); $heftRow = cbFindHeftRow($number) or cbTrace(mysql_error()); $numRows = mysql_numrows($heftRow); $title = mysql_result($heftRow, 0, "title"); $author = mysql_result($heftRow, 0, "author"); $summaryRow = cbFindSummaryRow($number); $summaryCount = mysql_numrows($summaryRow); $url = sprintf("http://perry-kotlin.app.heroku/api/covers/%d", $number); $date = null; if ($summaryCount > 0) { $summary = mysql_result($summaryRow, 0, "summary"); $englishTitle = mysql_result($summaryRow, 0, "english_title"); $date = mysql_result($summaryRow, 0, "date"); $authorName = mysql_result($summaryRow, 0, "author_name"); if ($date == null) $date = ''; } cbGenHtml($number, $title, $englishTitle, $author, $summary, $summaryCount, $url, $authorName, $date); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_summary() {\n // FIXME\n }", "public function summary();", "public function getSummary();", "public function getSummary(): string;", "function get_summary() {\n return $this->summary;\n }", "public function getSummary(): string\n {\n return $this->summary;\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->get(self::_SUMMARY);\n }", "public function getSummary()\n {\n return $this->summary;\n }", "public function getSummary()\n {\n return $this->summary;\n }", "public function getSummary()\n {\n return $this->summary;\n }", "public function getSummary()\n\t{\n\t\treturn $this->summary;\n\t}", "public function getSummary() {\n return $this->summary;\n }", "public function getSummary() {\n\t\treturn $this->summary;\n\t}", "function summary() {\n return NULL;\n // return array(\n // 'summary' => 'This is a summary',\n // 'total' => 50.0,\n // );\n }", "function summary() {\n return NULL;\n // return array(\n // 'summary' => 'This is a summary',\n // 'total' => 50.0,\n // );\n }", "public function getSummary(): string {\n return $this->body['summary'] ?? \"none\";\n }", "public function okr_summary()\n\t{\n\t\tif ($this->session->userdata('status') !== 'admin_logged_in') {\n\t\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('OKR Summary', $this->session->userdata['type']);\n\n\n\t\t$data = [\n\t\t\t'member_dsc' => $this->M_memberDsc->get_all_member(),\n\t\t\t'usecase' => $this->M_otherDataAssignments->get_usecase(),\n\t\t\t'member_selected' => '',\n\t\t\t'usecase_selected' => '',\n\t\t\t'judul' => 'OKR Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoring_okr_summaryProduct',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => []\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "function getSummary() {\n\t\treturn $this->data_array['summary'];\n\t}", "public function displayFullSummary()\n {\n return true;\n }", "public function workload_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Usecase Summary', $this->session->userdata['type']);\n\n\t\t$data = [\n\t\t\t'countUsecase' => $this->M_workloadGraph->getCountUsecase(),\n\t\t\t'countMember' => $this->M_workloadGraph->getCountMember(),\n\t\t\t'graphNodes' => $this->M_workloadGraph->get_nodes(),\n\t\t\t'graphLinks' => $this->M_workloadGraph->get_links(),\n\t\t\t'judul' => 'Workload Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringWorkload',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['workloadSummary/workloadGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "public static function getName()\n {\n return 'summary';\n }", "public function summary()\n\t{\n\t\t$this->load->database();\n\t\t$this->load->model('class_session');\n\t\t$userId = $this->session->profileData['user_id'];\n\t\t$sessionId = $this->input->get('sessionId');\n\t\t$sessionDate = $this->input->get('sessionDate');\n\t\t$sessionResult = $this->class_session->getSessionSummaryDetails($sessionId, $sessionDate);\n\t\t\n\t\t$this->load->model('student');\n\t\t$studentData = $this->student->getAllStudentIndex($sessionId);\n\t\t\n\t\t$data = array(\n\t\t\t'sessionId' => $sessionId,\n\t\t\t'sessionResult' => $sessionResult,\n\t\t\t'studentData' => $studentData\n\t\t);\n\t\t$this->load->view('session/class_details', $data);\n\t\t\n\t}", "function getSummary(){\n\t\t$output=\"{$this->getTitle()} ({$this->getProducer()})\";\n\t\treturn $output;\n\t}", "public function summary($summary = null)\n {\n if(null === $summary)\n {\n return $this->child('summary');\n }\n return $this->child('summary', trim($summary));\n }", "function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}", "function printSummary () {\n foreach ($this->ids as $i) {\n $this->link[$i]->printSummary();\n }\n }", "public function actionPrintsummary() {\n $this->layout = \"@app/views/layouts/print\";\n\n $searchModel = new FilesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('printsummary', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function summaryAction()\n {\n // handle unfiltered collection\n $collection = $this->getCollection();\n return $this->toJson([\n 'numberOfTotalItems' => $collection->queryCount(),\n ]);\n }", "function summary() {\n return NULL;\n }", "public function showSummary()\n {\n if ( isset($_GET['order'])) {\n $this->sortBy = $_GET['order'];\n }\n\n if ( ! isset($this->result['data'])) {\n die(\"Impropper coverage report. Please regenerate\");\n }\n\n $coveredArray = $this->result[\"data\"];\n //lets sort it.\n uasort($coveredArray, array($this,\"sortArray\"));\n\n //and flip if it perhaps?\n if (isset($_GET[\"flip\"]) && $_GET[\"flip\"] == \"true\") {\n $coveredArray = array_reverse($coveredArray, true);\n }\n\n $totals = $this->result[\"totals\"];\n\n echo '<tr><td>TOTAL</td><td>' , \n $totals['percentage'] , '%</td><td>' , \n $totals['lines'] , '</td><td>' , \n $totals['covered'] , '</td><td>', \n $totals['maybe'] , '</td><td>',\n $totals['notcovered'] , '</td><td></tr>';\n\n foreach($coveredArray as $class => $info) {\n\n echo '<tr><td>';\n if ( $info['type'] == \"covered\") {\n echo '<a href=\"' , $class , '.html\">', $class , '</a>';\n }else{\n echo $class;\n }\n echo '<td>' . $info['percentage'] . ' % </td><td>' . $info['total'] . '</td><td>' . $info['covered'] . '</td><td>' . $info['maybe'] . '</td><td>' . $info['notcovered']. '</td></tr>';\n }\n }", "function echo_summary_view_for_contest($id) {\n $image = get_corresponding_header_icon_url_for_contest_functionid(get_functionid_for_contestid($id));\n echo \"<img class=\\\"summary\\\" src=\\\"$image\\\">\";\n if (contest_is_upcoming($id)) {\n echo return_upcoming_contest_info_for_id($id);\n } else if (contest_is_recent($id)) {\n echo return_recent_contest_info_for_id($id);\n } else {\n echo return_info_for_contest($id);\n echo return_summary_for_contestid($id);\n }\n}", "public function getSummaryData();", "public function getSelfSummary()\n {\n return $this->get(self::_SELF_SUMMARY);\n }", "public function getItemSummary() {\n $return = '';\n\n foreach($this->Items() as $item) {\n $return .= \"{$item->Quantity} x {$item->Title};\\n\";\n }\n\n return $return;\n }", "function renderFunctionSummary() {\n\n reset($this->accessModifiers);\n while (list($k, $access) = each($this->accessModifiers)) {\n if (0 == count($this->functions[$access])) \n continue;\n\n $this->tpl->setCurrentBlock(\"functionsummary_loop\");\n reset($this->functions[$access]);\n while (list($name, $function) = each($this->functions[$access])) {\n\n $this->tpl->setVariable(\"NAME\", $name);\n \n if (isset($function[\"doc\"][\"parameter\"]))\n $this->tpl->setVariable(\"PARAMETER\", $this->getParameter($function[\"doc\"][\"parameter\"]));\n\n if (isset($function[\"doc\"][\"shortdescription\"]))\n $this->tpl->setVariable(\"SHORTDESCRIPTION\", $this->encode($function[\"doc\"][\"shortdescription\"][\"value\"]));\n\n if (isset($function[\"doc\"][\"return\"]))\n $this->tpl->setVariable(\"RETURNTYPE\", $function[\"doc\"][\"return\"][\"type\"]);\n else\n $this->tpl->setVariable(\"RETURNTYPE\", \"void\");\n\n if (\"true\" == $function[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"functionsummary\"); \n $this->tpl->setVariable(\"ACCESS\", ucfirst($access) );\n $this->tpl->parseCurrentBlock();\n }\n\n }", "public function mortality_summary()\n {\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n $action = route('people_show');\n\n $data = compact('action');\n\n return view('hact.reports.mortality', $data);\n }", "public function summary() {\n\t\t$i = $this->count() === 1 ? 'item' : 'items';\n\t\treturn \"{$this->count()} $i in your cart.\";\n\t\t\n\t}", "public function get_summary(){\n\t\tglobal $CFG;\n\n\t\trequire_once $CFG->libdir . '/filelib.php';\n\t\trequire_once $CFG->libdir . '/weblib.php';\n\n\t\tif (strlen($this->_summary) < 1) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$context = context_course::instance($this->_courseid);\n\n\t\t$options = array(\n\t\t\t'para' => false,\n\t\t\t'newlines' => true,\n\t\t\t'overflowdiv' => false,\n\t\t);\n\n\t\t$summary = file_rewrite_pluginfile_urls($this->_summary, 'pluginfile.php', $context->id, 'course', 'summary', null);\n\t\treturn format_text($summary, $this->_summaryFormat, $options, $this->_courseid);\n\t}", "public function summary()\n {\n $this->arguments[] = '--summary';\n\n return $this;\n }", "public function setSummary($summary)\n {\n $this->summary = $summary;\n }", "public function summaryAction()\n {\n $reporter = $this->getDI()->get('reporter');\n\n $this->getOutput()->last_15_min_mo_count = $reporter->getLastMoCount(new DateTime('15 minutes ago'));\n $this->getOutput()->time_span_last_10k = $reporter->getTimeSpan(10000);\n return $this->initResponse();\n }", "public function summary($remote = false) {\n\t\treturn $this->cmd('summary')->remote($remote);\n\t}", "public function _summary() {\n $text = $this->_failed ? 'TESTS FAILED!' : 'TESTS PASSED';\n $result = $this->_colors->getColoredString($text, $this->_colorsPalete[!$this->_failed]);\n $this->_log($result);\n }", "public function getUserSummary()\n {\n return $this->get(self::_USER_SUMMARY);\n }", "public function getUserSummary()\n {\n return $this->get(self::_USER_SUMMARY);\n }", "public function getUserSummary()\n {\n return $this->get(self::_USER_SUMMARY);\n }", "public function getSummary(): ?string\n {\n return $this->summary;\n }", "protected function RenderSummary_HTML_line() {\n\t$out = \"\\n\"\n\t .$this->TitleHREF()\n\t .$this->CatNum()\n\t .' &ldquo;'\n\t .$this->NameString()\n\t .'&rdquo;</a>: '\n\t .$this->RenderStatus_HTML_line()\n\t .'<br>'\n\t ;\n\treturn $out;\n }", "function renderUsesSummary() {\n\n reset($this->usesTypes);\n while (list($k, $type) = each($this->usesTypes)) {\n if (0 == count($this->uses[$type]))\n continue;\n\n $this->tpl->setCurrentBlock(\"usessummary_loop\");\n\n reset($this->uses[$type]);\n while (list($file, $uses) = each($this->uses[$type])) {\n\n $this->tpl->setVariable(\"FILE\", $file);\n if (isset($uses[\"doc\"][\"shortdescription\"]))\n $this->tpl->setVariable(\"SHORTDESCRIPTION\", $this->encode($uses[\"doc\"][\"shortdescription\"][\"value\"]));\n\n if (\"true\" == $uses[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"usessummary\");\n $this->tpl->setVariable(\"TYPE\", $type);\n $this->tpl->parseCurrentBlock();\n }\n\n }", "public function setSummary(string $summary): void;", "public function apprentice_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Apprentice Summary', $this->session->userdata['type']);\n\t\t\n\t\t$data = [\n\t\t\t'total_internship' => $this->M_apprenticeGraph->get_total_internship(),\n\t\t\t'contract_expiredApprentice' => $this->M_apprenticeGraph->get_contract_expiredApprentice(),\n\t\t\t'graphAlumniInt' => $this->M_apprenticeGraph->getGraphMemberAlumniInt(),\n\t\t\t'internship_expired' => $this->M_apprenticeGraph->get_internship_expired(),\n\t\t\t'graphApprYear' => $this->M_apprenticeGraph->getGraphApprByYear(),\n\t\t\t'graphApprUniv' => $this->M_apprenticeGraph->getGraphApprByUniversity(),\n\t\t\t'graphApprSpv' => $this->M_apprenticeGraph->getGraphApprBySpv(),\n\t\t\t'judul' => 'Apprentice Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringApprentice',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['apprenticeSummary/apprenticeSummaryGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "public function setSummary($value)\n {\n return $this->set('Summary', $value);\n }", "public function getSummaryForDisplay()\n {\n if (is_string($this->_description)) {\n return $this->_description;\n }\n\n return $this->buildCommand();\n }", "public function view_summary(stdClass $submission, & $showviewlink) {\n global $DB;\n\n $showviewlink = true;\n\n $count = $DB->count_records(\n SKETCHFAB_DB_TABLE,\n array(\n 'assignment' => $this->assignment->get_instance()->id,\n 'submission' => $submission->id\n )\n );\n return get_string(\n $count == 1 ? 'countitem_single' : 'countitem_plural',\n 'assignsubmission_sketchfab',\n $count\n );\n }", "public function show($id)\n\t{\n\t\t$summary = Summary::findOrFail($id);\n\n\t\treturn View::make('summaries.show', compact('summary'));\n\t}", "public function getAnalysisSummary()\n\t {\n\t return $this->_analysisSummary;\n\t }", "public function summary()\n {\n # select table to count data\n $query = \"SELECT\n (SELECT COUNT(*) FROM news) as news,\n (SELECT COUNT(*) FROM accounts) as accounts,\n (SELECT COUNT(*) FROM blog) as blog,\n (SELECT COUNT(*) FROM contect WHERE seen = 0) as message,\n (SELECT COUNT(*) FROM newsletter) as newsletter,\n (SELECT COUNT(*) FROM newsletter WHERE subscribed) as subscribed_newsletter\n FROM DUAL\";\n # use fake table (use count table)\n return $this->db->query($query)->result_array()[0];\n }", "public function getSummary($id)\n {\n return isset($this->_view) ? $this->_view->getSummary($id) : null;\n }", "public function getSummaryCount()\n {\n return $this->count(self::_SUMMARY);\n }", "public function getSummaryCount()\n {\n return $this->count(self::_SUMMARY);\n }", "public function getSummaryCount()\n {\n return $this->count(self::_SUMMARY);\n }", "public function action_account_summary() {\n $package = Model::factory('package');\n $paid_amount = $package->total_paid_amount(); \n $this->template->title = CLOUD_SITENAME . ' | Account'; \n $this->template->page_title = __('account_info');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_summary\")\n ->bind('paid_amount', $paid_amount);\n }", "public function getSummaryInfo(){\n \n if (!$this->student) return false;\n \n $output = \"\";\n \n $output .= \"<table>\";\n \n // Target grade\n $output .= \"<tr>\";\n \n $output .= \"<td>\".get_string('mintargetgrades', 'block_bcgt').\"</td>\";\n $output .= \"<td>{$this->getUserGrades(\"target\")}</td>\";\n \n $output .= \"</tr>\";\n \n // Target grade\n $output .= \"<tr>\";\n \n $output .= \"<td>\".get_string('asptargetgrades', 'block_bcgt').\"</td>\";\n $output .= \"<td>{$this->getUserGrades(\"aspirational\")}</td>\";\n \n $output .= \"</tr>\";\n \n $output .= \"</table>\";\n \n return $output;\n \n }", "function string_summary()\n\t{\n\t\ttry{\n\t\t\tob_start();\n\t\t\tif(is_array($this->subtopics) && !empty($this->subtopics))\n\t\t\t{\n\t\t\t\t$subs = array_values($this->subtopics);\n\t\t\t\t$subsize = count($subs);\n\t\t\t\tforeach($subs AS $pos => $t)\n\t\t\t\t{\n\t\t\t\t\tprint(htmlentities($t->short_title!=''?$t->short_title:$t->title));\n\t\t\t\t\tif ($pos < ($subsize - 2)) print(', ');\n\t\t\t\t\telseif ($pos == ($subsize - 2)) print(' and ');\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ob_get_clean();\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\treturn '<p class=\"error\">Topic listing failed</p>';\n\t\t}\n\t}", "public function view_booking_summary()\n {\n // check logged in\n if ( ! $this->custLoggedIn() )\n $this->redirect(\"login.php?error=login_required\");\n \n require_once('models/Customer.class.php');\n require_once('views/BookingSummary.class.php'); \n \n $site = new SiteContainer($this->db);\n\n $customer = new Customer($_SESSION['email'], $this->get_db());\n \n $bs = new BookingSummary();\n\n $site->printHeader();\n $site->printNav(\"customer\");\n $bs->printHtml($customer);\n $site->printFooter(); \n }", "public function buildPaneSummary();", "public function getDescriptionSummary() {\n return truncateText(plaintext($this->description), 300);\n }", "public function supplier_sales_summary($supplier_id)\n\t{\t\n\t\t$content = $this->lsupplier->supplier_sales_summary($supplier_id);\n\t\t$this->supplier_id=$supplier_id;\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function getSummary()\n {\n return view('tox.dashboard.index')->withTitle('Dashboard');\n }", "public function shortUsage()\n {\n return $this->summary\n ->setDescription($this->description)\n ->setCommand($this->name)\n ->setFilter($this->filter, $this->all())\n ->summarize();\n }", "public function getSummaryBox(){\n \n $TPL = new \\ELBP\\Template();\n \n $TPL->set(\"obj\", $this);\n \n $quals = $this->getStudentsQualifications();\n $courses = $this->getStudentsCoursesWithoutQualifications();\n \n if ($quals)\n {\n foreach($quals as $qual)\n {\n $qual->aspirationalGrade = $this->getAspirationalTargetGrade($qual->get_id());\n $qual->targetGrade = $this->getTargetGrade($qual->get_id());\n if (is_array($qual->aspirationalGrade)) $qual->aspirationalGrade = reset($qual->aspirationalGrade);\n if (is_array($qual->targetGrade)) $qual->targetGrade = reset($qual->targetGrade);\n }\n }\n \n if ($courses)\n {\n foreach($courses as $course)\n {\n $course->aspirationalGrade = $this->getAspirationalTargetGradeCourse($course->id);\n $course->targetGrade = $this->getTargetGradeCourse($course->id);\n if (is_array($course->aspirationalGrade)) $course->aspirationalGrade = reset($course->aspirationalGrade);\n if (is_array($course->targetGrade)) $course->targetGrade = reset($course->targetGrade);\n }\n }\n \n usort($quals, function($a, $b){\n return strcasecmp($a->get_display_name(), $b->get_display_name());\n });\n \n usort($courses, function($a, $b){\n return strcasecmp($a->fullname, $b->fullname);\n });\n \n $TPL->set(\"quals\", $quals);\n $TPL->set(\"courses\", $courses);\n \n try {\n return $TPL->load($this->CFG->dirroot . $this->path . 'tpl/elbp_target_grades/summary.html');\n }\n catch (\\ELBP\\ELBPException $e){\n return $e->getException();\n }\n \n }", "function set_summary($string) {\n $this->summary = $string;\n return true;\n }", "public function stats()\n\t{\n\t\t$stat = View::factory('profiler/stats');\n\t\t// echo $stat;\n\t}", "public function getIsSummary() {\n return $this->isSummary;\n }", "public function getSummaryForDisplay()\n {\n if (is_string($this->_description)) {\n return $this->_description;\n }\n\n return is_string($this->callback) ? $this->callback : 'Closure';\n }", "public function testGettingTheSummary()\n {\n $this->assertEquals('summary', $this->revision->getSummary());\n }", "public function totalClassHeldSummary()\n {\n return view('report.totalClassHeldSummary');\n }", "function get_summary_output($district_counts, $crm_dist, $name)\n{\n $label = \"$name - District $crm_dist\\n\"\n .\"Summary of contacts that are outside Senate District $crm_dist\\n\";\n\n $columns = [\n 'Senate District' => 12,\n 'Individuals' => 15,\n 'Households' => 14,\n 'Organizations' => 14,\n 'Total' => 16\n ];\n\n $output = '';\n $heading = $label . create_table_header($columns);\n\n ksort($district_counts);\n\n foreach ($district_counts as $dist => $counts) {\n $output .=\n fixed_width($dist, 12, false, 'Unknown')\n . fixed_width(get($counts, 'individual', '0'), 15, true)\n . fixed_width(get($counts, 'household', '0'), 14, true)\n . fixed_width(get($counts, 'organization', '0'), 14, true)\n . fixed_width(get($counts, 'contacts', '0'), 16, true) . \"\\n\";\n }\n\n return $heading . $output;\n}", "public function generalDataSummary()\n {\n $doctorsCount = Doctor::count();\n $patientsCount = Patient::count();\n $monthlyIncome = \"Rs.\" . number_format(Income::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->sum('amount'), 2);\n $monthlyAppointments = Appointment::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->count();\n return ResponseHelper::findSuccess('General Data Summary', [\n \"doctors_count\" => $doctorsCount,\n \"patients_count\" => $patientsCount,\n \"monthly_income\" => $monthlyIncome,\n \"monthly_appointments\" => $monthlyAppointments\n ]);\n }", "public static function rating_summary()\n {\n $date=static::first_end_date();\n return StatisticsHelper::rating_summary(null,null,$date->from->format('Y-m-d'),$date->to->format('Y-m-d'));\n }", "function admin_summary() {\n if (!is_array($this->value)) {\n return '';\n }\n\n $output = check_plain($this->value['column'] . ' ' . $this->operator);\n if (in_array($this->operator, $this->operator_values(2))) {\n $output .= ' ' . t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));\n }\n elseif (in_array($this->operator, $this->operator_values(1))) {\n $output .= ' ' . check_plain($this->value['value']);\n }\n\n return $output;\n }", "function artistManifestSummary($manifest, $format = null) {\n\t\t$format = is_null($format) ? $this->manifestSummaryFormat : $format;\n\n $artistName = $manifest->artistCard()->rootDisplayValue();\n $managerName = $manifest->selfAssigned()\n ? 'self'\n : $manifest->managerCard()->rootDisplayValue();\n $access = $manifest->accessSummary();\n\n return $this->Html->tag(\n 'h3',\n sprintf($format, $artistName, $managerName, $access),\n ['escape' => FALSE]);\n }", "private function summarizeText(string $summary): string {\n\n $summary = strip_tags($summary);\n // Truncate summary line to 100 characters\n $max_len = 100;\n if (strlen($summary) > $max_len)\n $summary = substr($summary, 0, $max_len) . '...';\n\n return $summary;\n }", "public function getSummary()\n {\n return $this->getNodeText('/p:package/p:summary');\n }", "public function getSummaryAt($offset)\n {\n return $this->get(self::_SUMMARY, $offset);\n }", "public function getSummaryAt($offset)\n {\n return $this->get(self::_SUMMARY, $offset);\n }", "public function getSummaryAt($offset)\n {\n return $this->get(self::_SUMMARY, $offset);\n }", "function has_summary() {\n return (strlen(get_field('summering')) > 0);\n}", "public function summary(array $array);", "public function actionSummary($id)\n {\n $this->layout = 'project';\n \n $model = $this->findModel($id);\n $query = \\common\\models\\ProjectBuilding::find()->where(['project_id' => $id]);\n\n $searchModel = new ProjectsSearch();\n $searchModel->status = 'active';\n $searchModel->visible = 1;\n $searchModel->user_id = $model->user_id;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('summary', [\n 'model' => $model,\n 'projectBuilding' => new ActiveDataProvider([\n 'query' => $query,\n ]),\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function _reportSummary($summary)\n {\n $passed = $summary->passed();\n $skipped = $summary->skipped();\n $pending = $summary->pending();\n $excluded = $summary->excluded();\n $failed = $summary->failed();\n $errored = $summary->errored();\n $expectation = $summary->expectation();\n $total = $summary->executable();\n\n $this->write(\"Expectations : \");\n $this->write(\"{$expectation} Executed\");\n $this->write(\"\\n\");\n $this->write(\"Specifications : \");\n $this->write(\"{$pending} Pending\", 'cyan');\n $this->write(\", \");\n $this->write(\"{$excluded} Excluded\", 'yellow');\n $this->write(\", \");\n $this->write(\"{$skipped} Skipped\", 'light-grey');\n $this->write(\"\\n\\n\");\n $this->write('Passed ' . ($passed), 'green');\n $this->write(\" of {$total} \");\n\n if ($failed + $errored) {\n $this->write('FAIL ', 'red');\n $this->write('(');\n $comma = false;\n if ($failed) {\n $this->write('FAILURE: ' . $failed, 'red');\n $comma = true;\n }\n if ($errored) {\n if ($comma) {\n $this->write(', ');\n }\n $this->write('EXCEPTION: ' . $errored, 'magenta');\n }\n $this->write(')');\n } else {\n $this->write('PASS', 'green');\n }\n $time = number_format(microtime(true) - $this->_start, 3);\n $memory = $this->readableSize($summary->memoryUsage());\n $this->write(\" in {$time} seconds (using {$memory}B)\");\n $this->write(\"\\n\\n\");\n\n $this->_reportFocused($summary);\n }", "public function getTargetSummary()\n {\n return $this->get(self::_TARGET_SUMMARY);\n }" ]
[ "0.8464724", "0.8124023", "0.78381956", "0.75764513", "0.7574754", "0.74134326", "0.7402533", "0.7402533", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.74022454", "0.73995876", "0.73995876", "0.73995876", "0.7377782", "0.7312386", "0.73038447", "0.7301028", "0.7301028", "0.7268058", "0.723182", "0.72232246", "0.717139", "0.71214867", "0.70689434", "0.70581144", "0.7047329", "0.6933251", "0.6919034", "0.69044375", "0.6899268", "0.68468827", "0.6749509", "0.66949815", "0.6658848", "0.66537875", "0.6621337", "0.66182226", "0.65886104", "0.6565131", "0.65592915", "0.65574574", "0.65452886", "0.65361744", "0.6528653", "0.6515288", "0.65004224", "0.6441275", "0.6439972", "0.6439972", "0.642099", "0.6413975", "0.640909", "0.6400147", "0.6399606", "0.63947195", "0.6390346", "0.63677984", "0.63602656", "0.6341837", "0.63186747", "0.6314325", "0.6312943", "0.6312943", "0.6312943", "0.63108027", "0.6304976", "0.6297646", "0.62840664", "0.6247336", "0.6233835", "0.6226251", "0.6220636", "0.61950946", "0.61878455", "0.61813164", "0.6163361", "0.6152331", "0.61358666", "0.6128121", "0.6126777", "0.6123097", "0.6116899", "0.6105567", "0.61013204", "0.609957", "0.6096137", "0.6082445", "0.60801893", "0.60801893", "0.60801893", "0.6073916", "0.60535884", "0.6052779", "0.6002809", "0.59814095" ]
0.68596494
35
displaySummary Generate a link to the image cover
function cbGenCover($url, $align) { return '<a href="' . $url . '">' . '<img style="padding: 10px;" align="' . $align . '" border="0" width="200" height="250"' . 'src="' . $url . '" />' . '</a>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function RenderImages_withLink_andSummary() {\n\t$htTitle = $this->NameString();\n\t$htStatus = $this->RenderCatalogSummary_HTML();\n\t$qStock = $this->QtyInStock();\n\t$htStock = \"$qStock in stock\";\n\t$htPopup = \"&ldquo;$htTitle&rdquo;%attr%\\n$htStatus\\n$htStock\";\n\t$htImgs = $this->RenderImages_forRow($htPopup,vctImages::SIZE_THUMB);\n\t$htTitle = $this->ShopLink($htImgs);\n\treturn $htTitle;\n }", "function cbDisplaySummary($number) {\n global $EDIT_SUMMARY_URL;\n\n cbTrace(\"DISPLAYING \" . $number);\n $heftRow = cbFindHeftRow($number) or cbTrace(mysql_error());\n $numRows = mysql_numrows($heftRow);\n\n $title = mysql_result($heftRow, 0, \"title\");\n $author = mysql_result($heftRow, 0, \"author\");\n $summaryRow = cbFindSummaryRow($number);\n $summaryCount = mysql_numrows($summaryRow);\n\n $url = sprintf(\"http://perry-kotlin.app.heroku/api/covers/%d\", $number);\n\n $date = null;\n if ($summaryCount > 0) {\n $summary = mysql_result($summaryRow, 0, \"summary\");\n $englishTitle = mysql_result($summaryRow, 0, \"english_title\");\n $date = mysql_result($summaryRow, 0, \"date\");\n $authorName = mysql_result($summaryRow, 0, \"author_name\");\n if ($date == null) $date = '';\n }\n\n cbGenHtml($number, $title, $englishTitle, $author, $summary,\n $summaryCount, $url, $authorName, $date);\n}", "function echo_summary_view_for_contest($id) {\n $image = get_corresponding_header_icon_url_for_contest_functionid(get_functionid_for_contestid($id));\n echo \"<img class=\\\"summary\\\" src=\\\"$image\\\">\";\n if (contest_is_upcoming($id)) {\n echo return_upcoming_contest_info_for_id($id);\n } else if (contest_is_recent($id)) {\n echo return_recent_contest_info_for_id($id);\n } else {\n echo return_info_for_contest($id);\n echo return_summary_for_contestid($id);\n }\n}", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "public function getSummaryThumbnail() {\n $data = [];\n if ($this->Image() && $this->Image()->exists()) {\n // Stretch to maximum of 36px either way then trim the extra off\n if ($this->Image()->getOrientation() === Image_Backend::ORIENTATION_PORTRAIT) {\n $data['Image'] = $this->Image()->ScaleWidth(36)->CropHeight(36);\n } else {\n $data['Image'] = $this->Image()->ScaleHeight(36)->CropWidth(36);\n }\n }\n return $this->customise($data)->renderWith(__CLASS__ . '/SummaryThumbnail')->forTemplate();\n }", "public function display_summary() {\n // FIXME\n }", "function display_album($img_in_album, $title, $width, $height) {\n echo '<img id=\"imgFromAlbum\" src=\"uploads/' . $img_in_album . '\" title=\"' . $title . '\" height=\"' . $height .'\" width=\"' . $width .'\" />';\n\t}", "function frmgetcourse_summary_image($courseid) {\n\tglobal $CFG;\n\t$contentimage = '';\n\tforeach (frmgetcourse_overviewfiles($courseid) as $file) {\n\t\t$isimage = $file->is_valid_image();\n\t\t$url = file_encode_url(\"$CFG->wwwroot/pluginfile.php\",\n\t\t'/'. $file->get_contextid(). '/'. $file->get_component(). '/'.\n\t\t$file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);\n\t\tif ($isimage) {\n\t\t\t$contentimage = html_writer::empty_tag('img', array('src' => $url, 'alt' => 'Course Image '. $course->fullname,'class' => 'card-img-top w-100'));\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (empty($contentimage)) {\n\t\t$url = $CFG->wwwroot . \"/theme/\".$CFG->theme.\"/pix/default_course.jpg\";\n\t\t$contentimage = html_writer::empty_tag('img', array('src' => $url, 'alt' => 'Course Image '. $course->fullname,'class' => 'card-img-top w-100'));\n\t}\n\treturn $contentimage;\n}", "public function showSummary()\n {\n if ( isset($_GET['order'])) {\n $this->sortBy = $_GET['order'];\n }\n\n if ( ! isset($this->result['data'])) {\n die(\"Impropper coverage report. Please regenerate\");\n }\n\n $coveredArray = $this->result[\"data\"];\n //lets sort it.\n uasort($coveredArray, array($this,\"sortArray\"));\n\n //and flip if it perhaps?\n if (isset($_GET[\"flip\"]) && $_GET[\"flip\"] == \"true\") {\n $coveredArray = array_reverse($coveredArray, true);\n }\n\n $totals = $this->result[\"totals\"];\n\n echo '<tr><td>TOTAL</td><td>' , \n $totals['percentage'] , '%</td><td>' , \n $totals['lines'] , '</td><td>' , \n $totals['covered'] , '</td><td>', \n $totals['maybe'] , '</td><td>',\n $totals['notcovered'] , '</td><td></tr>';\n\n foreach($coveredArray as $class => $info) {\n\n echo '<tr><td>';\n if ( $info['type'] == \"covered\") {\n echo '<a href=\"' , $class , '.html\">', $class , '</a>';\n }else{\n echo $class;\n }\n echo '<td>' . $info['percentage'] . ' % </td><td>' . $info['total'] . '</td><td>' . $info['covered'] . '</td><td>' . $info['maybe'] . '</td><td>' . $info['notcovered']. '</td></tr>';\n }\n }", "public function display() { ImageLib::serve($this->source_image, $this->source_image_mimetype); }", "function getHTML_coverFlowListElement($imageSrc, $title, $imagealttext, $link, $target = '_self') {\n\t\t\t// get HTML of image flow list element\n\t\t$HTML_coverFlowListElement = '\n\t\t\t<a class=\"mf_link\" href=\"' . $link . '\" rel=\"image\" target=\"' . $target . '\" >\n\t\t\t\t<img class=\"mf_image\" src=\"' . $imageSrc . '\" title=\"' . htmlSpecialChars($title) . '\" alt=\"' . htmlSpecialChars($imagealttext) . '\" />\n\t\t\t</a>\n\t\t';\n\t\t\t// output\n\t\treturn $HTML_coverFlowListElement;\n\t}", "abstract public function show($img);", "function printSummary () {\n foreach ($this->ids as $i) {\n $this->link[$i]->printSummary();\n }\n }", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "function display_image($entity)\n{\n\tglobal $config;\n\t\n\techo '\n\t\t\t<div class=\"heading-block clearfix\">\n\t\t\t\t<div class=\"heading-thumbnail\">';\n\t\t\t\t\n\t\n\tif (isset($entity->thumbnailUrl))\n\t{\n\t\techo '<img src=\"' . $config['thumbnail_cdn'] . get_thumbnail_url($entity->thumbnailUrl) . '\" />';\t\t\n\t}\t\n\telse\n\t{\n\t\techo '<img src=\"images/no-icon.svg\" />';\n\t}\n\t\t\n\techo '\n\t\t\t\t</div>\n\t\t\t\t<div class=\"heading-body\">\n\t\t\t\t\t<div class=\"heading-title\">';\n\t\t\t\t\t\n\techo get_literal_display($entity->name);\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"heading-description\">';\n\t\t\t\t\t\n\tif (isset($entity->description))\n\t{\n\t\techo '<div class=\"caption\">' . get_literal_display($entity->description) . '</div>';\n\t}\t\t\t\n\t\n\techo '<div id=\"identifiers\">';\n\techo '<ul class=\"identifier-list\">';\n\techo '<li><a class=\"external\" href=\"' . $entity->{'@id'} . '\" target=\"_new\">' . $entity->{'@id'} . '</a></li>';\n\techo '</ul>';\n\techo '</div>';\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t\t\n\t// Display image\n\techo '<div>';\t\n\techo '<img class=\"image\" src=\"' .$entity->contentUrl->{'@id'} . '\" />';\t\n\techo '</div>';\n\n\n\n\techo '\n\t\t<script>figure_is_part_of(\"' . $entity->{'@id'} . '\", \"cited_by\");</script> \n\t';\n}", "public function showImage()\n {\n }", "function printHTML() \n {\n $this->openBlockHeader(\"Candidate Event\");\n?>\n <img id='candidate_image' src=\"<?echo $this->cand_url?>\">\n<?\n $this->closeBlockHeader();\n }", "public static function main() {\n\t\t$page = file_get_html('http://photography.nationalgeographic.com/photography/photo-of-the-day/nature-weather/');\n\t\t$link = $page->find('#search_results', 0)->find('a', 0)->href;\n\n\t\t$page = file_get_html('http://photography.nationalgeographic.com'.$link);\n\t\t$img = $page->find('meta[property=og:image]', 0)->content;\n\t\treturn $img;\n\t}", "function imageDisplay($album=array(),$image=array(),$maximage=array(), $expComments=array(), $next=null, $previous=null, $modvars=array())\n\t{\n\t\t// Create output object\n\t\t$pnRender = pnRender :: getInstance('crpCasa');\n\n\t\t$pnRender->assign($modvars);\n\t\t$pnRender->assign('album',$album);\n\t\t$pnRender->assign('image',$image);\n\t\t$pnRender->assign('maximage',$maximage);\n\t\t$pnRender->assign('comments',$expComments);\n\t\t$pnRender->assign('previous',$previous);\n\t\t$pnRender->assign('next',$next);\n\n\t\t// Return the output that has been generated by this function\n\t\treturn $pnRender->fetch('crpcasa_user_image_display.htm');\n\t}", "public function get_cover_name(){\n\t\treturn \"{$this->id}_cover.png\";\n\t}", "public function display_image($data) {\n global $ID;\n if (file_exists(mediaFN($ID))) {\n echo '<img class=\"proofreadpage\" alt=\"\" width=\"500\" src=\"' . ml($ID, array('w' => '500')) . '\" />';\n }\n }", "function photoSummary($inputArr) {\n $ro = new PhotoSummaryRO();\n $album = $inputArr[\"name\"];\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $ro->numPics = count($files);\t\n\n $ro->usedSpace = round(filesize_r(\"Pics/$album\") / 1000000); // space in MiB\n\n $plinkRO = publicLink($inputArr);\n $ro->albumPublicUrl = $plinkRO->url;\n\n return $ro;\n}", "public function getCoverUrl()\n {\n return Url::to(\"/img/covers/{$this->avatar}\");\n }", "protected function RenderSummary_HTML_line() {\n\t$out = \"\\n\"\n\t .$this->TitleHREF()\n\t .$this->CatNum()\n\t .' &ldquo;'\n\t .$this->NameString()\n\t .'&rdquo;</a>: '\n\t .$this->RenderStatus_HTML_line()\n\t .'<br>'\n\t ;\n\treturn $out;\n }", "function statsImage($merchantData) {\n \t if ( ! isset($merchantData->stat_links) || ! is_array($merchantData->stat_links) || count($merchantData->stat_links) < 1 )\n \t return '';\n \t \n \t $images = '';\n \t \n \t foreach ( $merchantData->stat_links as $link ) {\n \t if ( isset($link->url) && preg_match('/^http/', $link->url) )\n \t $images .= '<img src=\"' . $link->url . '\" class=\"praized-merchant-stats-img\" width=\"1\" height=\"1\" border=\"0\" alt=\"Statistics Target\" style=\"margin:0; padding:0; border:none;\" />';\n \t }\n \t \n \t return $images;\n \t}", "public function view_summary(stdClass $submission, &$showviewlink) {\n // Get only latest submission from database\n $circleci_submission = $this->get_latest_circleci_submission($submission->id);\n \n $html = $this->circleci_summary_url_html($circleci_submission);\n \n $html_files = $this->assignment->render_area_files('assignsubmission_circleci',\n ASSIGNSUBMISSION_CIRCLECI_FILEAREA,\n $submission->id);\n $showviewlink = true; \n \n return $html . $html_files;\n return '';\n }", "public function okr_summary()\n\t{\n\t\tif ($this->session->userdata('status') !== 'admin_logged_in') {\n\t\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('OKR Summary', $this->session->userdata['type']);\n\n\n\t\t$data = [\n\t\t\t'member_dsc' => $this->M_memberDsc->get_all_member(),\n\t\t\t'usecase' => $this->M_otherDataAssignments->get_usecase(),\n\t\t\t'member_selected' => '',\n\t\t\t'usecase_selected' => '',\n\t\t\t'judul' => 'OKR Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoring_okr_summaryProduct',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => []\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }", "function view_project_plan($img,$w,$h,$alt)\n{\n if(file_exists(\"../project/plans/\".$img) && $img!='')\n\n $temp= \"<img src=\\\"../include/phpThumb.php?src=../project/plans/\".$img.\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" \n alt='$alt' class='floatL mar12R' />\";\n else\n $temp =\"<img src=\\\"../include/phpThumb.php?src=../project/nophoto.jpg\\\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" alt='$alt' class='floatL mar12R'/>\";\n \n\treturn $temp;\n}", "public function display() {\n \t\n \tif($this->userCanVisualize()){\n \t\t\n \t\t$e = $this->buildGraph();\n \t\tif($e){\n\t \techo $e->graph->GetHTMLImageMap(\"map\".$this->getId());\n\t \t$this->displayImgTag();\n \t\t}\n \t}\n }", "public function getSummary();", "function album_list_thumbnail($albumList)\n{\n\tforeach ($albumList as $album) {\n\t\t$id = $album->album_id;\n\t\t$title = $album->album_title;\n\t\t$year = $album->album_year;\n\t\techo \"<div class='col-md-6' data-toggle='tooltip' data-placement='top' title='$title'> \";\n\t\t\techo a_open(\"thumbnail\", base_url().\"album/$id\");\n\t\t\t\techo img(\"data/music/albums/$id/cover.png\");\n\t\t\techo a_close();\n\t\techo div_close();\n\t}\n}", "function get_display_photo(){\n\t$display_photo = get_profile( 'photo' );\n\tif ( empty($display_photo) || !file_exists(abspath('/contents/images/profile/'.$display_photo)) )\n\t\treturn false;\n\n\treturn get_image_link( \"/images/profile/$display_photo\", \"default\" );\n}", "public function show()\n {\n $path = Storage::url('public/IMG-20180930-WA0004.jpg.jpg');\n\n return '<img src=\"' .$path. '\" alt=\"\">';\n }", "function showmybadgeimage($badge,$userrole){\n\tglobal $DB, $CFG;\n\t$content ='';\n\t$context = frmget_context();\n\t$imageurl = moodle_url::make_pluginfile_url($context->id, 'badges', 'badgeimage', $badge->badgeid, '/', 'f1', false);\n\t$content.= html_writer::start_tag('div', array('class'=>'badges width50'));\n\t$content.= html_writer::start_tag('div', array('class' => 'badge-image'));\n\t$content.= html_writer::empty_tag('img', array('src' => $imageurl));\n\t$content.= html_writer::end_tag('div');\n\t$content.= html_writer::start_tag('div', array('class' => 'badgedetail width66'));\n\t$content.= html_writer::tag('span', $badge->name, array('class' => 'badge-name'));\n\t$content.= '<br>'.$badge->description.'</br></br>';\n\t$content.= html_writer::end_tag('div');\n\t//Project Details\n\tif($userrole==\"student\"){\n\t\t$content.= html_writer::start_tag('div', array('class' => 'badgedetail width66'));\n\t\t$content.='<span class=\"badge-name\">Innovation: </span><span>'.$badge->fullname.'</span></br>';\n\t\t$content.='<span class=\"badge-name\">Awarded By: </span><span>'.$badge->issuername.'</span></br>';\n\t\t$content.='<span class=\"badge-name\">Award Date: </span><span>'.$badge->createddate.'</span>';\n\t\t$content.= html_writer::end_tag('div');\n\t}\n\t$content.= html_writer::end_tag('div');\n\t\n\treturn $content;\n}", "function showCouponStyleContentThumbnail($detailsURL, $previewBase, $imageBase, $thumbnailInfo) {\n\t$image = $thumbnailInfo->filename;\n\t$thumbnailURL = $previewBase ? \"$previewBase/$image\" : $image;\n\t$imageURL = $imageBase ? \"$imageBase/$image\" : $image;\n\t$customer = $thumbnailInfo->name;\n\t$store = getPropertyValue($thumbnailInfo, 'store');\n\t$fullAddress = array(\n\t\tgetPropertyValue($thumbnailInfo, 'address'), \n\t\tgetPropertyValue($thumbnailInfo, 'city'), \n\t\tgetPropertyValue($thumbnailInfo, 'state'), \n\t\tgetPropertyValue($thumbnailInfo, 'zip')\n\t);\n\t$address = join(' ', $fullAddress);\n?>\n\t<div id=\"container76\" class=\"coupcontainer reset-15 col-xs-12 col-md-6 col-lg-4\">\n\t\t<div class=\"cp_img\">\n\t\t\t<a href=\"<?=$detailsURL?>\" title=\"<?=$customer?>\" class=\"screenshot\" rel=\"<?=$thumbnailURL?>\">\n\t\t\t\t<img src=\"<?=$imageURL?>\" alt=\"<?=$customer?>\" class=\"img-responsive\" style=\"width:100%;\"> \n\t\t\t</a>\n </div>\n <div class=\"couppicr panel panel-default\">\n\t\t\t<div class=\"coupcontl panel-body\">\n\t\t\t\t<div class=\"cp_info\">\n\t\t\t\t\t<div class=\"couptit ellipsis\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<a href=\"<?=$detailsURL?>\" title=\"<?=$customer?> - <?=$store?>\">\n\t\t\t\t\t\t\t\t<?=$customer?>\n\t\t\t\t\t\t\t</a>\n </span>\n </div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<small class=\"coupaddress\">\n\t\t\t\t\t\t\t<?=$address?>\n\t\t\t\t\t\t</small>\n </div>\n </div>\n </div>\n </div>\n </div>\n<?php\n}", "public function getGearSmallIconURL($wowGearSummary)\t{ return $this->buildItemSmallIconURL($this->armoryAdapter->getWowArmoryUrl(), $wowGearSummary->getIcon()); }", "function printFull()\n {\n echo'<div class=\"box\" style=\"background-image: url(\\'';\n if($this->img!=\"\")echo $this->img;\n else echo(\"https://$_SERVER[HTTP_HOST]/media/favicons/placeholder.jpg\");\n echo'\\');\">\n <div class=\"box-overlay\">\n <div>\n <h6>'.$this->name.'</h6>';\n if($this->position!=\"\")echo'<h5 class=\"w\" style=\"margin-bottom:3px;margin-top: 3px;\">'.$this->position.'</h5>';\n if($this->email!=\"\")echo'<span><a href=\"mailto:'.$this->email.'@pacificmun.com\">'.$this->email.'@pacificmun.com</a></span>';\n echo'</div><p>'.$this->bio.'</p>\n </div></div>';\n }", "public function get_image_link()\n {\n }", "public function getCover()\n {\n return $this->coverLink;\n }", "function showimage($img_name,$img_width,$img_height,$cropratio=NULL,$imgtitle=NULL,$round) {\r\n\r\n\tglobal $sitepath;\r\n\r\n\t$theimg.=\"<img src='$sitepath\". \"includes/image.php/$img_name[$i]?width=$img_width&amp;height=$img_height\";\r\n\r\n\tif ($cropratio) { $theimg.= \"&amp;cropratio=$cropratio\"; }\r\n\r\n\t$theimg.=\"&amp;quality=85&amp;image=$sitepath\" . \"$img_name' alt='$imgtitle' \";\r\n\r\n\t$theimg.=\" class='avatar\";\r\n\r\n\tif ($round==1) { $theimg.=\" round_1px \"; }\r\n\r\n\tif ($round==2) { $theimg.=\" round_2px \"; }\r\n\r\n\tif ($round==3) { $theimg.=\" round_3px \"; }\r\n\r\n\tif ($round==5) { $theimg.=\" round_5px \"; }\r\n\r\n\tif ($round==10) { $theimg.=\" round_10px \"; }\r\n\r\n\t$theimg.=\"' />\";\r\n\r\n\treturn $theimg;\r\n\r\n}", "public function getCoverLink()\n {\n return $this->coverLink;\n }", "public function summary();", "public function displayImage($params) { \n /// first make sure all params are valid\n $this->imgPath = realpath($this->imgDirPath . $params['src']);\n $this->validateParameters($params);\n $image = $this->getOriginalImg();\n if (isset($params['verbose'])) {\n $this->createVerboseLog();\n }\n if(isset($params['crop_to_fit']) || isset($params['height']) || isset($params['width'])) {\n $image = $this->resizeImage($params['height'], $params['width'], $params['crop_to_fit'], $image);\n }\n if (isset($params['sharpen'])) {\n $image = $this->sharpenImage($image);\n }\n $cacheFileName = $this->createCacheFileName($params);\n $this->checkCachePath($cacheFileName, $params['no_cache']);\n \n $this->saveImg($image, $cacheFileName, $params['quality']);\n $this->outputImage($cacheFileName, $this->verbose);\n }", "function outputImages($collectionObject) {\r\n\t$results = $collectionObject->getArray();\r\n\r\n\tfor($i=0;$i<$collectionObject->getCount();$i++){\r\n\t\techo '<div class=\"col-md-3\">';\r\n\t\techo '<a href=\"single-image.php?id=' . $results[$i]->getImageID() . '\">';\r\n\t\techo '<img src=\"travel-images/square-medium/'. $results[$i]->getPath() . '\" title=\"\" class=\"thumbnail\" />';\r\n\t\techo '</a>';\r\n\t\techo \"</div>\";\r\n\t}\r\n}", "public function workload_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Usecase Summary', $this->session->userdata['type']);\n\n\t\t$data = [\n\t\t\t'countUsecase' => $this->M_workloadGraph->getCountUsecase(),\n\t\t\t'countMember' => $this->M_workloadGraph->getCountMember(),\n\t\t\t'graphNodes' => $this->M_workloadGraph->get_nodes(),\n\t\t\t'graphLinks' => $this->M_workloadGraph->get_links(),\n\t\t\t'judul' => 'Workload Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringWorkload',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['workloadSummary/workloadGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "function showTestimonialStyleContentThumbnail($detailsURL, $previewBase, $imageBase, $thumbnailInfo) {\n\t$image = $thumbnailInfo->filename;\n\t$thumbnailURL = $previewBase ? \"$previewBase/$image\" : $image;\n\t$imageURL = $imageBase ? \"$imageBase/$image\" : $image;\n\t$customer = $thumbnailInfo->name;\n\t$store = getPropertyValue($thumbnailInfo, 'store');\n\t$fullAddress = array($thumbnailInfo->address, $thumbnailInfo->city, $thumbnailInfo->state, $thumbnailInfo->zip);\n\t$address = join(' ', $fullAddress);\n?>\n\t<div id=\"container76\" class=\"coupcontainer reset-15 col-xs-12 col-md-10 col-lg-10 couppicr panel panel-default\" style=\"margin-bottom:20px;padding-bottom:10px;\">\n\t\t<table width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td valign=\"top\" width=\"60%\">\n\t\t\t\t\t<a href=\"<?=$detailsURL?>\" title=\"<?=$customer?> - <?=$store?>\">\n\t\t\t\t\t\t<?=$customer?>\n\t\t\t\t\t</a>\n\t\t\t\t\t<br />\n \t\t\t\t<small class=\"coupaddress\" style=\"color:gray\">\n\t\t\t\t\t\t<?=$address?>\n\t\t\t\t\t</small>\n\t\t\t\t\t<br />\n \t\t\t\t<?=$thumbnailInfo->testimonial?>\n\t\t\t\t</td>\n\t\t\t\t<td width=\"6%\"></td>\n\t\t\t\t<td width=\"33%\" valign=\"top\">\n\t\t\t\t\t<a href=\"<?=$detailsURL?>\" title=\"<?=$customer?>\" class=\"screenshot\" rel=\"<?=$thumbnailURL?>\">\n\t\t\t\t\t\t<img src=\"<?=$imageURL?>\" alt=\"<?=$customer?>\" class=\"img-responsive\" align=\"right\"> \n\t\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n </div>\n<?php\n}", "function buildDescription($data) {\n $description_array = array();\n //Get image info.\n $imageinfo = image_get_info($data->uri);\n\n if ($this->conf['image_extra_info']['thumbnail']) {\n $image = $imageinfo ? theme_image_style(array(\n 'width' => $imageinfo['width'],\n 'height' => $imageinfo['height'],\n 'style_name' => 'linkit_thumb',\n 'path' => $data->uri,\n )) : '';\n }\n\n if ($this->conf['image_extra_info']['dimensions'] && !empty($imageinfo)) {\n $description_array[] = $imageinfo['width'] . 'x' . $imageinfo['height'] . 'px';\n }\n\n $description_array[] = parent::buildDescription($data);\n\n if ($this->conf['show_scheme']) {\n $description_array[] = file_uri_scheme($data->uri) . '://';\n }\n\n $description = (isset($image) ? $image : '') . implode('<br />' , $description_array);\n\n return $description;\n }", "function _showname($img,$data){\n global $ID;\n\n if(!$data['showname'] ) { return ''; }\n\n //prepare link\n $lnk = ml($img['id'],array('id'=>$ID),false);\n\n // prepare output\n $ret = '';\n $ret .= '<br /><a href=\"'.$lnk.'\">';\n $ret .= hsc($img['file']);\n $ret .= '</a>';\n return $ret;\n }", "public function get_summary(){\n\t\tglobal $CFG;\n\n\t\trequire_once $CFG->libdir . '/filelib.php';\n\t\trequire_once $CFG->libdir . '/weblib.php';\n\n\t\tif (strlen($this->_summary) < 1) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$context = context_course::instance($this->_courseid);\n\n\t\t$options = array(\n\t\t\t'para' => false,\n\t\t\t'newlines' => true,\n\t\t\t'overflowdiv' => false,\n\t\t);\n\n\t\t$summary = file_rewrite_pluginfile_urls($this->_summary, 'pluginfile.php', $context->id, 'course', 'summary', null);\n\t\treturn format_text($summary, $this->_summaryFormat, $options, $this->_courseid);\n\t}", "public function show_images(){\n\t\t\t$dir = '../pictures/';\n\t\t\t//checks if is an actual directory, opens it and reads each and returns filename.ext\n\t\t\tif (is_dir($dir)) {\n\t\t\t if ($dh = opendir($dir)) {\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t \tif( $file == '.' || $file == '..'){//readdir returns ., .. before actual filenames\n \t\tcontinue;//they are ignored\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//href value is to a include file showlarge.inc.php\n\t\t\t\t\t\techo \"<a href=?value=showlarge&value={$file}>\";\n\t\t\t\t\t\techo \"<img class = 'picture' src='{$dir}{$file}'></a>\";\n\t\t\t }\n\t\t\t closedir($dh);\n\t\t\t }\n\t\t\t}\n\t\t}", "function getCover () {\n\n}", "public function displayFullSummary()\n {\n return true;\n }", "public function getSummary(): string;", "public function displayContentOverview() {}", "function affiche_image_armure($image_armures, $nom_armure, $defense_armure, $description_armures,\n\t\t\t\t\t\t\t $BonusPerception_armures, $bonusPv_armure){\n\t\t\t\t\t\t\t\t \n\t$description_arme = $description_armures;\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\techo \"<td width=50 height=50 align=center>\n\t\t\t<img tabindex='0' src='../images/armures/$image_armures' width=50 height=50 \n\t\t\t\t\tdata-toggle='popover' data-trigger='focus' data-html='true' data-placement='bottom'\n\t\t\t\t\ttitle=\\\"<b>$nom_armure</b>\\\" \";\n\techo \"\t\t\tdata-content=\\\"\t<div><img src=../images/armures/$image_armures></div>\n\t\t\t\t\t\t\t\t\t<div><u>Defense :</u> $defense_armure</div>\";\n\t\t\t if($BonusPerception_armures){\n\t\t\t\techo \"<div><u>Bonus Perception :</u> $BonusPerception_armures</div>\";\n\t\t\t }\n\t\t\t if($bonusPv_armure){\n\t\t\t\techo \"<div><u>bonus Pv :</u> $bonusPv_armure</div>\";\n\t\t\t }\n\t\t\t echo \"<div><b>Description</b></div><div>$description_armures</div>\\\" >\";\n}", "public function getMetaSummary()\n {\n return $this->dbObject('ImageMetaCaption');\n }", "public function RenderImages() {\n\t$outYes = $outNo = NULL;\n\twhile ($this->NextRow()) {\n\t $htTitle = $this->RenderImages_withLink_andSummary();\n\t if ($this->IsForSale()) {\n\t\t$outYes .= $htTitle;\n\t } else {\n\t\t$outNo .= $htTitle;\n\t }\n\t}\n\t\n\tif (is_null($outYes)) {\n\t $htYes = '<span class=content>There are currently no titles available for this topic.</spaN>';\n\t} else {\n\t $oSection = new vcHideableSection('hide-available','Titles Available',$outYes);\n\t $htYes = $oSection->Render();\n\t}\n\tif (is_null($outNo)) {\n\t $htNo = NULL;\t// no point in mentioning lack of unavailable titles\n\t} else {\n\t $oSection = new vcHideableSection('show-retired','Titles NOT available',$outNo);\n\t $oSection->SetDefaultHide(TRUE);\n\t $htNo = $oSection->Render();\n\t}\n\treturn $htYes.$htNo;\n }", "function showImage()\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\timagegif($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\timagejpeg($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\timagepng($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "public function buildPaneSummary();", "protected function show()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n $this->sendHeader('gif');\n imagegif($this->image, '');\n break;\n \n case 'image/jpeg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/jpg':\n $this->sendHeader('jpg');\n imagejpeg($this->image, '', $this->quality);\n break;\n \n case 'image/png':\n $this->sendHeader('png');\n imagepng($this->image, '', round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n }", "function display_button($target, $image, $alt){\n\n ?>\n <a href=\"<?= \"/myPHP/ShoppingCart/model/\".$target ?>\"><img src=\"/myPHP/ShoppingCart/images/<?=$image ?>.gif\" alt=\"<?=$alt?>\"\n border=0\n height=50\n width=135></a>\n <?\n}", "function doc_pic ($a,$showdetails=false,$force=false) {\r\n\tGLOBAL $HTTP_SERVER_VARS;\r\n\t\t$SRC=$a[SRC];\r\n\t\t$path=$a[path];\r\n\t\t$HREF=$a[HREF];\r\n\t\t$BORDER=$a[BORDER];\r\n\t\t$ALIGN=$a[ALIGN];\r\n\t\t$HVSPACE=$a[HVSPACE];\r\n\t\t$ALT=$a[ALT];\r\n\t\t$WIDTH=$a[WIDTH];\r\n\t\t$HEIGHT=$a[HEIGHT];\r\n\r\n\t\tif (''==$SRC) {\r\n\t\t\tif ($showdetails) {\r\n\t\t\t\t$this->_debug2('doc_pic');\r\n\t\t\t\treturn(\"Kein Bild\");\r\n\t\t\t} else {\r\n\t\t\t\t$this->_debug2('doc_pic');\r\n\t\t\t\treturn('');\r\n\t\t\t}\r\n\t\t}\r\n\t if (''==$path) {\r\n\t \t$path=$SRC;\r\n\t }\r\n\t if (ereg(\"^/\",$SRC)) {\r\n\t \t## if unset, assume DOCUMENT_ROOT to be the path\r\n\t \tif (!$this->layoutpath) {\r\n\t \t\t$this->layoutpath = $HTTP_SERVER_VARS[\"DOCUMENT_ROOT\"];\r\n\t \t}\r\n\t\t\t$SRC= $this->layouturl . $SRC;\r\n\t\t\t$path=$this->layoutpath . $path;\r\n\t\t}\r\n\t if (file_exists($path)) {\r\n\t\t\t$WH=GetImageSize($path);\r\n\t\t} else {\r\n\t\t\t$this->defval($force, $this->picture_def['force']);\r\n\t\t\tif (!$force) {\r\n\t\t\t\t$this->_debug2('doc_pic not found');\r\n\t\t\t\treturn(\"Bild: '$path' nicht vorhanden!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($WIDTH>0) {\r\n\t\t\t$WH[0]=$WIDTH;\r\n\t\t}\r\n\t\tif ($HEIGHT>0) {\r\n\t\t\t$WH[1]=$HEIGHT;\r\n\t\t}\r\n\t\t$this->defval($BORDER, $this->picture_def['BORDER']);\r\n\t\t$this->defval($ALIGN, $this->picture_def['ALIGN']);\r\n\t\t$this->defval($HVSPACE, $this->picture_def['HVSPACE']);\r\n\t\t$this->defval($ALT, $this->picture_def['ALT']);\r\n\r\n\t\t$r.=($BORDER!='') ? sprintf($this->picture['BORDER'],$BORDER) : '';\r\n\t\t$r.=o_iftrue($ALIGN, $this->picture['ALIGN']);\r\n\t\tif ($HVSPACE) {\r\n\t\t\t$r.=sprintf($this->picture['HVSPACE'],$HVSPACE,$HVSPACE);\r\n\t\t}\r\n\t\t$r.=sprintf($this->picture['ALT'],HTMLSpecialChars($ALT));\r\n\t\t$r.=sprintf($this->picture['WIDTH'],$WH[0]);\r\n\t\t$r.=sprintf($this->picture['HEIGHT'],$WH[1]);\r\n\r\n\t\t$out=sprintf($this->picture['pictag'],$SRC,$r);\r\n\r\n\t\tif ($HREF) {\r\n\t\t\t$out=$this->doc_anker('NULL',$HREF,$out);\r\n\t\t}\r\n\r\n\t\tif ($showdetails) {\r\n\t\t\t$name=ereg_Replace(\"^.*/\",\"\",$SRC);\r\n\t\t\t$out=\"<SMALL>'<B>$name</B>'&nbsp;\".\r\n\t\t\t \"$WH[0]x$WH[1]&nbsp;Pixel</SMALL>\\n$out\";\r\n\t\t}\r\n\r\n\t\t$this->_debug('doc_pic',$out);\r\n\t\treturn($out);\r\n\t}", "function print_photo($table) {\n\n\t$html = \"<div class=\\\"div_class\\\" href=\\\"\" . $table['link'] . \"\\\">\\n\";\n\t$html .= \"\\t<img src=\\\"Images/\" . $table['photo'] . \"\\\">\";\n\t$html .= \"</div>\\n\";\n\n\treturn $html;\n\n}", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "function generateAlbumView($userId,$showEditImages,$rel,$albumName){\n\t$images_profile\t=$GLOBALS['cn']->query('\n\t\tSELECT i.id,i.image_path\n\t\tFROM images i\n\t\tJOIN album a ON a.id_user=i.id_user\n\t\tWHERE\n\t\t\ti.id_user='.$userId.' AND\n\t\t\ti.id_images_type=2 AND\n\t\t\ta.name=\"'.$albumName.'\" AND\n\t\t\ta.id_image_cover!=i.id\n\t\tORDER BY i.id DESC\n\t');\n\techo '<div style=\"display:none;\">';\n\twhile($image=mysql_fetch_assoc($images_profile)){\n\t\t$img_full_src=FILESERVER.'img/users/'.$image['image_path'];\n\t\t$showEditImages=($showEditImages?'&showMenu':'');\n\t\techo\n\t\t\t'<a id=\"'.md5($img_full_src).'\" class=\"grouped_PP\" rel=\"'.$rel.'\"'.\n\t\t\t\t'href=\"'.$GLOBALS['config']->main_server.'views/photos/picture.view.php?src='.$img_full_src.'&id_photo='.md5($image['id']).'&id_user='.$userId.$showEditImages.'\">'.\n\t\t\t\t'<img src=\"'.$img_full_src.'\" alt=\"\"/>'.\n\t\t\t'</a>';\n\t}\n\techo '</div>';\n}", "function printHTML() \n {\n?>\n <center>\n <img src=\"/images/blankimage.gif\" border=0 width=700 height=240 id=\"candidate\" TITLE=\"Current Candidate\" alt=\"alt\">\n </center>\n<?\n }", "function generateAlbumView($userId,$showEditImages,$rel,$albumName){\n\t$images_profile\t=$GLOBALS['cn']->query('\n\t\tSELECT i.id,i.image_path\n\t\tFROM images i\n\t\tJOIN album a ON a.id_user=i.id_user\n\t\tWHERE\n\t\t\ti.id_user='.$userId.' AND\n\t\t\ti.id_images_type=2 AND\n\t\t\ta.name=\"'.$albumName.'\" AND\n\t\t\ta.id_image_cover!=i.id\n\t\tORDER BY i.id DESC\n\t');\n\techo '<div style=\"display:none;\">';\n\twhile($image=mysql_fetch_assoc($images_profile)){\n\t\t$img_full_src=FILESERVER.'img/users/'.$image['image_path'];\n\t\t$showEditImages=($showEditImages?'&showMenu':'');\n\t\techo\n\t\t\t'<a id=\"'.md5($img_full_src).'\" class=\"grouped_PP\" rel=\"'.$rel.'\"'.\n\t\t\t\t'href=\"views/photos/picture.view.php?src='.$img_full_src.'&id_photo='.md5($image['id']).'&id_user='.$userId.$showEditImages.'\">'.\n\t\t\t\t'<img src=\"'.$img_full_src.'\" alt=\"\"/>'.\n\t\t\t'</a>';\n\t}\n\techo '</div>';\n}", "public function actionImg(){\n if (!isset($_GET['f'])) exit;\n $size = 200;\n if (isset($_GET['s'])) $size = $_GET['s'];\n $filename = Yii::app()->basePath . DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR . Yii::app()->params['coverPhotos'].substr($_GET['f'], 0, 2). DIRECTORY_SEPARATOR.$_GET['f'];\n if (!file_exists($filename)) exit;\n \n $type = exif_imagetype($filename);\n \n Yii::app()->clientScript->reset();\n $this->layout = 'none'; // template blank\n\t\tswitch ($type){\n\t\t\tcase IMAGETYPE_JPEG: header(\"Content-Type: image/jpg\"); break;\n\t\t\tcase IMAGETYPE_PNG: header(\"Content-Type: image/png\"); break;\n\t\t\tcase IMAGETYPE_GIF: header(\"Content-Type: image/gif\"); break;\n\t\t}\n\t\t\n header(\"Content-Description: Remote Image\");\n \n list($width, $height) = getimagesize($filename);\n $r = $width / $height;\n \n $oldMin = ($width > $height ? $height : $width);\n if ($oldMin > $size) {\n // don't do enything\n print file_get_contents($filename);\n exit;\n }\n \n if ($width > $height) {\n $newwidth = $size*$r;\n $newheight = $size;\n } else {\n $newheight = $size/$r;\n $newwidth = $size;\n }\n\t\t\n\t\tswitch ($type){\n\t\t\tcase IMAGETYPE_JPEG: $src = imagecreatefromjpeg($filename); break;\n\t\t\tcase IMAGETYPE_PNG: $src = imagecreatefrompng($filename); break;\n\t\t\tcase IMAGETYPE_GIF: $src = imagecreatefromgif($filename); break;\n\t\t}\n\t\t\n $dst = imagecreatetruecolor($newwidth, $newheight);\n fastimagecopyresampled($dst, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height, 2);\n \n\t\tswitch ($type){\n\t\t\tcase IMAGETYPE_JPEG: @imagejpeg($dst); break;\n\t\t\tcase IMAGETYPE_PNG: @imagepng($dst); break;\n\t\t\tcase IMAGETYPE_GIF: @imagegif($dst); break;\n\t\t}\n\t\t\n imagedestroy($dst);\n exit;\n }", "public function getSummary(): string\n {\n return $this->summary;\n }", "public function get_description()\n {\n return 'Populate your image of the day gallery with 40 LOLCAT images. After installing the addon select the image of the day in the usual way by going to Admin zone > Content > Images of the day and select the image you want to display.';\n }", "public function getBrief() {\n\t\t$baseUrl = \"http://\" . $_SERVER['SERVER_NAME'] . Director::BaseURL();\n\t\t$themeDir = $baseUrl . 'themes/' . SSViewer::current_theme();\n\t\t$html = '<div class=\"brief\">\n\t\t\t\t\t<div class=\"cell\" >'.$this->statusButton().'</div>\n\t\t\t\t\t<div class=\"cell weather\"><img src=\"'.$themeDir.'/images/weather_report/'.$this->getWeatherBrief().'.png\" alt=\"weather-icon\" /></div>\n\t\t\t\t\t<div class=\"cell temp\">'.$this->getWeatherTempurature().'&deg;</div>\n\t\t\t\t\t<div class=\"cell snowfall\">\n\t\t\t\t\t\tLast Snowfall<br />\n\t\t\t\t\t\t<span class=\"amount\">'.$this->getLatestFall().'cm</span><br />\n\t\t\t\t\t\t\ton '.$this->getLatestFallDate().'\n\t\t\t\t\t</div>\n\t\t\t\t</div>';\n\t\treturn $html;\n\t}", "function getSummary(){\n\t\t$output=\"{$this->getTitle()} ({$this->getProducer()})\";\n\t\treturn $output;\n\t}", "public function getSummary(): string {\n return $this->body['summary'] ?? \"none\";\n }", "public static function xms_id_display() { \r\n\t $customer_id = new Customer_ID_Model();\r\n\t $results = $customer_id->getUserProfile();\r\n\t \r\n\t foreach($results as $result){\r\n\t \t$user_image = $result->profile;\r\n\t }\r\n\t $user_img = $user_image;\r\n\t \r\n\t?>\r\n\t <span style=\"margin:20px 0 20px 0\" class=\"image mr-half inline-block\">\r\n\t <a href=\"/my-account/edit-account\"><img alt=\"\" src=\"<?php echo $user_img;?>\" class=\"avatar-photo\" width=\"170\" height=\"120\"></a>\r\n\t </span>\r\n\t<?php \r\n }", "public function getImageUrl();", "function printImage($imageUrl = '', $class = '') {\n global $app;\n\n $asset_path = $app->make('Config')->get('app.asset_path');\n $size = getimagesize($asset_path . '/' . $imageUrl);\n\n $width = $size[0];\n $height = $size[1];\n\n return \"<img src='$imageUrl' width='$width' height='$height' class='$class' />\";\n }", "public function displayImage($displayImage)\n {\n $ext = $displayImage->getClientOriginalExtension();\n\n $img = Image::make($displayImage)->resize(400, 500, function ($c) {\n $c->aspectRatio();\n $c->upsize();\n });\n $img->resizeCanvas(400, 500, 'center', false, array(255, 255, 255, 0));\n\n $img->crop(300, 340, null, null);\n $rend = rand(00000000, 99999999).'-'.Auth::user()->id;\n $productName = $rend.'.'.$ext;\n $img->save(public_path('storage/display_image/'.$productName));\n return $productName;\n }", "function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}", "function _showtitle($img,$data){\n global $ID;\n\n if(!$data['showtitle'] ) { return ''; }\n\n //prepare link\n $lnk = ml($img['id'],array('id'=>$ID),false);\n\n // prepare output\n $ret = '';\n $ret .= '<br /><a href=\"'.$lnk.'\">';\n $ret .= hsc($this->_meta($img,'title'));\n $ret .= '</a>';\n return $ret;\n }", "public function render(){\n\t\t$out = \"<img\".($this->getID() ? \" id=\\\"\".$this->getID().\"\\\"\" : \"\");\n\t\t\n\t\t$out .= \" src=\\\"\".$this->link.\"\\\"\";\n\t\t\n\t\tforeach( $this->getProperties() as $key => $value ) {\n\t\t\t$out .= \" \".$key.\"=\\\"\".$value.\"\\\"\"; //example: _width=\"100px\"\n\t\t}\n\t\t$out .= \" />\"; //end of opening html tag and html properties\n\t\t\n\t\treturn $out;\n\t}", "public function showThumbnails() {\n $this->generateHead();\n $thumbnailsArray = $this->getThumbnailsArray();\n for($i = 0; $i < $this->rowsCount * 2; $i ++){\n echo '<div class=\"col-xs-6\">';\n echo '<a href=\"big_img.php?img_id=' . $thumbnailsArray[$i]['id'] . '\" class=\"thumbnail\">';\n echo '<img src=\"images/thumbnails/' . $thumbnailsArray[$i]['filename'] . '\" alt=\"\">';\n echo '</a>';\n echo '</div>';\n }\n $this->generateFoot();\n }", "public function display($data) {\n\t\t\tif (isset($data[$this->get_field_name('image_id')])) {\n\t\t\t\t$image_src = wp_get_attachment_image_src(intval($data[$this->get_field_name('image_id')]), esc_attr($data[$this->get_field_name('image_id').'-size']), false);\n\t\t\t\t$image_alignment = esc_attr(str_replace('-', ' ', $data[$this->get_field_name('hero_alignment')]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$image_src = '';\n\t\t\t\t$image_alignment = '';\n\t\t\t}\n\t\t\t$title = (!empty($data[$this->get_field_name('title')]) ? esc_html($data[$this->get_field_name('title')]) : '');\n\t\t\t$content = (!empty($data[$this->get_field_name('content')]) ? $this->wp_formatting($data[$this->get_field_name('content')]) : '');\n\t\t\t$box_height = (!empty($data[$this->get_field_name('box-height')]) ? intval($data[$this->get_field_name('box-height')]) : 0);\n\t\t\t$id_base = $this->id_base;\n\t\t\t$url = $this->get_link_url($data);\n\t\t\t\n\t\t\treturn $this->load_view($data, compact('image_src', 'title', 'content', 'box_height', 'image_alignment', 'id_base', 'url'));\n\t\t\t//return $html;\n\t\t}", "public function Photo(){\n\t\t$photoId = \"491634914183411\";\n\t\t$imgInfo \t\t\t= 'https://graph.facebook.com/'.$photoId.'?access_token='.$this->session->userdata('oauth_token');\n\t\techo $imgInfo;\n\t}", "function get_summary() {\n return $this->summary;\n }", "public function display() {\n //send header to browser\n header( \"Content-type: {$this->mimetype}\" );\n\n //output image\n if ( $this->mimetype == 'image/jpeg' ) {\n imagejpeg( $this->image );\n }\n if ( $this->mimetype == 'image/png' ) {\n imagepng( $this->image );\n }\n if ( $this->mimetype == 'image/gif' ) {\n imagegif( $this->image );\n }\n }", "function displayImageInformation()\n {\n // query the number of saved images of the account\n $savedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'SAVED'\") or die(mysql_error());\n \n // query the number of deleted images of the account\n $deletedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n // calculate the number of images\n $savedImagesCount = mysql_num_rows($savedImagesQuery);\n $deletedImagesCount = mysql_num_rows($deletedImagesQuery);\n $totalImagesCount = $savedImagesCount + $deletedImagesCount;\n \n // calculate the hard disk space the saved image has used\n $savedImagesFileSize = 0;\n \n for($i=0; $i<$savedImagesCount ; $i++)\n {\n // incrementally compute the file sizes of each saved images in Kilobytes\n // 1 KB = 1024 bytes\n $savedImagePath = mysql_result($savedImagesQuery,$i,\"path\");\n $savedImagesFileSize = $savedImagesFileSize + ((filesize($savedImagePath)) / 1024);\n }\n \n // calculate the hard disk space the deleted image has used\n $deletedImagesFileSize = 0;\n \n for($i=0; $i<$deletedImagesCount; $i++)\n {\n // incrementally compute the file sizes of each deleted images in kilobytes\n // 1 KB = 1024 bytes\n $deletedImagePath = mysql_result($deletedImagesQuery,$i,\"path\");\n $deletedImagesFileSize = $deletedImagesFileSize + ((filesize($deletedImagePath)) / 1024);\n }\n \n // compute the total disk space that is being used\n $totalImagesFileSize = $savedImagesFileSize + $deletedImagesFileSize;\n \n // display the images information\n echo \"\n <p>Image Information</p>\n <p id='box'>\n Saved Images : \".$savedImagesCount.\" (\".round($savedImagesFileSize,2).\" KB)<br>\n Deleted Images : \".$deletedImagesCount.\" (\".round($deletedImagesFileSize,2).\" KB)<br><br>\n Total Images : \".$totalImagesCount.\" (\".round($totalImagesFileSize,2).\" KB)<br>\n </p>\";\n \n return;\n }", "public function options_page_overview() \n\t\t{\n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach( $this->size_groups as $size_group => $sizes ) \n\t\t\t{\n\t\t\t\t$html .= '<h3>' . $this->get_group_headline( $size_group ) . '</h3>';\n\t\t\t\t\n\t\t\t\t$html .= '<ul>';\n\t\t\t\t\n\t\t\t\tforeach( $sizes as $key => $image ) \n\t\t\t\t{\n\t\t\t\t\t$info = $image['width'] . '*' . $image['height'];\n\t\t\t\t\tif( isset( $image['crop'] ) && true === $image['crop'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$info .= ' ' . __( '(cropped)', 'avia_framework' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$info .= ' - ' . $this->get_image_key_info( $key );\n\t\t\t\t\t\n\t\t\t\t\t$html .= '<li>' . $info . '</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '</ul>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "public function display($echo = true)\r\n {\r\n $output = \"\";\r\n if (count($this->resultSet) > 0) {\r\n if ($this->shuf) {\r\n shuffle($this->resultSet);\r\n }\r\n $totalShown = 0;\r\n $output .= '<div class=\"tile ' . $this->class . '\"><a href=\"' . $this->URL . '\">';\r\n if ($this->barTitle != '') {\r\n $output .= '<div class=\"tileTitle\"><span>' . $this->barTitle . '</span></div>';\r\n }\r\n for ($i = 0; $i < count($this->resultSet); $i++) {\r\n $artifact = $this->resultSet[$i];\r\n if ($totalShown == count($this->resultSet) - 1) {\r\n $output .= '<div class=\"tileItem lastTileItem\"><div class=\"tileImgCont\">';\r\n } else {\r\n $output .= '<div class=\"tileItem\"><div class=\"tileImgCont\">';\r\n }\r\n List($width, $height) = getimagesize($artifact->getThumbImage(artifact::TILE_CONTEXT));\r\n if ($width == $height) {\r\n $output .= '\t\t<img src=\"' . $artifact->getThumbImage(artifact::TILE_CONTEXT) . '\" alt=\"' . $artifact->getAccessionNumber() . '\" width=\"' . self::TILE_IMAGE_SIZE . '\">';\r\n } else if ($width > $height) {\r\n $newWidth = self::TILE_IMAGE_SIZE / $height * $width;\r\n $output .= '\t\t<img src=\"' . $artifact->getThumbImage(artifact::TILE_CONTEXT) . '\" alt=\"' . $artifact->getAccessionNumber() . '\" height=\"' . self::TILE_IMAGE_SIZE . '\" style=\"margin-left: -' . ($newWidth - self::TILE_IMAGE_SIZE) / 2 . 'px\">';\r\n } else { //$width < $height\r\n $output .= '\t\t<img src=\"' . $artifact->getThumbImage(artifact::TILE_CONTEXT) . '\" alt=\"' . $artifact->getAccessionNumber() . '\" width=\"' . self::TILE_IMAGE_SIZE . '\">';\r\n }\r\n $output .= '\t\t</div></div>';\r\n $totalShown++;\r\n }\r\n $output .= '</a></div>';\r\n if ($echo) {\r\n echo $output;\r\n }\r\n }\r\n return $output;\r\n }", "function Display_Photo($Nom, $Prenom, $id, $Font_Size)\n{\n\tif(!isset($Font_Size)) {\n\t\t$Font_Size=\"1\";\n\t}\n\t\n\tif (file_exists(\"Photos/Individu_\".$id.\".jpg\")) { \n\t\tif ($Prenom == \"NO LINK\"){\n\t\t\techo '<A HREF='.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].' class=\"tooltip\"><FONT SIZE=\"'.$Font_Size.'\">'.$Nom.'</FONT>';\n\t\t\techo '<em><span></span>';\n\t\t\techo \"<img src='Photos/Individu_\".$id.\".jpg' height='100' border='1' alt='Paroissien_\".$id.\"'>\";\n\t\t\techo '<br><font face=verdana size=1>'.$Nom.'</font>';\n\t\t\techo '</em></A>';\n\t\t} else {\n\t\t\techo '<A HREF=/SuiviParoissien.php?action=edit_Individu&id='.$id.' class=\"tooltip\"><FONT SIZE=\"'.$Font_Size.'\">'.$Prenom.' '.$Nom.'</FONT>';\n\t\t\techo '<em><span></span>';\n\t\t\techo \"<img src='Photos/Individu_\".$id.\".jpg' height='100' border='1' alt='Paroissien_\".$id.\"'>\";\n\t\t\techo '<br><font face=verdana size=1>'.$Prenom.' '.$Nom.'</font>';\n\t\t\techo '</em></A>';\n\t\t}\n\t} else {\n\t\tif ($Prenom == \"NO LINK\"){\n\t\t\techo '<A HREF='.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'>';\n\t\t\techo '<FONT SIZE=\"'.$Font_Size.'\">' .$Nom. '</FONT> ';\n\t\t\techo '</A>';\n\t\t} else {\n\t\t\techo '<A HREF=/SuiviParoissien.php?action=edit_Individu&id='.$id.'>';\n\t\t\techo '<FONT SIZE=\"'.$Font_Size.'\">' .$Prenom. ' ' .$Nom. '</FONT> ';\n\t\t\techo '</A>';\n\t\t}\n\t}\n}", "function view_builder_logo_inside_project($img,$w,$h,$alt)\n{\n if(file_exists(\"../builder/\".$img) && $img!='')\n\n $temp= \"<img src=\\\"../include/phpThumb.php?src=../builder/\".$img.\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" \n alt='$alt' class='floatL mar12R' />\";\n else\n $temp =\"<img src=\\\"../include/phpThumb.php?src=../builder/nophoto.jpg\\\"&w=$w&h=$h&iar=1\\\"; border='0' width=\\\"$w\\\" height=\\\"$h\\\" alt='$alt' class='floatL mar12R'/>\";\n \n\treturn $temp;}", "function stats_display($what,$count,$url) {\n $max= 400;\t\t// max is a number to ensure the maximum lenght of the graph\n $length = 575; \t// length is the maximal lenght of the image\n\n echo \"<tr><td width=47%>&nbsp;<a href=\\\"\".$url.\"\\\">\".$what.\"</A>:</td>\\n\";\n echo \"<td width=1%>&nbsp;</td>\\n\";\n echo \"<td width=52%><img src=\\\"images/leftbar.gif\\\" height=14 width=7 Alt=\\\"${$type}[$i]\\\"><img src=\\\"images/mainbar.gif\\\" Alt=\\\"${$type}[$i]\\\" height=14 width=\", $count * $length / $max, \"><img src=\\\"images/rightbar.gif\\\" height=14 width=7 Alt=\\\"${$type}[$i]\\\">&nbsp; $count</td></tr>\\n\";\n echo \"</FONT></td></tr>\";\n}", "function ShowImage($spr = NULL, $lang_id = NULL, $img = NULL, $size = NULL, $quality = 85, $wtm = NULL, $parameters = NULL, $return_src=null)\n {\n\n $size_auto = NULL;\n $size_width = NULL;\n $size_height = NULL;\n $alt = NULL;\n $title = NULL;\n $str = NULL;\n\n $img_with_path = $this->GetImgPath($img, $spr, $lang_id);\n// echo '<br/>$img_with_path='.$img_with_path;\n $imgSmall = ImageK::getResizedImg($img_with_path, $size, $quality, null);\n //echo '<br/>$imgSmall='.$imgSmall;\n if($return_src){\n return $imgSmall;\n }else{\n return '<img src=\"'.$imgSmall.'\" '.$parameters.' />';\n }\n }", "function headimage($companyname)\n{ \n\n //initalize variable\n $output = \"\";\n\n //query to get headimage\n $query = \"SELECT * FROM company WHERE companyname = '$companyname'\";\n\n //function call from model to get image\n $result = fetchfunction($query);\n\n while( $row = $result->fetch_assoc())\n {\n $output .= '<img src=\"images/'.$row[\"headimage\"].'\" class=\"img-thumbnail\";> ';\n }\n \n echo $output;\n}", "function horizon_header_with_image( $title, $description, $image_url, $alt = '') {\n\t\t?>\n\t\t\t<header class=\"horizon-header\">\n\t\t\t\t<h2 class=\"title\"><?php echo wp_kses( $title, array('span' => array() ) ); ?></h2>\n\t\t\t\t<span class=\"sep\"></span>\n\t\t\t\t<p class=\"desc\"><?php echo esc_html( $description ); ?></p>\n\t\t\t\t<figure class=\"banner-blog col-lg-12\">\n\t\t\t\t\t<img src=\"<?php echo esc_url( $image_url ); ?>\" alt=\"<?php echo $alt; ?>\">\n\t\t\t\t</figure><!-- .banner-blog -->\n\t\t\t</header><!-- .horizon-header -->\n\t\t<?php\n\t}", "function showcaseGallery($groupId, $title) {\n\t$config = new ConfigReader();\n\t$config->loadConfigFile('assets/core/config/widgets/showGroup/gallery.properties');\n\t\n\t$maxDisplay = $config->readValue('maxDisplay');\n\t$maxPerRow = $config->readValue('maxPerRow');\n\t$w = $config->readValue('maxImageSizeX');\n\t$h = $config->readValue('maxImageSizeY');\n\t\n\t//if the user is not an admin, validate that the user is a member of this group\n\t$result = mysql_query(\"SELECT parentId, imageUrl FROM imagesGroups WHERE parentId = '{$groupId}' AND inSeriesImage = 1 ORDER BY RAND() LIMIT $maxDisplay\");\n\t$total = mysql_num_rows($result);\n\t\n\tif ($total > 0) {\n\t\t\n\t\t$urlCategory =urlencode($row->category);\n\t\t$caption = htmlentities($row->caption);\n\t\t\n\t\t$x = 0;\n\t\t$count = 0;\n\t\t\n\t\t//adjust maxPerRow is it's greater than the returned number of objects\n\t\tif ($maxPerRow > $total) {\n\t\t\t\n\t\t\t$maxPerRow = $total;\n\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"\t\t\t\t<div id=\\\"gallery_container\\\">\\n\";\n\t\t$return .= \"\t\t\t\t\t<div class=\\\"header\\\"><a href=\\\"/groupgalleries/id/$groupId\\\">$title</a></div>\\n\";\n\t\t$return .= \"\t\t\t\t\t<div class=\\\"body\\\">\\n\";\n\t\t\n\t\twhile ($row = mysql_fetch_object($result)) {\n\t\t\t\n\t\t\t//count this row's column itteration\n\t\t\t$x++;\n\t\t\t\n\t\t\t//keep track of total displayed so far\n\t\t\t$count++;\n\t\t\t\n\t\t\t//determine if separator class is applied\n\t\t\tif ($x % $maxPerRow != 0) {\n\t\t\t\t\n\t\t\t\t$separator = \" separator\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$separator = \"\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return .= \"<div class=\\\"gallery_image_container$separator\\\">\\n\";\n\t\t\t$return .= \"\t<a href=\\\"/groupgalleries/id/$groupId\\\"><img src=\\\"/file.php?load=$row->imageUrl&w=$w&h=$h\\\" border=\\\"0\\\"></a>\\n\";\n\t\t\t$return .= \"</div>\\n\";\n\t\t\t\n\t\t\t//row separator\n\t\t\tif ($x == $maxPerRow && $count < $total) {\n\t\t\t\t\n\t\t\t\t$return .= \"\t\t\t<div class=\\\"gallery_image_row_separator\\\"></div>\\n\";\n\t\t\t\t$x = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"\t\t\t\t\t</div>\\n\";\n\t\t$return .= \"\t\t\t\t</div>\\n\";\n\t\t\n\t}\t\n\t\n\treturn($return);\n\t\n}", "public function getCoverAttribute(): string\n {\n if ($this->hasMedia('image') && $this->relationLoaded('media') && config('filesystems.default') !== 'public') {\n return $this->getFirstTemporaryUrl(Carbon::now()->addHour(), 'image', 'sm');\n }\n\n if ($this->getFirstMediaUrl('image', 'sm')) {\n return $this->getFirstMediaUrl('image', 'sm');\n }\n\n return \\Storage::url('images/not-found.jpg');\n }", "public function itestAction(){\n $dashboard = new Dashboard();\n \n //fetch covergae summary\n $coverageSummary = $dashboard->fetchCoverageSummary();\n $this->view->assign('csummary', $coverageSummary);\n }", "function cbGenHtml($number, $title, $englishTitle, $author, $summary,\n $summaryCount, $url, $authorName, $date) {\n echo\n '<p align=\"center\">'\n . \"<p align='center'>\"\n . cbGenSpan(\"number\", $number)\n . ' - '\n . cbGenSpan(\"german-title\", $title)\n . \"<br>\"\n . cbGenSpan(\"english-title\", $englishTitle)\n . \"<br>\"\n . cbGenSpan(\"author\", $author)\n . \"<hr width='20%'/>\"\n . \"</p>\"\n . \"<htr>\"\n . \"<table><tr><td>\"\n ;\n\n if ($summaryCount > 0) {\n echo cbGenSpan(\"text\", $summary);\n echo '</td>'\n . '<td valign=\"top\">'\n\t. cbGenCover($url, \"right\")\n . '</td></tr></table>'\n ;\n\n } else {\n global $MAIN_URL, $EDIT_SUMMARY_URL;\n echo\n '</table>'\n . '<p align=\"center\">'\n\t. cbGenCover($url, \"center\")\n . '<br>'\n . 'No summary was found for this issue.<br>\n You can <a href=\"'\n . $EDIT_SUMMARY_URL\n . '?number='\n . $number\n . '\">submit one</a> or return to the '\n\t. '<a href=\"' . $MAIN_URL . '\">main page</a></p>';\n }\n\n echo '<p align=\"right\">'\n . (is_null($authorName) ? \"\" : cbGenSpanSmall(\"author\", $authorName))\n . (is_null($date) ? \"\" : \" \" . cbGenSpanSmall(\"date\", $date))\n . '</p>'\n ;\n}", "public function cover($size = 'large', $alt = '') {\n\n\t\t\t$output = '';\n\n\t\t\t$id = get_post_thumbnail_id($this->post->ID);\n\t\t\t$meta = get_post_meta($id, '_wp_attachment_image_alt', true);\n\n\t\t\t$alt = empty($alt) ? $meta : $alt;\n\t\t\t$src = get_the_post_thumbnail_url($this->post->ID, $size);\n\n\t\t\t$file = empty($id) ? '' : get_file_path($id);\n\n\t\t\t$width = 1280;\n \t\t$height = round($width / get_image_ratio($file));\n\t\t\t\n\t\t\t$src = empty($src) ? esc_url(get_template_directory_uri()).'/img/img-default-640x320.png' : $src;\n\t\t\t$loader = esc_url(get_template_directory_uri()).'/img/img-loader.png';\n\n\t\t\t$output = '<figure class=\"cover-graphic\"><img src=\"'.$loader.'\" data-srcset=\"'.$src.' 1x, '.$src.' 2x\" class=\"lazyload\" width=\"'.$width.'\" height=\"'.$height.'\" alt=\"'.$alt.'\" /></figure>'.\"\\n\";\n\n\t\t\treturn $output;\n\t\t}" ]
[ "0.7493668", "0.6927356", "0.69032794", "0.6735994", "0.6732984", "0.6632519", "0.6328679", "0.6265372", "0.621118", "0.6185384", "0.61649746", "0.614992", "0.61335355", "0.61061037", "0.6096102", "0.6072653", "0.6058839", "0.6028207", "0.60166925", "0.59910464", "0.5974214", "0.5956302", "0.59511006", "0.59480214", "0.59306866", "0.59271115", "0.5904072", "0.58946437", "0.58791834", "0.5869106", "0.5868824", "0.5854465", "0.5848042", "0.5814775", "0.5806964", "0.57994723", "0.57814103", "0.57717425", "0.57654667", "0.5760427", "0.5746412", "0.5744393", "0.57387584", "0.5738409", "0.5730006", "0.572665", "0.57147926", "0.5698101", "0.5695925", "0.56893116", "0.5681052", "0.567095", "0.5664891", "0.5663866", "0.5656579", "0.5653453", "0.5653141", "0.56525266", "0.5642936", "0.5633083", "0.56276655", "0.5620042", "0.5613474", "0.561118", "0.56077546", "0.560696", "0.56054896", "0.55996835", "0.5596607", "0.5594455", "0.559135", "0.55897963", "0.5587265", "0.55864316", "0.5581306", "0.5580568", "0.5579016", "0.5566299", "0.5561693", "0.55578005", "0.55555236", "0.5550294", "0.5548767", "0.55470365", "0.55380553", "0.5535372", "0.5528298", "0.55279094", "0.55249774", "0.5518907", "0.55160177", "0.5510809", "0.5510397", "0.5510177", "0.5506627", "0.55061406", "0.5504717", "0.5502076", "0.5496101", "0.54891676" ]
0.6236638
8
Generate the HTML content for this summary.
function cbGenHtml($number, $title, $englishTitle, $author, $summary, $summaryCount, $url, $authorName, $date) { echo '<p align="center">' . "<p align='center'>" . cbGenSpan("number", $number) . ' - ' . cbGenSpan("german-title", $title) . "<br>" . cbGenSpan("english-title", $englishTitle) . "<br>" . cbGenSpan("author", $author) . "<hr width='20%'/>" . "</p>" . "<htr>" . "<table><tr><td>" ; if ($summaryCount > 0) { echo cbGenSpan("text", $summary); echo '</td>' . '<td valign="top">' . cbGenCover($url, "right") . '</td></tr></table>' ; } else { global $MAIN_URL, $EDIT_SUMMARY_URL; echo '</table>' . '<p align="center">' . cbGenCover($url, "center") . '<br>' . 'No summary was found for this issue.<br> You can <a href="' . $EDIT_SUMMARY_URL . '?number=' . $number . '">submit one</a> or return to the ' . '<a href="' . $MAIN_URL . '">main page</a></p>'; } echo '<p align="right">' . (is_null($authorName) ? "" : cbGenSpanSmall("author", $authorName)) . (is_null($date) ? "" : " " . cbGenSpanSmall("date", $date)) . '</p>' ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function generateHtml()\n\t{\n\t}", "abstract public function generateHtml();", "public function getContent()\n {\n $this->_html = '<h2>' . $this->displayName . '</h2>';\n if (Tools::isSubmit('btnSubmit')) {\n $this->updateConfiguration();\n }\n $this->showConfigurationForm();\n return $this->_html;\n }", "public function generateHtml()\n {\n return $this->presenter->getView()->generateHtml();\n }", "public function render_content() {\n\t\t\t$allowed_html = array(\n\t\t\t\t'a' => array(\n\t\t\t\t\t'href' => array(),\n\t\t\t\t\t'title' => array(),\n\t\t\t\t\t'class' => array(),\n\t\t\t\t\t'target' => array(),\n\t\t\t\t),\n\t\t\t\t'br' => array(),\n\t\t\t\t'em' => array(),\n\t\t\t\t'strong' => array(),\n\t\t\t\t'i' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t);\n\t\t\t?>\n\t\t\t<div class=\"single-accordion-custom-control\">\n\t\t\t\t<div class=\"single-accordion-toggle\"><?php echo esc_html( $this->label ); ?><span class=\"accordion-icon-toggle dashicons dashicons-plus\"></span></div>\n\t\t\t\t<div class=\"single-accordion customize-control-description\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $this->description ) ) {\n\t\t\t\t\t\techo '<ul class=\"single-accordion-description\">';\n\t\t\t\t\t\tforeach ( $this->description as $key => $value ) {\n\t\t\t\t\t\t\techo '<li>' . esc_attr( $key ) . wp_kses( $value, $allowed_html ) . '</li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</ul>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo wp_kses( $this->description, $allowed_html );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function generateHtml() {\n $this->addToBody(\"<div class=\\\"col-xs-12\\\" style=\\\"height: 20vh;\\\"></div>\", Page::BOTTOM);\n return \"<!DOCTYPE HTML><html lang=\\\"en\\\">\" . $this->generateHtmlHead() . $this->generateHtmlBody() .\n \"</html>\";\n }", "public function render() {\n echo $this->getHtml();\n }", "public function buildHTML() {\n\n\t\t// Load the header\n\t\tinclude 'templates/header.php';\n\n\t\t// Load the content\n\t\t$this->contentHTML();\n\n\t\t// Load the footer\n\t\tinclude 'templates/footer.php';\n\n\t}", "public function run()\n {\n return \\yii\\helpers\\Html::tag($this->container, $this->content, $this->getOptions());\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction([\n 'width' => '12%',\n 'printable' => false,\n 'exportable' => false,\n 'searchable' => false\n ])\n ->paging(true)\n ->lengthMenu([[50, 100,500, -1], [50, 100,500, 'All']])\n ->scrollX(true)\n ->parameters($this->getBuilderParameters());\n }", "public function get_content() {\n global $CFG, $DB, $COURSE;\n\n if ($this->content !== null) {\n return $this->content;\n }\n\n if (!has_capability('report/learn_analytics:view', $this->page->context)) {\n $this->content = '';\n return $this->content;\n }\n\n $risks = report_learn_analytics_get_course_summary($COURSE->id);\n $users = $DB->get_records_list('user', 'id', array_keys($risks), '', 'id, firstname, lastname');\n\n // Grab the items to display.\n $this->content = new stdClass();\n $renderer = $this->page->get_renderer('block_learn_analytics');\n $this->content->text = $renderer->user_risk_list($risks, $users);\n return $this->content;\n }", "function getSummary(){\n\t\t$output=\"{$this->getTitle()} ({$this->getProducer()})\";\n\t\treturn $output;\n\t}", "public function generate()\n {\n # Build teh Header\n $this->buildHeader();\n\n # Switch the Views\n switch ($this->view) {\n case 'day':\n $this->buildBodyDay();\n break;\n case 'week':\n $this->buildBodyWeek();\n break;\n default:\n $this->buildBody();\n break;\n }\n # return thr string\n return $this->html;\n }", "public function html() {}", "public function getContent()\n {\n\n //Save Form configuration post data\n $this->__saveConfiguration();\n\n //Show Configuration form\n $this->__setConfigurationForm();\n\n return $this->_html;\n }", "public function toHtml()\n {\n return $this->render();\n }", "public function toHtml()\n {\n return $this->render();\n }", "protected function displayContent()\n\t{\n\t\t$html = \"\\t\\t\\t\\t\".'<div id=\"content\">'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\".'<h2 class=\"title\">'.$this->pageInfo['pageHeading'].'</h2>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\".'<div class=\"fineprint\">'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\".'<ul>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>What information do we collect?</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">We collect information from you when you register on our site. When ordering or registering on our site, as appropriate, you may be asked to enter your: name, e-mail address, mailing address or phone number. You may, however, visit our site anonymously.</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>What do we use your information for?</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">Any of the information we collect from you may be used in one of the following ways:<br />\n\t\t\t<strong>To personalize your experience:</strong><br />\n\t\t\tYour information helps us to better respond to your individual needs.<br /> \n\t\t\t<strong>To improve our website:</strong><br />\n\t\t\tWe continually strive to improve our website offerings based on the information and feedback we receive from you.<br /> \n\t\t\t<strong>To improve customer service:</strong><br />\n\t\t\tYour information helps us to more effectively respond to your customer service requests and support needs.<br />\n\t\t\t<strong>To process transactions</strong><br />\n\t\t\tYour information, whether public or private, will not be sold, exchanged, transferred, or given to any other company for any reason whatsoever, without your consent, other than for the express purpose of delivering the purchased product or service requested.<br />\n\t\t\t<strong>To administer a site feature</strong><br />\n\t\t\tThis may include a contest, promotion, survey or other<br />\n\t\t\t<strong>To send periodic emails</strong><br />\n\t\t\tThe email address you provide for order processing, may be used to send you information and updates pertaining to your order, in addition to receiving occasional company news, updates, related product or service information, etc.</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>How do we protect your information?</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">We implement a variety of security measures to maintain the safety of your personal information when you place an order or enter, submit, or access your personal information.</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\".'</ul>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\".'<ul>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>Do we use cookies?</li>'.\"\\n\";\t\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">We do not use cookies.</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>Do we disclose any information to outside parties?</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>Registered Users</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">All registered users of our site may make any changes to their information at anytime by logging in and going to the \\'Your Account\\' page.</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>Terms and Conditions</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">Please also visit our Terms and Conditions section establishing the use, disclaimers, and limitations of liability governing the use of our website at <a href=\"index.php?page=terms\">terms and conditions</a></li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>Your consent</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">By using our site, you consent to our online privacy policy.</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>Changes to our Privacy Policy</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">If we decide to change our privacy policy, we will post those changes on this page. This policy was last modified on 7 May 2013</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li><i class=\"icon-question-sign\"></i>Contacting us</li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\".'<li class=\"answer\">If there are any questions regarding this privacy policy you may <a href=\"index.php?page=contact\">contact us</a></li>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\\t\".'</ul>'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\\t\\t\".'</div><!-- fineprint -->'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\\t\".'</div><!-- home_text -->'.\"\\n\";\n\t\t$html .= \"\\t\\t\\t\\t\".'</div><!-- content -->'.\"\\n\";\n\t\treturn $html;\n\t}", "public function getHTML() {\n\t\tglobal $tpl;\n\n $tpl->addCss(\n 'Customizing/global/plugins/Services/Repository/RepositoryObject/'\n . 'Review/templates/default/css/Review.css'\n );\n $path_to_il_tpl = ilPlugin::getPluginObject(\n IL_COMP_SERVICE,\n 'Repository',\n 'robj',\n 'Review'\n )->getDirectory();\n $custom_tpl = new ilTemplate(\n \"tpl.aspect_row.html\",\n true,\n true,\n $path_to_il_tpl\n );\n\t\tforeach ($this->si_guis as $si_gui) {\n\t\t\t$si_gui->insert($custom_tpl);\n\t\t}\n\t\treturn $custom_tpl->get();\n\t}", "public function toHtml()\n {\n $oldContents = $this->contents;\n\n $actions = $this->renderActions();\n if ($actions) {\n $this->addContent($actions);\n }\n\n $output = parent::toHtml();\n\n // Przywracamy poczatkowy stan\n $this->contents = $oldContents;\n\n return $output;\n }", "public function html()\n {\n if (!$this->hasContent() && !$this->isEditable()) {\n return '';\n }\n\n $content = $this->hasContent() ? $this->show() : $this->showDefault();\n\n // If the return data is a View then assign any parameters to it.\n if ($content instanceof View && !empty($this->viewParams)) {\n $content->with($this->viewParams);\n }\n\n return (string) $content;\n }", "public function render()\n {\n $html = System::template('admin/v_main.php', [\n 'title' => $this->title,\n 'content' => $this->content,\n ]);\n \n return $html;\n }", "protected function RenderSummary_HTML_line() {\n\t$out = \"\\n\"\n\t .$this->TitleHREF()\n\t .$this->CatNum()\n\t .' &ldquo;'\n\t .$this->NameString()\n\t .'&rdquo;</a>: '\n\t .$this->RenderStatus_HTML_line()\n\t .'<br>'\n\t ;\n\treturn $out;\n }", "public function display_summary() {\n // FIXME\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->ajax('')\n ->addAction(['width' => '150px'])\n ->parameters($this->getBuilderParameters());\n }", "public function toHtml() {\n\t\techo '<pre '.$this->getAttributes().'>'.$this->renderChildren().'</pre>';\n\t}", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->ajax('')\n ->addAction(['width' => '80px'])\n ->parameters($this->getBuilderParameters());\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->ajax('')\n ->addAction(['width' => '80px'])\n ->parameters($this->getBuilderParameters());\n }", "protected function _generateCoverageHtml()\n {\n $coverage = xdebug_get_code_coverage();\n ksort($coverage);\n\n foreach ($coverage as $file => $lines) {\n $this->_addToCoverageList($file, $lines);\n }\n\n foreach ($this->_coverage as $file => $lines) {\n $this->_writeCoverageReport($file, $lines);\n }\n\n $summary = '<html><head>';\n $summary .= '<style>\n\n\n </style>';\n $summary .= '</head><body>' . \"\\n\";\n $summary .= '<ul>' . \"\\n\";\n $tracker = Tracker::getInstance();\n\n $summary .= '<li><dl><dt>File</dt><dd>All Files</dd><dt>Lines</dt><dd>' . $tracker->getTotalLines() . '</dd><dt>Covered Lines</dt><dd>' . $tracker->getCoveredLines() . '</dd><dt>Percent</dt><dd>' . $tracker->getTotalCoverage() . '%</dd></dl></li>' . \"\\n\";\n\n foreach ($tracker->getCoverages() as $coverage) {\n $summary .= '<li><dl><dt>File</dt><dd><a href=\"' . $coverage->getPath() . '\">' . $coverage->getFile() . '</a></dd><dt>Lines</dt><dd>' . $coverage->getLineCount() . '</dd><dt>Covered Lines</dt><dd>' . $coverage->getCoveredLineCount() . '</dd><dt>Percent</dt><dd>' . $coverage->getPercentCovered() . '%</dd></dl></li>' . \"\\n\";\n }\n $summary .= '</ul>';\n file_put_contents($this->coverageDirectory() . '/index.html', $summary);\n }", "public function html() {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '80px'])\n ->parameters($this->getBuilderParameters());\n }", "public function displayContentOverview() {}", "public function getHTML() {\n // Define the variable to output the HTML in\n $out = '';\n\n // Add the HTML code for each meta tag\n foreach($this->meta as $entry)\n $out .= $entry->getHTML() . PHP_EOL;\n\n // Return the HTML code\n return $out;\n }", "public function Content()\n {\n return new View('dashboard1/Card1.tpl', [\n 'browsers' => $this->model->getBrowserVisits()\n ]);\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '80px'])\n ->parameters($this->getBuilderParameters());\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '80px'])\n ->parameters($this->getBuilderParameters());\n }", "public function getHtml() {\n\t\treturn $this->_boleto->getOutput();\n\t}", "public function toHTML()\n {\n }", "public function get_content_html()\n {\n\n ob_start();\n RP_SUB_Help::include_template($this->template_html, array_merge($this->template_variables, array('plain_text' => false)));\n return ob_get_clean();\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '120px'])\n ->parameters($this->getBuilderParameters());\n }", "public function displayData()\r\n {\r\n $htmlContent = '';\r\n $htmlContent .= html_entity_decode($this->content);\r\n return $htmlContent;\r\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->colReorderRealtime(true)\n ->minifiedAjax()\n ->addAction(['width' => '80px'])\n ->parameters($this->getBuilderParameters());\n }", "public function render() {\n echo \"<!DOCTYPE html>\\n\";\n echo \"<html>\\n\";\n $this->show_head();\n \n echo\"\\n<body>\\n\";\n echo $this->show_contents();\n\n echo \"\\n</body>\";\n echo \"\\n</html>\\n\\n\";\n }", "public function html()\n {\n $random_quote = $this->randomQuote();\n $cp_path = CP_ROUTE;\n return $this->view('widget', compact('random_quote','cp_path'))->render();\n }", "public function toHTML();", "public function renderContent()\n {\n // Isn't a legale section\n if(!$this->processor->section) return;\n\n $method = 'gen'.ucfirst($this->processor->section);\n if(method_exists($this, $method)) {\n $section = $this->$method();\n return $this->tplp->render($section, $this->processor->data,\n true, array(), true\n );\n }\n }", "public function getHtml()\n {\n return $this->_getHtml();\n }", "public function render_html() {\n global $USER;\n $courseid = \\mod_customcert\\element_helper::get_courseid($this->get_id());\n $content = $this->get_decoded_data()->content;\n $text = format_text($content, FORMAT_HTML, ['context' => \\context_course::instance($courseid)]);\n\n return \\mod_customcert\\element_helper::render_html_content($this, $this->render_table($text, $USER, true));\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->ajax('')\n ->addAction(['width' => '130px']);\n }", "protected function content() {\n $content = $this->crud->content(false);\n\n if ($content->isEmpty()) {\n return ' <!-- TODO -->';\n }\n\n return $content\n ->map(function(Field $field) {\n return $this->showGroup($field);\n })\n ->implode(\"\\n\");\n }", "public function getContent()\n {\n /**\n * If values have been submitted in the form, process.\n */\n if (((bool) Tools::isSubmit('submitWi_spentModule')) == true) {\n $this->postProcess();\n }\n switch (Tools::getValue('tab_sec')) {\n case 'list':\n $html = $this->getList();\n break;\n case 'help':\n $html = $this->context->smarty->fetch($this->local_path . 'views/templates/admin/help.tpl');\n break;\n default:\n $html = $this->renderForm();\n break;\n }\n\n $params = array(\n 'wi_spent' => array(\n 'module_dir' => $this->_path,\n 'module_name' => $this->name,\n 'base_url' => _MODULE_DIR_ . $this->name . '/',\n 'iso_code' => $this->context->language->iso_code,\n 'menu' => $this->getMenu(),\n 'html' => $html,\n 'errors' => empty($this->errors) ? array() : $this->errors,\n ),\n );\n\n $this->context->smarty->assign($params);\n\n $header = $this->context->smarty->fetch($this->local_path . 'views/templates/admin/header.tpl');\n $body = $this->context->smarty->fetch($this->local_path . 'views/templates/admin/body.tpl');\n $footer = $this->context->smarty->fetch($this->local_path . 'views/templates/admin/footer.tpl');\n\n return $header . $body . $footer;\n }", "public static function contentHtml(): string\n {\n Craft::$app->getView()->registerAssetBundle(SchedApiIntegrationUtilityUtilityAsset::class);\n\n $someVar = 'Have a nice day!';\n return Craft::$app->getView()->renderTemplate(\n 'sched-api-integration/_components/utilities/SchedApiIntegrationUtility_content',\n [\n 'someVar' => $someVar\n ]\n );\n }", "public function getHtml()\n {\n return $this->_toHtml();\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->ajax('')\n ->parameters($this->getBuilderParameters());\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumnsTable())\n ->minifiedAjax()\n ->addAction(['width' => '80px','printable' => false, 'exportable' => false,'title'=>'Acciones'])\n ->parameters($this->getBuilderParameters());\n }", "public function renderContent() {\r\n\t\t$data\t= array(\r\n\t\t\t'id'\t\t=> $this->getID(),\r\n\t\t\t'statuses'\t=> $this->getStatusesInfos(),\r\n\t\t\t'selected'\t=> $this->getSelectedStatuses()\r\n\t\t);\r\n\r\n\t\treturn Todoyu::render($this->tmpl, $data);\r\n\t}", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->ajax('')\n ->addAction(['width' => 'auto']);\n }", "public function render_content()\n\t\t{ ?>\n\t\t\t<label>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->description ); ?></span>\n <p class=\"description\">\n <span class=\"typography-size-label\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\"><input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "public function render_content() {\n\t\t\t$allowed_html = array(\n\t\t\t\t'a' => array(\n\t\t\t\t\t'href' => array(),\n\t\t\t\t\t'title' => array(),\n\t\t\t\t\t'class' => array(),\n\t\t\t\t\t'target' => array(),\n\t\t\t\t),\n\t\t\t\t'br' => array(),\n\t\t\t\t'em' => array(),\n\t\t\t\t'strong' => array(),\n\t\t\t\t'i' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t\t'span' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t\t'code' => array(),\n\t\t\t);\n\t\t\t?>\n\t\t\t<div class=\"simple-notice-custom-control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo wp_kses( $this->description, $allowed_html ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function contentHtml()\n {\n return '<h3>Akun Personil Penghubung PME BBLK Palembang</h3>' .\n '<p>Terima kasih atas partisipasi Anda. Berikut tautan yang dapat Anda gunakan untuk mereset password Anda di dalam sistem PME BBLK Palembang.</p>' .\n '<p><a href=\"' . $this->link() . '\" target=\"_blank\">' . $this->link() . '</a></p>'.\n '<p>Dimohon untuk menjaga kerahasiaan password.<br/><br/>E-mail ini dikikrimkan oleh sistem. Mohon untuk tidak membalas e-mail ini.</p>';\n }", "public function getHtml();", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->ajax('')\n ->parameters($this->getBuilderParameters());\n }", "public function toHtml() {\n\t\techo '<output '.$this->getAttributes().'/>';\n\t}", "public function toHtml();", "public function generate() {\n\t\t\t$this->Wrapper->appendChild($this->Header);\n\t\t\t$this->Wrapper->appendChild($this->Contents);\n\t\t\t$this->Wrapper->appendChild($this->Footer);\n\n\t\t\t$this->Body->appendChild($this->Wrapper);\n\n\t\t\t$this->__appendBodyId();\n\t\t\t$this->__appendBodyClass($this->_context);\n\t\t\treturn parent::generate();\n\t\t}", "public function render() {\n\n echo $this->html;\n\n }", "public function getContent() {\n return $this->formatLinks($this->getTitle());\n }", "protected function output() {\n\t\treturn $this->before() . $this->option( 'content' ) . $this->after();\n\t}", "function render() {\n\t\t$content = Customify()->get_setting( $this->name );\n\t\techo '<div class=\"builder-header-' . esc_attr( $this->id ) . '-item item--html\">';\n\t\techo apply_filters( 'customify_the_content', wp_kses_post( balanceTags( $content, true ) ) );\n\t\techo '</div>';\n\t}", "public function toHtml() {\n\t\techo '<em '.$this->getAttributes().'>'.$this->renderChildren().'</em>';\n\t}", "public function render()\n\t{\n\t\t// convert json to PHP arrays\n\t\tif(!is_array($this->headers))\n\t\t\t$this->headers = $this->extract_json($this->headers);\n\t\tif(!is_array($this->data))\n\t\t\t$this->data = $this->extract_json($this->data);\n\n\t\t// generate a table of the appropriate type with sub-render method\n\t\t$table_html = $this->{\"render_$this->type\"}();\n\t\t\n\t\t// get the snippets directory if set\n\t\tif($this->snippets_dir && file_exists(\"$this->snippets_dir/table.php\"))\n\t\t\t$snippet = \"$this->snippets_dir/table.php\";\n\t\telse\n\t\t\t$snippet = __DIR__ . \"/snippets/table.php\";\n\t\t\n\t\t// build up the replacements array\n\t\t$replacements = array(\n\t\t\t'body' => $table_html,\n\t\t\t'class' => strlen($this->class)?\"class=\\\"$this->class\\\"\":'',\n\t\t\t'id' => strlen($this->id)?\"id=\\\"$this->id\\\"\":'',\n\t\t\t'caption' => strlen($this->caption)?\"<caption>$this->caption</caption>\":'',\n\t\t);\n\t\t\n\t\t$html = \\helpers\\html\\html::load_snippet($snippet, $replacements);\n\n\t\treturn $html;\n\t}", "public function pageContent()\r\n\t{\r\n\t\t$this->displayList();\r\n\t\t$content = '\r\n<div align=\"center\"><table width=\"60%\" border=\"1\" class=\"infoView\">\r\n <tbody>\r\n <tr>\r\n <th scope=\"col\">Manage a Department</th>\r\n </tr>\r\n \t '.$this->dList.'\r\n </tbody>\r\n</table></div>\r\n\t\t';\r\n\t\treturn $content;\r\n\t}", "public function html(){\n\n $all = [];\n $all['id'] = $this->id;\n $all['item'] = $this;\n $all['fields'] = $this->getFields();\n\n foreach ($this->getParams() as $key => $value) {\n $all['p_' . $key] = $value;\n }\n\n return view('components.' . $this->component->name . '.print' , $all)->render();\n }", "public function render()\n {\n return $this->content;\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n //->dom('Bfrtip')\n ->orderBy(0,'ASC');\n // ->buttons(\n // Button::make('export'),\n // Button::make('print')\n // );\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '120px', 'printable' => false])\n ->parameters([\n 'stateSave' => false,\n 'order' => [[($this->columnsLength-1), 'desc']],\n ]);\n }", "public function toHtml()\n {\n $iterator = new \\ArrayIterator((array)$this);\n\n echo \"<div style=\\\"padding-left: 16px\\\">\";\n\n $itemLink = '';\n\n while ($iterator->valid()) {\n $value = $iterator->current();\n $key = $iterator->key();\n\n if (strpos($key, 'link') !== false) {\n $itemLink = $value;\n }\n\n echo \\MIMAS\\Service\\Jorum\\Formatters\\Html::get($key, $value, $itemLink);\n\n $iterator->next();\n }\n echo \"</div>\";\n }", "public function render()\r\n\t{\r\n\t\t$content = \"\";\r\n\t\t\r\n\t\tif (!empty($this->id)) \r\n\t\t{\r\n\t\t\t$content .= \"id='\" . $this->id . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->name)) \r\n\t\t{\r\n\t\t\t$content .= \"name='\" . $this->name . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->className)) \r\n\t\t{\r\n\t\t\t$content .= \"class='\" . $this->className . \"' \";\r\n\t\t}\r\n\t\t\r\n\t\treturn $content;\r\n\t}", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n\t\t?> \t\n\t\t\t<div class=\"wpsm-numhead wpsm-style1\">\n\t\t\t\t<span><?php echo intval($settings['num']);?></span>\t\t\t\t\n\t\t\t\t<h<?php echo esc_attr($settings['heading']);?> <?php echo ''.$this->get_render_attribute_string( \"content\" );?>><?php echo ''.$settings['content'];?></h<?php echo esc_attr($settings['heading']);?>>\n\t\t\t</div>\n\t \t<?php\t\n\t}", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->postAjax()\n ->parameters($this->getBuilderParameters());\n }", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->postAjax()\n ->parameters($this->getBuilderParameters());\n }", "public function html()\n {\n return $this->builder()->columns($this->getColumns())->ajax('')->parameters($this->getBuilderParameters());\n }", "public function html()\n {\n return $this->builder()->columns($this->getColumns())->ajax('')->parameters($this->getBuilderParameters());\n }", "protected function generateHtml() : string\n {\n $output = '<html><head><script src=\"sorttable.js\" type=\"text/javascript\"></script></head><body>';\n\n $output .= $this->generateReportFrontPage();\n\n $output .= $this->generateHtmlBody();\n\n $output .= $this->generateHtmlFooter();\n\n $output .= '</body></html>';\n\n return $output;\n }", "public function renderContent() {}", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content() {\n\t\t\t?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<span class=\"description customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t</label>\n\t\t\t<div class=\"wds-customize-text-editor\">\n\t\t\t\t<?php\n\t\t\t\t// Setttings for the editor.\n\t\t\t\t$settings = array(\n\t\t\t\t\t'textarea_name' => $this->id,\n\t\t\t\t\t'textarea_rows' => 4,\n\t\t\t\t\t'media_buttons' => true,\n\t\t\t\t);\n\n\t\t\t\t// Add the editor.\n\t\t\t\twp_editor( $this->value(), $this->id, $settings );\n\n\t\t\t\t// Only enqueue scripts once.\n\t\t\t\tif ( 0 === self::$count ) {\n\t\t\t\t\t$this->enqueue_scripts();\n\t\t\t\t}\n\n\t\t\t\t// add the footer scripts.\n\t\t\t\t$this->add_footer_scripts();\n\n\t\t\t\t// Increment count.\n\t\t\t\t++self::$count;\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "protected function _content_template() {\n\t\t?>\n\t\t<div class = \"selector-demo\">\n\t\t<div class=\"title div33 el\">\n\t\t\t{{{ settings.title }}}\n\t\t\t<div class=\"box\" style=\" background-color:blue;width: {{ settings.width.size }}{{ settings.width.unit }}\">\n\t\t\tHello\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div class = \"wrapper\">\n\t\tHey Circle\n\t\t</div>\n\t\t\n\t\t<# if ( 'yes' === settings.show_title ) { #>\n\t\t\t<div class=\"title div34 el\">{{{ settings.Subtitle }}}</div>\n\t\t<# } #>\n\t\t<div class=\"title2 div35 el\">{{{ settings.Subtitle }}}</div>\n\t\t\n\t\t<# _.each( settings.gallery, function( image ) { #>\n\t\t\t<img class = \"siva_image_drag\" src=\"{{ image.url }}\">\n\t\t<# }); #>\n\t\t</div>\n\t\t<div class = \"selector-demo\">\n\t\t<div class = \"div33 el\"> Anime Demo</div> <div class = \"div34 el\"> Anime Demo</div> <div class = \"div35 el\"> Anime Demo</div>\n\t\t{{{settings.class}}}\n\t\t</div>\n\t\t<?php\n\t}" ]
[ "0.6869113", "0.6850675", "0.68029463", "0.6791693", "0.6688932", "0.6621305", "0.66144556", "0.65741944", "0.65344363", "0.65276474", "0.6504967", "0.64910567", "0.6471083", "0.6460833", "0.64495164", "0.6430129", "0.6430129", "0.64215016", "0.63996667", "0.63976926", "0.6396573", "0.63898176", "0.63851345", "0.63783145", "0.6373988", "0.63648105", "0.6359435", "0.63375986", "0.63299733", "0.632947", "0.6324883", "0.6305973", "0.63021755", "0.63013726", "0.63013726", "0.6299217", "0.6291821", "0.6280896", "0.6278662", "0.6277111", "0.62764776", "0.6234258", "0.6229692", "0.62275726", "0.62250483", "0.62211215", "0.62147856", "0.6213826", "0.62131226", "0.6209657", "0.6187392", "0.6186265", "0.618048", "0.6177101", "0.6176568", "0.6172983", "0.61711794", "0.61674976", "0.61643034", "0.615983", "0.6159572", "0.615856", "0.6146725", "0.61419374", "0.6141269", "0.61411995", "0.61328745", "0.6125293", "0.61245596", "0.612035", "0.6109703", "0.610916", "0.61072135", "0.6105114", "0.6101533", "0.6098096", "0.60909164", "0.60880715", "0.6082606", "0.6082606", "0.6081474", "0.6081474", "0.6077947", "0.60771465", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.6074334", "0.60690606", "0.60656655" ]
0.61672544
58
SHOW TEAM LIST Show players in sub team $game_id $team_id $team_sub_id $league_id $allowed_player_id $mode= 1 league ID isn't known = 2 league ID is known
function ShowTeamShowPlayers($team_id,$team_sub_id,$game_id,$mode = 1,$allowed_player_id = 0){ global $db_league_players,$db_admin,$db_admin_guids,$db_clan_games; if ($mode == 2){ $admin_guids = ""; $sub_team = ""; } else { $res_game = mysql_query("SELECT clan_games_game FROM $db_clan_games WHERE clan_games_id = ".(integer)$game_id) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $ar_game = mysql_fetch_array($res_game); $sub_team = "<tr style=\"background: #DCE3F1;\">\n"; $sub_team .= " <td colspan=\"5\" class=\"eden_title_middle\">Sub Team - ".$ar_game['clan_games_game']."</td>\n"; $sub_team .= "</tr>\n"; } $output = $sub_team; $res_player = mysql_query(" SELECT a.admin_id, a.admin_nick, a.admin_team_own_id, ag.admin_guid_guid, lp.league_player_id, lp.league_player_position_captain, lp.league_player_position_assistant, lp.league_player_position_player FROM $db_league_players AS lp JOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id LEFT JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_game_id=".(integer)$game_id." WHERE lp.league_player_team_id=".(integer)$team_id." AND lp.league_player_game_id=".(integer)$game_id) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $num = mysql_num_rows($res_player); $output .= "<tr style=\"background: #ff8080;\">\n"; if ($num > 0){ $output .= " <td width=\"120\" valign=\"middle\" class=\"eden_title_middle\">ID</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\">"._LEAGUE_PLAYER_NICK."</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\">"._LEAGUE_PLAYER_POSITION."</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\">"._LEAGUE_GUID."</td>\n"; $output .= " <td align=\"left\" valign=\"top\" class=\"eden_title_middle\"></td>\n"; } else { $output .= " <td colspan=\"5\" class=\"eden_title_middle\">"._LEAGUE_TEAM_NO_PLAYER_IN_SUB."</td>\n"; } $output .= "</tr>\n"; $cislo = 0; while ($ar_player = mysql_fetch_array($res_player)){ if ($cislo % 2 == 0){ $cat_class = "cat_level2_even";} else { $cat_class = "cat_level2_odd";} $output .= "<tr class=\"".$cat_class."\">\n"; $output .= " <td align=\"left\" valign=\"top\">".$ar_player['admin_id']."</td>\n"; $output .= " <td width=\"120\" valign=\"middle\">"; if ($mode == 2){ $output .= "<img src=\"./images/sys_"; if (in_array($ar_player['league_player_id'],$allowed_player_id)){ $output .= "yes"; $alt = _LEAGUE_PLAYER_PLAY; } else { $output .= "no"; $alt = _LEAGUE_PLAYER_NO_PLAY; } $output .= ".gif\" width=\"15\" height=\"15\" alt=\"".$alt."\" title=\"".$alt."\"> "; } $output .= "<strong>".stripslashes($ar_player['admin_nick'])."</strong>"; $output .= " </td>\n"; $output .= " <td align=\"left\" valign=\"top\">"; if (LeagueCheckPrivileges("O",$ar_player['admin_id'],$team_id,"") == $team_id){$output .= _LEAGUE_PLAYER_POSITION_O; $comma = ", ";} else {$comma = "";} if (LeagueCheckPrivileges("C",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_C;} if (LeagueCheckPrivileges("A",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_A;} if (LeagueCheckPrivileges("P",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_P;} $output .= " </td>\n"; $output .= " <td align=\"left\" valign=\"top\">"; if ($ar_player['admin_guid_guid'] != ""){ $output .= stripslashes($ar_player['admin_guid_guid']);} else {$output .= "<span class=\"red\">"._LEAGUE_PLAYER_NO_GUID."</span>";} $output .= "</td>\n"; $output .= " <td align=\"left\" valign=\"top\"></td>\n"; $output .= "</tr>\n"; $cislo++; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListAllowedPlayers(){\n\t\n\tglobal $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players;\n\t\n\tif ($_GET['mode'] != \"league\"){\n\t\t\n\t\techo Menu();\n\t\t\n\t\tKillUse($_SESSION['loginid']);\n\t}\n\techo \"<table width=\\\"857\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\tif ($_GET['lid'] == 0){\n\t\techo \"\t<tr>\\n\";\n\t\techo \"\t\t<td>\"._LEAGUE_NO_LEAGUE_ID.\"</td>\\n\";\n \t\techo \"\t</tr>\\n\";\n\t} else {\n\t\techo \"\t<tr>\\n\";\n\t\tif ($_GET['show'] != \"id\" && $_GET['show'] != \"season_players_all_guid\"){\n\t\t\techo \"\t\t<td width=\\\"30\\\" valign=\\\"middle\\\" class=\\\"eden_title\\\">ID</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t}\n\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\techo \"\t</tr>\\n\";\n\t\t//$msg = LeagueGenerateListAllowedPlayers((float)$_GET['lid'],(float)$_GET['sid'],(float)$_GET['rid']);\n\t\tswitch ($_GET['show']){\n\t \t\tcase \"id\":\n\t \t\t\t$colspan = 1;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players \n\t\t\t\tWHERE league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY league_season_round_allowed_player_guid\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t \t\tbreak;\n\t\t\tcase \"season_players_all\":\n\t\t\t\t$colspan = 4;\n\t \t\tbreak;\n\t\t\tcase \"season_players_all_guid\":\n\t \t\t\t$colspan = 1;\n\t \t\tbreak;\n\t\t\tdefault:\n\t \t\t\t$colspan = 4;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, ll.league_league_id, ll.league_league_game_id, lsrap.league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players AS lsrap \n\t\t\t\tJOIN $db_league_leagues AS ll ON ll.league_league_id=lsrap.league_season_round_allowed_player_league_id \n\t\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\t\t\t\tWHERE lsrap.league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY lsrap.league_season_round_allowed_player_team_sub_id ASC, a.admin_nick ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$_GET['show'] = \"all\";\n\t\t}\n\t\t\n\t\t$cislo = 0;\n\t\t// pro zobrazeni povolenych hracu\n\t\tif ($_GET['show'] == \"id\" || $_GET['show'] == \"all\"){\n\t\t\twhile ($ar_round = mysql_fetch_array($res_round)){\n\t\t\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\tif ($_GET['show'] != \"id\"){\n\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_round['admin_id'].\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_round['league_team_name']).\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_round['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t}\n\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if (empty($ar_round['league_season_round_allowed_player_guid'])){echo \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} else {echo stripslashes($ar_round['league_season_round_allowed_player_guid']);} echo \"</td>\\n\";\n\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t$cislo++;\n\t\t\t}\n\t\t\tunset($ar_round);\n\t\t}\n\t\t// pro zobrazeni vsech hracu\n\t\tif ($_GET['show'] == \"season_players_all\" || $_GET['show'] == \"season_players_all_guid\"){\n\t\t\t$res_team = mysql_query(\"\n\t\t\tSELECT lt.league_team_id, lt.league_team_name, ltsl.league_teams_sub_league_team_sub_id, ltsl.league_teams_sub_league_league_id \n\t\t\tFROM $db_league_teams_sub_leagues AS ltsl \n\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=ltsl.league_teams_sub_league_team_id \n\t\t\tWHERE ltsl.league_teams_sub_league_league_id=\".(integer)$_GET['lid']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\twhile ($ar_team = mysql_fetch_array($res_team)){\n\t\t\t\t$res_player = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, ag.admin_guid_guid, lp.league_player_id \n\t\t\t\tFROM $db_league_players AS lp \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\t\t\t\tJOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_league_guid_id=\".(integer)$ar_team['league_teams_sub_league_league_id'].\" AND ag.admin_guid_guid != '' \n\t\t\t\tWHERE lp.league_player_team_sub_id=\".(integer)$ar_team['league_teams_sub_league_team_sub_id']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$i=1;\n\t\t\t\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\t\tif ($_GET['show'] != \"season_players_all_guid\"){\n\t\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_team['league_team_name']).\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_player['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_player['admin_guid_guid']).\"</td>\\n\";\n\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\techo \"</table>\\n\";\n}", "function listTeams() {\n global $oDbHelper;\n\n $sQuery = \"SELECT * FROM team WHERE competition_id = \" . COMPETITION_ID;\n $oResult = $oDbHelper->executeQuery($sQuery);\n $oDbHelper->printDbResult($oResult);\n}", "function showteam( $ffanumber, $lastname )\n{\n\t\t$db_hostname = 'gungahlinunitedfc.org.au';\n\t\t$db_username = 'gufcweb_dev';\n\t\t$db_password = 'deve!oper';\n\t\t$db_database = 'gufcweb_player';\n\n \t$mysqli = new mysqli($db_hostname,$db_username,$db_password, $db_database);\n\n\t\t$playerteam = \"\";\n\t\t\n\t\t$sqlinner = \" SELECT * FROM gufcdraws.player where FFANumber = '\".$ffanumber.\"' and LastName = '\".$lastname.\"' and display = 'Y'\";\n\n\t\t$sqlexample1 = \" SELECT * FROM gufcdraws.player where FFANumber = 28069631 and LastName = 'Chilmaid' and display = 'Y' \";\n\t\t$sqlexample2 = \" SELECT * FROM gufcdraws.player where fkteamid = 'U16 Div 2 Boys' and display = 'Y' \";\n\t\t\n\t\t$r_queryinner = $mysqli->query($sqlinner);\n\n\t\t$todays_date = date(\"Y-m-d\");\t\t\t\t\t\t\n\n\t\t$msg = 'No player found.';\t\n\n\t\techo '<table class=\"table\" align=\"center\" border=\"1\" >';\n\t\techo '<th>First Name</th>';\n\t\techo '<th>Last Name</th>';\n\t\techo '<th>Team Name</th>';\n\n\t\tif ( ! $r_queryinner )\n\t\t{\n\t\t\techo 'Player not found'; \n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sqlteam = \" SELECT FirstName,LastName,fkteamid FROM gufcdraws.player where fkteamid = '\".$playerteam.\"' and display = 'Y'\";\n\t\t\t\n\t\t\t$r_queryteam = $mysqli->query($sqlteam);\n\t\t\t\n\t\t\tif ( $r_queryteam ) {\n\t\t\t\n\t\t\t\t$rowteam = mysqli_fetch_assoc($r_queryteam)\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>'.$rowteam['FirstName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['LastName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['fkteamid'].'</td>';\n\t\t\t\techo '</tr>';\n\t\t\t}\n\t\t\techo '</table>';\n\t\t\techo '<p/>';\n\t\t}\n}", "function ShowInfoPlayers($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idPlace, PondFishesPlace, FishedFishesPlace, ReleasedFishesPlace, OrderPlace, PseudoPlayer, RankingPlayer, DescriptionStatus FROM fishermenland.place\n INNER JOIN fishermenland.player ON place.fkPlayerPlace = player.idPlayer\n INNER JOIN fishermenland.status ON place.fkStatusPlace = status.idStatus WHERE fkGamePlace = '$idGame' ORDER BY OrderPlace ASC\");\n\n return $req;\n}", "function checkteam($team) {\n\t$result = $team->list_members();\n\tif (count($result) < 3) {\n\t\tprint <<<EOT\n<h1>Edit Match</h1>\n<p>\nSorry but there are not enough members in {$team->display_name()} yet to\nmake up a match with.</p>\n<p>Please <a href=\"javascript:history.back()\">click here</a> to go back\nor <a href=\"teamsupd.php\">here</a> to update teams.</p>\n\nEOT;\n\t\tlg_html_footer();\n\t\texit(0);\n\t}\n\tforeach ($result as $p) {\n\t\t$p->fetchdets();\n\t}\n\treturn $result;\n}", "function showGames( $curDivision=\"\" ) {\n\n/* ... define values for template variables to display on page */\n if ($curDivision == \"\") {\n $data['title'] = \"Playoffs - \".$this->config->item( 'siteName' );\n }\n else {\n $data['title'] = \"Division \".$curDivision.\" Playoffs - \".$this->config->item( 'siteName' );\n }\n\n/* ... get the schedule details from the database */ \n if ($curDivision == \"\") { \n $data['tournDetails'] = $this->Model_Tournament->getAllDetails();\n $data['tournHeader'] = \"League Playoff Schedule\";\n }\n else {\n $data['tournDetails'] = $this->Model_Tournament->getDivDetails( $curDivision );\n $data['tournHeader'] = \"Division \".$curDivision.\" Playoff Schedule\";\n }\n\n/* ... replace seeding placeholders in the schedule with appropriate team ids */\n for ($i=0; $i < count( $data['tournDetails'] ); $i++) {\n\n if ($data['tournDetails'][$i]['Status'] == \"SCHEDULED\") {\n if ($curDivision == \"\") {\n $seedDiv = substr( $data['tournDetails'][$i]['TournamentID'], 0, 1 );\n }\n else {\n $seedDiv = $curDivision;\n }\n if ($data['tournDetails'][$i]['HomeTeamID'] == NULL && $data['tournDetails'][$i]['HomeSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['HomeSeed'], $seedDiv );\n $data['tournDetails'][$i]['HomeTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n if ($data['tournDetails'][$i]['VisitTeamID'] == NULL && $data['tournDetails'][$i]['VisitSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['VisitSeed'], $seedDiv );\n $data['tournDetails'][$i]['VisitTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n }\n }\n \n/* ... set the name of the page to be displayed */\n $data['main'] = \"schedule/sched_tournamentMaster\";\n\n $this->index( $data );\n \n/* ... time to go */\n return;\n }", "function get_team_info($team_id) {\n global $db;\n $query = 'SELECT t.team_id\n , t.name\n , t.nickname\n , t.logo_file_name\n , l.name as league\n , l.abbr as league_abbr\n , s.name as sub_league_name\n , s.abbr as sub_league_abbr\n , d.name as div_name\n FROM teams t INNER JOIN leagues l ON t.league_id = l.league_id\n INNER JOIN sub_leagues s ON t.league_id = s.league_id AND t.sub_league_id = s.sub_league_id\n INNER JOIN divisions d ON t.league_id = d.league_id AND t.sub_league_id = d.sub_league_id\n AND t.division_id = d.division_id\n WHERE t.team_id = :team_id';\n $statement = $db->prepare($query);\n $statement->bindValue('team_id', $team_id);\n $statement->execute();\n $team_info = $statement->fetch();\n $statement->closeCursor();\n return $team_info;\n}", "function team_list()\n {\n }", "function LeagueSeasonPlayersResults(){\n\t\n\tglobal $db_admin,$db_admin_contact,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_players;\n\tglobal $db_country,$db_league_seasons_rounds,$db_league_players,$db_league_awards;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\t$result .= \"<table style=\\\"width:500px;\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\t$result .= \"\t<tr>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:40px;\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:60px;\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._CMN_COUNTRY.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\";\n\t$result .= \"\t</tr>\";\n \t$res_results_players = mysql_query(\"\n\tSELECT lsrp.league_season_result_player_player_id, a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, \n\tlsrp.league_season_result_player_points, c.country_shortname, c.country_name, agid.admin_guid_guid \n\tFROM $db_league_seasons_results_players AS lsrp \n\tJOIN $db_league_players AS lp ON lp.league_player_id = lsrp.league_season_result_player_player_id \n\tJOIN $db_admin AS a ON a.admin_id = lp.league_player_admin_id \n\tJOIN $db_admin_contact AS ac ON ac.aid = a.admin_id \n\tJOIN $db_admin_guids AS agid ON agid.aid = a.admin_id AND agid.admin_guid_game_id = lp.league_player_game_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id = lp.league_player_team_id \n\tJOIN $db_country AS c ON c.country_id = ac.admin_contact_country \n\tWHERE lsrp.league_season_result_player_season_id = \".(integer)$_GET['sid'].\" \n\tORDER BY lsrp.league_season_result_player_points DESC LIMIT 10\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$i = 1;\n\twhile ($ar_results_players = mysql_fetch_array($res_results_players)){\n\t\t// Call function\n\t\t$ar_award = LeagueCheckAwards(1,(integer)$_GET['sid'],(integer)$ar_results_players['league_season_result_player_player_id'],0);\n\t\t\n\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t$result .= \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t$result .= \"\t<td align=\\\"right\\\" valign=\\\"top\\\">\"; if($ar_award['league_award_place']){$result .= \"<img src=\\\"\".$url_league_awards.$ar_award['league_award_img'].\"\\\" alt=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" title=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" />\";} else {$result .= \"<strong>\".$i.\"</strong>\";} $result .= \"</td>\";\n\t\t$result .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\".$ar_results_players['league_season_result_player_points'].\"</td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\"><img src=\\\"\".$url_flags.$ar_results_players['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_results_players['country_name']).\"\\\" title=\\\"\".stripslashes($ar_results_players['country_name']).\"\\\" /></td>\";\n\t \t$result .= \"\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=player&amp;mode=player_acc&amp;id=\".$ar_results_players['admin_id'].\"&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_players['admin_nick']).\"</a></td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\">\".$ar_results_players['admin_guid_guid'].\"</td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=league_team&amp;mode=team_home&amp;ltid=\".$ar_results_players['league_team_id'].\"&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_players['league_team_name']).\"</a></td>\";\n\t\t$result .= \"</tr>\";\n\t\t$i++;\n\t}\n\t$result .= \"\t<tr>\\n\";\n\t$result .= \"\t\t<td colspan=\\\"5\\\"><br /><form action=\\\"sys_save.php?action=league_awards_give_to_players&sid=\".$_GET['sid'].\"\\\" method=\\\"post\\\" name=\\\"form1\\\" enctype=\\\"multipart/form-data\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$_GET['sid'].\"\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_AWARD_SUBMIT_PLAYER.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t$result .= \"\t\t</form>\\n\";\n\t$result .= \"\t\t</td>\\n\";\n\t$result .= \"\t</tr>\\n\";\n\t$result .= \"</table>\\n\";\n\t\n\treturn $result;\n}", "function SeasonResults($sid = 0,$mode = \"p\"){\n\t\n\tglobal $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players;\n\tglobal $db_admin,$db_league_seasons_rounds_results_players,$db_league_teams;\n\t\n\t$res_rounds = mysql_query(\"SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id \n\tFROM $db_league_seasons_rounds_results_players AS lsrrp \n\tJOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=\".(float)$rid.\" \n\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\tWHERE lsrrp.league_season_round_result_player_round_id=\".(float)$rid.\" \n\tORDER BY lsrrp.league_season_round_result_player_place ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\n\tswitch ($mode){\n\t\tcase \"p\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t\t$guid = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_GUID.\"</td>\\n\";\n\t\t\t$table_width = \"600\";\n\t\t\t\n\t\t\techo Menu();\n\t\t\t\n\t\tbreak;\n\t\tcase \"t\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\";\n\t\t\t$guid = \"\";\n\t\t\t$table_width = \"400\";\n\t\tbreak;\n\t\tdefault:\n\t\t\techo \"\";\n\t}\n\t$ar_round = mysql_fetch_array($res_round);\n\t$league_name = stripslashes($ar_round['league_league_name']);\n\t$season_id = $ar_round['league_season_round_season_id'];\n\t$season_name = stripslashes($ar_round['league_season_name']);\n\t$round_num = $ar_round['league_season_round_num'];\n\t\n\techo \"<table width=\\\"\".$table_wifth.\"\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\techo \"\t<tr>\\n\";\n\techo \"\t\t<td colspan=\\\"3\\\" align=\\\"left\\\">\";\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<h5 style=\\\"margin:20px 0px 0px 0px;\\\">\".$league_name.\" > <a href=\\\"modul_league.php?action=rounds&sid=\".$season_id.\"&project=\".$_SESSION['project'].\"\\\" target=\\\"_self\\\">\".$season_name.\"</a> > \"._LEAGUE_SEASON_ROUND.\" \".$round_num.\"</h5>\";}\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<form action=\\\"sys_save.php?action=results_add&rid=\".$rid.\"sid=\".$season_id.\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\">\";}\n\techo \"\t\t</td>\\n\";\n\techo \"\t</tr>\\n\";\n\techo \"\t<tr style=\\\"background-color:#dce3f1;\\\">\\n\";\n\techo \"\t\t<td width=\\\"50\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_POSITION.\"</td>\\n\";\n\techo \"\t\t<td align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_POINTS.\"</td>\\n\";\n\techo $nick;\n\techo $guid;\n\techo \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\techo \"\t</tr>\\n\";\n\tswitch ($mode){\n\t\tcase \"p\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tcase \"t\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t \t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['admin_nick'].\"</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\".$ar_rounds['league_season_round_allowed_player_guid'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tdefault;\n\t\t\techo \"\";\n\t}\n\techo \"</table>\\n\";\n}", "function get_team_whip_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT p.player_id\n , CONCAT(pl.first_name,\" \",pl.last_name) AS player\n , p.whip\n FROM CalcPitching p INNER JOIN players pl ON p.player_id=pl.player_id\n INNER JOIN team_history_record t ON p.team_id=t.team_id AND p.year=t.year\n WHERE p.year = :year AND p.team_id = :team_id\n AND p.g >= 35\n ORDER BY p.whip\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_whip_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_whip_leaders;\n}", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "function get_team_fipm_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT p.player_id\n , CONCAT(pl.first_name,\" \",pl.last_name) AS player\n , p.FIPminus\n FROM CalcPitching p INNER JOIN players pl ON p.player_id=pl.player_id\n INNER JOIN team_history_record t ON p.team_id=t.team_id AND p.year=t.year\n WHERE p.year = :year AND p.team_id = :team_id\n AND p.g >= 35\n ORDER BY p.FIPminus\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_fipm_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_fipm_leaders;\n}", "function galaxy_show_ranking_player() {\n\tglobal $db;\n\tglobal $pub_order_by, $pub_date, $pub_interval;\n\n\tif (!isset($pub_order_by)) {\n\t\t$pub_order_by = \"general\";\n\t}\n\tif ($pub_order_by != \"general\" && $pub_order_by != \"fleet\" && $pub_order_by != \"research\") {\n\t\t$pub_order_by = \"general\";\n\t}\n\n\tif (!isset($pub_interval)) {\n\t\t$pub_interval = 1;\n\t}\n\tif (($pub_interval-1)%100 != 0 || $pub_interval > 1401) {\n\t\t$pub_interval = 1;\n\t}\n\t$limit_down = $pub_interval;\n\t$limit_up = $pub_interval + 99;\n\n\t$order = array();\n\t$ranking = array();\n\t$ranking_available = array();\n\n\tswitch ($pub_order_by) {\n\t\tcase \"general\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\tbreak;\n\t\tcase \"fleet\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\tbreak;\n\t\tcase \"research\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\tbreak;\n\t}\n\t$i=0;\n\n\tif (!isset($pub_date)) {\n\t\t$request = \"select max(datadate) from \".$table[$i][\"tablename\"];\n\t\t$result = $db->sql_query($request);\n\t\tlist($last_ranking) = $db->sql_fetch_row($result);\n\t}\n\telse $last_ranking = $pub_date;\n\n\t$request = \"select rank, player, ally, points, username\";\n\t$request .= \" from \".$table[$i][\"tablename\"].\" left join \".TABLE_USER;\n\t$request .= \" on sender_id = user_id\";\n\t$request .= \" where rank between \".$limit_down.\" and \".$limit_up;\n\t$request .= isset($last_ranking) ? \" and datadate = \".mysql_real_escape_string($last_ranking) : \"\";\n\t$request .= \" order by rank\";\n\t$result = $db->sql_query($request);\n\n\twhile (list($rank, $player, $ally, $points, $username) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$player][$table[$i][\"arrayname\"]] = array(\"rank\" => $rank, \"points\" => $points);\n\t\t$ranking[$player][\"ally\"] = $ally;\n\t\t$ranking[$player][\"sender\"] = $username;\n\n\t\tif ($pub_order_by == $table[$i][\"arrayname\"]) {\n\t\t\t$order[$rank] = $player;\n\t\t}\n\t}\n\n\t$request = \"select distinct datadate from \".$table[$i][\"tablename\"].\" order by datadate desc\";\n\t$result_2 = $db->sql_query($request);\n\twhile ($row = $db->sql_fetch_assoc($result_2)) {\n\t\t$ranking_available[] = $row[\"datadate\"];\n\t}\n\n\tfor ($i ; $i<3 ; $i++) {\n\t\treset($ranking);\n\t\twhile ($value = current($ranking)) {\n\t\t\t$request = \"select rank, player, ally, points, username\";\n\t\t\t$request .= \" from \".$table[$i][\"tablename\"].\" left join \".TABLE_USER;\n\t\t\t$request .= \" on sender_id = user_id\";\n\t\t\t$request .= \" where player = '\".mysql_real_escape_string(key($ranking)).\"'\";\n\t\t\t$request .= isset($last_ranking) ? \" and datadate = \".mysql_real_escape_string($last_ranking) : \"\";\n\t\t\t$request .= \" order by rank\";\n\t\t\t$result = $db->sql_query($request);\n\n\t\t\twhile (list($rank, $player, $ally, $points, $username) = $db->sql_fetch_row($result)) {\n\t\t\t\t$ranking[$player][$table[$i][\"arrayname\"]] = array(\"rank\" => $rank, \"points\" => $points);\n\t\t\t\t$ranking[$player][\"ally\"] = $ally;\n\t\t\t\t$ranking[$player][\"sender\"] = $username;\n\n\t\t\t\tif ($pub_order_by == $table[$i][\"arrayname\"]) {\n\t\t\t\t\t$order[$rank] = $player;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnext($ranking);\n\t\t}\n\t}\n\n\t$ranking_available = array_unique($ranking_available);\n\n\treturn array($order, $ranking, $ranking_available);\n}", "public function filterPlayerByTeamAction() {\r\r $this->_helper->layout()->disableLayout();\r $this->_helper->viewRenderer->setNoRender(true);\r\r if ($this->getRequest()->isPost()) {\r $method = $this->getRequest()->getParam('method');\r\r //echo \"Method: \".$method;die();\r switch ($method) {\r case 'teamfilter':\r $teamfilter = $this->getRequest()->getPost('team');\r $searchValue = $this->getRequest()->getPost('searchValue');\r $playerListArray = $this->getRequest()->getPost('playerList');\r $searchKey = $this->getRequest()->getPost('searchKey');\r\r // with team filter\r $filterPlayerList = $this->filterArray($searchValue, $playerListArray, $searchKey, $teamfilter);\r // echo \"<pre>\"; print_r( $filterPlayerList); echo \"</pre>\"; die;\r if ($filterPlayerList) {\r echo json_encode($filterPlayerList);\r }\r\r break;\r\r case 'playerfilter':\r\t\t\t\t\t\r $searchValue = $this->getRequest()->getPost('searchValue');\r $filterValue = $this->getRequest()->getPost('filterValue');\r $playerListArray = $this->view->session->playerListArray;\r\t\t\t\t\t//echo print_r($this->getRequest()->getPost()); die;\r\t\t\t\t //added code by alok on 21/07/2017 used for search player with listing and search carry in another tab\r\t\t\t\t if(isset($filterValue) && !empty($filterValue) && $filterValue != null && $searchValue != 'ALL'){\r\t\t\t\t $objGamePlayers = Application_Model_GamePlayers::getInstance();\r\t\t\t\t $playerListArray = $objGamePlayers->getPlayersByGameTeamWithSearch($this->getRequest()->getPost('sportId'), $filterValue);\r\t\t\t\t }\r\t\t\t\t \r $searchKey = $this->getRequest()->getPost('searchKey');\r $teamfilter = $this->getRequest()->getPost('selectedTeam');\r $sportId = $this->getRequest()->getPost('sportId');\r if (($searchValue == \"FLEX\" && $sportId == 1 ) || ($searchValue == \"F\" && $sportId == 3 ) || ($searchValue == \"G\" && $sportId == 3 ) || $searchValue == \"UTIL\") {\r if ($teamfilter[0] != \"All Games\") { \r\t\t\t\t\t \r //$playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey, $teamfilter);\r $playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey, $teamfilter,$filterValue);\r\t\t\t\t\t\t\t\r } else {\r\t\t\t\t\t\t //$playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey);\r $playerListArray = $this->specialPlayer($sportId, $searchValue, $searchKey,$filterValue);\r }\r $value = array();\r foreach ($playerListArray as $key => $row) {\r $value[$key] = $row['plr_value'];\r }\r array_multisort($value, SORT_DESC, $playerListArray);\r\t\t\t\t\t\t\r echo json_encode($playerListArray);\r } else {\r\r if ($searchValue == \"ALL\" && empty($teamfilter)) {\r $value = array();\r\t\t\t\t\t\t\t$nfl_pos = array('QB','RB','WR','K','DST','TE');\r\t\t\t\t\t\t\t$mlb_pos = array('1B','2B','3B','C','SS','SP');\r\t\t\t\t\t\t\t$nba_pos = array('PG','SG','SF','PF','C');\r\t\t\t\t\t\t\t$nhl_pos = array('C','RW','LW','D','G','W');\r\t\t\t\t\t\t\t$newPlayerArray = array();\r foreach ($playerListArray as $key => $row) {\r\t\t\t\t\t\t\t\tif($sportId==1){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$nfl_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}elseif($sportId==2){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$mlb_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}elseif($sportId==3){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$nba_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}elseif($sportId==4){\r\t\t\t\t\t\t\t\t\tif(in_array($row['pos_code'],$nhl_pos)){\r\t\t\t\t\t\t\t\t\t\t$newPlayerArray[] = $row;\r\t\t\t\t\t\t\t\t\t\t$value[$key] = $row['plr_value'];\r\t\t\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\t\t}else{\r\t\t\t\t\t\t\t\t\t$newPlayerArray = $playerListArray;\r\t\t\t\t\t\t\t\t} \r }\r\t\t\t\t\t\t\t\r array_multisort($value, SORT_DESC, $newPlayerArray);\r\t\t\t\t\t\t\t\r echo json_encode($newPlayerArray);\r } else {\r if ($teamfilter[0] != \"All Games\") { \r\t\t\t\t\t\t\t \r $filterPlayerList = $this->filterArray($searchValue, $playerListArray, $searchKey, $teamfilter);\r\t\t\t\t\t\t\t\t\r } else {\r $filterPlayerList = $this->filterArray($searchValue, $playerListArray, $searchKey);\r }\r\r $value = array();\r foreach ($filterPlayerList as $key => $row) {\r $value[$key] = $row['plr_value'];\r }\r array_multisort($value, SORT_DESC, $filterPlayerList);\r if ($filterPlayerList) {\r echo json_encode($filterPlayerList);\r }\r }\r }\r\r break;\r\r case 'playerByTeam':\r\r $searchPos = $this->getRequest()->getPost('searchPos');\r $searchTeam = $this->getRequest()->getPost('searchTeam');\r $playerListArray = $this->view->session->playerListArray;\r $searchKey = $this->getRequest()->getPost('searchKey');\r\r $sportId = $this->getRequest()->getPost('sportId');\r if (($searchPos == \"FLEX\" && $sportId == 1 ) || ($searchPos == \"F\" && $sportId == 3 ) || ($searchPos == \"G\" && $sportId == 3 ) || $searchPos == \"UTIL\") {\r if ($searchTeam[0] != \"All Games\") {\r $playerListArray = $this->specialPlayer($sportId, $searchPos, $searchKey, $searchTeam);\r } else {\r $playerListArray = $this->specialPlayer($sportId, $searchPos, $searchKey);\r }\r\r echo json_encode($playerListArray);\r } else {\r\r if ($searchPos == \"ALL\") {\r echo json_encode($playerListArray);\r } else {\r\r if ($searchTeam[0] != \"All Games\") {\r $filterPlayerList = $this->filterTeamArray($searchPos, $playerListArray, $searchKey, $searchTeam);\r } else {\r $filterPlayerList = $this->filterTeamArray($searchPos, $playerListArray, $searchKey);\r }\r\r if ($filterPlayerList) {\r echo json_encode($filterPlayerList);\r }\r }\r }\r break;\r default:\r break;\r }\r }\r }", "public function getTeams();", "public function index(){\n $nbrPag = 20;\n $teams = Team::orderBy('league_id')->whereHas('players', function($query){\n $query->where('activity', '=', 1);\n })->has('players', '>', 0)->paginate($nbrPag);\n\n if(!Input::get('page')){\n $page = 0;\n } else {\n $page = Input::get('page') * $nbrPag - $nbrPag;\n }\n return view('admin.players.index', compact('teams', 'page'));\n }", "function LeagueSeasonTeamsResults(){\n\t\n\tglobal $db_league_leagues,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_teams,$db_league_awards;\n\tglobal $db_country,$db_league_seasons_rounds;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\t$result .= \"<table style=\\\"width:400px;\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\t$result .= \"\t<tr>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:40px;\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:60px;text-align:center;\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:50px;\\\">\"._CMN_COUNTRY.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t$result .= \"\t</tr>\\n\";\n \t$res_results_teams = mysql_query(\"\n\tSELECT lt.league_team_id, lt.league_team_name, lsrt.league_season_result_team_team_sub_id, lsrt.league_season_result_team_points, c.country_shortname, c.country_name, ls.league_season_end \n\tFROM $db_league_seasons_results_teams AS lsrt \n\tJOIN $db_league_teams AS lt ON lt.league_team_id = lsrt.league_season_result_team_team_id \n\tJOIN $db_country AS c ON c.country_id = lt.league_team_country_id \n\tJOIN $db_league_seasons AS ls ON ls.league_season_id = \".(integer)$_GET['sid'].\" \n\tWHERE lsrt.league_season_result_team_season_id = \".(integer)$_GET['sid'].\" \n\tORDER BY lsrt.league_season_result_team_points DESC LIMIT 10\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$i = 1;\n\twhile ($ar_results_teams = mysql_fetch_array($res_results_teams)){\n\t\t// Call function\n\t\t$ar_award = LeagueCheckAwards(2,(integer)$_GET['sid'],0,(integer)$ar_results_teams['league_season_result_team_team_sub_id']);\n\t\t\n\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t$result .= \"\t<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t$result .= \"\t\t<td align=\\\"right\\\" valign=\\\"top\\\">\"; if($ar_award['league_award_place']){$result .= \"<img src=\\\"\".$url_league_awards.$ar_award['league_award_img'].\"\\\" alt=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" title=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" />\";} else { $result .= \"<strong>\".$i.\"</strong>\";} $result .= \"</td>\\n\";\n\t\t$result .= \"\t\t<td valign=\\\"top\\\" align=\\\"right\\\">\".$ar_results_teams['league_season_result_team_points'].\"</td>\\n\";\n\t\t$result .= \"\t\t<td valign=\\\"top\\\" align=\\\"center\\\"><img src=\\\"\".$url_flags.$ar_results_teams['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_results_teams['country_name']).\"\\\" title=\\\"\".stripslashes($ar_results_teams['country_name']).\"\\\" /></td>\\n\";\n\t \t$result .= \"\t\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=league_team&mode=team_home&ltid=\".$ar_results_teams['league_team_id'].\"&lang=\".$_GET['lang'].\"&filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_teams['league_team_name']).\"</a></td>\\n\";\n\t\t$result .= \"\t</tr>\\n\";\n\t\t$i++;\n\t}\n\t// Show button for setting awards only if season is over\n\tif ($ar_results_teams['league_season_end'] < date(\"Y-m-d H:i:s\")){\n\t\t$result .= \"\t<tr>\\n\";\n\t\t$result .= \"\t\t<td colspan=\\\"5\\\"><br /><form action=\\\"sys_save.php?action=league_awards_give_to_teams&sid=\".$_GET['sid'].\"\\\" method=\\\"post\\\" name=\\\"form1\\\" enctype=\\\"multipart/form-data\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$_GET['sid'].\"\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_AWARD_SUBMIT_TEAM.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t\t$result .= \"\t\t</form>\\n\";\n\t\t$result .= \"\t\t</td>\\n\";\n\t\t$result .= \"\t</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\t\n\treturn $result;\n}", "function fantacalcio_admin_teams_list() {\n $out = l(\"Aggiungi squadra\", \"admin/fantacalcio/teams/add\", array(\n \"attributes\" => array(\"class\" => \"btn btn-info\"))) . \"<br/><br/>\";\n \n $teams = Team::all();\n \n if ($teams) {\n \n $header = array(\"Nome\", \"Utente\", \"Gironi\", \"Attiva\");\n \n foreach ($teams as $t_id => $team) {\n \n $account = User::get($team->user);\n \n $groups_team = \"\";\n foreach ($team->getCompetitions() as $competition) {\n $groups_team .= $competition . \"<br>\";\n }\n $rows[] = array(\n l($team->name, \"admin/fantacalcio/teams/\" . $t_id), \n $account != null ? $account->name : \"\", \n $groups_team, \n fantacalcio_check_value($team->active));\n }\n $out .= theme(\"table\", array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table table-responsive\")), \n \"sticky\" => TRUE, \n \"empty\" => t(\"Nessuna squadra\")));\n }\n \n return $out;\n}", "public function all_team_member_info(){\r\n $query = \"SELECT * FROM tbl_aboutus_team WHERE publication_status = 1 ORDER BY team_member_id DESC LIMIT 4\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function getPlayersByTeam(){\n $team = Input::get('id');\n if(Request::ajax()) {\n // Select players where team = get_id and pivot_team_id = get_id and pivot_activity=1\n $teams = Team::with(['players' => function($query) use ($team){\n $query->wherePivot('team_id' , '=' , $team)\n ->wherePivot('activity', '=', 1);\n }])->where('id', '=', $team)->get();\n return view('admin.partials.playersAjax', compact('teams'));\n }\n }", "public function team(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Team';\n\t\t$data['teamsList'] = $this->common_model->get_all('fr_team', '');\n\t\t$this->set_layout('team/team_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function index()\n {\n //get current user's id\n $user = Auth::User()->id;\n $league = League::find(1);\n $league_id = $league->id;\n\n //search players through user and league id's\n $teamMappings = Team::where('user_id', $user)->where('league_id', $league_id)->get();\n\n $playerIds = [];\n foreach ($teamMappings as $mapping) {\n $playerIds[] = $mapping->player_id;\n }\n\n $players = Player::whereIn('id', $playerIds)->get();\n\n\n return view('myteam', compact('players'));\n\n }", "public function teamPlayersList($param)\n {\n try {\n $team = Team::where('id', $param)->orWhere('name', $param)->first();\n if ($team) {\n $players = $team->players()->get();\n if ($players) {\n return json_encode(array(\"status\" => 200, \"message\" => \"Player List\", \"response\" => $players));\n }\n return json_encode(array(\"status\" => 500, \"message\" => \"No players associated with this team\"));\n }\n return json_encode(array(\"status\" => 500, \"message\" => \"Undefined team\"));\n } catch (Throwable $e) {\n report($e);\n return json_encode(array(\"status\" => 500, \"message\" => \"Something went wrong\"));\n }\n }", "function get_all_tournament_teams()\n {\n $this->db->select('TT.tournament_team_id,TT.team_id,T.tournament_name,T1.team_name,P.player_name as captain,P.employee_id,P1.player_name as vice_captain');\n $this->db->join('tournaments as T', 'T.tournament_id = TT.tournament_id');\n $this->db->join('teams as T1' , 'TT.team_id = T1.team_id');\n $this->db->join('players as P' , 'TT.captain = P.player_id ');\n $this->db->join('players as P1' , 'TT.vice_captain = P1.player_id ');\n $this->db->where(array('TT.is_active'=>'T','T.is_active'=>'T')); \n\n return $this->db->get('tournament_teams as TT')->result_array();\n }", "function viewTeam() {\n global $user;\n $UID = $user->uid;\n\n $params = drupal_get_query_parameters();\n $array = array();\n \n // checks to see if the user has a team\n if (isset($params['TID'])) {\n $TID = $params['TID'];\n } else {\n drupal_set_message(\"No team selected.\", 'error');\n drupal_goto($_SERVER['HTTP_REFERER']);\n }\n\n // checks to see if the user is on the team (keeping in mind that team owners can\n // see their team application\n if (dbGetTeamOwner($TID) != $UID && (!isMyTeam($TID) || teamIsIneligible($TID))) {\n drupal_set_message('You do not have permission to access this page.', 'error');\n return;\n }\n \n $team = dbGetTeam($TID);\n\n $markup = '';\n $markup .= '<div style=\"float:left; width:38%\">';\n // create team header and table\n $markup .= '<table style=\"margin:0px 0px 10px 0px;\"><tr>';\n \n $markup .= '<td style=\"padding:0px 14px 10px 14px;\"><div align=\"left\"><h2 style=\"margin:0px 0px 7px 0px;\"><b>';\n\n // if the team has a type\n if ($team['type'] != \"Other\"){\n $markup .= \"{$team['type']} {$team['number']} - {$team['name']}\";\n } else{\n $markup .= \"Team {$team['number']} - {$team['name']}\";\n }\n \n $markup .= '</b></h2></div></td></tr></table>';\n \n // create table\n $markup .= '<table id=\"photoAndEdit\"><tr><td style=\"padding:0px;\">'; \n\n // if the user can edit team picture\n if (hasPermissionForTeam('editTeam', $TID)){\n $markup .= '<div align=\"right\">';\n $markup .= '<a href= \"?q=editThumbnail';\n $markup .= '&TID='. $TID . '&FID=' . $team['FID'] . '\">';\n $markup .= '<span title=\"Edit Photo\"><button><img class=\"editIcon\" src=\"/images/icons/editThumbnailWhite.png\"></button></span></a>';\n $markup .='</div>';\n } else {\n // otherwise show just a disabled button\n $markup .= '<div align=\"right\">';\n $markup .= '<span title=\"Edit Photo\"><button type=\"button\" disabled><img class=\"editIcon\" src=\"/images/icons/editThumbnailWhite.png\"></button></span>';\n $markup .='</div>';\n }\n\n $markup .= '</td></tr><tr><td style=\"padding:0px;\">';\n\n // if the team has a picture then display\n if (!empty($team['FID'])) {\n $url = generateURL($team['FID']);\n $markup .= '<div align=\"center\"><img src=\"' .$url .'\" style=\"max-width:150px; width:auto; height:auto; padding: 5px 0px 5px 0px\">';\n // default team picture\n } else {\n $markup .= '<div align=\"center\"><img src= \"/images/defaultPics/team.png\" style=\"max-width:200px; width:auto; height:auto; padding: 15px 0px 15px 0px\">';\n }\n\n $markup .= '</div></td></tr></table></div>';\n\n $teams = dbGetTeamsForUser($UID);\n\n $markup .= '<div align=\"right\">';\n\n // if the user can permission to manage outreach\n if (!teamIsIneligible($TID) &&\n hasPermissionForTeam('manageOutreachTags', $TID)) {\n $markup .= '<a href=\"?q=teamModeratorPage\">';\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button>Moderators</button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to view ideas, write-ups, and hours awaiting approval.';\n $markup .= '</span></div></a>';\n } else {\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button type=\"button\" disabled>Moderators</button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to view ideas, write-ups, and hours awaiting approval.';\n $markup .= '</span></div>';\n\n }\n\n // if the user can manage the outreach settings (currently only tags)\n if (!teamIsIneligible($TID) && hasPermissionForTeam('manageOutreachTags', $TID)){\n $markup .= '<a href=\"?q=teamOutreachSettings\">';\n $markup .= '<button>Settings</button></a>';\n } else {\n $markup .= '<button type=\"button\" disabled>Settings</button>';\n }\n\n // if the user has permission to manage hours\n if (!teamIsIneligible($TID) && hasPermissionForTeam('editAnyHours', $TID)){\n $markup .= '<a href= \"?q=offsetHours';\n $markup .= '&TID=' . $team['TID'] . '\">';\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button type=\"button\"><img class=\"hoursIcon\" src=\"/images/icons/clockWhite.png\"></button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to enter old team hours from previous years.';\n $markup .= '</span></div></a>';\n } else {\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button type=\"button\" disabled><img class=\"hoursIcon\" src=\"/images/icons/clockWhite.png\"></button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to enter old team hours from previous years.';\n $markup .= '</span></div>';\n }\n \n // if the user can edit the team\n if (hasPermissionForTeam('editTeam',$TID)){\n $markup .= '<a href= \"?q=teamForm&url=viewTeam';\n $markup .= '&TID=' . $team['TID'] . '\">';\n $markup .= '<button type=\"button\"><img class=\"editIcon\" src=\"/images/icons/editWhite.png\"></button></a>';\n } else{\n $markup .= '<button type=\"button\" disabled><img class=\"editIcon\" src=\"/images/icons/editWhite.png\"></button></a>';\n }\n\n // if the user can delete the team\n if (hasPermissionForTeam('deleteTeam', $TID)){ \n $markup .= '<a href= \"?q=deleteTeamPage';\n $markup .= '&TID=' . $team['TID'] . '\">';\n $markup .= '<button type=\"button\"><img class=\"trashIcon\" src=\"/images/icons/trashWhite.png\"></button></a>';\n } else {\n $markup .= '<button type=\"button\" disabled><img class=\"trashIcon\" src=\"/images/icons/trashWhite.png\"></button></a>';\n }\n \n $markup .= '</div>';\n\n // begin displaying info\n\n $markup .= '<div style=\"width:60%; float:right; padding-left:10px\">';\n\n $teams = dbGetTeamsForUser($UID);\n $numOutreaches = dbGetNumOutreachForTeam($TID);\n \n // create table\n $markup .= '<table id=\"miniViewTeam\" style=\"margin:16px 0px 0px 0px\"><tr><td><b>';\n\n if ($numOutreaches != 0){\n $markup .= '<a href=\"?q=outreach&allTeamOutreach\">Outreaches: </a></b>';\n } else {\n $markup .= 'Outreaches: </b>';\n }\n\n $markup .= $numOutreaches . '</td>';\n\n $markup .= '<td><b>Total Number of Hours: </b>' . dbGetHoursForTeam($TID) . '</td></tr>';\n\n $markup .= '<tr><td><b><a href=\"?q=showUsersForTeam';\n $numStudents = dbGetNumStudentsForTeam($team['TID']);\n $numMentors = dbGetNumMentorsForTeam($team['TID']);\n $markup .= '&TID='.$team['TID'].'&type=student\">Students: </a></b>'.dbGetNumStudentsForTeam($team['TID']).'</td>';\n $markup .= '<td><b><a href=\"?q=showUsersForTeam';\n $markup .= '&TID='.$team['TID'].'&type=mentor\">Mentors: </a></b>'.dbGetNumMentorsForTeam($team['TID']).'</td></tr>';\n\n $markup .= '<tr><td><b>City: </b>' . $team['city'] . '</td>';\n $markup .= '<td><b>State: </b>' . $team['state'] . '</td></tr>';\n\n $markup .= '<tr><td><b>Country: </b>' . $team['country'] . '</td>';\n $markup .= '<td><b>Rookie Year: </b>' . $team['rookieYear'] . '</td></tr>';\n\n if ($team['rookieYear'] == NULL){\n $team['rookieYear'] = '[none]';\n }\n\n $markup .= '</table></div>';\n\n return array('#markup' => $markup);\n}", "function teams($contest_id = null) {\n $this->auth(COMP_ADM_LEVEL);\n if($contest_id == null){\n $contest_id = $this->uri->segment(3);\n }\n $data['competition_data'] = $this->m_key->getTeamDataByContestId($contest_id);\n $data['teams'] = $this->m_team->getAllByContestId($contest_id);\n $this->load->view('admin/company_admin/v_teams', $data);\n }", "function get_driver_team($idTeam)\n{\n $list_driver = get_driver_team_db($idTeam);\n return $list_driver;\n}", "function get_all_tournament_players()\n {\n $this->db->select('tournament_players_id,team_name,player_name,employee_id,company');\n $this->db->join('tournament_teams as TT', 'TT.tournament_team_id = TP.tournament_team_id');\n $this->db->join('tournaments as T', 'T.tournament_id = TT.tournament_id AND T.is_active = \"T\"');\n $this->db->join('players as P' , 'TP.player_id = P.player_id ');\n $this->db->join('teams as T1' , 'TT.team_id = T1.team_id');\n \n return $this->db->get_where('tournament_players as TP',array('TP.is_deleted'=>0))->result_array();\n }", "public function getTeam();", "function setup_undrafted_list() {\n global $smarty;\n global $SEASON;\n global $Link;\n $draftedListSubQuery = 'SELECT playerId FROM ' . DRAFT . ' WHERE seasonId=' . $SEASON;\n $undraftedListSubQueryColumns = 'playerFName,playerLName,skillLevelName,position';\n $undraftedListSelect = 'SELECT ' . $undraftedListSubQueryColumns;\n $undraftedListSelect.= ' FROM ' . PLAYER;\n $undraftedListSelect.= ' JOIN ' . REGISTRATION . ' ON ' . PLAYER . '.registrationId = ' . REGISTRATION . '.registrationId';\n $undraftedListSelect.= ' JOIN ' . SKILLLEVELS . ' ON ' . PLAYER . '.playerSkillLevel = ' . SKILLLEVELS . '.skillLevelID';\n $undraftedListSelect.= ' WHERE ' . PLAYER . '.seasonId=' . $SEASON;\n $undraftedListSelect.= ' AND ' . PLAYER . '.playerID NOT IN (' . $draftedListSubQuery . ')';\n $undraftedListSelect.= ' ORDER BY playerSkillLevel DESC ,playerLName';\n $undraftedListResult = mysql_query($undraftedListSelect, $Link) or die(\"sp_clubs (Line \" . __LINE__ . \"): \" . mysql_errno() . \": \" . mysql_error());\n if ($undraftedListResult && mysql_num_rows($undraftedListResult) > 0) {\n $countPlayers = 0;\n $smarty->assign('playerFName', array());\n $smarty->assign('playerLName', array());\n $smarty->assign('skillLevelName', array());\n $smarty->assign('position', array());\n while ($player = mysql_fetch_array($undraftedListResult, MYSQL_ASSOC)) {\n $countPlayers++;\n $playerFName = $player['playerFName'];\n $playerLName = $player['playerLName'];\n $skillLevelName = $player['skillLevelName'];\n $playerPosition = $player['position'];\n $smarty->append('countPlayers', $countPlayers);\n $smarty->append('playerFName', $playerFName);\n $smarty->append('playerLName', $playerLName);\n $smarty->append('skillLevelName', $skillLevelName);\n $smarty->append('position', $playerPosition);\n }\n $smarty->assign('countPlayers', $countPlayers);\n }\n}", "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}", "public function getPlayers();", "public function getPlayers();", "public function teamlist_get()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"GET\")\n\t\t{\n\t\t $this->response('Not Acceptable',406);\n\t\t}\n\t\t$sport_id = $this->input->get('sport_id');\n\t\t$search_text = $this->input->get('search_text');\n\t\t$offset = $this->input->get('offset');\n\t\t$limit = $this->input->get('limit');\n\t\t\n\t\t$this->load->model('User_model');\n\t\t\n\t\t$team_list_count = $this->User_model->GetTeamCount($sport_id, $search_text);\n\t\tif($limit >0 ) {\n\t\t\t$remianest = $team_list_count - $limit;\n\t\t}\n\t\telse {\n\t\t\t$remianest = $team_list_count;\n\t\t}\n\t\t\n\t\t$team_list_arr=$this->User_model->GetTeam($sport_id, $search_text, $offset, $limit);\n\t\tif(count($team_list_arr)>0)\n\t\t{\n\t\t\t$this->response(array('status'=>'success','remaincount' => $remianest, 'team'=>$team_list_arr), 200);\n\t\t}\n\t\telse\n\t\t\t$this->response(array('status'=>'failed','message'=>'No records in database'),200);\n\t\n\t\n\t}", "function getUsersTeamNames($userId) \n{\n global $db;\n try {\n $getTeams = \"SELECT tu.id,tu.team_id,t.name AS teamName \n FROM team_users AS tu\n LEFT JOIN teams AS t ON tu.team_id = t.id\n WHERE tu.user_id = '\" .$userId.\"' \n AND tu.deleted = '0'\";\n \n $statement = $db->prepare($getTeams);\n $statement->execute(); \n $usersTeams = $statement->fetchAll(PDO::FETCH_ASSOC);\n \n return (!empty($usersTeams))? $usersTeams : NULL;\n } catch (Exception $exception) {\n throw new Exception($exception->getMessage());\n }\n}", "function getNbMainObjectsFound($teamId){\r\n //$GLOBALS['link'] = connect();\r\n $res = mysqli_query($GLOBALS['link'], 'select nbMainObjectsFoundByPlayers as nb from teams where `id`=\"'. $teamId .'\";');\r\n\r\n return fetch_result($res);\r\n}", "function get_team_p_war_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT p.player_id\n , CONCAT(pl.first_name,\" \",pl.last_name) as player\n , round(p.war,1) as war\n FROM CalcPitching p INNER JOIN players pl ON p.player_id=pl.player_id\n WHERE p.year = :year AND p.team_id = :team_id\n ORDER BY p.war DESC\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_p_war_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_p_war_leaders;\n}", "function b_minitable_show( ) {\n global $xoopsDB;\n $module_handler =& xoops_gethandler('module');\n $module =& $module_handler->getByDirname('cricketstats');\n //Get config for News module\n $config_handler =& xoops_gethandler('config');\n if ($module) {\n $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));\n }\n \n //Season id\n $sql = \"SELECT SeasonID, SeasonName FROM \".$xoopsDB->prefix(\"cricket_seasonnames\").\" WHERE SeasonDefault=1\";\n $cricket_seasonname = $xoopsDB->query($sql);\n $cricket_seasonname = $xoopsDB->fetchArray($cricket_seasonname);\n $cricket_season_id = $cricket_seasonname['SeasonID'];\n $cricket_seasonname = $cricket_seasonname['SeasonName']; \n \n //League id\n $sql2 = \"SELECT LeagueID, LeagueName FROM \".$xoopsDB->prefix(\"cricket_leaguenames\").\" WHERE LeagueDefault=1\";\n $cricket_leaguename = $xoopsDB->query($sql2);\n $cricket_leaguename = $xoopsDB->fetchArray($cricket_leaguename);\n $cricket_league_id = $cricket_leaguename['LeagueID'];\n $cricket_leaguename = $cricket_leaguename['LeagueName']; \n\n //For win, draw and lost?\n $cricket_for_win = $moduleConfig['forwin'];\n $cricket_for_draw = $moduleConfig['fordraw'];\n $cricket_for_lose = $moduleConfig['forloss'];\n \n //Query to get teams from selected season & league\n $cricket_get_teams = $xoopsDB->query(\"SELECT DISTINCT\n O.OpponentName AS name,\n O.OpponentID AS id\n FROM \".$xoopsDB->prefix(\"cricket_opponents\").\" O, \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n WHERE LM.LeagueMatchSeasonID = '$cricket_season_id' AND\n\t\t\t\t\t\tLM.LeagueMatchLeagueID = '$cricket_league_id' AND\n (O.OpponentID = LM.LeagueMatchHomeID OR\n O.OpponentID = LM.LeagueMatchAwayID)\n ORDER BY name\");\n \n //Lets read teams into the table\n $i = 0;\n while($cricket_data = $xoopsDB->fetchArray($cricket_get_teams))\n {\n $team[$cricket_data['id']]['name'] = $cricket_data['name'];\n $team[$cricket_data['id']]['homewins'] = 0;\n $team[$cricket_data['id']]['awaywins'] = 0;\n $team[$cricket_data['id']]['homeloss'] = 0;\n $team[$cricket_data['id']]['awayloss'] = 0;\n $team[$cricket_data['id']]['hometie'] = 0;\n $team[$cricket_data['id']]['awaytie'] = 0;\n $team[$cricket_data['id']]['homerunsfor'] = 0;\n $team[$cricket_data['id']]['homerunsagainst'] = 0;\n $team[$cricket_data['id']]['awayrunsfor'] = 0;\n $team[$cricket_data['id']]['awayrunsagainst'] = 0;\n $team[$cricket_data['id']]['matches'] = 0;\n }\n \n //Match data\n $query = $xoopsDB->query(\"SELECT\n LM.LeagueMatchID AS mid, \n LM.LeagueMatchHomeID as homeid,\n LM.LeagueMatchAwayID as awayid, \n LM.LeagueMatchHomeRuns as homeruns,\n LM.LeagueMatchAwayRuns as awayruns \n FROM\n \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n \tWHERE\n LM.LeagueMatchSeasonID = '$cricket_season_id' AND LM.LeagueMatchLeagueID = '$cricket_league_id' AND\n\t\t\t\t\t\t\t\tLM.LeagueMatchHomeRuns IS NOT NULL\");\n while ($cricket_matchdata = $xoopsDB->fetchArray($query)) {\n $cricket_hometeam = $cricket_matchdata['homeid'];\n $cricket_awayteam = $cricket_matchdata['awayid'];\n \n $team[$cricket_hometeam]['matches'] = $team[$cricket_hometeam]['matches'] + 1;\n $team[$cricket_awayteam]['matches'] = $team[$cricket_awayteam]['matches'] + 1;\n \n $team[$cricket_hometeam]['homerunsfor'] = $team[$cricket_hometeam]['homerunsfor'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsagainst'] = $team[$cricket_awayteam]['awayrunsagainst'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsfor'] = $team[$cricket_awayteam]['awayrunsfor'] + $cricket_matchdata['awayruns'];\n $team[$cricket_hometeam]['homerunsagainst'] = $team[$cricket_hometeam]['homerunsagainst'] + $cricket_matchdata['awayruns'];\n \n $rundiff = $cricket_matchdata['homeruns'] - $cricket_matchdata['awayruns'];\n if ($rundiff > 0) {\n $team[$cricket_hometeam]['homewins'] = $team[$cricket_hometeam]['homewins'] + 1;\n $team[$cricket_awayteam]['awayloss'] = $team[$cricket_awayteam]['awayloss'] + 1;\n }\n elseif ($rundiff == 0) {\n $team[$cricket_hometeam]['hometie'] = $team[$cricket_hometeam]['hometie'] + 1;\n $team[$cricket_awayteam]['awaytie'] = $team[$cricket_awayteam]['awaytie'] + 1;\n }\n elseif ($rundiff < 0) {\n $team[$cricket_hometeam]['homeloss'] = $team[$cricket_hometeam]['homeloss'] + 1;\n $team[$cricket_awayteam]['awaywins'] = $team[$cricket_awayteam]['awaywins'] + 1;\n }\n }\n $cricket_get_deduct = $xoopsDB->query(\"SELECT points, teamid FROM \".$xoopsDB->prefix(\"cricket_deductedpoints\").\" WHERE seasonid = '$cricket_season_id' AND leagueid = '$cricket_league_id'\");\n while ($cricket_d_points = $xoopsDB->fetchArray($cricket_get_deduct)) {\n $team[$cricket_d_points[\"teamid\"]]['d_points'] = $cricket_d_points['points'];\n }\n foreach ($team as $teamid => $thisteam) {\n $temp_points = isset($thisteam['d_points']) ? $thisteam['d_points'] : 0;\n $cricket_points[$teamid] = ($thisteam['homewins'] * $cricket_for_win) + ($thisteam['awaywins'] * $cricket_for_win) + ($thisteam['hometie'] * $cricket_for_draw) + ($thisteam['awaytie'] * $cricket_for_draw) + $temp_points;\n $cricket_runsfor[$teamid] = $thisteam['homerunsfor'] + $thisteam['awayrunsfor'];\n $cricket_runsagainst[$teamid] = $thisteam['homerunsagainst'] + $thisteam['awayrunsagainst'];\n }\n array_multisort($cricket_points, SORT_NUMERIC, SORT_DESC, $cricket_runsfor, SORT_NUMERIC, SORT_DESC, $cricket_runsagainst, SORT_NUMERIC, SORT_DESC, $team, SORT_STRING, SORT_ASC);\n \n //Print the table\n $block['title'] = _BL_CRICK_MINITABLE;\n $block['content'] = \"<table width='100%' cellspacing='2' cellpadding='2' border='0'>\n <tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_TEAM.\"</u></span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_POINTS.\"</u></span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_RUNS.\"</u></span></td> \n </tr></table><marquee behavior='scroll' direction='up' width='100%' height='100' scrollamount='1' scrolldelay='60' onmouseover='this.stop()' onmouseout='this.start()'><table width='100%' cellspacing='2' cellpadding='2' border='0'>\";\n foreach ($team as $teamid => $thisteam)\n {\n $block['content'] .= \"<tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: normal;'>\".$thisteam['name'].\"</span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_points[$teamid].\"</span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_runsfor[$teamid].\"-\".$cricket_runsagainst[$teamid].\"</span></td>\n </tr>\";\n }\n $block['content'] .= \"</table><br><div align=\\\"center\\\"><a href=\\\"\".XOOPS_URL.\"/modules/cricketstats/index.php\\\">\"._BL_CRICK_GOTOMAIN.\"</a></div></marquee>\";\n return $block;\n}", "function getPlayinTeams(){\n return array(\n //winner to [25]\n array('name'=>'UCLA','elo'=>1542,'off'=>114.1,'def'=>96.8,'tempo'=>64.7),\n array('name'=>'Michigan State','elo'=>1596,'off'=>107.7,'def'=>92.2,'tempo'=>68.6),\n //winner to [17]\n array('name'=>'Texas Southern','elo'=>1395,'off'=>99.7,'def'=>104.3,'tempo'=>72.0),\n array('name'=>'Mt. St Marys','elo'=>1278,'off'=>96.1,'def'=>99.7,'tempo'=>62.2),\n //winner to [9]\n array('name'=>'Drake','elo'=>1540,'off'=>114.6,'def'=>98.6,'tempo'=>66.8),\n array('name'=>'Wichita State','elo'=>1592,'off'=>110.7,'def'=>97.7,'tempo'=>67.6),\n //winner to [1]\n array('name'=>'Appalachian State','elo'=>1378,'off'=>100.1,'def'=>103.0,'tempo'=>65.7),\n array('name'=>'Norfolk St','elo'=>1310,'off'=>101.3,'def'=>103.6,'tempo'=>67.7),\n );\n}", "function get_team_info_db($idTeam)\n{\n require('./model/connect_db.php');\n $sql = \"select t.nameTeam from team t where t.idteam = '%d'\";\n $request = sprintf($sql,$idTeam);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $team_info = mysqli_fetch_assoc($result);\n return $team_info;\n}", "function check_looted_current_player($id_partie, $byTeam = false, $position = false) {\n global $wpdb;\n if ($byTeam == false AND $position == false) {\n\n try {\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d\", get_position_by_id($id_partie, get_current_user_id()), $id_partie\n )\n );\n\n return count($resultats);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n } else {\n try {\n \n $equipe= get_team(get_current_user_id(), $id_partie);\n if($equipe == 1){\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d AND equipe_1 = %d\", $position, $id_partie, 1\n )\n );}else {\n $resultats = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT * FROM looted WHERE position = %s AND id_partie = %d AND equipe_2 = %d\", $position, $id_partie, 1\n )\n );\n }\n\n return count($resultats);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n}", "public function showSpecificTeamAction(Team $team)\n {\n $activeTeamMemberships = $this->getDoctrine()->getRepository(TeamMembership::class)->findActiveTeamMembershipsByTeam($team);\n $inActiveTeamMemberships = $this->getDoctrine()->getRepository(TeamMembership::class)->findInactiveTeamMembershipsByTeam($team);\n usort($activeTeamMemberships, array( $this, 'sortTeamMembershipsByEndDate' ));\n usort($inActiveTeamMemberships, array( $this, 'sortTeamMembershipsByEndDate' ));\n\n $user = $this->getUser();\n $currentUserTeamMembership = $this->getDoctrine()->getRepository(TeamMembership::class)->findActiveTeamMembershipsByUser($user);\n $isUserInTeam = false;\n foreach ($currentUserTeamMembership as $wh) {\n if (in_array($wh, $activeTeamMemberships)) {\n $isUserInTeam = true;\n }\n }\n\n // Return the view with suitable variables\n return $this->render('team_admin/specific_team.html.twig', array(\n 'team' => $team,\n 'activeTeamMemberships' => $activeTeamMemberships,\n 'inActiveTeamMemberships' => $inActiveTeamMemberships,\n 'isUserInTeam' => $isUserInTeam,\n ));\n }", "function listTeams($con, $def_teamID)\n\t{ \n\t # Default value for the team dropdown\n\t $sql_teams = \"SELECT teamID, teamName FROM journeyteams\";\n\t\t$result_teams = $con->query($sql_teams) or die(mysqli_error($con));\n\t\n\t\t$list_teams = \"\";\n\t\twhile($rowt = mysqli_fetch_array($result_teams))\n\t\t{\n\t\t\t$teamID = htmlspecialchars($rowt['teamID']);\n\t\t\t$teamName = htmlspecialchars($rowt['teamName']);\n\t\n\t\t\tif($teamID == $def_teamID) { $selected = \"selected='true'\"; } else { $selected = \"\"; }\n\t\n\t\t\t$list_teams .= \"<option value='$teamID' $selected>$teamName</option>\";\n\t\t}\n\n\t\treturn $list_teams;\n\t}", "public function selectLeagueWinner($league, $team);", "function getActions($user, $opponent, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\n\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE Email = '$user' LIMIT 1\");\n\t$row = mysqli_fetch_assoc($playerResult);\n\t$player = $row['PlayerID'];\n\n\t// If we are trying to compare the logged in user with themselves on the list kill this function\n\tif ($player == $opponent) {\n\t\treturn false;\n\t}\n\n\t// Find any matches these two have\n\t$matchups = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT MatchID, ChallengerID, DefenderID, Status FROM Games WHERE (ChallengerID = '$player' OR DefenderID = '$player') AND (ChallengerID = '$opponent' OR DefenderID = '$opponent') AND (Status = 'Pending' OR Status = 'Issued')\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matchups[] = $row;\n\t}\n\n\tif (count($matchups) > 0) {\n\t\tforeach ($matchups as $key => $value) {\n\t\t\tif ($value['Status'] == 'Pending') {\n\t\t\t\tif ($value['ChallengerID'] == $player) {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"reportMatch(' . $value['MatchID'] . ',' . $value['ChallengerID'] . ',' . $value['DefenderID'] . ',\\'' . getName($opponent) . '\\',\\'Ladder\\',\\'Challenge\\')\">Report Match</button>';\n\t\t\t\t} else {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"reportMatch(' . $value['MatchID'] . ',' . $value['DefenderID'] . ',' . $value['ChallengerID'] . ',\\'' . getName($opponent) . '\\',\\'Ladder\\',\\'Defend\\')\">Report Match</button>';\n\t\t\t\t}\n\t\t\t} else if ($value['Status'] == 'Issued') {\n\t\t\t\tif ($value['ChallengerID'] == $player) {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"withdrawChallenge(' . $value['MatchID'] . ')\">Withdraw</button>';\n\t\t\t\t} else {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"acceptChallenge(' . $value['MatchID'] . ')\">Accept</button><button class=\"btn\" onclick=\"refuseChallenge(' . $value['MatchID'] . ')\">Refuse</button>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$actions = '<button class=\"btn\" onclick=\"issueChallenge(' . $player . ',' . $opponent . ',\\'' . getName($opponent) . '\\',\\'Ladder\\')\">Issue Challenge</button>';\n\t}\n\t\n\treturn $actions;\n}", "public function show()\n {\n $players = Player::all();\n $player = Player::where('id', '=', Auth::user()->id)->first();\n $actice_user_player = Player::where('id', '=', Auth::user()->id)->first();\n /* ======================================================\n Navigation\n ====================================================== */\n //Current Header\n $my_player_heading = '';\n $update_heading = '';\n $my_team_heading = '';\n $team_update_heading = '';\n $free_agency_heading = 'active';\n $activity_stream_heading = '';\n $find_teams_heading = '';\n\n //List of teams owned\n $teams_owned = [];\n $teams_on = [];\n\n foreach($player->teams as $team) {\n if ($team->pivot->status == 1) {\n $teams_owned[] = $team;\n }\n elseif($team->pivot->status == 2) {\n $teams_on[] = $team;\n }\n }\n\n /* ======================================================\n Free Agency Banner Content\n ====================================================== */\n $name = $player->name;\n $position = $player->position;\n $archetype = $player->archetype;\n $archetype2 = $player->archetype2;\n $player_profile_pic = $player->player_profile_pic;\n $user_avatar = $player->player_profile_pic;\n\n $search_name = '';\n $search_position = ['PG', 'SG', 'SF', 'PF', 'C'];\n $search_overall_min = 60;\n $search_overall_max = 99;\n $search_overall = [];\n\n $search_archetype = ['Playmaker', 'Lockdown Defender', 'Sharp Shooter', 'Slasher', 'Athletic Finisher', 'Stretch Big', 'Post Scorer', 'Glass Cleaner', 'Point Forward', 'Shot Creator'];\n $search_archetype2 = ['Playmaker', 'Lockdown Defender', 'Sharp Shooter', 'Slasher', 'Athletic Finisher', 'Stretch Big', 'Post Scorer', 'Glass Cleaner', 'Point Forward', 'Shot Creator'];\n\n $search_type_role = ['On-Ball | Facilitator','On-Ball | Scorer','Off-Ball | Facilitator','Off-Ball | Finisher'];\n $search_style = ['Drible-N-Dime', 'Run-The-Break', 'Pass-To-Assist-King', 'Assist-King', 'Ball-Movement-Coach', 'Screen-And-D', 'Inside-Out-Big',\n 'Defensive-Anchor', 'Boards-N-Outlets', 'Putback-King','Shot-Creator', 'Ankle-Breaking-Driver', 'Blow-By-Dunker', 'Isolation-Specialist',\n 'Post-Move-Master', 'Fast-Break-Finisher', 'Pick-N-Roll-Big', 'Second-Chance-Only', 'Backdoor-Posterizer', 'Catch-N-Shoot', 'Slash-N-Shoot'];\n $search_role = [];\n $search_type = [];\n foreach($search_type_role as $filter){\n array_push($search_type, explode(' | ', $filter)[0]);\n array_push($search_role, explode(' | ', $filter)[1]);\n }\n\n /* ======================================================\n View Player | Teams & Teammates\n ====================================================== */\n\n //team array instantiation\n $view_player_teams_owned = [];\n $view_player_teams_on = [];\n $disable_invites_for_these_team_ids = [];\n $teams_view_player_requested_to_join = [];\n\n // check pivot table -> status\n foreach($player->teams as $team) {\n if ($team->pivot->status == 1) {\n //List of Teams View Player owns\n $view_player_teams_owned[] = $team;\n }\n elseif($team->pivot->status == 2) {\n //List of Teams View Player is rostered on\n $view_player_teams_on[] = $team;\n //Disable \"send invite\" if player is rostered\n $disable_invites_for_these_team_ids[] = $team->id;\n }\n elseif($team->pivot->status == 3) {\n //Disable \"send invite\" if invite was already sent\n $disable_invites_for_these_team_ids[] = $team->id;\n }\n elseif($team->pivot->status == 4) {\n //List of teams this view user has requested to join\n $teams_view_player_requested_to_join[] = $team->id;\n }\n }\n\n //merge team arrays | used to find list of teammates\n $all_teams = array_merge($view_player_teams_owned, $view_player_teams_on);\n\n //teammate array instantiation\n $team_members = [];\n $player_names = [];\n\n //search all teams\n foreach($all_teams as $team) {\n //search all players\n foreach($team->players as $player) {\n //If teammate is not alreaady in the teammate list, add them as a teammate\n if (!in_array($player->name, $player_names)) {\n //Used for reference\n $player_names[] = $player->name;\n //Used to display teammate list on front end\n $team_members[] = $player;\n }\n }\n }\n\n /* ======================================================\n Active User | Teams & Teammates\n ====================================================== */\n\n //Identify the list of teams an invite can be sent from\n $label_invite_sent_if_one_of_these_teams = [];\n $add_player_to_roster_if_one_of_these_teams = [];\n $label_invite_sent_if_one_of_these_team_ids = [];\n $add_player_to_roster_if_one_of_these_team_ids = [];\n\n //Iterate Active User's Team List\n foreach($teams_owned as $team) {\n //If team is not diabled\n if(!in_array($team->id, $disable_invites_for_these_team_ids)) {\n //and team has not received an incoming request\n if(!in_array($team->id, $teams_view_player_requested_to_join)){\n //Add to SEND INVITE Button's team list\n $label_invite_sent_if_one_of_these_teams[] = $team;\n $label_invite_sent_if_one_of_these_team_ids[] = $team->id;\n }\n //if team has received an incoming request\n else {\n //Add to ACCEPT REQUEST Button's team list\n $add_player_to_roster_if_one_of_these_teams[] = $team;\n $add_player_to_roster_if_one_of_these_team_ids[] = $team->id;\n }\n }\n }\n\n $send_invite_from_one_of_these_teams = array_merge($label_invite_sent_if_one_of_these_teams, $add_player_to_roster_if_one_of_these_teams);\n\n\n\n\n /* ======================================================\n Data Object\n ====================================================== */\n $data = ['find_teams_heading' => $find_teams_heading, 'search_type_role' => $search_type_role, 'search_name' => $search_name ,\n 'search_archetype' => $search_archetype, 'search_archetype2' => $search_archetype2, 'search_position' => $search_position,\n 'search_type' => $search_type, 'search_overall_min' => $search_overall_min, 'search_overall_max' => $search_overall_max, 'search_overall' => $search_overall,\n 'search_role' => $search_role, 'search_style' => $search_style, 'name' => $name, 'archetype' => $archetype,\n 'position' => $position, 'archetype2' => $archetype2, 'players' => $players, 'team_update_heading' => $team_update_heading,\n 'my_player_heading' => $my_player_heading, 'update_heading' => $update_heading, 'my_team_heading' => $my_team_heading,\n 'free_agency_heading' => $free_agency_heading, 'activity_stream_heading' => $activity_stream_heading, 'user_avatar' => $user_avatar,\n 'teams_owned' => $teams_owned, 'teams_on' => $teams_on, 'player_profile_pic' => $player_profile_pic,\n 'label_invite_sent_if_one_of_these_team_ids' => $label_invite_sent_if_one_of_these_team_ids,\n 'add_player_to_roster_if_one_of_these_team_ids' => $add_player_to_roster_if_one_of_these_team_ids,\n 'send_invite_from_one_of_these_teams' => $send_invite_from_one_of_these_teams\n ];\n\n return view('agency.show')->with($data);\n }", "public static function get_players($team)\r\n {\r\n $result = db::sql(\"SELECT player_id, first_name, last_name FROM `superrugby_2016_scores_18` WHERE Team = '$team' ORDER BY first_name;\", DB_NAME);\r\n $player_reference = null;\r\n if (mysqli_num_rows($result)){\r\n while(list($player_id, $firstname, $lastname) = mysqli_fetch_array($result)){\r\n $player_reference[] = array('id'=>$player_id, 'firstname'=>$firstname, 'lastname'=>$lastname);\r\n }\r\n }\r\n return $player_reference;\r\n }", "public static function fetch_data($opt)\r\n {\r\n $result = ($opt == 'all') ? db::sql(\"SELECT * FROM `superrugby_2016_scores_18`\", DB_NAME):\r\n db::sql(\"SELECT * FROM `superrugby_2016_scores_18` WHERE Team = '$opt'\", DB_NAME);\r\n $return_result = null;\r\n if (mysqli_num_rows($result)){\r\n while(list($round, $match_id, $player_id, $first_name, $last_name, $country, $position, $bonus_points, $full_appearance, $part_appearance, $win, $draw,\t$away_win, $away_draw, $try, $assist, $conversion, $penalty, $drop_goal, $yellow_card, $red_card, $man_of_the_match) = mysqli_fetch_array($result)){\r\n $return_result[] = array(\r\n 'round'=>$round,\r\n 'match_id'=>$match_id,\r\n 'player_id'=>$player_id,\r\n 'first_name'=>$first_name,\r\n 'last_name'=>$last_name,\r\n 'team'=>$country,\r\n 'position'=>$position,\r\n 'bonus_points'=>$bonus_points,\r\n 'full_appearance'=>$full_appearance,\r\n 'part_appearance'=>$part_appearance,\r\n 'win'=>$win,\r\n 'draw'=>$draw,\r\n 'away_win'=>$away_win,\r\n 'away_draw'=>$away_draw,\r\n 'try'=>$try,\r\n 'assist'=>$assist,\r\n 'conversion'=>$conversion,\r\n 'penalty'=>$penalty,\r\n 'drop_goal'=>$drop_goal,\r\n 'yellow_card'=>$yellow_card,\r\n 'red_card'=>$red_card,\r\n 'man_of_the_match'=>$man_of_the_match\r\n );\r\n }\r\n }\r\n return $return_result;\r\n }", "function players(){\n\t\t$this->autoRender = false;\n\t\t$this->response->type('json');\n\t\t\n\t\t$this->loadModel('Player'); // player module to fetch player data\n\t\t\n\t\t$team_id = $this->request->data('teamid'); //team id from request\n\t\t\n\t\ttry {\n\t\t\t$players = $this->Player->find('all', array('conditions' => array('team_id' => $team_id))); //players by team_id\n\t\t}catch (Exception $e){\n\t\t\techo $this->dbError;\n\t\t}\n\t\tif (!empty($players)){\n\t\t\techo json_encode($players);\n\t\t}else{\n\t\t\techo $this->noResult;\n\t\t}\n\t\t\n\t}", "public function team();", "function getActiveGamesList () {\n\tglobal $bdd;\n\t$req = $bdd->prepare('\n\t\tSELECT *\n\t\tFROM parties\n\t\tORDER BY id_partie;\n\t');\n\t$req->execute();\n\t$list = array();\n\twhile ($row = $req->fetch()) {\n\t\t$list[] = array(\n\t\t\t'id_partie' => $row['id_partie'],\n\t\t\t'nom' => $row['nom'],\n\t\t\t'createur' => getLoginForPlayer($row['createur']),\n\t\t\t'date_debut' => $row['date_debut'],\n\t\t\t'date_fin' => $row['date_fin'],\n\t\t\t'partie_privee' => ($row['password'] === sha1('') || $row['password'] === NULL) ? 'NO' : 'YES',\n\t\t\t'players' => getListeJoueursPartie($row['id_partie'])\n\t\t);\n\t}\n\treturn $list;\n}", "public function list_team($id)\n {\n $con['selection'] = 'hr_users.*, hr_users.id as user_id, hr_designations.name as designation, hr_roles.name as role, hr_departments.name as department';\n $con['conditions'] = array(\n 'hr_users.department_id' => $id,\n 'hr_users.status' => 1\n );\n $con['innerJoin'] = array(array(\n 'table' => 'hr_designations',\n 'condition' =>'hr_users.designation_id = hr_designations.id',\n 'joinType' => 'left'\n ),array(\n 'table' => 'hr_roles',\n 'condition' =>'hr_users.role_id = hr_roles.id',\n 'joinType' => 'left'\n ),array(\n 'table' => 'hr_departments',\n 'condition' =>'hr_users.department_id = hr_departments.id',\n 'joinType' => 'left'\n ));\n $data['users'] = $this->get_users($con);\n $data['heading'] = 'Employees';\n $this->load->view('users/users', $data);\n }", "function get_team_woba_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT b.player_id\n , CONCAT(p.first_name,\" \",p.last_name) AS player\n , b.woba\n FROM CalcBatting b INNER JOIN players p ON b.player_id=p.player_id\n INNER JOIN team_history_record t ON b.team_id=t.team_id AND b.year=t.year\n WHERE b.year = :year AND b.team_id = :team_id\n AND b.PA * 3.1 >= t.g\n ORDER BY b.woba DESC\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_woba_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_woba_leaders;\n}", "function getAllPlayers()\r\n{\r\n global $db, $selectSQL, $selectSQL2;\r\n\r\n unset($GLOBALS['players']);\r\n $GLOBALS['players'] = array();\r\n $res = $db->query(\"select * from player order by firstname asc\");\r\n\r\n while($row = $db->getRows($res))\r\n {\r\n $GLOBALS['players'][$row['id']]['id'] = $row['id'];\r\n $GLOBALS['players'][$row['id']]['firstname'] = $row['firstname'];\r\n $GLOBALS['players'][$row['id']]['lastname'] = $row['lastname'];\r\n $GLOBALS['players'][$row['id']]['email'] = $row['email'];\r\n $GLOBALS['players'][$row['id']]['phone'] = $row['phone'];\r\n $inches = $row['height'] % 12;\r\n $GLOBALS['players'][$row['id']]['heightIN'] = $inches;\r\n $GLOBALS['players'][$row['id']]['heightFT'] = ($row['height'] - $inches) / 12;\r\n $GLOBALS['players'][$row['id']]['weight'] = $row['weight'];\r\n $GLOBALS['players'][$row['id']]['positions'] = $row['positions'];\r\n $GLOBALS['players'][$row['id']]['bats'] = $row['bats'];\r\n $GLOBALS['players'][$row['id']]['throws'] = $row['throws'];\r\n \r\n if(!empty($row['birthdate']) && $row['birthdate'] != \"0000-00-00\")\r\n {\r\n list($year, $month, $day) = explode('-', $row['birthdate']);\r\n $birthdate = $month . \"/\" . $day . \"/\" . $year;\r\n $GLOBALS['players'][$row['id']]['birthdate'] = $birthdate;\r\n }\r\n \r\n $GLOBALS['players'][$row['id']]['nickname'] = $row['nickname'];\r\n $GLOBALS['players'][$row['id']]['img'] = $row['img'];\r\n }\r\n}", "public static function getPlayersByTeam(Team $team) {\n CommonDao::connectToDb();\n $lastYear = TimeUtil::getYearByEvent(Event::OFFSEASON_START) - 1;\n $query = \"select p.*, s.fantasy_pts\n \t from player p\n \t left outer join (select * from stat where year = $lastYear) s\n on s.player_id = p.player_id\n \t inner join team_player tp on p.player_id = tp.player_id\n \t where tp.team_id = \" . $team->getId() .\n \t\" order by p.last_name, p.first_name\";\n $res = mysql_query($query);\n $playersDb = array();\n while($playerDb = mysql_fetch_assoc($res)) {\n \t$player = PlayerDao::populatePlayer($playerDb);\n \t$player->setStatLine($lastYear, StatDao::populateStatLine($playerDb));\n \t$playersDb[] = $player;\n }\n return $playersDb;\n }", "public function competition_team_get()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"GET\")\n\t\t{\n\t\t $this->response('Not Acceptable',406);\n\t\t}\n\t\t$comp_team_list_arr=array();\n\n\t\t$this->load->model('Table_model');\n\t\t$comp_team_list_arr=$this->Table_model->GetCompetitionTeam();\n\t\tif(count($comp_team_list_arr)>0)\n\t\t{\n\t\t\t$this->response(array('status'=>'success','competition_team'=>$comp_team_list_arr), 200);\n\t\t}\n\t\telse\n\t\t\t$this->response(array('status'=>'failed','message'=>'No records in database'),200);\n\t\n\t\n\t}", "function get_team_war_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT b.player_id\n , CONCAT(p.first_name,\" \",p.last_name) AS player\n , round(b.war,1) as war\n FROM CalcBatting b INNER JOIN players p ON b.player_id=p.player_id\n INNER JOIN team_history_record t ON b.team_id=t.team_id AND b.year=t.year\n WHERE b.year = :year AND b.team_id = :team_id\n ORDER BY b.war DESC\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_war_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_war_leaders;\n}", "function xstats_displayShipList( $gameId ) {\n $playerIndexList = xstats_getAvailablePlayerIndicies($gameId);\n foreach($playerIndexList as $playerIndex) {\n xstats_displayShipListOfUser( $gameId, $playerIndex);\n }\n}", "function getTeams($Field = '', $Where = array(), $multiRecords = FALSE, $PageNo = 1, $PageSize = 15)\n {\n $Params = array();\n if (!empty($Field)) {\n $Params = array_map('trim', explode(',', $Field));\n $Field = '';\n $FieldArray = array(\n 'TeamID' => 'T.TeamID',\n 'StatusID' => 'T.StatusID',\n 'TeamIDLive' => 'T.TeamIDLive',\n 'TeamName' => 'T.TeamName',\n 'TeamNameShort' => 'T.TeamNameShort',\n 'SportsType' => 'T.SportsType',\n 'TeamFlag' => 'IF(T.TeamFlag IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/TeamFlag/\",\"team.png\"), CONCAT(\"' . BASE_URL . '\",\"uploads/TeamFlag/\",T.TeamFlag)) TeamFlag',\n 'Status' => 'CASE T.StatusID\n when \"2\" then \"Active\"\n when \"6\" then \"Inactive\"\n END as Status',\n 'SeriesName' => '(SELECT GROUP_CONCAT(`SeriesName`) FROM sports_series WHERE SeriesID IN(SELECT DISTINCT SeriesID FROM `sports_team_players` WHERE `TeamID` = T.TeamID)) SeriesName'\n );\n if ($Params) {\n foreach ($Params as $Param) {\n $Field .= (!empty($FieldArray[$Param]) ? ',' . $FieldArray[$Param] : '');\n }\n }\n }\n $this->db->select('T.TeamName,T.TeamGUID');\n if (!empty($Field)) {\n $this->db->select($Field, FALSE);\n }\n $this->db->from('sports_teams T');\n if (!empty($Where['Keyword'])) {\n $Where['Keyword'] = trim($Where['Keyword']);\n $this->db->group_start();\n $this->db->like(\"T.TeamName\", $Where['Keyword']);\n $this->db->or_like(\"T.TeamNameShort\", $Where['Keyword']);\n $this->db->group_end();\n }\n if (!empty($Where['TeamID'])) {\n $this->db->where(\"T.TeamID\", $Where['TeamID']);\n }\n if (!empty($Where['TeamIDLive'])) {\n $this->db->where(\"T.TeamIDLive\", $Where['TeamIDLive']);\n }\n if (!empty($Where['SportsType'])) {\n $this->db->where(\"T.SportsType\", $Where['SportsType']);\n }\n if (!empty($Where['StatusID'])) {\n $this->db->where(\"T.StatusID\", $Where['StatusID']);\n }\n if (!empty($Where['SeriesID'])) {\n $this->db->where('T.TeamID IN(SELECT DISTINCT TeamID FROM `sports_team_players` WHERE `SeriesID` = ' . $Where['SeriesID'] . ')', NULL, FALSE);\n }\n if (!empty($Where['OrderBy']) && !empty($Where['Sequence'])) {\n $this->db->order_by($Where['OrderBy'], $Where['Sequence']);\n } else {\n $this->db->order_by('T.TeamName', 'ASC');\n }\n\n /* Total records count only if want to get multiple records */\n if ($multiRecords) {\n $TempOBJ = clone $this->db;\n $TempQ = $TempOBJ->get();\n $Return['Data']['TotalRecords'] = $TempQ->num_rows();\n if ($PageNo != 0) {\n $this->db->limit($PageSize, paginationOffset($PageNo, $PageSize)); /* for pagination */\n }\n } else {\n $this->db->limit(1);\n }\n $Query = $this->db->get();\n if ($Query->num_rows() > 0) {\n if ($multiRecords) {\n $Return['Data']['Records'] = $Query->result_array();\n return $Return;\n } else {\n return $Query->row_array();\n }\n }\n return FALSE;\n }", "public function actionListmyteam() {\n return array('status' => 0, 'status_msg' => 'ok');\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function getPotentialOpponents() {\n\t\t\n\t\t$userID = $this->id;\n\t\t$level = $this->level;\n\t\t$agencySize = $this->agency_size;\n\t\t$minHealth = 25;\n\t\t\t\t\n\t\t// get up to 10 people to list on the attack list\n\t\t$attackListSize = 15;\n\t\t\n\t\t$maxAgencySize = $agencySize + 5;\n\t\t$minAgencySize = max(array(1, $agencySize - 5));\n\t\t\n\t\t// temporary solution for level range\n\t\t$minLevel = $level - 5 .'<br />';\n\t\t$maxLevel = $level + 5 .'<br />';\n\t\t\n/*\t\t$query = \"SELECT * FROM users,agencies WHERE (users.level <= ? AND users.level >= ? OR users.agency_size <= ? AND users.agency_size >= ?) AND (users.health > $minHealth AND users.level>3) AND (users.id != agencies.user_one_id AND users.id != agencies.user_two_id AND agencies.accepted =1) AND users.id != ? GROUP BY users.id ORDER BY RAND() LIMIT $attackListSize\";*/\n\n\t\t/*$query = \"SELECT * FROM users,agencies WHERE (users.level <= ? AND users.level >= ? OR users.agency_size <= ? AND users.agency_size >= ?) AND (users.health > $minHealth AND users.level>3) AND (users.id NOT IN (SELECT agencies.user_one_id FROM agencies WHERE agencies.user_two_id = $userID AND agencies.accepted =1)) AND (users.id NOT IN (SELECT agencies.user_two_id FROM agencies WHERE agencies.user_one_id = $userID AND agencies.accepted =1)) AND users.id != $userID GROUP BY users.id ORDER BY users.id LIMIT $attackListSize\";*/\n\t\t\n\t\t\n\t\t $query = \"SELECT * FROM users WHERE (users.level <= ? AND users.level >= ?) AND users.id != $userID GROUP BY users.id ORDER BY users.id LIMIT $attackListSize\";\n\t\t\n\t\t$objAllPotOpps = ConnectionFactory::SelectRowsAsClasses($query, array($maxLevel, $minLevel), __CLASS__);\n\t\t\t\t\n\t\tif (!$objAllPotOpps || count($objAllPotOpps) < $attackListSize) {\n\t\t\t// TODO: execute further queries with higher level or agency size ranges if too few users\n\t\t\t//the next lines is temp solution if there is 1<x<attacklistsize opponents\n\t\t\tif ($objAllPotOpps) return $objAllPotOpps;\n\t\t\telse return array();\n\t\t}\n\n\t\t// get random indices\n\t\t$randomIntegers = getRandomIntegers($attackListSize, count($objAllPotOpps));\n\t\t\n\t\t$opponents = array();\n\t\tforeach ($randomIntegers as $key=>$value) {\n\t\t\tarray_push($opponents, $objAllPotOpps[$key]);\n\t\t}\n\t\treturn $opponents;\n\t}", "function getAllPlayers(){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by rating DESC\";\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "public function playerList($param)\n {\n try {\n $player = Player::where('id', $param)->orWhere('first_name', $param)->orWhere('last_name', $param)->first();\n if ($player) {\n $team = $player->team()->get('name');\n if ($team) {\n return json_encode(array(\"status\" => 200, \"message\" => \"Players\", \"response\" => array($player, $team)));\n }\n return json_encode(array(\"status\" => 200, \"message\" => \"Players info without team details\", \"response\" => array($player)));\n }\n return json_encode(array(\"status\" => 500, \"message\" => \"Player not found\"));\n } catch (Throwable $e) {\n report($e);\n return json_encode(array(\"status\" => 500, \"message\" => \"Something went wrong\"));\n }\n }", "function printGameList($g) {\n\t\t$gameList = Ss::get()->gameMap;\n\t\t$gamePlayed = $g['gamePlayed'];\n\t\techo '<div id=\"divGameList\" class=\"hiddenDiv\">';\n\t\techo '<select id=\"selectGameList\" multiple=\"multiple\" name=\"new_game[]\">';\n\t\tforeach($gameList as $game) {\n\t\t\tif(!isset($gamePlayed[$game->id])) {\n\t\t\t\t// on ajoute le jeu dans la liste uniquement si on y joue pas déjà\n\t\t\t\techo '<option value=\"'.$game->id.'\">'.$game->name.'</option>';\n\t\t\t}\n\t\t}\n\t\techo '</select>';\n\t\techo '</div>';\n\t\treturn $g;\n\t}", "function lanorg_get_tournament_list() {\n\tglobal $wpdb;\n\n\t$table_name = $wpdb->prefix . 'lanorg_tournaments';\n\n\t$tournaments = $wpdb->get_results(\"SELECT id, game FROM $table_name\", ARRAY_A);\n\t$tournament_list = array();\n\tforeach ($tournaments as $tournament) {\n\t\t$tournament_list[$tournament['id']] = $tournament['game'];\n\t}\n\n\treturn $tournament_list;\n}", "function fantacalcio_admin_players_list() {\n $out = l(\"Aggiorna lista\", \"admin/fantacalcio/players/list\") . \"<br/>\";\n \n $players = Player::all();\n \n if ($players) {\n \n $header = array(\"Id\", \"Nome\", \"Ruolo\");\n \n foreach ($players as $pl_id => $player) {\n $names[] = $player->name;\n $roles[] = $player->role;\n }\n \n array_multisort($names, SORT_ASC, $roles, SORT_ASC, $players);\n \n foreach ($players as $pl_id => $player) {\n $rows[] = array(\n \"data\" => array(\n $player->id, \n l($player->name, \"admin/fantacalcio/players/\" . $player->id), \n Player::convertRole($player->role)));\n }\n \n $out .= theme(\"table\", array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table\", \"table-responsive\"))));\n }\n return $out;\n}", "public function actionDisplay() {\r\n global $mainframe, $user; \r\n $tourID = Request::getVar('tourID',0);\r\n $model = Tournament::getInstance();\r\n $tour_detail = $model->getItem($tourID);\r\n $lists = $model->getLists($tourID, $tour_detail); \r\n \r\n $this->addBarTitle(\"Tournament: <small>$tour_detail->name</small>\", \"tournaments\"); \r\n $this->addIconToolbar(\"Apply\", Router::buildLink(\"gamesport\", array(\"view\"=>\"tournament\", \"layout\" => \"save\",\"tourID\"=>$tourID)), \"apply\");\r\n addSubMenuGameSportTour('tournament');\r\n \r\n $this->render('teamjoined', array('tour_detail'=> $tour_detail,'lists' => $lists));\r\n }", "public function teamList()\n {\n $teams = Team::all();\n $countTC = 0;\n $countBranch = 0;\n foreach ($teams as $t) {\n if($t->respo->branch == \"TC\" && $t->respo->level < 4){\n $countTC ++;\n }\n else\n $countBranch++;\n }\n //info(\"Nombre de team de TC : \" . $countTC . \" Nombre de team de Branche : \" . $countBranch);\n\n return View::make('dashboard.ce.teamlist', [\n 'teams' => Team::all(),\n 'teamLeftTC' => Config::get('services.ce.maxTeamTc') - $countTC,\n 'teamLeftBranch' => Config::get('services.ce.maxTeamBranch') - $countBranch,\n ]);\n }", "function get_mil_fielding_stats($player_id) {\n global $db;\n $query = 'SELECT f.player_id,\n f.year,\n f.year - YEAR(p.date_of_birth) AS age,\n f.team_id,\n f.league_id,\n l.abbr as league,\n f.level_id,\n f.split_id,\n po.pos_name,\n f.tc,\n f.a,\n f.po,\n f.er,\n f.ip,\n f.g,\n f.gs,\n f.e,\n f.dp,\n f.tp,\n f.pb,\n f.sba,\n f.rto,\n f.ipf,\n f.plays,\n f.plays_base,\n f.roe,\n f.opps_0,\n f.opps_made_0,\n f.opps_1,\n f.opps_made_1,\n f.opps_2,\n f.opps_made_2,\n f.opps_3,\n f.opps_made_3,\n f.opps_4,\n f.opps_made_4,\n f.opps_5,\n f.opps_made_5,\n f.zr,\n concat(p.first_name,\" \",p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM players_career_fielding_stats f INNER JOIN players p ON\n f.player_id = p.player_id\n INNER JOIN teams t ON f.team_id = t.team_id\n INNER JOIN positions po ON f.position = po.position\n INNER JOIN leagues l ON b.league_id = l.league_id\n WHERE f.level_id <> 1 AND f.player_id = :player_id\n ORDER BY f.year, f.level_id, t.abbr, po.pos_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':player_id', $player_id);\n $statement->execute();\n $mil_fielding_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $mil_fielding_stats;\n}", "public function teams_view()\n {\n $user = \\Auth::user();\n $is_referee = \\App\\Referee::where('user_id', $user->id)->first();\n $is_admin = \\App\\Admin::where('user_id', $user->id)->first();\n\n $venue = false;\n $teams = false;\n \n if($is_referee)\n {\n $venue = \\App\\Venue::find($is_referee->venue_id);\n } else if($is_admin) {\n $venue = \\App\\Venue::find($is_admin->venue_id);\n }\n\n if($venue and $is_admin)\n {\n $teams = \\App\\Team::where('venue_id', $is_admin->venue_id)->orderBy('name')->paginate(15);\n } else if($venue and $is_referee) {\n $teams = \\App\\Team::where('venue_id', $is_referee->venue_id)->orderBy('name')->paginate(15);\n } else {\n return abort(404);\n }\n\n return view('admin_users.teams_view', ['teams' => $teams]);\n }", "public function getTeamList() {\n if ($this->cached['Team']) return array_values($this->cache['Team']);\n return XPClass::forName('de.uska.db.Team')\n ->getMethod('getPeer')\n ->invoke()\n ->doSelect(new Criteria(\n array('team_id', $this->getTeam_id(), EQUAL)\n ));\n }", "function get_team_player_pitching_stats($year,$team_id) {\n global $db;\n $query = 'SELECT concat(players.first_name, \" \", players.last_name) AS player\n , g\n , gs\n , ip\n , ab\n , ha\n , k\n , bb\n , bf\n , war\n , k9\n , bb9\n , HR9\n , WHIP\n , `K/BB`\n , BABIP\n , ERA\n , FIP\n , xFIP\n , ERAminus\n , ERAplus\n , FIPminus\n , CalcPitching.player_id\n\n\n FROM CalcPitching INNER JOIN players ON CalcPitching.player_id = players.player_id\n\n WHERE year = :year AND CalcPitching.team_id = :team_id\n ORDER BY gs DESC, players.last_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $pitchers = $statement->fetchAll();\n $statement->closeCursor();\n return $pitchers;\n}", "function get_team_ba_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT b.player_id\n , CONCAT(p.first_name,\" \",p.last_name) AS player\n , b.ba\n FROM CalcBatting b INNER JOIN players p ON b.player_id=p.player_id\n INNER JOIN team_history_record t ON b.team_id=t.team_id AND b.year=t.year\n WHERE b.year = :year AND b.team_id = :team_id\n AND b.PA * 3.1 >= t.g\n ORDER BY b.ba DESC\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_ba_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_ba_leaders;\n}", "function oid_check_teams($response)\n{\n $requiredTeam = common_config('openid', 'required_team');\n if ($requiredTeam) {\n $team_resp = new Auth_OpenID_TeamsResponse($response);\n if ($team_resp) {\n $teams = $team_resp->getTeams();\n } else {\n $teams = array();\n }\n\n $match = in_array($requiredTeam, $teams);\n $is = $match ? 'is' : 'is not';\n common_log(LOG_DEBUG, \"Remote user $is in required team $requiredTeam: [\" . implode(', ', $teams) . \"]\");\n\n return $match;\n }\n\n return true;\n}", "public function getPlayersForMatchWithStatistics( $id_match, $id_season, $order_by = false )\n\t{\n\t\t$id_match\t= intval( $id_match );\n\t\t$id_season\t= intval( $id_season );\n\t\t$order_by\t= ( false === $order_by )? 'status_order, p4.position, num_times_rotated DESC' : $order_by;\n\n\t\t$query = <<<QUERY\nSELECT\n\tmp4.id_match,\n\tmp4.available,\n\tp4.id_player,\n\tp4.name,\n\tp4.position,\n\tp4.email,\n\tp4.sanitized_name,\n\tp4.middle_name,\n\tp4.image_url,\n\t(\n\t\tSELECT\n\t\t\tCOUNT( mp1.id_match ) AS num\n\t\tFROM\n\t\t\tmatches_player mp1\n\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\tWHERE\n\t\t\tp1.id_player = p4.id_player AND\n\t\t\tm2.id_season = $id_season AND\n\t\t\tm2.status = 'closed' AND\n\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\tm2.id_match != $id_match AND\n\t\t\tmp1.available = 'available'\n\t) AS num_times_rotated,\n\t(\n\t\t(\n\t\t\t1 * (\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT( mp1.id_match ) AS num\n\t\t\t\tFROM\n\t\t\t\t\tmatches_player mp1\n\t\t\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\t\t\tWHERE\n\t\t\t\t\tp1.id_player = p4.id_player AND\n\t\t\t\t\tm2.id_season = $id_season AND\n\t\t\t\t\tm2.status = 'closed' AND\n\t\t\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\tm2.id_match != $id_match AND\n\t\t\t\t\tmp1.available = 'available'\n\t\t\t)\n\t\t)\n\t\t- \n\t\t(\n\t\t\t(\n\t\t\t\t0.25 * (\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tCOUNT( m4.id_match ) AS num\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmatches m4\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tm4.id_season = $id_season AND\n\t\t\t\t\t\t\tm4.id_match != $id_match AND\n\t\t\t\t\t\t\tm4.status = 'closed' AND\n\t\t\t\t\t\t\tm4.type IN ( 'league', 'cup' )\n\t\t\t\t\t) - (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tCOUNT( mp3.id_match ) AS num\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmatches_player mp3\n\t\t\t\t\t\t\tINNER JOIN matches m5 USING ( id_match )\n\t\t\t\t\t\t\tINNER JOIN player p3 USING ( id_player )\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp3.id_player = p4.id_player AND\n\t\t\t\t\t\t\tm5.id_season = $id_season AND\n\t\t\t\t\t\t\tm5.status = 'closed' AND\n\t\t\t\t\t\t\tm5.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\t\t\tm5.id_match != $id_match AND\n\t\t\t\t\t\t\tmp3.available IN ( 'available', 'injuried', 'called', 'if_necessary' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t+\n\t\t\t(\n\t\t\t\t1 * (\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tCOUNT( mp1.id_match ) AS num\n\t\t\t\t\tFROM\n\t\t\t\t\t\tmatches_player mp1\n\t\t\t\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\t\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp1.id_player = p4.id_player AND\n\t\t\t\t\t\tm2.id_season = $id_season AND\n\t\t\t\t\t\tm2.status = 'closed' AND\n\t\t\t\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\t\tm2.id_match != $id_match AND\n\t\t\t\t\t\tmp1.available = 'missed'\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t) AS rotate_index,\n\t(\n\t\tCASE\n\t\t\tWHEN mp4.available = 'called' THEN 1\n\t\t\tWHEN mp4.available = 'available' THEN 2\n\t\t\tWHEN mp4.available = 'if_necessary' THEN 3\n\t\t\tELSE 4\n\t\tEND\n\t) AS status_order\nFROM\n\tmatches_player mp4\n\tINNER JOIN player p4 USING( id_player )\nWHERE\n\tmp4.id_match = $id_match\nORDER BY\n\t$order_by\nQUERY;\n\n\t\tif ( !$players = $this->database->query( $query, 'Get players for a match' ) )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$url = $this->getClass( 'Url' );\n\t\tforeach ( $players as &$player )\n\t\t{\n\t\t\t$player['player_url']\t= $url->buildUrl( 'player', 'index', array( $player['sanitized_name'] ) );\n\t\t}\n\n\t\treturn $players;\n\t}", "function tournament_list_ex() {\n if (empty($_SESSION['user_info'])) {\n echo \"Không lấy được thông tin người dùng, bạn vui lòng làm mới trang.\";\n die;\n }\n\n $user = unserialize($_SESSION['user_info']);\n //var_dump($user); die;\n $this->data[\"user\"] = $user;\n\n $char_id = $user->character_id;\n $server_id = $user->server_id;\n $char_name = $user->character_name;\n $mobo_service_id = $user->mobo_service_id;\n $mobo_id = $user->mobo_id;\n\n $tournament_list = $this->tichluy->tournament_list();\n\n $tournament_filter = array();\n $client_ip = $this->get_client_ip();\n\n foreach ($tournament_list as $key => $value) {\n //echo var_dump(preg_replace('/\\s+/', '', $value[\"tournament_ip_list\"]));die;\n $ip_list = preg_replace('/\\s+/', '', $value[\"tournament_ip_list\"]);\n $server_list = preg_replace('/\\s+/', '', $value[\"tournament_server_list\"]);\n\n if ($ip_list != \"\" && $server_list == \"\") {\n $ip_list = explode(\";\", $ip_list);\n if (in_array($client_ip, $ip_list)) {\n array_push($tournament_filter, Array(\"id\" => $value[\"id\"], \"tournament_name\" => $value[\"tournament_name\"], \"tournament_date_start\" => $value[\"tournament_date_start\"], \"tournament_date_end\" => $value[\"tournament_date_end\"],\n \"tournament_status\" => $value[\"tournament_status\"], \"tournament_server_list\" => $server_list, \"tournament_date_start_reward\" => $value[\"tournament_date_start_reward\"], \"tournament_date_end_reward\" => $value[\"tournament_date_end_reward\"]\n , \"tournament_ip_list\" => $ip_list, \"tournament_img\" => $value[\"tournament_img\"]));\n }\n }\n\n if ($server_list != \"\" && $ip_list == \"\") {\n $server_list = explode(\";\", $server_list);\n if (in_array($server_id, $server_list)) {\n array_push($tournament_filter, Array(\"id\" => $value[\"id\"], \"tournament_name\" => $value[\"tournament_name\"], \"tournament_date_start\" => $value[\"tournament_date_start\"], \"tournament_date_end\" => $value[\"tournament_date_end\"],\n \"tournament_status\" => $value[\"tournament_status\"], \"tournament_server_list\" => $server_list, \"tournament_date_start_reward\" => $value[\"tournament_date_start_reward\"], \"tournament_date_end_reward\" => $value[\"tournament_date_end_reward\"]\n , \"tournament_ip_list\" => $ip_list, \"tournament_img\" => $value[\"tournament_img\"]));\n }\n }\n\n if ($server_list == \"\" && $ip_list == \"\") {\n array_push($tournament_filter, Array(\"id\" => $value[\"id\"], \"tournament_name\" => $value[\"tournament_name\"], \"tournament_date_start\" => $value[\"tournament_date_start\"], \"tournament_date_end\" => $value[\"tournament_date_end\"],\n \"tournament_status\" => $value[\"tournament_status\"], \"tournament_server_list\" => $server_list, \"tournament_date_start_reward\" => $value[\"tournament_date_start_reward\"], \"tournament_date_end_reward\" => $value[\"tournament_date_end_reward\"]\n , \"tournament_ip_list\" => $ip_list, \"tournament_img\" => $value[\"tournament_img\"]));\n }\n\n if ($server_list != \"\" && $ip_list != \"\") {\n $server_list = explode(\";\", $server_list);\n $ip_list = explode(\";\", $ip_list);\n if (in_array($server_id, $server_list) && (in_array($client_ip, $ip_list))) {\n array_push($tournament_filter, Array(\"id\" => $value[\"id\"], \"tournament_name\" => $value[\"tournament_name\"], \"tournament_date_start\" => $value[\"tournament_date_start\"], \"tournament_date_end\" => $value[\"tournament_date_end\"],\n \"tournament_status\" => $value[\"tournament_status\"], \"tournament_server_list\" => $server_list, \"tournament_date_start_reward\" => $value[\"tournament_date_start_reward\"], \"tournament_date_end_reward\" => $value[\"tournament_date_end_reward\"]\n , \"tournament_ip_list\" => $ip_list, \"tournament_img\" => $value[\"tournament_img\"]));\n }\n }\n }\n\n $this->output->set_output(json_encode($tournament_filter));\n }", "function get_ml_fielding_stats($player_id) {\n global $db;\n $query = 'SELECT f.player_id,\n f.year,\n f.year - YEAR(p.date_of_birth) AS age,\n f.team_id,\n f.league_id,\n l.abbr as league,\n f.level_id,\n f.split_id,\n po.pos_name,\n f.tc,\n f.a,\n f.po,\n f.er,\n f.ip,\n f.g,\n f.gs,\n f.e,\n f.dp,\n f.tp,\n f.pb,\n f.sba,\n f.rto,\n f.ipf,\n f.plays,\n f.plays_base,\n f.roe,\n f.opps_0,\n f.opps_made_0,\n f.opps_1,\n f.opps_made_1,\n f.opps_2,\n f.opps_made_2,\n f.opps_3,\n f.opps_made_3,\n f.opps_4,\n f.opps_made_4,\n f.opps_5,\n f.opps_made_5,\n f.zr,\n concat(p.first_name,\" \",p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM players_career_fielding_stats f INNER JOIN players p ON\n f.player_id = p.player_id\n INNER JOIN teams t ON f.team_id = t.team_id\n INNER JOIN positions po ON f.position = po.position\n INNER JOIN leagues l ON f.league_id = l.league_id\n WHERE f.level_id = 1 AND f.player_id = :player_id\n ORDER BY f.year, t.abbr, po.pos_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':player_id', $player_id);\n $statement->execute();\n $ml_fielding_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $ml_fielding_stats;\n}", "function getTeams(){\n return array(\n //Gonzaga ~96%\n array('name'=>'Gonzaga','elo'=>1870,'off'=>126.8,'def'=>88.8,'tempo'=>74.8),\n array(),\n //Missouri 53%\n array('name'=>'Oklahoma','elo'=>1534,'off'=>112.1,'def'=>94.1,'tempo'=>67.7),\n array('name'=>'Missouri','elo'=>1548,'off'=>110.9,'def'=>94.9,'tempo'=>68.7),\n //Creighton 70%\n array('name'=>'Creighton','elo'=>1650,'off'=>115.6,'def'=>92.8,'tempo'=>69.1),\n array('name'=>'UCSB','elo'=>1496,'off'=>109.9,'def'=>96.3,'tempo'=>66.1),\n //Virginia 73%\n array('name'=>'Virginia','elo'=>1682,'off'=>116.3,'def'=>92.3,'tempo'=>60.1),\n array('name'=>'Ohio','elo'=>1507,'off'=>113.7,'def'=>101.2,'tempo'=>69.3),\n // USC 55%\n array('name'=>'USC','elo'=>1628,'off'=>113.6,'def'=>89.9,'tempo'=>67,3),\n array(),\n //Kansas 79%\n array('name'=>'Kansas','elo'=>1701,'off'=>110.3,'def'=>87.9,'tempo'=>68.3),\n array('name'=>'E Washington','elo'=>1469,'off'=>108.4,'def'=>100.3,'tempo'=>72.4),\n //Oregon 65%\n array('name'=>'Oregon','elo'=>1669,'off'=>115.1,'def'=>96.0,'tempo'=>67.2),\n array('name'=>'VCU','elo'=>1558,'off'=>106.2,'def'=>88.8,'tempo'=>69.8),\n //Iowa 86%\n array('name'=>'Iowa','elo'=>1710,'off'=>124.2,'def'=>93.9,'tempo'=>70.0),\n array('name'=>'Grand Canyon','elo'=>1383,'off'=>104.2,'def'=>95.8,'tempo'=>65.5),\n //Michigan 87%\n array('name'=>'Michigan','elo'=>1727,'off'=>120.1,'def'=>87.9,'tempo'=>66.8),\n array(),\n //LSU 55%\n array('name'=>'LSU','elo'=>1633,'off'=>120.5,'def'=>99.4,'tempo'=>70.8),\n array('name'=>'St Bonaventure','elo'=>1597,'off'=>112.0,'def'=>89.8,'tempo'=>65.2),\n //Colorado 56%\n array('name'=>'Colorado','elo'=>1639,'off'=>115.1,'def'=>92.0,'tempo'=>66.4),\n array('name'=>'Georgetown','elo'=>1593,'off'=>108.4,'def'=>92.9,'tempo'=>69.6),\n //Florida State 65%\n array('name'=>'Florida State','elo'=>1632,'off'=>117.1,'def'=>93.6,'tempo'=>70.6),\n array('name'=>'UNCG','elo'=>1519,'off'=>104.8,'def'=>95.2,'tempo'=>68.5),\n //BYU 62%\n array('name'=>'BYU','elo'=>1632,'off'=>113.8,'def'=>91.4,'tempo'=>68.0),\n array(),\n //Texas 78%\n array('name'=>'Texas','elo'=>1705,'off'=>114.5,'def'=>92.5,'tempo'=>69.2),\n array('name'=>'Abilene Christian','elo'=>1481,'off'=>103.7,'def'=>92.2,'tempo'=>70.0),\n //UCONN 59%\n array('name'=>'UCONN','elo'=>1610,'off'=>114.3,'def'=>90.9,'tempo'=>66.0),\n array('name'=>'Maryland','elo'=>1546,'off'=>111.6,'def'=>91.5,'tempo'=>65.3),\n //Alabama 90%\n array('name'=>'Alabama','elo'=>1753,'off'=>112.4,'def'=>86.0,'tempo'=>73.9),\n array('name'=>'Iona','elo'=>1371,'off'=>101.1,'def'=>100.7,'tempo'=>68.3),\n //Baylor 92%\n array('name'=>'Baylor','elo'=>1806,'off'=>124.0,'def'=>93.0,'tempo'=>68.4),\n array('name'=>'Hartford','elo'=>1359,'off'=>98.2,'def'=>99.5,'tempo'=>66.7),\n //UNC 60%\n array('name'=>'North Carolina','elo'=>1624,'off'=>110.8,'def'=>89.3,'tempo'=>71.8),\n array('name'=>'Wisconsin','elo'=>1553,'off'=>113.2,'def'=>89.1,'tempo'=>64.9),\n //Villanova 60%\n array('name'=>'Villanova','elo'=>1634,'off'=>119.3,'def'=>95.3,'tempo'=>65.1),\n array('name'=>'Winthrop','elo'=>1558,'off'=>105.8,'def'=>95.4,'tempo'=>73.6),\n //Purdue 68%\n array('name'=>'Purdue','elo'=>1622,'off'=>114.3,'def'=>90.6,'tempo'=>66.5),\n array('name'=>'North Texas','elo'=>1484,'off'=>106.1,'def'=>92.9,'tempo'=>63.1),\n //Texas Tech 52%\n array('name'=>'Texas Tech','elo'=>1595,'off'=>113.1,'def'=>90.7,'tempo'=>65.4),\n array('name'=>'Utah State','elo'=>1576,'off'=>106.4,'def'=>88.5,'tempo'=>68.9),\n //Arkansas 66%\n array('name'=>'Arkansas','elo'=>1679,'off'=>112.2,'def'=>89.2,'tempo'=>73.1),\n array('name'=>'Colgate','elo'=>1559,'off'=>111.6,'def'=>99.9,'tempo'=>72.5),\n //Florida 52%\n array('name'=>'Florida','elo'=>1550,'off'=>111.7,'def'=>92.7,'tempo'=>68.7),\n array('name'=>'Virginia Tech','elo'=>1530,'off'=>110.7,'def'=>94.1,'tempo'=>66.2),\n //Ohio St 85%\n array('name'=>'Ohio State','elo'=>1681,'off'=>123.0,'def'=>96.1,'tempo'=>67.1),\n array('name'=>'Oral Roberts','elo'=>1373,'off'=>109.4,'def'=>106.7,'tempo'=>71.8),\n //Illinois 92%\n array('name'=>'Illinois','elo'=>1807,'off'=>119.7,'def'=>87.6,'tempo'=>70.7),\n array('name'=>'Drexel','elo'=>1362,'off'=>107.8,'def'=>104.8,'tempo'=>64.2),\n //Georgia Tech 51%\n array('name'=>'Loyola Chicago','elo'=>1655,'off'=>111.1,'def'=>85.9,'tempo'=>64.2),\n array('name'=>'Georgia Tech','elo'=>1659,'off'=>114.0,'def'=>94.1,'tempo'=>67.8),\n //Tennessee 51%\n array('name'=>'Tennessee','elo'=>1602,'off'=>109.5,'def'=>87.0,'tempo'=>67.3),\n array('name'=>'Oregon State','elo'=>1591,'off'=>110.0,'def'=>98.4,'tempo'=>65.4),\n //Oklahoma St 74%\n array('name'=>'Oklahoma State','elo'=>1700,'off'=>110.8,'def'=>90.6,'tempo'=>72.0),\n array('name'=>'Liberty','elo'=>1517,'off'=>110.8,'def'=>101.0,'tempo'=>63.1),\n //SD State 66%\n array('name'=>'San Diego State','elo'=>1697,'off'=>111.5,'def'=>88.8,'tempo'=>66.1),\n array('name'=>'Syracuse','elo'=>1574,'off'=>114.5,'def'=>96.9,'tempo'=>69.2),\n //West Virginia 69%\n array('name'=>'West Virginia','elo'=>1633,'off'=>116.8,'def'=>95.1,'tempo'=>69.6),\n array('name'=>'Morehead State','elo'=>1492,'off'=>100.9,'def'=>95.5,'tempo'=>65.6),\n //Clemson 52%\n array('name'=>'Clemson','elo'=>1571,'off'=>107.6,'def'=>90.0,'tempo'=>64.2),\n array('name'=>'Rutgers','elo'=>1556,'off'=>109.3,'def'=>89.8,'tempo'=>67.8),\n //Houston 88%\n array('name'=>'Houston','elo'=>1742,'off'=>119.6,'def'=>89.4,'tempo'=>64.9),\n array('name'=>'Cleveland State','elo'=>1395,'off'=>101.5,'def'=>98.7,'tempo'=>66.3),\n );\n}", "private static function showMembers(SR_Player $player, $page)\n\t{\n\t\tif ($page < 1)\n\t\t{\n\t\t\t$player->message(Shadowhelp::getHelp($player, 'clan'));\n\t\t\treturn false;\n\t\t}\n\t\tif (false === ($clan = SR_Clan::getByPlayer($player)))\n\t\t{\n\t\t\tself::rply($player, '1019', array($player->getName()));\n// \t\t\t$player->message('You are not in a clan, chummer.');\n\t\t\treturn false;\n\t\t}\n\t\t$ipp = 10;\n\t\t$nItems = $clan->getMembercount();\n\t\t$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);\n\t\tif ($page > $nPages)\n\t\t{\n\t\t\t$player->msg('1009');\n// \t\t\t$player->message('This page is empty.');\n\t\t\treturn false;\n\t\t}\n\t\t$from = GWF_PageMenu::getFrom($page, $ipp);\n\t\t$where = 'sr4cm_cid='.$clan->getID();\n\t\t$orderby = 'sr4cm_jointime ASC';\n\t\tif (false === ($members = GDO::table('SR_ClanMembers')->selectAll('sr4pl_name, sr4pl_sid, sr4pl_level', $where, $orderby, array('players'), $ipp, $from, GDO::ARRAY_N)))\n\t\t{\n\t\t\t$player->message('DB ERROR 1');\n\t\t\treturn false;\n\t\t}\n\t\tif (count($members) === 0)\n\t\t{\n\t\t\t$player->msg('1009');\n// \t\t\t$player->message('This page is empty.');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$back = '';\n\t\t$format = $player->lang('fmt_sumlist');\n\t\tforeach ($members as $row)\n\t\t{\n\t\t\t$from++;\n\t\t\t$back .= sprintf($format, $from, \"{$row[0]}{{$row[1]}}\", \"L{$row[2]}\");\n// \t\t\t$back .= sprintf(', %d-%s{%s}(L%s)', $from, $row[0], $row[1], $row[2]);\n\t\t}\n\t\t\n\t\treturn self::rply($player, '5040', array($nItems, $page, $nPages, ltrim($back, ',; ')));\n// \t\treturn Shadowrap::instance($player)->reply(sprintf('%d ClanMembers page %d/%d: %s.', $nItems, $page, $nPages, substr($back, 2)));\n\t}", "function get_driver_team_db($idTeam)\n{\n require('./model/connect_db.php');\n $sql = \"select p.idPilot, p.namePilot, p.pilotNumber, p.country from pilot p where p.idTeam = '%d'\";\n $request = sprintf($sql,$idTeam);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $list_driver = array();\n while($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $list_driver[] = $line;\n }\n return $list_driver;\n}", "function fetchGame() {\n\n\t\t$this -> mysqli -> query(\"\n\t\tCREATE TEMPORARY TABLE IF NOT EXISTS temp1 AS\n\t\t(SELECT matchups.matchupID, matchups.homeTeamID, matchups.awayTeamID, games.gameKickofftime \n\t\tFROM games \n\t\tINNER JOIN matchups \n\t\tON games.gameID = matchups.gameID);\");\n\n\t\t$this -> mysqli -> query(\"CREATE TEMPORARY TABLE IF NOT EXISTS temp2 AS\n\t\t(SELECT t.matchupID, t.homeTeamID, t.awayTeamID, t.gameKickofftime, teams.teamSchoolAcro \n FROM temp1 t\n LEFT JOIN teams ON t.homeTeamID = teams.teamID);\");\n\n\t\t$res = $this -> mysqli -> query(\"SELECT t2.matchupID, t2.homeTeamID, t2.awayTeamID, t2.gameKickofftime, t2.teamSchoolAcro AS homeTeam, teams.teamSchoolAcro AS awayTeam\n FROM temp2 t2\n LEFT JOIN teams ON t2.awayTeamID = teams.teamID;\");\n\n\t\techo \"<div class='table-responsive'><table class='table table-striped table-hover'>\";\n\t\techo \"<tr><th>Game ID</th><th>Game</th><th>Kickoff Time</th></tr>\";\n\n\t\twhile ($row = $res -> fetch_assoc()) {\n\t\t\t//format the date to be more user friendly\n\t\t\t$date = date_create($row['gameKickofftime']);\n\t\t\t$formattedDate = date_format($date, 'd/m/Y @ g:i A');\n\t\t\techo \"<tr>\" . \"<td>\" . $row['matchupID'] . \"</td>\" . \"<td>\" . $row['awayTeam'] . \" @ \" . $row['homeTeam'] . \"</td>\" . \"<td>\" . $formattedDate . \"</td>\" . \"</tr>\";\n\t\t}\n\t\techo \"</table></div>\";\n\t}", "public function get_teams($sportFK,$tsid)\n\t{\n\t\t$this->db->select('e.id,ep.id as epid,p.id as pid,p.name as pname');\n\t\t$this->db->from('tournament_template as tt');\n\t\t$this->db->join('tournament AS t', 't.tournament_templateFK = tt.id', 'INNER');\n\t\t$this->db->join('tournament_stage AS ts', 't.id = ts.tournamentFK', 'INNER');\n\t\t$this->db->join('event AS e', 'ts.id = e.tournament_stageFK', 'INNER');\n\t\t$this->db->join('event_participants AS ep', 'e.id = ep.eventFK', 'INNER');\n\t\t$this->db->join('participant AS p', 'ep.participantFK = p.id', 'left');\n\t\t$this->db->WHERE(\"tt.sportFK =\".$sportFK.\"\");\n\t\t$this->db->WHERE(\"ts.id = $tsid \");\n\t\t//$this->db->WHERE(\"e.startdate > '\".$this->today.\"' \");\n\t\t$this->db->group_by('ep.participantFK');\n\t\t$this->db->order_by(\"e.startdate,e.id,ts.id\");\n\t\t$result = $this->db->get();\n\t\treturn $result->result();\n\t}", "function LoginTeam($sid='qte')\n{\n if ( isset($_SESSION[$sid.'_usr_auth']) && ( isset($_SESSION[$sid.'_usr_name']) || isset($_SESSION[$sid.'_usr_username']) ) ) {\n if ( $_SESSION[$sid.'_usr_auth']=='yes' ) {\n\n // check coherence: name must exist\n global $oDB;\n if ( isset($_SESSION[$sid.'_usr_name']) ) { $str = $_SESSION[$sid.'_usr_name']; } else { $str=$_SESSION[$sid.'_usr_username']; }\n $oDB->Query('SELECT count(*) as countid FROM '.TABUSER.' WHERE username=\"'.$str.'\"');\n\n if ( $row = $oDB->Getrow() ) {\n if ( isset($row['countid']) ) {\n if ( $row['countid']==1 ) {\n $_SESSION[$sid.'_usr_auth'] = true;\n // Get user info\n $oDB->Query('SELECT id,username,role,children,status FROM '.TABUSER.' WHERE username=\"'.$str.'\"');\n $row = $oDB->Getrow();\n $_SESSION[$sid.'_usr_id'] = (int)$row['id'];\n $_SESSION[$sid.'_usr_name'] = $row['username'];\n $_SESSION[$sid.'_usr_role'] = $row['role'];\n // Register VIP info in session\n $this->Register();\n return array('fullname'=>$str,'coppa'=>intval($row['children']),'status'=>$row['status']);\n\n }}}\n\n }}\n\n return array('fullname'=>'','coppa'=>0,'status'=>'Z');\n}", "public function biuldTeamsOptions() {// Connection data (server_address, database, name, poassword)\r\n \r\n $sql = \"select Team_Id,Team_Name from teams \";\r\n $html=\"\";\r\n $result=array();\r\n try {\r\n $result= $this->query($sql);\r\n }\r\n \r\n catch (PDOException $e) {\r\n \r\n return($e->getMessage());\r\n }\r\n \r\n\r\n \r\n \r\n \r\n $html = '<option value=\"0\"></option>';\r\n foreach ($result as $row) {\r\n\r\n $html.='<option value=\"'.$row['Team_Id'].'\">'.$row['Team_Name'].'</option>';\r\n\r\n\r\n \r\n }\r\n \r\n\r\n \r\n \r\n $html.='';\r\n\r\n return $html;\r\n \r\n }", "public function show($id)\n {\n\n $teams= Team::all();\n $team= Team::find($id);\n $player= Player::find($id);\n return view('players.show', compact('player','team','teams'));\n // $teams = $player->teams;\n // return view('players.show', compact(\"teams\",\"player\"));\n }", "function getPlayers($player = '')\n {\n $queryString = \"SELECT * FROM `players` \";\n if (!empty($player)) {\n $queryString .= \"WHERE Player='$player'\";\n }\n $result = $this->db->query($queryString);\n\n return $result;\n }", "public function show(team_members $team_members)\n {\n //\n }", "function get_team_info($idTeam)\n{\n $team_info = get_team_info_db($idTeam);\n return $team_info;\n}", "public function actionUser_team() {\n if (isset($_POST['dep_id']) != 0) {\n $output = '';\n $dep_id = $_POST['dep_id'];\n\n $UserTeam = DvUsersTeam::find()->where(['status' => 1, 'dep_id' => $dep_id])->all();\n $UTeam = ArrayHelper::map($UserTeam, 'id', 'name');\n\n if (!empty($UTeam)) {\n $output .= '<select id=\"dvusers-team\" class=\"form-control\" name=\"usermeta[team]\" required=\"required\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Team\">';\n $output .= '<option value=\"\">Select Team</option>';\n foreach ($UTeam as $id => $name) {\n $output .= '<option value=\"' . $id . '\">' . $name . '</option>';\n }\n\n $output .= '</select>';\n } else {\n $output .= '<select id=\"dvusers-team\" class=\"form-control\" name=\"usermeta[team]\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Team\">';\n $output .= '<option value=\"\">Select Team</option>';\n $output .= '</select>';\n }\n\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "function playTournament(){\n $teams = getTeams();\n $playin = getPlayinTeams();\n $teams[25] = compete2($playin[0],$playin[1]);\n $teams[17] = compete2($playin[2],$playin[3]);\n $teams[9] = compete2($playin[4],$playin[5]);\n $teams[1] = compete2($playin[6],$playin[7]);\n while(count($teams)>1){\n $newteams = array();\n for($i=0;$i<count($teams);$i+=2){\n $newteams[] = compete2($teams[$i],$teams[$i+1]);\n }\n $teams = $newteams;\n }\n return $teams[0]['name'];\n}", "function showGames()\n{\n $email = trim($_SESSION['login']);\n $dbEmail = R::getAll(\"SELECT * FROM users WHERE email = '$email'\");\n if (!empty($dbEmail)) {\n $user_id = $dbEmail[0]['id'];\n $games = R::getAll(\"SELECT * FROM games WHERE `user_id` = '$user_id'\");\n if (!empty($games)) {\n echo \"<table class='games'>\";\n echo \"<thead><tr>\n <td>#</td>\n <td>Cas hry</td>\n <td>Data hry</td>\n </tr></thead>\";\n $count = 1;\n foreach ($games as $game) {\n echo \"<tr>\n <td>\" . $count . \"</td>\";\n echo \"<td>\" . $game['time'] . \"</td>\";\n echo \"<td>\" . $game['data'] . \"</td>\";\n echo \"</tr>\";\n $count++;\n }\n echo \"</table>\";\n } else {\n echo \"No games yet!\";\n }\n }\n}", "function getPlayersGames($page)\n\t{\n\t\t$uid = $_SESSION[\"uid\"];\n\t\t$games = array();\n\t\t\n\t\t\n\t\t$query = ($page == \"ord\") ? \n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid'\n\t\t\tAND i.uid <>\n\t\t\tALL (\n\t\t\t\tSELECT DISTINCT o.uid\n\t\t\t\tFROM games g1, orders o\n\t\t\t\tWHERE g1.gid = g.gid\n\t\t\t\tAND g.gid = o.gid\n\t\t\t\tAND g.year = o.year\n\t\t\t\tAND g.season = o.season\n\t\t\t\t);\" \n\t\t\t:\n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($games, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "public function relatedTeams($idol)\n {\n return null;\n }" ]
[ "0.72173315", "0.6366328", "0.62107897", "0.5962764", "0.59562147", "0.58814335", "0.5831519", "0.58178693", "0.5812512", "0.5761344", "0.57304186", "0.5712501", "0.56841695", "0.5677066", "0.5673284", "0.56380284", "0.56097174", "0.56029207", "0.5587503", "0.55863094", "0.5549772", "0.5521579", "0.5515227", "0.55003935", "0.54791534", "0.5476346", "0.54746544", "0.5473214", "0.5472994", "0.54494184", "0.5440205", "0.5436564", "0.5427001", "0.5427001", "0.54154426", "0.5414782", "0.54049164", "0.5393459", "0.5377522", "0.5372661", "0.53692967", "0.53549874", "0.5353176", "0.53275794", "0.5326945", "0.5301545", "0.52973545", "0.5289778", "0.5283683", "0.5282245", "0.52748823", "0.5256474", "0.5256376", "0.52544415", "0.5251328", "0.5245659", "0.5229891", "0.52298707", "0.5229786", "0.5229627", "0.52138925", "0.5210661", "0.5210661", "0.5210661", "0.5210661", "0.5210661", "0.5210661", "0.52076524", "0.519703", "0.51957315", "0.5188316", "0.5184007", "0.5167776", "0.51671803", "0.51527464", "0.5152549", "0.51477134", "0.5142439", "0.51372385", "0.5136503", "0.5126664", "0.5126259", "0.51252234", "0.5119803", "0.5109416", "0.5104095", "0.5085577", "0.5083304", "0.50828797", "0.50770724", "0.507401", "0.5071239", "0.5068269", "0.5064035", "0.5051302", "0.50490296", "0.50425166", "0.50361675", "0.5033197", "0.50286925" ]
0.84685683
0
ZOBRAZENI SEZNAMU HRACU SPLNUJICICH PODMINKY LIGY $_GET['id'] = Mod zobrazeni prazdna normalni (zobrazi se jen kapitanem povoleni hraci a jejich giudy atd) id normalni (zobrazi se jen kapitanem povoleni hraci jen jejich giudy) all Zobrazi se i kapitanem nepovoleni hraci, jejich nicky atd allid Zobrazi se i kapitanem nepovoleni hraci jen jejich GUIDY
function ListAllowedPlayers(){ global $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players; if ($_GET['mode'] != "league"){ echo Menu(); KillUse($_SESSION['loginid']); } echo "<table width=\"857\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; if ($_GET['lid'] == 0){ echo " <tr>\n"; echo " <td>"._LEAGUE_NO_LEAGUE_ID."</td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; if ($_GET['show'] != "id" && $_GET['show'] != "season_players_all_guid"){ echo " <td width=\"30\" valign=\"middle\" class=\"eden_title\">ID</td>\n"; echo " <td align=\"left\" valign=\"top\" class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; echo " <td align=\"left\" valign=\"top\" class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>\n"; } echo " <td align=\"left\" valign=\"top\" class=\"eden_title\">"._LEAGUE_GUID."</td>\n"; echo " </tr>\n"; //$msg = LeagueGenerateListAllowedPlayers((float)$_GET['lid'],(float)$_GET['sid'],(float)$_GET['rid']); switch ($_GET['show']){ case "id": $colspan = 1; $res_round = mysql_query(" SELECT league_season_round_allowed_player_guid FROM $db_league_seasons_round_allowed_players WHERE league_season_round_allowed_player_season_round_id=".(float)$_GET['rid']." ORDER BY league_season_round_allowed_player_guid") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); break; case "season_players_all": $colspan = 4; break; case "season_players_all_guid": $colspan = 1; break; default: $colspan = 4; $res_round = mysql_query(" SELECT a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, ll.league_league_id, ll.league_league_game_id, lsrap.league_season_round_allowed_player_guid FROM $db_league_seasons_round_allowed_players AS lsrap JOIN $db_league_leagues AS ll ON ll.league_league_id=lsrap.league_season_round_allowed_player_league_id JOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id JOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id WHERE lsrap.league_season_round_allowed_player_season_round_id=".(float)$_GET['rid']." ORDER BY lsrap.league_season_round_allowed_player_team_sub_id ASC, a.admin_nick ASC") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $_GET['show'] = "all"; } $cislo = 0; // pro zobrazeni povolenych hracu if ($_GET['show'] == "id" || $_GET['show'] == "all"){ while ($ar_round = mysql_fetch_array($res_round)){ if ($cislo % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; if ($_GET['show'] != "id"){ echo " <td width=\"30\" align=\"right\" valign=\"top\">".$ar_round['admin_id']."</td>\n"; echo " <td width=\"150\" align=\"left\" valign=\"top\">".stripslashes($ar_round['league_team_name'])."</td>\n"; echo " <td valign=\"middle\"><strong>".stripslashes($ar_round['admin_nick'])."</strong></td>\n"; } echo " <td align=\"left\" valign=\"top\">"; if (empty($ar_round['league_season_round_allowed_player_guid'])){echo "<span class=\"red\">"._LEAGUE_PLAYER_NO_GUID."</span>";} else {echo stripslashes($ar_round['league_season_round_allowed_player_guid']);} echo "</td>\n"; echo " </tr>\n"; $cislo++; } unset($ar_round); } // pro zobrazeni vsech hracu if ($_GET['show'] == "season_players_all" || $_GET['show'] == "season_players_all_guid"){ $res_team = mysql_query(" SELECT lt.league_team_id, lt.league_team_name, ltsl.league_teams_sub_league_team_sub_id, ltsl.league_teams_sub_league_league_id FROM $db_league_teams_sub_leagues AS ltsl JOIN $db_league_teams AS lt ON lt.league_team_id=ltsl.league_teams_sub_league_team_id WHERE ltsl.league_teams_sub_league_league_id=".(integer)$_GET['lid']) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); while ($ar_team = mysql_fetch_array($res_team)){ $res_player = mysql_query(" SELECT a.admin_id, a.admin_nick, ag.admin_guid_guid, lp.league_player_id FROM $db_league_players AS lp JOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_league_guid_id=".(integer)$ar_team['league_teams_sub_league_league_id']." AND ag.admin_guid_guid != '' WHERE lp.league_player_team_sub_id=".(integer)$ar_team['league_teams_sub_league_team_sub_id']) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $i=1; while ($ar_player = mysql_fetch_array($res_player)){ if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; if ($_GET['show'] != "season_players_all_guid"){ echo " <td width=\"30\" align=\"right\" valign=\"top\">".$ar_player['admin_id']."</td>\n"; echo " <td width=\"150\" align=\"left\" valign=\"top\">".stripslashes($ar_team['league_team_name'])."</td>\n"; echo " <td valign=\"middle\"><strong>".stripslashes($ar_player['admin_nick'])."</strong></td>\n"; } echo " <td align=\"left\" valign=\"top\">".stripslashes($ar_player['admin_guid_guid'])."</td>\n"; echo " </tr>\n"; $i++; } } } } echo "</table>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\n return true;\n }", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "function buscarPorId($id) {\r\n \r\n }", "function get_id($id){\n\t\t$this->id = $id;\n\t}", "function teilnehmer()\n{\n if (isset($_GET['id'])) {\n showTeilnehmerEditForm();\n } else {\n showTeilnehmer();\n }\n}", "public function suprimerId($id)\n {\n }", "public function cargarCita(){\n if(isset($_GET[\"id\"])){\n echo ($_GET[\"datos\"]);\n }\n else\n {\n echo (\"No hay Id\");\n }\n }", "public function rechercherId($id)\n {\n }", "public function lidWijzigen($id) {\n if (!$this->authex->loggedIn()) {\n redirect('home/login');\n }\n\n $this->load->model('persoon_model');\n $data['lid'] = $this->persoon_model->get($id);\n $data['title'] = 'Lid wijzigen';\n $data['user'] = $this->authex->getUserInfo();\n $data['auteur'] = 'Stefanie Seker';\n\n $partials = array('header' => 'main_header', 'content' => 'lid_aanpassen', 'menu' => 'main_menu');\n $this->template->load('main_master', $partials, $data);\n }", "static public function ctrObtenerMensajePorId(){\n\n\t\t\tif(isset($_GET[\"id\"])){\n\n\t\t\t\t$tabla = \"mensajes\";\n\n\t\t\t\t$id = $_GET[\"id\"];\n\n\t\t\t\t$respuesta = ModeloMensajes::mdlObtenerMensajePorId($tabla, $id);\n\n\t\t\t\treturn $respuesta;\t\n\t\t\t\n\t\t\t}\n\n \t}", "function buscarPerId($id) {\n\n $con = new db();\n $query = $con->prepare(\"SELECT * FROM missatge INNER JOIN usuari ON missatge.id_usuari = usuari.id_usuari WHERE id_missatge='$id';\");\n $result = $con->consultar($query);\n\n $usuari = $result[0][\"usuari\"];\n $llegit = $result[0][\"llegit\"];\n if ($llegit == '0') {\n $llegit = 'no';\n } else {\n $llegit = 'si';\n }\n $titol = $result[0][\"titol\"];\n $data = $result[0][\"data\"];\n $text = $result[0][\"missatge\"];\n $id_missatge = $result[0][\"id_missatge\"];\n $missatge = new Missatge($usuari, $llegit, $titol, $data, $text);\n $missatge->setId_missatge($id_missatge);\n\n if ($llegit == 'no') {\n $query = $con->prepare(\"UPDATE missatge set llegit=1 WHERE id_missatge='$id';\");\n }\n\n $con->consulta($query);\n $con = null;\n\n\n return $missatge;\n }", "public static function ObtenerPorID($id) {\n }", "public function traerPorVehiculo($id)\n {\n }", "public function SalasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM salas LEFT JOIN mesas ON salas.codsala = mesas.codsala where salas.codsala = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codsala\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($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}", "public function iloscMinus($id)\n\t\t{\n\t\t\t$data = array();\n\t\t\t\tif($id === NULL || $id === \"\")\n\t\t\t\t\t$data['error'] = 'Nieokreślone ID!';\n\t\t\t\telse\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$stmt2 = $this->pdo->prepare('SELECT IdTowar, ilosc FROM `koszyk` where IdTowar=:id');\n\t\t\t\t\t\t$stmt2 -> bindValue(':id',$id,PDO::PARAM_INT);\n\t\t\t\t\t\t$ilosc = $stmt2 -> execute();\n\t\t\t\t\t\t$data = $stmt2 -> fetchAll();\n\t\t\t\t\t\tforeach($data as $result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ilosc = $result['ilosc'];\n\t\t\t\t\t\t\t$idt = $result['IdTowar'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($ilosc>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo $id.'<br>towary: ';\n\t\t\t\t\t\t\tvar_dump($_COOKIE['idtowary']);\n\t\t\t\t\t\t\t$stmt = $this->pdo->prepare('UPDATE koszyk SET ilosc=ilosc-1 WHERE IdTowar=:id');\n\t\t\t\t\t\t\t$stmt -> bindValue(':id',$id,PDO::PARAM_INT);\n\t\t\t\t\t\t\t$wynik_zapytania = $stmt -> execute();\n\n\t\t\t\t\t\t\t$stmt2 = $this->pdo->prepare(\"update towar set towar.StanMagazynowyDysponowany = towar.StanMagazynowyDysponowany+1 where IdTowar = $idt\");\n\t\t\t\t\t\t\t$stmt2 -> execute();\n\n\t\t\t\t\t\t\t$cookie2 = $_COOKIE['idtowary'];\n\t\t\t\t\t\t\t$cookie2 = stripslashes($cookie2);\n\t\t\t\t\t\t\t$ids = json_decode($cookie2, true);\n\n\t\t\t\t\t\t\tif(($k = array_search($idt, $ids)) === false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// echo 'nie ma';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t //echo 'jest';\n\t\t\t\t\t\t\t $indeks = array_search($idt, $ids);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$cookie = $_COOKIE['ilosci'];\n\t\t\t\t\t\t\t$cookie = stripslashes($cookie);\n\t\t\t\t\t\t\t$quantity = json_decode($cookie, true);\n\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tif(($k = array_search($idt, $ids)) === false){}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<br>ilosci ';\n\t\t\t\t\t\t\t\tvar_dump($_COOKIE['ilosci']);\n\t\t\t\t\t\t\t\t$ilosc=$ilosc-1;\n\t\t\t\t\t\t\t $quantity[$indeks]=$ilosc;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dane = json_encode($quantity);\n\t\t\t\t\t\t\tsetcookie('ilosci', $dane,time()+60*60*24*30,'/');\n\t\t\t\t\t\t\t$_COOKIE['ilosci'] = $dane;\n\t\t\t\t\t\t\techo '<br>';\n\t\t\t\t\t\t\tvar_dump($_COOKIE['ilosci']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(\\PDOException $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['error'] =$data['error'].'<br> Błąd wykonywania operacji usunięcia';\n\t\t\t\t\t}\n\t\t\t\t\t/*var_dump($_COOKIE['idtowary']);\n\t\t\t\t\techo '<br>';\n\t\t\t\t\tvar_dump($_COOKIE['ilosci']);\n\t\t\t\t\techo '<br>';*/\n\t\t\t\treturn $data;\n\n\t\t}", "public function edit($id) //Hämta redan bokad boking\n\t{\n\t\t//\n\t}", "function loadSimple($id){\r\n //$sql = $GLOBALS[\"db\"]->query('SELECT j_compte.*,j_partie.vitesse,j_partie.type FROM j_compte,j_partie WHERE j_compte.id = '.$id.' AND j_compte.partie = j_partie.id');\r\n if($id>0 AND $id != \"\"){\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_compte WHERE id = '.$id);\r\n $donnees = mysql_fetch_array($sql);\r\n }\r\n if($donnees['partie'] != 0 ){\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_partie WHERE id = '.$donnees['partie']);\r\n $donneesPartie = mysql_fetch_array($sql);\r\n }\r\n $this->id = $donnees['id'];\r\n $this->login = $donnees['login'];\r\n $this->mdp = $donnees['mdp'];\r\n $this->email = $donnees['email'];\r\n $this->skin = $donnees['skin'];\r\n $this->etat = $donnees['etat'];\r\n $this->points = $donnees['points'];\r\n $this->date_inscription = $donnees['date_inscription'];\r\n $this->date_dern_action = $donnees['date_dern_action'];\r\n $this->description = $donnees['description'];\r\n $this->age = $donnees['age'];\r\n $this->sexe = $donnees['sexe'];\r\n $this->alliance = $donnees['alliance'];\r\n $this->guilde = $donnees['guilde'];\r\n $this->avatar = $donnees['avatar'];\r\n $this->idVille = unserialize($donnees['idVille']);\r\n $this->idHero = unserialize($donnees['idHero']);\r\n $this->bois = $donnees['bois'];\r\n $this->ors = $donnees['ors'];\r\n $this->boisMax = $donnees['boisMax'];\r\n $this->orsMax = $donnees['orsMax'];\r\n $this->augOrsParMinute = $donnees['augOrsParMinute'];\r\n $this->augBoisParMinute = $donnees['augBoisParMinute'];\r\n $this->position = $donnees['position'];\r\n $this->partie = $donnees['partie'];\r\n $this->etatPartie = $donnees['etatPartie'];\r\n\r\n $this->tuto = unserialize($donnees['tuto']);\r\n\r\n $this->typePartie = $donneesPartie['type'];\r\n $this->vitesse = $donneesPartie['vitesse'];\r\n\r\n $GLOBALS['skin'] = $this->skin;\r\n $GLOBALS['ors'] = $this->ors;\r\n $GLOBALS['bois'] = $this->bois;\r\n $GLOBALS['idjoueur'] = $this->id;\r\n $GLOBALS['alliance'] = $this->alliance;\r\n $GLOBALS['typePartie'] = $this->typePartie;\r\n $GLOBALS['partie'] = $this->partie;\r\n $GLOBALS['vitesse'] = $this->vitesse;\r\n\r\n $_SESSION['typePartie'] = $this->typePartie;\r\n $_SESSION['partie'] = $this->partie;\r\n $_SESSION['alliance'] = $this->alliance;\r\n $_SESSION['etat'] = $this->etat;\r\n }", "function get_by_id($id = null)\n\t{\n\t\t$data['data'] = 0;\n\t\tif (!empty($id)) {\n\t\t\t$query = $this->cbt_modul_model->get_by_kolom('modul_id', $id);\n\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t$query = $query->row();\n\t\t\t\t$data['data'] = 1;\n\t\t\t\t$data['id'] = $query->modul_id;\n\t\t\t\t$data['modul'] = $query->modul_nama;\n\t\t\t\t$data['status'] = $query->modul_aktif;\n\t\t\t}\n\t\t}\n\t\techo json_encode($data);\n\t}", "public function getId($id=null)\n {\n if ($id != null && is_array($this->livres) && count($this->livres)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE id = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$id]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId($d['id']);\n$this->setTitre($d['titre']);\n$this->setDescription($d['description']);\n$this->setDate($d['date']);\n$this->setClivres_id($d['clivres_id']);\n$this->setAuteur($d['auteur']);\n$this->setPhoto($d['photo']);\n$this->setChemin($d['chemin']);\n$this->livres =$data; \n return $this;\n }\n \n } else {\n return $this->id;\n }\n \n }", "function tampil_data_id($tabel,$where,$id)\n {\n $row = $this->db->prepare(\"SELECT * FROM $tabel WHERE $where = :id,:teks,:label,:predict\");\n $row->execute(array($id));\n return $hasil = $row->fetch();\n }", "public function ver($id)\n {\n //\n }", "public function pertanyaanId($id){\r\n $sql = \"SELECT * FROM tbl_pertanyaan where id=$id\";\r\n $query = mysql_query($sql);\r\n \t\t $row = mysql_fetch_array($query);\r\n return $row;\r\n }", "public function ver($id) \n {\n $qry_terminos = $this->M_politicas->obtener_terminos($id);\n if($qry_terminos->num_rows() > 0)\n {\n $terminos = $qry_terminos->row();\n $this->data['acc'] = CONSULTAR;\n $this->data['politicas'] = $terminos; \n $this->_vista('comun');\n }\n else\n {\n echo false;\n }\n }", "public function dohvatiJeloId($id) {\n $this->db->select(\"idR,naziv,sadrzaj,obrok,kategorija,spec_prilika,slika\");\n $this->db->from(\"recepti\");\n $this->db->where(\"idR\", $id);\n $query = $this->db->get();\n return $query->result();\n }", "public function getUnCompteRendu($id){\n\t\t$req = \"select * from praticien P,rapport_visite R, visiteur V where R.RAP_NUM='$id' and P.PRA_NUM=R.PRA_NUM and r.vis_matricule = v.vis_matricule\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetch();\n\t\treturn $ligne;\n\t}", "function abm($id)\n { \n $db['registro'] = $this->model->getRegistros($id);\n $db['id'] = $id;\n $db['cantidad'] = $this->model->getCantidad();\n \n \n $this->armarVista('abm', $db);\n }", "public function edit($id)\n {\n echo \"Day la trang edit co id = \".$id;\n }", "public function lidSchrappen($id) {\n $this->load->model('persoon_model');\n $data['lid'] = $this->persoon_model->delete($id);\n $data['user'] = $this->authex->getUserInfo();\n\n redirect('/persoon/ledenOverzicht');\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function get( $id ){}", "public function obrisiSmestajeKorisnika($id){\n $smestajiKorisnika = $this->where('idVlasnik',$id)->findAll();\n foreach($smestajiKorisnika as $smestaj){\n $this->obrisiSmestaj($smestaj->id);\n }\n }", "function getId();", "public function edit($id)\n {\n $datasiswa = mysqli_query($this->koneksi,\"select * from ulangan where id='$id'\");\n return $datasiswa;\n }", "public function load_data($id=null){\r\n \t//$this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \t//$data=$this->Apimodel->getSub($id);//submiss,soal\r\n\t \t// $data['problem']=$this->Apimodel->getProblem();\r\n\t \t$ids = $this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \techo('<pre>');\r\n\t\tprint_r($ids);\r\n\t\techo('</pre>');\r\n\r\n\r\n\t}", "function getdatait( $id = 0 ){\n\t\tif($id == 0){\n\t\t\t$id = $this->datasis->dameval('SELECT MAX(id) AS id FROM spre');\n\t\t}\n\t\t$dbid = intval($id);\n\t\tif(empty($id)) return '';\n\t\t$numero = $this->datasis->dameval(\"SELECT numero FROM spre WHERE id=${dbid}\");\n\t\t$dbnumero = $this->db->escape($numero);\n\n\t\t$orderby= '';\n\t\t$sidx=$this->input->post('sidx');\n\t\tif($sidx){\n\t\t\t$campos = $this->db->list_fields('itspre');\n\t\t\tif(in_array($sidx,$campos)){\n\t\t\t\t$sidx = trim($sidx);\n\t\t\t\t$sord = $this->input->post('sord');\n\t\t\t\t$orderby=\"ORDER BY `${sidx}` \".(($sord=='asc')? 'ASC':'DESC');\n\t\t\t}\n\t\t}\n\n\t\t$grid = $this->jqdatagrid;\n\t\t$mSQL = \"SELECT a.*, b.existen, b.activo, if(MID(b.tipo,1,1)='S',1,b.existen-a.cana) saldo \";\n\t\t$mSQL .= \"FROM itspre a JOIN sinv b ON a.codigo=b.codigo WHERE numero=${dbnumero} ${orderby}\";\n\t\t$response = $grid->getDataSimple($mSQL);\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "public function editberita($id){\n\t\t$flag = array('id_berita'=>$id);\n\t\t$q = $this->Allcrud->getData('berita',$flag)->row();\n\t\techo json_encode($q);\n\t}", "function get(string $id);", "public function actionPrihodit($id = null) \n {\n \t// vyhod nepovoleny pristup, pokud uzivatel nema prava zajemce a pokud jemu pridelene id_nemovitosti se neshoduje s id nemovitosti\n if (!$this->user->isAllowed('drazba','prihodit') || ($id != $this->user->identity->id_nemovitost))\n throw new Nette\\Application\\ForbiddenRequestException(); \n }", "function getID();", "public function beheerderWijzigen($id) {\n if (!$this->authex->loggedIn()) {\n redirect('home/login');\n }\n\n $data['title'] = 'Hondenschool Bollie';\n $data['nobox'] = true; // geen extra rand rond hoofdmenu\n $data['user'] = $this->authex->getUserInfo();\n $data['auteur'] = 'Jarne Peeters, Bart Buyens';\n\n $this->load->model('persoon_model');\n $data['beheerder'] = $this->persoon_model->get($id);\n\n $partials = array('header' => 'main_header', 'content' => 'beheerderAanpassen', 'menu' => 'main_menu');\n $this->template->load('main_master', $partials, $data);\n }", "public function let_permission($id){\n\t\t/*\n\t\t * Genero un arrai contentente gli id dei moduli dei permessi di questa classe\n\t\t */\n\t\t$id_modul=\"\";\n\t\t$q = new Query();\n\t\t$q->fields = array(\"id,modul\");\n\t\t$q->tables = array(\"tbl_moduls\");\n\t\t$q->filters = \"( modul like '\" . $this->classname . \"%' )\";\n\t\t$q->sortfields = array(\"id\");\n\t\tif ($q->Open()){\n\t\t\twhile($row = $q->GetNextRecord()){\n\t\t\t\t$id_modul[$row[0]]=$row[1];\n\t\t\t}\n\t\t}\n\t\t$q->Close();\n\n\t\t/*\n\t\t * Genera un array con i permessi relativi alla classe specificata ciclando sugli id\n\t\t */\n\n\t\tforeach($id_modul as $key => $value){\n\t\t\t$permission[$value] = $this->oUt->fArrayPermission($this->let_id_sito(),$value,$id,$this->oUt->id, 'pgdb', 'id_sito', 'id', 'IDUt');\n\t\t}\n\t\t$this->aPermission=$permission;\n\t\treturn $permission;\n\t}", "function get_entrada_lote_id($id,$auth){\n\t\tif($auth==0){\n\t\t\t$validacion=\"and prf.usuario_validador_id=0 \";\n\t\t} else {\n\t\t\t$validacion=\" and prf.usuario_validador_id>0 \";\n\t\t}\n\t\t\t\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, ( prf.monto_total - prf.descuento ) as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and lf.lote_id='$id' $validacion\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, prf.descuento, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc \";\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function get($id)\n {\n\n $request = Requete::with([\n 'soumis_par.senior',\n 'matiere',\n 'plageHoraire.plage_unique',\n 'plageHoraire.plage_horaire_repetitive'\n ])\n ->find($id)\n ->makeHidden(['plageHoraire_id', 'matiere_id']);\n\n if ($request && !($request->plageHoraire->plage_horaire_repetitive))\n {\n $request->plageHoraire->makeHidden('plage_horaire_repetitive');\n }\n else if($request && !($request->plageHoraire->plage_unique))\n {\n $request->plageHoraire->makeHidden('plage_unique');\n }\n return $request;\n }", "function get_by_id($id)\n {\n\t\t\t\n\t\t$id_patner = $this->session->userdata('DX_id_patner');\n\t\tif($id_patner > 0){\n\t\t\t$this->db->where('id_patner', $id_patner);\n\t\t}\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "static function modificadescrizione($id){\n if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');\n else{\n session_start();\n if($_SERVER['REQUEST_METHOD'] == \"GET\")header('Location: /Progetto/Utente/homepagedef');\n else{\n\n if(FPersistentManager::exist('id',$id,'FWatchlist')) {\n $w=FPersistentManager::load('id',$id,'FWatchlist');\n\n FPersistentManager::update(\"descrizione\", $_POST['descrizione'], \"id\", $id, \"FWatchlist\");\n\n\n }\n // else $_SESSION['pwedit']=false;\n\n header('Location: /Progetto'.$_SESSION['location']);\n }\n }\n }", "function vedi($id) {\n if (null == $id || !is_numeric($id)) {\n $this->set_view('errore');\n $this->view->set_message('id non valido');\n $this->view->set_user($this->user);\n $this->view->render();\n die();\n }\n\n $stato = new stato($this->db, $id);\n $this->set_view('stati', 'vedi');\n $this->view->set_db($this->db);\n $this->view->set_user($this->user);\n $this->view->set_model($stato);\n $this->view->render();\n die();\n }", "function getdatait( $id = 0 ){\n\t\tif($id === 0){\n\t\t\t$id = intval($this->datasis->dameval(\"SELECT MAX(id) FROM rcobro\"));\n\t\t}\n\t\tif(empty($id)) return '';\n\t\t$grid = $this->jqdatagrid;\n\t\t$mSQL = \"SELECT * FROM smov WHERE rcobro=${id}\";\n\t\t$response = $grid->getDataSimple($mSQL);\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "function generate_id($tabel, $kolom) {\n $val = 'ABCDEF0123456789'; //value yang akan di random antara string tersebut\n global $conn; //memanggil koneksi di global\n $sudah_ada = true; //mengasumsikan id tersebut sudah ada di dalam tabel\n while ($sudah_ada) { //selama id tersebut ada (antisipasi jika id yang random tersebut memang sudah ada di tabel, tetapi kemungkinannya kecil sekali)\n $re = ''; //variabel string kosong untuk menampung\n for ($x=0; $x<23; $x++) { //melakukan perulangan sebanyak 23 kali \n if (($x+1)%6==0) $re .= '-'; //jika kelipatan 6 maka dipastikan pada saat itu adalah pemisah\n else $re .= $val[random_int(0, strlen($val)-1)]; //jika tidak maka akan merandom pilihan val di atas (dengan cara merandom index tersebut dengan angka 0-panjang val di atas)\n }\n $q = $conn->prepare(\"SELECT * FROM $tabel where $kolom='$re'\"); //melakukan select di tabel dengan kolom yang bersangkutan\n $q->execute();\n @$sudah_ada = $q->fetchAll(); //memperbarui asumsi sudah ada tersebut dengan hasil select tadi, jika bernilai false, maka dipastikan di tabel tersebut memang tidak ada data random itu\n //jika sudah ada, makan bernilai true yang mengakibatkan looping berulang lagi, dan mengacak lagi\n }\n return $re; //mereturn hasil\n}", "public function edit($id){\n\t\t$d=$this->db->get_where('siswa',array('ID'=>$id))->row();\n\t\treturn $d;\n\t}", "public function datumDeleteFromId($id){\n $sql = \"select persnr,datum from dzeitsoll where id='$id'\";\n $res = $this->db->query($sql);\n $rows = $res->fetchAll();\n $row = $rows[0];\n $datum = $row['datum'];\n $persnr = $row['persnr'];\n // zjistim kolik takovych datumu pro daneho cloveka jeste mam\n $sql = \"select count(datum) as pocetdatumu from dzeitsoll where persnr='$persnr' and datum='$datum'\";\n $res = $this->db->query($sql);\n $pocetDatumu = $res->fetchSingle();\n if($pocetDatumu>1){\n // muzu dane id smazat\n $this->db->query(\"delete from dzeitsoll where id='$id' limit 1\");\n }\n else{\n // nebudu mazat ale nastavim stunden = 0, oe = -\n $sql = \"update dzeitsoll set stunden=0,oe='-' where id='$id'\";\n $this->db->query($sql);\n }\n }", "function TenNguoiDangBai_TheoId($id_nguoidung)\n{\n\t$qr=\"\n\t\t\tSELECT ten_nguoidung FROM nguoidung\n\t\t\tWHERE id_nguoidung=$id_nguoidung\n\t\";\n\treturn mysql_query($qr);\n}", "public function get_id()\t{return $this->id;}", "public function load($id){\n\t\t$sql = 'SELECT * FROM cbt_nomor_peserta WHERE id_nomor = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "function getByHeenRit($id) {\n $this->db->where('ritIdHeenrit', $id);\n $query = $this->db->get('rit');\n $rit = $query->row();\n return $rit;\n }", "public function MesasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM mesas INNER JOIN salas ON salas.codsala = mesas.codsala where mesas.codmesa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($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}", "public function edit($id_peminjaman)\n {\n //\n\n\n }", "public function __construct($id=null){\n if($id){\n $c = kuharica_baza::connect();\n $sql = \"SELECT * FROM vrsta_jela WHERE id = $id LIMIT 1\";\n $r = $c->query($sql);\n $row = $r->fetch_assoc();\n $this->id = $row['id'];\n $this->naziv = $row['naziv'];\n }\n }", "public function getById3($id = null)\n {\n $this->db->from('tabel_lapak');\n $this->db->join('tabel_peminjaman', 'tabel_peminjaman.kd_lapak = tabel_lapak.kd_lapak');\n //$this->db->join('tabel_pengguna', 'tabel_pengguna.kd_pengguna2=tabel_peminjaman.kd_pengguna');\n $this->db->where('tabel_lapak.kd_lapak', $id);\n $query = $this->db->get();\n return $query->result();\n }", "public function renderPrihodit($id = null)\n {\n $this->template->nemovitost = $this->database->findById('nemovitost', $id);\n if (!$this->template->nemovitost) \n {\n $this->flashMessage('Tato nemovitost neexistuje. Je možné, že ji někdo smazal.');\n $this->redirect('Homepage:default'); \n } else {\n $prihozy = $this->database->findAll('drazba')->where('id_nemovitost', $id);\n $this->template->drazba = $this->drazba->vyhodnotDrazbu($id, $prihozy);\n $this->template->status = $this->drazba->vratStatus();\n $this->template->pocet_prihozu = $prihozy->count('*'); \n \tif($this->template->pocet_prihozu > 0) // v template osetruji prvni prihoz\n \t\t{ \n \t\t\t$form = $this['prihozForm'];\n \t\t\t$form['send']->caption = 'Podat nabídku';\n \t\t$form['pocet']->value = $this->template->pocet_prihozu; // do formulare, protoze pri odesilani kontroluji zda nekdo mezitim neprihodil\n \t} else { // prvni nulovy, pouze potvrdi zadanou castku\n \t\t$form = $this['prvniPrihozForm'];\n \t\t\t$form['send']->caption = 'Podat nabídku';\n \t\t\t$form['pocet']->value = $this->template->pocet_prihozu; // do formulare, protoze pri odesilani kontroluji zda nekdo mezitim neprihodil\t\n \t}\n if ($this->template->status == 1) \n {\n $this->flashMessage('K této nemovitosti nelze přihodit, dražba ještě nezačala.');\n $this->redirect('Nemovitosti:detailNemovitosti', $id); \n } elseif ($this->template->status == 2) {\n $this->flashMessage('K této nemovitosti nelze přihodit, dražba již skončila.');\n $this->redirect('Nemovitosti:detailNemovitosti', $id); \n }\n }\n\n }", "function ambil_syarat_usulan_by_id_proyek($id)\n\t{\n\t\t$sql = \"SELECT * FROM irena_view_sbsn_usulan_syarat WHERE id_proyek = '$id'\t\";\n\t\treturn $this->db->query($sql);\n\t}", "public function id_test($id) {\r\n\r\n $error_msg = \"\";\r\n $errors = 0;\r\n\r\n if(isset($id)) {\r\n $identifiant = trim($id);\r\n $identifiant = htmlentities($identifiant, ENT_NOQUOTES, 'utf-8');\r\n $identifiant = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\\1', $identifiant);\r\n $identifiant = preg_replace('#&([A-za-z]{2})(?:lig);#', '\\1', $identifiant); // pour les ligatures e.g. '&oelig;'\r\n $identifiant = preg_replace('#&[^;]+;#', '', $identifiant);\r\n $identifiant = str_replace(';', '', $identifiant);\r\n $identifiant = str_replace(' ', '', $identifiant);\r\n $identifiant = str_replace('php', '', $identifiant);\r\n\r\n if($identifiant == '') {\r\n $error_msg .= \"Vous devez spécifier un identifiant. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) < 3) {\r\n $error_msg .= \"Votre identifiant est trop court. <br/>\";\r\n $errors++;\r\n } else if(strlen($identifiant) > 24) {\r\n $error_msg .= \"Votre identifiant est trop long. <br/>\";\r\n $errors++;\r\n } else {\r\n\r\n if(Model::getModel(\"Session\\\\User\")->exists($identifiant)) {\r\n $error_msg .= \"Cet identifiant est déjà utilisé. <br/>\";\r\n $errors++;\r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n return array(\r\n \"value\" => $identifiant,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n\r\n }", "function listarUnActoPorId($id) {\r\n $query = \"SELECT * FROM programas WHERE id_Programa LIKE \".$id.\";\";\r\n $database = new Database();\r\n $resultado = $database->getConn()->query($query);\r\n \r\n $arr = array();\r\n \r\n while ($row = $resultado->fetch(PDO::FETCH_ASSOC)) {\r\n $programa = new Programa();\r\n $programa->id=$row[\"id_Programa\"];\r\n $programa->titulo=$row[\"titulo\"];\r\n $programa->fecha=$row[\"fecha\"];\r\n $programa->enUso=$row[\"enUso\"];\r\n $programa->categoria=$row[\"id_Categoria\"];\r\n array_push($arr, $programa);\r\n }\r\n $paraDevolver = json_encode($arr);\r\n return $paraDevolver;\r\n \r\n }", "public function get_id(){ return $this->_id;}", "public function get_id(){ return $this->_id;}", "public function get_id(){ return $this->_id;}", "public function edit($id){\n\t\t//\n\t}", "public function edit($id){\n\t\t//\n\t}", "function getAbogadoID($id){\n $query = \"SELECT\n nombre,\n apellidoP,\n apellidoM,\n email,\n fechaNac, \n valuePermission,\n cuentaBanco,\n costoBase,\n descripcion,\n cedulaPro\n FROM\n usuario\n LEFT JOIN(rol) ON usuario.rol_id = rol.id_rol \n LEFT JOIN(abogado) ON usuario.id_usuario = abogado.usuario_id\n WHERE\n usuario.id_usuario = \".$this->db->escape($id).\" AND\n rol.valuePermission = 1\n \";\n return $this->db->query($query);\n }", "public function edit($id)\n {\n try {\n $iddetalle = decrypt($id);\n $etalle = DetalleServicioModel::with('servicio')\n ->where('iddetalle_servicio',$iddetalle)\n ->first();\n\n return response()->json([\n 'error'=>false,\n 'resultado'=>$etalle\n ], 200);\n\n } catch (\\Throwable $th) {\n Log::error(\"Error get Request Id \".$th->getMessage());\n return response()->json([\n 'error'=>true,\n 'message'=>$th->getMessage()\n ], 500);\n }\n \n }", "function get ( $id )\n {\n $this->dbInit();\n if ( $id != \"\" )\n {\n $this->Database->array_query( $link_array, \"SELECT * FROM eZLink_Link WHERE ID='$id'\" );\n if ( count( $link_array ) > 1 )\n {\n die( \"Feil: flere linker med samme ID ble funnet i databasen, dette skal ikke være mulig.\" );\n }\n else if ( count( $link_array ) == 1 )\n {\n $this->ID =& $link_array[ 0 ][ \"ID\" ];\n $this->Title =& $link_array[ 0 ][ \"Title\" ];\n $this->Description =& $link_array[ 0 ][ \"Description\" ];\n $this->LinkGroupID =& $link_array[ 0 ][ \"LinkGroup\" ];\n $this->KeyWords =& $link_array[ 0 ][ \"KeyWords\" ];\n $this->Created =& $link_array[ 0 ][ \"Created\" ];\n $this->Modified =& $link_array[ 0 ][ \"Modified\" ];\n $this->Accepted =& $link_array[ 0 ][ \"Accepted\" ];\n $this->Url =& $link_array[ 0 ][ \"Url\" ];\n $this->ImageID =& $link_array[ 0 ][ \"ImageID\" ];\n }\n }\n }", "public function index($id){\n\t\t$po_prostu_pokaz = true;\n\t\t$user = $this->session->zalogowany;\n\t\tif($dane = $this->baza->czy_zlecenie_istnieje($id)){\n\t\t\t$dane[0]->nick = $this->baza->daj_nick($dane[0]->zlecajacy_id);\n\t\t\t$prace = $this->baza->prace();\n\t\t\t$aktualna_data = date('Y-m-d');\n\t\t\t$aktualna_godzina = date('H:i');\n\t\t\tif($this->baza->czy_zlecenie_aktualne($id,$aktualna_data,$aktualna_godzina)){\n\t\t\t\t//zlecenie aktualne\n\t\t\t\tif($user != null){\n\t\t\t\t\tif($dane[0]->zlecajacy_id != $user){\n\t\t\t\t\t\t//nie jesteś zlecającym\n\t\t\t\t\t\t$zwyciezca = $this->baza->dane_zwyciezcy($id);\n\t\t\t\t\t\tif(count($zwyciezca)==0){\n\t\t\t\t\t\t\t//jeszcze nie wybrano zwycięzcy\n\t\t\t\t\t\t\tif(!$this->baza->czy_juz_zgloszono($id,$user)){\n\t\t\t\t\t\t\t\t//nie zgłosiłeś się jeszcze\n\t\t\t\t\t\t\t\t$po_prostu_pokaz = false;\n\t\t\t\t\t\t\t\t$zgloszenie = $this->input->post('zlecenie_zgloszenie');\n\t\t\t\t\t\t\t\tif($zgloszenie != null){\n\t\t\t\t\t\t\t\t\t//wyświetl komunikat informujący o poprawnym zgłoszeniu się\n\t\t\t\t\t\t\t\t\t$this->baza->dodaj_zgloszenie($id,$user);\n\t\t\t\t\t\t\t\t\t$this->load->view(\"naglowek\",array('tytul'=>'ZLECENIE'));\n\t\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'zglos_sie'=>1));\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t//wyswietl widok z możliwością zgłoszenia się do niego\n\t\t\t\t\t\t\t\t\t//aktualne - true,jestes_zlecajacym=false,zgloszono_sie=false\n\t\t\t\t\t\t\t\t\t$this->load->view(\"naglowek\",array('tytul'=>'ZLECENIE'));\n\t\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'zglos_sie'=>0));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//wybrano zwycięzcę\n\t\t\t\t\t\t\tif($this->baza->czy_juz_zgloszono($id,$user)){\n\t\t\t\t\t\t\t\t//zgłoszono się\n\t\t\t\t\t\t\t\tif($this->baza->czy_wygrales_zlecenie($id,$user)){\n\t\t\t\t\t\t\t\t\t//jesteś zwycięzcą\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$status = $zwyciezca[0]->status;\n\t\t\t\t\t\t\t\t\tif($status == 0){\n\t\t\t\t\t\t\t\t\t\t//zostałeś wybrany przez zlecającego\n\t\t\t\t\t\t\t\t\t\t$po_prostu_pokaz = false;\n\t\t\t\t\t\t\t\t\t\t$this->load->view(\"naglowek\",array('tytul'=>'ZLECENIE'));\n\t\t\t\t\t\t\t\t\t\t$podjecie = $this->input->post('zlecenie_podjecie');\n\t\t\t\t\t\t\t\t\t\tif($podjecie != null){\n\t\t\t\t\t\t\t\t\t\t\t//komunikat o pomyślnym podjęciu się pracy\n\t\t\t\t\t\t\t\t\t\t\t$this->baza->potwierdz_podjecie($id);\n\t\t\t\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'podjecie'=>1));\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t//strona z możliwością potwierdzenia podjecia się pracy\n\t\t\t\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'podjecie'=>0));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//zalogowany jest zlecajacym\n\t\t\t\t\t\t$jestes_zlecajacym = true;\n\t\t\t\t\t\t$dane_zwyciezcy = $this->baza->dane_zwyciezcy($id);\n\t\t\t\t\t\tif(count($dane_zwyciezcy)==0){\n\t\t\t\t\t\t\t//nie wybrano zwycięzcy\n\t\t\t\t\t\t\t$po_prostu_pokaz = false;\n\t\t\t\t\t\t\t$this->load->view(\"naglowek\",array('tytul'=>'ZLECENIE'));\n\t\t\t\t\t\t\t$wybrany = $this->input->post('zlecenie_zwyciezca');\n\t\t\t\t\t\t\tif($wybrany != null){\n\t\t\t\t\t\t\t\t$this->baza->wybierz_zwyciezce($id,$wybrany);\n\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'zgloszenia'=>1));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t//wyświetl listę zgłoszeń\n\t\t\t\t\t\t\t\t//daj możliwość wybrania jednego\n\t\t\t\t\t\t\t\t$zgloszenia = $this->baza->lista_zgloszen($id);\n\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'zgloszenia'=>$zgloszenia));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//zlecenie po czasie wykonania\n\t\t\t\t$user = $this->session->zalogowany;\n\t\t\t\tif($dane[0]->zlecajacy_id == $user){\n\t\t\t\t\t//jesteś zleceniodawcą\n\t\t\t\t\t$dane_zwyciezcy = $this->baza->dane_zwyciezcy($id);\n\t\t\t\t\tif(count($dane_zwyciezcy)>0){\n\t\t\t\t\t\t//ktoś wygrał\n\t\t\t\t\t\t$status = $dane_zwyciezcy[0]->status;\n\t\t\t\t\t\tif($status == 1){\n\t\t\t\t\t\t\t$po_prostu_pokaz = false;\n\t\t\t\t\t\t\t//daj możliwość potwierdzenia wykonania\n\t\t\t\t\t\t\t$this->load->view(\"naglowek\",array('tytul'=>'ZLECENIE'));\n\t\t\t\t\t\t\t$potwierdzono = $this->input->post('zlecenie_potwierdzenie');\n\t\t\t\t\t\t\tif($potwierdzono != null){\n\t\t\t\t\t\t\t\t$this->baza->potwierdz_wykonanie($id);\n\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'ocena'=>0));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'potwierdzenie'=>0));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if($status == 2){\n\t\t\t\t\t\t\t$po_prostu_pokaz = false;\n\t\t\t\t\t\t\t//daj możliwość ocenienia\n\t\t\t\t\t\t\t$this->load->view(\"naglowek\",array('tytul'=>'ZLECENIE'));\n\t\t\t\t\t\t\t$ocena = $this->input->post('zlecenie_ocena');\n\t\t\t\t\t\t\t$komentarz = $this->input->post('zlecenie_komentarz');\n\t\t\t\t\t\t\tif($ocena != null && $komentarz != null){\n\t\t\t\t\t\t\t\t$this->baza->ocen($id,$dane_zwyciezcy[0]->zglaszajacy_id,$ocena,$komentarz);\n\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'ocena'=>1));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace,'ocena'=>0));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($po_prostu_pokaz){\n\t\t\t\t$this->load->view(\"naglowek\",array('tytul'=>'ZLECENIE'));\n\t\t\t\t$this->load->view('zlecenie/zlecenie',array('dane'=>$dane,'prace'=>$prace));\n\t\t\t}\n\t\t}else{\n\t\t\t$this->load->view('blad',array('komunikat'=>'Nie ma takiego zlecenia!'));\n\t\t}\n\t}", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "function get_id() {\n \n $id_okay = true;\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n if(\"\" == ($id = isset($_GET[$this->name]) ? $_GET[$this->name] : \"\")) {\n $id = isset($_POST[$this->name]) ? $_POST[$this->name] : \"\";\n }\n \n ## check if the id consists of chars that make up a session\n if(ereg('[^a-z0-9]', $id)){\n\t\t$id_okay = false;\n\t}\n \n if( \"\" == $id || !$id_okay) {\n $newid=true;\n // I'll have to work on this class to figure out how this link works\n $id = md5(uniqid($this->magic));\n }\n \n if(isset($_SERVER['QUERY_STRING'])) {\n $_SERVER['QUERY_STRING'] = ereg_replace(\"(^|&)\".quotemeta(urlencode($this->name)).\"=(.)*(&|$)\",\"\\\\1\", $_SERVER['QUERY_STRING']);\n }\n \n $this->id = $id;\n }", "public static function Rechercher_Liens($id=\"rien\"){\n\t\t \t//connexion à la base de données\n\t\t \t$oMysqliLib = new MySqliLib();\n\t\t \t//requête de recherche du groupe\n\t\t \tif($id==\"rien\"){\n\t\t\t\t$sRequete = \"SELECT * FROM liens\";\n\t\t\t}else{\n\t\t\t\t$sRequete = \"SELECT * FROM liens WHERE idlien='\".$id.\"'\";\n\t\t\t}\n\t\t\t\t\n\t\t \t//exécuter la requête\n\t\t \t$oResult = $oMysqliLib->executer($sRequete); \n\t\t \t//récupérer le tableau des enregistrements\n\t\t \t$aLiens = $oMysqliLib->recupererTableau($oResult);\n\t\t\t\n\t\t\tif($id==null){\n\t\t\t\t$aLiens[0]['vchnomlien']=\"\";// si le ud est null sinon ca cause des erreurs\n\t\t\t\t$aLiens[0]['urllien']=\"\";\n\t\t\t}\n\t\t\t\n\t\t \t//retourner array contenant les etapes\n\t\t \treturn $aLiens;\t\n\t\t }", "public function id_tarjeta();", "public function setMenuById($id) {\n \n $query = $this->dbConnection->prepare('SELECT `id`, `name`, `nameen`, `address`, `isMenu`, `order` FROM `menu` WHERE `id` = :id');\n $query->bindValue(':id',$id, PDO::PARAM_INT); \n $query->execute();\n $rows = $query->rowCount();\n if ($rows <= 0) {\n throw new WrongIDException();\n }\n $result = $query->fetch();\n $this->id = $result['id'];\n $this->name = $result['name'];\n $this->nameen = $result['nameen'];\n $this->address = $result['address'];\n $this->isMenu = $result['isMenu'];\n $this->order = $result['order'];\n }", "public function loadId($id){\n\t\t$model=new Model();\n\t\t$resultado=$model->select(\"SELECT * FROM tb_usuarios WHERE idusuario = :ID\",array(\":ID\"=>$id));\n\t\tif (count($resultado)>0) {\n\t\t\t$this->setData($resultado[0]);\n\t\t}\n\t}", "public function getById4($id)\n {\n //$this->db->select('tabel_lapak.*, tabel_peminjaman.kd_pengguna as kd');\n $this->db->from('tabel_lapak');\n //$this->db->join('tabel_lapak', 'tabel_lapak.kd_lapak = tabel_peminjaman.kd_lapak');\n $this->db->join('tabel_pengguna', 'tabel_pengguna.kd_pengguna = tabel_lapak.kd_pengguna');\n $this->db->where('tabel_lapak.kd_lapak', $id);\n $query = $this->db->get();\n return $query->result();\n }", "public function edit($id)\n {\n $soal = Soal::find(base64_decode($id));\n $ujian = Ujian::where('id_ujian', $soal->id_ujian)->get()->first();\n $pilihan = explode(' , ', $soal->bankSoal['pilihan']);\n $jawaban = $soal->bankSoal['jawaban'];\n if($soal->bankSoal['tipe'] == 'MC'){\n $jawaban = explode(' , ', $jawaban);\n unset($jawaban[5]);\n }\n\n // return $pilihan['0'];\n return view('admin.kelola-soal.edit', compact('soal', 'pilihan', 'ujian', 'jawaban'));\n }", "public function editar($id)\n {\n //\n }", "public function editar($id)\n {\n //\n }", "public function dohvSmestaj($id){\n return ($this->where('id',$id)->find());\n }", "public function setId($id){ $this->id=$id;}", "abstract public function getId();", "public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }", "function edit_plazo($id = null)\n\t{\t\n\t\tif (!$id && empty($this->data))\n\t\t{\n\t\t\t$this->Session->setFlash('Permiso inválido','alerta',array('class'=>'alert-error'));\n\t\t\t$this->redirect(array('action' => 'index_sedes'));\n\t\t}\t\n\t\tif(!empty($this->data))\n\t\t{\n\t\t\techo var_dump($this->data);\n\t\t\t$etapa = mb_strtoupper($this->data['Plazo']['etapa']);\t\t\n\t\t\t$etapa = $etapa;\n\t\t\t$datos = array( 'id' => $id,\n\t\t\t\t\t\t\t'etapa'=> $etapa,\n\t\t\t\t\t\t 'etapa_id'\t=> $this->data['Plazo']['etapa_id'],\n\t\t\t\t\t\t 'plazo'\t=> $this->data['Plazo']['plazo']\t\t\t\t\t\t \n\t\t\t\t\t\t );\n\t\t\tif( $this->Plazo->save($datos))\n\t\t\t{\n\t\t\t\t$this->Session->setFlash(__('Plazo creado correctamente'),'mensaje-exito');\n\t\t\t\t$this->redirect(array('action' => 'index_plazos'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->Session->setFlash(__('Hubo un error al guardar el plazo'),'mensaje-error');\n\t\t\t\t$this->redirect(array('action' => 'index_plazos'));\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(empty($this->data)){\n\t\t\t$this->data = $this->Plazo->find('first', array('conditions' => array('Plazo.id' => $id)));\n\t\t}\n\t}", "function getArticulo( $id=NULL){\n $where_id = \"1\";\n if($id){\n $where_id = \"articulo.id = $id\"; \n }\n \n $sql = \"SELECT articulo.id, articulo.titulo, articulo.contenido, articulo.imagen_1, articulo.genero_id, articulo.subtitulo, articulo.fecha, autor.nombre autor, genero.nombre genero, articulo.autor_id \n from articulo\n inner join autor on autor_id=autor.id\n inner join genero on genero_id=genero.id WHERE articulo.activo=1 AND $where_id \n ORDER BY `articulo`.`id` DESC\";\n \n return ejecutarConsulta($sql);\n }", "public function edit($id)\t{\n\t\t//\n\t}", "public function ambilkampus2($id){\r\n $sql = \"SELECT * FROM tbl_kampus where id='$id'\";\r\n $query = mysql_query($sql);\r\n return $query;\r\n\t }", "public function getEdit($id)\n\t{\n\t\t//\n\t}", "function cargar_registro_venta_id($id) {\n return true;\n }", "public function edit($id)\n {\n $datapengasuh = mysqli_query(\n $this->koneksi,\n \"select * from pengasuh where id='$id'\"\n );\n return $datapengasuh;\n }", "abstract public function get_id();", "public function setId_recette($id) {\n\n\t\t$id = (int) $id;\n\n \tif ($id>0) {\n\n \t\t$this->_id_recette = $id;\n\n \t}\n\n\t}", "function select($id)\r\n{\r\n\r\n$sql = \"SELECT * FROM aattribut WHERE aatribut_pk_id = $id;\";\r\n$result = $this->database->query($sql);\r\n$result = $this->database->result;\r\n$row = mysql_fetch_object($result);\r\n\r\n\r\n$this->id_attribut = $row->id_attribut;\r\n\r\n$this->id_produit = $row->id_produit;\r\n\r\n$this->valeur = $row->valeur;\r\n\r\n}", "public function editRegularContentFromId() {}", "function modificar_biografia($id){\n\t$conn = db_conectar();\n\t$id = $conn->real_escape_string($id);\n\t$result = $conn->query(\"SELECT * FROM biografia WHERE id='$id'\");\n\t$conn->close();\n\tif ($result !== FALSE && $result->num_rows === 1){\n\t\t$row = $result->fetch_assoc();\n\t\t$_POST[\"id\"] = $row[\"id\"];\n\t\t$_POST[\"texto\"] = $row[\"texto\"];\n\t\t\n\t\techo \"<h1 id='modificar' class='h1login'>Modificar Parrafo</h1>\";\n\t\t//print_r($id);\n\t\tform_biografia(\"parrafo_mod2\", $id);\n\t} else\n\t\techo \"<p class='error'>ERROR</p>\";\n}", "private static function _id($id)\n {\n return ($id == Null)?Null:' id=\"'.$id.'\"';\n }" ]
[ "0.6838743", "0.66630006", "0.6554232", "0.65217537", "0.63153213", "0.63109624", "0.6306744", "0.6271408", "0.62578475", "0.62436444", "0.62272656", "0.6146567", "0.6133375", "0.611305", "0.60886914", "0.60808235", "0.6077351", "0.60739017", "0.6058133", "0.6054362", "0.6044765", "0.6026827", "0.6008429", "0.59988856", "0.59831804", "0.5969348", "0.59690374", "0.5962968", "0.5959684", "0.5959684", "0.5959684", "0.5949967", "0.5919902", "0.5915785", "0.591177", "0.5907287", "0.5898824", "0.5893443", "0.58872694", "0.5882901", "0.5872445", "0.58680445", "0.58668244", "0.58654386", "0.58650947", "0.58521456", "0.58461416", "0.58448625", "0.5842434", "0.5838639", "0.5831476", "0.5825474", "0.582427", "0.58230865", "0.5813462", "0.5807233", "0.58032924", "0.5802829", "0.58000326", "0.5792766", "0.57896316", "0.57891995", "0.578587", "0.5771854", "0.57716644", "0.57716644", "0.57716644", "0.576864", "0.576864", "0.5766949", "0.57652295", "0.5763793", "0.57633996", "0.57631993", "0.57631993", "0.5760457", "0.57592916", "0.5759102", "0.57588685", "0.5757141", "0.5755626", "0.5753839", "0.57484215", "0.57484215", "0.5746136", "0.5743828", "0.5739681", "0.57392937", "0.5737112", "0.57359546", "0.57335347", "0.5733211", "0.5728769", "0.57276857", "0.5724522", "0.5721746", "0.5714489", "0.57117546", "0.5710675", "0.57104576", "0.5709266" ]
0.0
-1
LeagueSeasonTeamsResults Je i v /cfg/eden_league.php Zobrazeni vysledku tymu v sezone
function LeagueSeasonTeamsResults(){ global $db_league_leagues,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_teams,$db_league_awards; global $db_country,$db_league_seasons_rounds; global $eden_cfg; global $url_flags,$url_league_awards; $result = ""; $result .= "<table style=\"width:400px;\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; $result .= " <tr>\n"; $result .= " <td class=\"eden_title\" style=\"width:40px;\">"._LEAGUE_SEASON_ROUND_POSITION."</td>\n"; $result .= " <td class=\"eden_title\" style=\"width:60px;text-align:center;\">"._LEAGUE_SEASON_ROUND_POINTS."</td>\n"; $result .= " <td class=\"eden_title\" style=\"width:50px;\">"._CMN_COUNTRY."</td>\n"; $result .= " <td class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; $result .= " </tr>\n"; $res_results_teams = mysql_query(" SELECT lt.league_team_id, lt.league_team_name, lsrt.league_season_result_team_team_sub_id, lsrt.league_season_result_team_points, c.country_shortname, c.country_name, ls.league_season_end FROM $db_league_seasons_results_teams AS lsrt JOIN $db_league_teams AS lt ON lt.league_team_id = lsrt.league_season_result_team_team_id JOIN $db_country AS c ON c.country_id = lt.league_team_country_id JOIN $db_league_seasons AS ls ON ls.league_season_id = ".(integer)$_GET['sid']." WHERE lsrt.league_season_result_team_season_id = ".(integer)$_GET['sid']." ORDER BY lsrt.league_season_result_team_points DESC LIMIT 10") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $i = 1; while ($ar_results_teams = mysql_fetch_array($res_results_teams)){ // Call function $ar_award = LeagueCheckAwards(2,(integer)$_GET['sid'],0,(integer)$ar_results_teams['league_season_result_team_team_sub_id']); if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} $result .= " <tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; $result .= " <td align=\"right\" valign=\"top\">"; if($ar_award['league_award_place']){$result .= "<img src=\"".$url_league_awards.$ar_award['league_award_img']."\" alt=\"".stripslashes($ar_award['league_award_name'])."\" title=\"".stripslashes($ar_award['league_award_name'])."\" />";} else { $result .= "<strong>".$i."</strong>";} $result .= "</td>\n"; $result .= " <td valign=\"top\" align=\"right\">".$ar_results_teams['league_season_result_team_points']."</td>\n"; $result .= " <td valign=\"top\" align=\"center\"><img src=\"".$url_flags.$ar_results_teams['country_shortname'].".gif\" alt=\"".stripslashes($ar_results_teams['country_name'])."\" title=\"".stripslashes($ar_results_teams['country_name'])."\" /></td>\n"; $result .= " <td valign=\"top\"><a href=\"".$eden_cfg['url']."index.php?action=league_team&mode=team_home&ltid=".$ar_results_teams['league_team_id']."&lang=".$_GET['lang']."&filter=".$_GET['filter']."\" target=\"_self\">".stripslashes($ar_results_teams['league_team_name'])."</a></td>\n"; $result .= " </tr>\n"; $i++; } // Show button for setting awards only if season is over if ($ar_results_teams['league_season_end'] < date("Y-m-d H:i:s")){ $result .= " <tr>\n"; $result .= " <td colspan=\"5\"><br /><form action=\"sys_save.php?action=league_awards_give_to_teams&sid=".$_GET['sid']."\" method=\"post\" name=\"form1\" enctype=\"multipart/form-data\">\n"; $result .= " <input type=\"hidden\" name=\"sid\" value=\"".$_GET['sid']."\">\n"; $result .= " <input type=\"hidden\" name=\"confirm\" value=\"true\">\n"; $result .= " <input type=\"hidden\" name=\"project\" value=\"".$_SESSION['project']."\">\n"; $result .= " <input type=\"submit\" value=\""._LEAGUE_AWARD_SUBMIT_TEAM."\" class=\"eden_button\">\n"; $result .= " </form>\n"; $result .= " </td>\n"; $result .= " </tr>\n"; } $result .= "</table>\n"; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LeagueSeasonPlayersResults(){\n\t\n\tglobal $db_admin,$db_admin_contact,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_players;\n\tglobal $db_country,$db_league_seasons_rounds,$db_league_players,$db_league_awards;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\t$result .= \"<table style=\\\"width:500px;\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\t$result .= \"\t<tr>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:40px;\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:60px;\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._CMN_COUNTRY.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\";\n\t$result .= \"\t</tr>\";\n \t$res_results_players = mysql_query(\"\n\tSELECT lsrp.league_season_result_player_player_id, a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, \n\tlsrp.league_season_result_player_points, c.country_shortname, c.country_name, agid.admin_guid_guid \n\tFROM $db_league_seasons_results_players AS lsrp \n\tJOIN $db_league_players AS lp ON lp.league_player_id = lsrp.league_season_result_player_player_id \n\tJOIN $db_admin AS a ON a.admin_id = lp.league_player_admin_id \n\tJOIN $db_admin_contact AS ac ON ac.aid = a.admin_id \n\tJOIN $db_admin_guids AS agid ON agid.aid = a.admin_id AND agid.admin_guid_game_id = lp.league_player_game_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id = lp.league_player_team_id \n\tJOIN $db_country AS c ON c.country_id = ac.admin_contact_country \n\tWHERE lsrp.league_season_result_player_season_id = \".(integer)$_GET['sid'].\" \n\tORDER BY lsrp.league_season_result_player_points DESC LIMIT 10\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$i = 1;\n\twhile ($ar_results_players = mysql_fetch_array($res_results_players)){\n\t\t// Call function\n\t\t$ar_award = LeagueCheckAwards(1,(integer)$_GET['sid'],(integer)$ar_results_players['league_season_result_player_player_id'],0);\n\t\t\n\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t$result .= \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t$result .= \"\t<td align=\\\"right\\\" valign=\\\"top\\\">\"; if($ar_award['league_award_place']){$result .= \"<img src=\\\"\".$url_league_awards.$ar_award['league_award_img'].\"\\\" alt=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" title=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" />\";} else {$result .= \"<strong>\".$i.\"</strong>\";} $result .= \"</td>\";\n\t\t$result .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\".$ar_results_players['league_season_result_player_points'].\"</td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\"><img src=\\\"\".$url_flags.$ar_results_players['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_results_players['country_name']).\"\\\" title=\\\"\".stripslashes($ar_results_players['country_name']).\"\\\" /></td>\";\n\t \t$result .= \"\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=player&amp;mode=player_acc&amp;id=\".$ar_results_players['admin_id'].\"&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_players['admin_nick']).\"</a></td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\">\".$ar_results_players['admin_guid_guid'].\"</td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=league_team&amp;mode=team_home&amp;ltid=\".$ar_results_players['league_team_id'].\"&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_players['league_team_name']).\"</a></td>\";\n\t\t$result .= \"</tr>\";\n\t\t$i++;\n\t}\n\t$result .= \"\t<tr>\\n\";\n\t$result .= \"\t\t<td colspan=\\\"5\\\"><br /><form action=\\\"sys_save.php?action=league_awards_give_to_players&sid=\".$_GET['sid'].\"\\\" method=\\\"post\\\" name=\\\"form1\\\" enctype=\\\"multipart/form-data\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$_GET['sid'].\"\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_AWARD_SUBMIT_PLAYER.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t$result .= \"\t\t</form>\\n\";\n\t$result .= \"\t\t</td>\\n\";\n\t$result .= \"\t</tr>\\n\";\n\t$result .= \"</table>\\n\";\n\t\n\treturn $result;\n}", "function SeasonResults($sid = 0,$mode = \"p\"){\n\t\n\tglobal $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players;\n\tglobal $db_admin,$db_league_seasons_rounds_results_players,$db_league_teams;\n\t\n\t$res_rounds = mysql_query(\"SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id \n\tFROM $db_league_seasons_rounds_results_players AS lsrrp \n\tJOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=\".(float)$rid.\" \n\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\tWHERE lsrrp.league_season_round_result_player_round_id=\".(float)$rid.\" \n\tORDER BY lsrrp.league_season_round_result_player_place ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\n\tswitch ($mode){\n\t\tcase \"p\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t\t$guid = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_GUID.\"</td>\\n\";\n\t\t\t$table_width = \"600\";\n\t\t\t\n\t\t\techo Menu();\n\t\t\t\n\t\tbreak;\n\t\tcase \"t\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\";\n\t\t\t$guid = \"\";\n\t\t\t$table_width = \"400\";\n\t\tbreak;\n\t\tdefault:\n\t\t\techo \"\";\n\t}\n\t$ar_round = mysql_fetch_array($res_round);\n\t$league_name = stripslashes($ar_round['league_league_name']);\n\t$season_id = $ar_round['league_season_round_season_id'];\n\t$season_name = stripslashes($ar_round['league_season_name']);\n\t$round_num = $ar_round['league_season_round_num'];\n\t\n\techo \"<table width=\\\"\".$table_wifth.\"\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\techo \"\t<tr>\\n\";\n\techo \"\t\t<td colspan=\\\"3\\\" align=\\\"left\\\">\";\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<h5 style=\\\"margin:20px 0px 0px 0px;\\\">\".$league_name.\" > <a href=\\\"modul_league.php?action=rounds&sid=\".$season_id.\"&project=\".$_SESSION['project'].\"\\\" target=\\\"_self\\\">\".$season_name.\"</a> > \"._LEAGUE_SEASON_ROUND.\" \".$round_num.\"</h5>\";}\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<form action=\\\"sys_save.php?action=results_add&rid=\".$rid.\"sid=\".$season_id.\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\">\";}\n\techo \"\t\t</td>\\n\";\n\techo \"\t</tr>\\n\";\n\techo \"\t<tr style=\\\"background-color:#dce3f1;\\\">\\n\";\n\techo \"\t\t<td width=\\\"50\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_POSITION.\"</td>\\n\";\n\techo \"\t\t<td align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_POINTS.\"</td>\\n\";\n\techo $nick;\n\techo $guid;\n\techo \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\techo \"\t</tr>\\n\";\n\tswitch ($mode){\n\t\tcase \"p\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tcase \"t\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t \t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['admin_nick'].\"</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\".$ar_rounds['league_season_round_allowed_player_guid'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tdefault;\n\t\t\techo \"\";\n\t}\n\techo \"</table>\\n\";\n}", "function crawl_games_per_season($param_season, $param_gameType, $param_team) {\n\t\n\t$base_link = 'http://www.nhl.com/ice/schedulebyseason.htm';\n\t\t\n\t$html_games = file_get_html(\"$base_link?season=$param_season&gameType=$param_gameType&team=$param_team\");\n\t\n\tif(!$html_games) {\n\t\techo 'GET HTML FALSE <br>';\n\t}\n\t\n\t$games_list = array();\n\t\n\t\n\tforeach($html_games->find('table[class=data schedTbl] tbody tr') as $match) {\n\t\t\n\t\t//Don't take into account where column is less than 6, filtering out header and blank rows.\n\t\tif(count($match->find('td')) == 6) {\n\t\t\t\n\t\t\t //Need to check if it's the FINAL result by checking if it starts with 'FINAL:'.\n\t\t\t //Additionally read out teams involved, determine winner/loser, and if there has been overtime.\n\t\t\t \n\t\t\t $item_result = $match->find('td.tvInfo', 0)->plaintext;\n\t\t\t $item_result_split = explode(' ', $item_result);\n\t\t\t \n\t\t\t \n\t\t\t if($item_result_split[1] == 'FINAL:') {\n\t\t\t \t\n\t\t\t\t$item['final'] = $item_result_split[1];\n\t\t\t\t$item['visiting_team'] = $item_result_split[3];\n\t\t\t\t$item['visiting_team_score'] = trim($item_result_split[4], '()');\n\t\t\t\t$item['home_team'] = $item_result_split[8];\n\t\t\t\t$item['home_team_score'] = trim($item_result_split[9], '()');\n\t\t\t\t$item['overtime'] = $item_result_split[10];\n\t\t\t\t \n\t\t\t\t$item_date = $match->find('td.date .skedStartDateSite', 0)->plaintext;\n\t\t\t\t$item['date'] = date(\"Y-m-d\", strtotime($item_date));\n\t\t\t\t \n\t\t\t\t//No need for retrieve teams directly, because we need to analyze result string above, and retrieve more information.\n\t\t\t\t//$item['visiting_team'] = $match->find('td.team', 0)->plaintext;\n\t\t\t\t//$item['home_team'] = $match->find('td.team', 1)->plaintext;\n\t\t\t\t \n\t\t\t\t//Read out the link to the \"Recap\" article.\n\t\t\t\t$item['recap'] = $match->find('td.skedLinks a', 0)->href;\n\t\t\t\t \n\t\t\t\t$games_list[] = $item;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t}\n\t\n\treturn $games_list;\n\n}", "function getTeams(){\n return array(\n //Gonzaga ~96%\n array('name'=>'Gonzaga','elo'=>1870,'off'=>126.8,'def'=>88.8,'tempo'=>74.8),\n array(),\n //Missouri 53%\n array('name'=>'Oklahoma','elo'=>1534,'off'=>112.1,'def'=>94.1,'tempo'=>67.7),\n array('name'=>'Missouri','elo'=>1548,'off'=>110.9,'def'=>94.9,'tempo'=>68.7),\n //Creighton 70%\n array('name'=>'Creighton','elo'=>1650,'off'=>115.6,'def'=>92.8,'tempo'=>69.1),\n array('name'=>'UCSB','elo'=>1496,'off'=>109.9,'def'=>96.3,'tempo'=>66.1),\n //Virginia 73%\n array('name'=>'Virginia','elo'=>1682,'off'=>116.3,'def'=>92.3,'tempo'=>60.1),\n array('name'=>'Ohio','elo'=>1507,'off'=>113.7,'def'=>101.2,'tempo'=>69.3),\n // USC 55%\n array('name'=>'USC','elo'=>1628,'off'=>113.6,'def'=>89.9,'tempo'=>67,3),\n array(),\n //Kansas 79%\n array('name'=>'Kansas','elo'=>1701,'off'=>110.3,'def'=>87.9,'tempo'=>68.3),\n array('name'=>'E Washington','elo'=>1469,'off'=>108.4,'def'=>100.3,'tempo'=>72.4),\n //Oregon 65%\n array('name'=>'Oregon','elo'=>1669,'off'=>115.1,'def'=>96.0,'tempo'=>67.2),\n array('name'=>'VCU','elo'=>1558,'off'=>106.2,'def'=>88.8,'tempo'=>69.8),\n //Iowa 86%\n array('name'=>'Iowa','elo'=>1710,'off'=>124.2,'def'=>93.9,'tempo'=>70.0),\n array('name'=>'Grand Canyon','elo'=>1383,'off'=>104.2,'def'=>95.8,'tempo'=>65.5),\n //Michigan 87%\n array('name'=>'Michigan','elo'=>1727,'off'=>120.1,'def'=>87.9,'tempo'=>66.8),\n array(),\n //LSU 55%\n array('name'=>'LSU','elo'=>1633,'off'=>120.5,'def'=>99.4,'tempo'=>70.8),\n array('name'=>'St Bonaventure','elo'=>1597,'off'=>112.0,'def'=>89.8,'tempo'=>65.2),\n //Colorado 56%\n array('name'=>'Colorado','elo'=>1639,'off'=>115.1,'def'=>92.0,'tempo'=>66.4),\n array('name'=>'Georgetown','elo'=>1593,'off'=>108.4,'def'=>92.9,'tempo'=>69.6),\n //Florida State 65%\n array('name'=>'Florida State','elo'=>1632,'off'=>117.1,'def'=>93.6,'tempo'=>70.6),\n array('name'=>'UNCG','elo'=>1519,'off'=>104.8,'def'=>95.2,'tempo'=>68.5),\n //BYU 62%\n array('name'=>'BYU','elo'=>1632,'off'=>113.8,'def'=>91.4,'tempo'=>68.0),\n array(),\n //Texas 78%\n array('name'=>'Texas','elo'=>1705,'off'=>114.5,'def'=>92.5,'tempo'=>69.2),\n array('name'=>'Abilene Christian','elo'=>1481,'off'=>103.7,'def'=>92.2,'tempo'=>70.0),\n //UCONN 59%\n array('name'=>'UCONN','elo'=>1610,'off'=>114.3,'def'=>90.9,'tempo'=>66.0),\n array('name'=>'Maryland','elo'=>1546,'off'=>111.6,'def'=>91.5,'tempo'=>65.3),\n //Alabama 90%\n array('name'=>'Alabama','elo'=>1753,'off'=>112.4,'def'=>86.0,'tempo'=>73.9),\n array('name'=>'Iona','elo'=>1371,'off'=>101.1,'def'=>100.7,'tempo'=>68.3),\n //Baylor 92%\n array('name'=>'Baylor','elo'=>1806,'off'=>124.0,'def'=>93.0,'tempo'=>68.4),\n array('name'=>'Hartford','elo'=>1359,'off'=>98.2,'def'=>99.5,'tempo'=>66.7),\n //UNC 60%\n array('name'=>'North Carolina','elo'=>1624,'off'=>110.8,'def'=>89.3,'tempo'=>71.8),\n array('name'=>'Wisconsin','elo'=>1553,'off'=>113.2,'def'=>89.1,'tempo'=>64.9),\n //Villanova 60%\n array('name'=>'Villanova','elo'=>1634,'off'=>119.3,'def'=>95.3,'tempo'=>65.1),\n array('name'=>'Winthrop','elo'=>1558,'off'=>105.8,'def'=>95.4,'tempo'=>73.6),\n //Purdue 68%\n array('name'=>'Purdue','elo'=>1622,'off'=>114.3,'def'=>90.6,'tempo'=>66.5),\n array('name'=>'North Texas','elo'=>1484,'off'=>106.1,'def'=>92.9,'tempo'=>63.1),\n //Texas Tech 52%\n array('name'=>'Texas Tech','elo'=>1595,'off'=>113.1,'def'=>90.7,'tempo'=>65.4),\n array('name'=>'Utah State','elo'=>1576,'off'=>106.4,'def'=>88.5,'tempo'=>68.9),\n //Arkansas 66%\n array('name'=>'Arkansas','elo'=>1679,'off'=>112.2,'def'=>89.2,'tempo'=>73.1),\n array('name'=>'Colgate','elo'=>1559,'off'=>111.6,'def'=>99.9,'tempo'=>72.5),\n //Florida 52%\n array('name'=>'Florida','elo'=>1550,'off'=>111.7,'def'=>92.7,'tempo'=>68.7),\n array('name'=>'Virginia Tech','elo'=>1530,'off'=>110.7,'def'=>94.1,'tempo'=>66.2),\n //Ohio St 85%\n array('name'=>'Ohio State','elo'=>1681,'off'=>123.0,'def'=>96.1,'tempo'=>67.1),\n array('name'=>'Oral Roberts','elo'=>1373,'off'=>109.4,'def'=>106.7,'tempo'=>71.8),\n //Illinois 92%\n array('name'=>'Illinois','elo'=>1807,'off'=>119.7,'def'=>87.6,'tempo'=>70.7),\n array('name'=>'Drexel','elo'=>1362,'off'=>107.8,'def'=>104.8,'tempo'=>64.2),\n //Georgia Tech 51%\n array('name'=>'Loyola Chicago','elo'=>1655,'off'=>111.1,'def'=>85.9,'tempo'=>64.2),\n array('name'=>'Georgia Tech','elo'=>1659,'off'=>114.0,'def'=>94.1,'tempo'=>67.8),\n //Tennessee 51%\n array('name'=>'Tennessee','elo'=>1602,'off'=>109.5,'def'=>87.0,'tempo'=>67.3),\n array('name'=>'Oregon State','elo'=>1591,'off'=>110.0,'def'=>98.4,'tempo'=>65.4),\n //Oklahoma St 74%\n array('name'=>'Oklahoma State','elo'=>1700,'off'=>110.8,'def'=>90.6,'tempo'=>72.0),\n array('name'=>'Liberty','elo'=>1517,'off'=>110.8,'def'=>101.0,'tempo'=>63.1),\n //SD State 66%\n array('name'=>'San Diego State','elo'=>1697,'off'=>111.5,'def'=>88.8,'tempo'=>66.1),\n array('name'=>'Syracuse','elo'=>1574,'off'=>114.5,'def'=>96.9,'tempo'=>69.2),\n //West Virginia 69%\n array('name'=>'West Virginia','elo'=>1633,'off'=>116.8,'def'=>95.1,'tempo'=>69.6),\n array('name'=>'Morehead State','elo'=>1492,'off'=>100.9,'def'=>95.5,'tempo'=>65.6),\n //Clemson 52%\n array('name'=>'Clemson','elo'=>1571,'off'=>107.6,'def'=>90.0,'tempo'=>64.2),\n array('name'=>'Rutgers','elo'=>1556,'off'=>109.3,'def'=>89.8,'tempo'=>67.8),\n //Houston 88%\n array('name'=>'Houston','elo'=>1742,'off'=>119.6,'def'=>89.4,'tempo'=>64.9),\n array('name'=>'Cleveland State','elo'=>1395,'off'=>101.5,'def'=>98.7,'tempo'=>66.3),\n );\n}", "function AddResults($rid){\n\t\n\tglobal $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players;\n\tglobal $db_admin,$db_admin_contact,$db_country,$db_league_seasons_rounds_results_players,$db_league_teams;\n\tglobal $url_flags;\n\t\n \t// CHECK PRIVILEGIES\n\tif ($_GET['action'] == \"results_add\" || $_GET['action'] == \"results_show\"){\n\t\tif (CheckPriv(\"groups_league_season_add\") <> 1) { echo _NOTENOUGHPRIV;exit;}\n\t} else {\n\t\techo _NOTENOUGHPRIV;exit;\n\t}\n\t\n\t$res_rounds = mysql_query(\"SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id, c.country_shortname,c.country_name \n\tFROM $db_league_seasons_rounds_results_players AS lsrrp \n\tJOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=\".(float)$rid.\" \n\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\tLEFT JOIN $db_admin_contact AS ac ON ac.aid=a.admin_id \n\tLEFT JOIN $db_country AS c ON c.country_id=ac.admin_contact_country \n\tWHERE lsrrp.league_season_round_result_player_round_id=\".(float)$rid.\" \n\tORDER BY lsrrp.league_season_round_result_player_place ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\";\n\t\t\t$team = \"\";\n\t\t\t$table_width = \"857\";\n\t\t\t\n\t\t\techo Menu();\n\t\t\t\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$flag = \"\t\t<td width=\\\"20\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._CMN_COUNTRY.\"</td>\\n\";\n\t\t\t$nick = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t\t$team = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\t$table_width = \"600\";\n\t\tbreak;\n\t\tdefault:\n\t\t\techo \"\";\n\t}\n\t$ar_round = mysql_fetch_array($res_round);\n\t$league_name = stripslashes($ar_round['league_league_name']);\n\t$season_id = $ar_round['league_season_round_season_id'];\n\t$season_name = stripslashes($ar_round['league_season_name']);\n\t$round_num = $ar_round['league_season_round_num'];\n\t\n\techo \"<table width=\\\"\".$table_width.\"\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\techo \"\t<tr>\\n\";\n\techo \"\t\t<td colspan=\\\"3\\\" align=\\\"left\\\">\";\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<h5 style=\\\"margin:20px 0px 0px 0px;\\\">\".$league_name.\" > <a href=\\\"modul_league.php?action=rounds&sid=\".$season_id.\"&project=\".$_SESSION['project'].\"\\\" target=\\\"_self\\\">\".$season_name.\"</a> > \"._LEAGUE_SEASON_ROUND.\" \".$round_num.\"</h5>\";}\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<form action=\\\"sys_save.php?action=results_add&rid=\".$rid.\"sid=\".$season_id.\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\">\";}\n\techo \"\t\t</td>\\n\";\n\techo \"\t</tr>\\n\";\n\techo \"\t<tr style=\\\"background-color:#dce3f1;\\\">\\n\";\n\techo \"\t\t<td width=\\\"50\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\\n\";\n\techo \"\t\t<td align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\\n\";\n\techo $flag;\n\techo $nick;\n\techo \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_GUID.\"</td>\\n\";\n\techo $team;\n\techo \"\t</tr>\\n\";\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_round['league_season_round_classified'] >= $i){\n\t\t\t\t$ar_rounds = mysql_fetch_array($res_rounds);\n\t\t\t\tif ($ar_rounds['league_season_round_result_player_player_id']){ $guid = $ar_rounds['league_season_round_allowed_player_guid'].\" (PID \".$ar_rounds['league_season_round_result_player_player_id'].\")\";} else {$guid =\"\";}\n\t\t\t\techo \"<tr align=\\\"left\\\" valign=\\\"top\\\" onmouseover=\\\"this.style.backgroundColor='FFDEDF'\\\" onmouseout=\\\"this.style.backgroundColor='FFFFFF'\\\" style=\\\"background-color: #FFFFFF;\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_num\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_data[\".$i.\"_place]\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t\".$i.\"\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input name=\\\"round_player_data[\".$i.\"_points]\\\" size=\\\"5\\\" value=\\\"\".$ar_rounds['league_season_round_result_player_points'].\"\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"text\\\" name=\\\"round_player_data[\".$i.\"_player_guid]\\\" size=\\\"25\\\" value=\\\"\".$guid.\"\\\" autocomplete=\\\"off\\\" onkeyup=\\\"ajax_showOptions(this,'getAllowedPlayerGuidByLetters=1&rid=\".$rid.\"&project=\".$_SESSION['project'].\"',event)\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\techo \"\t<tr align=\\\"left\\\" valign=\\\"top\\\">\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" colspan=\\\"3\\\"><br />\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"round\\\" value=\\\"\".$round_num.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"rid\\\" value=\\\"\".$rid.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$season_id.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_SEASON_ROUND_RESULTS_SAVE.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t\t \tif ($ar_rounds){echo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"results_mode\\\" value=\\\"edit\\\">\\n\";}\n\t\t\techo \"\t\t\t</form>\\n\";\n\t\t\techo \"\t\t</td>\\n\";\n\t\t\techo \"\t</tr>\\n\";\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\techo \"\t<tr \"; if ($i % 2 == 0){echo \"class=\\\"suda\\\"\";} else {echo \"class=\\\"licha\\\"\";} echo \">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t \t\t\techo \"\t<td valign=\\\"top\\\"><img src=\\\"\".$url_flags.$ar_rounds['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" title=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" /></td>\";\n\t \t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['admin_nick'].\"</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\".$ar_rounds['league_season_round_allowed_player_guid'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tdefault;\n\t\t\techo \"\";\n\t}\n\techo \"</table>\\n\";\n}", "public function analyseLeague(){\n\t\t$content \t= curl_file(\"https://euw.api.pvp.net/api/lol/euw/v2.5/league/by-summoner/\".trim($this->id).\"?api_key=\".RIOT_KEY);\n\t\t$json \t= json_decode($content[\"result\"], true);\n\t\techo $this->id.\"<br/>\";\n\t\tif(isset($json[$this->id][0][\"entries\"])){\n\t\t\tforeach($json[$this->id][0][\"entries\"] as $player){\n\t\t\t\t$status = $this->handleSummoner($player[\"playerOrTeamId\"]);\n\t\t\t\tif($status == true){\n\t\t\t\t\t$this->status = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($this->status){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function getTeams();", "function getPlayinTeams(){\n return array(\n //winner to [25]\n array('name'=>'UCLA','elo'=>1542,'off'=>114.1,'def'=>96.8,'tempo'=>64.7),\n array('name'=>'Michigan State','elo'=>1596,'off'=>107.7,'def'=>92.2,'tempo'=>68.6),\n //winner to [17]\n array('name'=>'Texas Southern','elo'=>1395,'off'=>99.7,'def'=>104.3,'tempo'=>72.0),\n array('name'=>'Mt. St Marys','elo'=>1278,'off'=>96.1,'def'=>99.7,'tempo'=>62.2),\n //winner to [9]\n array('name'=>'Drake','elo'=>1540,'off'=>114.6,'def'=>98.6,'tempo'=>66.8),\n array('name'=>'Wichita State','elo'=>1592,'off'=>110.7,'def'=>97.7,'tempo'=>67.6),\n //winner to [1]\n array('name'=>'Appalachian State','elo'=>1378,'off'=>100.1,'def'=>103.0,'tempo'=>65.7),\n array('name'=>'Norfolk St','elo'=>1310,'off'=>101.3,'def'=>103.6,'tempo'=>67.7),\n );\n}", "public function getSeasons();", "public function run()\n {\n $teams = [\n ['team'=>'Manchester City',\n 'team_id'=>1001,\n 'league_id'=>1,\n 'points'=>77,\n 'wins'=>24,\n 'draws'=>5,\n 'losses'=>4,\n 'gd'=>45,\n 'sport_id'=>1,\n 'img_name'=>'manCity.png'],\n ['team'=>'Manchester United',\n 'team_id'=>1002,\n 'league_id'=>1,\n 'points'=>67,\n 'wins'=>19,\n 'draws'=>10,\n 'losses'=>4,\n 'gd'=>29,\n 'sport_id'=>1,\n 'img_name'=>'manUtd.png'],\n ['team'=>'Leicester City',\n 'team_id'=>1003,\n 'league_id'=>1,\n 'points'=>62,\n 'wins'=>19,\n 'draws'=>5,\n 'losses'=>9,\n 'gd'=>22,\n 'sport_id'=>1,\n 'img_name'=>'leicesterCity.png'],\n ['team'=>'Chelsea',\n 'team_id'=>1004,\n 'league_id'=>1,\n 'points'=>58,\n 'wins'=>16,\n 'draws'=>10,\n 'losses'=>7,\n 'gd'=>20,\n 'sport_id'=>1,\n 'img_name'=>'chelsea.png'],\n ['team'=>'West Ham',\n 'team_id'=>1005,\n 'league_id'=>1,\n 'points'=>55,\n 'wins'=>16,\n 'draws'=>7,\n 'losses'=>10,\n 'gd'=>10,\n 'sport_id'=>1,\n 'img_name'=>'westHam.png'],\n ['team'=>'Liverpool',\n 'team_id'=>1006,\n 'league_id'=>1,\n 'points'=>54,\n 'wins'=>15,\n 'draws'=>9,\n 'losses'=>9,\n 'gd'=>16,\n 'sport_id'=>1,\n 'img_name'=>'liverpool.png'],\n ['team'=>'Tottenham',\n 'team_id'=>1007,\n 'league_id'=>1,\n 'points'=>53,\n 'wins'=>15,\n 'draws'=>8,\n 'losses'=>10,\n 'gd'=>18,\n 'sport_id'=>1,\n 'img_name'=>'tottenham.png'],\n ['team'=>'Everton',\n 'team_id'=>1008,\n 'league_id'=>1,\n 'points'=>52,\n 'wins'=>15,\n 'draws'=>7,\n 'losses'=>10,\n 'gd'=>4,\n 'sport_id'=>1,\n 'img_name'=>'everton.png'],\n ['team'=>'Leeds United',\n 'team_id'=>1009,\n 'league_id'=>1,\n 'points'=>47,\n 'wins'=>14,\n 'draws'=>5,\n 'losses'=>14,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'leedsUtd.png'],\n ['team'=>'Arsenal',\n 'team_id'=>1010,\n 'league_id'=>1,\n 'points'=>46,\n 'wins'=>13,\n 'draws'=>7,\n 'losses'=>13,\n 'gd'=>7,\n 'sport_id'=>1,\n 'img_name'=>'arsenal.png'],\n ['team'=>'Aston Villa',\n 'team_id'=>1011,\n 'league_id'=>1,\n 'points'=>45,\n 'wins'=>13,\n 'draws'=>6,\n 'losses'=>13,\n 'gd'=>9,\n 'sport_id'=>1,\n 'img_name'=>'astonVilla.png'],\n ['team'=>'Wolves',\n 'team_id'=>1012,\n 'league_id'=>1,\n 'points'=>41,\n 'wins'=>11,\n 'draws'=>8,\n 'losses'=>14,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'wolves.png'],\n ['team'=>'Crystal Palace',\n 'team_id'=>1013,\n 'league_id'=>1,\n 'points'=>38,\n 'wins'=>10,\n 'draws'=>8,\n 'losses'=>14,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'crystalPalace.png'],\n ['team'=>'Burnley',\n 'team_id'=>1014,\n 'league_id'=>1,\n 'points'=>36,\n 'wins'=>9,\n 'draws'=>9,\n 'losses'=>15,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'burnley.png'],\n ['team'=>'Southampton',\n 'team_id'=>1015,\n 'league_id'=>1,\n 'points'=>36,\n 'wins'=>10,\n 'draws'=>6,\n 'losses'=>16,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'southampton.png'],\n ['team'=>'Newcastle',\n 'team_id'=>1016,\n 'league_id'=>1,\n 'points'=>36,\n 'wins'=>9,\n 'draws'=>9,\n 'losses'=>15,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'newcastle.png'],\n ['team'=>'Brighton',\n 'team_id'=>1017,\n 'league_id'=>1,\n 'points'=>34,\n 'wins'=>7,\n 'draws'=>13,\n 'losses'=>13,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'brighton.png'],\n ['team'=>'Fullham',\n 'team_id'=>1018,\n 'league_id'=>1,\n 'points'=>27,\n 'wins'=>5,\n 'draws'=>10,\n 'losses'=>18,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'fullham.png'],\n ['team'=>'West Brom',\n 'team_id'=>1019,\n 'league_id'=>1,\n 'points'=>25,\n 'wins'=>5,\n 'draws'=>10,\n 'losses'=>18,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'westBrom.png'],\n ['team'=>'Sheffield United',\n 'team_id'=>1020,\n 'league_id'=>1,\n 'points'=>17,\n 'wins'=>5,\n 'draws'=>2,\n 'losses'=>26,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'sheffieldUtd.png'],\n ];\n\n foreach($teams as $team){\n football::create([\n 'team'=> $team['team'],\n 'team_id'=> $team['team_id'],\n 'league_id'=> $team['league_id'],\n 'points'=> $team['points'],\n 'wins'=> $team['wins'],\n 'draws'=> $team['draws'],\n 'losses'=> $team['losses'],\n 'gd'=> $team['gd'],\n 'sport_id'=> $team['sport_id'],\n 'img_name'=>$team['img_name']\n ]);\n }\n }", "function showGames( $curDivision=\"\" ) {\n\n/* ... define values for template variables to display on page */\n if ($curDivision == \"\") {\n $data['title'] = \"Playoffs - \".$this->config->item( 'siteName' );\n }\n else {\n $data['title'] = \"Division \".$curDivision.\" Playoffs - \".$this->config->item( 'siteName' );\n }\n\n/* ... get the schedule details from the database */ \n if ($curDivision == \"\") { \n $data['tournDetails'] = $this->Model_Tournament->getAllDetails();\n $data['tournHeader'] = \"League Playoff Schedule\";\n }\n else {\n $data['tournDetails'] = $this->Model_Tournament->getDivDetails( $curDivision );\n $data['tournHeader'] = \"Division \".$curDivision.\" Playoff Schedule\";\n }\n\n/* ... replace seeding placeholders in the schedule with appropriate team ids */\n for ($i=0; $i < count( $data['tournDetails'] ); $i++) {\n\n if ($data['tournDetails'][$i]['Status'] == \"SCHEDULED\") {\n if ($curDivision == \"\") {\n $seedDiv = substr( $data['tournDetails'][$i]['TournamentID'], 0, 1 );\n }\n else {\n $seedDiv = $curDivision;\n }\n if ($data['tournDetails'][$i]['HomeTeamID'] == NULL && $data['tournDetails'][$i]['HomeSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['HomeSeed'], $seedDiv );\n $data['tournDetails'][$i]['HomeTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n if ($data['tournDetails'][$i]['VisitTeamID'] == NULL && $data['tournDetails'][$i]['VisitSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['VisitSeed'], $seedDiv );\n $data['tournDetails'][$i]['VisitTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n }\n }\n \n/* ... set the name of the page to be displayed */\n $data['main'] = \"schedule/sched_tournamentMaster\";\n\n $this->index( $data );\n \n/* ... time to go */\n return;\n }", "public function test2014TeamsSuccessfulResponse()\n {\n $client = new DebugClient($_SERVER['FANTASY_DATA_API_KEY'], Subscription::KEY_DEVELOPER);\n\n /** @var \\GuzzleHttp\\Command\\Model $result */\n $result = $client->Teams(['Season' => '2014']);\n\n $response = $client->mHistory->getLastResponse();\n\n $this->assertEquals('200', $response->getStatusCode());\n\n /** we expect 32 teams for 2014 */\n $this->assertCount( 32, $result );\n\n $check_team_keys = function ( $pTeam )\n {\n /** we expect 19 stats (woah!) */\n $this->assertCount( 19, $pTeam );\n\n $cloned_array = $pTeam;\n\n /** this function helps us assure that we're not missing any keys in the Enum list */\n $process_key = function ( $pKey ) use ( $pTeam, &$cloned_array )\n {\n $this->assertArrayHasKey( $pKey, $pTeam );\n unset( $cloned_array[$pKey] );\n\n if ( Teams\\Property::KEY_STADIUM_DETAILS == $pKey )\n {\n $pStadium = $pTeam[$pKey];\n\n /** we expect 7 keys */\n $this->assertCount( 7, $pStadium );\n\n $cloned_stadium = $pStadium;\n\n $process_stadium = function ( $pStadiumKey ) use ( $pStadium, &$cloned_stadium )\n {\n $this->assertArrayHasKey( $pStadiumKey, $pStadium );\n unset( $cloned_stadium[$pStadiumKey] );\n };\n\n /** test all the stadium keys */\n $process_stadium( Stadium\\Property::KEY_CAPACITY );\n $process_stadium( Stadium\\Property::KEY_CITY );\n $process_stadium( Stadium\\Property::KEY_COUNTRY );\n $process_stadium( Stadium\\Property::KEY_NAME );\n $process_stadium( Stadium\\Property::KEY_PLAYING_SURFACE );\n $process_stadium( Stadium\\Property::KEY_STADIUM_ID );\n $process_stadium( Stadium\\Property::KEY_STATE );\n }\n };\n\n /** test all the keys */\n $process_key( Teams\\Property::KEY_CITY );\n $process_key( Teams\\Property::KEY_CONFERENCE );\n $process_key( Teams\\Property::KEY_DIVISION );\n $process_key( Teams\\Property::KEY_FULL_NAME );\n $process_key( Teams\\Property::KEY_KEY );\n $process_key( Teams\\Property::KEY_NAME );\n $process_key( Teams\\Property::KEY_STADIUM_DETAILS );\n $process_key( Teams\\Property::KEY_STADIUM_ID );\n\n /** 06/07/2014 Update */\n $process_key( Teams\\Property::KEY_AVERAGE_DRAFT_POSITION );\n $process_key( Teams\\Property::KEY_AVERAGE_DRAFT_POSITION_PPR );\n $process_key( Teams\\Property::KEY_BYE_WEEK );\n $process_key( Teams\\Property::KEY_DEFENSIVE_COORDINATOR );\n $process_key( Teams\\Property::KEY_DEFENSIVE_SCHEME );\n $process_key( Teams\\Property::KEY_HEAD_COACH );\n $process_key( Teams\\Property::KEY_OFFENSIVE_COORDINATOR );\n $process_key( Teams\\Property::KEY_OFFENSIVE_SCHEME );\n $process_key( Teams\\Property::KEY_SPECIAL_TEAMS_COACH );\n $process_key( Teams\\Property::KEY_TEAM_ID );\n\n /** ?? */\n $process_key( Teams\\Property::KEY_PLAYER_ID );\n\n $this->assertEmpty( $cloned_array );\n };\n\n $stats = $result->toArray();\n\n array_walk( $stats, $check_team_keys );\n }", "public function calculateAllTeamsPlayerValues(){\n $view= $this->view;\n $view->setNoRender();\n $peopleService = parent::getService('people','people');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n Service::loadModels('rally', 'rally');\n $season = $leagueService->getCurrentSeason();\n $peopleService->calculateNewValuesForAllPlayers($season);\n echo \"good\";\n }", "public function get_teams()\r\n\t\t{\r\n\t\t\t$retArr = $this->obj->result;\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "function getAllTeams(){\r\n /*for testing purposes only, replace with request to db\r\n return array(\r\n array(\"name\" => \"Usine\", \"score\" => 2000),\r\n array(\"name\" => \"Abattoirs\", \"score\" => 1000),\r\n array(\"name\" => \"Caserne\", \"score\" => 1200),\r\n array(\"name\" => \"Asile\", \"score\" => 5000),\r\n array(\"name\" => \"Zombie\", \"score\" => -10000)\r\n );*/\r\n\r\n //$GLOBALS['link'] = connect();\r\n $res = mysqli_query($GLOBALS['link'], 'select `id`, `name`, `score` from teams;');\r\n\r\n return fetch_result($res);\r\n}", "public function getScores()\n {\n \t$url = 'http://www.nfl.com/liveupdate/scorestrip/ss.json';\n \t$content = file_get_contents($url);\n \t$ss_json = json_decode($content, true);\n \t\n $url = 'http://www.nfl.com/liveupdate/scores/scores.json';\n $content = file_get_contents($url);\n $scores_json = json_decode($content, true);\n\n foreach ($ss_json['gms'] as $game) {\n // Map game data to game\n $eid = $game[\"eid\"];\n $game['data'] = $scores_json[$eid];\n \n // Get team IDs\n $home_team = DB::table('team')->where('abbr', $game['data']['home']['abbr'])->value('id');\n $away_team = DB::table('team')->where('abbr', $game['data']['away']['abbr'])->value('id');\n \n // Save teams\n if (! $home_team > 0) {\n \tprint \"Inserting home team into DB<br/>\";\n $home_team = DB::table('team')->insertGetId([\n 'name' => $game['hnn'],\n 'abbr' => $game['data']['home']['abbr']\n ]);\n } else {\n print \"Updating home team in DB<br/>\";\n DB::table('team')->where('id',$home_team)->update(['name' => $game['hnn']]);\n }\n if (! $away_team > 0) {\n print \"Inserting away team into DB<br/>\";\n $away_team = DB::table('team')->insertGetId([\n 'name' => $game['vnn'],\n 'abbr' => $game['data']['away']['abbr']\n ]);\n } else {\n print \"Updating away team in DB<br/>\";\n DB::table('team')->where('id',$away_team)->update(['name' => $game['vnn']]);\n }\n \n // Determine start time\n $year = substr($eid,0,4);\n $month = substr($eid,4,2);\n $day = substr($eid,6,2);\n $time = explode(':',$game['t']);\n $hours = $time[0] + 12;\n $minutes = $time[1];\n $seconds = 0;\n $start = date(\"Y-m-d H:i:s\", mktime($hours, $minutes, $seconds, $month, $day, $year));\n \n // Pull game ID\n $gid = DB::table('game')\n ->where('home_team_id', $home_team)\n ->where('away_team_id', $away_team)\n ->value('id');\n \n // Save game\n if (! $gid > 0) {\n print \"Inserting game for \". $home_team .\" \". $away_team .\" \". $start .\"<br/>\";\n $gid = DB::table('game')->insertGetId([\n \t'eid' => $eid,\n 'home_team_id' => $home_team,\n \t 'away_team_id' => $away_team,\n 'start' => $start\n ]);\n }\n \n // Save scores\n print \"Inserting scores \". $game['data']['home']['score']['T'] .\" \". $game['data']['away']['score']['T'] .\"<br/>\";\n if ($game['data']['home']['score']['T'] != Null && $game['data']['home']['score']['T'] != Null) {\n DB::table('score')->insert([\n 'game_id' => $gid,\n 'home_q1' => $game['data']['home']['score']['1'],\n 'home_q2' => $game['data']['home']['score']['2'],\n 'home_q3' => $game['data']['home']['score']['3'],\n 'home_q4' => $game['data']['home']['score']['4'],\n 'home_q5' => $game['data']['home']['score']['5'],\n 'away_q1' => $game['data']['away']['score']['1'],\n 'away_q2' => $game['data']['away']['score']['2'],\n 'away_q3' => $game['data']['away']['score']['3'],\n 'away_q4' => $game['data']['away']['score']['4'],\n 'away_q5' => $game['data']['away']['score']['5']\n ]);\n }\n print \"<p>----------------------------------------</p>\";\n }\n\n $response = array('exit_code' => 'success');\n //return $response;\n }", "function get_standing_team_db($idSeason)\n{\n require('./model/connect_db.php');\n $sql = \"select t.idTeam, t.nameTeam, sum(r.Points) as points from team t, race r, season s where r.idTeam = t.idTeam and s.idseason = '%d' and s.idseason = r.idseason group by t.nameTeam order by points desc \";\n $request = sprintf($sql,$idSeason);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $standing = array();\n while($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $standing[] = $line;\n }\n return $standing;\n}", "protected function processResultsByTeam($ws,$level,&$teamCount,&$newPool,$teams,$header='Team Standings',$headerLabels)\n { \n }", "function getSportsDays($params = array()){\r\n $seasonID = trim($this->seasonInfo['id']);\r\n if(!$seasonID) {\r\n $this->errorMessage[] = 'SeasonID is not specified';\r\n return array();\r\n }\r\n $leagueID = trim($this->seasonInfo['league_id']);\r\n if(!$leagueID) {\r\n $this->errorMessage[] = 'leagueID is not specified';\r\n return array();\r\n }\r\n if(!is_array($params)) $params = array();\r\n // $this->dbInstance()->queryParams['fields'] = '*';\r\n $this->dbInstance()->queryParams['table'] = 'league_season_sportsday';\r\n\r\n\r\n if(isset($params['scheduledAfter']) && intval($params['scheduledAfter'])){\r\n $scheduledAfter = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` > \".intval($params['scheduledAfter']).\")\";\r\n }\r\n if(isset($params['scheduledBefore']) && intval($params['scheduledBefore'])){\r\n $scheduledBefore = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` < \".intval($params['scheduledBefore']).\")\";\r\n }\r\n $this->dbInstance()->queryParams['where'] = \"\r\n `league_id` = :leagueID && \r\n `season_id` = :seasonID \" . \r\n $scheduledAfter . \r\n $scheduledBefore;\r\n\r\n $this->dbInstance()->queryParams['params'] = array(\r\n 'leagueID' => $leagueID,\r\n 'seasonID' => $seasonID\r\n );\r\n \r\n $this->dbInstance()->queryParams['order'] = $this->dbInstance()->calcORDERcondition($params, 'sort', 'DESC');\r\n \r\n // $offset = ($page - 1) * $limit;\r\n $this->dbInstance()->queryParams['limit'] = $this->dbInstance()->calcLIMITcondition($params);\r\n $result = $this->dbInstance()->select();\r\n\r\n if(isset($params['extend'])){\r\n if(!is_array($params['extend'])) $params['extend'] = array($params['extend']);\r\n if(in_array('games', $params['extend'])){\r\n foreach ($result as $key => $value) {\r\n $result[$key]['games'] = $this->getSportsDayGames(\r\n $result[$key]['id'], \r\n array(\r\n 'scheduledAfter'=>$params['scheduledAfter'],\r\n 'scheduledBefore'=>$params['scheduledBefore']\r\n )\r\n );\r\n }\r\n }\r\n }\r\n\r\n return $result;\r\n }", "function getResults(DateTime $date){\n\t\t\t\n\t\t\t\n\t\t\t$dateString = $date->format('Y-m-d');\n\t\t\t$url = 'http://betting.racingpost.com/horses/results/?r_date='.$dateString;\n\t\t\t\n\t\t\t$html = $this->getHtml($url);\n\t\t\t\n\t\t\t//Line needs to be accross two lines to recognise new line character\n \t\t\t$events = explode(\"<div class=\\\"headlineBlock\\\">\n <h2>\",$html);\n \n \t\t\t//logness($events);\n \t\t\t//customExit();\n \t\t\t$resultsArray = array();\n \t\t\t\n \t\t\t$maxI = count($events);\n\t\t\t\n\t\t\tfor( $i=1; $i< $maxI;$i++){\n\t\t\t\t\n\t\t\t\t$eventName = explode('</h2>',$events[$i])[0];\n\t\t\t\t\n\t\t\t\t//Remove bracketed text if any\n\t\t\t\t$eventName = rtrim(explode('(',$eventName)[0],\" \");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Get each race...\n\t\t\t\t$races = explode('<strong id=', $events[$i]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$resultsArray[$eventName]=array();\n\t\t\t\t\n\t\t\t\t$maxQ = count($races);\n\t\t\t\t\n\t\t\t\tfor( $q=1; $q<$maxQ;$q++){\n\t\t\t\t\t\n\t\t\t\t\t$raceTime = explode('<',explode('>', $races[$q])[1])[0];\n\t\t\t\t\t\n\t\t\t\t\t//Convert the hour part of the time to 24 hour\n\t\t\t\t\t$raceTime = explode(':',$raceTime);\n\t\t\t\t\t$raceHour = $raceTime[0]; \n\t\t\t\t\t$raceMinute = $raceTime[1]; \n\t\t\t\t\t\n\t\t\t\t\tif( $raceHour < 11){\n\t\t\t\t\t\t$raceHour+=12;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$raceTime = $raceHour.':'.$raceMinute;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$resultsArray[$eventName][$raceTime]=array();\n\t\t\t\t\t\n\t\t\t\t\t//Find out number of runners..\n\t\t\t\t\t$totalRunners = explode('>',explode('ran Distances', $races[$q])[0]);\n\t\t\t\t\t$totalRunners = (int)$totalRunners[count($totalRunners)-1];\n\t\t\t\t\t\n\t\t\t\t\t$resultsArray[$eventName][$raceTime]['totalRunners']=$totalRunners;\n\t\t\t\t\t\n\t\t\t\t\t//Only proceed if number of runners found..\n\t\t\t\t\tif( $totalRunners> 0 ){\n\t\t\t\t\t\n\t\t\t\t\t\t//Get horses in order\n\t\t\t\t\t\t$horses = explode('HORSE\">', $races[$q]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$maxH = count($horses);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor( $h=1; $h<$maxH; $h++ ){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//get the position os this horse, (should match $h)\n\t\t\t\t\t\t\t$position = explode(' <a href', $horses[$h-1]);\n\t\t\t\t\t\t\t$position = $position[count($position)-2];\n\t\t\t\t\t\t\t$position = explode('>',$position);\n\t\t\t\t\t\t\t$position = $position[count($position)-1];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//make sure we havent gone down as far as non runner horses, or script\n\t\t\t\t\t\t\tif (strpos($position, 'NR') !== false || !is_numeric($position)) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//If it doesn't match, probably a deadheat\n\t\t\t\t\t\t\tif( $position != $h ){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//unset the array and break from for loop\n\t\t\t\t\t\t\t\t//logness(\"position: $position not match: $h\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tunset($resultsArray[$eventName][$raceTime]['results']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$horseName = explode('</a>',$horses[$h] )[0];\n\t\t\t\t\t\t\t\t$horsePrice = trim(explode('<',explode('</a>', $horses[$h])[1])[0],' F');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($horsePrice==\"evens\"){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$horserice = \"1/1\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Convert price to decimal\n\t\t\t\t\t\t\t\t$horsePrice = explode('/', $horsePrice);\n\t\t\t\t\t\t\t\t$horsePrice = $horsePrice[0]/$horsePrice[1]+1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$resultsArray[$eventName][$raceTime]['results'][$h] = array('name'=>$horseName,'price'=>$horsePrice );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Get non runners\n\t\t\t\t\t\t$nonRunners = explode('NR:', $races[$q]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Check if there is any\n\t\t\t\t\t\tif( count($nonRunners)>1){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$resultsArray[$eventName][$raceTime]['nonRunners']=array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$nonRunners = explode('</p>', $nonRunners[1])[0];\n\t\t\t\t\t\t\t$nonRunners = explode('</a>', $nonRunners);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$maxN = (sizeof($nonRunners)-1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor( $n=0; $n<$maxN;$n++){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$nonRunnerName = explode('>', $nonRunners[$n])[1];\n\t\t\t\t\t\t\t\t$nonRunnerName = explode(' (', $nonRunnerName)[0];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$resultsArray[$eventName][$raceTime]['nonRunners'][]=explode('>', $nonRunners[$n])[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $resultsArray;\n\t\t\t//logness($resultsArray);\n\t\t\t//customExit();\n\t\t}", "public function populateMatchStandings(){\n\t\t $team = new Application_Model_Mapper_Team();\n\t\t //cath all teams\n\t\t $teamList=$team->fetchAll();\n\t\t $prosGoal= null;\n\t\t $agaistGoal=null;\n\t\t if(count($teamList)>0){\n\t\t \t foreach($teamList as $row){\n\t\t \t \t //begin team statistics by 0\n\t\t \t \t $row->setWins(0);\n\t\t \t \t $row->setLosses(0);\n\t\t \t \t $row->setPoints(0);\n\t\t \t \t $row->setDraws(0);\n\t\t \t \t //catch all matches by team\n\t\t $championship = $this->seachMatchByTeam($row->getId());\n\t\t foreach ($championship as $match) {\n\t\t //if a team is a visitor team goals of visitor team it is\n\t\t \t $prosGoal=$match['goalVisitorTeam'];\n\t\t \t $agaistGoal=$match['goalHomeTeam'];\n\t\t \t //if a team is a home team goals of home team it is\n\t\t \t if($match['idHomeTeam']==$row->getId()){\n\t\t \t \t $prosGoal=$match['goalHomeTeam'];\n\t\t \t \t $agaistGoal=$match['goalVisitorTeam'];\n\t\t \t }\n\t\t \t //if team win\n\t\t \t if($agaistGoal<$prosGoal){\n\t\t \t \t$row->setWins($row->getWins()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+3);\n\t\t \t }//if team lost\n\t\t \t elseif($agaistGoal>$prosGoal){\n\t\t \t \t$row->setLosses($row->getLosses()+1);\n\t\t \t }//if team draw\n\t\t \t else{\n\t\t \t \t$row->setDraws($row->getDraws()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+1);\n\t\t \t }\n\t\t }\n\t\t //update table team\n\t\t $team->updateTeam($row);\n\t\t \t }\n\t\t }\n\t}", "public function index()\n {\n return response(League::withCount('teams')->get());\n }", "public function testActiveTeamResponse()\n {\n $client = new DebugClient($_SERVER['FANTASY_DATA_API_KEY'], Subscription::KEY_DEVELOPER);\n\n /** @var \\GuzzleHttp\\Command\\Model $result */\n $result = $client->Teams([]);\n\n $response = $client->mHistory->getLastResponse();\n\n $this->assertEquals('200', $response->getStatusCode());\n\n /** we expect 32 teams for 2014 */\n $this->assertCount( 32, $result );\n\n $check_team_keys = function ( $pTeam )\n {\n /** we expect 19 stats (woah!) */\n $this->assertCount( 19, $pTeam );\n\n $cloned_array = $pTeam;\n\n /** this function helps us assure that we're not missing any keys in the Enum list */\n $process_key = function ( $pKey ) use ( $pTeam, &$cloned_array )\n {\n $this->assertArrayHasKey( $pKey, $pTeam );\n unset( $cloned_array[$pKey] );\n\n if ( Teams\\Property::KEY_STADIUM_DETAILS == $pKey )\n {\n $pStadium = $pTeam[$pKey];\n\n /** we expect 7 keys */\n $this->assertCount( 7, $pStadium );\n\n $cloned_stadium = $pStadium;\n\n $process_stadium = function ( $pStadiumKey ) use ( $pStadium, &$cloned_stadium )\n {\n $this->assertArrayHasKey( $pStadiumKey, $pStadium );\n unset( $cloned_stadium[$pStadiumKey] );\n };\n\n /** test all the stadium keys */\n $process_stadium( Stadium\\Property::KEY_CAPACITY );\n $process_stadium( Stadium\\Property::KEY_CITY );\n $process_stadium( Stadium\\Property::KEY_COUNTRY );\n $process_stadium( Stadium\\Property::KEY_NAME );\n $process_stadium( Stadium\\Property::KEY_PLAYING_SURFACE );\n $process_stadium( Stadium\\Property::KEY_STADIUM_ID );\n $process_stadium( Stadium\\Property::KEY_STATE );\n }\n };\n\n /** test all the keys */\n $process_key( Teams\\Property::KEY_CITY );\n $process_key( Teams\\Property::KEY_CONFERENCE );\n $process_key( Teams\\Property::KEY_DIVISION );\n $process_key( Teams\\Property::KEY_FULL_NAME );\n $process_key( Teams\\Property::KEY_KEY );\n $process_key( Teams\\Property::KEY_NAME );\n $process_key( Teams\\Property::KEY_STADIUM_DETAILS );\n $process_key( Teams\\Property::KEY_STADIUM_ID );\n\n /** 06/07/2014 Update */\n $process_key( Teams\\Property::KEY_AVERAGE_DRAFT_POSITION );\n $process_key( Teams\\Property::KEY_AVERAGE_DRAFT_POSITION_PPR );\n $process_key( Teams\\Property::KEY_BYE_WEEK );\n $process_key( Teams\\Property::KEY_DEFENSIVE_COORDINATOR );\n $process_key( Teams\\Property::KEY_DEFENSIVE_SCHEME );\n $process_key( Teams\\Property::KEY_HEAD_COACH );\n $process_key( Teams\\Property::KEY_OFFENSIVE_COORDINATOR );\n $process_key( Teams\\Property::KEY_OFFENSIVE_SCHEME );\n $process_key( Teams\\Property::KEY_SPECIAL_TEAMS_COACH );\n $process_key( Teams\\Property::KEY_TEAM_ID );\n\n /** ?? */\n $process_key( Teams\\Property::KEY_PLAYER_ID );\n\n $this->assertEmpty( $cloned_array );\n };\n\n $stats = $result->toArray();\n\n array_walk( $stats, $check_team_keys );\n }", "function display_player_stats($res) {\n\n echo '<br><div class=\"stat-sheet\"><h3>Regular Season Stats</h3><br>';\n\n // Table header:\n echo '<table class=\"player-tbl\" cellspacing=\"5\" cellpadding=\"5\"\n width=\"75%\">\n\t<tr class=\"player-stat-heading\">\n\t\t<td align=\"left\"><b>Year</b></td>\n\t\t<td align=\"left\"><b>Team</b></td>\n\t\t<td align=\"left\"><b>Lg</b></td>\n\t\t<td align=\"left\"><b>G</b></td>\n\t\t<td align=\"left\"><b>Min</b></td>\n\t\t<td align=\"left\"><b>Pts</b></td>\n\t\t<td align=\"left\"><b>PPG</b></td>\n\t\t<td align=\"left\"><b>FGM</b></td>\n\t\t<td align=\"left\"><b>FGA</b></td>\n\t\t<td align=\"left\"><b>FGP</b></td>\n\t\t<td align=\"left\"><b>FTM</b></td>\n\t\t<td align=\"left\"><b>FTA</b></td>\n\t\t<td align=\"left\"><b>FTP</b></td>\n\t\t<td align=\"left\"><b>3PM</b></td>\n\t\t<td align=\"left\"><b>3PA</b></td>\n\t\t<td align=\"left\"><b>3PP</b></td>\n\t\t<td align=\"left\"><b>ORB</b></td>\n\t\t<td align=\"left\"><b>DRB</b></td>\n\t\t<td align=\"left\"><b>TRB</b></td>\n\t\t<td align=\"left\"><b>RPG</b></td>\n\t\t<td align=\"left\"><b>AST</b></td>\n\t\t<td align=\"left\"><b>APG</b></td>\n\t\t<td align=\"left\"><b>STL</b></td>\n\t\t<td align=\"left\"><b>BLK</b></td>\n\t\t<td align=\"left\"><b>TO</b></td>\n\t\t<td align=\"left\"><b>PF</b></td>\n\t</tr>\n';\n\n // Fetch and print all the records:\n while ($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) {\n echo '<tr class=\"player-stat\">\n\t\t\t<td align=\"left\">' . $row['year'] . '</td>\n\t\t\t<td align=\"left\">' . $row['team'] . '</td>\n\t\t\t<td align=\"left\">' . $row['lg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['g'] . '</td>\n\t\t\t<td align=\"left\">' . $row['min'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pts'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ppg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fga'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fta'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpa'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['orb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['drb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['trb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['rpg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ast'] . '</td>\n\t\t\t<td align=\"left\">' . $row['apg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['stl'] . '</td>\n\t\t\t<td align=\"left\">' . $row['blk'] . '</td>\n\t\t\t<td align=\"left\">' . $row['turnover'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pf'] . '</td>\n\t\t</tr>\n\t\t';\n }\n\n echo '</table></div>';\n\n}", "function teams($contest_id = null) {\n $this->auth(COMP_ADM_LEVEL);\n if($contest_id == null){\n $contest_id = $this->uri->segment(3);\n }\n $data['competition_data'] = $this->m_key->getTeamDataByContestId($contest_id);\n $data['teams'] = $this->m_team->getAllByContestId($contest_id);\n $this->load->view('admin/company_admin/v_teams', $data);\n }", "function teams(){\n\t\t$this->autoRender = false;\n\t\t$this->response->type('json');\n\t\ttry {\n\t\t\t$teams = $this->Team->find('all');\n\t\t}catch (Exception $e){\n\t\t\techo $this->dbError;\n\t\t}\n\t\tif (!empty($teams)){\n\t\t\techo json_encode($teams);\n\t\t}else{\n\t\t\techo $this->noResult;\n\t\t}\n\t}", "function getStandings($allSchools){\n \n $all_records = [];\n $all_leagues = [];\n $brk = [];\n $ccc = [];\n $cra = [];\n $csc = [];\n $ecc = [];\n $fciac = [];\n $nvl = [];\n $nccc = [];\n $scc = [];\n $shr = [];\n $swc = [];\n \n $db_standings = new Database();\n //\n foreach($allSchools as $team){\n $getTeamRecord = \"CALL getRecord('$team[0]')\";\n $record = $db_standings->getData($getTeamRecord);\n $record = getRecords($record, $team);\n\n if($record['league'] == 'Berkshire'){ array_push($brk, $record); }\n elseif($record['league']=='Central Connecticut'){ array_push($ccc, $record); }\n elseif($record['league']=='Capital Region Athletic'){ array_push($cra,$record); }\n elseif($record['league']=='Constitution State'){ array_push($csc, $record); }\n elseif($record['league']=='Eastern Connecticut'){ array_push($ecc, $record); }\n elseif($record['league']=='Fairfield County Interscholastic Athletic'){ array_push($fciac, $record); }\n elseif($record['league']=='Naugatuck Valley'){ array_push($nvl, $record); }\n elseif($record['league']=='North Central Connecticut'){ array_push($nccc, $record); }\n elseif($record['league']=='Southern Connecticut'){ array_push($scc, $record); }\n elseif($record['league']=='Shoreline'){ array_push($shr, $record); }\n elseif($record['league']=='South West'){ array_push($swc, $record); }\n else{ array_push($all_records, $record); }\n\n // Sort brk arrays by overall w,l\n usort($brk,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ccc arrays by overall w,l\n usort($ccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort cra arrays by overall w,l\n usort($cra,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort csc arrays by overall w,l\n usort($csc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ecc arrays by overall w,l\n usort($ecc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort fcica arrays by overall w,l\n usort($fciac,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nccc arrays by overall w,l\n usort($nccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nvl arrays by overall w,l\n usort($nvl,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort scc arrays by overall w,l\n usort($scc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort shr arrays by overall w,l\n usort($shr,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort swc arrays by overall w,l\n usort($swc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n \n // Combine sorted divisions into all leagues array\n $all_leagues = [\n 'berkshire'=>$brk,\n 'capital region athletic'=>$cra,\n 'central connecticut'=>$ccc,\n 'constitution state'=>$csc,\n 'eastern connecticut'=>$ecc,\n 'fairfield county interscholastic athletic'=>$fciac,\n 'north central connecticut'=>$nccc,\n 'naugatuck valley'=>$nvl,\n 'shoreline'=>$shr,\n 'southern connecticut'=>$scc,\n 'south west'=>$swc\n ];\n }\n \n return $all_leagues;\n}", "function ListAllowedPlayers(){\n\t\n\tglobal $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players;\n\t\n\tif ($_GET['mode'] != \"league\"){\n\t\t\n\t\techo Menu();\n\t\t\n\t\tKillUse($_SESSION['loginid']);\n\t}\n\techo \"<table width=\\\"857\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\tif ($_GET['lid'] == 0){\n\t\techo \"\t<tr>\\n\";\n\t\techo \"\t\t<td>\"._LEAGUE_NO_LEAGUE_ID.\"</td>\\n\";\n \t\techo \"\t</tr>\\n\";\n\t} else {\n\t\techo \"\t<tr>\\n\";\n\t\tif ($_GET['show'] != \"id\" && $_GET['show'] != \"season_players_all_guid\"){\n\t\t\techo \"\t\t<td width=\\\"30\\\" valign=\\\"middle\\\" class=\\\"eden_title\\\">ID</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t}\n\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\techo \"\t</tr>\\n\";\n\t\t//$msg = LeagueGenerateListAllowedPlayers((float)$_GET['lid'],(float)$_GET['sid'],(float)$_GET['rid']);\n\t\tswitch ($_GET['show']){\n\t \t\tcase \"id\":\n\t \t\t\t$colspan = 1;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players \n\t\t\t\tWHERE league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY league_season_round_allowed_player_guid\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t \t\tbreak;\n\t\t\tcase \"season_players_all\":\n\t\t\t\t$colspan = 4;\n\t \t\tbreak;\n\t\t\tcase \"season_players_all_guid\":\n\t \t\t\t$colspan = 1;\n\t \t\tbreak;\n\t\t\tdefault:\n\t \t\t\t$colspan = 4;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, ll.league_league_id, ll.league_league_game_id, lsrap.league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players AS lsrap \n\t\t\t\tJOIN $db_league_leagues AS ll ON ll.league_league_id=lsrap.league_season_round_allowed_player_league_id \n\t\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\t\t\t\tWHERE lsrap.league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY lsrap.league_season_round_allowed_player_team_sub_id ASC, a.admin_nick ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$_GET['show'] = \"all\";\n\t\t}\n\t\t\n\t\t$cislo = 0;\n\t\t// pro zobrazeni povolenych hracu\n\t\tif ($_GET['show'] == \"id\" || $_GET['show'] == \"all\"){\n\t\t\twhile ($ar_round = mysql_fetch_array($res_round)){\n\t\t\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\tif ($_GET['show'] != \"id\"){\n\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_round['admin_id'].\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_round['league_team_name']).\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_round['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t}\n\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if (empty($ar_round['league_season_round_allowed_player_guid'])){echo \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} else {echo stripslashes($ar_round['league_season_round_allowed_player_guid']);} echo \"</td>\\n\";\n\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t$cislo++;\n\t\t\t}\n\t\t\tunset($ar_round);\n\t\t}\n\t\t// pro zobrazeni vsech hracu\n\t\tif ($_GET['show'] == \"season_players_all\" || $_GET['show'] == \"season_players_all_guid\"){\n\t\t\t$res_team = mysql_query(\"\n\t\t\tSELECT lt.league_team_id, lt.league_team_name, ltsl.league_teams_sub_league_team_sub_id, ltsl.league_teams_sub_league_league_id \n\t\t\tFROM $db_league_teams_sub_leagues AS ltsl \n\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=ltsl.league_teams_sub_league_team_id \n\t\t\tWHERE ltsl.league_teams_sub_league_league_id=\".(integer)$_GET['lid']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\twhile ($ar_team = mysql_fetch_array($res_team)){\n\t\t\t\t$res_player = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, ag.admin_guid_guid, lp.league_player_id \n\t\t\t\tFROM $db_league_players AS lp \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\t\t\t\tJOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_league_guid_id=\".(integer)$ar_team['league_teams_sub_league_league_id'].\" AND ag.admin_guid_guid != '' \n\t\t\t\tWHERE lp.league_player_team_sub_id=\".(integer)$ar_team['league_teams_sub_league_team_sub_id']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$i=1;\n\t\t\t\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\t\tif ($_GET['show'] != \"season_players_all_guid\"){\n\t\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_team['league_team_name']).\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_player['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_player['admin_guid_guid']).\"</td>\\n\";\n\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\techo \"</table>\\n\";\n}", "function get_archieved_games_results($odds_season) {\n\t\n//$odds_season = '2013-14';\n\n/* odds_limit is used to check if the games is an even match. If not, we don't bother using it. \n\tThe odds archive files contains multiple odds notations for a two way situation, including\n\tthe US odds (like -125). The US odds is only available for the favorite team, so only need\n\tto check one end of the\trange. Ex.: -130 is ~1.76 in decimal notation, so it should fit in \n\tour range of 1.75 - 2.1. \n*/\n//$odds_limit = -130;\n$odds_archive = file('odds_archive/nhl odds '.$odds_season.'.csv');\n\n$line_number = 1;\n\nforeach($odds_archive as $odds_line) {\n\t\n\tif($line_number != 1) {\n\t\t\n\t\t$odds_columns = explode(',', $odds_line);\n\t\t\n\t\t$i=0;\n\t\t\t\t\t\t\n\t\tforeach($odds_columns as $column) {\n\t\t\tswitch($i) {\n\t\t\t\tcase 0:\n\t\t\t\t\t$current_date = $column;\n\t\t\t\tcase 3:\n\t\t\t\t\t$current_team = $column;\n\t\t\t\tcase 7:\n\t\t\t\t\t$current_score = $column;\t\n\t\t\t\tcase 8:\n\t\t\t\t\t$current_odds = $column;\t\n\t\t\t\tcase 10:\n\t\t\t\t\t$current_overtime = $column;\t\n\t\t\t}\n\t\t\t$i++;\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\tif($line_number % 2 == 0) {\n\t\t\t$visitor_team = $current_team;\n\t\t\t$visitor_score = $current_score;\n\t\t\t$visitor_odds = $current_odds;\n\t\t\t$visitor_overtime = $current_overtime;\n\t\t} else {\n\n\t\t\n//\t\t\t$save_to_db = false;\n\t\t\t$save_to_db = true;\n\t\t\tif(substr($current_odds, 0, 1) == '-') {\n\t\t\t\t/*if($current_odds >= $odds_limit) {\n\t\t\t\t\t$save_to_db = true;\n\t\t\t\t}*/\n\t\t\t\t$odds_to_use = $current_odds;\n\t\t\t} elseif (substr($visitor_odds, 0, 1) == '-') {\n\t\t\t\t/*if($visitor_odds >= $odds_limit) {\n\t\t\t\t\t$save_to_db = true;\n\t\t\t\t}*/\n\t\t\t\t$odds_to_use = $visitor_odds;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($save_to_db) {\n\t\t\t\t\n\t\t\t\t$date_length = strlen($current_date);\n\t\t\t\tif($date_length == 4) {\n\t\t\t\t\t$date_year = substr($odds_season, 0, 4);\n\t\t\t\t\t$date_month = substr($current_date, 0, $date_length-2);\n\t\t\t\t} else {\n\t\t\t\t \t$date_year = '20'.substr($odds_season, 5, 2);\n\t\t\t\t \t$date_month = '0'.substr($current_date, 0, $date_length-2);\n\t\t\t\t }\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$date_day = substr($current_date, $date_length-2, 2);\n\t\t\t\t$date_to_use = $date_year.'-'.$date_month.'-'.$date_day;\n\t\t\t\t\n\t\t\t\t//if($date_to_use >= '2013-10-01' && $date_to_use <= '2014-04-13') {\n\t\t\t\t\t\t\n\t\t\t\t\t$message_value[] = $date_to_use.' | '.$visitor_team.'-'.$current_team;\n\t\t\t\t\t\n\t\t\t\t\t$query = \"INSERT INTO matches(date, visitor, home, odds_us) VALUES ('$date_to_use', '$visitor_team', '$current_team', '$odds_to_use')\";\n\t\t\t\t\t\n\t\t\t\t\tif(!mysqli_query(DBi::$conn, $query)) { echo mysqli_error(DBi::$conn); }\n\t\t\t\t\t\n\t\t\t\t\t$game_id = mysqli_insert_id(DBi::$conn);\n\t\t\t\t\t\n\t\t\t\t\tif($visitor_score > $current_score) {\n\t\t\t\t\t\t$result = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result = 2;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//echo 'Visitor OT'.$visitor_overtime.'|';\n\t\t\t\t\t//echo 'Home OT'.$current_overtime.'<br>';\n\t\t\t\t\t\n\t\t\t\t\tif($visitor_overtime == 1 || $current_overtime == 1) {\n\t\t\t\t\t\t$overtime = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$overtime = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//echo 'OT:'.$overtime.'<br>';\n\t\t\t\t\t$query2 = \"INSERT INTO results(game_id, result, overtime) VALUES ($game_id, $result, $overtime)\";\n\t\t\t\t\t\n\t\t\t\t\tif(!mysqli_query(DBi::$conn, $query2)) { echo mysqli_error(DBi::$conn); }\n\t\t\t\t\t\n\t\t\t\t//}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\t\n\t}\n\t\n\t$line_number++;\n\n}\n\n}", "function listTeams() {\n global $oDbHelper;\n\n $sQuery = \"SELECT * FROM team WHERE competition_id = \" . COMPETITION_ID;\n $oResult = $oDbHelper->executeQuery($sQuery);\n $oDbHelper->printDbResult($oResult);\n}", "public function getTeams() { \r\n $uri = $this->payload->_links->teams->href;\r\n $response = file_get_contents($uri, false, stream_context_create($this->reqPrefs)); \r\n $response = json_decode($response);\r\n \r\n return $response->teams;\r\n }", "public function getLeagueSelect($season)\n\t{\t\t\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n $query->select('l.id AS value, l.name AS text');\n $query->from('#__sportsmanagement_league AS l');\n $query->join('INNER','#__sportsmanagement_project AS p on l.id = p.league_id');\n $query->join('INNER','#__sportsmanagement_season AS s on s.id = p.season_id ');\n $query->where('s.id = ' . $season );\n $query->where('s.published = 1');\n $query->where('l.published = 1');\n $query->group('l.name');\n $query->order('l.name');\n \n \n\t\t$db->setQuery($query);\n \n $this->getLeagueSelect = $query->dump();\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t$res = $db->loadObjectList();\n\t\tif ($res) \n {\n $options = array(JHTML::_('select.option', 0, JText::_($this->getParam('leagues_text'))));\n\t\t\t$options = array_merge($options, $res);\n\t\t}\n//\t\treturn JHTML::_('select.genericlist', $options, 'l', 'class=\"jlnav-select\"', 'value', 'text', $this->getLeagueId());\n\t\treturn $options;\n\t}", "public function index()\n\t{\n\t\t$eu_standings = LeagueStanding::where(\"league_id\", \"=\", 11)->orderBy(\"rank\", \"ASC\")->get();\n\t\t$na_standings = LeagueStanding::where(\"league_id\", \"=\", 19)->orderBy(\"rank\", \"ASC\")->get();\n\t\t\n\t\t$cs_eu_standings = LeagueStanding::where(\"league_id\", \"=\", 40)->orderBy(\"rank\", \"ASC\")->get();\n\t\t$cs_na_standings = LeagueStanding::where(\"league_id\", \"=\", 41)->orderBy(\"rank\", \"ASC\")->get();\n\t\t\n\t\t$ogn = League::find(3);\n\t\t$gpl = League::find(4);\n\t\t$lpl = League::find(5);\n\t\t$lms = League::find(38);\n\n\t\treturn View::make('teams.index', compact('na_standings', 'ogn', 'gpl', 'lpl','lms', 'eu_standings', 'cs_eu_standings', 'cs_na_standings'));\n\t}", "public function scrape()\n {\n $this->scrapeTeams();\n }", "function crawl_team_rosters($season) {\n\n$base_link = 'http://www.hockeydb.com/ihdb/stats/leagues/seasons/nhl1927'.$season.'.html';\nglobal $teams;\n\n$html_season_standings = file_get_html($base_link);\n\nif($html_season_standings) {\n\t\n\t//Retrieve the team links\n\tforeach($html_season_standings->find('table[class=sortable autostripe] tbody tr') as $team_stats){\n\t\t\tif($team_link = $team_stats->find('td a', 0)) {\n\t\t\t\t$team_name = $team_link->plaintext;\n\t\t\t\t$team_href = $team_link->href;\n\t\t\t\t\n\t\t\t\t//Retrieve the players.\n\t\t\t\tif($html_team_roster = file_get_html(\"http://www.hockeydb.com/ihdb/stats/leagues/seasons/$team_href\")) {\n\t\t\t\t\t\n\t\t\t\t\t$team_members = array();\n\t\t\t\t\t//Coaches\n\t\t\t\t\t$team_coach_section = $html_team_roster->find('div.tablebg div div', 4);\n\t\t\t\t\tforeach($team_coach_section->find('a') as $team_coach) {\n\t\t\t\t\t\t$team_members[] = $team_coach->plaintext;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Players\t\n\t\t\t\t\tforeach($html_team_roster->find('div.tablebg table[class=sortable autostripe]') as $team_player_section) {\n\t\t\t\t\t\tforeach($team_player_section->find('tbody tr') as $team_player_stats) {\n\t\t\t\t\t\t\tif($team_player = $team_player_stats->find('td a', 0)) {\n\t\t\t\t\t\t\t\t$team_members[] = $team_player->plaintext;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Upload data to files in the rosters directory.\n\t\t\t\t\t\n\t\t\t\t\tif($team_name == 'Arizona Coyotes') {\n\t\t\t\t\t\t$team_roster_handle = fopen('rosters/team_ari.txt', \"w\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$team_roster_handle = fopen('rosters/'.$teams[$team_name].'.txt', \"w\");\n\t\t\t\t\t}\n\t\t\t\t\tforeach($team_members as $member) {\n\t\t\t\t\t\t//Save only last name\n\t\t\t\t\t\t$name_parts = array();\n\t\t\t\t\t\t$name_parts = explode(' ', $member);\n\t\t\t\t\t\tfwrite($team_roster_handle, end($name_parts).\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\tfclose($team_roster_handle);\n\t\t\t\t\t$message_value[] = 'Roster updated for team: '.$team_name.'<br>';\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$message_value[] = 'GET HTML FALSE | TEAM ROSTER <br>';\n\t\t\t\t}\n\t\t\t\t//Need to remove break after dev!\n\t\t\t\t//break;\n\t\t\t}\n\t}\n\t\t\n} else {\n\t$message_value[] = 'GET HTML FALSE | SEASON STANDINGS <br>';\n}\n\n}", "function season_by_week($season_start, $season_end, $type=\"schedule\", $sport_id=1, $week_current=0, $conference_id=0)\n{\n $season_start = strtotime($season_start);\n $season_end = strtotime($season_end);\n $seconds_in_a_week = 604800;\n \n // How many weeks are in a season?\n $season_weeks = round(( $season_end - $season_start ) / $seconds_in_a_week);\n \n $this_week = round(( time() - $season_start ) / $seconds_in_a_week);\n if ( $this_week < 0 ) $this_week = 0;\n\n switch ( strtolower($type) )\n {\n case \"schedule\":\n $week_start = $this_week;\n break;\n case \"results\":\n $week_start = 0;\n $season_weeks = $this_week;\n break;\n default:\n \n $week_start = 0;\n break;\n }\n\n\n //echo \"<dd>Weeks: $season_weeks</dd>\";\n //echo \"<dd>This week: $this_week</dd>\";\n //echo \"<dd>Week start: $week_start</dd>\";\n \n if ( $conference_id > 0 )\n {\n $conference_link = \"&ConferenceID=$conference_id\";\n }\n \n // Loop through the weeks, put the dates in an array.\n $return = \"\";\n for ( $i = $week_start; $i <= $season_weeks; $i ++ )\n {\n $week_display = $i + 1;\n $timestamp = $season_start + ( $seconds_in_a_week * $i );\n $week[$i] = week_generate($timestamp);\n \n $link = \"/home.html?site=default&tpl=Schedule&Sport=\" . $sport_id . \"&SearchDate=\" . date(\"m/d/Y\", $week[$i][0]) . \"&SearchDateEnd=\" . date(\"m/d/Y\", $week[$i][1]) . \"&start=0&count=250&Week=\" . $week_display . $conference_link;\n \n \n \n if ( $week_current == $week_display )\n {\n $return .= $week_display . \" \";\n }\n else\n {\n $return .= \"<a href=\" . $link . \" class=pageNumberLink>\" . $week_display . \"</a> \";\n }\n \n }\n return $return;\n}", "function display_teamsingleschedule($season, $team, $output = 'html', $week = null)\n{\n\tglobal $tpl, $db;\n\n\tif (empty($season)) {\n\t\t// default to this year\n\t\t$season = get_current_season();\n\t}\n\n\tif (!is_numeric($season)) {\n\t\tdisplay_message(\"Invalid season\", SCHEDULE_HEADER);\n\t\treturn;\n\t}\n\n\t$user = user_logged_in();\n\n\t$gamesstmt = $db->prepare('SELECT games.week, games.start, games.home_score, games.away_score, home_teams.abbreviation AS home_team_abbr, away_teams.abbreviation AS away_team_abbr FROM ' . TOTE_TABLE_GAMES . ' AS games LEFT JOIN ' . TOTE_TABLE_SEASONS . ' AS seasons ON games.season_id=seasons.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS home_teams ON games.home_team_id=home_teams.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS away_teams ON games.away_team_id=away_teams.id WHERE seasons.year=:year AND (games.away_team_id=:away_team_id OR games.home_team_id=:home_team_id) ORDER BY week');\n\t$gamesstmt->bindParam(':year', $season, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':away_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':home_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->execute();\n\n\t$tz = date_default_timezone_get();\n\tdate_default_timezone_set('UTC');\n\t$teamgames = array();\n\twhile ($game = $gamesstmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$game['start'] = strtotime($game['start']);\n\t\t$game['localstart'] = get_local_datetime($game['start'], (!empty($user['timezone']) ? $user['timezone'] : null));\n\t\t$teamgames[(int)$game['week']] = $game;\n\t}\n\tdate_default_timezone_set($tz);\n\t\n\t$gamesstmt = null;\n\n\t$seasonweeks = get_season_weeks($season);\n\n\tfor ($i = 1; $i <= $seasonweeks; $i++) {\n\t\tif (!isset($teamgames[$i])) {\n\t\t\t$teamgames[$i] = array('bye' => true);\n\t\t}\n\t}\n\tksort($teamgames);\n\n\t$teamstmt = $db->prepare('SELECT teams.home, teams.team FROM . ' . TOTE_TABLE_TEAMS . ' WHERE id=:team_id');\n\t$teamstmt->bindParam(':team_id', $team, PDO::PARAM_INT);\n\t$teamstmt->execute();\n\t$teamobj = $teamstmt->fetch(PDO::FETCH_ASSOC);\n\t$teamstmt = null;\n\n\thttp_headers();\n\n\t$tpl->assign('team', $teamobj);\n\tif (empty($week)) {\n\t\t$tpl->assign('allseasons', array_reverse(get_seasons()));\n\t}\n\t$mobile = mobile_browser();\n\tif ($mobile) {\n\t\t$tpl->assign('mobile', true);\n\t}\n\n\t$tpl->assign('year', $season);\n\t$tpl->assign('games', $teamgames);\n\tif (!empty($week))\n\t\t$tpl->assign('week', $week);\n\n\tif ($output == 'js')\n\t\t$tpl->assign('js', true);\n\n\t$tpl->display('teamsingleschedule.tpl');\n}", "public function run() {\n if (Match::count() > 48) {\n return;\n }\n\n $teams = Team::get();\n $stadiums = Stadium::get();\n $matches = [\n // 30th June\n [\n 'home_team_id' => $teams->where('name', 'France')->first()->id,\n 'away_team_id' => $teams->where('name', 'Argentina')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Kazan Arena')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 6, 30, 17, 0, 0, 3)->timezone('UTC')->toDateTimeString(),\n ],\n [\n 'home_team_id' => $teams->where('name', 'Uruguay')->first()->id,\n 'away_team_id' => $teams->where('name', 'Portugal')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Fisht Olympic Stadium')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 6, 30, 21, 0, 0, 3)->timezone('UTC')->toDateTimeString(),\n ],\n\n // 1st July\n [\n 'home_team_id' => $teams->where('name', 'Spain')->first()->id,\n 'away_team_id' => $teams->where('name', 'Russia')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Luzhniki Stadium')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 7, 1, 17, 0, 0, 3)->timezone('UTC')->toDateTimeString(),\n ],\n [\n 'home_team_id' => $teams->where('name', 'Croatia')->first()->id,\n 'away_team_id' => $teams->where('name', 'Denmark')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Nizhny Novgorod Stadium')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 7, 1, 21, 0, 0, 3)->timezone('UTC')->toDateTimeString(),\n ],\n\n // 2nd July\n [\n 'home_team_id' => $teams->where('name', 'Brazil')->first()->id,\n 'away_team_id' => $teams->where('name', 'Mexico')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Cosmos Arena')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 7, 2, 17, 0, 0, 4)->timezone('UTC')->toDateTimeString(),\n ],\n [\n 'home_team_id' => $teams->where('name', 'Belgium')->first()->id,\n 'away_team_id' => $teams->where('name', 'Japan')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Rostov Arena')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 7, 2, 21, 0, 0, 3)->timezone('UTC')->toDateTimeString(),\n ],\n\n // 3rd July\n [\n 'home_team_id' => $teams->where('name', 'Sweden')->first()->id,\n 'away_team_id' => $teams->where('name', 'Switzerland')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Krestovsky Stadium')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 7, 3, 17, 0, 0, 3)->timezone('UTC')->toDateTimeString(),\n ],\n [\n 'home_team_id' => $teams->where('name', 'Colombia')->first()->id,\n 'away_team_id' => $teams->where('name', 'England')->first()->id,\n 'stadium_id' => $stadiums->where('name', 'Otkritie Arena')->first()->id,\n 'can_predict' => TRUE,\n 'is_ko_stage' => TRUE,\n 'date' => Carbon::create(2018, 7, 3, 21, 0, 0, 3)->timezone('UTC')->toDateTimeString(),\n ],\n\n ];\n\n foreach ($matches as $match) {\n Match::create($match);\n }\n }", "public function index()\n {\n $season = DB::table('tblleague')->orderBy('League', 'DESC')->First();\n\n $ranks = DB::table('tblclubstats')\n ->select(DB::raw('count(club) as matches, sum(win) as win, sum(lose) as lose, sum(draw) as draw, sum(goalsFor) as goalsFor, sum(goalsAgainst) as goalsAgainst, sum(points) as points, sum(goalsDiff) as diff, club, League'))\n ->where('League', $season->League)\n ->orderBy('points', 'DESC')\n ->orderBy('diff', 'DESC')\n ->groupBy('club', 'League')\n ->get();\n\n $goals = DB::table('tblplayerstats')\n ->select(DB::raw('sum(goals) as goals, player, League'))\n ->where('League', $season->League)\n ->orderBy('goals', 'DESC')\n ->groupBy('player', 'League')\n ->paginate(6);\n\n $assists = DB::table('tblplayerstats')\n ->select(DB::raw('sum(assists) as assists, player, League'))\n ->where('League', $season->League)\n ->orderBy('assists', 'DESC')\n ->groupBy('player', 'League')\n ->paginate(6);\n\n (!empty($ranks)) ? $ranks = $ranks : $ranks = 'Null';\n (!empty($goals)) ? $goals = $goals : $goals = 'Null';\n (!empty($assists)) ? $assists = $assists : $assists = 'Null';\n\n return view('ranks', compact('ranks', 'season', 'goals', 'assists'));\n }", "public static function loadAllTeams()\n\t{\n\t\t$tmpDataMgr = createNewDataManager();\n\t\t$sql = self::getQueryTextAndCurYearWeek();\n\t\t$qTeam = $tmpDataMgr->runQuery($sql);\n\t\t$aTeams = array();\n\t\t\n\t\twhile($row = mysql_fetch_assoc($qTeam))\n\t\t{\t\t\n\t\t\t$aTeams[$row[\"id\"]] = new Team($row);\n\t\t}\n\t\t\n\t\treturn $aTeams;\n\t\t\n\t}", "public function selectLeagueWinner($league, $team);", "function showteam( $ffanumber, $lastname )\n{\n\t\t$db_hostname = 'gungahlinunitedfc.org.au';\n\t\t$db_username = 'gufcweb_dev';\n\t\t$db_password = 'deve!oper';\n\t\t$db_database = 'gufcweb_player';\n\n \t$mysqli = new mysqli($db_hostname,$db_username,$db_password, $db_database);\n\n\t\t$playerteam = \"\";\n\t\t\n\t\t$sqlinner = \" SELECT * FROM gufcdraws.player where FFANumber = '\".$ffanumber.\"' and LastName = '\".$lastname.\"' and display = 'Y'\";\n\n\t\t$sqlexample1 = \" SELECT * FROM gufcdraws.player where FFANumber = 28069631 and LastName = 'Chilmaid' and display = 'Y' \";\n\t\t$sqlexample2 = \" SELECT * FROM gufcdraws.player where fkteamid = 'U16 Div 2 Boys' and display = 'Y' \";\n\t\t\n\t\t$r_queryinner = $mysqli->query($sqlinner);\n\n\t\t$todays_date = date(\"Y-m-d\");\t\t\t\t\t\t\n\n\t\t$msg = 'No player found.';\t\n\n\t\techo '<table class=\"table\" align=\"center\" border=\"1\" >';\n\t\techo '<th>First Name</th>';\n\t\techo '<th>Last Name</th>';\n\t\techo '<th>Team Name</th>';\n\n\t\tif ( ! $r_queryinner )\n\t\t{\n\t\t\techo 'Player not found'; \n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sqlteam = \" SELECT FirstName,LastName,fkteamid FROM gufcdraws.player where fkteamid = '\".$playerteam.\"' and display = 'Y'\";\n\t\t\t\n\t\t\t$r_queryteam = $mysqli->query($sqlteam);\n\t\t\t\n\t\t\tif ( $r_queryteam ) {\n\t\t\t\n\t\t\t\t$rowteam = mysqli_fetch_assoc($r_queryteam)\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>'.$rowteam['FirstName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['LastName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['fkteamid'].'</td>';\n\t\t\t\techo '</tr>';\n\t\t\t}\n\t\t\techo '</table>';\n\t\t\techo '<p/>';\n\t\t}\n}", "public function pastSeasons(){\n $json = file_get_contents('http://ergast.com/api/f1/seasons.json?limit=100');\n $f1json = json_decode($json);\n return view('seasons.pastRaces')\n ->with([\n 'f1json' => $f1json\n ]);\n }", "public function getTeams(string $league, int $season = null)\n {\n $season = $season ?? date('Y');\n\n return Cache::remember('season_teams_'.$league.'_'.$season, $this->cacheTime, function () use ($league, $season) {\n $response = $this->client->request('GET', 'getavailableteams/'.$league.'/'.$season);\n\n return collect(\n json_decode(\n (string) $response->getBody()\n )\n )->transform(function ($item, $key) {\n return [\n 'id' => $item->TeamId,\n 'name' => $item->TeamName,\n 'shortName' => $item->ShortName,\n 'icon' => $item->TeamIconUrl,\n 'win' => 0,\n 'loss' => 0,\n ];\n })->keyBy('id');\n });\n }", "public function fetchLeague($sport_id)\n\t{\n\t\t$log_data \t\t\t\t\t= [];\n\t\t$log_data['last_timestamp']\t= gmdate(\"Y-m-d\\TH:i:s\");\n\t\t$log_details\t\t\t\t= [];\n\t\t$insert_count\t\t\t\t= 0;\n\t\t$update_count\t\t\t\t= 0;\n\t\t$log_details['start_time']\t= date('Y-m-d H:i:s');\n\t\t$url \t\t\t\t\t\t= FEED_URL.'sid='.$sport_id.'&o=lg'.$this->getLastTimeStamp('league feed',$sport_id);\n\t\t$feed_object\t\t\t\t= getObjectFromXMl($url);\n\t\tif(is_object($feed_object) && isset($feed_object->L) && count($feed_object->L)){\n\t\t\t$insert_array\t\t\t=\t[];\n\t\t\tforeach ($feed_object->L as $key => $value) {\n\t\t\t\t$league\t= League::find((int)$value['I']);\n\t\t\t\t$data\t\t\t\t=\t[];\n\t\t\t\t$data['id']\t\t\t=\t(int)$value['I'];\n\t\t\t\t$data['sport_id']\t=\t(int)$value['S'];\n\t\t\t\t$data['country_id']\t=\t(int)$value['C'] == 0 ? null : (int)$value['C'];\n\t\t\t\t$data['name']\t\t=\t(string)$value['N'];\n\t\t\t\t$data['priority']\t=\t(int)$value['PRC'];\n\t\t\t\tif(isset($league->id) == false){\n\t\t\t\t\t//we will insert this data\n\t\t\t\t\t$data['created_at']\t=\tdate('Y-m-d H:i:s');\n\t\t\t\t\t$insert_array[]\t\t= \t$data;\n\t\t\t\t\t$insert_count++;\n\t\t\t\t}else {\n\t\t\t\t\t$data['updated_at']\t=\tdate('Y-m-d H:i:s');\n\t\t\t\t\t$league->fill($data)->save();\n\t\t\t\t\t$update_count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$log_details['details']\t= $insert_count.' row inserted, '.$update_count.' row updated.';\n\t\t\t//saved to database\n\t\t\tLeague::insert($insert_array);\n\t\t}else {\n\t\t\t$log_details['details']\t= 'data not found';\n\t\t}\n\t\t$log_details['end_time']\t= date('Y-m-d H:i:s');\n\t\t//log info\n\t\t$log_data['sport_id']\t\t= $sport_id;\n\t\t$log_data['event']\t\t\t= 'league feed';\n\t\t$log_data['details']\t\t= json_encode($log_details);\n\t\t$log_data['status']\t\t\t= 'ok';\n\t\t$this->logFeed($log_data);\n\t}", "function team_list()\n {\n }", "function b_minitable_show( ) {\n global $xoopsDB;\n $module_handler =& xoops_gethandler('module');\n $module =& $module_handler->getByDirname('cricketstats');\n //Get config for News module\n $config_handler =& xoops_gethandler('config');\n if ($module) {\n $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));\n }\n \n //Season id\n $sql = \"SELECT SeasonID, SeasonName FROM \".$xoopsDB->prefix(\"cricket_seasonnames\").\" WHERE SeasonDefault=1\";\n $cricket_seasonname = $xoopsDB->query($sql);\n $cricket_seasonname = $xoopsDB->fetchArray($cricket_seasonname);\n $cricket_season_id = $cricket_seasonname['SeasonID'];\n $cricket_seasonname = $cricket_seasonname['SeasonName']; \n \n //League id\n $sql2 = \"SELECT LeagueID, LeagueName FROM \".$xoopsDB->prefix(\"cricket_leaguenames\").\" WHERE LeagueDefault=1\";\n $cricket_leaguename = $xoopsDB->query($sql2);\n $cricket_leaguename = $xoopsDB->fetchArray($cricket_leaguename);\n $cricket_league_id = $cricket_leaguename['LeagueID'];\n $cricket_leaguename = $cricket_leaguename['LeagueName']; \n\n //For win, draw and lost?\n $cricket_for_win = $moduleConfig['forwin'];\n $cricket_for_draw = $moduleConfig['fordraw'];\n $cricket_for_lose = $moduleConfig['forloss'];\n \n //Query to get teams from selected season & league\n $cricket_get_teams = $xoopsDB->query(\"SELECT DISTINCT\n O.OpponentName AS name,\n O.OpponentID AS id\n FROM \".$xoopsDB->prefix(\"cricket_opponents\").\" O, \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n WHERE LM.LeagueMatchSeasonID = '$cricket_season_id' AND\n\t\t\t\t\t\tLM.LeagueMatchLeagueID = '$cricket_league_id' AND\n (O.OpponentID = LM.LeagueMatchHomeID OR\n O.OpponentID = LM.LeagueMatchAwayID)\n ORDER BY name\");\n \n //Lets read teams into the table\n $i = 0;\n while($cricket_data = $xoopsDB->fetchArray($cricket_get_teams))\n {\n $team[$cricket_data['id']]['name'] = $cricket_data['name'];\n $team[$cricket_data['id']]['homewins'] = 0;\n $team[$cricket_data['id']]['awaywins'] = 0;\n $team[$cricket_data['id']]['homeloss'] = 0;\n $team[$cricket_data['id']]['awayloss'] = 0;\n $team[$cricket_data['id']]['hometie'] = 0;\n $team[$cricket_data['id']]['awaytie'] = 0;\n $team[$cricket_data['id']]['homerunsfor'] = 0;\n $team[$cricket_data['id']]['homerunsagainst'] = 0;\n $team[$cricket_data['id']]['awayrunsfor'] = 0;\n $team[$cricket_data['id']]['awayrunsagainst'] = 0;\n $team[$cricket_data['id']]['matches'] = 0;\n }\n \n //Match data\n $query = $xoopsDB->query(\"SELECT\n LM.LeagueMatchID AS mid, \n LM.LeagueMatchHomeID as homeid,\n LM.LeagueMatchAwayID as awayid, \n LM.LeagueMatchHomeRuns as homeruns,\n LM.LeagueMatchAwayRuns as awayruns \n FROM\n \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n \tWHERE\n LM.LeagueMatchSeasonID = '$cricket_season_id' AND LM.LeagueMatchLeagueID = '$cricket_league_id' AND\n\t\t\t\t\t\t\t\tLM.LeagueMatchHomeRuns IS NOT NULL\");\n while ($cricket_matchdata = $xoopsDB->fetchArray($query)) {\n $cricket_hometeam = $cricket_matchdata['homeid'];\n $cricket_awayteam = $cricket_matchdata['awayid'];\n \n $team[$cricket_hometeam]['matches'] = $team[$cricket_hometeam]['matches'] + 1;\n $team[$cricket_awayteam]['matches'] = $team[$cricket_awayteam]['matches'] + 1;\n \n $team[$cricket_hometeam]['homerunsfor'] = $team[$cricket_hometeam]['homerunsfor'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsagainst'] = $team[$cricket_awayteam]['awayrunsagainst'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsfor'] = $team[$cricket_awayteam]['awayrunsfor'] + $cricket_matchdata['awayruns'];\n $team[$cricket_hometeam]['homerunsagainst'] = $team[$cricket_hometeam]['homerunsagainst'] + $cricket_matchdata['awayruns'];\n \n $rundiff = $cricket_matchdata['homeruns'] - $cricket_matchdata['awayruns'];\n if ($rundiff > 0) {\n $team[$cricket_hometeam]['homewins'] = $team[$cricket_hometeam]['homewins'] + 1;\n $team[$cricket_awayteam]['awayloss'] = $team[$cricket_awayteam]['awayloss'] + 1;\n }\n elseif ($rundiff == 0) {\n $team[$cricket_hometeam]['hometie'] = $team[$cricket_hometeam]['hometie'] + 1;\n $team[$cricket_awayteam]['awaytie'] = $team[$cricket_awayteam]['awaytie'] + 1;\n }\n elseif ($rundiff < 0) {\n $team[$cricket_hometeam]['homeloss'] = $team[$cricket_hometeam]['homeloss'] + 1;\n $team[$cricket_awayteam]['awaywins'] = $team[$cricket_awayteam]['awaywins'] + 1;\n }\n }\n $cricket_get_deduct = $xoopsDB->query(\"SELECT points, teamid FROM \".$xoopsDB->prefix(\"cricket_deductedpoints\").\" WHERE seasonid = '$cricket_season_id' AND leagueid = '$cricket_league_id'\");\n while ($cricket_d_points = $xoopsDB->fetchArray($cricket_get_deduct)) {\n $team[$cricket_d_points[\"teamid\"]]['d_points'] = $cricket_d_points['points'];\n }\n foreach ($team as $teamid => $thisteam) {\n $temp_points = isset($thisteam['d_points']) ? $thisteam['d_points'] : 0;\n $cricket_points[$teamid] = ($thisteam['homewins'] * $cricket_for_win) + ($thisteam['awaywins'] * $cricket_for_win) + ($thisteam['hometie'] * $cricket_for_draw) + ($thisteam['awaytie'] * $cricket_for_draw) + $temp_points;\n $cricket_runsfor[$teamid] = $thisteam['homerunsfor'] + $thisteam['awayrunsfor'];\n $cricket_runsagainst[$teamid] = $thisteam['homerunsagainst'] + $thisteam['awayrunsagainst'];\n }\n array_multisort($cricket_points, SORT_NUMERIC, SORT_DESC, $cricket_runsfor, SORT_NUMERIC, SORT_DESC, $cricket_runsagainst, SORT_NUMERIC, SORT_DESC, $team, SORT_STRING, SORT_ASC);\n \n //Print the table\n $block['title'] = _BL_CRICK_MINITABLE;\n $block['content'] = \"<table width='100%' cellspacing='2' cellpadding='2' border='0'>\n <tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_TEAM.\"</u></span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_POINTS.\"</u></span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_RUNS.\"</u></span></td> \n </tr></table><marquee behavior='scroll' direction='up' width='100%' height='100' scrollamount='1' scrolldelay='60' onmouseover='this.stop()' onmouseout='this.start()'><table width='100%' cellspacing='2' cellpadding='2' border='0'>\";\n foreach ($team as $teamid => $thisteam)\n {\n $block['content'] .= \"<tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: normal;'>\".$thisteam['name'].\"</span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_points[$teamid].\"</span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_runsfor[$teamid].\"-\".$cricket_runsagainst[$teamid].\"</span></td>\n </tr>\";\n }\n $block['content'] .= \"</table><br><div align=\\\"center\\\"><a href=\\\"\".XOOPS_URL.\"/modules/cricketstats/index.php\\\">\"._BL_CRICK_GOTOMAIN.\"</a></div></marquee>\";\n return $block;\n}", "function get_standing_team($idSeason)\n{\n $table_standing = get_standing_team_db($idSeason);\n return $table_standing;\n}", "public function index()\n {\n $teamResults = TeamResult::with('division')->get();\n\n if (request()->expectsJson()) {\n return $teamResults;\n }\n\n return view('results.track.teamResults.index', compact('teamResults'));\n }", "public function testTeamsGet()\n {\n $this->get('/api/v1/teams', ['Content-Type' => 'application/json', 'Accept' => 'application/json'])\n ->seeJsonStructure([\n '*' => [\n 'id',\n 'name',\n 'nickname',\n 'acronym',\n 'coach',\n 'location',\n ]\n ]);\n }", "public function team();", "function getStills($rTMDBID, $rSeason, $rEpisode)\n{\n global $rSettings, $rAdminSettings;\n if (strlen($rAdminSettings[\"tmdb_language\"]) > 0) {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"] . \"&language=\" . $rAdminSettings[\"tmdb_language\"];\n } else {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"];\n }\n return json_decode(file_get_contents($rURL), true);\n}", "public function startSeason(){\n ini_set('max_execution_time',300000);\n $rallyDataService = parent::getService('rally','rallyData');\n $rallyService = parent::getService('rally','rally');\n $leagueService = parent::getService('league','league');\n \n $seasonInfo = $leagueService->getSeasonInfo();\n \n $rallies = $rallyDataService->getAllRallies();\n foreach($rallies as $rally):\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start']);\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start'],2);\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start'],3);\n endforeach;\n \n $this->createRalliesForAllLeagues();\n echo \"done\";exit;\n }", "public function teamList()\n {\n $teams = Team::all();\n $countTC = 0;\n $countBranch = 0;\n foreach ($teams as $t) {\n if($t->respo->branch == \"TC\" && $t->respo->level < 4){\n $countTC ++;\n }\n else\n $countBranch++;\n }\n //info(\"Nombre de team de TC : \" . $countTC . \" Nombre de team de Branche : \" . $countBranch);\n\n return View::make('dashboard.ce.teamlist', [\n 'teams' => Team::all(),\n 'teamLeftTC' => Config::get('services.ce.maxTeamTc') - $countTC,\n 'teamLeftBranch' => Config::get('services.ce.maxTeamBranch') - $countBranch,\n ]);\n }", "function chunk($chunk_start_date, $chunk_end_date, $j)\n{\n\n global $db;\n $sharedFunctions = new Shared($db);\n\n $query = \"SELECT *\n\t\tFROM ibl_schedule\n\t\tWHERE Date BETWEEN '$chunk_start_date' AND '$chunk_end_date'\n\t\tORDER BY SchedID ASC\";\n $result = $db->sql_query($query);\n $num = $db->sql_numrows($result);\n\n $teamSeasonRecordsQuery = \"SELECT tid, leagueRecord FROM ibl_standings ORDER BY tid ASC;\";\n $teamSeasonRecordsResult = $db->sql_query($teamSeasonRecordsQuery);\n\n $arrayLastSimDates = $sharedFunctions->getLastSimDatesArray();\n $lastSimStartDate = date_create($arrayLastSimDates[\"Start Date\"]);\n $lastSimEndDate = date_create($arrayLastSimDates[\"End Date\"]);\n $projectedNextSimEndDate = date_add($lastSimEndDate, date_interval_create_from_date_string('7 days'));\n\n // override $projectedNextSimEndDate to account for the blank week at end of HEAT\n $currentSeasonEndingYear = $sharedFunctions->getCurrentSeasonEndingYear();\n $currentSeasonBeginningYear = $currentSeasonEndingYear - 1;\n if ($projectedNextSimEndDate >= date_create(\"$currentSeasonBeginningYear-10-23\") and $projectedNextSimEndDate < date_create(\"$currentSeasonBeginningYear-11-01\")) {\n $projectedNextSimEndDate = date_create(\"$currentSeasonBeginningYear-11-08\");\n }\n\n echo \"<table width=\\\"500\\\" cellpadding=\\\"6\\\" cellspacing=\\\"0\\\" border=\\\"1\\\" align=center>\";\n\n $i = 0;\n $z = 0;\n while ($i < $num) {\n $date = $db->sql_result($result, $i, \"Date\");\n $visitor = $db->sql_result($result, $i, \"Visitor\");\n $visitorScore = $db->sql_result($result, $i, \"VScore\");\n $home = $db->sql_result($result, $i, \"Home\");\n $homeScore = $db->sql_result($result, $i, \"HScore\");\n $boxid = $db->sql_result($result, $i, \"BoxID\");\n\n $visitorTeamname = $sharedFunctions->getTeamnameFromTid($visitor);\n $homeTeamname = $sharedFunctions->getTeamnameFromTid($home);\n $visitorRecord = $db->sql_result($teamSeasonRecordsResult, $visitor - 1, \"leagueRecord\");\n $homeRecord = $db->sql_result($teamSeasonRecordsResult, $home - 1, \"leagueRecord\");\n\n if (($i % 2) == 0) {\n $bgcolor = \"FFFFFF\";\n } else {\n $bgcolor = \"DDDDDD\";\n }\n\n if (($z % 2) == 0) {\n $bgcolor2 = \"0070C0\";\n } else {\n $bgcolor2 = \"C00000\";\n }\n\n if ($visitorScore == $homeScore and date_create($date) <= $projectedNextSimEndDate) {\n $bgcolor = \"DDDD00\";\n }\n\n if ($visitorScore > $homeScore) {\n $visitorTeamname = '<b>' . $visitorTeamname . '</b>';\n $visitorRecord = '<b>' . $visitorRecord . '</b>';\n $visitorScore = '<b>' . $visitorScore . '</b>';\n } elseif ($homeScore > $visitorScore) {\n $homeTeamname = '<b>' . $homeTeamname . '</b>';\n $homeRecord = '<b>' . $homeRecord . '</b>';\n $homeScore = '<b>' . $homeScore . '</b>';\n }\n\n if ($date == $datebase) {\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n } else {\n echo \"<tr>\n\t\t\t\t<td></td><td></td><td></td><td></td><td></td><td></td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor2>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Date</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Visitor</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Home</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Box Score</td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n $datebase = $date;\n $z++;\n }\n $i++;\n }\n echo \"</table>\";\n //return array($homewin, $homeloss, $visitorwin, $visitorloss);\n}", "public function sycTeams(){\n //Get all team\n $url = \"http://db.basketball.nl/db/json/team.pl?clb_ID=81\";\n\n //Get json file for api\n\n //TODO set to api\n $teams = file_get_contents($url);\n $teams = json_decode($teams);\n\n\n //TODO filter if there is dubbel comp_id\n\n //TODO create team categorys for menu\n foreach ($teams->teams as $team){\n\n //Create new team entity\n $teamEntities = $this->Teams->newEntity();\n $teamEntities->name = $team->naam;\n\n //Create slug\n $teamEntities->slug = strtolower(Text::slug(trim($team->naam)));\n $teamEntities->nbb_id = $team->id;\n $teamEntities->comp_id = $team->comp_id;\n\n //Save team\n $this->Teams->save($teamEntities);\n }\n\n }", "function get_football_seasons() {\n\t$currseasonstring = $lastseasonstring = $lastlastseasonstring = '';\n\t$seasonout[] = array();\n\t$currentyear = date(\"Y\");\n\t$currentmonth = date(\"m\");\n\t\n\tif ( $currentmonth > 2 ) {\n\t\t$seasonout[0] = (string)$currentyear . '-' . (string)($currentyear + 1);\n\t\t$seasonout[1] = (string)($currentyear - 1) . '-' . (string)$currentyear;\n\t\t$seasonout[2] = (string)($currentyear - 2) . '-' . (string)($currentyear - 1);\n\t} else {\n\t\t$seasonout[0] = (string)($currentyear - 1) . '-' . (string)($currentyear);\n\t\t$seasonout[1] = (string)($currentyear - 2) . '-' . (string)($currentyear - 1);\n\t\t$seasonout[2] = (string)($currentyear - 3) . '-' . (string)($currentyear - 2);\n\t}\n\treturn $seasonout;\n\n}", "private function calculateResultsForEachTeam($teams, $games)\n {\n foreach ($teams as $key => $team)\n {\n $team_name = $team->getName();\n $played = 0;\n $wins = 0;\n $draws = 0;\n $losses = 0;\n $points = 0;\n\n foreach ($games as $game)\n {\n if ($game['homeTeam'] == $team_name || $game['awayTeam'] == $team_name)\n {\n $played++;\n $score = explode(' ', $game['score']);\n $homeScore = $score[0];\n $awayScore = $score[2];\n\n // case home game\n if ($team_name == $game['homeTeam'])\n {\n if ($homeScore > $awayScore)\n {\n $wins++;\n $points += 3;\n }\n else if ($awayScore == $awayScore)\n {\n $draws++;\n $points += 1;\n }\n else\n {\n $losses++;\n }\n }\n // case away game\n else\n {\n if ($homeScore < $awayScore)\n {\n $wins++;\n $points += 3;\n }\n else if ($homeScore == $awayScore)\n {\n $draws++;\n $points += 1;\n }\n else\n {\n $losses++;\n }\n }\n }\n }\n\n $standing = array\n (\n 'place' => 0,\n 'team' => $team_name,\n 'played' => $played,\n 'wins' => $wins,\n 'draws' => $draws,\n 'losses' => $losses,\n 'points' => $points\n );\n\n $this->standings[$key] = $standing;\n }\n\n return $this;\n }", "public function teamlist_get()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"GET\")\n\t\t{\n\t\t $this->response('Not Acceptable',406);\n\t\t}\n\t\t$sport_id = $this->input->get('sport_id');\n\t\t$search_text = $this->input->get('search_text');\n\t\t$offset = $this->input->get('offset');\n\t\t$limit = $this->input->get('limit');\n\t\t\n\t\t$this->load->model('User_model');\n\t\t\n\t\t$team_list_count = $this->User_model->GetTeamCount($sport_id, $search_text);\n\t\tif($limit >0 ) {\n\t\t\t$remianest = $team_list_count - $limit;\n\t\t}\n\t\telse {\n\t\t\t$remianest = $team_list_count;\n\t\t}\n\t\t\n\t\t$team_list_arr=$this->User_model->GetTeam($sport_id, $search_text, $offset, $limit);\n\t\tif(count($team_list_arr)>0)\n\t\t{\n\t\t\t$this->response(array('status'=>'success','remaincount' => $remianest, 'team'=>$team_list_arr), 200);\n\t\t}\n\t\telse\n\t\t\t$this->response(array('status'=>'failed','message'=>'No records in database'),200);\n\t\n\t\n\t}", "function insertLastYearGames() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2017-10-04&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO LastYear_Games VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "function _displayWeeksGames( $schedGames ) {\n\n/* ... data declarations */\n $dayOfWeek = array();\n $textBlock = \"\";\n\n/* ... figure out which games are on which days of the week */\n for ($i = 0; $i < count( $schedGames ); $i++) {\n $dayOfWeek[date( \"D\", strtotime( $schedGames[$i]['Date'] ) )][] = $i;\n }\n\n/* ... we'll buffer the XHTML output and then pass it back in a string */\n ob_start();\n\n/* ... for each day of the week with games, we will now build a block with that day's games */\n $firstBlock = true;\n foreach ($dayOfWeek as $dow => $games) {\n\n?>\n <div id=\"dayOfGames\" class=\"<?= !$firstBlock ? 'notFirst' : '' ?>\">\n <table id=\"<?= $dow ?>\" width=\"100%\">\n <caption><?= $dow ?></caption>\n\n<?php\n foreach ($games as $gameIndex) {\n if ($schedGames[$gameIndex]['Status'] == \"PLAYED\") {\n if ($schedGames[$gameIndex]['VisitScore'] >= $schedGames[$gameIndex]['HomeScore']) {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) ).\": \".$schedGames[$gameIndex]['VisitScore'];\n $state = \"vs\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) ).\": \".$schedGames[$gameIndex]['HomeScore'];\n }\n else {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) ).\": \".$schedGames[$gameIndex]['HomeScore'];\n $state = \"vs\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) ).\": \".$schedGames[$gameIndex]['VisitScore'];\n }\n }\n elseif ($schedGames[$gameIndex]['Status'] == \"SCHEDULED\") {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) );\n $state = \"at\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) );\n }\n else {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) );\n $state = \"RAINED OUT\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) );\n }\n?>\n<!--\n <tr>\n <td><?= htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) ).\":\" ?></td>\n <td><?= $schedGames[$gameIndex]['VisitScore'] ?></td>\n <td> at </td>\n <td><?= htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) ).\":\" ?></td>\n <td><?= $schedGames[$gameIndex]['HomeScore'] ?></td>\n </tr>\n-->\n <tr>\n <td><?= $team1 ?></td>\n <td><?= $state ?> </td>\n <td><?= $team2 ?></td>\n </tr>\n\n<?php\n }\n?>\n </table>\n </div>\n\n<?php\n/* ... if this is the first block of games for the week, unset our flag used to define spacing between subsequent blocks */\n $firstBlock = false;\n\n }\n\n/* ... time to go */\n $textBlock = ob_get_contents();\n ob_end_clean();\n return( $textBlock );\n }", "public function teamStatistics(): Response\n {\n return $this->call('statistics/team');\n }", "public function load_teamManagerTeams() {\n\t\treturn $this->noScriptWarning().$this->displayManager();\n\t}", "public function season()\n {\n $this->load->view('admin/header');\n $data['all_hotels'] = $this->hotelInfoModel->getHotelList();\n $data['seasons'] = $this->common_model->getAll('sett_season');\n $this->load->view('setting/season',$data);\n $this->load->view('admin/footer');\n }", "public function getBestSeasonFinale();", "function last_games($championship,$num){\n\t\t$games=$this->db->query('Select m.*, t1.id as hid, t1.name as hname, t2.id as aid, t2.name as aname,UNIX_TIMESTAMP(date_match) as datem\n\t\t\t\t\t\t\t\t From matches as m, groups as g, rounds as r, championships as c, matches_teams as mt, teams as t1, teams as t2 \n\t\t\t\t\t\t\t\t Where mt.match_id=m.id and mt.team_id_home=t1.id and mt.team_id_away=t2.id and m.group_id=g.id and g.round_id=r.id and r.championship_id=c.id and c.id='.$championship.'\n\t\t\t\t\t\t\t\t Order by date_match desc\n\t\t\t\t\t\t\t\t Limit 0,'.$num);\n\t\t\n\t\t$query=$this->db->query('SELECT UNIX_TIMESTAMP(min( date_match )) as date_match_first, UNIX_TIMESTAMP(max( date_match ))as date_match_last\n\t\t\t\t\t\t\t\t FROM championships AS c, rounds AS r, groups AS g, matches AS m\n\t\t\t\t\t\t\t\t WHERE c.id =4\n\t\t\t\t\t\t\t \t AND r.championship_id = c.id\n\t\t\t\t\t\t\t \t AND g.round_id = r.id\n\t\t\t\t\t\t\t\t AND m.group_id = g.id')->result();\n\t\t\n\t\t\n\t\t$fecha_first=$this->weekStartEnd(mdate(\"%Y-%m-%d\",$query[0]->date_match_first));\n\t\t$fecha_last=$this->weekStartEnd(mdate(\"%Y-%m-%d\",$query[0]->date_match_last));\n\t\t\n\t\t$i=1;\n\t\tdo{\n\t\t\tif($i!=1){\n\t\t\t\t$fecha_first=$this->weekStartEnd($this->calcularfecha($fecha_first['end'],+3));\n\t\t\t}\n\t\t\t$weeks[$i]=array(\n\t \t\t\t\t\t\"start\" => $fecha_first['start'],\n\t\t\t\t\t\t\t\"end\" => $fecha_first['end'],\t\t\n\t\t \t\t );\n\t\t $i+=1;\n\t\t}while ($fecha_first['end']!=$fecha_last['end']);\n\t\t\n\t\t$j=0;\n\t\tforeach($games->result() as $row):\n\t\t\t$partidos[$j]['id']=$row->id;\n\t\t\t$partidos[$j]['fecha']=mdate(\"%d %M %y\",$row->datem);\n\t\t\t$partidos[$j]['hora']=mdate(\"%h:%i\",$row->datem);\n\t\t\t$partidos[$j]['hequipo']=$row->hname;\n\t\t\t$partidos[$j]['aequipo']=$row->aname;\n\t\t\tif($row->result=='' || $row->result==NULL)\n\t\t\t\t$partidos[$j]['marcador']='Sin jugar';\n\t\t\telse\n\t\t\t\t$partidos[$j]['marcador']=$row->result;\n\t\t\t\n\t\t\t\n\t\t\tfor($k=1 ; $k<$i; $k+=1){\n\t \t\tif($row->date_match>$weeks[$k]['start'].' 00:00:00' AND $row->date_match<$weeks[$k]['end'].' 23:59:59')\n\t \t\t\t$partidos[$j]['jornada']=$k;\n\t\t\t}\n\t\t\t\n\t\t\t$j+=1;\n\t\t\t\n\t\tendforeach;\n\t\t\n\t\treturn $partidos;\n\t\t\n\t}", "function insertLastFiveYears() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n // all games from the start of the 2013-2014 season to 2017-2018 season\n $all_games = \"/v1/schedule?startDate=2013-10-01&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO Games_Last5Years VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n\n // skip over playoff games\n if(strcmp($item->games[$i]->gameType, \"P\") == 0) {\n break;\n }\n\n\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // skip over all star games and team that is not in the nhl anymore (27)\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87 || $home_id == 93 || $home_id == 94 ||\n $home_id == 27 || $away_id == 27) {\n continue;\n }\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "function getTodaysGames($mobile){\n\n //$query = \"SELECT * FROM `games` WHERE gameDate = '$currentDate' ORDER BY id DESC\";\n // used GROUP BY to eliminate duplicate home and vising teams...\n // get all other games that are on except the current game on from your city this evening,\n // everything else\n\n // IMPORTANT NEED TO FIX THIS.... FROM IN TORONTO WON't SHOW ME THE TORONTO GAME ON NOV 8th\n\n $query = \"SELECT games.*, teams.`teamName`,\n (SELECT `teamName` FROM teams WHERE `city`= games.`homeTeam` ) AS `homeTeam`,\n (SELECT `teamName` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visitingTeamName`,\n (SELECT `logo` FROM teams WHERE `city`= games.`homeTeam` ) AS `home_logo`,\n (SELECT `logo` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visiting_logo`,\n (SELECT `id` FROM teams WHERE `city`= games.`homeTeam` ) AS `homeTeamId`,\n (SELECT `id` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visitingTeamId`\n FROM games, teams WHERE gameDate = '$this->currentDate'\n AND games.`homeTeam` <> '$this->myCity'\n AND games.`visitingTeam` <> '$this->myCity' GROUP BY games.`id`\";\n\n $result = mysql_query($query);\n\n if($mobile == true){\n $dir = \"../\";\n }else{\n $dir = \"\";\n }\n\n while($row = mysql_fetch_assoc($result)){\n\n echo \"<h3><img class='left' alt='\" . $row['homeTeam'] . \"' width='141' src='\" . $dir . $row['home_logo'] .\"' /> <img class='right' alt='\" . $row['visitingTeamName'] . \"' width='141' src='\" . $dir . $row['visiting_logo'] .\"' /></a></h3>\";\n echo '<div class=\"content\"><p>';\n echo \"<a href='schedule/\".$row['homeTeamId'].\"/\".$row['league'].\"/\".urlencode($row['homeTeam']).\"'>\" . $row['homeTeam'] . \"</a> VS <a href='schedule/\".$row['visitingTeamId'].\"/\".$row['league'].\"/\".urlencode($row['visitingTeamName']).\"'>\" . $row['visitingTeamName'] . \"</a><br />\";\n echo $row['gameDate'] . \" at \" . $row['gameTime'] . \"<br />\";\n echo '</p></div>';\n\n }\n\n }", "public function index($season)\n {\n return Team::all('id', 'name', 'location', 'stadium', 'season');\n }", "public function testAction()\n {\n if ($this->identity()) {\n $summoners = $this->account()->getSummoners();\n $summoner = $summoners[0];\n $response = $this->getServiceLocator()->get('youtube_service')->findByQuery(\"league of legends\", null, 20, \"this_week\");\n $videos = $response->getVideos(true);\n foreach ($videos as $video) {\n echo $video->getScore() . '<br />';\n }\n # $feeds = $this->getServiceLocator()->get('feed_service')->getLolProFeeds(array(\"Ahri\",\"Aatrox\",\"Jayce\"));\n return new ViewModel();\n } else {\n return $this->notFoundAction();\n }\n }", "function get_team_info($team_id) {\n global $db;\n $query = 'SELECT t.team_id\n , t.name\n , t.nickname\n , t.logo_file_name\n , l.name as league\n , l.abbr as league_abbr\n , s.name as sub_league_name\n , s.abbr as sub_league_abbr\n , d.name as div_name\n FROM teams t INNER JOIN leagues l ON t.league_id = l.league_id\n INNER JOIN sub_leagues s ON t.league_id = s.league_id AND t.sub_league_id = s.sub_league_id\n INNER JOIN divisions d ON t.league_id = d.league_id AND t.sub_league_id = d.sub_league_id\n AND t.division_id = d.division_id\n WHERE t.team_id = :team_id';\n $statement = $db->prepare($query);\n $statement->bindValue('team_id', $team_id);\n $statement->execute();\n $team_info = $statement->fetch();\n $statement->closeCursor();\n return $team_info;\n}", "public function CreateMatchesResults($matches_played) {\n\t\t$round_index = 0;\n\n\t\t// Associative array of id => team\n\t\t$teams_list = array();\n\t\tforeach ($this->teams as $team) {\n\t\t\t$teams_list[$team->id] = $team;\n\t\t}\n\n\t\tforeach ($this->rounds as &$matches_planned) {\n\t\t\t$i = 0;\n\t\t\t$skip_branches = 0;\n\t\t\tforeach ($matches_planned as &$match_planned) {\n\t\t\t\t$match_planned['result'] = NULL;\n\t\t\t\t$match_planned['team1'] = NULL;\n\t\t\t\t$match_planned['team2'] = NULL;\n\n\t\t\t\t// Every team plays on first round\n\t\t\t\tif ($round_index == 0) {\n\t\t\t\t\t$match_planned['team1'] = $this->teams[$i];\n\t\t\t\t\t$match_planned['team2'] = ($i + 1 < count($this->teams)) ? $this->teams[$i + 1] : NULL;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Find out which team played\n\t\t\t\t\t$match_index = $i;\n\t\t\t\t\t$last_round = $this->rounds[$round_index - 1];\n\n\t\t\t\t\tif (isset($last_round[$match_index]) &&\n\t\t\t\t\t\t\tisset($last_round[$match_index + 1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$match1 = $last_round[$match_index];\n\t\t\t\t\t\t$match2 = $last_round[$match_index + 1];\n\n\t\t\t\t\t\t$match_result1 = $match1['result'];\n\t\t\t\t\t\t$match_result2 = $match2['result'];\n\n\t\t\t\t\t\tif ($match_result1 && $match_result2) {\n\t\t\t\t\t\t\t$match_planned['team1'] = ($match_result1['winner'] == 1)\n\t\t\t\t\t\t\t\t? $match1['team1']\n\t\t\t\t\t\t\t\t: $match1['team2'];\n\n\t\t\t\t\t\t\t$match_planned['team2'] = ($match_result2['winner'] == 1)\n\t\t\t\t\t\t\t\t? $match2['team1']\n\t\t\t\t\t\t\t\t: $match2['team2'];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($match_planned['team1'] && $match_planned['team2']) {\n\t\t\t\t\t// Match exists, no gap between each match\n\t\t\t\t\t$skip_branches = 0;\n\t\t\t\t\tforeach ($matches_played as $key => &$match_played) {\n\t\t\t\t\t\tif ($match_played['round'] == $round_index &&\n\t\t\t\t\t\t\t\t$match_planned['team1']->id == $match_played['team1_id'] &&\n\t\t\t\t\t\t\t\t$match_planned['team2']->id == $match_played['team2_id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$match_planned['result'] = $match_played;\n\t\t\t\t\t\t\tunset($matches_played[$key]);\n\t\t\t\t\t\t\tbreak ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//$skip_branches++;\n\t\t\t\t}\n\n\t\t\t\t// Only pass to next teams when it is correctly aligned by preceding round branch\n\t\t\t\tif ($skip_branches % 4 == 0) {\n\t\t\t\t\t$i += 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Seperate played matches which doesn't get into the dynamically generated tree\n\t\t\tif ($round_index > 0) {\n\t\t\t\t// Create empty matches to create gap\n\t\t\t\t$last_nb_matches = count($this->rounds[$round_index - 1]);\n\t\t\t\t$nb_matches = count($this->rounds[$round_index]);\n\t\t\t\t$skip_branches = ceil($last_nb_matches / 2) - $nb_matches;\n\t\t\t\tfor ($i = 0; $i < $skip_branches; $i++) {\n\t\t\t\t\t$this->CreateMatch($round_index, NULL, NULL, NULL);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($matches_played as $key => &$match_played) {\n\t\t\t\tif ($match_played['round'] == $round_index) {\n\t\t\t\t\t$team1_id = (int) $match_played['team1_id'];\n\t\t\t\t\t$team2_id = (int) $match_played['team2_id'];\n\n\t\t\t\t\tif (isset($teams_list[$team1_id]) && isset($teams_list[$team2_id])) {\n\t\t\t\t\t\t$team1 = $teams_list[$team1_id];\n\t\t\t\t\t\t$team2 = $teams_list[$team2_id];\n\t\t\t\t\t\t$this->CreateMatch($round_index, $team1, $team2, $match_played);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$round_index++;\n\t\t}\n\t}", "function fantacalcio_admin_teams_list() {\n $out = l(\"Aggiungi squadra\", \"admin/fantacalcio/teams/add\", array(\n \"attributes\" => array(\"class\" => \"btn btn-info\"))) . \"<br/><br/>\";\n \n $teams = Team::all();\n \n if ($teams) {\n \n $header = array(\"Nome\", \"Utente\", \"Gironi\", \"Attiva\");\n \n foreach ($teams as $t_id => $team) {\n \n $account = User::get($team->user);\n \n $groups_team = \"\";\n foreach ($team->getCompetitions() as $competition) {\n $groups_team .= $competition . \"<br>\";\n }\n $rows[] = array(\n l($team->name, \"admin/fantacalcio/teams/\" . $t_id), \n $account != null ? $account->name : \"\", \n $groups_team, \n fantacalcio_check_value($team->active));\n }\n $out .= theme(\"table\", array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table table-responsive\")), \n \"sticky\" => TRUE, \n \"empty\" => t(\"Nessuna squadra\")));\n }\n \n return $out;\n}", "function getRecords($record, $team){\n // league standings\n $l_win = 0;\n $l_loss = 0;\n $l_tie = 0;\n // overall standings\n $o_win = 0;\n $o_loss = 0;\n $o_tie = 0;\n // league goals\n $l_pf = 0;\n $l_pa = 0;\n // overall goals\n $o_pf = 0;\n $o_pa = 0;\n // total points\n $points = 0;\n\n foreach($record as $result){\n if($result['winner'] != NULL){\n //get the final scores for both teams\n if($result['away_final'] != NULL && $result['home_final'] != NULL){\n $away_score = $result['away_final'];\n $home_score = $result['home_final']; \n }\n //get pf/pa and w/l for league\n if($result['away_league'] == $result['home_league']){\n //if school won, +1 to win, else +1 to loss\n if($result['team_id'] == $result['winner']){\n $l_win++;\n }\n elseif($result['winner'] == \"TIE\"){\n $l_tie++;\n }\n else{\n $l_loss++;\n }\n //is school home or away, add points to appropriate total\n if($result['team_id'] == $result['away_id']){\n // if away, add score to points for and opponent to points against \n $l_pf += $away_score;\n $l_pa += $home_score;\n }else{\n // if home, add score to points for and opponent to points against\n $l_pf += $home_score;\n $l_pa += $away_score;\n }\n }\n //get pf/pa and w/l for overall\n //if school won, +1 to win, else +1 to loss\n if($result['team_id'] == $result['winner']){\n $o_win++;\n $points += 3;\n }\n elseif($result['winner'] == \"TIE\"){\n $o_tie++;\n $points += 1;\n }\n else{\n $o_loss++;\n }\n //is school home or away, add points to appropriate total\n if($result['team_id'] == $result['away_id']){\n // if away, add score to points for and opponent to points against \n $o_pf += $away_score;\n $o_pa += $home_score;\n }else{\n // if home, add score to points for and opponent to points against\n $o_pf += $home_score;\n $o_pa += $away_score;\n }\n }\n }\n // push team record info into array\n $team_record = ['team'=>$team['name'],'team_id'=>$team['school_id'],'league'=>$team['league'],'class'=>$team['class'],'lwin'=>$l_win,'lloss'=>$l_loss,'ltie'=>$l_tie,'lgf'=>$l_pf,'lga'=>$l_pa,'owin'=>$o_win,'oloss'=>$o_loss,'otie'=>$o_tie,'ogf'=>$o_pf,'oga'=>$o_pa,'points'=>$points];\n\n return $team_record;\n}", "public function getAll(){\n\t\t$url = WEBSERVICE. \"teams/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToTeam($arrayResponse, false);\n\t}", "public function actionTeams()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('teams');\n\t}", "public function get_seasons()\n\t\t{\n\t\t\t/*\n\t\t\treturn $this->get_seasonteams();\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->execute();\n\t\t\t//print_r($objs);\n\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$season = ORM::factory('Sportorg_Seasons_Base',$obj['season_id']);\n\t\t\t\t$retArr[] = $season->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t\t*/\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->execute();\n\t\t\t//print_r($objs);\n\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$season = ORM::factory('Sportorg_Seasons_Base',$obj['season_id']);\n\t\t\t\t$retArr[] = $season->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}", "function SandboxHomePage($oDB)\n{ ?>\n <h1>Welcome to RideNet</h1>\n <p>\n You are currently in the RideNet Sandbox, a holding place for riders that are not yet a member of a RideNet team.\n Although you're welcome to stay in the Sandbox as long as you like, one of RideNet's coolest features is the ability\n to create and join teams. Below are some of the more popular RideNet teams in your area.\n </p>\n <div style=\"height:10px;clear:both\"></div>\n<?$sql = \"SELECT TeamID, Domain, TeamName, TeamType, CONCAT(City, ', ', State, ' ', ZipCode) AS Location\n FROM teams\n JOIN ref_team_type USING (TeamTypeID)\n JOIN ref_zipcodes USING (ZipCodeID)\n WHERE TeamID IN (120, 122, 86, 115, 135, 130)\n ORDER BY TeamName ASC\";\n $rs = $oDB->query($sql); ?>\n <table cellpadding=0 cellspacing=0 class=\"centered\" style=\"border:1px solid #CCC;background-color:#EEE\">\n <? while(($record = $rs->fetch_array())!=false) { ?>\n <tr>\n <td style=\"border-bottom:1px solid #CCC\">\n <div style=\"width:100px;overflow:hidden;text-align:center;margin:1px\">\n <a href=\"<?=BuildTeamBaseURL($record['Domain'])?>/\" target=\"_blank\">\n <img class=\"tight\" src=\"<?=getFullDomainRoot()?>/imgstore/team-logo/fit/<?=$record['TeamID']?>.png\" border=0>\n </a>\n </div>\n </td>\n <td style=\"border-bottom:1px solid #CCC\">\n <div class=\"ellipses\" style=\"padding:5px 5px;width:155px\">\n <a href=\"<?=BuildTeamBaseURL($record['Domain'])?>/\" target=\"_blank\">\n <div class=\"find-name\"><?=$record['TeamName']?></div>\n </a>\n <div class=\"find-info\"><?=$record['TeamType']?></div>\n <div class=\"find-info2\"><?=$record['Location']?></div>\n </div>\n </td>\n <td style=\"border-bottom:1px solid #CCC;text-align:center\" valign=bottom width=160>\n <?if(CheckLogin()) { ?>\n <span class='action-btn' id='join-btn<?=$record['TeamID']?>' onclick=\"ChangeTeams(<?=$record['TeamID']?>, '<?=htmlentities(addslashes($record['TeamName']))?>', '<?=htmlentities(addslashes($record['Domain']))?>')\">&nbsp;&nbsp;Join Team&nbsp;&nbsp;</span>\n <? } else { ?>\n <span class='action-btn' onclick=\"window.location.href='/login?Goto=<?=urlencode(\"/\")?>'\">&nbsp;&nbsp;Login to Join&nbsp;&nbsp;</span>\n <? } ?>\n <div style=\"margin:5px 0 5px 0\" class=\"find-info2\"><a href=\"<?=BuildTeamBaseURL($record['Domain'])?>/\" target=\"_blank\" style=\"color:#BBB\">Learn more...</a></div>\n </td>\n </tr>\n <? } ?>\n <tr height=60>\n <td style=\"padding:10px 40px;\" colspan=2>\n <p style=\"margin:0\">\n Search for other teams on RideNet\n </p>\n </td>\n <td style=\"text-align:center\">\n <?if(CheckLogin()) { ?>\n <span class=\"action-btn\" id='ct-btn' onClick=\"g_changeTeamsDialog.show({ redirectToHome: true, animateTarget: 'ct-btn' })\">&nbsp;&nbsp;Find a team...&nbsp;&nbsp;</span>\n <? } else { ?>\n <span class='action-btn' onclick=\"window.location.href='/login?Goto=<?=urlencode(\"/\")?>'\">&nbsp;&nbsp;Login to Find Teams&nbsp;&nbsp;</span>\n <? } ?>\n </td>\n </tr>\n </table>\n <div style=\"height:40px\"></div>\n <div style=\"float:right;margin: 0px 0px 0px 20px\">\n <img src=\"images/sandbox-profile.jpg\" style=\"width:280px\"><br>\n </div>\n <h1 style=\"margin-top:0px\">Change Teams Any Time</h1>\n <p>\n You can change teams at any time. From Your Profile page, click \"Edit Profile...\", then click\n \"Change Teams...\".\n </p>\n <div style=\"clear:both;height:25px\"></div>\n <div style=\"float:left;margin: 5px 20px 0px 0px;border:1px solid #DDD\">\n <img src=\"images/sandbox-roster.jpg\" style=\"width:200px\"><br>\n </div>\n <h1 style=\"padding-top:0px\">Start Something New</h1>\n <p>\n If you can't find a team on RideNet, why not create one? A RideNet team can be based\n around a real-world cycling club or could be a loosely affiliated group of riders that just want to stay\n connected. As a member of a team, you can see what everyone on your team is up to, track your team's race\n results (if you race), and organize rides together.<br><br>\n Creating a RideNet team is easy. Send us an email at <a href=\"mailto:[email protected]\">[email protected]</a>\n and we'll take care of the rest.\n </p>\n <div style=\"clear:both;height:10px\"></div>\n<!-- <h1>Send Us Feedback</h1>\n <p>\n We are continually working to improve RideNet and add new features. If you have any comments, questions\n or suggestions (or just want to tell us how much you love the site) send us an email:\n <a href=\"mailto:[email protected]\">[email protected]</a>\n </p>-->\n<? \n}", "function showResults($filename, $searchterm){\n\tif(file_exists($filename)){\n\t\t$contents = file_get_contents($filename);\n\t\t$results = json_decode($contents);\n\n\t\t# check if error in decode and give error msg\n\t\tif(json_last_error() !== JSON_ERROR_NONE){\n\t\t\techo \"<p style=\\\"font-weight:bold; color:red;\\\">\";\n echo \"ERROR: <br> Error with JSON data <br></p>\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$winCount = 0;\n\t\t$totalGames = 0; # counters\n\t\t\n\t\t# create header\t\n\t\techo \"<h4>\";\n\t\tforeach($results->comments as $elem){\n\t\t\techo \"$elem<br>\";\t\n\t\t}\n echo '</h4>'; \n\n\t\t# iterate through each element in games\n\t\tforeach($results->games as $element){\n\t\t\t\n\t\t\t# then iterate through each key value pair\n\t\t\tforeach($element as $key => $value){\n $newValue = str_replace(\"_\", \" \", $value); # clean up team names\n\n if($key === $searchterm){ # check if search term, then bold if so\n echo \"<p style=\\\"font-weight:bold; color:blue;\\\">\";\n echo \"$key : $newValue </p>\";\n }\n else{ # otherwise print normally\n echo \"<p> $key : $newValue </p>\"; \n }\n\n\t\t\t\t# check if win and update count if necessary\n\t\t\t\tif($key === \"WinorLose\" && $value === \"W\")\n\t\t\t\t\t++$winCount;\n\t\t\t}\n\t\t\t++$totalGames;\t# increment game count regardless\n\t\t echo \"<br>\";\n \n }\n\n\t\t$winPercentage = ($winCount / $totalGames) * 100;\n\t\techo \"<br><p style=\\\"color:blue;\\\">\";\n echo \"Win percentage: $winPercentage % </p><br></body></html>\";\t\t\n\t\n\t}\n\telse{\t\t# give error if file not found\n\t\techo \"<p style=\\\"font-weight:bold; color:red;\\\">\";\n echo \"No results found for the specified input.</p></body></html>\";\n\t\t\n return;\n\t}\n}", "public function winloss()\n {\n $sql = '\n SELECT \n t.name,\n ( \n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team1_id=t.id\n AND m.team1_goalcount > m.team2_goalcount ) +\n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team2_id=t.id\n AND m.team1_goalcount < m.team2_goalcount ) \n ) wins,\n ( \n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team1_id=t.id\n AND m.team1_goalcount < m.team2_goalcount ) +\n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team2_id=t.id\n AND m.team1_goalcount > m.team2_goalcount )\n ) losses\n FROM teams t';\n\n return view( 'winloss', ['matches' => \\DB::select( $sql ) ] );\n }", "function divisions($sc2id) {\n\t\t\n\t\t$bnetprofile = ($sc2id);\n \t$html = file_get_contents($bnetprofile);\n \t\n \t$preg_fourvfour = preg_match_all(\n\t\t'/<div class=\"ladder\" data-tooltip=\"#best-team-4\">.*?<span class=\"(.*?)\">.*?<div class=\"tooltip-title\">Highest Ranked in 4v4<\\/div>.*?<strong>Division:<\\/strong> (.*?)<br \\/>.*?<strong>Rank:<\\/strong> (.*?)<\\/div>/s',\n\t\t$html,\n\t\t$games,\n\t\tPREG_SET_ORDER\n\t\t);\n\t\n\t\t\n\t\treturn $games;\n\t}", "public function getMaxTeamsList(){\n return $this->_get(11);\n }", "public function seachMatchAll(){\n\t\t $query = $this->getDbTable()->select()\n\t\t ->from(array('b' => 'tbteam'),array('home'=>'b.team'))\n ->joinInner(array('a' => 'tbmatch'),'a.idHomeTeam=b.id',array('a.id','a.goalHomeTeam','a.goalVisitorTeam','a.date','a.round'))\n ->joinInner(array('c' => 'tbteam'),'c.id=a.idVisitorTeam',array('visitor'=>'c.team'))\n ->order('a.round')\n ->setIntegrityCheck(false);\n return $this->getDbTable()->fetchAll($query);\n\t}", "public function getTeam();", "function getTrend($player, $season, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t$matches = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT * FROM Games WHERE SeasonID = '$season' AND MatchType = '$type' AND Status = 'Complete' AND (ChallengerID = '$player' OR DefenderID = '$player') ORDER BY MatchID DESC\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matches[] = $row;\n\t}\n\n\t$trend = '';\n\t$trendCount = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($trendCount > 0) {\n\t\t\t$tempTrend = '';\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$tempTrend = 'Won';\n\t\t\t} else {\n\t\t\t\t$tempTrend = 'Lost';\n\t\t\t}\n\t\t\tif ($tempTrend == $trend) {\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$trend = 'Won';\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\t$trend = 'Lost';\n\t\t\t\t$trendCount++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $trend . ' ' . $trendCount;\n}", "function getTeams($conn, $table, $year, $league_id, $selector){\n $dataArray = [];\n foreach($table->find('td[class='.$selector.']') as $element){\n $row = new DataRow();\n $row->team_name = $element->plaintext;\n $row->league_id=$league_id;\n $row->year=$year;\n array_push($dataArray, $row);\n }\n\n foreach ($dataArray as $row) {\n $row->getTeamId($conn,$league_id);\n } \n\n return $dataArray;\n}", "function ShowTeamShowPlayers($team_id,$team_sub_id,$game_id,$mode = 1,$allowed_player_id = 0){\n\t\n\tglobal $db_league_players,$db_admin,$db_admin_guids,$db_clan_games;\n\t\n\tif ($mode == 2){\n\t\t$admin_guids = \"\";\n\t\t$sub_team = \"\";\n\t} else {\n\t\t$res_game = mysql_query(\"SELECT clan_games_game FROM $db_clan_games WHERE clan_games_id = \".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t$ar_game = mysql_fetch_array($res_game);\n\t\t$sub_team = \"<tr style=\\\"background: #DCE3F1;\\\">\\n\";\n\t\t$sub_team .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">Sub Team - \".$ar_game['clan_games_game'].\"</td>\\n\";\n\t \t$sub_team .= \"</tr>\\n\";\n\t}\n\t$output = $sub_team;\n\t$res_player = mysql_query(\"\n\tSELECT a.admin_id, a.admin_nick, a.admin_team_own_id, ag.admin_guid_guid, lp.league_player_id, lp.league_player_position_captain, lp.league_player_position_assistant, lp.league_player_position_player \n\tFROM $db_league_players AS lp \n\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\tLEFT JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_game_id=\".(integer)$game_id.\" \n\tWHERE lp.league_player_team_id=\".(integer)$team_id.\" AND lp.league_player_game_id=\".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$num = mysql_num_rows($res_player);\n\t$output .= \"<tr style=\\\"background: #ff8080;\\\">\\n\";\n\tif ($num > 0){\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\" class=\\\"eden_title_middle\\\">ID</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_POSITION.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\"></td>\\n\";\n\t} else {\n\t\t$output .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_TEAM_NO_PLAYER_IN_SUB.\"</td>\\n\";\n\t}\n\t$output .= \"</tr>\\n\";\n\t$cislo = 0;\n\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level2_even\";} else { $cat_class = \"cat_level2_odd\";}\n\t\t$output .= \"<tr class=\\\"\".$cat_class.\"\\\">\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\">\";\n\t\t\t\t\t\tif ($mode == 2){\n\t\t\t\t\t\t\t$output .= \"<img src=\\\"./images/sys_\"; \n\t\t\t\t\t\t\tif (in_array($ar_player['league_player_id'],$allowed_player_id)){\n\t\t\t\t\t\t\t\t$output .= \"yes\"; $alt = _LEAGUE_PLAYER_PLAY;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$output .= \"no\"; $alt = _LEAGUE_PLAYER_NO_PLAY;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t$output .= \".gif\\\" width=\\\"15\\\" height=\\\"15\\\" alt=\\\"\".$alt.\"\\\" title=\\\"\".$alt.\"\\\"> \"; \n\t\t\t\t\t\t} \n\t\t\t\t\t\t$output .= \"<strong>\".stripslashes($ar_player['admin_nick']).\"</strong>\";\n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; \n\t\t\t\t\tif (LeagueCheckPrivileges(\"O\",$ar_player['admin_id'],$team_id,\"\") == $team_id){$output .= _LEAGUE_PLAYER_POSITION_O; $comma = \", \";} else {$comma = \"\";}\n\t\t\t\t\tif (LeagueCheckPrivileges(\"C\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_C;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"A\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_A;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"P\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_P;} \n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if ($ar_player['admin_guid_guid'] != \"\"){ $output .= stripslashes($ar_player['admin_guid_guid']);} else {$output .= \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} $output .= \"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\"></td>\\n\";\n\t\t$output .= \"</tr>\\n\";\n\t\t$cislo++;\n\t}\n\t\n\treturn $output;\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SkokiOrlikBundle:Matches')->findAll();\n $teams = $em->getRepository('SkokiOrlikBundle:Teams')->findAll();\n $tt = array();\n foreach($teams as $t) {\n $tt[$t->getId()] = $t;\n }\n //var_dump($tt,$entities);die();\n\n return $this->render('SkokiOrlikBundle:Matches:index.html.twig', array(\n 'entities' => $entities,\n 'teams' => $tt\n ));\n }", "public function getLeagueData($leagueId, $page = 1)\n {\n $leagueURLs = [];\n if (is_numeric($page)) {\n // Fetch specific page (lazy loading)\n $leagueURLs[] = str_replace('{id}', $leagueId, self::FANTASY_CLASSIC_LEAGUE_URL) . '?phase=1&page_new_entries=1&page_standings=' . $page;\n } else {\n // Fetch a set of pages\n for ($i = 1; $i <= count($page); $i++) {\n $leagueURLs[] = str_replace('{id}', $leagueId, self::FANTASY_CLASSIC_LEAGUE_URL) . '?phase=1&page_new_entries=1&page_standings=' . $i;\n }\n }\n\n $leagueData = $this->curl->getMulti($leagueURLs, true);\n\n $currentEvent = false;\n $teams = [];\n foreach ($leagueData as $page) {\n if (!isset($page['standings']['results'])) {\n return [];\n }\n foreach ($page['standings']['results'] as $index => $team) {\n // Get current gameweek\n if (!$currentEvent) {\n $eventTeam = $this->getTeamData($team['entry']);\n $currentEvent = $eventTeam['current_event'];\n }\n $teams[$team['entry']] = [\n 'entry' => $team['entry'],\n 'team_name' => $team['entry_name'],\n 'league' => $leagueId,\n 'player_name' => $team['player_name'],\n 'total' => $team['total'],\n 'is_last' => !$page['standings']['has_next'] && $index == (count($page['standings']['results'])-1),\n 'url' => \"https://fantasy.premierleague.com/api/entry/{$team['entry']}/event/$currentEvent/picks/\",\n 'last_rank' => $team['last_rank'],\n 'real_event_total' => 0,\n 'event_total' => $team['event_total'],\n 'real_total' => $team['total'] - $team['event_total'],\n 'expanded' => false,\n ];\n }\n }\n\n // Perform fetch of gameweek data for each team in chosen league\n $gameweekTeamData = $this->getGameweekDataForTeamsInLeague($teams);\n // Perform fetch of live gameweek information about player points and fixtures\n $gameweekPointsData = $this->curl->get(\"https://fantasy.premierleague.com/api/fixtures/?event=$currentEvent\", true);\n $gameweekLiveData = $this->curl->get(\"https://fantasy.premierleague.com/api/event/$currentEvent/live/\", true);\n // Perform fetch of gameweek fixture schedule data\n $gameweekFixturesData = $this->getFixtureData($gameweekPointsData);\n // Perform fetch of gameweek bonus points\n $gameweekBonusPoints = $this->getBonusPointsData($gameweekPointsData);\n // Perform fetch of gameweek transfers made by each team in chosen league\n $gameweekTransfersData = $this->getTransfersData($teams, $currentEvent);\n\n // Loop through each team's player picks\n foreach ($gameweekTeamData as $teamId => $team) {\n $picks = $team['picks'];\n $playingPositions = [];\n $autoSubbableOut = [];\n $autoSubbableIn = [];\n // Add some additional data about each player in currently iterated team\n foreach ($picks as $playerNumber => $player) {\n $id = $player['element'];\n $benched = $playerNumber > 10 && $team['active_chip'] != 'bboost';\n // Set multiplier to 1 for benched players with multiplier 0\n $realMultiplier = $player['multiplier'] == 0 ? 1 : $player['multiplier'];\n $picks[$playerNumber] = [\n 'id' => $id,\n 'firstName' => $this->playerData[$id]['first_name'],\n 'secondName' => $this->playerData[$id]['second_name'],\n 'name' => $this->playerData[$id]['web_name'],\n 'fullName' => $this->playerData[$id]['first_name'] . ' ' . $this->playerData[$id]['second_name'],\n 'cost' => $this->playerData[$id]['cost'],\n 'position' => $this->playerData[$id]['position'],\n 'multiplier' => $player['multiplier'],\n 'tripleCaptain' => $player['multiplier'] == 3,\n 'captain' => $player['is_captain'],\n 'viceCaptain' => $player['is_vice_captain'],\n 'availability' => $this->playerData[$id]['availability'],\n 'availability_text' => $this->playerData[$id]['availability_text'],\n 'points' => 0,\n 'bonus' => 0,\n 'bonus_provisional' => false,\n 'transferred_in_for' => false,\n 'benched' => $benched,\n 'breakdown' => $this->getLivePointsDataForPlayers($gameweekLiveData['elements'], $id, $currentEvent),\n 'fixtures' => $gameweekFixturesData[$this->playerData[$id]['team']] ?? [],\n ];\n\n // Insert who this player was transferred in for if he was transferred in this gameweek\n if (isset($gameweekTransfersData[$teamId])) {\n foreach ($gameweekTransfersData[$teamId] as $teamTransfers) {\n foreach ($teamTransfers as $in => $out) {\n if ($id == $in) {\n $picks[$playerNumber]['transferred_in_for'] = $this->playerData[$out]['web_name'];\n }\n }\n }\n }\n\n $pos = $picks[$playerNumber]['position'];\n if (!$benched) {\n $playingPositions[$pos] = isset($playingPositions[$pos]) ? $playingPositions[$pos]+1 : 1;\n }\n\n list($eligibleAutoSubOut, $eligibleAutoSubIn) = $this->getAutoSubStatus($picks[$playerNumber]);\n if ($eligibleAutoSubOut) {\n $autoSubbableOut[$playerNumber] = $pos;\n }\n if ($eligibleAutoSubIn) {\n $autoSubbableIn[$playerNumber] = $pos;\n }\n\n // Determine this player's current points, doubled or tripled if captained or triple captained\n // Add these points to team's and individual tally\n $playerPoints = $picks[$playerNumber]['breakdown']['stats']['total_points'] * $realMultiplier;\n if (!$benched) {\n $gameweekTeamData[$teamId]['real_event_total'] += $playerPoints;\n }\n $picks[$playerNumber]['points'] = $playerPoints;\n\n // No bonus points for this player, carry on\n if (!isset($gameweekBonusPoints[$id])) {\n continue;\n }\n\n // Add bonus points\n $picks[$playerNumber]['bonus'] = $gameweekBonusPoints[$id]['points'];\n $picks[$playerNumber]['bonus_provisional'] = false;\n\n // These bonus points are confirmed, no need to add to team and individual tally\n if ($gameweekBonusPoints[$id]['confirmed']) {\n continue;\n }\n\n $playerBonusPoints = $gameweekBonusPoints[$id]['points'] * $realMultiplier;\n // Update status to reflect that bonus points are unconfirmed\n $picks[$playerNumber]['bonus_provisional'] = true;\n // Add this player's current bonus points to team's and individual tally\n $gameweekTeamData[$teamId]['real_event_total'] += !$benched ? $playerBonusPoints : 0;\n $picks[$playerNumber]['points'] += $playerBonusPoints;\n }\n\n $gameweekTeamData[$teamId]['playing_positions'] = $playingPositions;\n $gameweekTeamData[$teamId]['autosubbable_out'] = $autoSubbableOut;\n $gameweekTeamData[$teamId]['autosubbable_in'] = $autoSubbableIn;\n\n $gameweekTeamData[$teamId]['real_total'] = $gameweekTeamData[$teamId]['real_total'] + $gameweekTeamData[$teamId]['real_event_total'];\n $gameweekTeamData[$teamId]['picks'] = $picks;\n if (!empty($autoSubbableOut) && !empty($autoSubbableIn)) {\n $this->performAutoSubs($gameweekTeamData[$teamId]);\n }\n }\n\n return array_values($gameweekTeamData);\n }", "function insertTeams() {\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api/v1/teams\";\n\n $jsonString = file_get_contents($url);\n $jsonObject = json_decode($jsonString);\n\n $sql = \"INSERT INTO teams VALUES \";\n for($i = 0; $i < sizeof($jsonObject->teams); $i++) {\n $sql .= \"(\".$jsonObject->teams[$i]->id.\", '\".$jsonObject->teams[$i]->name.\"', '\".$jsonObject->teams[$i]->abbreviation.\"', '\".$jsonObject->teams[$i]->locationName.\"', '\".$jsonObject->teams[$i]->conference->name.\"', '\".$jsonObject->teams[$i]->division->name.\"'),\";\n }\n $sql = substr($sql, 0, -1).\";\";\n\n $conn -> query($sql);\n }", "function viewTeamStatistics() {\n global $user;\n $params = drupal_get_query_parameters();\n $UID = $user->uid;\n\n if (isset($params['TID'])){\n $TID = $params['TID'];\n $team = dbGetTeam($TID);\n $teamNumber = $team['number'];\n } else {\n $currentTeam = getCurrentTeam();\n $TID = $currentTeam['TID'];\n $teamNumber = $currentTeam['number'];\n }\n\n // checks if team has permission to acces page\n if (teamIsIneligible($TID)) {\n drupal_set_message('Your team does not have permission to access this page.', 'error');\n drupal_goto($_SERVER['HTTP_REFERER']);\n }\n \n $markup = \"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.js\\\"></script>\";\n $markup .= '<script src=\"numberCounting.js\"></script>';\n // create table and header\n $markup .= '<table id=\"teamStats\"><tr><td colspan=\"2\" style=\"text-align:center\">';\n \n $markup .= '<div class=\"help tooltip1\">';\n $markup .= '<h2><b>Team Stats</b></h2>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext1\">';\n $markup .= 'These are the total numbers of hours and outreaches your team has inputted into CROMA.';\n $markup .= '</span></div>';\n $markup .= '</td></tr>';\n\n // links to all team outreach page\n $markup .= '<tr><td style=\"text-align:center\"><a href=\"?q=outreach&allTeamOutreach\"><b>HOURS</b></a></td>';\n $markup .= '<td style=\"text-align:center\"><a href=\"?q=outreach&allTeamOutreach\"><b>OUTREACHES</b></a></td></tr>';\n $markup .= '<tr style=\"font-size:48pt; font-family: \"Open Sans\", sans-serif;\"><td style=\"text-align:center\"><b class=\"countUp\">' . dbGetHoursForTeam($TID) . '</a></b></td>';\n $markup .= '<td style=\"text-align:center\"><b class=\"countUp\">' . dbGetNumOutreachForTeam($TID);\n $markup .= '</b></td></tr></table>';\n\n return array('#markup' => $markup);\n}", "function updateTeams($players, $json) {\n\n\tunset($teams);\n\t$teams = array( 'won' => array(), 'lost' => array() );\n\tforeach ($players as $player) {\n\t\tif ($player['state'] == 'Won') {\n\t\t\tarray_push($teams['won'], $player['id']);\n\t\t} else {\n\t\t\tarray_push($teams['lost'], $player['id']);\n\t\t}\n\t}\n\t\n\t//updateWinnerTeam($teams['won']);\n\tunset($jsonteam);\n\tforeach ($json['teams'] as &$jsonteam) {\n\t\t$foundteam = 0;\n\t\t\n\t\tforeach ($jsonteam['players'] as $jsonplayer) {\n\t\t\tforeach ($teams['won'] as $thisplayer) {\n\t\t\t\tif ($jsonplayer['token'] == $thisplayer) $foundteam++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($foundteam == 3) {\n\t\t\techo 'updating team with win<br>';\n\t\t\t$jsonteam['wins']++;\n\t\t\t$jsonteam['rating']++;\n\t\t\t//$jsonteam['pendinggames']--;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t//updateLosingTeam($teams['lost']);\n\tunset($jsonteam);\n\tforeach ($json['teams'] as &$jsonteam) {\n\t\t$foundteam = 0;\n\t\t\n\t\tforeach ($jsonteam['players'] as $jsonplayer) {\n\t\t\tforeach ($teams['lost'] as $thisplayer) {\n\t\t\t\tif ($jsonplayer['token'] == $thisplayer) $foundteam++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($foundteam == 3) {\n\t\t\techo 'updating team with win<br>';\n\t\t\t$jsonteam['losses']++;\n\t\t\t$jsonteam['rating']--;\n\t\t\t//$jsonteam['pendinggames']--;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn true;\n}", "public function index()\n {\n // ******** Page title ********\n $pageTitle = \"Équipes\";\n $team = new Team;\n // ******** Get current season ********\n $currentSeason = $team->getCurrentSeason();\n // ******** Get all teams form current season ********\n $teams = $team->getTeamsFromCurrentSeason($currentSeason);\n\n return view('team/index', compact('pageTitle', 'teams', 'currentSeason'));\n }", "public function getMatches(string $league, int $season = null)\n {\n $season = $season ?? date('Y');\n\n return Cache::remember('season_matches_'.$league.'_'.$season, $this->cacheTime, function () use ($league, $season) {\n $response = $this->client->request('GET', 'getmatchdata/'.$league.'/'.$season);\n\n return collect(\n json_decode(\n (string) $response->getBody()\n )\n )->transform(function ($item, $key) {\n return [\n 'id' => $item->MatchID,\n 'date' => new Carbon($item->MatchDateTimeUTC, 'UTC'),\n 'team1' => $item->Team1,\n 'team2' => $item->Team2,\n 'isFinished' => (bool) $item->MatchIsFinished,\n 'results' => collect($item->MatchResults),\n 'goals' => $item->Goals,\n 'location' => $item->Location,\n ];\n });\n });\n }", "public function teams_view()\n {\n $user = \\Auth::user();\n $is_referee = \\App\\Referee::where('user_id', $user->id)->first();\n $is_admin = \\App\\Admin::where('user_id', $user->id)->first();\n\n $venue = false;\n $teams = false;\n \n if($is_referee)\n {\n $venue = \\App\\Venue::find($is_referee->venue_id);\n } else if($is_admin) {\n $venue = \\App\\Venue::find($is_admin->venue_id);\n }\n\n if($venue and $is_admin)\n {\n $teams = \\App\\Team::where('venue_id', $is_admin->venue_id)->orderBy('name')->paginate(15);\n } else if($venue and $is_referee) {\n $teams = \\App\\Team::where('venue_id', $is_referee->venue_id)->orderBy('name')->paginate(15);\n } else {\n return abort(404);\n }\n\n return view('admin_users.teams_view', ['teams' => $teams]);\n }", "public function get_teams($round_ids = null, $competition_ids = null)\n\t\t{\n\t\t\t$output = file_get_contents($this->api_url.\"/teams?api_key=\".$this->api_key);\n\t\t\treturn json_decode($output);\n\t\t}", "public function get_teams($sportFK,$tsid)\n\t{\n\t\t$this->db->select('e.id,ep.id as epid,p.id as pid,p.name as pname');\n\t\t$this->db->from('tournament_template as tt');\n\t\t$this->db->join('tournament AS t', 't.tournament_templateFK = tt.id', 'INNER');\n\t\t$this->db->join('tournament_stage AS ts', 't.id = ts.tournamentFK', 'INNER');\n\t\t$this->db->join('event AS e', 'ts.id = e.tournament_stageFK', 'INNER');\n\t\t$this->db->join('event_participants AS ep', 'e.id = ep.eventFK', 'INNER');\n\t\t$this->db->join('participant AS p', 'ep.participantFK = p.id', 'left');\n\t\t$this->db->WHERE(\"tt.sportFK =\".$sportFK.\"\");\n\t\t$this->db->WHERE(\"ts.id = $tsid \");\n\t\t//$this->db->WHERE(\"e.startdate > '\".$this->today.\"' \");\n\t\t$this->db->group_by('ep.participantFK');\n\t\t$this->db->order_by(\"e.startdate,e.id,ts.id\");\n\t\t$result = $this->db->get();\n\t\treturn $result->result();\n\t}", "function playTournament(){\n $teams = getTeams();\n $playin = getPlayinTeams();\n $teams[25] = compete2($playin[0],$playin[1]);\n $teams[17] = compete2($playin[2],$playin[3]);\n $teams[9] = compete2($playin[4],$playin[5]);\n $teams[1] = compete2($playin[6],$playin[7]);\n while(count($teams)>1){\n $newteams = array();\n for($i=0;$i<count($teams);$i+=2){\n $newteams[] = compete2($teams[$i],$teams[$i+1]);\n }\n $teams = $newteams;\n }\n return $teams[0]['name'];\n}", "function next_games($championship,$num){\n\t\t$query=$this->db->query('Select m.*, t1.name as t1name,t2.name as t2name, UNIX_TIMESTAMP(m.date_match) as dm \n\t\t\t\t\t\t \t\t From matches as m, matches_teams as mt, teams as t1, teams as t2, groups as g, rounds as r, championships as c \n\t\t\t\t\t\t \t\t Where c.id='.$championship.' AND c.id=r.championship_id AND r.id=g.round_id AND g.id=m.group_id AND m.id=mt.match_id AND mt.team_id_home=t1.id AND mt.team_id_away=t2.id AND m.state=0 AND m.date_match > \"'.mdate(\"%Y-%m-%d 00:00:00\").'\"\n\t\t\t\t\t\t \t\t Order by date_match ASC\n\t\t\t\t\t\t \t\t Limit 0,'.$num);\n\t\t\n\t\t$partido=array();\n\t\t$i=0;\n\t\tforeach($query->result() as $row):\n\t\t\t$partido[$i]['id']=$row->id;\n\t\t\t$partido[$i]['fecha']=mdate(\"%Y/%m/%d\",$row->dm);\n\t\t\t$partido[$i]['hora']=mdate(\"%h:%i\",$row->dm);\n\t\t\t$partido[$i]['hequipo']=$row->t1name;\n\t\t\t$partido[$i]['aequipo']=$row->t2name;\n\t\t\t$i+=1;\n\t\tendforeach;\n\t\t\n\t\treturn $partido;\n\t}", "public function testTeamsIndex()\n {\n $response = $this->get('/teams');\n $response->assertStatus(200);\n }" ]
[ "0.7644486", "0.70751536", "0.67354023", "0.66878366", "0.64946383", "0.637977", "0.6371251", "0.63671374", "0.6346919", "0.63450265", "0.6328256", "0.6295237", "0.61552304", "0.60882163", "0.6080508", "0.6077736", "0.6074801", "0.60459584", "0.6023377", "0.59755325", "0.59681964", "0.59582", "0.59443873", "0.59405184", "0.59189963", "0.58873975", "0.5876617", "0.58371025", "0.58320916", "0.5828421", "0.5825873", "0.58245206", "0.58145565", "0.5793561", "0.5748545", "0.5747095", "0.57163066", "0.56810445", "0.5676549", "0.5672225", "0.56720316", "0.5664277", "0.565384", "0.5650099", "0.564417", "0.5638", "0.5616602", "0.56135225", "0.5600542", "0.5589997", "0.55832946", "0.5581085", "0.55763316", "0.557309", "0.55567384", "0.55417687", "0.553622", "0.55343825", "0.5532462", "0.5529441", "0.5519416", "0.5518919", "0.550845", "0.55077153", "0.5507285", "0.550204", "0.55018", "0.5475614", "0.54752654", "0.54697174", "0.5450125", "0.54496956", "0.54476017", "0.54342055", "0.5431377", "0.5428214", "0.5427529", "0.5423029", "0.5421946", "0.5417142", "0.5416396", "0.54136425", "0.5407189", "0.5401209", "0.53983814", "0.53932863", "0.5388827", "0.5387484", "0.5381848", "0.5379055", "0.5369094", "0.535473", "0.53516734", "0.53323084", "0.5331011", "0.53153825", "0.53145605", "0.531434", "0.5312143", "0.53108853" ]
0.81306845
0
LeagueSeasonPlayersResults Je i v /cfg/eden_league.php Zobrazeni vysledku hracu v sezone
function LeagueSeasonPlayersResults(){ global $db_admin,$db_admin_contact,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_players; global $db_country,$db_league_seasons_rounds,$db_league_players,$db_league_awards; global $eden_cfg; global $url_flags,$url_league_awards; $result = ""; $result .= "<table style=\"width:500px;\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; $result .= " <tr>"; $result .= " <td class=\"eden_title\" style=\"width:40px;\">"._LEAGUE_SEASON_ROUND_POSITION."</td>"; $result .= " <td class=\"eden_title\" style=\"width:60px;\">"._LEAGUE_SEASON_ROUND_POINTS."</td>"; $result .= " <td class=\"eden_title\">"._CMN_COUNTRY."</td>"; $result .= " <td class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>"; $result .= " <td class=\"eden_title\">"._LEAGUE_GUID."</td>"; $result .= " <td class=\"eden_title\">"._LEAGUE_TEAM."</td>"; $result .= " </tr>"; $res_results_players = mysql_query(" SELECT lsrp.league_season_result_player_player_id, a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, lsrp.league_season_result_player_points, c.country_shortname, c.country_name, agid.admin_guid_guid FROM $db_league_seasons_results_players AS lsrp JOIN $db_league_players AS lp ON lp.league_player_id = lsrp.league_season_result_player_player_id JOIN $db_admin AS a ON a.admin_id = lp.league_player_admin_id JOIN $db_admin_contact AS ac ON ac.aid = a.admin_id JOIN $db_admin_guids AS agid ON agid.aid = a.admin_id AND agid.admin_guid_game_id = lp.league_player_game_id JOIN $db_league_teams AS lt ON lt.league_team_id = lp.league_player_team_id JOIN $db_country AS c ON c.country_id = ac.admin_contact_country WHERE lsrp.league_season_result_player_season_id = ".(integer)$_GET['sid']." ORDER BY lsrp.league_season_result_player_points DESC LIMIT 10") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $i = 1; while ($ar_results_players = mysql_fetch_array($res_results_players)){ // Call function $ar_award = LeagueCheckAwards(1,(integer)$_GET['sid'],(integer)$ar_results_players['league_season_result_player_player_id'],0); if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} $result .= "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; $result .= " <td align=\"right\" valign=\"top\">"; if($ar_award['league_award_place']){$result .= "<img src=\"".$url_league_awards.$ar_award['league_award_img']."\" alt=\"".stripslashes($ar_award['league_award_name'])."\" title=\"".stripslashes($ar_award['league_award_name'])."\" />";} else {$result .= "<strong>".$i."</strong>";} $result .= "</td>"; $result .= " <td align=\"left\" valign=\"top\">".$ar_results_players['league_season_result_player_points']."</td>"; $result .= " <td valign=\"top\"><img src=\"".$url_flags.$ar_results_players['country_shortname'].".gif\" alt=\"".stripslashes($ar_results_players['country_name'])."\" title=\"".stripslashes($ar_results_players['country_name'])."\" /></td>"; $result .= " <td valign=\"top\"><a href=\"".$eden_cfg['url']."index.php?action=player&amp;mode=player_acc&amp;id=".$ar_results_players['admin_id']."&amp;lang=".$_GET['lang']."&amp;filter=".$_GET['filter']."\" target=\"_self\">".stripslashes($ar_results_players['admin_nick'])."</a></td>"; $result .= " <td valign=\"top\">".$ar_results_players['admin_guid_guid']."</td>"; $result .= " <td valign=\"top\"><a href=\"".$eden_cfg['url']."index.php?action=league_team&amp;mode=team_home&amp;ltid=".$ar_results_players['league_team_id']."&amp;lang=".$_GET['lang']."&amp;filter=".$_GET['filter']."\" target=\"_self\">".stripslashes($ar_results_players['league_team_name'])."</a></td>"; $result .= "</tr>"; $i++; } $result .= " <tr>\n"; $result .= " <td colspan=\"5\"><br /><form action=\"sys_save.php?action=league_awards_give_to_players&sid=".$_GET['sid']."\" method=\"post\" name=\"form1\" enctype=\"multipart/form-data\">\n"; $result .= " <input type=\"hidden\" name=\"sid\" value=\"".$_GET['sid']."\">\n"; $result .= " <input type=\"hidden\" name=\"confirm\" value=\"true\">\n"; $result .= " <input type=\"hidden\" name=\"project\" value=\"".$_SESSION['project']."\">\n"; $result .= " <input type=\"submit\" value=\""._LEAGUE_AWARD_SUBMIT_PLAYER."\" class=\"eden_button\">\n"; $result .= " </form>\n"; $result .= " </td>\n"; $result .= " </tr>\n"; $result .= "</table>\n"; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LeagueSeasonTeamsResults(){\n\t\n\tglobal $db_league_leagues,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_teams,$db_league_awards;\n\tglobal $db_country,$db_league_seasons_rounds;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\t$result .= \"<table style=\\\"width:400px;\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\t$result .= \"\t<tr>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:40px;\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:60px;text-align:center;\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:50px;\\\">\"._CMN_COUNTRY.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t$result .= \"\t</tr>\\n\";\n \t$res_results_teams = mysql_query(\"\n\tSELECT lt.league_team_id, lt.league_team_name, lsrt.league_season_result_team_team_sub_id, lsrt.league_season_result_team_points, c.country_shortname, c.country_name, ls.league_season_end \n\tFROM $db_league_seasons_results_teams AS lsrt \n\tJOIN $db_league_teams AS lt ON lt.league_team_id = lsrt.league_season_result_team_team_id \n\tJOIN $db_country AS c ON c.country_id = lt.league_team_country_id \n\tJOIN $db_league_seasons AS ls ON ls.league_season_id = \".(integer)$_GET['sid'].\" \n\tWHERE lsrt.league_season_result_team_season_id = \".(integer)$_GET['sid'].\" \n\tORDER BY lsrt.league_season_result_team_points DESC LIMIT 10\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$i = 1;\n\twhile ($ar_results_teams = mysql_fetch_array($res_results_teams)){\n\t\t// Call function\n\t\t$ar_award = LeagueCheckAwards(2,(integer)$_GET['sid'],0,(integer)$ar_results_teams['league_season_result_team_team_sub_id']);\n\t\t\n\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t$result .= \"\t<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t$result .= \"\t\t<td align=\\\"right\\\" valign=\\\"top\\\">\"; if($ar_award['league_award_place']){$result .= \"<img src=\\\"\".$url_league_awards.$ar_award['league_award_img'].\"\\\" alt=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" title=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" />\";} else { $result .= \"<strong>\".$i.\"</strong>\";} $result .= \"</td>\\n\";\n\t\t$result .= \"\t\t<td valign=\\\"top\\\" align=\\\"right\\\">\".$ar_results_teams['league_season_result_team_points'].\"</td>\\n\";\n\t\t$result .= \"\t\t<td valign=\\\"top\\\" align=\\\"center\\\"><img src=\\\"\".$url_flags.$ar_results_teams['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_results_teams['country_name']).\"\\\" title=\\\"\".stripslashes($ar_results_teams['country_name']).\"\\\" /></td>\\n\";\n\t \t$result .= \"\t\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=league_team&mode=team_home&ltid=\".$ar_results_teams['league_team_id'].\"&lang=\".$_GET['lang'].\"&filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_teams['league_team_name']).\"</a></td>\\n\";\n\t\t$result .= \"\t</tr>\\n\";\n\t\t$i++;\n\t}\n\t// Show button for setting awards only if season is over\n\tif ($ar_results_teams['league_season_end'] < date(\"Y-m-d H:i:s\")){\n\t\t$result .= \"\t<tr>\\n\";\n\t\t$result .= \"\t\t<td colspan=\\\"5\\\"><br /><form action=\\\"sys_save.php?action=league_awards_give_to_teams&sid=\".$_GET['sid'].\"\\\" method=\\\"post\\\" name=\\\"form1\\\" enctype=\\\"multipart/form-data\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$_GET['sid'].\"\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_AWARD_SUBMIT_TEAM.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t\t$result .= \"\t\t</form>\\n\";\n\t\t$result .= \"\t\t</td>\\n\";\n\t\t$result .= \"\t</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\t\n\treturn $result;\n}", "function SeasonResults($sid = 0,$mode = \"p\"){\n\t\n\tglobal $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players;\n\tglobal $db_admin,$db_league_seasons_rounds_results_players,$db_league_teams;\n\t\n\t$res_rounds = mysql_query(\"SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id \n\tFROM $db_league_seasons_rounds_results_players AS lsrrp \n\tJOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=\".(float)$rid.\" \n\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\tWHERE lsrrp.league_season_round_result_player_round_id=\".(float)$rid.\" \n\tORDER BY lsrrp.league_season_round_result_player_place ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\n\tswitch ($mode){\n\t\tcase \"p\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t\t$guid = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_GUID.\"</td>\\n\";\n\t\t\t$table_width = \"600\";\n\t\t\t\n\t\t\techo Menu();\n\t\t\t\n\t\tbreak;\n\t\tcase \"t\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\";\n\t\t\t$guid = \"\";\n\t\t\t$table_width = \"400\";\n\t\tbreak;\n\t\tdefault:\n\t\t\techo \"\";\n\t}\n\t$ar_round = mysql_fetch_array($res_round);\n\t$league_name = stripslashes($ar_round['league_league_name']);\n\t$season_id = $ar_round['league_season_round_season_id'];\n\t$season_name = stripslashes($ar_round['league_season_name']);\n\t$round_num = $ar_round['league_season_round_num'];\n\t\n\techo \"<table width=\\\"\".$table_wifth.\"\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\techo \"\t<tr>\\n\";\n\techo \"\t\t<td colspan=\\\"3\\\" align=\\\"left\\\">\";\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<h5 style=\\\"margin:20px 0px 0px 0px;\\\">\".$league_name.\" > <a href=\\\"modul_league.php?action=rounds&sid=\".$season_id.\"&project=\".$_SESSION['project'].\"\\\" target=\\\"_self\\\">\".$season_name.\"</a> > \"._LEAGUE_SEASON_ROUND.\" \".$round_num.\"</h5>\";}\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<form action=\\\"sys_save.php?action=results_add&rid=\".$rid.\"sid=\".$season_id.\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\">\";}\n\techo \"\t\t</td>\\n\";\n\techo \"\t</tr>\\n\";\n\techo \"\t<tr style=\\\"background-color:#dce3f1;\\\">\\n\";\n\techo \"\t\t<td width=\\\"50\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_POSITION.\"</td>\\n\";\n\techo \"\t\t<td align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_POINTS.\"</td>\\n\";\n\techo $nick;\n\techo $guid;\n\techo \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\techo \"\t</tr>\\n\";\n\tswitch ($mode){\n\t\tcase \"p\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tcase \"t\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t \t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['admin_nick'].\"</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\".$ar_rounds['league_season_round_allowed_player_guid'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tdefault;\n\t\t\techo \"\";\n\t}\n\techo \"</table>\\n\";\n}", "function AddResults($rid){\n\t\n\tglobal $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players;\n\tglobal $db_admin,$db_admin_contact,$db_country,$db_league_seasons_rounds_results_players,$db_league_teams;\n\tglobal $url_flags;\n\t\n \t// CHECK PRIVILEGIES\n\tif ($_GET['action'] == \"results_add\" || $_GET['action'] == \"results_show\"){\n\t\tif (CheckPriv(\"groups_league_season_add\") <> 1) { echo _NOTENOUGHPRIV;exit;}\n\t} else {\n\t\techo _NOTENOUGHPRIV;exit;\n\t}\n\t\n\t$res_rounds = mysql_query(\"SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id, c.country_shortname,c.country_name \n\tFROM $db_league_seasons_rounds_results_players AS lsrrp \n\tJOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=\".(float)$rid.\" \n\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\tLEFT JOIN $db_admin_contact AS ac ON ac.aid=a.admin_id \n\tLEFT JOIN $db_country AS c ON c.country_id=ac.admin_contact_country \n\tWHERE lsrrp.league_season_round_result_player_round_id=\".(float)$rid.\" \n\tORDER BY lsrrp.league_season_round_result_player_place ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\";\n\t\t\t$team = \"\";\n\t\t\t$table_width = \"857\";\n\t\t\t\n\t\t\techo Menu();\n\t\t\t\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$flag = \"\t\t<td width=\\\"20\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._CMN_COUNTRY.\"</td>\\n\";\n\t\t\t$nick = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t\t$team = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\t$table_width = \"600\";\n\t\tbreak;\n\t\tdefault:\n\t\t\techo \"\";\n\t}\n\t$ar_round = mysql_fetch_array($res_round);\n\t$league_name = stripslashes($ar_round['league_league_name']);\n\t$season_id = $ar_round['league_season_round_season_id'];\n\t$season_name = stripslashes($ar_round['league_season_name']);\n\t$round_num = $ar_round['league_season_round_num'];\n\t\n\techo \"<table width=\\\"\".$table_width.\"\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\techo \"\t<tr>\\n\";\n\techo \"\t\t<td colspan=\\\"3\\\" align=\\\"left\\\">\";\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<h5 style=\\\"margin:20px 0px 0px 0px;\\\">\".$league_name.\" > <a href=\\\"modul_league.php?action=rounds&sid=\".$season_id.\"&project=\".$_SESSION['project'].\"\\\" target=\\\"_self\\\">\".$season_name.\"</a> > \"._LEAGUE_SEASON_ROUND.\" \".$round_num.\"</h5>\";}\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<form action=\\\"sys_save.php?action=results_add&rid=\".$rid.\"sid=\".$season_id.\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\">\";}\n\techo \"\t\t</td>\\n\";\n\techo \"\t</tr>\\n\";\n\techo \"\t<tr style=\\\"background-color:#dce3f1;\\\">\\n\";\n\techo \"\t\t<td width=\\\"50\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\\n\";\n\techo \"\t\t<td align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\\n\";\n\techo $flag;\n\techo $nick;\n\techo \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_GUID.\"</td>\\n\";\n\techo $team;\n\techo \"\t</tr>\\n\";\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_round['league_season_round_classified'] >= $i){\n\t\t\t\t$ar_rounds = mysql_fetch_array($res_rounds);\n\t\t\t\tif ($ar_rounds['league_season_round_result_player_player_id']){ $guid = $ar_rounds['league_season_round_allowed_player_guid'].\" (PID \".$ar_rounds['league_season_round_result_player_player_id'].\")\";} else {$guid =\"\";}\n\t\t\t\techo \"<tr align=\\\"left\\\" valign=\\\"top\\\" onmouseover=\\\"this.style.backgroundColor='FFDEDF'\\\" onmouseout=\\\"this.style.backgroundColor='FFFFFF'\\\" style=\\\"background-color: #FFFFFF;\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_num\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_data[\".$i.\"_place]\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t\".$i.\"\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input name=\\\"round_player_data[\".$i.\"_points]\\\" size=\\\"5\\\" value=\\\"\".$ar_rounds['league_season_round_result_player_points'].\"\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"text\\\" name=\\\"round_player_data[\".$i.\"_player_guid]\\\" size=\\\"25\\\" value=\\\"\".$guid.\"\\\" autocomplete=\\\"off\\\" onkeyup=\\\"ajax_showOptions(this,'getAllowedPlayerGuidByLetters=1&rid=\".$rid.\"&project=\".$_SESSION['project'].\"',event)\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\techo \"\t<tr align=\\\"left\\\" valign=\\\"top\\\">\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" colspan=\\\"3\\\"><br />\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"round\\\" value=\\\"\".$round_num.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"rid\\\" value=\\\"\".$rid.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$season_id.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_SEASON_ROUND_RESULTS_SAVE.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t\t \tif ($ar_rounds){echo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"results_mode\\\" value=\\\"edit\\\">\\n\";}\n\t\t\techo \"\t\t\t</form>\\n\";\n\t\t\techo \"\t\t</td>\\n\";\n\t\t\techo \"\t</tr>\\n\";\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\techo \"\t<tr \"; if ($i % 2 == 0){echo \"class=\\\"suda\\\"\";} else {echo \"class=\\\"licha\\\"\";} echo \">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t \t\t\techo \"\t<td valign=\\\"top\\\"><img src=\\\"\".$url_flags.$ar_rounds['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" title=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" /></td>\";\n\t \t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['admin_nick'].\"</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\".$ar_rounds['league_season_round_allowed_player_guid'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tdefault;\n\t\t\techo \"\";\n\t}\n\techo \"</table>\\n\";\n}", "function crawl_games_per_season($param_season, $param_gameType, $param_team) {\n\t\n\t$base_link = 'http://www.nhl.com/ice/schedulebyseason.htm';\n\t\t\n\t$html_games = file_get_html(\"$base_link?season=$param_season&gameType=$param_gameType&team=$param_team\");\n\t\n\tif(!$html_games) {\n\t\techo 'GET HTML FALSE <br>';\n\t}\n\t\n\t$games_list = array();\n\t\n\t\n\tforeach($html_games->find('table[class=data schedTbl] tbody tr') as $match) {\n\t\t\n\t\t//Don't take into account where column is less than 6, filtering out header and blank rows.\n\t\tif(count($match->find('td')) == 6) {\n\t\t\t\n\t\t\t //Need to check if it's the FINAL result by checking if it starts with 'FINAL:'.\n\t\t\t //Additionally read out teams involved, determine winner/loser, and if there has been overtime.\n\t\t\t \n\t\t\t $item_result = $match->find('td.tvInfo', 0)->plaintext;\n\t\t\t $item_result_split = explode(' ', $item_result);\n\t\t\t \n\t\t\t \n\t\t\t if($item_result_split[1] == 'FINAL:') {\n\t\t\t \t\n\t\t\t\t$item['final'] = $item_result_split[1];\n\t\t\t\t$item['visiting_team'] = $item_result_split[3];\n\t\t\t\t$item['visiting_team_score'] = trim($item_result_split[4], '()');\n\t\t\t\t$item['home_team'] = $item_result_split[8];\n\t\t\t\t$item['home_team_score'] = trim($item_result_split[9], '()');\n\t\t\t\t$item['overtime'] = $item_result_split[10];\n\t\t\t\t \n\t\t\t\t$item_date = $match->find('td.date .skedStartDateSite', 0)->plaintext;\n\t\t\t\t$item['date'] = date(\"Y-m-d\", strtotime($item_date));\n\t\t\t\t \n\t\t\t\t//No need for retrieve teams directly, because we need to analyze result string above, and retrieve more information.\n\t\t\t\t//$item['visiting_team'] = $match->find('td.team', 0)->plaintext;\n\t\t\t\t//$item['home_team'] = $match->find('td.team', 1)->plaintext;\n\t\t\t\t \n\t\t\t\t//Read out the link to the \"Recap\" article.\n\t\t\t\t$item['recap'] = $match->find('td.skedLinks a', 0)->href;\n\t\t\t\t \n\t\t\t\t$games_list[] = $item;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t}\n\t\n\treturn $games_list;\n\n}", "function display_player_stats($res) {\n\n echo '<br><div class=\"stat-sheet\"><h3>Regular Season Stats</h3><br>';\n\n // Table header:\n echo '<table class=\"player-tbl\" cellspacing=\"5\" cellpadding=\"5\"\n width=\"75%\">\n\t<tr class=\"player-stat-heading\">\n\t\t<td align=\"left\"><b>Year</b></td>\n\t\t<td align=\"left\"><b>Team</b></td>\n\t\t<td align=\"left\"><b>Lg</b></td>\n\t\t<td align=\"left\"><b>G</b></td>\n\t\t<td align=\"left\"><b>Min</b></td>\n\t\t<td align=\"left\"><b>Pts</b></td>\n\t\t<td align=\"left\"><b>PPG</b></td>\n\t\t<td align=\"left\"><b>FGM</b></td>\n\t\t<td align=\"left\"><b>FGA</b></td>\n\t\t<td align=\"left\"><b>FGP</b></td>\n\t\t<td align=\"left\"><b>FTM</b></td>\n\t\t<td align=\"left\"><b>FTA</b></td>\n\t\t<td align=\"left\"><b>FTP</b></td>\n\t\t<td align=\"left\"><b>3PM</b></td>\n\t\t<td align=\"left\"><b>3PA</b></td>\n\t\t<td align=\"left\"><b>3PP</b></td>\n\t\t<td align=\"left\"><b>ORB</b></td>\n\t\t<td align=\"left\"><b>DRB</b></td>\n\t\t<td align=\"left\"><b>TRB</b></td>\n\t\t<td align=\"left\"><b>RPG</b></td>\n\t\t<td align=\"left\"><b>AST</b></td>\n\t\t<td align=\"left\"><b>APG</b></td>\n\t\t<td align=\"left\"><b>STL</b></td>\n\t\t<td align=\"left\"><b>BLK</b></td>\n\t\t<td align=\"left\"><b>TO</b></td>\n\t\t<td align=\"left\"><b>PF</b></td>\n\t</tr>\n';\n\n // Fetch and print all the records:\n while ($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) {\n echo '<tr class=\"player-stat\">\n\t\t\t<td align=\"left\">' . $row['year'] . '</td>\n\t\t\t<td align=\"left\">' . $row['team'] . '</td>\n\t\t\t<td align=\"left\">' . $row['lg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['g'] . '</td>\n\t\t\t<td align=\"left\">' . $row['min'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pts'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ppg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fga'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fta'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpa'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['orb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['drb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['trb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['rpg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ast'] . '</td>\n\t\t\t<td align=\"left\">' . $row['apg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['stl'] . '</td>\n\t\t\t<td align=\"left\">' . $row['blk'] . '</td>\n\t\t\t<td align=\"left\">' . $row['turnover'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pf'] . '</td>\n\t\t</tr>\n\t\t';\n }\n\n echo '</table></div>';\n\n}", "public function analyseLeague(){\n\t\t$content \t= curl_file(\"https://euw.api.pvp.net/api/lol/euw/v2.5/league/by-summoner/\".trim($this->id).\"?api_key=\".RIOT_KEY);\n\t\t$json \t= json_decode($content[\"result\"], true);\n\t\techo $this->id.\"<br/>\";\n\t\tif(isset($json[$this->id][0][\"entries\"])){\n\t\t\tforeach($json[$this->id][0][\"entries\"] as $player){\n\t\t\t\t$status = $this->handleSummoner($player[\"playerOrTeamId\"]);\n\t\t\t\tif($status == true){\n\t\t\t\t\t$this->status = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($this->status){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function ListAllowedPlayers(){\n\t\n\tglobal $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players;\n\t\n\tif ($_GET['mode'] != \"league\"){\n\t\t\n\t\techo Menu();\n\t\t\n\t\tKillUse($_SESSION['loginid']);\n\t}\n\techo \"<table width=\\\"857\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\tif ($_GET['lid'] == 0){\n\t\techo \"\t<tr>\\n\";\n\t\techo \"\t\t<td>\"._LEAGUE_NO_LEAGUE_ID.\"</td>\\n\";\n \t\techo \"\t</tr>\\n\";\n\t} else {\n\t\techo \"\t<tr>\\n\";\n\t\tif ($_GET['show'] != \"id\" && $_GET['show'] != \"season_players_all_guid\"){\n\t\t\techo \"\t\t<td width=\\\"30\\\" valign=\\\"middle\\\" class=\\\"eden_title\\\">ID</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t}\n\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\techo \"\t</tr>\\n\";\n\t\t//$msg = LeagueGenerateListAllowedPlayers((float)$_GET['lid'],(float)$_GET['sid'],(float)$_GET['rid']);\n\t\tswitch ($_GET['show']){\n\t \t\tcase \"id\":\n\t \t\t\t$colspan = 1;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players \n\t\t\t\tWHERE league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY league_season_round_allowed_player_guid\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t \t\tbreak;\n\t\t\tcase \"season_players_all\":\n\t\t\t\t$colspan = 4;\n\t \t\tbreak;\n\t\t\tcase \"season_players_all_guid\":\n\t \t\t\t$colspan = 1;\n\t \t\tbreak;\n\t\t\tdefault:\n\t \t\t\t$colspan = 4;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, ll.league_league_id, ll.league_league_game_id, lsrap.league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players AS lsrap \n\t\t\t\tJOIN $db_league_leagues AS ll ON ll.league_league_id=lsrap.league_season_round_allowed_player_league_id \n\t\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\t\t\t\tWHERE lsrap.league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY lsrap.league_season_round_allowed_player_team_sub_id ASC, a.admin_nick ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$_GET['show'] = \"all\";\n\t\t}\n\t\t\n\t\t$cislo = 0;\n\t\t// pro zobrazeni povolenych hracu\n\t\tif ($_GET['show'] == \"id\" || $_GET['show'] == \"all\"){\n\t\t\twhile ($ar_round = mysql_fetch_array($res_round)){\n\t\t\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\tif ($_GET['show'] != \"id\"){\n\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_round['admin_id'].\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_round['league_team_name']).\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_round['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t}\n\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if (empty($ar_round['league_season_round_allowed_player_guid'])){echo \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} else {echo stripslashes($ar_round['league_season_round_allowed_player_guid']);} echo \"</td>\\n\";\n\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t$cislo++;\n\t\t\t}\n\t\t\tunset($ar_round);\n\t\t}\n\t\t// pro zobrazeni vsech hracu\n\t\tif ($_GET['show'] == \"season_players_all\" || $_GET['show'] == \"season_players_all_guid\"){\n\t\t\t$res_team = mysql_query(\"\n\t\t\tSELECT lt.league_team_id, lt.league_team_name, ltsl.league_teams_sub_league_team_sub_id, ltsl.league_teams_sub_league_league_id \n\t\t\tFROM $db_league_teams_sub_leagues AS ltsl \n\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=ltsl.league_teams_sub_league_team_id \n\t\t\tWHERE ltsl.league_teams_sub_league_league_id=\".(integer)$_GET['lid']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\twhile ($ar_team = mysql_fetch_array($res_team)){\n\t\t\t\t$res_player = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, ag.admin_guid_guid, lp.league_player_id \n\t\t\t\tFROM $db_league_players AS lp \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\t\t\t\tJOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_league_guid_id=\".(integer)$ar_team['league_teams_sub_league_league_id'].\" AND ag.admin_guid_guid != '' \n\t\t\t\tWHERE lp.league_player_team_sub_id=\".(integer)$ar_team['league_teams_sub_league_team_sub_id']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$i=1;\n\t\t\t\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\t\tif ($_GET['show'] != \"season_players_all_guid\"){\n\t\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_team['league_team_name']).\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_player['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_player['admin_guid_guid']).\"</td>\\n\";\n\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\techo \"</table>\\n\";\n}", "public function calculateAllTeamsPlayerValues(){\n $view= $this->view;\n $view->setNoRender();\n $peopleService = parent::getService('people','people');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n Service::loadModels('rally', 'rally');\n $season = $leagueService->getCurrentSeason();\n $peopleService->calculateNewValuesForAllPlayers($season);\n echo \"good\";\n }", "function showGames( $curDivision=\"\" ) {\n\n/* ... define values for template variables to display on page */\n if ($curDivision == \"\") {\n $data['title'] = \"Playoffs - \".$this->config->item( 'siteName' );\n }\n else {\n $data['title'] = \"Division \".$curDivision.\" Playoffs - \".$this->config->item( 'siteName' );\n }\n\n/* ... get the schedule details from the database */ \n if ($curDivision == \"\") { \n $data['tournDetails'] = $this->Model_Tournament->getAllDetails();\n $data['tournHeader'] = \"League Playoff Schedule\";\n }\n else {\n $data['tournDetails'] = $this->Model_Tournament->getDivDetails( $curDivision );\n $data['tournHeader'] = \"Division \".$curDivision.\" Playoff Schedule\";\n }\n\n/* ... replace seeding placeholders in the schedule with appropriate team ids */\n for ($i=0; $i < count( $data['tournDetails'] ); $i++) {\n\n if ($data['tournDetails'][$i]['Status'] == \"SCHEDULED\") {\n if ($curDivision == \"\") {\n $seedDiv = substr( $data['tournDetails'][$i]['TournamentID'], 0, 1 );\n }\n else {\n $seedDiv = $curDivision;\n }\n if ($data['tournDetails'][$i]['HomeTeamID'] == NULL && $data['tournDetails'][$i]['HomeSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['HomeSeed'], $seedDiv );\n $data['tournDetails'][$i]['HomeTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n if ($data['tournDetails'][$i]['VisitTeamID'] == NULL && $data['tournDetails'][$i]['VisitSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['VisitSeed'], $seedDiv );\n $data['tournDetails'][$i]['VisitTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n }\n }\n \n/* ... set the name of the page to be displayed */\n $data['main'] = \"schedule/sched_tournamentMaster\";\n\n $this->index( $data );\n \n/* ... time to go */\n return;\n }", "public function getSeasons();", "function getTeams(){\n return array(\n //Gonzaga ~96%\n array('name'=>'Gonzaga','elo'=>1870,'off'=>126.8,'def'=>88.8,'tempo'=>74.8),\n array(),\n //Missouri 53%\n array('name'=>'Oklahoma','elo'=>1534,'off'=>112.1,'def'=>94.1,'tempo'=>67.7),\n array('name'=>'Missouri','elo'=>1548,'off'=>110.9,'def'=>94.9,'tempo'=>68.7),\n //Creighton 70%\n array('name'=>'Creighton','elo'=>1650,'off'=>115.6,'def'=>92.8,'tempo'=>69.1),\n array('name'=>'UCSB','elo'=>1496,'off'=>109.9,'def'=>96.3,'tempo'=>66.1),\n //Virginia 73%\n array('name'=>'Virginia','elo'=>1682,'off'=>116.3,'def'=>92.3,'tempo'=>60.1),\n array('name'=>'Ohio','elo'=>1507,'off'=>113.7,'def'=>101.2,'tempo'=>69.3),\n // USC 55%\n array('name'=>'USC','elo'=>1628,'off'=>113.6,'def'=>89.9,'tempo'=>67,3),\n array(),\n //Kansas 79%\n array('name'=>'Kansas','elo'=>1701,'off'=>110.3,'def'=>87.9,'tempo'=>68.3),\n array('name'=>'E Washington','elo'=>1469,'off'=>108.4,'def'=>100.3,'tempo'=>72.4),\n //Oregon 65%\n array('name'=>'Oregon','elo'=>1669,'off'=>115.1,'def'=>96.0,'tempo'=>67.2),\n array('name'=>'VCU','elo'=>1558,'off'=>106.2,'def'=>88.8,'tempo'=>69.8),\n //Iowa 86%\n array('name'=>'Iowa','elo'=>1710,'off'=>124.2,'def'=>93.9,'tempo'=>70.0),\n array('name'=>'Grand Canyon','elo'=>1383,'off'=>104.2,'def'=>95.8,'tempo'=>65.5),\n //Michigan 87%\n array('name'=>'Michigan','elo'=>1727,'off'=>120.1,'def'=>87.9,'tempo'=>66.8),\n array(),\n //LSU 55%\n array('name'=>'LSU','elo'=>1633,'off'=>120.5,'def'=>99.4,'tempo'=>70.8),\n array('name'=>'St Bonaventure','elo'=>1597,'off'=>112.0,'def'=>89.8,'tempo'=>65.2),\n //Colorado 56%\n array('name'=>'Colorado','elo'=>1639,'off'=>115.1,'def'=>92.0,'tempo'=>66.4),\n array('name'=>'Georgetown','elo'=>1593,'off'=>108.4,'def'=>92.9,'tempo'=>69.6),\n //Florida State 65%\n array('name'=>'Florida State','elo'=>1632,'off'=>117.1,'def'=>93.6,'tempo'=>70.6),\n array('name'=>'UNCG','elo'=>1519,'off'=>104.8,'def'=>95.2,'tempo'=>68.5),\n //BYU 62%\n array('name'=>'BYU','elo'=>1632,'off'=>113.8,'def'=>91.4,'tempo'=>68.0),\n array(),\n //Texas 78%\n array('name'=>'Texas','elo'=>1705,'off'=>114.5,'def'=>92.5,'tempo'=>69.2),\n array('name'=>'Abilene Christian','elo'=>1481,'off'=>103.7,'def'=>92.2,'tempo'=>70.0),\n //UCONN 59%\n array('name'=>'UCONN','elo'=>1610,'off'=>114.3,'def'=>90.9,'tempo'=>66.0),\n array('name'=>'Maryland','elo'=>1546,'off'=>111.6,'def'=>91.5,'tempo'=>65.3),\n //Alabama 90%\n array('name'=>'Alabama','elo'=>1753,'off'=>112.4,'def'=>86.0,'tempo'=>73.9),\n array('name'=>'Iona','elo'=>1371,'off'=>101.1,'def'=>100.7,'tempo'=>68.3),\n //Baylor 92%\n array('name'=>'Baylor','elo'=>1806,'off'=>124.0,'def'=>93.0,'tempo'=>68.4),\n array('name'=>'Hartford','elo'=>1359,'off'=>98.2,'def'=>99.5,'tempo'=>66.7),\n //UNC 60%\n array('name'=>'North Carolina','elo'=>1624,'off'=>110.8,'def'=>89.3,'tempo'=>71.8),\n array('name'=>'Wisconsin','elo'=>1553,'off'=>113.2,'def'=>89.1,'tempo'=>64.9),\n //Villanova 60%\n array('name'=>'Villanova','elo'=>1634,'off'=>119.3,'def'=>95.3,'tempo'=>65.1),\n array('name'=>'Winthrop','elo'=>1558,'off'=>105.8,'def'=>95.4,'tempo'=>73.6),\n //Purdue 68%\n array('name'=>'Purdue','elo'=>1622,'off'=>114.3,'def'=>90.6,'tempo'=>66.5),\n array('name'=>'North Texas','elo'=>1484,'off'=>106.1,'def'=>92.9,'tempo'=>63.1),\n //Texas Tech 52%\n array('name'=>'Texas Tech','elo'=>1595,'off'=>113.1,'def'=>90.7,'tempo'=>65.4),\n array('name'=>'Utah State','elo'=>1576,'off'=>106.4,'def'=>88.5,'tempo'=>68.9),\n //Arkansas 66%\n array('name'=>'Arkansas','elo'=>1679,'off'=>112.2,'def'=>89.2,'tempo'=>73.1),\n array('name'=>'Colgate','elo'=>1559,'off'=>111.6,'def'=>99.9,'tempo'=>72.5),\n //Florida 52%\n array('name'=>'Florida','elo'=>1550,'off'=>111.7,'def'=>92.7,'tempo'=>68.7),\n array('name'=>'Virginia Tech','elo'=>1530,'off'=>110.7,'def'=>94.1,'tempo'=>66.2),\n //Ohio St 85%\n array('name'=>'Ohio State','elo'=>1681,'off'=>123.0,'def'=>96.1,'tempo'=>67.1),\n array('name'=>'Oral Roberts','elo'=>1373,'off'=>109.4,'def'=>106.7,'tempo'=>71.8),\n //Illinois 92%\n array('name'=>'Illinois','elo'=>1807,'off'=>119.7,'def'=>87.6,'tempo'=>70.7),\n array('name'=>'Drexel','elo'=>1362,'off'=>107.8,'def'=>104.8,'tempo'=>64.2),\n //Georgia Tech 51%\n array('name'=>'Loyola Chicago','elo'=>1655,'off'=>111.1,'def'=>85.9,'tempo'=>64.2),\n array('name'=>'Georgia Tech','elo'=>1659,'off'=>114.0,'def'=>94.1,'tempo'=>67.8),\n //Tennessee 51%\n array('name'=>'Tennessee','elo'=>1602,'off'=>109.5,'def'=>87.0,'tempo'=>67.3),\n array('name'=>'Oregon State','elo'=>1591,'off'=>110.0,'def'=>98.4,'tempo'=>65.4),\n //Oklahoma St 74%\n array('name'=>'Oklahoma State','elo'=>1700,'off'=>110.8,'def'=>90.6,'tempo'=>72.0),\n array('name'=>'Liberty','elo'=>1517,'off'=>110.8,'def'=>101.0,'tempo'=>63.1),\n //SD State 66%\n array('name'=>'San Diego State','elo'=>1697,'off'=>111.5,'def'=>88.8,'tempo'=>66.1),\n array('name'=>'Syracuse','elo'=>1574,'off'=>114.5,'def'=>96.9,'tempo'=>69.2),\n //West Virginia 69%\n array('name'=>'West Virginia','elo'=>1633,'off'=>116.8,'def'=>95.1,'tempo'=>69.6),\n array('name'=>'Morehead State','elo'=>1492,'off'=>100.9,'def'=>95.5,'tempo'=>65.6),\n //Clemson 52%\n array('name'=>'Clemson','elo'=>1571,'off'=>107.6,'def'=>90.0,'tempo'=>64.2),\n array('name'=>'Rutgers','elo'=>1556,'off'=>109.3,'def'=>89.8,'tempo'=>67.8),\n //Houston 88%\n array('name'=>'Houston','elo'=>1742,'off'=>119.6,'def'=>89.4,'tempo'=>64.9),\n array('name'=>'Cleveland State','elo'=>1395,'off'=>101.5,'def'=>98.7,'tempo'=>66.3),\n );\n}", "function getPlayinTeams(){\n return array(\n //winner to [25]\n array('name'=>'UCLA','elo'=>1542,'off'=>114.1,'def'=>96.8,'tempo'=>64.7),\n array('name'=>'Michigan State','elo'=>1596,'off'=>107.7,'def'=>92.2,'tempo'=>68.6),\n //winner to [17]\n array('name'=>'Texas Southern','elo'=>1395,'off'=>99.7,'def'=>104.3,'tempo'=>72.0),\n array('name'=>'Mt. St Marys','elo'=>1278,'off'=>96.1,'def'=>99.7,'tempo'=>62.2),\n //winner to [9]\n array('name'=>'Drake','elo'=>1540,'off'=>114.6,'def'=>98.6,'tempo'=>66.8),\n array('name'=>'Wichita State','elo'=>1592,'off'=>110.7,'def'=>97.7,'tempo'=>67.6),\n //winner to [1]\n array('name'=>'Appalachian State','elo'=>1378,'off'=>100.1,'def'=>103.0,'tempo'=>65.7),\n array('name'=>'Norfolk St','elo'=>1310,'off'=>101.3,'def'=>103.6,'tempo'=>67.7),\n );\n}", "function getResults(DateTime $date){\n\t\t\t\n\t\t\t\n\t\t\t$dateString = $date->format('Y-m-d');\n\t\t\t$url = 'http://betting.racingpost.com/horses/results/?r_date='.$dateString;\n\t\t\t\n\t\t\t$html = $this->getHtml($url);\n\t\t\t\n\t\t\t//Line needs to be accross two lines to recognise new line character\n \t\t\t$events = explode(\"<div class=\\\"headlineBlock\\\">\n <h2>\",$html);\n \n \t\t\t//logness($events);\n \t\t\t//customExit();\n \t\t\t$resultsArray = array();\n \t\t\t\n \t\t\t$maxI = count($events);\n\t\t\t\n\t\t\tfor( $i=1; $i< $maxI;$i++){\n\t\t\t\t\n\t\t\t\t$eventName = explode('</h2>',$events[$i])[0];\n\t\t\t\t\n\t\t\t\t//Remove bracketed text if any\n\t\t\t\t$eventName = rtrim(explode('(',$eventName)[0],\" \");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Get each race...\n\t\t\t\t$races = explode('<strong id=', $events[$i]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$resultsArray[$eventName]=array();\n\t\t\t\t\n\t\t\t\t$maxQ = count($races);\n\t\t\t\t\n\t\t\t\tfor( $q=1; $q<$maxQ;$q++){\n\t\t\t\t\t\n\t\t\t\t\t$raceTime = explode('<',explode('>', $races[$q])[1])[0];\n\t\t\t\t\t\n\t\t\t\t\t//Convert the hour part of the time to 24 hour\n\t\t\t\t\t$raceTime = explode(':',$raceTime);\n\t\t\t\t\t$raceHour = $raceTime[0]; \n\t\t\t\t\t$raceMinute = $raceTime[1]; \n\t\t\t\t\t\n\t\t\t\t\tif( $raceHour < 11){\n\t\t\t\t\t\t$raceHour+=12;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$raceTime = $raceHour.':'.$raceMinute;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$resultsArray[$eventName][$raceTime]=array();\n\t\t\t\t\t\n\t\t\t\t\t//Find out number of runners..\n\t\t\t\t\t$totalRunners = explode('>',explode('ran Distances', $races[$q])[0]);\n\t\t\t\t\t$totalRunners = (int)$totalRunners[count($totalRunners)-1];\n\t\t\t\t\t\n\t\t\t\t\t$resultsArray[$eventName][$raceTime]['totalRunners']=$totalRunners;\n\t\t\t\t\t\n\t\t\t\t\t//Only proceed if number of runners found..\n\t\t\t\t\tif( $totalRunners> 0 ){\n\t\t\t\t\t\n\t\t\t\t\t\t//Get horses in order\n\t\t\t\t\t\t$horses = explode('HORSE\">', $races[$q]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$maxH = count($horses);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor( $h=1; $h<$maxH; $h++ ){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//get the position os this horse, (should match $h)\n\t\t\t\t\t\t\t$position = explode(' <a href', $horses[$h-1]);\n\t\t\t\t\t\t\t$position = $position[count($position)-2];\n\t\t\t\t\t\t\t$position = explode('>',$position);\n\t\t\t\t\t\t\t$position = $position[count($position)-1];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//make sure we havent gone down as far as non runner horses, or script\n\t\t\t\t\t\t\tif (strpos($position, 'NR') !== false || !is_numeric($position)) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//If it doesn't match, probably a deadheat\n\t\t\t\t\t\t\tif( $position != $h ){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//unset the array and break from for loop\n\t\t\t\t\t\t\t\t//logness(\"position: $position not match: $h\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tunset($resultsArray[$eventName][$raceTime]['results']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$horseName = explode('</a>',$horses[$h] )[0];\n\t\t\t\t\t\t\t\t$horsePrice = trim(explode('<',explode('</a>', $horses[$h])[1])[0],' F');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($horsePrice==\"evens\"){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$horserice = \"1/1\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Convert price to decimal\n\t\t\t\t\t\t\t\t$horsePrice = explode('/', $horsePrice);\n\t\t\t\t\t\t\t\t$horsePrice = $horsePrice[0]/$horsePrice[1]+1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$resultsArray[$eventName][$raceTime]['results'][$h] = array('name'=>$horseName,'price'=>$horsePrice );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Get non runners\n\t\t\t\t\t\t$nonRunners = explode('NR:', $races[$q]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Check if there is any\n\t\t\t\t\t\tif( count($nonRunners)>1){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$resultsArray[$eventName][$raceTime]['nonRunners']=array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$nonRunners = explode('</p>', $nonRunners[1])[0];\n\t\t\t\t\t\t\t$nonRunners = explode('</a>', $nonRunners);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$maxN = (sizeof($nonRunners)-1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor( $n=0; $n<$maxN;$n++){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$nonRunnerName = explode('>', $nonRunners[$n])[1];\n\t\t\t\t\t\t\t\t$nonRunnerName = explode(' (', $nonRunnerName)[0];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$resultsArray[$eventName][$raceTime]['nonRunners'][]=explode('>', $nonRunners[$n])[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $resultsArray;\n\t\t\t//logness($resultsArray);\n\t\t\t//customExit();\n\t\t}", "public function populateMatchStandings(){\n\t\t $team = new Application_Model_Mapper_Team();\n\t\t //cath all teams\n\t\t $teamList=$team->fetchAll();\n\t\t $prosGoal= null;\n\t\t $agaistGoal=null;\n\t\t if(count($teamList)>0){\n\t\t \t foreach($teamList as $row){\n\t\t \t \t //begin team statistics by 0\n\t\t \t \t $row->setWins(0);\n\t\t \t \t $row->setLosses(0);\n\t\t \t \t $row->setPoints(0);\n\t\t \t \t $row->setDraws(0);\n\t\t \t \t //catch all matches by team\n\t\t $championship = $this->seachMatchByTeam($row->getId());\n\t\t foreach ($championship as $match) {\n\t\t //if a team is a visitor team goals of visitor team it is\n\t\t \t $prosGoal=$match['goalVisitorTeam'];\n\t\t \t $agaistGoal=$match['goalHomeTeam'];\n\t\t \t //if a team is a home team goals of home team it is\n\t\t \t if($match['idHomeTeam']==$row->getId()){\n\t\t \t \t $prosGoal=$match['goalHomeTeam'];\n\t\t \t \t $agaistGoal=$match['goalVisitorTeam'];\n\t\t \t }\n\t\t \t //if team win\n\t\t \t if($agaistGoal<$prosGoal){\n\t\t \t \t$row->setWins($row->getWins()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+3);\n\t\t \t }//if team lost\n\t\t \t elseif($agaistGoal>$prosGoal){\n\t\t \t \t$row->setLosses($row->getLosses()+1);\n\t\t \t }//if team draw\n\t\t \t else{\n\t\t \t \t$row->setDraws($row->getDraws()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+1);\n\t\t \t }\n\t\t }\n\t\t //update table team\n\t\t $team->updateTeam($row);\n\t\t \t }\n\t\t }\n\t}", "public function getScores()\n {\n \t$url = 'http://www.nfl.com/liveupdate/scorestrip/ss.json';\n \t$content = file_get_contents($url);\n \t$ss_json = json_decode($content, true);\n \t\n $url = 'http://www.nfl.com/liveupdate/scores/scores.json';\n $content = file_get_contents($url);\n $scores_json = json_decode($content, true);\n\n foreach ($ss_json['gms'] as $game) {\n // Map game data to game\n $eid = $game[\"eid\"];\n $game['data'] = $scores_json[$eid];\n \n // Get team IDs\n $home_team = DB::table('team')->where('abbr', $game['data']['home']['abbr'])->value('id');\n $away_team = DB::table('team')->where('abbr', $game['data']['away']['abbr'])->value('id');\n \n // Save teams\n if (! $home_team > 0) {\n \tprint \"Inserting home team into DB<br/>\";\n $home_team = DB::table('team')->insertGetId([\n 'name' => $game['hnn'],\n 'abbr' => $game['data']['home']['abbr']\n ]);\n } else {\n print \"Updating home team in DB<br/>\";\n DB::table('team')->where('id',$home_team)->update(['name' => $game['hnn']]);\n }\n if (! $away_team > 0) {\n print \"Inserting away team into DB<br/>\";\n $away_team = DB::table('team')->insertGetId([\n 'name' => $game['vnn'],\n 'abbr' => $game['data']['away']['abbr']\n ]);\n } else {\n print \"Updating away team in DB<br/>\";\n DB::table('team')->where('id',$away_team)->update(['name' => $game['vnn']]);\n }\n \n // Determine start time\n $year = substr($eid,0,4);\n $month = substr($eid,4,2);\n $day = substr($eid,6,2);\n $time = explode(':',$game['t']);\n $hours = $time[0] + 12;\n $minutes = $time[1];\n $seconds = 0;\n $start = date(\"Y-m-d H:i:s\", mktime($hours, $minutes, $seconds, $month, $day, $year));\n \n // Pull game ID\n $gid = DB::table('game')\n ->where('home_team_id', $home_team)\n ->where('away_team_id', $away_team)\n ->value('id');\n \n // Save game\n if (! $gid > 0) {\n print \"Inserting game for \". $home_team .\" \". $away_team .\" \". $start .\"<br/>\";\n $gid = DB::table('game')->insertGetId([\n \t'eid' => $eid,\n 'home_team_id' => $home_team,\n \t 'away_team_id' => $away_team,\n 'start' => $start\n ]);\n }\n \n // Save scores\n print \"Inserting scores \". $game['data']['home']['score']['T'] .\" \". $game['data']['away']['score']['T'] .\"<br/>\";\n if ($game['data']['home']['score']['T'] != Null && $game['data']['home']['score']['T'] != Null) {\n DB::table('score')->insert([\n 'game_id' => $gid,\n 'home_q1' => $game['data']['home']['score']['1'],\n 'home_q2' => $game['data']['home']['score']['2'],\n 'home_q3' => $game['data']['home']['score']['3'],\n 'home_q4' => $game['data']['home']['score']['4'],\n 'home_q5' => $game['data']['home']['score']['5'],\n 'away_q1' => $game['data']['away']['score']['1'],\n 'away_q2' => $game['data']['away']['score']['2'],\n 'away_q3' => $game['data']['away']['score']['3'],\n 'away_q4' => $game['data']['away']['score']['4'],\n 'away_q5' => $game['data']['away']['score']['5']\n ]);\n }\n print \"<p>----------------------------------------</p>\";\n }\n\n $response = array('exit_code' => 'success');\n //return $response;\n }", "function get_archieved_games_results($odds_season) {\n\t\n//$odds_season = '2013-14';\n\n/* odds_limit is used to check if the games is an even match. If not, we don't bother using it. \n\tThe odds archive files contains multiple odds notations for a two way situation, including\n\tthe US odds (like -125). The US odds is only available for the favorite team, so only need\n\tto check one end of the\trange. Ex.: -130 is ~1.76 in decimal notation, so it should fit in \n\tour range of 1.75 - 2.1. \n*/\n//$odds_limit = -130;\n$odds_archive = file('odds_archive/nhl odds '.$odds_season.'.csv');\n\n$line_number = 1;\n\nforeach($odds_archive as $odds_line) {\n\t\n\tif($line_number != 1) {\n\t\t\n\t\t$odds_columns = explode(',', $odds_line);\n\t\t\n\t\t$i=0;\n\t\t\t\t\t\t\n\t\tforeach($odds_columns as $column) {\n\t\t\tswitch($i) {\n\t\t\t\tcase 0:\n\t\t\t\t\t$current_date = $column;\n\t\t\t\tcase 3:\n\t\t\t\t\t$current_team = $column;\n\t\t\t\tcase 7:\n\t\t\t\t\t$current_score = $column;\t\n\t\t\t\tcase 8:\n\t\t\t\t\t$current_odds = $column;\t\n\t\t\t\tcase 10:\n\t\t\t\t\t$current_overtime = $column;\t\n\t\t\t}\n\t\t\t$i++;\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\tif($line_number % 2 == 0) {\n\t\t\t$visitor_team = $current_team;\n\t\t\t$visitor_score = $current_score;\n\t\t\t$visitor_odds = $current_odds;\n\t\t\t$visitor_overtime = $current_overtime;\n\t\t} else {\n\n\t\t\n//\t\t\t$save_to_db = false;\n\t\t\t$save_to_db = true;\n\t\t\tif(substr($current_odds, 0, 1) == '-') {\n\t\t\t\t/*if($current_odds >= $odds_limit) {\n\t\t\t\t\t$save_to_db = true;\n\t\t\t\t}*/\n\t\t\t\t$odds_to_use = $current_odds;\n\t\t\t} elseif (substr($visitor_odds, 0, 1) == '-') {\n\t\t\t\t/*if($visitor_odds >= $odds_limit) {\n\t\t\t\t\t$save_to_db = true;\n\t\t\t\t}*/\n\t\t\t\t$odds_to_use = $visitor_odds;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($save_to_db) {\n\t\t\t\t\n\t\t\t\t$date_length = strlen($current_date);\n\t\t\t\tif($date_length == 4) {\n\t\t\t\t\t$date_year = substr($odds_season, 0, 4);\n\t\t\t\t\t$date_month = substr($current_date, 0, $date_length-2);\n\t\t\t\t} else {\n\t\t\t\t \t$date_year = '20'.substr($odds_season, 5, 2);\n\t\t\t\t \t$date_month = '0'.substr($current_date, 0, $date_length-2);\n\t\t\t\t }\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$date_day = substr($current_date, $date_length-2, 2);\n\t\t\t\t$date_to_use = $date_year.'-'.$date_month.'-'.$date_day;\n\t\t\t\t\n\t\t\t\t//if($date_to_use >= '2013-10-01' && $date_to_use <= '2014-04-13') {\n\t\t\t\t\t\t\n\t\t\t\t\t$message_value[] = $date_to_use.' | '.$visitor_team.'-'.$current_team;\n\t\t\t\t\t\n\t\t\t\t\t$query = \"INSERT INTO matches(date, visitor, home, odds_us) VALUES ('$date_to_use', '$visitor_team', '$current_team', '$odds_to_use')\";\n\t\t\t\t\t\n\t\t\t\t\tif(!mysqli_query(DBi::$conn, $query)) { echo mysqli_error(DBi::$conn); }\n\t\t\t\t\t\n\t\t\t\t\t$game_id = mysqli_insert_id(DBi::$conn);\n\t\t\t\t\t\n\t\t\t\t\tif($visitor_score > $current_score) {\n\t\t\t\t\t\t$result = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result = 2;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//echo 'Visitor OT'.$visitor_overtime.'|';\n\t\t\t\t\t//echo 'Home OT'.$current_overtime.'<br>';\n\t\t\t\t\t\n\t\t\t\t\tif($visitor_overtime == 1 || $current_overtime == 1) {\n\t\t\t\t\t\t$overtime = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$overtime = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//echo 'OT:'.$overtime.'<br>';\n\t\t\t\t\t$query2 = \"INSERT INTO results(game_id, result, overtime) VALUES ($game_id, $result, $overtime)\";\n\t\t\t\t\t\n\t\t\t\t\tif(!mysqli_query(DBi::$conn, $query2)) { echo mysqli_error(DBi::$conn); }\n\t\t\t\t\t\n\t\t\t\t//}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\t\n\t}\n\t\n\t$line_number++;\n\n}\n\n}", "function get_standing_team_db($idSeason)\n{\n require('./model/connect_db.php');\n $sql = \"select t.idTeam, t.nameTeam, sum(r.Points) as points from team t, race r, season s where r.idTeam = t.idTeam and s.idseason = '%d' and s.idseason = r.idseason group by t.nameTeam order by points desc \";\n $request = sprintf($sql,$idSeason);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $standing = array();\n while($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $standing[] = $line;\n }\n return $standing;\n}", "function galaxy_show_ranking_player() {\n\tglobal $db;\n\tglobal $pub_order_by, $pub_date, $pub_interval;\n\n\tif (!isset($pub_order_by)) {\n\t\t$pub_order_by = \"general\";\n\t}\n\tif ($pub_order_by != \"general\" && $pub_order_by != \"fleet\" && $pub_order_by != \"research\") {\n\t\t$pub_order_by = \"general\";\n\t}\n\n\tif (!isset($pub_interval)) {\n\t\t$pub_interval = 1;\n\t}\n\tif (($pub_interval-1)%100 != 0 || $pub_interval > 1401) {\n\t\t$pub_interval = 1;\n\t}\n\t$limit_down = $pub_interval;\n\t$limit_up = $pub_interval + 99;\n\n\t$order = array();\n\t$ranking = array();\n\t$ranking_available = array();\n\n\tswitch ($pub_order_by) {\n\t\tcase \"general\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\tbreak;\n\t\tcase \"fleet\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\tbreak;\n\t\tcase \"research\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\tbreak;\n\t}\n\t$i=0;\n\n\tif (!isset($pub_date)) {\n\t\t$request = \"select max(datadate) from \".$table[$i][\"tablename\"];\n\t\t$result = $db->sql_query($request);\n\t\tlist($last_ranking) = $db->sql_fetch_row($result);\n\t}\n\telse $last_ranking = $pub_date;\n\n\t$request = \"select rank, player, ally, points, username\";\n\t$request .= \" from \".$table[$i][\"tablename\"].\" left join \".TABLE_USER;\n\t$request .= \" on sender_id = user_id\";\n\t$request .= \" where rank between \".$limit_down.\" and \".$limit_up;\n\t$request .= isset($last_ranking) ? \" and datadate = \".mysql_real_escape_string($last_ranking) : \"\";\n\t$request .= \" order by rank\";\n\t$result = $db->sql_query($request);\n\n\twhile (list($rank, $player, $ally, $points, $username) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$player][$table[$i][\"arrayname\"]] = array(\"rank\" => $rank, \"points\" => $points);\n\t\t$ranking[$player][\"ally\"] = $ally;\n\t\t$ranking[$player][\"sender\"] = $username;\n\n\t\tif ($pub_order_by == $table[$i][\"arrayname\"]) {\n\t\t\t$order[$rank] = $player;\n\t\t}\n\t}\n\n\t$request = \"select distinct datadate from \".$table[$i][\"tablename\"].\" order by datadate desc\";\n\t$result_2 = $db->sql_query($request);\n\twhile ($row = $db->sql_fetch_assoc($result_2)) {\n\t\t$ranking_available[] = $row[\"datadate\"];\n\t}\n\n\tfor ($i ; $i<3 ; $i++) {\n\t\treset($ranking);\n\t\twhile ($value = current($ranking)) {\n\t\t\t$request = \"select rank, player, ally, points, username\";\n\t\t\t$request .= \" from \".$table[$i][\"tablename\"].\" left join \".TABLE_USER;\n\t\t\t$request .= \" on sender_id = user_id\";\n\t\t\t$request .= \" where player = '\".mysql_real_escape_string(key($ranking)).\"'\";\n\t\t\t$request .= isset($last_ranking) ? \" and datadate = \".mysql_real_escape_string($last_ranking) : \"\";\n\t\t\t$request .= \" order by rank\";\n\t\t\t$result = $db->sql_query($request);\n\n\t\t\twhile (list($rank, $player, $ally, $points, $username) = $db->sql_fetch_row($result)) {\n\t\t\t\t$ranking[$player][$table[$i][\"arrayname\"]] = array(\"rank\" => $rank, \"points\" => $points);\n\t\t\t\t$ranking[$player][\"ally\"] = $ally;\n\t\t\t\t$ranking[$player][\"sender\"] = $username;\n\n\t\t\t\tif ($pub_order_by == $table[$i][\"arrayname\"]) {\n\t\t\t\t\t$order[$rank] = $player;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnext($ranking);\n\t\t}\n\t}\n\n\t$ranking_available = array_unique($ranking_available);\n\n\treturn array($order, $ranking, $ranking_available);\n}", "function crawl_team_rosters($season) {\n\n$base_link = 'http://www.hockeydb.com/ihdb/stats/leagues/seasons/nhl1927'.$season.'.html';\nglobal $teams;\n\n$html_season_standings = file_get_html($base_link);\n\nif($html_season_standings) {\n\t\n\t//Retrieve the team links\n\tforeach($html_season_standings->find('table[class=sortable autostripe] tbody tr') as $team_stats){\n\t\t\tif($team_link = $team_stats->find('td a', 0)) {\n\t\t\t\t$team_name = $team_link->plaintext;\n\t\t\t\t$team_href = $team_link->href;\n\t\t\t\t\n\t\t\t\t//Retrieve the players.\n\t\t\t\tif($html_team_roster = file_get_html(\"http://www.hockeydb.com/ihdb/stats/leagues/seasons/$team_href\")) {\n\t\t\t\t\t\n\t\t\t\t\t$team_members = array();\n\t\t\t\t\t//Coaches\n\t\t\t\t\t$team_coach_section = $html_team_roster->find('div.tablebg div div', 4);\n\t\t\t\t\tforeach($team_coach_section->find('a') as $team_coach) {\n\t\t\t\t\t\t$team_members[] = $team_coach->plaintext;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Players\t\n\t\t\t\t\tforeach($html_team_roster->find('div.tablebg table[class=sortable autostripe]') as $team_player_section) {\n\t\t\t\t\t\tforeach($team_player_section->find('tbody tr') as $team_player_stats) {\n\t\t\t\t\t\t\tif($team_player = $team_player_stats->find('td a', 0)) {\n\t\t\t\t\t\t\t\t$team_members[] = $team_player->plaintext;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Upload data to files in the rosters directory.\n\t\t\t\t\t\n\t\t\t\t\tif($team_name == 'Arizona Coyotes') {\n\t\t\t\t\t\t$team_roster_handle = fopen('rosters/team_ari.txt', \"w\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$team_roster_handle = fopen('rosters/'.$teams[$team_name].'.txt', \"w\");\n\t\t\t\t\t}\n\t\t\t\t\tforeach($team_members as $member) {\n\t\t\t\t\t\t//Save only last name\n\t\t\t\t\t\t$name_parts = array();\n\t\t\t\t\t\t$name_parts = explode(' ', $member);\n\t\t\t\t\t\tfwrite($team_roster_handle, end($name_parts).\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\tfclose($team_roster_handle);\n\t\t\t\t\t$message_value[] = 'Roster updated for team: '.$team_name.'<br>';\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$message_value[] = 'GET HTML FALSE | TEAM ROSTER <br>';\n\t\t\t\t}\n\t\t\t\t//Need to remove break after dev!\n\t\t\t\t//break;\n\t\t\t}\n\t}\n\t\t\n} else {\n\t$message_value[] = 'GET HTML FALSE | SEASON STANDINGS <br>';\n}\n\n}", "function getStandings($allSchools){\n \n $all_records = [];\n $all_leagues = [];\n $brk = [];\n $ccc = [];\n $cra = [];\n $csc = [];\n $ecc = [];\n $fciac = [];\n $nvl = [];\n $nccc = [];\n $scc = [];\n $shr = [];\n $swc = [];\n \n $db_standings = new Database();\n //\n foreach($allSchools as $team){\n $getTeamRecord = \"CALL getRecord('$team[0]')\";\n $record = $db_standings->getData($getTeamRecord);\n $record = getRecords($record, $team);\n\n if($record['league'] == 'Berkshire'){ array_push($brk, $record); }\n elseif($record['league']=='Central Connecticut'){ array_push($ccc, $record); }\n elseif($record['league']=='Capital Region Athletic'){ array_push($cra,$record); }\n elseif($record['league']=='Constitution State'){ array_push($csc, $record); }\n elseif($record['league']=='Eastern Connecticut'){ array_push($ecc, $record); }\n elseif($record['league']=='Fairfield County Interscholastic Athletic'){ array_push($fciac, $record); }\n elseif($record['league']=='Naugatuck Valley'){ array_push($nvl, $record); }\n elseif($record['league']=='North Central Connecticut'){ array_push($nccc, $record); }\n elseif($record['league']=='Southern Connecticut'){ array_push($scc, $record); }\n elseif($record['league']=='Shoreline'){ array_push($shr, $record); }\n elseif($record['league']=='South West'){ array_push($swc, $record); }\n else{ array_push($all_records, $record); }\n\n // Sort brk arrays by overall w,l\n usort($brk,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ccc arrays by overall w,l\n usort($ccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort cra arrays by overall w,l\n usort($cra,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort csc arrays by overall w,l\n usort($csc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ecc arrays by overall w,l\n usort($ecc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort fcica arrays by overall w,l\n usort($fciac,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nccc arrays by overall w,l\n usort($nccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nvl arrays by overall w,l\n usort($nvl,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort scc arrays by overall w,l\n usort($scc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort shr arrays by overall w,l\n usort($shr,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort swc arrays by overall w,l\n usort($swc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n \n // Combine sorted divisions into all leagues array\n $all_leagues = [\n 'berkshire'=>$brk,\n 'capital region athletic'=>$cra,\n 'central connecticut'=>$ccc,\n 'constitution state'=>$csc,\n 'eastern connecticut'=>$ecc,\n 'fairfield county interscholastic athletic'=>$fciac,\n 'north central connecticut'=>$nccc,\n 'naugatuck valley'=>$nvl,\n 'shoreline'=>$shr,\n 'southern connecticut'=>$scc,\n 'south west'=>$swc\n ];\n }\n \n return $all_leagues;\n}", "function getAllPlayers(){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by rating DESC\";\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "function last_games($championship,$num){\n\t\t$games=$this->db->query('Select m.*, t1.id as hid, t1.name as hname, t2.id as aid, t2.name as aname,UNIX_TIMESTAMP(date_match) as datem\n\t\t\t\t\t\t\t\t From matches as m, groups as g, rounds as r, championships as c, matches_teams as mt, teams as t1, teams as t2 \n\t\t\t\t\t\t\t\t Where mt.match_id=m.id and mt.team_id_home=t1.id and mt.team_id_away=t2.id and m.group_id=g.id and g.round_id=r.id and r.championship_id=c.id and c.id='.$championship.'\n\t\t\t\t\t\t\t\t Order by date_match desc\n\t\t\t\t\t\t\t\t Limit 0,'.$num);\n\t\t\n\t\t$query=$this->db->query('SELECT UNIX_TIMESTAMP(min( date_match )) as date_match_first, UNIX_TIMESTAMP(max( date_match ))as date_match_last\n\t\t\t\t\t\t\t\t FROM championships AS c, rounds AS r, groups AS g, matches AS m\n\t\t\t\t\t\t\t\t WHERE c.id =4\n\t\t\t\t\t\t\t \t AND r.championship_id = c.id\n\t\t\t\t\t\t\t \t AND g.round_id = r.id\n\t\t\t\t\t\t\t\t AND m.group_id = g.id')->result();\n\t\t\n\t\t\n\t\t$fecha_first=$this->weekStartEnd(mdate(\"%Y-%m-%d\",$query[0]->date_match_first));\n\t\t$fecha_last=$this->weekStartEnd(mdate(\"%Y-%m-%d\",$query[0]->date_match_last));\n\t\t\n\t\t$i=1;\n\t\tdo{\n\t\t\tif($i!=1){\n\t\t\t\t$fecha_first=$this->weekStartEnd($this->calcularfecha($fecha_first['end'],+3));\n\t\t\t}\n\t\t\t$weeks[$i]=array(\n\t \t\t\t\t\t\"start\" => $fecha_first['start'],\n\t\t\t\t\t\t\t\"end\" => $fecha_first['end'],\t\t\n\t\t \t\t );\n\t\t $i+=1;\n\t\t}while ($fecha_first['end']!=$fecha_last['end']);\n\t\t\n\t\t$j=0;\n\t\tforeach($games->result() as $row):\n\t\t\t$partidos[$j]['id']=$row->id;\n\t\t\t$partidos[$j]['fecha']=mdate(\"%d %M %y\",$row->datem);\n\t\t\t$partidos[$j]['hora']=mdate(\"%h:%i\",$row->datem);\n\t\t\t$partidos[$j]['hequipo']=$row->hname;\n\t\t\t$partidos[$j]['aequipo']=$row->aname;\n\t\t\tif($row->result=='' || $row->result==NULL)\n\t\t\t\t$partidos[$j]['marcador']='Sin jugar';\n\t\t\telse\n\t\t\t\t$partidos[$j]['marcador']=$row->result;\n\t\t\t\n\t\t\t\n\t\t\tfor($k=1 ; $k<$i; $k+=1){\n\t \t\tif($row->date_match>$weeks[$k]['start'].' 00:00:00' AND $row->date_match<$weeks[$k]['end'].' 23:59:59')\n\t \t\t\t$partidos[$j]['jornada']=$k;\n\t\t\t}\n\t\t\t\n\t\t\t$j+=1;\n\t\t\t\n\t\tendforeach;\n\t\t\n\t\treturn $partidos;\n\t\t\n\t}", "protected function processResultsByTeam($ws,$level,&$teamCount,&$newPool,$teams,$header='Team Standings',$headerLabels)\n { \n }", "function getAllTeams(){\r\n /*for testing purposes only, replace with request to db\r\n return array(\r\n array(\"name\" => \"Usine\", \"score\" => 2000),\r\n array(\"name\" => \"Abattoirs\", \"score\" => 1000),\r\n array(\"name\" => \"Caserne\", \"score\" => 1200),\r\n array(\"name\" => \"Asile\", \"score\" => 5000),\r\n array(\"name\" => \"Zombie\", \"score\" => -10000)\r\n );*/\r\n\r\n //$GLOBALS['link'] = connect();\r\n $res = mysqli_query($GLOBALS['link'], 'select `id`, `name`, `score` from teams;');\r\n\r\n return fetch_result($res);\r\n}", "function getSportsDays($params = array()){\r\n $seasonID = trim($this->seasonInfo['id']);\r\n if(!$seasonID) {\r\n $this->errorMessage[] = 'SeasonID is not specified';\r\n return array();\r\n }\r\n $leagueID = trim($this->seasonInfo['league_id']);\r\n if(!$leagueID) {\r\n $this->errorMessage[] = 'leagueID is not specified';\r\n return array();\r\n }\r\n if(!is_array($params)) $params = array();\r\n // $this->dbInstance()->queryParams['fields'] = '*';\r\n $this->dbInstance()->queryParams['table'] = 'league_season_sportsday';\r\n\r\n\r\n if(isset($params['scheduledAfter']) && intval($params['scheduledAfter'])){\r\n $scheduledAfter = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` > \".intval($params['scheduledAfter']).\")\";\r\n }\r\n if(isset($params['scheduledBefore']) && intval($params['scheduledBefore'])){\r\n $scheduledBefore = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` < \".intval($params['scheduledBefore']).\")\";\r\n }\r\n $this->dbInstance()->queryParams['where'] = \"\r\n `league_id` = :leagueID && \r\n `season_id` = :seasonID \" . \r\n $scheduledAfter . \r\n $scheduledBefore;\r\n\r\n $this->dbInstance()->queryParams['params'] = array(\r\n 'leagueID' => $leagueID,\r\n 'seasonID' => $seasonID\r\n );\r\n \r\n $this->dbInstance()->queryParams['order'] = $this->dbInstance()->calcORDERcondition($params, 'sort', 'DESC');\r\n \r\n // $offset = ($page - 1) * $limit;\r\n $this->dbInstance()->queryParams['limit'] = $this->dbInstance()->calcLIMITcondition($params);\r\n $result = $this->dbInstance()->select();\r\n\r\n if(isset($params['extend'])){\r\n if(!is_array($params['extend'])) $params['extend'] = array($params['extend']);\r\n if(in_array('games', $params['extend'])){\r\n foreach ($result as $key => $value) {\r\n $result[$key]['games'] = $this->getSportsDayGames(\r\n $result[$key]['id'], \r\n array(\r\n 'scheduledAfter'=>$params['scheduledAfter'],\r\n 'scheduledBefore'=>$params['scheduledBefore']\r\n )\r\n );\r\n }\r\n }\r\n }\r\n\r\n return $result;\r\n }", "public function run()\n {\n $teams = [\n ['team'=>'Manchester City',\n 'team_id'=>1001,\n 'league_id'=>1,\n 'points'=>77,\n 'wins'=>24,\n 'draws'=>5,\n 'losses'=>4,\n 'gd'=>45,\n 'sport_id'=>1,\n 'img_name'=>'manCity.png'],\n ['team'=>'Manchester United',\n 'team_id'=>1002,\n 'league_id'=>1,\n 'points'=>67,\n 'wins'=>19,\n 'draws'=>10,\n 'losses'=>4,\n 'gd'=>29,\n 'sport_id'=>1,\n 'img_name'=>'manUtd.png'],\n ['team'=>'Leicester City',\n 'team_id'=>1003,\n 'league_id'=>1,\n 'points'=>62,\n 'wins'=>19,\n 'draws'=>5,\n 'losses'=>9,\n 'gd'=>22,\n 'sport_id'=>1,\n 'img_name'=>'leicesterCity.png'],\n ['team'=>'Chelsea',\n 'team_id'=>1004,\n 'league_id'=>1,\n 'points'=>58,\n 'wins'=>16,\n 'draws'=>10,\n 'losses'=>7,\n 'gd'=>20,\n 'sport_id'=>1,\n 'img_name'=>'chelsea.png'],\n ['team'=>'West Ham',\n 'team_id'=>1005,\n 'league_id'=>1,\n 'points'=>55,\n 'wins'=>16,\n 'draws'=>7,\n 'losses'=>10,\n 'gd'=>10,\n 'sport_id'=>1,\n 'img_name'=>'westHam.png'],\n ['team'=>'Liverpool',\n 'team_id'=>1006,\n 'league_id'=>1,\n 'points'=>54,\n 'wins'=>15,\n 'draws'=>9,\n 'losses'=>9,\n 'gd'=>16,\n 'sport_id'=>1,\n 'img_name'=>'liverpool.png'],\n ['team'=>'Tottenham',\n 'team_id'=>1007,\n 'league_id'=>1,\n 'points'=>53,\n 'wins'=>15,\n 'draws'=>8,\n 'losses'=>10,\n 'gd'=>18,\n 'sport_id'=>1,\n 'img_name'=>'tottenham.png'],\n ['team'=>'Everton',\n 'team_id'=>1008,\n 'league_id'=>1,\n 'points'=>52,\n 'wins'=>15,\n 'draws'=>7,\n 'losses'=>10,\n 'gd'=>4,\n 'sport_id'=>1,\n 'img_name'=>'everton.png'],\n ['team'=>'Leeds United',\n 'team_id'=>1009,\n 'league_id'=>1,\n 'points'=>47,\n 'wins'=>14,\n 'draws'=>5,\n 'losses'=>14,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'leedsUtd.png'],\n ['team'=>'Arsenal',\n 'team_id'=>1010,\n 'league_id'=>1,\n 'points'=>46,\n 'wins'=>13,\n 'draws'=>7,\n 'losses'=>13,\n 'gd'=>7,\n 'sport_id'=>1,\n 'img_name'=>'arsenal.png'],\n ['team'=>'Aston Villa',\n 'team_id'=>1011,\n 'league_id'=>1,\n 'points'=>45,\n 'wins'=>13,\n 'draws'=>6,\n 'losses'=>13,\n 'gd'=>9,\n 'sport_id'=>1,\n 'img_name'=>'astonVilla.png'],\n ['team'=>'Wolves',\n 'team_id'=>1012,\n 'league_id'=>1,\n 'points'=>41,\n 'wins'=>11,\n 'draws'=>8,\n 'losses'=>14,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'wolves.png'],\n ['team'=>'Crystal Palace',\n 'team_id'=>1013,\n 'league_id'=>1,\n 'points'=>38,\n 'wins'=>10,\n 'draws'=>8,\n 'losses'=>14,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'crystalPalace.png'],\n ['team'=>'Burnley',\n 'team_id'=>1014,\n 'league_id'=>1,\n 'points'=>36,\n 'wins'=>9,\n 'draws'=>9,\n 'losses'=>15,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'burnley.png'],\n ['team'=>'Southampton',\n 'team_id'=>1015,\n 'league_id'=>1,\n 'points'=>36,\n 'wins'=>10,\n 'draws'=>6,\n 'losses'=>16,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'southampton.png'],\n ['team'=>'Newcastle',\n 'team_id'=>1016,\n 'league_id'=>1,\n 'points'=>36,\n 'wins'=>9,\n 'draws'=>9,\n 'losses'=>15,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'newcastle.png'],\n ['team'=>'Brighton',\n 'team_id'=>1017,\n 'league_id'=>1,\n 'points'=>34,\n 'wins'=>7,\n 'draws'=>13,\n 'losses'=>13,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'brighton.png'],\n ['team'=>'Fullham',\n 'team_id'=>1018,\n 'league_id'=>1,\n 'points'=>27,\n 'wins'=>5,\n 'draws'=>10,\n 'losses'=>18,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'fullham.png'],\n ['team'=>'West Brom',\n 'team_id'=>1019,\n 'league_id'=>1,\n 'points'=>25,\n 'wins'=>5,\n 'draws'=>10,\n 'losses'=>18,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'westBrom.png'],\n ['team'=>'Sheffield United',\n 'team_id'=>1020,\n 'league_id'=>1,\n 'points'=>17,\n 'wins'=>5,\n 'draws'=>2,\n 'losses'=>26,\n 'gd'=>0,\n 'sport_id'=>1,\n 'img_name'=>'sheffieldUtd.png'],\n ];\n\n foreach($teams as $team){\n football::create([\n 'team'=> $team['team'],\n 'team_id'=> $team['team_id'],\n 'league_id'=> $team['league_id'],\n 'points'=> $team['points'],\n 'wins'=> $team['wins'],\n 'draws'=> $team['draws'],\n 'losses'=> $team['losses'],\n 'gd'=> $team['gd'],\n 'sport_id'=> $team['sport_id'],\n 'img_name'=>$team['img_name']\n ]);\n }\n }", "public function CreateMatchesResults($matches_played) {\n\t\t$round_index = 0;\n\n\t\t// Associative array of id => team\n\t\t$teams_list = array();\n\t\tforeach ($this->teams as $team) {\n\t\t\t$teams_list[$team->id] = $team;\n\t\t}\n\n\t\tforeach ($this->rounds as &$matches_planned) {\n\t\t\t$i = 0;\n\t\t\t$skip_branches = 0;\n\t\t\tforeach ($matches_planned as &$match_planned) {\n\t\t\t\t$match_planned['result'] = NULL;\n\t\t\t\t$match_planned['team1'] = NULL;\n\t\t\t\t$match_planned['team2'] = NULL;\n\n\t\t\t\t// Every team plays on first round\n\t\t\t\tif ($round_index == 0) {\n\t\t\t\t\t$match_planned['team1'] = $this->teams[$i];\n\t\t\t\t\t$match_planned['team2'] = ($i + 1 < count($this->teams)) ? $this->teams[$i + 1] : NULL;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Find out which team played\n\t\t\t\t\t$match_index = $i;\n\t\t\t\t\t$last_round = $this->rounds[$round_index - 1];\n\n\t\t\t\t\tif (isset($last_round[$match_index]) &&\n\t\t\t\t\t\t\tisset($last_round[$match_index + 1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$match1 = $last_round[$match_index];\n\t\t\t\t\t\t$match2 = $last_round[$match_index + 1];\n\n\t\t\t\t\t\t$match_result1 = $match1['result'];\n\t\t\t\t\t\t$match_result2 = $match2['result'];\n\n\t\t\t\t\t\tif ($match_result1 && $match_result2) {\n\t\t\t\t\t\t\t$match_planned['team1'] = ($match_result1['winner'] == 1)\n\t\t\t\t\t\t\t\t? $match1['team1']\n\t\t\t\t\t\t\t\t: $match1['team2'];\n\n\t\t\t\t\t\t\t$match_planned['team2'] = ($match_result2['winner'] == 1)\n\t\t\t\t\t\t\t\t? $match2['team1']\n\t\t\t\t\t\t\t\t: $match2['team2'];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($match_planned['team1'] && $match_planned['team2']) {\n\t\t\t\t\t// Match exists, no gap between each match\n\t\t\t\t\t$skip_branches = 0;\n\t\t\t\t\tforeach ($matches_played as $key => &$match_played) {\n\t\t\t\t\t\tif ($match_played['round'] == $round_index &&\n\t\t\t\t\t\t\t\t$match_planned['team1']->id == $match_played['team1_id'] &&\n\t\t\t\t\t\t\t\t$match_planned['team2']->id == $match_played['team2_id'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$match_planned['result'] = $match_played;\n\t\t\t\t\t\t\tunset($matches_played[$key]);\n\t\t\t\t\t\t\tbreak ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//$skip_branches++;\n\t\t\t\t}\n\n\t\t\t\t// Only pass to next teams when it is correctly aligned by preceding round branch\n\t\t\t\tif ($skip_branches % 4 == 0) {\n\t\t\t\t\t$i += 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Seperate played matches which doesn't get into the dynamically generated tree\n\t\t\tif ($round_index > 0) {\n\t\t\t\t// Create empty matches to create gap\n\t\t\t\t$last_nb_matches = count($this->rounds[$round_index - 1]);\n\t\t\t\t$nb_matches = count($this->rounds[$round_index]);\n\t\t\t\t$skip_branches = ceil($last_nb_matches / 2) - $nb_matches;\n\t\t\t\tfor ($i = 0; $i < $skip_branches; $i++) {\n\t\t\t\t\t$this->CreateMatch($round_index, NULL, NULL, NULL);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($matches_played as $key => &$match_played) {\n\t\t\t\tif ($match_played['round'] == $round_index) {\n\t\t\t\t\t$team1_id = (int) $match_played['team1_id'];\n\t\t\t\t\t$team2_id = (int) $match_played['team2_id'];\n\n\t\t\t\t\tif (isset($teams_list[$team1_id]) && isset($teams_list[$team2_id])) {\n\t\t\t\t\t\t$team1 = $teams_list[$team1_id];\n\t\t\t\t\t\t$team2 = $teams_list[$team2_id];\n\t\t\t\t\t\t$this->CreateMatch($round_index, $team1, $team2, $match_played);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$round_index++;\n\t\t}\n\t}", "public function getLeagueSelect($season)\n\t{\t\t\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n $query->select('l.id AS value, l.name AS text');\n $query->from('#__sportsmanagement_league AS l');\n $query->join('INNER','#__sportsmanagement_project AS p on l.id = p.league_id');\n $query->join('INNER','#__sportsmanagement_season AS s on s.id = p.season_id ');\n $query->where('s.id = ' . $season );\n $query->where('s.published = 1');\n $query->where('l.published = 1');\n $query->group('l.name');\n $query->order('l.name');\n \n \n\t\t$db->setQuery($query);\n \n $this->getLeagueSelect = $query->dump();\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t$res = $db->loadObjectList();\n\t\tif ($res) \n {\n $options = array(JHTML::_('select.option', 0, JText::_($this->getParam('leagues_text'))));\n\t\t\t$options = array_merge($options, $res);\n\t\t}\n//\t\treturn JHTML::_('select.genericlist', $options, 'l', 'class=\"jlnav-select\"', 'value', 'text', $this->getLeagueId());\n\t\treturn $options;\n\t}", "function played_matches() \n\t{\n\t\t$fecha=$this->weekStartEnd(mdate(\"%Y-%m-%d\",time()));\n\t\t$query=$this->db->query('SELECT mh . * , ma.aid, ma.aname, c.id, c.name\n\t\t\t\t\t\t FROM (SELECT m . * , t.id hid, t.name AS hname\n\t\t\t\t\t\t FROM matches AS m, matches_teams AS mt, teams AS t\n\t\t\t\t\t\t WHERE mt.match_id = m.id AND mt.team_id_home = t.id) AS mh, \n\t\t\t\t\t\t (SELECT m . * , t.id aid, t.name AS aname\n\t\t\t\t\t\t FROM matches AS m, matches_teams AS mt, teams AS t\n\t\t\t\t\t\t WHERE mt.match_id = m.id AND mt.team_id_away = t.id ) AS ma,\n\t\t\t\t\t\t championships as c, rounds as r, groups as g\n\t\t\t\t\t\t WHERE mh.id = ma.id AND mh.date_match <\"'.mdate(\"%Y-%m-%d %h:%i:%s\",time()).'\" AND mh.date_match > \"'.$fecha['start'].' 00:00:00\" AND mh.group_id = g.id AND g.round_id = r.id AND r.championship_id=c.id \n\t\t\t\t\t\t ORDER BY c.name, mh.date_match ASC');\n\t\treturn $query;\n\t}", "function display_teamsingleschedule($season, $team, $output = 'html', $week = null)\n{\n\tglobal $tpl, $db;\n\n\tif (empty($season)) {\n\t\t// default to this year\n\t\t$season = get_current_season();\n\t}\n\n\tif (!is_numeric($season)) {\n\t\tdisplay_message(\"Invalid season\", SCHEDULE_HEADER);\n\t\treturn;\n\t}\n\n\t$user = user_logged_in();\n\n\t$gamesstmt = $db->prepare('SELECT games.week, games.start, games.home_score, games.away_score, home_teams.abbreviation AS home_team_abbr, away_teams.abbreviation AS away_team_abbr FROM ' . TOTE_TABLE_GAMES . ' AS games LEFT JOIN ' . TOTE_TABLE_SEASONS . ' AS seasons ON games.season_id=seasons.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS home_teams ON games.home_team_id=home_teams.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS away_teams ON games.away_team_id=away_teams.id WHERE seasons.year=:year AND (games.away_team_id=:away_team_id OR games.home_team_id=:home_team_id) ORDER BY week');\n\t$gamesstmt->bindParam(':year', $season, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':away_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':home_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->execute();\n\n\t$tz = date_default_timezone_get();\n\tdate_default_timezone_set('UTC');\n\t$teamgames = array();\n\twhile ($game = $gamesstmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$game['start'] = strtotime($game['start']);\n\t\t$game['localstart'] = get_local_datetime($game['start'], (!empty($user['timezone']) ? $user['timezone'] : null));\n\t\t$teamgames[(int)$game['week']] = $game;\n\t}\n\tdate_default_timezone_set($tz);\n\t\n\t$gamesstmt = null;\n\n\t$seasonweeks = get_season_weeks($season);\n\n\tfor ($i = 1; $i <= $seasonweeks; $i++) {\n\t\tif (!isset($teamgames[$i])) {\n\t\t\t$teamgames[$i] = array('bye' => true);\n\t\t}\n\t}\n\tksort($teamgames);\n\n\t$teamstmt = $db->prepare('SELECT teams.home, teams.team FROM . ' . TOTE_TABLE_TEAMS . ' WHERE id=:team_id');\n\t$teamstmt->bindParam(':team_id', $team, PDO::PARAM_INT);\n\t$teamstmt->execute();\n\t$teamobj = $teamstmt->fetch(PDO::FETCH_ASSOC);\n\t$teamstmt = null;\n\n\thttp_headers();\n\n\t$tpl->assign('team', $teamobj);\n\tif (empty($week)) {\n\t\t$tpl->assign('allseasons', array_reverse(get_seasons()));\n\t}\n\t$mobile = mobile_browser();\n\tif ($mobile) {\n\t\t$tpl->assign('mobile', true);\n\t}\n\n\t$tpl->assign('year', $season);\n\t$tpl->assign('games', $teamgames);\n\tif (!empty($week))\n\t\t$tpl->assign('week', $week);\n\n\tif ($output == 'js')\n\t\t$tpl->assign('js', true);\n\n\t$tpl->display('teamsingleschedule.tpl');\n}", "public function index()\n {\n $season = DB::table('tblleague')->orderBy('League', 'DESC')->First();\n\n $ranks = DB::table('tblclubstats')\n ->select(DB::raw('count(club) as matches, sum(win) as win, sum(lose) as lose, sum(draw) as draw, sum(goalsFor) as goalsFor, sum(goalsAgainst) as goalsAgainst, sum(points) as points, sum(goalsDiff) as diff, club, League'))\n ->where('League', $season->League)\n ->orderBy('points', 'DESC')\n ->orderBy('diff', 'DESC')\n ->groupBy('club', 'League')\n ->get();\n\n $goals = DB::table('tblplayerstats')\n ->select(DB::raw('sum(goals) as goals, player, League'))\n ->where('League', $season->League)\n ->orderBy('goals', 'DESC')\n ->groupBy('player', 'League')\n ->paginate(6);\n\n $assists = DB::table('tblplayerstats')\n ->select(DB::raw('sum(assists) as assists, player, League'))\n ->where('League', $season->League)\n ->orderBy('assists', 'DESC')\n ->groupBy('player', 'League')\n ->paginate(6);\n\n (!empty($ranks)) ? $ranks = $ranks : $ranks = 'Null';\n (!empty($goals)) ? $goals = $goals : $goals = 'Null';\n (!empty($assists)) ? $assists = $assists : $assists = 'Null';\n\n return view('ranks', compact('ranks', 'season', 'goals', 'assists'));\n }", "public function testRanking()\n {\n\n $results = [\n\n [\n \"bracket\" => \"WB\",\n \"rounds\" => [\n [\n\n \"round\" => 1,\n \"matches\" => [\n [\n \"name\" => \"1.1\",\n \"scores\" => [\n [\"player_id\" => \"Dan\", \"score\" => 2],\n [\"player_id\" => \"Taru\", \"score\" => 0],\n ]\n ],\n [\n \"name\" => \"1.2\",\n \"scores\" => [\n [\"player_id\" => \"Michael\", \"score\" => 1],\n [\"player_id\" => \"JP\", \"score\" => 0],\n ]\n ],\n [\n \"name\" => \"1.3\",\n \"scores\" => [\n [\"player_id\" => \"Phelix\", \"score\" => 0],\n [\"player_id\" => \"Sykes\", \"score\" => 2],\n ]\n ],\n [\n \"name\" => \"1.4\",\n \"scores\" => [\n [\"player_id\" => \"Calvin\", \"score\" => 1],\n [\"player_id\" => \"Jordan\", \"score\" => 4],\n ]\n ]\n ]\n ],\n [\n \"round\" => 2,\n \"matches\" => [\n [\n \"name\" => \"2.1\",\n \"scores\" => [\n [\"player_id\" => \"Jordan\", \"score\" => 2],\n [\"player_id\" => \"Sykes\", \"score\" => 1],\n ]\n ],\n [\n \"name\" => \"2.2\",\n \"scores\" => [\n [\"player_id\" => \"Michael\", \"score\" => 0],\n [\"player_id\" => \"Dan\", \"score\" => 5],\n ]\n ]\n ]\n ],\n [\n \"round\" => 3,\n \"matches\" => [\n [\n \"name\" => \"3.1\",\n \"scores\" => [\n [\"player_id\" => \"Dan\", \"score\" => 1],\n [\"player_id\" => \"Jordan\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 4,\n \"matches\" => [\n [\n \"name\" => \"4.1\",\n \"scores\" => [\n [\"player_id\" => \"Dan\", \"score\" => 2],\n [\"player_id\" => \"Phelix\", \"score\" => 4],\n ]\n ]\n ]\n ]\n ]\n ],\n [\n \"bracket\" => \"LB\",\n \"rounds\" => [\n\n [\n\n \"round\" => 1,\n \"matches\" => [\n [\n \"name\" => \"1.1L\",\n \"scores\" => [\n [\"player_id\" => \"Phelix\", \"score\" => 1],\n [\"player_id\" => \"Taru\", \"score\" => 0],\n ]\n ],\n [\n \"name\" => \"1.2L\",\n \"scores\" => [\n [\"player_id\" => \"JP\", \"score\" => 2],\n [\"player_id\" => \"Calvin\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 2,\n \"matches\" => [\n [\n \"name\" => \"2.1L\",\n \"scores\" => [\n [\"player_id\" => \"Sykes\", \"score\" => 2],\n [\"player_id\" => \"Phelix\", \"score\" => 3],\n ]\n ],\n [\n \"name\" => \"2.2L\",\n \"scores\" => [\n [\"player_id\" => \"Michael\", \"score\" => 2],\n [\"player_id\" => \"JP\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 3,\n \"matches\" => [\n [\n \"name\" => \"3.1L\",\n \"scores\" => [\n [\"player_id\" => \"Phelix\", \"score\" => 2],\n [\"player_id\" => \"Michael\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 4,\n \"matches\" => [\n [\n \"name\" => \"4.1L\",\n \"scores\" => [\n [\"player_id\" => \"Jordan\", \"score\" => 2],\n [\"player_id\" => \"Phelix\", \"score\" => 3],\n ]\n ]\n ]\n ]\n ]\n ]\n ];\n\n $response = DoubleElimination::generateStageLeaderboard($results);\n\n //print_r($response);\n\n $this->assertNotEmpty($response);\n }", "function b_minitable_show( ) {\n global $xoopsDB;\n $module_handler =& xoops_gethandler('module');\n $module =& $module_handler->getByDirname('cricketstats');\n //Get config for News module\n $config_handler =& xoops_gethandler('config');\n if ($module) {\n $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));\n }\n \n //Season id\n $sql = \"SELECT SeasonID, SeasonName FROM \".$xoopsDB->prefix(\"cricket_seasonnames\").\" WHERE SeasonDefault=1\";\n $cricket_seasonname = $xoopsDB->query($sql);\n $cricket_seasonname = $xoopsDB->fetchArray($cricket_seasonname);\n $cricket_season_id = $cricket_seasonname['SeasonID'];\n $cricket_seasonname = $cricket_seasonname['SeasonName']; \n \n //League id\n $sql2 = \"SELECT LeagueID, LeagueName FROM \".$xoopsDB->prefix(\"cricket_leaguenames\").\" WHERE LeagueDefault=1\";\n $cricket_leaguename = $xoopsDB->query($sql2);\n $cricket_leaguename = $xoopsDB->fetchArray($cricket_leaguename);\n $cricket_league_id = $cricket_leaguename['LeagueID'];\n $cricket_leaguename = $cricket_leaguename['LeagueName']; \n\n //For win, draw and lost?\n $cricket_for_win = $moduleConfig['forwin'];\n $cricket_for_draw = $moduleConfig['fordraw'];\n $cricket_for_lose = $moduleConfig['forloss'];\n \n //Query to get teams from selected season & league\n $cricket_get_teams = $xoopsDB->query(\"SELECT DISTINCT\n O.OpponentName AS name,\n O.OpponentID AS id\n FROM \".$xoopsDB->prefix(\"cricket_opponents\").\" O, \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n WHERE LM.LeagueMatchSeasonID = '$cricket_season_id' AND\n\t\t\t\t\t\tLM.LeagueMatchLeagueID = '$cricket_league_id' AND\n (O.OpponentID = LM.LeagueMatchHomeID OR\n O.OpponentID = LM.LeagueMatchAwayID)\n ORDER BY name\");\n \n //Lets read teams into the table\n $i = 0;\n while($cricket_data = $xoopsDB->fetchArray($cricket_get_teams))\n {\n $team[$cricket_data['id']]['name'] = $cricket_data['name'];\n $team[$cricket_data['id']]['homewins'] = 0;\n $team[$cricket_data['id']]['awaywins'] = 0;\n $team[$cricket_data['id']]['homeloss'] = 0;\n $team[$cricket_data['id']]['awayloss'] = 0;\n $team[$cricket_data['id']]['hometie'] = 0;\n $team[$cricket_data['id']]['awaytie'] = 0;\n $team[$cricket_data['id']]['homerunsfor'] = 0;\n $team[$cricket_data['id']]['homerunsagainst'] = 0;\n $team[$cricket_data['id']]['awayrunsfor'] = 0;\n $team[$cricket_data['id']]['awayrunsagainst'] = 0;\n $team[$cricket_data['id']]['matches'] = 0;\n }\n \n //Match data\n $query = $xoopsDB->query(\"SELECT\n LM.LeagueMatchID AS mid, \n LM.LeagueMatchHomeID as homeid,\n LM.LeagueMatchAwayID as awayid, \n LM.LeagueMatchHomeRuns as homeruns,\n LM.LeagueMatchAwayRuns as awayruns \n FROM\n \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n \tWHERE\n LM.LeagueMatchSeasonID = '$cricket_season_id' AND LM.LeagueMatchLeagueID = '$cricket_league_id' AND\n\t\t\t\t\t\t\t\tLM.LeagueMatchHomeRuns IS NOT NULL\");\n while ($cricket_matchdata = $xoopsDB->fetchArray($query)) {\n $cricket_hometeam = $cricket_matchdata['homeid'];\n $cricket_awayteam = $cricket_matchdata['awayid'];\n \n $team[$cricket_hometeam]['matches'] = $team[$cricket_hometeam]['matches'] + 1;\n $team[$cricket_awayteam]['matches'] = $team[$cricket_awayteam]['matches'] + 1;\n \n $team[$cricket_hometeam]['homerunsfor'] = $team[$cricket_hometeam]['homerunsfor'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsagainst'] = $team[$cricket_awayteam]['awayrunsagainst'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsfor'] = $team[$cricket_awayteam]['awayrunsfor'] + $cricket_matchdata['awayruns'];\n $team[$cricket_hometeam]['homerunsagainst'] = $team[$cricket_hometeam]['homerunsagainst'] + $cricket_matchdata['awayruns'];\n \n $rundiff = $cricket_matchdata['homeruns'] - $cricket_matchdata['awayruns'];\n if ($rundiff > 0) {\n $team[$cricket_hometeam]['homewins'] = $team[$cricket_hometeam]['homewins'] + 1;\n $team[$cricket_awayteam]['awayloss'] = $team[$cricket_awayteam]['awayloss'] + 1;\n }\n elseif ($rundiff == 0) {\n $team[$cricket_hometeam]['hometie'] = $team[$cricket_hometeam]['hometie'] + 1;\n $team[$cricket_awayteam]['awaytie'] = $team[$cricket_awayteam]['awaytie'] + 1;\n }\n elseif ($rundiff < 0) {\n $team[$cricket_hometeam]['homeloss'] = $team[$cricket_hometeam]['homeloss'] + 1;\n $team[$cricket_awayteam]['awaywins'] = $team[$cricket_awayteam]['awaywins'] + 1;\n }\n }\n $cricket_get_deduct = $xoopsDB->query(\"SELECT points, teamid FROM \".$xoopsDB->prefix(\"cricket_deductedpoints\").\" WHERE seasonid = '$cricket_season_id' AND leagueid = '$cricket_league_id'\");\n while ($cricket_d_points = $xoopsDB->fetchArray($cricket_get_deduct)) {\n $team[$cricket_d_points[\"teamid\"]]['d_points'] = $cricket_d_points['points'];\n }\n foreach ($team as $teamid => $thisteam) {\n $temp_points = isset($thisteam['d_points']) ? $thisteam['d_points'] : 0;\n $cricket_points[$teamid] = ($thisteam['homewins'] * $cricket_for_win) + ($thisteam['awaywins'] * $cricket_for_win) + ($thisteam['hometie'] * $cricket_for_draw) + ($thisteam['awaytie'] * $cricket_for_draw) + $temp_points;\n $cricket_runsfor[$teamid] = $thisteam['homerunsfor'] + $thisteam['awayrunsfor'];\n $cricket_runsagainst[$teamid] = $thisteam['homerunsagainst'] + $thisteam['awayrunsagainst'];\n }\n array_multisort($cricket_points, SORT_NUMERIC, SORT_DESC, $cricket_runsfor, SORT_NUMERIC, SORT_DESC, $cricket_runsagainst, SORT_NUMERIC, SORT_DESC, $team, SORT_STRING, SORT_ASC);\n \n //Print the table\n $block['title'] = _BL_CRICK_MINITABLE;\n $block['content'] = \"<table width='100%' cellspacing='2' cellpadding='2' border='0'>\n <tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_TEAM.\"</u></span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_POINTS.\"</u></span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_RUNS.\"</u></span></td> \n </tr></table><marquee behavior='scroll' direction='up' width='100%' height='100' scrollamount='1' scrolldelay='60' onmouseover='this.stop()' onmouseout='this.start()'><table width='100%' cellspacing='2' cellpadding='2' border='0'>\";\n foreach ($team as $teamid => $thisteam)\n {\n $block['content'] .= \"<tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: normal;'>\".$thisteam['name'].\"</span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_points[$teamid].\"</span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_runsfor[$teamid].\"-\".$cricket_runsagainst[$teamid].\"</span></td>\n </tr>\";\n }\n $block['content'] .= \"</table><br><div align=\\\"center\\\"><a href=\\\"\".XOOPS_URL.\"/modules/cricketstats/index.php\\\">\"._BL_CRICK_GOTOMAIN.\"</a></div></marquee>\";\n return $block;\n}", "function ShowTeamShowPlayers($team_id,$team_sub_id,$game_id,$mode = 1,$allowed_player_id = 0){\n\t\n\tglobal $db_league_players,$db_admin,$db_admin_guids,$db_clan_games;\n\t\n\tif ($mode == 2){\n\t\t$admin_guids = \"\";\n\t\t$sub_team = \"\";\n\t} else {\n\t\t$res_game = mysql_query(\"SELECT clan_games_game FROM $db_clan_games WHERE clan_games_id = \".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t$ar_game = mysql_fetch_array($res_game);\n\t\t$sub_team = \"<tr style=\\\"background: #DCE3F1;\\\">\\n\";\n\t\t$sub_team .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">Sub Team - \".$ar_game['clan_games_game'].\"</td>\\n\";\n\t \t$sub_team .= \"</tr>\\n\";\n\t}\n\t$output = $sub_team;\n\t$res_player = mysql_query(\"\n\tSELECT a.admin_id, a.admin_nick, a.admin_team_own_id, ag.admin_guid_guid, lp.league_player_id, lp.league_player_position_captain, lp.league_player_position_assistant, lp.league_player_position_player \n\tFROM $db_league_players AS lp \n\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\tLEFT JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_game_id=\".(integer)$game_id.\" \n\tWHERE lp.league_player_team_id=\".(integer)$team_id.\" AND lp.league_player_game_id=\".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$num = mysql_num_rows($res_player);\n\t$output .= \"<tr style=\\\"background: #ff8080;\\\">\\n\";\n\tif ($num > 0){\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\" class=\\\"eden_title_middle\\\">ID</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_POSITION.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\"></td>\\n\";\n\t} else {\n\t\t$output .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_TEAM_NO_PLAYER_IN_SUB.\"</td>\\n\";\n\t}\n\t$output .= \"</tr>\\n\";\n\t$cislo = 0;\n\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level2_even\";} else { $cat_class = \"cat_level2_odd\";}\n\t\t$output .= \"<tr class=\\\"\".$cat_class.\"\\\">\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\">\";\n\t\t\t\t\t\tif ($mode == 2){\n\t\t\t\t\t\t\t$output .= \"<img src=\\\"./images/sys_\"; \n\t\t\t\t\t\t\tif (in_array($ar_player['league_player_id'],$allowed_player_id)){\n\t\t\t\t\t\t\t\t$output .= \"yes\"; $alt = _LEAGUE_PLAYER_PLAY;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$output .= \"no\"; $alt = _LEAGUE_PLAYER_NO_PLAY;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t$output .= \".gif\\\" width=\\\"15\\\" height=\\\"15\\\" alt=\\\"\".$alt.\"\\\" title=\\\"\".$alt.\"\\\"> \"; \n\t\t\t\t\t\t} \n\t\t\t\t\t\t$output .= \"<strong>\".stripslashes($ar_player['admin_nick']).\"</strong>\";\n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; \n\t\t\t\t\tif (LeagueCheckPrivileges(\"O\",$ar_player['admin_id'],$team_id,\"\") == $team_id){$output .= _LEAGUE_PLAYER_POSITION_O; $comma = \", \";} else {$comma = \"\";}\n\t\t\t\t\tif (LeagueCheckPrivileges(\"C\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_C;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"A\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_A;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"P\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_P;} \n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if ($ar_player['admin_guid_guid'] != \"\"){ $output .= stripslashes($ar_player['admin_guid_guid']);} else {$output .= \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} $output .= \"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\"></td>\\n\";\n\t\t$output .= \"</tr>\\n\";\n\t\t$cislo++;\n\t}\n\t\n\treturn $output;\n}", "function next_games($championship,$num){\n\t\t$query=$this->db->query('Select m.*, t1.name as t1name,t2.name as t2name, UNIX_TIMESTAMP(m.date_match) as dm \n\t\t\t\t\t\t \t\t From matches as m, matches_teams as mt, teams as t1, teams as t2, groups as g, rounds as r, championships as c \n\t\t\t\t\t\t \t\t Where c.id='.$championship.' AND c.id=r.championship_id AND r.id=g.round_id AND g.id=m.group_id AND m.id=mt.match_id AND mt.team_id_home=t1.id AND mt.team_id_away=t2.id AND m.state=0 AND m.date_match > \"'.mdate(\"%Y-%m-%d 00:00:00\").'\"\n\t\t\t\t\t\t \t\t Order by date_match ASC\n\t\t\t\t\t\t \t\t Limit 0,'.$num);\n\t\t\n\t\t$partido=array();\n\t\t$i=0;\n\t\tforeach($query->result() as $row):\n\t\t\t$partido[$i]['id']=$row->id;\n\t\t\t$partido[$i]['fecha']=mdate(\"%Y/%m/%d\",$row->dm);\n\t\t\t$partido[$i]['hora']=mdate(\"%h:%i\",$row->dm);\n\t\t\t$partido[$i]['hequipo']=$row->t1name;\n\t\t\t$partido[$i]['aequipo']=$row->t2name;\n\t\t\t$i+=1;\n\t\tendforeach;\n\t\t\n\t\treturn $partido;\n\t}", "public function getPlayers();", "public function getPlayers();", "public function index()\n {\n //get current user's id\n $user = Auth::User()->id;\n $league = League::find(1);\n $league_id = $league->id;\n\n //search players through user and league id's\n $teamMappings = Team::where('user_id', $user)->where('league_id', $league_id)->get();\n\n $playerIds = [];\n foreach ($teamMappings as $mapping) {\n $playerIds[] = $mapping->player_id;\n }\n\n $players = Player::whereIn('id', $playerIds)->get();\n\n\n return view('myteam', compact('players'));\n\n }", "function divisions($sc2id) {\n\t\t\n\t\t$bnetprofile = ($sc2id);\n \t$html = file_get_contents($bnetprofile);\n \t\n \t$preg_fourvfour = preg_match_all(\n\t\t'/<div class=\"ladder\" data-tooltip=\"#best-team-4\">.*?<span class=\"(.*?)\">.*?<div class=\"tooltip-title\">Highest Ranked in 4v4<\\/div>.*?<strong>Division:<\\/strong> (.*?)<br \\/>.*?<strong>Rank:<\\/strong> (.*?)<\\/div>/s',\n\t\t$html,\n\t\t$games,\n\t\tPREG_SET_ORDER\n\t\t);\n\t\n\t\t\n\t\treturn $games;\n\t}", "function insertLastYearGames() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2017-10-04&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO LastYear_Games VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "function season_by_week($season_start, $season_end, $type=\"schedule\", $sport_id=1, $week_current=0, $conference_id=0)\n{\n $season_start = strtotime($season_start);\n $season_end = strtotime($season_end);\n $seconds_in_a_week = 604800;\n \n // How many weeks are in a season?\n $season_weeks = round(( $season_end - $season_start ) / $seconds_in_a_week);\n \n $this_week = round(( time() - $season_start ) / $seconds_in_a_week);\n if ( $this_week < 0 ) $this_week = 0;\n\n switch ( strtolower($type) )\n {\n case \"schedule\":\n $week_start = $this_week;\n break;\n case \"results\":\n $week_start = 0;\n $season_weeks = $this_week;\n break;\n default:\n \n $week_start = 0;\n break;\n }\n\n\n //echo \"<dd>Weeks: $season_weeks</dd>\";\n //echo \"<dd>This week: $this_week</dd>\";\n //echo \"<dd>Week start: $week_start</dd>\";\n \n if ( $conference_id > 0 )\n {\n $conference_link = \"&ConferenceID=$conference_id\";\n }\n \n // Loop through the weeks, put the dates in an array.\n $return = \"\";\n for ( $i = $week_start; $i <= $season_weeks; $i ++ )\n {\n $week_display = $i + 1;\n $timestamp = $season_start + ( $seconds_in_a_week * $i );\n $week[$i] = week_generate($timestamp);\n \n $link = \"/home.html?site=default&tpl=Schedule&Sport=\" . $sport_id . \"&SearchDate=\" . date(\"m/d/Y\", $week[$i][0]) . \"&SearchDateEnd=\" . date(\"m/d/Y\", $week[$i][1]) . \"&start=0&count=250&Week=\" . $week_display . $conference_link;\n \n \n \n if ( $week_current == $week_display )\n {\n $return .= $week_display . \" \";\n }\n else\n {\n $return .= \"<a href=\" . $link . \" class=pageNumberLink>\" . $week_display . \"</a> \";\n }\n \n }\n return $return;\n}", "public function index()\n {\n return response(League::withCount('teams')->get());\n }", "function printStatsPlayers($players) {\n\n\t\t$report = \"Player Stats:\\n\"\n\t\t\t. \"=============\\n\"\n\t\t\t;\n\n\t\tforeach ($players as $key => $value) {\n\t\t\t//$this->logger->info(\"Player: \" . json_encode($value->getStats()));\n\t\t\t$stats = $value->getStats();\n\n\t\t\t$report .= sprintf(\"\"\n\t\t\t\t. \"%15s: %20s\\n\"\n\t\t\t\t. \"%15s: %10d\\n\"\n\t\t\t\t. \"%15s: %10d\\n\"\n\t\t\t\t. \"%15s: %10d\\n\"\n\t\t\t\t. \"%15s: %10d\\n\"\n\t\t\t\t. \"%15s: %10d\\n\"\n\t\t\t\t. \"%15s: %10d\\n\"\n\t\t\t\t. \"%15s: $this->green%10.2f$this->default\\n\"\n\t\t\t\t. \"%15s: $this->red%10.2f$this->default\\n\"\n\t\t\t\t. \"%15s: %10.2f\\n\"\n\t\t\t\t. \"\\n\",\n\t\t\t\t\"Name\", $stats[\"name\"],\n\t\t\t\t\"Games Played\", $stats[\"stats\"][\"num_games\"],\n\t\t\t\t\"Bet\", $stats[\"stats\"][\"strategy\"][\"bet\"],\n\t\t\t\t\"Took Odds?\", $stats[\"stats\"][\"strategy\"][\"take_odds\"],\n\t\t\t\t\"Bail At\", $stats[\"stats\"][\"strategy\"][\"bail_at\"],\n\t\t\t\t\"Wins\", $stats[\"stats\"][\"wins\"],\n\t\t\t\t\"Losses\", $stats[\"stats\"][\"losses\"],\n\t\t\t\t\"Amount Won\", $stats[\"stats\"][\"amount_won\"],\n\t\t\t\t\"Amount Lost\", $stats[\"stats\"][\"amount_lost\"],\n\t\t\t\t\"Balance\", $stats[\"balance\"]\n\t\t\t\t);\n\n\t\t}\n\n\t\tprint $report;\n\n\t}", "function ShowInfoPlayers($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idPlace, PondFishesPlace, FishedFishesPlace, ReleasedFishesPlace, OrderPlace, PseudoPlayer, RankingPlayer, DescriptionStatus FROM fishermenland.place\n INNER JOIN fishermenland.player ON place.fkPlayerPlace = player.idPlayer\n INNER JOIN fishermenland.status ON place.fkStatusPlace = status.idStatus WHERE fkGamePlace = '$idGame' ORDER BY OrderPlace ASC\");\n\n return $req;\n}", "function get_mil_fielding_stats($player_id) {\n global $db;\n $query = 'SELECT f.player_id,\n f.year,\n f.year - YEAR(p.date_of_birth) AS age,\n f.team_id,\n f.league_id,\n l.abbr as league,\n f.level_id,\n f.split_id,\n po.pos_name,\n f.tc,\n f.a,\n f.po,\n f.er,\n f.ip,\n f.g,\n f.gs,\n f.e,\n f.dp,\n f.tp,\n f.pb,\n f.sba,\n f.rto,\n f.ipf,\n f.plays,\n f.plays_base,\n f.roe,\n f.opps_0,\n f.opps_made_0,\n f.opps_1,\n f.opps_made_1,\n f.opps_2,\n f.opps_made_2,\n f.opps_3,\n f.opps_made_3,\n f.opps_4,\n f.opps_made_4,\n f.opps_5,\n f.opps_made_5,\n f.zr,\n concat(p.first_name,\" \",p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM players_career_fielding_stats f INNER JOIN players p ON\n f.player_id = p.player_id\n INNER JOIN teams t ON f.team_id = t.team_id\n INNER JOIN positions po ON f.position = po.position\n INNER JOIN leagues l ON b.league_id = l.league_id\n WHERE f.level_id <> 1 AND f.player_id = :player_id\n ORDER BY f.year, f.level_id, t.abbr, po.pos_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':player_id', $player_id);\n $statement->execute();\n $mil_fielding_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $mil_fielding_stats;\n}", "public function test2014TeamsSuccessfulResponse()\n {\n $client = new DebugClient($_SERVER['FANTASY_DATA_API_KEY'], Subscription::KEY_DEVELOPER);\n\n /** @var \\GuzzleHttp\\Command\\Model $result */\n $result = $client->Teams(['Season' => '2014']);\n\n $response = $client->mHistory->getLastResponse();\n\n $this->assertEquals('200', $response->getStatusCode());\n\n /** we expect 32 teams for 2014 */\n $this->assertCount( 32, $result );\n\n $check_team_keys = function ( $pTeam )\n {\n /** we expect 19 stats (woah!) */\n $this->assertCount( 19, $pTeam );\n\n $cloned_array = $pTeam;\n\n /** this function helps us assure that we're not missing any keys in the Enum list */\n $process_key = function ( $pKey ) use ( $pTeam, &$cloned_array )\n {\n $this->assertArrayHasKey( $pKey, $pTeam );\n unset( $cloned_array[$pKey] );\n\n if ( Teams\\Property::KEY_STADIUM_DETAILS == $pKey )\n {\n $pStadium = $pTeam[$pKey];\n\n /** we expect 7 keys */\n $this->assertCount( 7, $pStadium );\n\n $cloned_stadium = $pStadium;\n\n $process_stadium = function ( $pStadiumKey ) use ( $pStadium, &$cloned_stadium )\n {\n $this->assertArrayHasKey( $pStadiumKey, $pStadium );\n unset( $cloned_stadium[$pStadiumKey] );\n };\n\n /** test all the stadium keys */\n $process_stadium( Stadium\\Property::KEY_CAPACITY );\n $process_stadium( Stadium\\Property::KEY_CITY );\n $process_stadium( Stadium\\Property::KEY_COUNTRY );\n $process_stadium( Stadium\\Property::KEY_NAME );\n $process_stadium( Stadium\\Property::KEY_PLAYING_SURFACE );\n $process_stadium( Stadium\\Property::KEY_STADIUM_ID );\n $process_stadium( Stadium\\Property::KEY_STATE );\n }\n };\n\n /** test all the keys */\n $process_key( Teams\\Property::KEY_CITY );\n $process_key( Teams\\Property::KEY_CONFERENCE );\n $process_key( Teams\\Property::KEY_DIVISION );\n $process_key( Teams\\Property::KEY_FULL_NAME );\n $process_key( Teams\\Property::KEY_KEY );\n $process_key( Teams\\Property::KEY_NAME );\n $process_key( Teams\\Property::KEY_STADIUM_DETAILS );\n $process_key( Teams\\Property::KEY_STADIUM_ID );\n\n /** 06/07/2014 Update */\n $process_key( Teams\\Property::KEY_AVERAGE_DRAFT_POSITION );\n $process_key( Teams\\Property::KEY_AVERAGE_DRAFT_POSITION_PPR );\n $process_key( Teams\\Property::KEY_BYE_WEEK );\n $process_key( Teams\\Property::KEY_DEFENSIVE_COORDINATOR );\n $process_key( Teams\\Property::KEY_DEFENSIVE_SCHEME );\n $process_key( Teams\\Property::KEY_HEAD_COACH );\n $process_key( Teams\\Property::KEY_OFFENSIVE_COORDINATOR );\n $process_key( Teams\\Property::KEY_OFFENSIVE_SCHEME );\n $process_key( Teams\\Property::KEY_SPECIAL_TEAMS_COACH );\n $process_key( Teams\\Property::KEY_TEAM_ID );\n\n /** ?? */\n $process_key( Teams\\Property::KEY_PLAYER_ID );\n\n $this->assertEmpty( $cloned_array );\n };\n\n $stats = $result->toArray();\n\n array_walk( $stats, $check_team_keys );\n }", "function insertLastFiveYears() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n // all games from the start of the 2013-2014 season to 2017-2018 season\n $all_games = \"/v1/schedule?startDate=2013-10-01&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO Games_Last5Years VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n\n // skip over playoff games\n if(strcmp($item->games[$i]->gameType, \"P\") == 0) {\n break;\n }\n\n\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // skip over all star games and team that is not in the nhl anymore (27)\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87 || $home_id == 93 || $home_id == 94 ||\n $home_id == 27 || $away_id == 27) {\n continue;\n }\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "protected function processResultsByGame($ws,$level,&$poolCount,&$newPool,$games, $header='Match Results',$headerLabels)\n {\n }", "public function index()\n\t{\n\t\t$eu_standings = LeagueStanding::where(\"league_id\", \"=\", 11)->orderBy(\"rank\", \"ASC\")->get();\n\t\t$na_standings = LeagueStanding::where(\"league_id\", \"=\", 19)->orderBy(\"rank\", \"ASC\")->get();\n\t\t\n\t\t$cs_eu_standings = LeagueStanding::where(\"league_id\", \"=\", 40)->orderBy(\"rank\", \"ASC\")->get();\n\t\t$cs_na_standings = LeagueStanding::where(\"league_id\", \"=\", 41)->orderBy(\"rank\", \"ASC\")->get();\n\t\t\n\t\t$ogn = League::find(3);\n\t\t$gpl = League::find(4);\n\t\t$lpl = League::find(5);\n\t\t$lms = League::find(38);\n\n\t\treturn View::make('teams.index', compact('na_standings', 'ogn', 'gpl', 'lpl','lms', 'eu_standings', 'cs_eu_standings', 'cs_na_standings'));\n\t}", "function getRank($player, $season, $type) {\n\tif ($type == 'Ladder') { // We rank ladder standings by RPI\n\t\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t\t$players = array();\n\n\n\t\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE LadderSeason = '$season'\");\n\t\twhile($row = mysqli_fetch_assoc($playerResult)) {\n\t\t\t$players[] = $row;\n\t\t}\n\n\t\tforeach($players as $key => $value) {\n\t\t\t$players[$key]['rpi'] = getRPI($players[$key]['PlayerID'], $season, $type);\n\t\t}\n\n\t\tforeach ($players as $key => $row) {\n\t\t\t$rpi[$key] = $row['rpi'];\n\t\t}\n\n\t\tarray_multisort($rpi, SORT_DESC, $players);\n\t\t\n\t\tforeach ($players as $key => $value) {\n\t\t\tif ($players[$key]['PlayerID'] === $player) {\n\t\t\t\treturn $key+1;\n\t\t\t}\n\t\t}\n\n\t} else { // We rank league standings by least number of losses with an RPI tie-breaker\n\t\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t\t$players = array();\n\n\n\t\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE LadderSeason = '$season'\");\n\t\twhile($row = mysqli_fetch_assoc($playerResult)) {\n\t\t\t$players[] = $row;\n\t\t}\n\n\t\tforeach($players as $key => $value) {\n\t\t\t$players[$key]['losses'] = substr(getRecord($players[$key]['PlayerID'], $season, $type), -1);\n\t\t}\n\n\t\tforeach ($players as $key => $row) {\n\t\t\t$losses[$key] = $row['losses'];\n\t\t}\n\n\t\tarray_multisort($losses, SORT_ASC, $players);\n\t\t\n\t\tforeach ($players as $key => $value) {\n\t\t\tif ($players[$key]['PlayerID'] === $player) {\n\t\t\t\treturn $key+1;\n\t\t\t}\n\t\t}\n\t}\n}", "public function getTeams();", "public function getStatistics($seasonId)\n {\n $query = \"SELECT IPLAYER.id, IPLAYER.voornaam AS firstname, IPLAYER.naam AS name, \n ISPS.gespeelde_sets AS setsPlayed, ISPS.gewonnen_sets AS setsWon, ISPS.gespeelde_punten AS pointsPlayed,\n ISPS.gewonnen_punten AS pointsWon, ISPS.gespeelde_matchen as matchesPlayed, ISPS.gewonnen_matchen AS matchesWon,\n ISPS.speeldagen_aanwezig AS roundsPresent\n FROM intra_spelers IPLAYER\n INNER JOIN intra_spelerperseizoen ISPS ON ISPS.speler_id = IPLAYER.Id\n WHERE ISPS.seizoen_id = ? AND IPLAYER.is_lid = 1\n ORDER BY ISPS.speeldagen_aanwezig desc, ISPS.gewonnen_matchen desc, ISPS.basispunten desc\";\n $stmt = $this->db->prepare($query);\n $stmt->execute([$seasonId]);\n return $stmt->fetchAll();\n }", "function getTrend($player, $season, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t$matches = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT * FROM Games WHERE SeasonID = '$season' AND MatchType = '$type' AND Status = 'Complete' AND (ChallengerID = '$player' OR DefenderID = '$player') ORDER BY MatchID DESC\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matches[] = $row;\n\t}\n\n\t$trend = '';\n\t$trendCount = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($trendCount > 0) {\n\t\t\t$tempTrend = '';\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$tempTrend = 'Won';\n\t\t\t} else {\n\t\t\t\t$tempTrend = 'Lost';\n\t\t\t}\n\t\t\tif ($tempTrend == $trend) {\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$trend = 'Won';\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\t$trend = 'Lost';\n\t\t\t\t$trendCount++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $trend . ' ' . $trendCount;\n}", "function showteam( $ffanumber, $lastname )\n{\n\t\t$db_hostname = 'gungahlinunitedfc.org.au';\n\t\t$db_username = 'gufcweb_dev';\n\t\t$db_password = 'deve!oper';\n\t\t$db_database = 'gufcweb_player';\n\n \t$mysqli = new mysqli($db_hostname,$db_username,$db_password, $db_database);\n\n\t\t$playerteam = \"\";\n\t\t\n\t\t$sqlinner = \" SELECT * FROM gufcdraws.player where FFANumber = '\".$ffanumber.\"' and LastName = '\".$lastname.\"' and display = 'Y'\";\n\n\t\t$sqlexample1 = \" SELECT * FROM gufcdraws.player where FFANumber = 28069631 and LastName = 'Chilmaid' and display = 'Y' \";\n\t\t$sqlexample2 = \" SELECT * FROM gufcdraws.player where fkteamid = 'U16 Div 2 Boys' and display = 'Y' \";\n\t\t\n\t\t$r_queryinner = $mysqli->query($sqlinner);\n\n\t\t$todays_date = date(\"Y-m-d\");\t\t\t\t\t\t\n\n\t\t$msg = 'No player found.';\t\n\n\t\techo '<table class=\"table\" align=\"center\" border=\"1\" >';\n\t\techo '<th>First Name</th>';\n\t\techo '<th>Last Name</th>';\n\t\techo '<th>Team Name</th>';\n\n\t\tif ( ! $r_queryinner )\n\t\t{\n\t\t\techo 'Player not found'; \n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sqlteam = \" SELECT FirstName,LastName,fkteamid FROM gufcdraws.player where fkteamid = '\".$playerteam.\"' and display = 'Y'\";\n\t\t\t\n\t\t\t$r_queryteam = $mysqli->query($sqlteam);\n\t\t\t\n\t\t\tif ( $r_queryteam ) {\n\t\t\t\n\t\t\t\t$rowteam = mysqli_fetch_assoc($r_queryteam)\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>'.$rowteam['FirstName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['LastName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['fkteamid'].'</td>';\n\t\t\t\techo '</tr>';\n\t\t\t}\n\t\t\techo '</table>';\n\t\t\techo '<p/>';\n\t\t}\n}", "public function winloss()\n {\n $sql = '\n SELECT \n t.name,\n ( \n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team1_id=t.id\n AND m.team1_goalcount > m.team2_goalcount ) +\n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team2_id=t.id\n AND m.team1_goalcount < m.team2_goalcount ) \n ) wins,\n ( \n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team1_id=t.id\n AND m.team1_goalcount < m.team2_goalcount ) +\n ( SELECT COUNT(*)\n FROM matches m\n WHERE m.match_date_time < CURDATE()\n AND m.team2_id=t.id\n AND m.team1_goalcount > m.team2_goalcount )\n ) losses\n FROM teams t';\n\n return view( 'winloss', ['matches' => \\DB::select( $sql ) ] );\n }", "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}", "function players(){\n\t\t$this->autoRender = false;\n\t\t$this->response->type('json');\n\t\t\n\t\t$this->loadModel('Player'); // player module to fetch player data\n\t\t\n\t\t$team_id = $this->request->data('teamid'); //team id from request\n\t\t\n\t\ttry {\n\t\t\t$players = $this->Player->find('all', array('conditions' => array('team_id' => $team_id))); //players by team_id\n\t\t}catch (Exception $e){\n\t\t\techo $this->dbError;\n\t\t}\n\t\tif (!empty($players)){\n\t\t\techo json_encode($players);\n\t\t}else{\n\t\t\techo $this->noResult;\n\t\t}\n\t\t\n\t}", "private function welcome_players()\n\t{\n\t\t$players = $this->players->all(); \n\n\t\t\n\t\t$players_array = array ();\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\t$player['equity'] = $this->players->equity($player['player']);\n\t\t\t$players_array[] = (array) $player;\n\t\t}\n\t\t$this->data['test'] = $players_array; \n\t}", "function get_team_woba_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT b.player_id\n , CONCAT(p.first_name,\" \",p.last_name) AS player\n , b.woba\n FROM CalcBatting b INNER JOIN players p ON b.player_id=p.player_id\n INNER JOIN team_history_record t ON b.team_id=t.team_id AND b.year=t.year\n WHERE b.year = :year AND b.team_id = :team_id\n AND b.PA * 3.1 >= t.g\n ORDER BY b.woba DESC\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_woba_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_woba_leaders;\n}", "function getRecords($record, $team){\n // league standings\n $l_win = 0;\n $l_loss = 0;\n $l_tie = 0;\n // overall standings\n $o_win = 0;\n $o_loss = 0;\n $o_tie = 0;\n // league goals\n $l_pf = 0;\n $l_pa = 0;\n // overall goals\n $o_pf = 0;\n $o_pa = 0;\n // total points\n $points = 0;\n\n foreach($record as $result){\n if($result['winner'] != NULL){\n //get the final scores for both teams\n if($result['away_final'] != NULL && $result['home_final'] != NULL){\n $away_score = $result['away_final'];\n $home_score = $result['home_final']; \n }\n //get pf/pa and w/l for league\n if($result['away_league'] == $result['home_league']){\n //if school won, +1 to win, else +1 to loss\n if($result['team_id'] == $result['winner']){\n $l_win++;\n }\n elseif($result['winner'] == \"TIE\"){\n $l_tie++;\n }\n else{\n $l_loss++;\n }\n //is school home or away, add points to appropriate total\n if($result['team_id'] == $result['away_id']){\n // if away, add score to points for and opponent to points against \n $l_pf += $away_score;\n $l_pa += $home_score;\n }else{\n // if home, add score to points for and opponent to points against\n $l_pf += $home_score;\n $l_pa += $away_score;\n }\n }\n //get pf/pa and w/l for overall\n //if school won, +1 to win, else +1 to loss\n if($result['team_id'] == $result['winner']){\n $o_win++;\n $points += 3;\n }\n elseif($result['winner'] == \"TIE\"){\n $o_tie++;\n $points += 1;\n }\n else{\n $o_loss++;\n }\n //is school home or away, add points to appropriate total\n if($result['team_id'] == $result['away_id']){\n // if away, add score to points for and opponent to points against \n $o_pf += $away_score;\n $o_pa += $home_score;\n }else{\n // if home, add score to points for and opponent to points against\n $o_pf += $home_score;\n $o_pa += $away_score;\n }\n }\n }\n // push team record info into array\n $team_record = ['team'=>$team['name'],'team_id'=>$team['school_id'],'league'=>$team['league'],'class'=>$team['class'],'lwin'=>$l_win,'lloss'=>$l_loss,'ltie'=>$l_tie,'lgf'=>$l_pf,'lga'=>$l_pa,'owin'=>$o_win,'oloss'=>$o_loss,'otie'=>$o_tie,'ogf'=>$o_pf,'oga'=>$o_pa,'points'=>$points];\n\n return $team_record;\n}", "public function manageResults($parameters)\n\t{\n\n\t\t// for each match result\n\t\tforeach ($parameters['matches'] as $match)\n\t\t{\n\t\t\t// if there is no entry for the winner yet\n\t\t\tif (!isset($this->results[$match['winner']]))\n\t\t\t{\n\t\t\t\t// set an entry for the winner\n\t\t\t\t$this->results[$match['winner']] = array (\n\t\t\t\t\t'player' => $match['winner'],\n\t\t\t\t\t'winners' => array ()\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * manage all the cases where the winner has previously lost to\n\t\t\t * somebody in the winner’s winners’ critical path\n\t\t\t */\n\t\t\t$this->cleanWinner(array (\n\t\t\t\t'deep' => false,\n\t\t\t\t'results' => $this->results[$match['winner']],\n\t\t\t\t'winner' => $match['winner'],\n\t\t\t\t'looser' => $match['looser'],\n\t\t\t\t'parent' => NULL\n\t\t\t));\n\n\t\t\t// set an entry for the looser\n\t\t\t$this->results[$match['looser']]['player'] = $match['looser'];\n\t\t\t// insert the list of the winner to the winners' list of the looser\n\t\t\t$this->results[$match['looser']]['winners'][$match['winner']] =\n\t\t\t\t\t$this->results[$match['winner']];\n\n\t\t\t// update loosers of the looser\n\t\t\t$this->updateLooser(array (\n\t\t\t\t'looser' => $match['looser']\n\t\t\t));\n\t\t}\n// \t\t\t\techo ' 381: <pre>';print_r($this->results); echo '</pre>';\n\t\t\n\t\t// for each player\n\t\tforeach ($this->results as $player => $arrayOfPlayer)\n\t\t{\n\t\t\t// if there is an entry for the winners by the player\n\t\t\tif (isset ($arrayOfPlayer['winners']))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * set the place of the player according to the length of the\n\t\t\t\t * critical path of the player's winners\n\t\t\t\t */\n\t\t\t\t$this->results[$player]['place'] = $this->array_depth(array (\n\t\t\t\t\t'array' => $arrayOfPlayer,\n\t\t\t\t\t'keyForChildren' => 'winners'\n\t\t\t\t)) - 1;\n\t\t\t}\n\t\t\t// otherwise\n\t\t\telse\n\t\t\t{\n\t\t\t\t// set the place as 1 for the player\n\t\t\t\t$this->results[$player]['place'] = 1;\n\t\t\t}\n\n\t\t}\n// \t\techo ' 59: <pre>';print_r($this->results); echo '</pre>';\n\t\t// sort the list of the players according to their places ascending\n\t\t$sortedResults = MergeSortChart::multiSort($this->results, array (\n\t\t\t'place' => array (\n\t\t\t\t'sortAscending' => TRUE,\n\t\t\t\t'type' => SORT_NUMERIC\n\t\t\t)\n\t\t));\n// \t\techo ' 340: <pre>';print_r($sortedResults); echo '</pre>';\n\t\tforeach ($sortedResults as $player => $arrayOfPlayer)\n\t\t{\n\t\t\techo ' 629: <br/>', $player, ', (', $arrayOfPlayer['place'], ')';\n\t\t}\n\n\t}", "function get_standing_driver_db($idSeason)\n{\n require('./model/connect_db.php');\n $sql = \"select p.idPilot, p.namePilot, p.pilotNumber, t.idTeam, t.nameTeam, sum(r.Points) as points from pilot p, team t, race r, season s where r.idPilot = p.idpilot and p.idteam = t.idTeam and s.idseason = '%d' and s.idseason = r.idseason group by p.namepilot order by points desc \";\n $request = sprintf($sql,$idSeason);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $standing = array();\n while($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $standing[] = $line;\n }\n return $standing;\n}", "public function listFearPlayers(){\n $sql = \"SELECT j.nome AS nome,\n t.nome AS nome_time,\n j.numero AS numero , \n (d.advertencia + d.punicao + d.desqualificacao + d.relatorio) \n AS faltas\n FROM dados d,jogador j,time t\n WHERE j.id_jogador = d.jogador_id_jogador\n AND j.time_id_time = t.id_time\n GROUP BY jogador_id_jogador\t\n ORDER BY faltas ASC\";\n $result = $this->connection->dataBase->Execute($sql);\n while($record = $result->FetchNextObject()){\n $fear['playerName'] = $record->NOME;\n $fear['teamName'] = $record->NOME_TIME;\n $fear['amountPenalty'] = $record->FALTAS;\n $fear['playerNumber'] = $record->NUMERO;\n $arrayFear[] = $fear;\n }\n\n return $arrayFear;\n }", "function xstats_displayAllFights( $gameId ) {\n include ('../../inc.conf.php');\n echo '<br><h4>Liste aller Raumk&auml;mpfe nach Runden</h4>';\n $query = \"SELECT * FROM skrupel_xstats_ships ships,skrupel_xstats_shipvsship shipvsship WHERE shipvsship.shipid=ships.shipid AND (shipvsship.fightresult=2 OR shipvsship.fightresult=3) AND shipvsship.gameid=\".$gameId.\" AND ships.gameid=\".$gameId.\" ORDER BY turn,shipvsship.id\";\n $result = @mysql_query( $query ) or die(mysql_error());\n echo '<table class=\"shiptable\" border=\"0\">';\n echo '<tr><th>Runde</th><th colspan=\"3\">Kampf</th><th>H&uuml;llenschaden</tr>';\n while ($row = mysql_fetch_array($result)) {\n echo \"<tr>\";\n //turn\n echo '<td class=\"highlight\">'.$row['turn'].'</td>';\n echo '<td>';\n //get victorous ship\n $query = \"SELECT * FROM skrupel_xstats_ships WHERE gameid=\".$gameId.\" AND shipid=\".$row['enemyshipid'];\n $victoryResult = @mysql_query( $query ) or die(mysql_error());\n $victoryRow = mysql_fetch_array($victoryResult);\n echo xstats_getShipFullDescription( $gameId, $victoryRow['shipid'], $victoryRow['shiprace'], $victoryRow['picturesmall'], $victoryRow['experience'], $row['turn'],$victoryRow['shipclass'],$victoryRow['shipname']);\n echo '</td><td>';\n if( $row['fightresult'] == 2) {\n $turnToUse = $row['turn'];\n echo ' zerst&ouml;rt ';\n }else {\n echo ' erobert ';\n //display the formerly owner of this ship\n $turnToUse = $row['turn']-1;\n }\n echo '</td><td>';\n echo xstats_getShipFullDescription( $gameId, $row['shipid'], $row['shiprace'], $row['picturesmall'], $row['experience'], $turnToUse,$row['shipclass'],$row['shipname']);\n echo '</td>';\n //get hull damage of winning ship\n $query = \"SELECT * FROM skrupel_xstats_shipvsship WHERE shipid=\".$row['enemyshipid'].\" AND enemyshipid=\".$row['shipid'].\" AND gameid=\".$gameId;\n $winnerResult = @mysql_query( $query ) or die(mysql_error());\n $winnerResult = mysql_fetch_array($winnerResult);\n $hullDamage = $winnerResult['hulldamage'];\n echo '<td>'.$hullDamage.'%';\n //hull damage bar\n echo '<div class=\"hulldamage\">';\n echo '<div style=\"width: '.(100-$hullDamage).'%\"></div>';\n echo '</div>';\n echo '</td>';\n echo \"</tr>\";\n }\n echo '</table>';\n}", "function getTeamRankings ($gameId) {\n\tglobal $bdd;\n\t$req = $bdd->prepare('\n\t\tSELECT (\n\t\t\tSELECT login\n\t\t\tFROM joueurs\n\t\t\tWHERE id_joueur = i.joueur\n\t\t\tLIMIT 1\n\t\t) AS name, i.joueur as joueur, (\n SELECT IFNULL(sum(nbpoints), 0)\n\t\t\tFROM infos_flashs\n\t\t\tWHERE i.joueur = joueur AND i.partie = partie AND nbpoints IS NOT NULL\n\t\t) AS score\n\t\tFROM inscriptions i\n\t\tWHERE partie = :game_id\n\t\tGROUP BY joueur, name\n\t\tORDER BY score DESC;\n\t');\n\t$req->execute(array(\n\t\t'game_id' => $gameId\n\t));\n\t$rankings = array();\n\twhile ($row = $req->fetch()) {\n\t\t$rankings[] = array(\n\t\t\t'name' => $row['name'],\n\t\t\t'score' => strval($row['score']),\n\t\t\t'team' => intval(getEquipeJoueurPartieActive($gameId, $row['joueur']))\n\t\t);\n\t}\n\treturn $rankings;\n}", "function get_team_war_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT b.player_id\n , CONCAT(p.first_name,\" \",p.last_name) AS player\n , round(b.war,1) as war\n FROM CalcBatting b INNER JOIN players p ON b.player_id=p.player_id\n INNER JOIN team_history_record t ON b.team_id=t.team_id AND b.year=t.year\n WHERE b.year = :year AND b.team_id = :team_id\n ORDER BY b.war DESC\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_war_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_war_leaders;\n}", "public static function fetch_data($opt)\r\n {\r\n $result = ($opt == 'all') ? db::sql(\"SELECT * FROM `superrugby_2016_scores_18`\", DB_NAME):\r\n db::sql(\"SELECT * FROM `superrugby_2016_scores_18` WHERE Team = '$opt'\", DB_NAME);\r\n $return_result = null;\r\n if (mysqli_num_rows($result)){\r\n while(list($round, $match_id, $player_id, $first_name, $last_name, $country, $position, $bonus_points, $full_appearance, $part_appearance, $win, $draw,\t$away_win, $away_draw, $try, $assist, $conversion, $penalty, $drop_goal, $yellow_card, $red_card, $man_of_the_match) = mysqli_fetch_array($result)){\r\n $return_result[] = array(\r\n 'round'=>$round,\r\n 'match_id'=>$match_id,\r\n 'player_id'=>$player_id,\r\n 'first_name'=>$first_name,\r\n 'last_name'=>$last_name,\r\n 'team'=>$country,\r\n 'position'=>$position,\r\n 'bonus_points'=>$bonus_points,\r\n 'full_appearance'=>$full_appearance,\r\n 'part_appearance'=>$part_appearance,\r\n 'win'=>$win,\r\n 'draw'=>$draw,\r\n 'away_win'=>$away_win,\r\n 'away_draw'=>$away_draw,\r\n 'try'=>$try,\r\n 'assist'=>$assist,\r\n 'conversion'=>$conversion,\r\n 'penalty'=>$penalty,\r\n 'drop_goal'=>$drop_goal,\r\n 'yellow_card'=>$yellow_card,\r\n 'red_card'=>$red_card,\r\n 'man_of_the_match'=>$man_of_the_match\r\n );\r\n }\r\n }\r\n return $return_result;\r\n }", "public function get_teams()\r\n\t\t{\r\n\t\t\t$retArr = $this->obj->result;\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "function get_ml_fielding_stats($player_id) {\n global $db;\n $query = 'SELECT f.player_id,\n f.year,\n f.year - YEAR(p.date_of_birth) AS age,\n f.team_id,\n f.league_id,\n l.abbr as league,\n f.level_id,\n f.split_id,\n po.pos_name,\n f.tc,\n f.a,\n f.po,\n f.er,\n f.ip,\n f.g,\n f.gs,\n f.e,\n f.dp,\n f.tp,\n f.pb,\n f.sba,\n f.rto,\n f.ipf,\n f.plays,\n f.plays_base,\n f.roe,\n f.opps_0,\n f.opps_made_0,\n f.opps_1,\n f.opps_made_1,\n f.opps_2,\n f.opps_made_2,\n f.opps_3,\n f.opps_made_3,\n f.opps_4,\n f.opps_made_4,\n f.opps_5,\n f.opps_made_5,\n f.zr,\n concat(p.first_name,\" \",p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM players_career_fielding_stats f INNER JOIN players p ON\n f.player_id = p.player_id\n INNER JOIN teams t ON f.team_id = t.team_id\n INNER JOIN positions po ON f.position = po.position\n INNER JOIN leagues l ON f.league_id = l.league_id\n WHERE f.level_id = 1 AND f.player_id = :player_id\n ORDER BY f.year, t.abbr, po.pos_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':player_id', $player_id);\n $statement->execute();\n $ml_fielding_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $ml_fielding_stats;\n}", "function listTeams() {\n global $oDbHelper;\n\n $sQuery = \"SELECT * FROM team WHERE competition_id = \" . COMPETITION_ID;\n $oResult = $oDbHelper->executeQuery($sQuery);\n $oDbHelper->printDbResult($oResult);\n}", "function get_player_mil_batting_stats($player_id) {\n global $db;\n $query = 'SELECT b.player_id\n , b.year\n , b.year - YEAR(p.date_of_birth) AS age\n , b.team_id\n , b.level_id\n , b.league_id\n , l.abbr as league\n , b.g\n , b.ab\n , b.PA\n , b.r\n , b.h\n , b.d\n , b.t\n , b.hr\n , b.rbi\n , b.sb\n , b.cs\n , b.bb\n , b.k\n , b.ibb\n , b.hp\n , b.sh\n , b.sf\n , b.gdp\n , b.ci\n , b.war\n , b.ba\n , b.krate\n , b.bbrate\n , b.obp\n , b.OBPplus\n , b.woba\n , b.slg\n , b.ops\n , b.iso\n , b.babip\n , b.wRAA\n , b.wRC\n , b.`wRC+`\n , concat(p.first_name,\" \", p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM CalcBatting b INNER JOIN players p ON b.player_id = p.player_id\n INNER JOIN teams t ON b.team_id = t.team_id\n INNER JOIN leagues l ON b.league_id = l.league_id\n WHERE b.level_id <> 1 AND b.player_id = :player_id\n ORDER BY b.year';\n $statement = $db->prepare($query);\n $statement->bindValue('player_id', $player_id);\n $statement->execute();\n $mil_batting_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $mil_batting_stats;\n}", "function countryName($country, $league)\n {\n $matchId = array();\n \n $fixtures = curl_download_fixtures($country, $league);\n $odds = curl_download_odds($country, $league);\n foreach($fixtures as $fixturez) {\n foreach($odds as $oddz){\n if($fixturez['match_id'] == $oddz['match_id'])\n {\n $betsDetail[]=array_merge($fixturez,$oddz);\n\n //print_r($betsDetail);\n }\n }\n }\n //selecting user id query\n $selUserId=\"SELECT user_id FROM user WHERE `display_name` = '$league'\";\n $exeselUserId=mysql_query($selUserId) or die(mysql_error());\n $UserId=mysql_fetch_assoc($exeselUserId) or die(mysql_error());\n print_r(\"user_id:\" . $UserId['user_id'] . \"-----------\");\n $UserId = $UserId['user_id'];\n\n // foreach ($betsDetail as $key => $value) {\n // print_r($value[\"match_id\"] . \"<br>\");\n // }\n $selMatchId=\"SELECT match_id FROM bets WHERE `correct_option` IS NULL AND match_id > 0\";\n $exeMatchId=mysql_query($selMatchId) or die(mysql_error());\n\n // echo \"undeclareWinnerd Bets found in DB: \" . mysql_num_rows($exeMatchId) . \"<br>\";\n $temp = $exeMatchId;\n\n $dbMatchIds = array();\n $alreadyPresent = array();\n\n // while ($row = mysql_fetch_assoc($temp)) {\n // $dbMatchIds[] = $row['match_id'];\n // }\n\n while ($fetchMatchId=mysql_fetch_assoc($exeMatchId)) {\n // echo \"<br>\";\n // print_r($fetchMatchId['match_id']);\n $i = 0;\n foreach ($betsDetail as $key => $value) {\n // print_r($value['match_id'] . \"<br>\");\n if($value['match_id'] == $fetchMatchId['match_id']){\n // echo \"Value found: \" . $value['match_id'].\"<br> i = \" . $i . \"<br>\";\n $alreadyPresent[] = $i;\n break;\n } \n $i++;\n }\n }\n\n // print_r($alreadyPresent);\n foreach ($alreadyPresent as $key => $value) {\n unset($betsDetail[$value]);\n }\n\n // print_r($betsDetail);\n // echo \"New details:<br>\";\n $insertCounter = 0;\n $UserId = (int)$UserId;\n\n // return;\n\n\n foreach ($betsDetail as $key => $value) {\n // print_r($betsDetail[$key]['description']);\n /*$description=$betsDetail[$value]['description'];//['description'];\n print_r($description).\"<br>\";*/\n \n $description=(string)$betsDetail[$key]['description'];\n $option1=(string)$betsDetail[$key]['option1'];\n $opt1percent=(double)$betsDetail[$key]['opt1percent'];\n $option2=(string)$betsDetail[$key]['option2'];\n $opt2percent=(double)$betsDetail[$key]['opt2percent'];\n $option3=(string)$betsDetail[$key]['option3'];\n $opt3percent=(double)$betsDetail[$key]['opt3percent'];\n $betCreationTime=(string)$betsDetail[$key]['betCreationTime'];\n $betEndsTime=(string)$betsDetail[$key]['betEndsTime'];\n $betReminderTime=(string)$betsDetail[$key]['betReminderTime'];\n $match_id=(string)$betsDetail[$key]['match_id'];\n \n $queryInsert = \"INSERT INTO `bets` \";\n $queryInsert .= \"(`bet_id`, `creator_id`, `category_id`, `bet_details`, `option1`, `opt1percent`, `option2`, `opt2percent`, `option3`, `opt3percent`, `option4`, `opt4percent`, `creation_time`, `bet_ends`, `rem_time`, `correct_option`, `reportedBy`, `match_id`\";\n $queryInsert .= \") VALUES ( \";\n $queryInsert .= \"'', $UserId,1,'$description','$option1',$opt1percent,'$option2',\";\n $queryInsert .= \"$opt2percent,'$option3',$opt3percent, NULL, NULL,\";\n $queryInsert .= \"'$betCreationTime','$betEndsTime','$betReminderTime', NULL, NULL,$match_id)\";\n //echo $queryInsert . \"<br>\";\n $exeInsert=mysql_query($queryInsert) or die(mysql_error());\n // $insertCounter++;\n }\n \n }", "function xstats_displayRanking( $gameId ) {\n include ('../../inc.conf.php');\n echo( \"<H3>Skrupel Rang nach Spielende</H3>\");\n $ranking = array();\n for($k=1; $k<=10; $k++) {\n $result = @mysql_query(\"SELECT * FROM skrupel_spiele WHERE id='$gameId'\") or die(mysql_error());\n $result = @mysql_fetch_array($result);\n $playerId = $result['spieler_'.$k];\n $playerRank = $result['spieler_'.$k.'_platz'];\n if($playerId != 0) {\n $ranking[] = '<tr><td>'.\n '<strong>'.$playerRank.'. </strong>'.\n '<img src=\"../../daten/'.$result['spieler_'.$k.'_rasse'].'/bilder_allgemein/menu.png\" height=\"18\" class=\"beveled\">'.\n ' <strong><font color=\"'.$spielerfarbe[$k].'\"> '.\n xstats_getPlayerNick($playerId).'</font></strong></td><td>als '.$result['spieler_'.$k.'_rassename'].\n ':</td><td align=\"center\">'.$result['spieler_'.$k.'_planeten'].'</td><td align=\"center\">'.\n $result['spieler_'.$k.'_schiffe'].'</td><td align=\"center\">'.\n $result['spieler_'.$k.'_basen'].'</td></tr>';\n }\n }\n natsort( $ranking );\n echo( '<table border=\"0\">');\n echo '<tr><td colspan=\"2\"><img src=\"../../lang/de/topics/dieimperien.gif\" width=\"140\"></td>';\n echo '<td><img src=\"../../bilder/aufbau/rang_2.gif\"></td>';\n echo '<td><img src=\"../../bilder/aufbau/rang_3.gif\"></td>';\n echo '<td><img src=\"../../bilder/aufbau/rang_1.gif\"></td>';\n echo '<td>';\n foreach( $ranking as $rankLine) {\n echo( $rankLine);\n }\n echo( '</table>');\n}", "function teams(){\n\t\t$this->autoRender = false;\n\t\t$this->response->type('json');\n\t\ttry {\n\t\t\t$teams = $this->Team->find('all');\n\t\t}catch (Exception $e){\n\t\t\techo $this->dbError;\n\t\t}\n\t\tif (!empty($teams)){\n\t\t\techo json_encode($teams);\n\t\t}else{\n\t\t\techo $this->noResult;\n\t\t}\n\t}", "function get_football_seasons() {\n\t$currseasonstring = $lastseasonstring = $lastlastseasonstring = '';\n\t$seasonout[] = array();\n\t$currentyear = date(\"Y\");\n\t$currentmonth = date(\"m\");\n\t\n\tif ( $currentmonth > 2 ) {\n\t\t$seasonout[0] = (string)$currentyear . '-' . (string)($currentyear + 1);\n\t\t$seasonout[1] = (string)($currentyear - 1) . '-' . (string)$currentyear;\n\t\t$seasonout[2] = (string)($currentyear - 2) . '-' . (string)($currentyear - 1);\n\t} else {\n\t\t$seasonout[0] = (string)($currentyear - 1) . '-' . (string)($currentyear);\n\t\t$seasonout[1] = (string)($currentyear - 2) . '-' . (string)($currentyear - 1);\n\t\t$seasonout[2] = (string)($currentyear - 3) . '-' . (string)($currentyear - 2);\n\t}\n\treturn $seasonout;\n\n}", "function showResults($filename, $searchterm){\n\tif(file_exists($filename)){\n\t\t$contents = file_get_contents($filename);\n\t\t$results = json_decode($contents);\n\n\t\t# check if error in decode and give error msg\n\t\tif(json_last_error() !== JSON_ERROR_NONE){\n\t\t\techo \"<p style=\\\"font-weight:bold; color:red;\\\">\";\n echo \"ERROR: <br> Error with JSON data <br></p>\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$winCount = 0;\n\t\t$totalGames = 0; # counters\n\t\t\n\t\t# create header\t\n\t\techo \"<h4>\";\n\t\tforeach($results->comments as $elem){\n\t\t\techo \"$elem<br>\";\t\n\t\t}\n echo '</h4>'; \n\n\t\t# iterate through each element in games\n\t\tforeach($results->games as $element){\n\t\t\t\n\t\t\t# then iterate through each key value pair\n\t\t\tforeach($element as $key => $value){\n $newValue = str_replace(\"_\", \" \", $value); # clean up team names\n\n if($key === $searchterm){ # check if search term, then bold if so\n echo \"<p style=\\\"font-weight:bold; color:blue;\\\">\";\n echo \"$key : $newValue </p>\";\n }\n else{ # otherwise print normally\n echo \"<p> $key : $newValue </p>\"; \n }\n\n\t\t\t\t# check if win and update count if necessary\n\t\t\t\tif($key === \"WinorLose\" && $value === \"W\")\n\t\t\t\t\t++$winCount;\n\t\t\t}\n\t\t\t++$totalGames;\t# increment game count regardless\n\t\t echo \"<br>\";\n \n }\n\n\t\t$winPercentage = ($winCount / $totalGames) * 100;\n\t\techo \"<br><p style=\\\"color:blue;\\\">\";\n echo \"Win percentage: $winPercentage % </p><br></body></html>\";\t\t\n\t\n\t}\n\telse{\t\t# give error if file not found\n\t\techo \"<p style=\\\"font-weight:bold; color:red;\\\">\";\n echo \"No results found for the specified input.</p></body></html>\";\n\t\t\n return;\n\t}\n}", "public function pastSeasons(){\n $json = file_get_contents('http://ergast.com/api/f1/seasons.json?limit=100');\n $f1json = json_decode($json);\n return view('seasons.pastRaces')\n ->with([\n 'f1json' => $f1json\n ]);\n }", "function getPlayersGames($page)\n\t{\n\t\t$uid = $_SESSION[\"uid\"];\n\t\t$games = array();\n\t\t\n\t\t\n\t\t$query = ($page == \"ord\") ? \n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid'\n\t\t\tAND i.uid <>\n\t\t\tALL (\n\t\t\t\tSELECT DISTINCT o.uid\n\t\t\t\tFROM games g1, orders o\n\t\t\t\tWHERE g1.gid = g.gid\n\t\t\t\tAND g.gid = o.gid\n\t\t\t\tAND g.year = o.year\n\t\t\t\tAND g.season = o.season\n\t\t\t\t);\" \n\t\t\t:\n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($games, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "public function getTeamPlayerTotal(string $leagueCode): array;", "private function fetchGames() {\n $this->games = array();\n $this->playtimes = array();\n\n $url = $this->getBaseUrl() . '/games?xml=1';\n $gamesData = new SimpleXMLElement(file_get_contents($url));\n\n foreach($gamesData->games->game as $gameData) {\n $game = SteamGame::create($gameData);\n $this->games[$game->getAppId()] = $game;\n $recent = (float) $gameData->hoursLast2Weeks;\n $total = (float) $gameData->hoursOnRecord;\n $playtimes = array((int) ($recent * 60), (int) ($total * 60));\n $this->playtimes[$game->getAppId()] = $playtimes;\n }\n }", "public function startSeason(){\n ini_set('max_execution_time',300000);\n $rallyDataService = parent::getService('rally','rallyData');\n $rallyService = parent::getService('rally','rally');\n $leagueService = parent::getService('league','league');\n \n $seasonInfo = $leagueService->getSeasonInfo();\n \n $rallies = $rallyDataService->getAllRallies();\n foreach($rallies as $rally):\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start']);\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start'],2);\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start'],3);\n endforeach;\n \n $this->createRalliesForAllLeagues();\n echo \"done\";exit;\n }", "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 getPlayerStats($accountId, $lolSeason){\n\t\treturn $this->_makeCall($this->_lolServer . '/player_stats/' . $accountId . '/' . $lolSeason . '?');\n\t}", "function galaxy_ShowAvailableRanking($type) {\n\tglobal $db;\n\n\t$ranking = array();\n\n\tswitch ($type) {\n\t\tcase \"player\":\n\t\t$table_points = TABLE_RANK_PLAYER_POINTS;\n\t\t$table_fleet = TABLE_RANK_PLAYER_POINTS;\n\t\t$table_research = TABLE_RANK_PLAYER_POINTS;\n\t\tbreak;\n\n\t\tcase \"ally\":\n\t\t$table_points = TABLE_RANK_ALLY_POINTS;\n\t\t$table_fleet = TABLE_RANK_ALLY_POINTS;\n\t\t$table_research = TABLE_RANK_ALLY_POINTS;\n\t\tbreak;\n\t}\n\n\t$request = \"select distinct datadate from \".$table_points.\" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"points\"] = true;\n\t}\n\n\t$request = \"select distinct datadate from \".$table_fleet.\" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"fleet\"] = true;\n\t}\n\n\t$request = \"select distinct datadate from \".$table_research.\" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"research\"] = true;\n\t}\n\n\twhile ($value = current($ranking)) {\n\t\techo date(\"Y-m-d H:i:s\", key($ranking)+4).\"=\";\n\t\tif (isset($value[\"points\"])) echo \"P\";\n\t\tif (isset($value[\"fleet\"])) echo \"F\";\n\t\tif (isset($value[\"research\"])) echo \"R\";\n\t\techo \"<|>\";\n\t\tnext($ranking);\n\t}\n\texit();\n}", "function gaMatch_getResultString($appGlobals, $roster, $pSep = ' ,') {\n $s = '';\n $sSep = '';\n for ($i=0; $i < $this->game_opponents_count; ++$i) {\n //$kidPeriod = $appGlobals->rst_cur_period->perd_getKidPeriodObject($this->game_opponents_kidPeriodId[$i]);\n //$kidName = ($kidPeriod==NULL) ? '***' : $kidPeriod->kidPer_kidObject->rstKid_uniqueName;\n $kidName = $roster->rst_cur_period->perd_getKidUniqueName($this->game_opponents_kidPeriodId[$i]);\n $sep = '';\n $s1 = '';\n $tot = $this->game_opponents_wins[$i] + $this->game_opponents_losts[$i] + $this->game_opponents_draws[$i];\n if ($this->game_opponents_wins[$i] > 0) {\n $s1 = ($this->game_opponents_wins[$i] + $tot == 2)? 'Won' : ' Won ' . $this->game_opponents_wins[$i] ;\n $sep = ', ';\n }\n if ($this->game_opponents_losts[$i] > 0) {\n $lost = ($this->game_opponents_losts[$i] + $tot == 2)? 'Lost' : ' Lost ' . $this->game_opponents_losts[$i] ;\n $s1 .= $sep . $lost;\n $sep = ', ';\n }\n if ($this->game_opponents_draws[$i] > 0) {\n $draw = ($this->game_opponents_draws[$i] + $tot == 2)? 'Draw' : ' Draw ' . $this->game_opponents_draws[$i];\n $s1 .= $sep . $draw; ;\n $sep = ', ';\n }\n $s .= $sSep . $kidName . ' (' . $s1 . ')';\n $sSep = $pSep;\n }\n return $s;\n //return kcmRosterLib_getDesc_gameType($appGlobals->gb_form->chain->chn_posted_object->sesGame->game_gameType) . ' Game Saved: ' . $s;\n}", "function get_player_ml_batting_stats($player_id) {\n global $db;\n $query = 'SELECT b.player_id\n , b.year\n , b.year - YEAR(p.date_of_birth) AS age\n , b.team_id\n , b.level_id\n , b.league_id\n , l.abbr as league\n , b.g\n , b.ab\n , b.PA\n , b.r\n , b.h\n , b.d\n , b.t\n , b.hr\n , b.rbi\n , b.sb\n , b.cs\n , b.bb\n , b.k\n , b.ibb\n , b.hp\n , b.sh\n , b.sf\n , b.gdp\n , b.ci\n , b.war\n , b.ba\n , b.krate\n , b.bbrate\n , b.obp\n , b.OBPplus\n , b.woba\n , b.slg\n , b.ops\n , b.iso\n , b.babip\n , b.wRAA\n , b.wRC\n , b.`wRC+`\n , concat(p.first_name,\" \", p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM CalcBatting b INNER JOIN players p ON b.player_id = p.player_id\n INNER JOIN teams t ON b.team_id = t.team_id\n INNER JOIN leagues l ON b.league_id = l.league_id\n WHERE b.level_id = 1 AND b.player_id = :player_id\n ORDER BY b.year';\n $statement = $db->prepare($query);\n $statement->bindValue('player_id', $player_id);\n $statement->execute();\n $ml_batting_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $ml_batting_stats;\n}", "function chunk($chunk_start_date, $chunk_end_date, $j)\n{\n\n global $db;\n $sharedFunctions = new Shared($db);\n\n $query = \"SELECT *\n\t\tFROM ibl_schedule\n\t\tWHERE Date BETWEEN '$chunk_start_date' AND '$chunk_end_date'\n\t\tORDER BY SchedID ASC\";\n $result = $db->sql_query($query);\n $num = $db->sql_numrows($result);\n\n $teamSeasonRecordsQuery = \"SELECT tid, leagueRecord FROM ibl_standings ORDER BY tid ASC;\";\n $teamSeasonRecordsResult = $db->sql_query($teamSeasonRecordsQuery);\n\n $arrayLastSimDates = $sharedFunctions->getLastSimDatesArray();\n $lastSimStartDate = date_create($arrayLastSimDates[\"Start Date\"]);\n $lastSimEndDate = date_create($arrayLastSimDates[\"End Date\"]);\n $projectedNextSimEndDate = date_add($lastSimEndDate, date_interval_create_from_date_string('7 days'));\n\n // override $projectedNextSimEndDate to account for the blank week at end of HEAT\n $currentSeasonEndingYear = $sharedFunctions->getCurrentSeasonEndingYear();\n $currentSeasonBeginningYear = $currentSeasonEndingYear - 1;\n if ($projectedNextSimEndDate >= date_create(\"$currentSeasonBeginningYear-10-23\") and $projectedNextSimEndDate < date_create(\"$currentSeasonBeginningYear-11-01\")) {\n $projectedNextSimEndDate = date_create(\"$currentSeasonBeginningYear-11-08\");\n }\n\n echo \"<table width=\\\"500\\\" cellpadding=\\\"6\\\" cellspacing=\\\"0\\\" border=\\\"1\\\" align=center>\";\n\n $i = 0;\n $z = 0;\n while ($i < $num) {\n $date = $db->sql_result($result, $i, \"Date\");\n $visitor = $db->sql_result($result, $i, \"Visitor\");\n $visitorScore = $db->sql_result($result, $i, \"VScore\");\n $home = $db->sql_result($result, $i, \"Home\");\n $homeScore = $db->sql_result($result, $i, \"HScore\");\n $boxid = $db->sql_result($result, $i, \"BoxID\");\n\n $visitorTeamname = $sharedFunctions->getTeamnameFromTid($visitor);\n $homeTeamname = $sharedFunctions->getTeamnameFromTid($home);\n $visitorRecord = $db->sql_result($teamSeasonRecordsResult, $visitor - 1, \"leagueRecord\");\n $homeRecord = $db->sql_result($teamSeasonRecordsResult, $home - 1, \"leagueRecord\");\n\n if (($i % 2) == 0) {\n $bgcolor = \"FFFFFF\";\n } else {\n $bgcolor = \"DDDDDD\";\n }\n\n if (($z % 2) == 0) {\n $bgcolor2 = \"0070C0\";\n } else {\n $bgcolor2 = \"C00000\";\n }\n\n if ($visitorScore == $homeScore and date_create($date) <= $projectedNextSimEndDate) {\n $bgcolor = \"DDDD00\";\n }\n\n if ($visitorScore > $homeScore) {\n $visitorTeamname = '<b>' . $visitorTeamname . '</b>';\n $visitorRecord = '<b>' . $visitorRecord . '</b>';\n $visitorScore = '<b>' . $visitorScore . '</b>';\n } elseif ($homeScore > $visitorScore) {\n $homeTeamname = '<b>' . $homeTeamname . '</b>';\n $homeRecord = '<b>' . $homeRecord . '</b>';\n $homeScore = '<b>' . $homeScore . '</b>';\n }\n\n if ($date == $datebase) {\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n } else {\n echo \"<tr>\n\t\t\t\t<td></td><td></td><td></td><td></td><td></td><td></td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor2>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Date</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Visitor</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Home</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Box Score</td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n $datebase = $date;\n $z++;\n }\n $i++;\n }\n echo \"</table>\";\n //return array($homewin, $homeloss, $visitorwin, $visitorloss);\n}", "function getAllPlayers()\r\n{\r\n global $db, $selectSQL, $selectSQL2;\r\n\r\n unset($GLOBALS['players']);\r\n $GLOBALS['players'] = array();\r\n $res = $db->query(\"select * from player order by firstname asc\");\r\n\r\n while($row = $db->getRows($res))\r\n {\r\n $GLOBALS['players'][$row['id']]['id'] = $row['id'];\r\n $GLOBALS['players'][$row['id']]['firstname'] = $row['firstname'];\r\n $GLOBALS['players'][$row['id']]['lastname'] = $row['lastname'];\r\n $GLOBALS['players'][$row['id']]['email'] = $row['email'];\r\n $GLOBALS['players'][$row['id']]['phone'] = $row['phone'];\r\n $inches = $row['height'] % 12;\r\n $GLOBALS['players'][$row['id']]['heightIN'] = $inches;\r\n $GLOBALS['players'][$row['id']]['heightFT'] = ($row['height'] - $inches) / 12;\r\n $GLOBALS['players'][$row['id']]['weight'] = $row['weight'];\r\n $GLOBALS['players'][$row['id']]['positions'] = $row['positions'];\r\n $GLOBALS['players'][$row['id']]['bats'] = $row['bats'];\r\n $GLOBALS['players'][$row['id']]['throws'] = $row['throws'];\r\n \r\n if(!empty($row['birthdate']) && $row['birthdate'] != \"0000-00-00\")\r\n {\r\n list($year, $month, $day) = explode('-', $row['birthdate']);\r\n $birthdate = $month . \"/\" . $day . \"/\" . $year;\r\n $GLOBALS['players'][$row['id']]['birthdate'] = $birthdate;\r\n }\r\n \r\n $GLOBALS['players'][$row['id']]['nickname'] = $row['nickname'];\r\n $GLOBALS['players'][$row['id']]['img'] = $row['img'];\r\n }\r\n}", "public function season()\n {\n $this->load->view('admin/header');\n $data['all_hotels'] = $this->hotelInfoModel->getHotelList();\n $data['seasons'] = $this->common_model->getAll('sett_season');\n $this->load->view('setting/season',$data);\n $this->load->view('admin/footer');\n }", "function _displayWeeksGames( $schedGames ) {\n\n/* ... data declarations */\n $dayOfWeek = array();\n $textBlock = \"\";\n\n/* ... figure out which games are on which days of the week */\n for ($i = 0; $i < count( $schedGames ); $i++) {\n $dayOfWeek[date( \"D\", strtotime( $schedGames[$i]['Date'] ) )][] = $i;\n }\n\n/* ... we'll buffer the XHTML output and then pass it back in a string */\n ob_start();\n\n/* ... for each day of the week with games, we will now build a block with that day's games */\n $firstBlock = true;\n foreach ($dayOfWeek as $dow => $games) {\n\n?>\n <div id=\"dayOfGames\" class=\"<?= !$firstBlock ? 'notFirst' : '' ?>\">\n <table id=\"<?= $dow ?>\" width=\"100%\">\n <caption><?= $dow ?></caption>\n\n<?php\n foreach ($games as $gameIndex) {\n if ($schedGames[$gameIndex]['Status'] == \"PLAYED\") {\n if ($schedGames[$gameIndex]['VisitScore'] >= $schedGames[$gameIndex]['HomeScore']) {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) ).\": \".$schedGames[$gameIndex]['VisitScore'];\n $state = \"vs\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) ).\": \".$schedGames[$gameIndex]['HomeScore'];\n }\n else {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) ).\": \".$schedGames[$gameIndex]['HomeScore'];\n $state = \"vs\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) ).\": \".$schedGames[$gameIndex]['VisitScore'];\n }\n }\n elseif ($schedGames[$gameIndex]['Status'] == \"SCHEDULED\") {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) );\n $state = \"at\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) );\n }\n else {\n $team1 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) );\n $state = \"RAINED OUT\";\n $team2 = htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) );\n }\n?>\n<!--\n <tr>\n <td><?= htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['VisitTeamID'] ) ).\":\" ?></td>\n <td><?= $schedGames[$gameIndex]['VisitScore'] ?></td>\n <td> at </td>\n <td><?= htmlspecialchars( $this->Model_Team->getTeamName( $schedGames[$gameIndex]['HomeTeamID'] ) ).\":\" ?></td>\n <td><?= $schedGames[$gameIndex]['HomeScore'] ?></td>\n </tr>\n-->\n <tr>\n <td><?= $team1 ?></td>\n <td><?= $state ?> </td>\n <td><?= $team2 ?></td>\n </tr>\n\n<?php\n }\n?>\n </table>\n </div>\n\n<?php\n/* ... if this is the first block of games for the week, unset our flag used to define spacing between subsequent blocks */\n $firstBlock = false;\n\n }\n\n/* ... time to go */\n $textBlock = ob_get_contents();\n ob_end_clean();\n return( $textBlock );\n }", "function getStills($rTMDBID, $rSeason, $rEpisode)\n{\n global $rSettings, $rAdminSettings;\n if (strlen($rAdminSettings[\"tmdb_language\"]) > 0) {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"] . \"&language=\" . $rAdminSettings[\"tmdb_language\"];\n } else {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"];\n }\n return json_decode(file_get_contents($rURL), true);\n}", "public function selectLeagueWinner($league, $team);", "function getTodaysGames($mobile){\n\n //$query = \"SELECT * FROM `games` WHERE gameDate = '$currentDate' ORDER BY id DESC\";\n // used GROUP BY to eliminate duplicate home and vising teams...\n // get all other games that are on except the current game on from your city this evening,\n // everything else\n\n // IMPORTANT NEED TO FIX THIS.... FROM IN TORONTO WON't SHOW ME THE TORONTO GAME ON NOV 8th\n\n $query = \"SELECT games.*, teams.`teamName`,\n (SELECT `teamName` FROM teams WHERE `city`= games.`homeTeam` ) AS `homeTeam`,\n (SELECT `teamName` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visitingTeamName`,\n (SELECT `logo` FROM teams WHERE `city`= games.`homeTeam` ) AS `home_logo`,\n (SELECT `logo` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visiting_logo`,\n (SELECT `id` FROM teams WHERE `city`= games.`homeTeam` ) AS `homeTeamId`,\n (SELECT `id` FROM teams WHERE `city`= games.`visitingTeam` ) AS `visitingTeamId`\n FROM games, teams WHERE gameDate = '$this->currentDate'\n AND games.`homeTeam` <> '$this->myCity'\n AND games.`visitingTeam` <> '$this->myCity' GROUP BY games.`id`\";\n\n $result = mysql_query($query);\n\n if($mobile == true){\n $dir = \"../\";\n }else{\n $dir = \"\";\n }\n\n while($row = mysql_fetch_assoc($result)){\n\n echo \"<h3><img class='left' alt='\" . $row['homeTeam'] . \"' width='141' src='\" . $dir . $row['home_logo'] .\"' /> <img class='right' alt='\" . $row['visitingTeamName'] . \"' width='141' src='\" . $dir . $row['visiting_logo'] .\"' /></a></h3>\";\n echo '<div class=\"content\"><p>';\n echo \"<a href='schedule/\".$row['homeTeamId'].\"/\".$row['league'].\"/\".urlencode($row['homeTeam']).\"'>\" . $row['homeTeam'] . \"</a> VS <a href='schedule/\".$row['visitingTeamId'].\"/\".$row['league'].\"/\".urlencode($row['visitingTeamName']).\"'>\" . $row['visitingTeamName'] . \"</a><br />\";\n echo $row['gameDate'] . \" at \" . $row['gameTime'] . \"<br />\";\n echo '</p></div>';\n\n }\n\n }", "function get_team_whip_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT p.player_id\n , CONCAT(pl.first_name,\" \",pl.last_name) AS player\n , p.whip\n FROM CalcPitching p INNER JOIN players pl ON p.player_id=pl.player_id\n INNER JOIN team_history_record t ON p.team_id=t.team_id AND p.year=t.year\n WHERE p.year = :year AND p.team_id = :team_id\n AND p.g >= 35\n ORDER BY p.whip\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_whip_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_whip_leaders;\n}", "function show_round()\n{\n $bdd = DB_connect();\n\n // On récupère de la table matches les informations sur la partie\n $req_match = $bdd->query('SELECT * FROM matches WHERE id = \\''.$_SESSION['match']['id'].'\\'');\n $data_match = $req_match->fetch();\n\n // On récupère de la table rounds tous les rounds de la partie\n $req_round = $bdd->query('SELECT * FROM rounds WHERE match_id = \\''.$_SESSION['match']['id'].'\\'');\n while($data_round = $req_round->fetch())\n $tab[$data_round['id']] = $data_round;\n // On sélectionne le dernier round en mémoire du match\n $round = $tab[max(array_keys($tab))];\n\n $_SESSION['match']['previous_user'] = $round['actual_user'];\n\n // On détermine si l'on est le user1 ou le user2 dans la partie\n if ($data_match['user1_id'] == $_SESSION['user']['id'])\n {\n $_SESSION['match']['user_me'] = 1;\n $_SESSION['match']['user_me_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_me_score'] = $round['user1_score'];\n $_SESSION['match']['user_enemy'] = 2;\n $_SESSION['match']['user_enemy_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user2_score'];\n }\n else\n {\n $_SESSION['match']['user_me'] = 2;\n $_SESSION['match']['user_me_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_me_score'] = $round['user2_score'];\n $_SESSION['match']['user_enemy'] = 1;\n $_SESSION['match']['user_enemy_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user1_score'];\n }\n\n // Si la partie est finie, on n'affiche pas la map\n if ($data_match['end'])\n {\n echo '<h3>La partie est finie !</h3>';\n if ($_SESSION['match']['user_me_score'] > $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Bravo ! Tu as GAGNÉ.</h3>';\n }\n else if ($_SESSION['match']['user_me_score'] < $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Dommage ! Tu as PERDU.</h3>';\n }\n else\n {\n echo '<h3>Bravo ! Vous êtes arrivés EX AEQUO.</h3>';\n }\n return (0);\n }\n\n // On enregistre la map dans le $_SESSION\n $map = string_to_map($round['map']);\n $_SESSION['match']['map'] = $map;\n\n // On affiche la map à jour\n echo '<table id=\"map\">';\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td></td>';\n else\n echo '<td>'.$j.'</td>';\n }\n echo '</tr>';\n for ($i = 'A'; isset($map[$i]); $i++)\n {\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td>'.$i.'</td>';\n else\n {\n if ($map[$i][$j] == 3)\n $background_color = 'red';\n else if ($map[$i][$j] == 4)\n $background_color = 'green';\n else\n $background_color = 'white';\n echo \"<td style='background-color:$background_color'></td>\";\n }\n }\n echo '</tr>';\n }\n echo '</table>';\n\n if ($round['actual_user'] == $_SESSION['match']['user_me'] ||\n ($round['actual_user'] == 0 && $_SESSION['match']['user_me'] != 1))\n {\n // On récupère le nom de l'ennemi dans la table users\n $req_enemy_login = $bdd->query('SELECT login FROM users WHERE id = \\''.$_SESSION['match']['user_enemy_id'].'\\'');\n $data_enemy_login = $req_enemy_login->fetch();\n\n echo '<h3>C\\'est au tour de '.$data_enemy_login['login'].'</h3>';\n echo '<form method=\"POST\" action=\"game.php\">\n <input type=\"submit\" name=\"reload_submit\" value=\"↻ Rafraîchir\">\n </form>';\n return (1);\n }\n else\n {\n echo '<h3>C\\'est à ton tour !</h3>\n <form method=\"POST\" action=\"#\">\n <br>\n <input type=\"text\" name=\"coord\" placeholder=\"Case\" required><br><br>\n <input type=\"submit\" value=\"Jouer\">\n </form>';\n return (0);\n }\n}", "function get_team_player_batting_stats($year,$team_id) {\n global $db;\n $query = 'SELECT concat(players.first_name, \" \", players.last_name) AS player\n , positions.pos_name AS pos\n , CalcBatting.g\n , CalcBatting.ab\n , CalcBatting.pa\n , CalcBatting.h\n , CalcBatting.d\n , CalcBatting.t\n , CalcBatting.hr\n , CalcBatting.bb\n , CalcBatting.k\n , CalcBatting.ba\n , CalcBatting.krate\n , CalcBatting.bbrate\n , CalcBatting.obp\n , CalcBatting.OBPplus\n , CalcBatting.slg\n , CalcBatting.ops\n , CalcBatting.iso\n , CalcBatting.babip\n , CalcBatting.woba\n , CalcBatting.wRAA\n , CalcBatting.wRC\n , CalcBatting.`wRC+`\n , CalcBatting.player_id\n\n FROM CalcBatting INNER JOIN players ON CalcBatting.player_id = players.player_id\n INNER JOIN positions ON players.position = positions.position\n WHERE year = :year AND CalcBatting.team_id = :team_id AND players.position <> 1\n ORDER BY CalcBatting.PA DESC, players.last_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $batters = $statement->fetchAll();\n $statement->closeCursor();\n return $batters;\n}", "function getWeekForActualResults($mysqli, $week) {\n\t$counter = 1;\n\t$counterTwo = 1;\n\t$missedGameCutoffCounter = 0;\n\t$currentDateAndTimeForCutoff = getCurrentDateAndTimeForCutoff ();\n\t$getWeekForPicks = $mysqli->prepare ( \"select * from game_list where weekid = ?\" );\n\t$getWeekForPicks->bind_param ( 'i', $week );\n\t$getWeekForPicks->execute ();\n\t$myPicks = $getWeekForPicks->get_result ();\n\t$numberOfGames = getNumberOfGamesInWeek ( $mysqli, $week );\n\t// else { sameScore = false; var table = $(\"#submitActualResults tbody\"); sameScorePicks = []; table.find(\\'tr\\').each(function () { var $input = $(this).find(\\'td input\\'), awayScore = $input.eq(1).val(), homeScore = $input.eq(4).val(); if (awayScore == homeScore) { sameScore = true; } }); } if (sameScore) { alert(\"You cannot have the same score for any game. Please check scores.\"); return false; } else { return true; }\n\techo \"<br>\";\n\techo '<script>$(document).ready(function () { var specialKeys = []; specialKeys.push(8); $(function () { $(\\'.numeric\\').bind(\"keypress\", function (e) { var keyCode = e.which ? e.which : e.keyCode; var ret = ((keyCode >= 48 && keyCode <= 57) || specialKeys.indexOf(keyCode) != -1); return ret; }); $(\\'.numeric\\').bind(\"paste\", function (e) { return false; }); $(\\'.numeric\\').bind(\"drop\", function (e) { return false; }); });});</script>';\n\techo '<script>$(document).ready(function () {$(\"button[id$=\\'submitActualResults\\']\").click(function () { var emptyInputs = $(this).parent().find(\\'td input[type=\"text\"]\\').filter(function () { return $(this).val() === \"\"; }); if (emptyInputs.length) { alert(\"Please fill out all scores!\"); return false; } }); });</script>';\n\techo \"<form method=\\\"post\\\" action=\\\"php/process_actualresults.php\\\" id=\\\"submitActualResultsForm\\\">\";\n\techo \"<h4>Week $week</h4>\";\n\techo \"<input type=\\\"hidden\\\" name=\\\"week\\\" value=\\\"$week\\\"/><button type=\\\"submit\\\" id=\\\"submitActualResults\\\">Submit Actual Results</button>\";\n\techo \"<table id=\\\"submitActualResults\\\">\";\n\techo \"<thead>\";\n\techo \"<tr>\";\n\techo \"<td><h4>Away Score</h4></td>\";\n\techo \"<td></td>\";\n\techo \"<td width=\\\"200\\\"><h4>Away Team</h4></td>\";\n\techo \"<td></td>\";\n\techo \"<td><h4>VS</h4></td>\";\n\techo \"<td></td>\";\n\techo \"<td><h4>Home Team</h4></td>\";\n\techo \"<td></td>\";\n\techo \"<td><h4>Home Score</h4></td>\";\n\techo \"</tr>\";\n\techo \"</thead>\";\n\techo \"<tbody>\";\n\twhile ( $row = mysqli_fetch_array ( $myPicks ) ) {\n\t\techo \"<tr>\";\n\t\techo \"<td><input type=\\\"hidden\\\" name=\\\"gameID$counterTwo\\\" value=\\\"$row[gameid]\\\"/><input class=\\\"numeric\\\" id=\\\"firstinput\\\" type=\\\"text\\\" name=\\\"$counter\\\"size=\\\"2\\\" maxlength=\\\"2\\\" value='$row[away_score]'/></td>\";\n\t\t$counter ++;\n\t\techo \"<td></td>\";\n\t\techo \"<td><input name=\\\"awayGame$counterTwo\\\" type=\\\"hidden\\\" value=\\\"\" . $row [away_team] . \"\\\" />\" . $row [away_team] . \"</td>\";\n\t\techo \"<td></td>\";\n\t\techo \"<td>@</td>\";\n\t\techo \"<td></td>\";\n\t\techo \"<td><input name=\\\"homeGame$counterTwo\\\" type=\\\"hidden\\\" value=\\\"\" . $row [home_team] . \"\\\" /> \" . $row [home_team] . \" </td>\";\n\t\techo \"<td></td>\";\n\t\techo \"<td><input class=\\\"numeric\\\" type=\\\"text\\\" name=\\\"$counter\\\"size=\\\"2\\\" maxlength=\\\"2\\\" value='$row[home_score]'/></td>\";\n\t\techo \"</tr>\";\n\t\t$counter ++;\n\t\t$counterTwo ++;\n\t}\n\techo \"</tbody>\";\n\techo \"</table>\";\n\techo \"</form>\";\n\treturn true;\n}", "public function fetchLeague($sport_id)\n\t{\n\t\t$log_data \t\t\t\t\t= [];\n\t\t$log_data['last_timestamp']\t= gmdate(\"Y-m-d\\TH:i:s\");\n\t\t$log_details\t\t\t\t= [];\n\t\t$insert_count\t\t\t\t= 0;\n\t\t$update_count\t\t\t\t= 0;\n\t\t$log_details['start_time']\t= date('Y-m-d H:i:s');\n\t\t$url \t\t\t\t\t\t= FEED_URL.'sid='.$sport_id.'&o=lg'.$this->getLastTimeStamp('league feed',$sport_id);\n\t\t$feed_object\t\t\t\t= getObjectFromXMl($url);\n\t\tif(is_object($feed_object) && isset($feed_object->L) && count($feed_object->L)){\n\t\t\t$insert_array\t\t\t=\t[];\n\t\t\tforeach ($feed_object->L as $key => $value) {\n\t\t\t\t$league\t= League::find((int)$value['I']);\n\t\t\t\t$data\t\t\t\t=\t[];\n\t\t\t\t$data['id']\t\t\t=\t(int)$value['I'];\n\t\t\t\t$data['sport_id']\t=\t(int)$value['S'];\n\t\t\t\t$data['country_id']\t=\t(int)$value['C'] == 0 ? null : (int)$value['C'];\n\t\t\t\t$data['name']\t\t=\t(string)$value['N'];\n\t\t\t\t$data['priority']\t=\t(int)$value['PRC'];\n\t\t\t\tif(isset($league->id) == false){\n\t\t\t\t\t//we will insert this data\n\t\t\t\t\t$data['created_at']\t=\tdate('Y-m-d H:i:s');\n\t\t\t\t\t$insert_array[]\t\t= \t$data;\n\t\t\t\t\t$insert_count++;\n\t\t\t\t}else {\n\t\t\t\t\t$data['updated_at']\t=\tdate('Y-m-d H:i:s');\n\t\t\t\t\t$league->fill($data)->save();\n\t\t\t\t\t$update_count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$log_details['details']\t= $insert_count.' row inserted, '.$update_count.' row updated.';\n\t\t\t//saved to database\n\t\t\tLeague::insert($insert_array);\n\t\t}else {\n\t\t\t$log_details['details']\t= 'data not found';\n\t\t}\n\t\t$log_details['end_time']\t= date('Y-m-d H:i:s');\n\t\t//log info\n\t\t$log_data['sport_id']\t\t= $sport_id;\n\t\t$log_data['event']\t\t\t= 'league feed';\n\t\t$log_data['details']\t\t= json_encode($log_details);\n\t\t$log_data['status']\t\t\t= 'ok';\n\t\t$this->logFeed($log_data);\n\t}", "function get_team_player_pitching_stats($year,$team_id) {\n global $db;\n $query = 'SELECT concat(players.first_name, \" \", players.last_name) AS player\n , g\n , gs\n , ip\n , ab\n , ha\n , k\n , bb\n , bf\n , war\n , k9\n , bb9\n , HR9\n , WHIP\n , `K/BB`\n , BABIP\n , ERA\n , FIP\n , xFIP\n , ERAminus\n , ERAplus\n , FIPminus\n , CalcPitching.player_id\n\n\n FROM CalcPitching INNER JOIN players ON CalcPitching.player_id = players.player_id\n\n WHERE year = :year AND CalcPitching.team_id = :team_id\n ORDER BY gs DESC, players.last_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $pitchers = $statement->fetchAll();\n $statement->closeCursor();\n return $pitchers;\n}", "public function testAction()\n {\n if ($this->identity()) {\n $summoners = $this->account()->getSummoners();\n $summoner = $summoners[0];\n $response = $this->getServiceLocator()->get('youtube_service')->findByQuery(\"league of legends\", null, 20, \"this_week\");\n $videos = $response->getVideos(true);\n foreach ($videos as $video) {\n echo $video->getScore() . '<br />';\n }\n # $feeds = $this->getServiceLocator()->get('feed_service')->getLolProFeeds(array(\"Ahri\",\"Aatrox\",\"Jayce\"));\n return new ViewModel();\n } else {\n return $this->notFoundAction();\n }\n }" ]
[ "0.78913397", "0.74179655", "0.67957884", "0.6563778", "0.6428345", "0.6420337", "0.6350053", "0.6269324", "0.62174594", "0.62074333", "0.61606354", "0.6091576", "0.6075755", "0.6038162", "0.59723884", "0.59410155", "0.59332544", "0.58928007", "0.585586", "0.580125", "0.57740897", "0.5721088", "0.5717117", "0.5707732", "0.5698061", "0.56916404", "0.5663264", "0.5659736", "0.56275594", "0.5622267", "0.56198204", "0.56064874", "0.5595781", "0.5588851", "0.5588327", "0.5562604", "0.5562604", "0.55593324", "0.5541129", "0.5538989", "0.55350304", "0.5530643", "0.5530272", "0.5529407", "0.55235946", "0.55235374", "0.55009496", "0.550006", "0.5494903", "0.5494859", "0.5494527", "0.5494162", "0.54851115", "0.5483493", "0.5483047", "0.5476223", "0.54754055", "0.54655707", "0.54645044", "0.54644847", "0.5463956", "0.54584956", "0.5446218", "0.54289377", "0.5428071", "0.54270726", "0.54033446", "0.53980917", "0.5396475", "0.5396332", "0.53931415", "0.53924215", "0.5390979", "0.53815764", "0.53793633", "0.53680444", "0.53678155", "0.53629243", "0.5361143", "0.53598183", "0.5357025", "0.53457385", "0.5345044", "0.5343618", "0.5337139", "0.533646", "0.53357273", "0.5329791", "0.5329715", "0.5322324", "0.5320383", "0.5315129", "0.5311666", "0.53097856", "0.530722", "0.5306775", "0.5305018", "0.52991277", "0.528086", "0.5277385" ]
0.80964524
0
Add Results Zadavani vysledku kola $rid= Round ID $mode= add/edit
function AddResults($rid){ global $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players; global $db_admin,$db_admin_contact,$db_country,$db_league_seasons_rounds_results_players,$db_league_teams; global $url_flags; // CHECK PRIVILEGIES if ($_GET['action'] == "results_add" || $_GET['action'] == "results_show"){ if (CheckPriv("groups_league_season_add") <> 1) { echo _NOTENOUGHPRIV;exit;} } else { echo _NOTENOUGHPRIV;exit; } $res_rounds = mysql_query("SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id, c.country_shortname,c.country_name FROM $db_league_seasons_rounds_results_players AS lsrrp JOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=".(float)$rid." JOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id JOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id LEFT JOIN $db_admin_contact AS ac ON ac.aid=a.admin_id LEFT JOIN $db_country AS c ON c.country_id=ac.admin_contact_country WHERE lsrrp.league_season_round_result_player_round_id=".(float)$rid." ORDER BY lsrrp.league_season_round_result_player_place ASC") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); switch ($_GET['action']){ case "results_add": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $nick = ""; $team = ""; $table_width = "857"; echo Menu(); break; case "results_show": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $flag = " <td width=\"20\" align=\"left\" class=\"eden_title\">"._CMN_COUNTRY."</td>\n"; $nick = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>\n"; $team = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; $table_width = "600"; break; default: echo ""; } $ar_round = mysql_fetch_array($res_round); $league_name = stripslashes($ar_round['league_league_name']); $season_id = $ar_round['league_season_round_season_id']; $season_name = stripslashes($ar_round['league_season_name']); $round_num = $ar_round['league_season_round_num']; echo "<table width=\"".$table_width."\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; echo " <tr>\n"; echo " <td colspan=\"3\" align=\"left\">"; if ($_GET['action'] == "results_add"){echo "<h5 style=\"margin:20px 0px 0px 0px;\">".$league_name." > <a href=\"modul_league.php?action=rounds&sid=".$season_id."&project=".$_SESSION['project']."\" target=\"_self\">".$season_name."</a> > "._LEAGUE_SEASON_ROUND." ".$round_num."</h5>";} if ($_GET['action'] == "results_add"){echo "<form action=\"sys_save.php?action=results_add&rid=".$rid."sid=".$season_id."\" method=\"post\" enctype=\"multipart/form-data\">";} echo " </td>\n"; echo " </tr>\n"; echo " <tr style=\"background-color:#dce3f1;\">\n"; echo " <td width=\"50\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_POSITION."</td>\n"; echo " <td align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_POINTS."</td>\n"; echo $flag; echo $nick; echo " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_GUID."</td>\n"; echo $team; echo " </tr>\n"; switch ($_GET['action']){ case "results_add": $i=1; while ($ar_round['league_season_round_classified'] >= $i){ $ar_rounds = mysql_fetch_array($res_rounds); if ($ar_rounds['league_season_round_result_player_player_id']){ $guid = $ar_rounds['league_season_round_allowed_player_guid']." (PID ".$ar_rounds['league_season_round_result_player_player_id'].")";} else {$guid ="";} echo "<tr align=\"left\" valign=\"top\" onmouseover=\"this.style.backgroundColor='FFDEDF'\" onmouseout=\"this.style.backgroundColor='FFFFFF'\" style=\"background-color: #FFFFFF;\">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">"; echo " <input type=\"hidden\" name=\"round_player_num\" value=\"".$i."\">"; echo " <input type=\"hidden\" name=\"round_player_data[".$i."_place]\" value=\"".$i."\">"; echo " ".$i.""; echo " </td>\n"; echo " <td align=\"left\">"; echo " <input name=\"round_player_data[".$i."_points]\" size=\"5\" value=\"".$ar_rounds['league_season_round_result_player_points']."\">"; echo " </td>\n"; echo " <td width=\"200\" align=\"left\">"; echo " <input type=\"text\" name=\"round_player_data[".$i."_player_guid]\" size=\"25\" value=\"".$guid."\" autocomplete=\"off\" onkeyup=\"ajax_showOptions(this,'getAllowedPlayerGuidByLetters=1&rid=".$rid."&project=".$_SESSION['project']."',event)\">"; echo " </td>\n"; echo "</tr>\n"; $i++; } echo " <tr align=\"left\" valign=\"top\">\n"; echo " <td align=\"left\" colspan=\"3\"><br />\n"; echo " <input type=\"hidden\" name=\"round\" value=\"".$round_num."\">\n"; echo " <input type=\"hidden\" name=\"rid\" value=\"".$rid."\">\n"; echo " <input type=\"hidden\" name=\"sid\" value=\"".$season_id."\">\n"; echo " <input type=\"submit\" value=\""._LEAGUE_SEASON_ROUND_RESULTS_SAVE."\" class=\"eden_button\">\n"; echo " <input type=\"hidden\" name=\"confirm\" value=\"true\">\n"; echo " <input type=\"hidden\" name=\"project\" value=\"".$_SESSION['project']."\">\n"; if ($ar_rounds){echo " <input type=\"hidden\" name=\"results_mode\" value=\"edit\">\n";} echo " </form>\n"; echo " </td>\n"; echo " </tr>\n"; break; case "results_show": $i=1; while ($ar_rounds = mysql_fetch_array($res_rounds)){ echo " <tr "; if ($i % 2 == 0){echo "class=\"suda\"";} else {echo "class=\"licha\"";} echo ">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">".$i."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_season_round_result_player_points']."</td>\n"; echo " <td valign=\"top\"><img src=\"".$url_flags.$ar_rounds['country_shortname'].".gif\" alt=\"".stripslashes($ar_rounds['country_name'])."\" title=\"".stripslashes($ar_rounds['country_name'])."\" /></td>"; echo " <td align=\"left\">".$ar_rounds['admin_nick']."</td>\n"; echo " <td width=\"200\" align=\"left\">".$ar_rounds['league_season_round_allowed_player_guid']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_team_name']."</td>\n"; echo "</tr>\n"; $i++; } break; default; echo ""; } echo "</table>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addmatch()\n\t{\n\t\t$option = JFactory::getApplication()->input->getCmd('option');\n\t\t$app = JFactory::getApplication();\n\t\t$post = JFactory::getApplication()->input->post->getArray(array());\n\t\t$post['project_id'] = $app->getUserState( \"$option.pid\", '0' );\n\t\t$post['round_id'] = $app->getUserState( \"$option.rid\", '0' );\n $post['count_result'] = 1;\n $post['published'] = 1;\n\t\t$model = $this->getModel('match');\n $row = $model->getTable();\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' row<br><pre>'.print_r($row,true).'</pre>'),'');\n \n // bind the form fields to the table\n if (!$row->bind($post)) \n {\n $this->setError($this->_db->getErrorMsg());\n return false;\n }\n // make sure the record is valid\n if (!$row->check()) \n {\n $this->setError($this->_db->getErrorMsg());\n return false;\n }\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' row<br><pre>'.print_r($row,true).'</pre>'),'');\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' post<br><pre>'.print_r($post,true).'</pre>'),'');\n \n // store to the database\n\t\t//if ($row->store($post))\n if ($row->save($post))\n\t\t{\n\t\t\t$msg = JText::_('COM_SPORTSMANAGEMENT_ADMIN_MATCH_CTRL_ADD_MATCH');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = JText::_('COM_SPORTSMANAGEMENT_ADMIN_MATCH_CTRL_ERROR_ADD_MATCH').$model->getError();\n\t\t}\n\t\t$link = 'index.php?option=com_sportsmanagement&view=matches';\n\t\t$this->setRedirect($link,$msg);\n\t}", "public function ajoutRue(int $rue)\n {\n // On effectue une recherche de tous les immeubles contenus\n $query = Core::query('building-by-street');\n $query->bindValue(':street', $rue, PDO::PARAM_INT);\n $query->execute();\n\n // S'il y a des immeubles\n if ($query->rowCount()) {\n // On récupère la liste des identifiants\n $immeubles = $query->fetchAll(PDO::FETCH_NUM);\n\n // Si la mission est un porte à porte,\n // on cherche les électeurs concernés\n if ($this->_data['mission_type'] == 'porte') {\n // Pour chaque immeuble, on recherche tous les électeurs\n foreach ($immeubles as $immeuble) {\n $query = Core::query('people-by-building');\n $query->bindValue(':building', $immeuble[0], PDO::PARAM_INT);\n $query->execute();\n $contacts = $query->fetchAll(PDO::FETCH_NUM);\n\n // Pour chaque électeur, on créé une porte à frapper\n foreach ($contacts as $contact) {\n $query = Core::query('item-new');\n $query->bindParam(\n ':mission',\n $this->_data['mission_id'],\n PDO::PARAM_INT\n );\n $query->bindParam(':rue', $rue, PDO::PARAM_INT);\n $query->bindParam(':immeuble', $immeuble[0], PDO::PARAM_INT);\n $query->bindParam(':contact', $contact[0], PDO::PARAM_INT);\n $query->execute();\n }\n }\n } else {\n foreach ($immeubles as $immeuble) {\n $query = Core::query('item-boitage-new');\n $query->bindParam(\n ':mission', \n $this->_data['mission_id'], \n PDO::PARAM_INT\n );\n $query->bindParam(':rue', $rue, PDO::PARAM_INT);\n $query->bindParam(':immeuble', $immeuble[0], PDO::PARAM_INT);\n $query->execute();\n }\n }\n } else {\n return false;\n }\n }", "function expense_tracker_add_row()\n{\n\t$this->layout='blank';\n\t$s_society_id=(int)$this->Session->read('society_id');\n\t$s_user_id=(int)$this->Session->read('user_id');\n\n\t\t$count = (int)$this->request->query('con');\n\t\t$this->set('count',$count);\n\n\t\t\t$this->loadmodel('accounts_group');\n\t\t\t$conditions=array(\"accounts_id\" => 4);\n\t\t\t$cursor1=$this->accounts_group->find('all',array('conditions'=>$conditions));\n\t\t\t$this->set('cursor1',$cursor1);\n\n\t\t\t\t$this->loadmodel('ledger_sub_account');\n\t\t\t\t$conditions=array(\"ledger_id\" => 15);\n\t\t\t\t$cursor2=$this->ledger_sub_account->find('all',array('conditions'=>$conditions));\n\t\t\t\t$this->set('cursor2',$cursor2);\n}", "public function save($round){\n if($round->isPersistent()){\n //update\n $q = \"UPDATE round\n set round.number = ?,\n league_id = ?\n WHERE round_id = ?;\";\n\n //create prepared statement from query\n $stmt = $this->dbConnection->prepare($q);\n //bind parameters to prepared statement\n $roundNum = $round->getNumber();\n $leagueId = $round->getLeague()->getId();\n $roundId = $round->getId();\n $stmt->bindParam(1, $roundNum, \\PDO::PARAM_INT);\n $stmt->bindParam(2, $leagueId, \\PDO::PARAM_INT);\n $stmt->bindParam(3, $roundId, \\PDO::PARAM_INT);\n if($stmt->execute()){\n echo 'round created successfully';\n }\n else{\n throw new RDException('Error creating round' . print_r($stmt->errorInfo()));\n }\n }\n else{\n //insert\n //create Query\n $q = \"INSERT INTO round (round.number, league_id) VALUES(?, ?);\";\n //create prepared statement from query\n $stmt = $this->dbConnection->prepare($q);\n //bind parameters to prepared statement\n $roundNum = $round->getNumber();\n $leagueId = $round->getLeague()->getId();\n $stmt->bindParam(1, $roundNum, \\PDO::PARAM_INT);\n $stmt->bindParam(2, $leagueId, \\PDO::PARAM_INT);\n\n if($stmt->execute()){\n $round->setId($this->dbConnection->lastInsertId());\n echo 'round created successfully';\n }\n else{\n throw new RDException('error creating round');\n }\n }\n }", "function _publiRound()\r\n\t{\n\t\t$roundIds = kform::getInput(\"rowsDraws\", array());\n\t\t$status = kform::getInput(\"status\");\n\t\t$publiSchedu = kform::getInput(\"publiSchedu\", false);\r\n\r\n\t\t// Modifie la visibilite d'un round\n\t\trequire_once \"utils/utpubli.php\";\n\t\t$utp = new utpubli();\n\t\tforeach($roundIds as $roundId) $utp->publiRound($roundId, $status, $publiSchedu);\n\t\t$page = new utPage('none');\r\n\t\t$page->close();\r\n\t\texit();\r\n\t}", "function _createRound()\n\t{\n\t\t$ut = $this->_ut;\n\t\t$dt = $this->_dt;\n\n\t\t$round['rund_id'] = -1;\n\t\t$round['rund_name'] = kform::getInput('roundName');\n\t\t$round['rund_stamp'] = kform::getInput('roundStamp');\n\t\t$round['rund_type'] = kform::getInput('roundType');\n\t\t$round['rund_entries'] = kform::getInput('roundEntries');\n\t\t$round['rund_drawId'] = kform::getInput('drawId');\n\t\t$round['rund_rge'] = kform::getInput('rundFinalPlace');\n\t\t$round['rund_group'] = kform::getInput('group');\n\t\t$round['rund_qual'] = 1;\n\n\t\t$tie['tie_nbms'] = 0;\n\t\t$tie['tie_nbws'] = 0;\n\t\t$tie['tie_nbmd'] = 0;\n\t\t$tie['tie_nbwd'] = 0;\n\t\t$tie['tie_nbxd'] = 0;\n\t\t$tie['tie_nbas'] = 0;\n\t\t$tie['tie_nbad'] = 0;\n\t\t$disci = kform::getInput('drawDisci');\n\t\tswitch ($disci)\n\t\t{\n\t\t\tcase WBS_MS :\n\t\t\t\t$tie['tie_nbms'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_LS :\n\t\t\t\t$tie['tie_nbws'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_MD :\n\t\t\t\t$tie['tie_nbmd'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_LD :\n\t\t\t\t$tie['tie_nbwd'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_MX :\n\t\t\t\t$tie['tie_nbxd'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_AS :\n\t\t\t\t$tie['tie_nbas'] = 1;\n\t\t\t\tbreak;\n\t\t\tcase WBS_AD :\n\t\t\t\t$tie['tie_nbad'] = 1;\n\t\t\t\tbreak;\n\t\t}\n\n\t\trequire_once \"utils/utround.php\";\n\t\t$utr = new utround();\n\t\t$roundId = $utr->updateRound($round, $tie);\n\n\t\t$page = new utPage('none');\n\t\t//$page->close();\n\t\texit();\n\t}", "public function showRoundResults(){\n global $ilAccess, $ilUser, $tpl, $ilTabs;\n include_once('./Services/Table/classes/class.ilTable2GUI.php');\n\n $ilTabs->activateTab(\"showResults\");\n $round_id = $_GET[\"round_id\"];;\n $html;\n $answers = $this->object->getAnswers($round_id);\n $answer_count = count($this->object->getDistinctAnswers($round_id));\n $questions = $this->object->getQuestions($this->object->getId());\n\n \n // For every question render the answers and add them\n if(!count($questions) == 0) {\n foreach ($questions as $question){\n switch($question[\"type\"]) {\n case QUESTION_TYPE_MULTI:\t// Multiple choice\n $html = $html.$this->showRoundResultsForMultipleChoice($question, $answers, $answer_count, $round_id);\n break;\n case QUESTION_TYPE_SINGLE:\t// Single choice\n $html = $html.$this->showRoundResultsForSingleChoice($question, $answers, $answer_count, $round_id);\n break;\n case QUESTION_TYPE_NUM:\t// Numeric\n $html = $html.$this->showRoundResultsForNumeric($question, $answers, $answer_count, $round_id);\n break;\n }\n }\n }\n\n $tpl->setContent($html);\n }", "function add_kunjungan_pasien($no_rm){\n $kunjungan = $this->db->query(\"select kunjungan from pasien where no_rm = '\".$no_rm.\"' \")->row()->kunjungan;\n \n $data = array(\n 'kunjungan' => ($kunjungan + 1)\n );\n\n $this->db->where('no_rm', $no_rm);\n $this->db->update('pasien',$data);\n }", "public function additionReson()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `reson`(`namena`, `namene`, `deletn`)\n VALUES ('$this->namena' ,'$this->namene' ,'$this->deletn')\");\n $result = $sql->execute();\n $idn = $dbh->lastInsertId();\n return array ($result,$idn);\n }", "public function additionReson()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `reson`(`namena`, `namene`, `deletn`)\n VALUES ('$this->namena' ,'$this->namene' ,'$this->deletn')\");\n $result = $sql->execute();\n $idn = $dbh->lastInsertId();\n return array ($result,$idn);\n }", "function action_add() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['add_id'];\n\t\t\t$table = $data['add_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\t$choosen[$table][$id] = $id;\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}", "public function CreateRound() {\n\t\tarray_push($this->rounds, array());\n\t}", "public function changeRoundStatus(){\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"showResults\");\n\n if(isset($_GET['round_id']) && is_numeric($_GET['round_id'])){\n $round_id = $_GET['round_id'];\n\n $this->object->changeRoundStatus($round_id);\n $ilTabs->activateTab(\"showResults\");\n\n\n ilUtil::sendSuccess($this->txt(\"results_round_status_change_success\"), true);\n $ilCtrl->redirect($this, \"showResults\");\n }\n }", "private function addResult($result) {\n //Adds a result to the results array\n $this->results[] = $result;\n }", "public function actionCreate($id)\r\n {\r\n $provider = ProviderPerson::model()->findByAttributes(array('user_id' => $id));\r\n $model = new Results_add;\r\n\r\n if (isset($_POST['Results_add'])) {\r\n\r\n if (CUploadedFile::getInstance($model, 'image')) {\r\n $model->image = CUploadedFile::getInstance($model, 'image');\r\n $photoName = MainHelper::translit($model->image->getName());\r\n $model->photo = $photoName;\r\n $model->photo = '/' . Yii::getPathOfAlias('photos') . '/' . $photoName;\r\n } else $model->photo = '/' . Yii::getPathOfAlias('photos') . '/Nophoto.jpg';\r\n\r\n $model->attributes = $_POST['Results_add'];\r\n $model->file_id = 0;\r\n $model->user_id = $id;\r\n $model->date = date('Y-m-d H:i:s');\r\n $model->last_check = date('Y-m-d H:i:s', time());\r\n\r\n if ((ProviderPerson::getUploadedProductsCount($id) < $provider->allowed_products_amount) && $model->validate() && $model->save()) {\r\n $provider->uploaded_products_amount += 1;\r\n\r\n $provider->save(false);\r\n if ($model->image) {\r\n $path = Yii::getPathOfAlias('photos') . '/' . $photoName;\r\n $model->image->saveAs($path);\r\n }\r\n\r\n\r\n if (isset($_POST['Numbers_add']['number'])) {\r\n foreach ($_POST['Numbers_add']['number'] as $item) {\r\n $number = new Numbers_add();\r\n $number->user_id = $id;\r\n $number->results_add_id = $model->id;\r\n $number->number = $item;\r\n $number->save(false);\r\n }\r\n }\r\n\r\n Yii::app()->user->setFlash('success', 'Товар додано.');\r\n\r\n $this->redirect(array('update', 'productId' => $model->id, 'id' => $id));\r\n } else {\r\n Yii::app()->user->setFlash('error', 'Ви загрузили максимально дозволену кількість товарів');\r\n $this->redirect(array('create', 'id' => $id));\r\n }\r\n }\r\n\r\n $this->render('create', array(\r\n 'model' => $model,\r\n 'id' => $id\r\n ));\r\n }", "function add_row()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->rows[] = $this->_prep_args($args);\n\t}", "public function add() \n { \n $data['piutang'] = $this->piutangs->add();\n $data['action'] = 'piutang/save';\n \n $tmp_statuss = $this->statuss->get_all();\n foreach($tmp_statuss as $row){\n $statuss[$row['id']] = $row['status'];\n }\n $data['statuss'] = $statuss;\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_piutang\").parsley();\n });','embed');\n \n $this->template->render('piutang/form',$data);\n\n }", "function addRvps()\n {\n $output = new stdClass();\n\n $db = new MySQL(DB_INFO);\n $table = 'ipt_networks';\n $where = 'status=1 AND server_nid='.$_POST['server'];\n $networks = $db->select($table, $where);\n\n $table = 'ipt_servers';\n $where = 'status=1 AND nid='.$_POST['server'];\n $output->res['server'] = $db->selectRow($where, null,$table);\n\n $table = 'fin_plans';\n $output->res['plan'] = $db->selectId($_POST['plan'],'*',$table);\n\n $table = 'fin_plan_limits';\n $where = \"plan_name='\".$output->res['plan']['plan_name'].\"'\";\n $output->res['limits'] = $db->selectRow($where, null,$table);\n\n $table = 'ipt_os';\n $plan_cpu = $output->res['plan']['cpu_core'];\n $plan_ram = $output->res['plan']['ram'];\n $where = 'min_ram<='.$plan_ram.' AND min_cpu<='.$plan_cpu;\n $output->res['os'] = $db->select($table, $where);\n\n $ip = false;\n foreach ($networks as $network) {\n $output->res['network'] = $network;\n $table = 'ipt_ips';\n $where = 'status=1 AND network_id='.$network['id'];\n $order = 'network_id';\n $ip = $db->selectRow($where, $order,$table);\n if ($ip) break;\n }\n $output->res['ip'] = $ip;\n $output->e = ($ip) ? false : true;\n echo json_encode($output);\n }", "public function add_estimation()\n\t{\n\t\t$qid = '';\n\t\t\n\t\t$this->load->model('operations_model'); \n $data['result'] = $this->operations_model->add_estimation();\n\t\t//echo $data['result']; die;\n\t\tif($data['result'] == \"2\"){\n\t\t\t$this->quotation_list($qid);\n\t\t}else{\n\t\t$this->load->view('operations',$data);\n\t\t \n\t\t}\n\t\t\n\t}", "function _displayFormKo($roundId)\r\n\t{\r\n\t\t$ut =& $this->_ut;\r\n\t\t$utd =& $this->_utd;\r\n\t\t$dt =& $this->_dt;\r\n\t\t$utr = new utround();\r\n\r\n\t\t//--- Details of the draw\n\t\tif (!empty($roundId)) $round = $utr->getRoundDef($roundId);\n\t\tif(!empty($round))\n\t\t{\n\t\t\t$groupName = $round['rund_group'];\r\n\t\t\t$drawId = $round['rund_drawId'];\n\t\t}\n\t\t// en cas de supression\n\t\telse\n\t\t{\n\t\t\t$groupName = kform::getInput(\"group\");\n\t\t\t$drawId = kform::getInput(\"drawId\");\n\t\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_MAINDRAW, null, $groupName);\n\t\t\t$round = reset($rounds);\n\t\t\t$roundId = $round['rund_id'];\n\t\t}\n\t\tif (empty($roundId)) return;\r\n\t\t$draw = $utd->getDrawById($drawId);\n\t\t$draw['groupname'] = $groupName;\r\n\t\t$kdiv =& $this->_displayHeadDraw($draw, 'itMainDraw', DRAW_FINAL_DISPLAY);\r\n\t\t$this->_utpage->_page->addAction('onload', array('initForm', 'formRoundDef'));\r\n\t\t$this->_utpage->_page->addJavaFile('draws/draws.js');\r\n\r\n\t\t// Afficher l'indicateur de publication\r\n\t\t$size['maxWidth'] = 30;\r\n\t\t$size['maxHeight'] = 30;\r\n\t\t$logo = utimg::getPubliIcon($round['rund_del'],\r\n\t\t$round['rund_pbl']);\r\n\t\t$kdiv->addImg('rundState', $logo, $size);\r\n\r\n\t\t// Bouton d'ajout\r\n\t\t$form =& $kdiv->addForm('formPlus');\r\n\t\t$form->addBtn('btnNewPlateau', KAF_NEWWIN, 'draws', DRAW_ROUND_NEW, $round['rund_group'] . ';' . $drawId . ';' . $draw['draw_disci']);\n\n\t\t// Bouton de supression\n\t\tif ($round['rund_type'] == WBS_ROUND_CONSOL || $round['rund_type'] == WBS_ROUND_PLATEAU)\n\t\t$form->addBtn('itDeletePlateau', KAF_NEWWIN, 'draws', DRAW_ROUND_CONFIRM, $roundId, 300, 100);\n\r\n\t\t// Bouton d'expansion\r\n\t\t$form->addBtn('btnPlus', 'mask', 'formRoundDef');\r\n\t\t//if($draw['draw_discipline'] <= WBS_SINGLE) $itsm['itSelectPlayers'] = array(KAF_NEWWIN, 'pairs', PAIR_SELECT_KOPAIRS, $roundId, 600, 460);\n\t\t//else $itsm['itSelectPairs'] = array(KAF_NEWWIN, 'pairs', PAIR_SELECT_KOPAIRS, $roundId, 600, 460);;\n\r\n\t\tif($draw['draw_discipline'] <= WBS_SINGLE)\n\t\t$form->addBtn('itSelectPlayers', KAF_NEWWIN, 'pairs', PAIR_SELECT_KOPAIRS, $roundId, 600, 460);\n\t\telse\n\t\t$form->addBtn('itSelectPairs', KAF_NEWWIN, 'pairs', PAIR_SELECT_KOPAIRS, $roundId, 600, 460);\n\t\t// Display the menu\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_GROUP, null, $round['rund_group']);\n\t\tif (!empty($rounds))\n\t\t{\n\t\t\t$form->addBtn('itPdfGroups', KAF_NEWWIN, 'draws', DRAW_PDF_GROUPS, $drawId.';'.$round['rund_group'], 600, 460);\n\t\t\t$form->addBtn('btnGroups2Draw', KAF_NEWWIN, 'pairs', PAIR_GROUP2KO, $drawId.';'.$round['rund_group'].';'.$roundId, 600, 460);\n\t\t}\n\n\t\t$form->addBtn('btnPdfDoc', KAF_NEWWIN, 'draws', DRAW_PDF_GROUP_KO, $drawId.';'.$round['rund_group'], 600, 460);\n\n\t\t// Donnees modifiables du tableau\r\n\t\t$form =& $kdiv->addForm('formRoundDef', 'draws', KID_UPDATE);\r\n\t\t$form->addHide('drawId', $drawId);\r\n\t\t$form->addHide('roundId', $roundId);\r\n\t\t$form->addHide('drawDisci', $draw['draw_disci']);\r\n\t\t$form->addHide('oldEntries', $round['rund_entries']);\r\n\t\t$form->addInfo('roundTypeLabel', $ut->getLabel($round['rund_type']));\n\t\tif ($round['rund_type'] == WBS_ROUND_CONSOL)\n\t\t{\r\n\t\t\t$form->addHide('roundType', $round['rund_type']);\n\t\t\t$form->addEdit('roundName', $round['rund_name'], 40);\r\n\t\t\t$form->addEdit('roundStamp', $round['rund_stamp'], 40);\r\n\t\t\t$form->addEdit('roundEntries', $round['rund_entries'], 40);\n\t\t\t$form->addEdit('group', $round['rund_group'], 40);\n\t\t\t$kedit =& $form->addEdit('rundFinalPlace', $round['rund_rge'], 3);\n\t\t\t$kedit->setMaxLength(3);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->addInfo('roundName', $round['rund_name']);\n\t\t\t$form->addInfo('roundStamp', $round['rund_stamp']);\n\t\t\t$form->addInfo('roundEntries', $round['rund_entries']);\n\t\t\t$form->addInfo('group', $round['rund_group']);\n\t\t\t$form->addInfo('rundFinalPlace', $round['rund_rge']);\n\t\t}\r\n\t\t$elts =array('roundTypeLabel', 'roundType', 'group', 'roundName', 'roundStamp', 'roundEntries', 'rundFinalPlace');\r\n\t\t$form->addBlock('blkInfo', $elts);\r\n\n\t\tif ($round['rund_type'] == WBS_ROUND_CONSOL) $form->addBtn('btnModify', 'activate', 'formRoundDef', 'roundName');\r\n\t\t$form->addBtn('btnMoins', 'mask', 'formRoundDef');\r\n\t\t$elts =array('btnModify','btnMoins');\r\n\t\t$form->addBlock('divModif', $elts);\r\n\r\n\t\t$form->addBtn('btnRegister', KAF_AJAJ, 'endSubmit', AJAJ_DRAW_SAVEROUND);\r\n\t\t//$form->addBtn('btnRegister', KAF_NEWWIN, 'ajajx', AJAJ_DRAW_SAVEROUND);\r\n\t\t$form->addBtn('btnCancel', 'cancel', 'formRoundDef');\r\n\t\t$elts =array('btnRegister','btnCancel');\r\n\t\t$form->addBlock('divValid', $elts);\r\n\r\n\t\t$kdiv->addDiv('page2', 'blkNewPage');\r\n\r\n\t\t//$itsm['btnPdfIbf'] = array(KAF_NEWWIN, 'draws', DRAW_PDF_KO_IBF, $roundId, 600, 460);\r\n\r\n\t\tif ($draw['draw_type'] == WBS_KO)\r\n\t\t{\r\n\t\t\tif ($draw['draw_nbPairs'] > $draw['draw_nbpl']) $kdiv->addImg('lgdPairs', utimg::getIcon('w1'));\r\n\t\t\tif ($draw['draw_nbPairs'] < $draw['draw_nbpl'])\t$kdiv->addImg('lgdPlaces', utimg::getIcon('w3'));\r\n\t\t}\r\n\t\t$kdiv->addDiv('page', 'blkNewPage');\r\n\n\t\t// Liste des plateaux\n\t\t$items =array();\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_MAINDRAW, null, $groupName);\n\t\tforeach($rounds as $cur)\n\t\t{\n\t\t\tif ($cur['rund_group'] == 'Principal') $name = $cur['rund_name'];\n\t\t\telse $name = $cur['rund_group'] .' - '. $cur['rund_name'];\n\t\t\t$items[$name] = array(KAF_UPLOAD, 'draws', DRAW_KO_DISPLAY, $cur['rund_id']);\n\t\t\tif($cur['rund_id'] == $roundId) $select = $name;\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_THIRD, null, $groupName);\n\t\tforeach($rounds as $cur)\n\t\t{\n\t\t\tif ($cur['rund_group'] == 'Principal') $name = $cur['rund_name'];\n\t\t\telse $name = $cur['rund_group'] .' - '. $cur['rund_name'];\n\t\t\t$items[$name] = array(KAF_UPLOAD, 'draws', DRAW_KO_DISPLAY, $cur['rund_id']);\n\t\t\tif($cur['rund_id'] == $roundId) $select = $name;\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_QUALIF, null, $groupName);\n\t\tforeach($rounds as $cur)\n\t\t{\n\t\t\tif ($cur['rund_group'] == 'Principal') $name = $cur['rund_name'];\n\t\t\telse $name = $cur['rund_group'] .' - '. $cur['rund_name'];\n\t\t\t$items[$name] = array(KAF_UPLOAD, 'draws', DRAW_KO_DISPLAY, $cur['rund_id']);\n\t\t\tif($cur['rund_id'] == $roundId) $select = $name;\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_CONSOL, 'rund_rge', $groupName);\n\t\tforeach($rounds as $cur)\n\t\t{\n\t\t\tif ($cur['rund_group'] == 'Principal') $name = $cur['rund_name'];\n\t\t\telse $name = $cur['rund_group'] .' - '. $cur['rund_name'];\n\t\t\t//$list[$cur['rund_id']] = $cur['rund_id']. '-- ' . $list[$cur['rund_id']];\n\t\t\t$items[$name] = array(KAF_UPLOAD, 'draws', DRAW_KO_DISPLAY, $cur['rund_id']);\n\t\t\tif($cur['rund_id'] == $roundId) $select = $name;\n\t\t}\n\t\t$rounds = $utr->getRounds($drawId, WBS_ROUND_PLATEAU, 'rund_rge', $groupName);\n\t\tforeach($rounds as $cur)\n\t\t{\n\t\t\t//if($cur['rund_size']==1) continue;\n\t\t\tif ($cur['rund_group'] == 'Principal') $name = $cur['rund_name'];\n\t\t\telse $name = $cur['rund_group'] .' - '. $cur['rund_name'];\n\t\t\t//$list[$cur['rund_id']] = $cur['rund_id']. '-- ' . $list[$cur['rund_id']];\n\t\t\t$items[$name] = array(KAF_UPLOAD, 'draws', DRAW_KO_DISPLAY, $cur['rund_id']);\n\t\t\tif($cur['rund_id'] == $roundId) $select = $name;\n\t\t}\n\t\tif (count($items) > 1)\t$kdiv->addMenu(\"menuplateau\", $items, $select);\n\n\t\t// Affichage du plateau\r\n\t\t$pairs = $dt->getRoundPairs($roundId);\n\t\trequire_once \"utils/utko.php\";\r\n\t\t$utko = new utKo($pairs, $round['rund_entries']);\r\n\t\t$vals = $utko->getExpandedValues();\n\t\t$kdraw = & $kdiv->addDraw('draw', $round['rund_qual']);\r\n\t\t$kdraw->setValues(1, $vals);\n\t\t$size = $round['rund_size'];\r\n\t\t$winners = $dt->getWinners($roundId);\r\n\t\t$allTies = $utr->getTies($roundId);\r\n\t\tif (isset($ties['errMsg'])) return $ties;\r\n\n\t\t// Construc a table with the ties\r\n\t\t$ties = array();\r\n\t\tforeach($allTies as $data)\r\n\t\t{\r\n\t\t\t$ties[$data['tie_posRound']] = $dt->getMatch($data);\r\n\t\t}\n\t\t$numCol = 2;\r\n\t\twhile( ($size/=2) >= 1)\r\n\t\t{\r\n\t $vals = array();\r\n\t $firstTie = $size-1;\r\n\t for($i=0; $i < $size; $i++)\r\n\t {\r\n\t \t$val = '';\r\n\t \tif (isset($winners[$firstTie + $i]))\r\n\t \t{\r\n\t \t\t$tie = $ties[$firstTie + $i];\n\t \t\t$winner = $winners[$firstTie + $i];\r\n\t \t\tif (!$tie['tie_isBye'])\r\n\t \t\t{\r\n\t \t\t\t$val['seed'] = array('name'=>$tie['mtch_num'], 'action' => array(KAF_NEWWIN, 'matches',\r\n\t \t\t\tKID_EDIT, $tie['mtch_id'], 600, 350));\r\n\t \t\t}\r\n\t \t\t$val['value'] = $winner['value'];\n\t \t\t$val['score'] = '';\r\n\t \t\t//$val['score'] = $tie['tie_looserdrawid'] .' - ' . $tie['mtch_id'] .';';\r\n\t \t\tif ($winner['score'] != '0-0') $val['score'] .= $winner['score'];\n\t \t\telse $val['score'] .= $tie['tie_schedule'];\r\n\t \t}\r\n\t \telse if (isset($ties[$firstTie + $i]))\r\n\t \t{\r\n\t \t\t$tie = $ties[$firstTie + $i];\r\n\t \t\t$val = array('seed' => array('name'=>$tie['mtch_num'],\r\n\t\t\t\t\t 'action' => array(KAF_NEWWIN, 'matches', \r\n\t \t\tKID_EDIT, $tie['mtch_id'], 600, 350)),\r\n\t\t\t 'value' => $tie['tie_schedule']);\r\n\t \t}\r\n\t \t$vals[] = $val;\r\n\t }\r\n\t $kdraw->setValues($numCol++, $vals);\r\n\t\t}\r\n\r\n\t\tfor ($i=0; $i<$numCol; $i++) $title[$numCol-$i-2] = $ut->getLabel(WBS_WINNER + $i);\r\n\r\n\t\t$kdraw->setTitles($title);\n\t\t$kdiv->addDiv('break', 'blkNewPage');\n\n\t\t$this->_utpage->display();\r\n\t\texit;\r\n\t}", "public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}", "function roster_add($pid = 0, $tid = 0, $sid = 0)\n\t{\n\t\t// Retrieve all the players, teams, or seasons.\n\t\t$players = $this->players->retrieve_roster();\n\t\t$teams = $this->teams->retrieve_roster();\n\t\t$seasons = $this->seasons->retrieve_roster();\n\n\t\t// If there are no players, teams, or seasons...\n\t\tif (!$players || !$teams || !$seasons)\n\t\t{\n\t\t\tshow_error('At least one team, one player, and one season must be added for roster functions to work.');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'form_action' => 'action_add_roster',\n\t\t\t'title' => 'Add to Roster',\n\t\t\t'js' => array('/js/admin/admin.js'),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'players' => $players,\n\t\t\t'teams' => $teams,\n\t\t\t'seasons' => $seasons,\n\t\t\t'pid' => $pid,\n\t\t\t'tid' => $tid,\n\t\t\t'sid' => $sid,\n\t\t\t'submit_message' => 'Add to Roster',\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->helper(array('form'));\n\n\t\t$this->load->view('admin/add_roster.php', $data);\n\t}", "function testResultAdd() {\n \n $result = $this->CI->player->memcacheInstance->flush();\n\n $query = $this->CI->db->query('SET FOREIGN_KEY_CHECKS=0;');\n $query = $this->CI->db->query('TRUNCATE SportGameResults;');\n $query = $this->CI->db->query('SET FOREIGN_KEY_CHECKS=1;');\n\n // check parlay schedule id\n $parlayCard = $this->CI->db->query('SELECT *\n FROM SportParlayCards c\n WHERE\n NOT c.id IS NULL AND\n NOT EXISTS(\n SELECT NULL\n FROM SportGameResults r\n WHERE c.sportScheduleId = r.sportScheduleId\n )\n LIMIT 1')->result();\n\n if( sizeof($parlayCard) > 0 ) {\n\n $data = array(\n 'sportScheduleId' => $parlayCard[0]->sportScheduleId,\n 'parlayCardId' => $parlayCard[0]->parlayCardId,\n 'score1' => 12,\n 'score2' => 20,\n );\n\n // To verify add result is invalid\n // ===============================\n // To verify parlayCardId Invalid\n $idInvalid = array('', null, 0, -1);\n\n foreach ($idInvalid as $value) {\n\n $parlayCardIdInvalid = $data;\n $parlayCardIdInvalid['parlayCardId'] = $value;\n $testResultSecond = $this->parlayresult->add( $parlayCardIdInvalid );\n\n if( is_array($testResultSecond) && isset($testResultSecond['message']) ) {\n\n if( !empty($value) ) {\n\n $this->assertContains( $testResultSecond['message'][0], 'The parlay Card Id field must contain a number greater than 0.', 'To verify parlayCardId is invalid' );\n } else {\n\n $this->assertContains( $testResultSecond['message'][0], 'The parlay Card Id field is required.', 'To verify parlayCardId is invalid' );\n }\n\n }\n }\n // To verify sportScheduleId Invalid\n $idInvalid = array('', null, 0, -1);\n foreach ($idInvalid as $value) {\n\n $sportScheduleIdInvalid = $data;\n $sportScheduleIdInvalid['sportScheduleId'] = $value;\n $testResultThird = $this->parlayresult->add( $sportScheduleIdInvalid );\n\n if( is_array($testResultThird) && isset($testResultThird['message']) ) {\n\n if( !empty($value) ) {\n\n $this->assertContains( $testResultThird['message'][0], 'The sport Schedule Id field must contain a number greater than 0.', 'To verify sportScheduleId is invalid' );\n } else {\n\n $this->assertContains( $testResultThird['message'][0], 'The sport Schedule Id field is required.', 'To verify sportScheduleId is invalid' );\n }\n\n }\n }\n\n // To verify add result is valid\n // ===============================\n $testResult = $this->parlayresult->add( $data );\n\n if ( is_object($testResult) ) {\n\n // To verify parlayCardId return must be equal parlayCardId input\n $this->assertEquals((int)$testResult->parlayCardId, (int)$data['parlayCardId'], 'To verify parlayCardId return must be equal parlayCardId input');\n\n // To verify sportScheduleId return must be equal sportScheduleId input\n $this->assertEquals((int)$testResult->sportScheduleId, (int)$data['sportScheduleId'], 'To verify sportScheduleId return must be equal sportScheduleId input');\n\n // To verify score1 return must be equal score1 input\n $this->assertEquals((int)$testResult->score1, (int)$data['score1'], 'To verify score1 return must be equal score1 input');\n\n // To verify score2 return must be equal score2 input\n $this->assertEquals((int)$testResult->score2, (int)$data['score2'], 'To verify score2 return must be equal score2 input');\n\n } else {\n\n $this->assertTrue( FALSE, \"Can't verify add result dailyshow in case valid.\");\n }\n\n } else {\n\n $this->assertTrue( FALSE, \"Can't verify add result dailyshow. Schedule is'nt exist.\");\n\n }\n\n }", "function add()\n {\n $gameId = intval($this->registry->params[0]);\n $game = new \\Webshop\\Model\\Game();\n $game = $game->getOne(\"id\", $gameId);\n\n if (!is_numeric($gameId) || (!empty($_SESSION['cart']) && in_array($gameId, $_SESSION['cart']))) {\n echo \"gameId is niet numeric, geldig of winkelwagen bevat al deze game!\";\n } else {\n $amount = 1;\n (isset($_POST['amount']) ? $amount = intval($_POST['amount']) : '');\n\n $supply = $game->supply;\n // Throw error if the requested amount is higher then the supply\n if ($supply < $amount) {\n $_SESSION['addToCartError'] = \"We hebben maar \" . $supply. \" games in voorraad van \". $game->title;\n $amount = $supply;\n }\n\n $gameItem = [intval($gameId), $amount];\n $_SESSION['cart'][] = $gameItem;\n }\n header(\"Location: /cart\");\n }", "public function exportResultData() {\n \n // get rounds\n $rounds = $this->object->getRounds();\n \n // Check if rounds exist, write a message if not\n if (count($rounds) > 0) { \n $this->exportResults();\n } else {\n ilUtil::sendFailure($this->txt(\"results_export_failure\"), true);\n }\n \n $this->ctrl->redirect($this, 'showResults');\n }", "public function AddEntry($score, $racerid) {\n ++$this->count;\n if ($score <= $this->last_score) {\n // A tie!\n $place = count($this->result) - 1; // Index of last populated \"place\" in the results\n $this->result[$place][] = $racerid;\n // The tricky bit here is that only upon the arrival of the second racer\n // do we find out that there was a tie; we need to be able to go back to\n // the first racer and update. That's why we make a second pass to mark\n // ties, rather than trying to do it on the fly here.\n } else {\n while (count($this->result) < $this->count - 1) {\n $this->result[] = array(); // Empty slots for ties\n }\n $this->result[] = array($racerid);\n $place = $this->count - 1;\n }\n\n $this->last_score = $score;\n return $place;\n }", "public function AddEntry($score, $racerid) {\n ++$this->count;\n if ($score <= $this->last_score) {\n // A tie!\n $place = count($this->result) - 1; // Index of last populated \"place\" in the results\n $this->result[$place][] = $racerid;\n // The tricky bit here is that only upon the arrival of the second racer\n // do we find out that there was a tie; we need to be able to go back to\n // the first racer and update. That's why we make a second pass to mark\n // ties, rather than trying to do it on the fly here.\n } else {\n while (count($this->result) < $this->count - 1) {\n $this->result[] = array(); // Empty slots for ties\n }\n $this->result[] = array($racerid);\n $place = $this->count - 1;\n }\n\n $this->last_score = $score;\n return $place;\n }", "function addLinke($linke_details){\n\t if ($this->db->insert('vc_linke',$linke_details))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }", "function _displayFormNewRound($aInfos=null)\n\t{\n\t\t$utd =& $this->_utd;\n\t\t$ut =& $this->_ut;\n\n\t\t$utpage = new utPage('draws');\n\t\t$utpage->_page->addAction('onload', array('changeDrawType'));\n\t\t$utpage->_page->addJavaFile('draws/draws.js');\n\t\t$content =& $utpage->getPage();\n\t\t$form =& $content->addForm('fdraws', 'draws', DRAW_ROUND_CREATE);\n\t\t$form->setTitle('tNewRound');\n\n\t\t// Display warning if exist\n\t\tif (isset($aInfos['errMsg'])) $form->addWng($aInfos['errMsg']);\n\n\t\tif (empty($aInfos))\n\t\t{\n\t\t\tlist($group, $drawId, $drawDisci) = explode(';', kform::getData());\n\t\t\t$infos['rund_drawId'] = $drawId;\n\t\t\t$infos['rund_group'] = $group;\n\t\t\t$infos['rund_name'] = '';\n\t\t\t$infos['rund_stamp'] = '';\n\t\t\t$infos['rund_entries'] = 0;\n\t\t\t$infos['rund_rge'] = 0;\n\t\t}\n\t\telse $infos = $aInfos;\n\t\t\t\n\t\t// Initialize the field\n\t\t$form->addHide(\"drawId\", $infos['rund_drawId']);\n\t\t$form->addHide(\"group\", $infos['rund_group']);\n\t\t$form->addHide(\"roundType\", WBS_ROUND_CONSOL);\n\t\t$form->addHide('drawDisci', $drawDisci);\n\t\t$form->addEdit('roundName', $infos['rund_name'], 20);\n\t\t$form->addEdit('roundStamp', $infos['rund_stamp'], 20);\n\t\t$form->addEdit('roundEntries', $infos['rund_entries'], 3);\n\t\t$kedit =& $form->addEdit('rundFinalPlace', $infos['rund_rge'], 3);\n\t\t$kedit->setMaxLength(3);\n\t\t$elts=array('roundName', 'roundStamp', 'roundEntries', 'rundFinalPlace');\n\t\t$form->addBlock('blkGroup', $elts);\n\n\t\t$form->addDiv('break', 'blkNewPage');\n\t\t$form->addBtn('btnRegister', KAF_SUBMIT);\n\t\t$form->addBtn('btnCancel');\n\t\t$elts=array('btnRegister', 'btnCancel');\n\t\t$form->addBlock('blkBtn', $elts);\n\n\t\t//Display the form\n\t\t$utpage->display();\n\t\texit;\n\t}", "public function add_invoice_row() {\n\n $addFlag = false;\n\n // Set null values to check for and later insertion if required\n $data = array(\n 'category' => null,\n 'description' => null,\n 'amount' => null,\n 'mockInvoiceId' => $_POST[ 'mockInvoiceId' ]\n );\n\n // Check if there are any rows that have nothing in them\n $row = $this->mockinvoice_row_model->get_by( $data );\n\n // Add a new row if there are no blank ones already\n if ( empty( $row ) ) {\n // Add a new row with empty values\n $this->mockinvoice_row_model->save( $data );\n $addFlag = true;\n }\n\n\n // Send back if a new row was added\n $returnArray[] = array( 'rowAdded' => $addFlag );\n $this->json_library->print_array_json_unless_empty( $returnArray );\n }", "private function setNewRounds($rounds, $activity)\n {\n $result = true;\n if (count($rounds) > 0) {\n foreach ($rounds as $item) {\n $round = $this->roundRepository->createRound();\n $round->setDistance($item->distance);\n $round->setElapsedTime($item->elapsed_time);\n $round->setElevationDifference($item->elevation_difference);\n $round->setMovingTime($item->moving_time);\n $round->setSplit($item->split);\n $round->setAverageSpeed($item->average_speed);\n $round->setAverageHeartrate($item->average_heartrate);\n $round->setPaceZone($item->pace_zone);\n $round->setActivity($activity);\n $round->setDateCreated(new \\DateTime());\n $round->setCreatedBy(null);\n $result = $this->roundRepository->storeRound($round);\n if ($result == false) {\n break;\n }\n }\n }\n return $result;\n }", "function add_tb_redacteur($params)\n {\n $this->db->insert('tb_redacteurs',$params);\n return $this->db->insert_id();\n }", "function add($param) {\n extract($param);\n // nunca suponga el orden de las columnas: INSERT INTO tabla VALUES (v1, v2,v3, ...); tómese el trabajo de indicar los nombres de columnas\n // los nombres de los elementos del array asociativo corresponden a los atributos name de las columnas del jqGrid\n $sql = \"INSERT INTO usuario(id_usuario, direccion, telefonos, correos, contrasena, rol )\n VALUES ('$id_usuario', '$direccion','$telefonos', '$correos', '$contrasena','operario' );\n INSERT INTO operario(fk_usuario,nombres, apellidos) \n VALUES ('$id_usuario','$nombres', '$apellidos');\";\n $conexion->getPDO()->exec($sql);\n echo $conexion->getEstado();\n }", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "function addResource($resObject)\n{\n\t\n\t\n\t$sql = \"INSERT INTO `\".DB_NAME.\"`.`resources` (\n\t\t`rid` ,\n\t\t`title` ,\n\t\t`link` ,\n\t\t`author` ,\n\t\t`timecreated` ,\n\t\t`rating` ,\n\t\t`description` ,\n\t\t`tags` ,\n\t\t`voteips`\n\t\t)\n\t\tVALUES (\n\t\tNULL , '\".sanitize($resObject->name).\"', '\".sanitize($resObject->url).\"', '\".$resObject->owner.\"',\n\t\t\".time().\" , '\".$resObject->score.\"', '\".sanitize($resObject->description).\"', '\".sanitize(dcSemicolonArrayToString($resObject->tags)).\"',\n\t\t'\".dcSemicolonArrayToString($resObject->voteips).\"'\n\t\t)\";\n\n\t$result = mysql_query($sql);\n\n\tif($result)\n\t\t$result = mysql_insert_id();\n\t\t\n\treturn $result;\n}", "public function addRows()\n {\n }", "public function AddMatch($tournament_id, $winner) {\n\n\t\t$round_index = 0;\n\t\tforeach ($this->rounds as &$matches_planned) {\n\t\t\t$match_index = 0;\n\t\t\tforeach ($matches_planned as &$match_planned) {\n\t\t\t\t$unique_id1 = TournamentBrackets::GetUniqueID($round_index, $match_index, '1');\n\t\t\t\t$unique_id2 = TournamentBrackets::GetUniqueID($round_index, $match_index, '2');\n\n\t\t\t\tif ($unique_id1 == $winner || $unique_id2 == $winner) {\n\t\t\t\t\t$winner_team_index = $unique_id1 == $winner ? 1 : 2;\n\n\t\t\t\t\tlanorg_add_match(\t$tournament_id, $round_index,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$match_planned['team1']->id, $match_planned['team2']->id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$winner_team_index);\n\t\t\t\t}\n\n\t\t\t\t$match_index++;\n\t\t\t}\n\t\t\t$round_index++;\n\t\t}\n\t}", "public function add_result(array $request, $result) {\n $this->__results[] = array('action' => $request['action'],\n 'method' => $request['method'],\n 'tid' => $request['tid'],\n 'type' => $request['type'],\n 'result' => $result);\n return (true);\n }", "function add_results($col,$score,$id){\n\t\tglobal $bBlog;\n\t\t$sql = \"\n\t\t\tSELECT `postid`,`\".$col.\"`\n\t\t\tFROM `\".$this->table.\"`\n\t\t\tWHERE 1\";\n\t\tif(!empty($id)){\n\t\t\t$sql .= \" AND `postid` = '\".$id.\"'\";\n\t\t}\n\t\t$ress = $bBlog->db->get_results($sql);\n\t \n\t if($this->trans){\n\t\t $bBlog->db->query(\"START TRANSACTION;\");\n\t }\n\t \n\t // cycle result rows\n\t foreach ($ress as $res){\n\t\t $key = $res->postid;\n\t\t // separate string into words\n\t\t $values = explode(' ', preg_replace('/[\\[[^\\[]*]|<[^<]*>]|\\n|\\r/',' ',$res->$col));\n\t\t // add each word for ID\n\t\t foreach($values as $value){\n\t\t\t $value = $this->replace($value);\n\t\t\t // only words between 2 and 50 characters\n\t\t\t if(strlen($value) > 2 && strlen($value) < 50){\n\t\t\t\t $this->_add($key, $value, $score);\n\t\t\t }\n\t\t }\n\t }\n\n\t if($this->trans){\n\t\t $bBlog->db->query(\"COMMIT;\");\n\t }\n\t return true;\n\t}", "function LoadRowValues(&$rs) {\n\t\tglobal $planilla;\n\t\t$planilla->idPlanilla->setDbValue($rs->fields('idPlanilla'));\n\t\t$planilla->Nombre->setDbValue($rs->fields('Nombre'));\n\t}", "public function additionArea()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `area`(`nameaa`, `nameae`, `groupa`, `deleta`)VALUES('$this->nameaa' ,'$this->nameae' ,'$this->groupa' ,'$this->deleta')\");\n $result = $sql->execute();\n $id = $dbh->lastInsertId();\n return array ($result,$id);\n }", "public function updateAdd($post)\n\t{\n\t\t$ID=$_GET['ID'];\n\t\t$SQL=\"UPDATE local_businesses SET Rank={$post['rank']} WHERE business_id={$ID}\";\n\t\t$this->MyDB->query($SQL);\n\t\t$rec=array(\"result\"=>true, \"message\"=>'Added Successfully');\n\t\treturn $rec;\n\t}", "public function addRent($args = []){\r\n\t\ttry {\r\n\t\t\t$conn = $this->connect();\r\n\t\t\t$sql = \"INSERT INTO rent\" \r\n\t\t\t\t\t.\"(rent_name,price,type_id,square,describe_rent,user_id,province_id,district_id,ward_id,address_detail)\"\r\n\t\t\t\t\t.\"VALUES (:rent_name,:price,:type_id,:square,:describe_rent,:user_id,:province_id,:district_id,:ward_id,:address_detail)\";\r\n\t\t\t$stmt = $conn->prepare($sql);\r\n\t\t\t$stmt->bindParam(':rent_name',$args['rent_name']);\r\n\t\t\t$stmt->bindParam(':price',$args['price']);\t\t\t\r\n\t\t\t$stmt->bindParam(':type_id',$args['type_id']);\r\n\t\t\t$stmt->bindParam(':square',$args['square']);\r\n\t\t\t$stmt->bindParam(':describe_rent',$args['describe_rent']);\t\t\t\t\t\t\t\t\t\r\n\t\t\t$stmt->bindParam(':user_id',$args['user_id']);\r\n\t\t\t$stmt->bindParam(':province_id',$args['province_id']);\r\n\t\t\t$stmt->bindParam(':district_id',$args['district_id']);\r\n\t\t\t$stmt->bindParam(':ward_id',$args['ward_id']);\r\n\t\t\t$stmt->bindParam(':address_detail',$args['address_detail']);\r\n\t\t\t$stmt->execute();\r\n\t\t\t$lastId = $conn->lastInsertId();\r\n\t\t\t$this -> addImage ($args['image_url'],$lastId);\r\n\t\t\tif($lastId){\r\n\t\t\t\treturn $lastId;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t }catch(PDOException $e){\t \t\r\n\t \treturn false;//error 404\r\n\t }\r\n\t}", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function add (){\n // receives $_GET['id'] to redirect to page showing same page\n\n $columns = array('curriculum_id', 'timetable_period_id', 'start_time_id', 'end_time_id', 'weekday_id', 'classroom_id');\n $table = new simple_table_ops();\n $table->set_table_name('timetables');\n $table->set_table_column_names($columns);\n\n $table->add();\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=timetable&action=show&submit=yes&timetable_period_id={$_POST['timetable_period_id']}\");\n }", "function add_rombel($params)\n {\n // $this->db->insert('rombel',$params);\n // return $this->db->insert_id();\n return $this->db->insert_batch('rombel', $params);\n\n }", "public static function add($entreprise){\n $con=new connexion();\n $resultat=$con->executeactualisation(\"insert into tblentreprise (id_entreprise,admin_id,nom,logo,ville_id,adresse_complete,etat,date_ajout,date_modifier)\n values('\" . $entreprise->ident . \"','\" . $entreprise->adminid . \"','\" . $entreprise->nom . \"','\" . $entreprise->logo . \"','\" . $entreprise->villeid . \"','\" . $entreprise->adressecomp . \"',1,NOW(),NOW())\");\n $con->closeconnexion();\n\n }", "public function addRace()\n {\n // on fait une requête préparée\n $addRaceQuery = $this->db->prepare(\n // Marqueur nominatif\n //bindValue: vérifie le type et que ça ne génère pas de faille de sécurité.\n //$this-> : permet d'acceder aux attributs de l'instance qui est en cours\n 'INSERT INTO `ap29f_race` (`name`,`circuit`,`photo`,`id_ap29f_championship`,`id_ap29f_dateRace`)\n VALUES(:name,:circuit,:photo,:id_ap29f_championship,:id_ap29f_dateRace)'\n );\n $addRaceQuery->bindvalue(':name', $this->name, PDO::PARAM_STR);\n $addRaceQuery->bindvalue(':circuit', $this->circuit, PDO::PARAM_STR);\n $addRaceQuery->bindvalue(':photo', $this->photo, PDO::PARAM_STR);\n $addRaceQuery->bindvalue(':id_ap29f_championship', $this->id_ap29f_championship, PDO::PARAM_INT);\n $addRaceQuery->bindvalue(':id_ap29f_dateRace', $this->id_ap29f_dateRace, PDO::PARAM_INT);\n return $addRaceQuery->execute();\n }", "function ReScoring($id,$jml){\n\t\t$query1 = \"UPDATE T_PROGRAM_SCORE_DETAIL\n\t\tSET T_PROGRAM_SCORE_DETAIL.PROSCR_DETAIL_ANSWER_TRUE = T_PROGRAM_QUE_OPTIONS.OPTION_VALUE\n\t\tFROM\n\t\t\tT_PROGRAM_QUE_OPTIONS\n\t\tWHERE\n\t\t\tT_PROGRAM_SCORE_DETAIL.PROSCR_DETAIL_QUESTION_ID = T_PROGRAM_QUE_OPTIONS.OPTION_QUESTION_ID\n\t\tAND T_PROGRAM_QUE_OPTIONS.OPTION_ANSWER = 1\n\t\tAND T_PROGRAM_SCORE_DETAIL.PROSCR_DETAIL_PROSCR_ID = '\".$id.\"'\";\n\t\t//echo $query1; die;\n\t\t$this->db->query($query1);\n\t\t//step 2 update benar/salah jawaban peserta\n\t\t$query2 = \"UPDATE T_PROGRAM_SCORE_DETAIL\n\t\tSET PROSCR_DETAIL_IS_TRUE = (\n\t\t\tCASE\n\t\t\tWHEN PROSCR_DETAIL_ANSWER_TRUE = PROSCR_DETAIL_ANSWER THEN\n\t\t\t\t1\n\t\t\tELSE\n\t\t\t\t0\n\t\t\tEND\n\t\t)\n\t\tWHERE PROSCR_DETAIL_PROSCR_ID = '\".$id.\"'\";\n\t\t$this->db->query($query2);\n\n\t\t//step 3 update nilai tes peserta\n\t\t$query3 = \"UPDATE T_PROGRAM_SCORE\n\t\tSET PROSCR_VALUE = ((\n\t\t\tSELECT\n\t\t\t\tCAST(COUNT (1) AS DECIMAL)\n\t\t\tFROM\n\t\t\t\tT_PROGRAM_SCORE_DETAIL\n\t\t\tWHERE\n\t\t\t\tPROSCR_DETAIL_PROSCR_ID = PROSCR_ID\n\t\t\tAND PROSCR_DETAIL_IS_TRUE = 1\n\t\t)/ \".$jml.\") * 100\n\t\tWHERE PROSCR_ID = '\".$id.\"'\";\n\t\t$this->db->query($query3);\n\n\t}", "public function modelDoAdd(){\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"insert into phongban set tenphongban=:ten\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban));\n\t\t}", "public function run()\n {\n DB::table('results')->insert([\n \t'finish_time' => Carbon\\Carbon::now(),\n 'score' => '8',\n 'user_id' => '1',\n 'test_id' => '1',\n ]);\n }", "function _assignMatchesDo() {\n\t\tdefined('_JEXEC') or die( 'Invalid Token' );\n\n\t\t// Turnierdaten!\n\t\t$tournament = new CLMTournament($this->id, true);\n\t\t// $tournament->data->typ\n\n\t\tif (($tournament->data->tl != clm_core::$access->getJid() AND $clmAccess->access('BE_tournament_edit_round') !== true) OR $clmAccess->access('BE_tournament_edit_round') === false) {\n\t\t\t$this->app->enqueueMessage( JText::_('TOURNAMENT_NO_ACCESS'),'warning' );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($tournament->data->typ == 2) {\n\t\t\t// Vollturnier nur via Rundenerstellung!\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'IMPOSSIBLE' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t} elseif ($tournament->data->typ == 3) { // KO\n\t\t\t// maximal bestätige Runde holen - ist hier MIN(nr)\n\t\t\t$query = 'SELECT MIN(nr) FROM #__clm_turniere_rnd_termine'\n\t\t\t\t. ' WHERE turnier = '.$this->id.' AND tl_ok = 1';\n\t\t\t$this->_db->setQuery( $query );\n\t\t\tif ($tlokMin = $this->_db->loadResult()) {\n\t \t\t\t$roundToDraw = $tlokMin-1;\n\t \t\t} else {\n\t \t\t\t$roundToDraw = $tournament->data->runden;\n\t\t\t}\n\t\t\t// nächste zu vervollständigende Runde ermittelt\n\t\t\tif ($roundToDraw == 0) { // dann gibt es nichts mehr zu tun\n\t\t\t\t$this->app->enqueueMessage( JText::_('NO_ROUND_LEFT'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Frage: sind in dieser Runde schon Partien angesetzt?\n\t\t\t$query = 'SELECT COUNT(*)'\n\t\t\t\t\t. ' FROM #__clm_turniere_rnd_spl'\n\t\t\t\t\t. ' WHERE turnier = '.$this->id.' AND runde = '.$roundToDraw.' AND ((spieler >= 1 AND gegner >= 1) OR ergebnis = 8)';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$matchesAssigned = $this->_db->loadResult();\n\t\t\t\n\t\t\tif ($matchesAssigned > 0) { // bereits Matches angelegt\n\t\t\t\t$this->app->enqueueMessage( JText::_('MATCHES_ASSIGNED_ALREADY'),'warning' );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// OKay, jetzt kann angesetzt werden\n\t\t\t// alle Spieler, die 'in' sind holen\n\t\t\t$query = \"SELECT snr \"\n\t\t\t\t\t. \" FROM #__clm_turniere_tlnr\"\n\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND koStatus = '1'\";\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$playersIn = $this->_db->loadAssocList('snr');\n\t\t\t\n\t\t\t// wieviele Matches werden benötigt? \n\t\t\t// Spielerzahl - (maximale Matches der Runde / 2)\n\t\t\t// maximale Matches der Runde: 2^Runde\n\t\t\t$neededMatches = (count($playersIn) - pow(2, $roundToDraw)/2);\n\t\t\t\n\t\t\t// TODO: Sicherheitscheck, ob diese Boards wirklich vorhanden!\n\t\t\t\n\t\t\t// jetzt setzen wir an jedes Board eine Zufallspaarung\n\t\t\t\n\t\t\t// Matches zusammenstellen\n\t\t\t$sid = $tournament->data->sid;\n\t\t\tfor ($m=1; $m<=$neededMatches; $m++) {\n\t\t\t\t// Spieler 1\n\t\t\t\t$player1 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player1]);\n\t\t\t\t// Spieler 2\n\t\t\t\t$player2 = array_rand($playersIn);\n\t\t\t\tunset($playersIn[$player2]);\n\t\t\t\t// SQL\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player1.\", spieler = \".$player1.\", gegner = \".$player2\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '1'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t\t$query = \"UPDATE #__clm_turniere_rnd_spl\"\n\t\t\t\t\t\t. \" SET tln_nr = \".$player2.\", spieler = \".$player2.\", gegner = \".$player1\n\t\t\t\t\t\t. \" WHERE turnier = \".$this->id.\" AND runde = \".$roundToDraw.\" AND brett = \".$m.\" AND heim = '0'\";\n//\t\t\t\t$this->_db->setQuery($query);\n//\t\t\t\tif (!$this->_db->query()) { \n\t\t\t\tif (!clm_core::$db->query($query)) { \n\t\t\t\t\t$this->app->enqueueMessage( JText::_('MATCH: ').$m.\": \".$this->_db->getErrorMsg(),'error' );\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$this->app->enqueueMessage( JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED') );\n\t\n\t\t\t// Log\n\t\t\t$clmLog = new CLMLog();\n\t\t\t$clmLog->aktion = JText::_('ROUND_KO_'.$roundToDraw).\": \".JText::_('TOURNAMENT_MATCHES_ASSIGNED');\n\t\t\t$clmLog->params = array('sid' => $tournament->data->sid, 'tid' => $this->id, 'rnd' => $roundToDraw); // TurnierID wird als LigaID gespeichert\n\t\t\t$clmLog->write();\n\t\n\t\n\t\t} elseif ($tournament->data->typ == 1) { // CH\n\t\t\t$this->app->enqueueMessage( CLMText::errortext(JText::_('MATCHES_ASSIGN'), 'NOTIMPLEMENTED' ),'warning' );\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\n\t}", "function _deleteRound()\r\n\t{\r\n\t\t$utr = new utRound();\r\n\t\t$roundId = kform::getInput(\"roundId\");\n\t\t$utr->delRound($roundId);\n\t\t$page = new utPage('none');\r\n\t\t$page->close();\r\n\t\texit;\n\t}", "public function p_add() {\n if (empty($_POST['title'])) {\n Router::redirect(\"/trips/new/missing\");\n }\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['coverimg'] = \"fpo.jpg\";\n\n # Insert\n DB::instance(DB_NAME)->insert(\"trips\", $_POST);\n\n Router::redirect(\"/trips/index\");\n\n }", "function addCache( $results ) {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"INSERT INTO $this->cacheTable (post_id,cached_result) VALUES (\" . $this->db->escape( $this->postID ) . \", '\" . $this->db->escape( $results ). \"')\";\n\t\t\n\t\t$results = $this->db->query( $sql );\n\t\n\t\tif ( !$results )\n\t\t\treturn false;\n\t \n\t\treturn true;\n\t}", "function gr_tipo6($_idrespuesta,$valor){\n \n $tableRpta=$this->_tablerpta;\n \n \n \n if(empty($_idrespuesta) and isset($valor)){\n $g_sql=\"INSERT INTO $tableRpta ([[ra_decimal]],[[id_conjunto_respuesta]],[[id_pregunta]],[[id_tpregunta]],[[id_capitulo]],[[id_formato]],[[id_conjunto_pregunta]],[[id_version]],[[id_junta]]) VALUES (:valor, :idconjrpta, :idpregunta, :idtpregunta, :idcapitulo, :idformato,:idconjprta,:idversion,:idjunta)\";\n }else if(!empty($_idrespuesta) and isset($valor)){\n $g_sql=\"UPDATE $tableRpta SET [[ra_decimal]] = :valor,[[id_conjunto_respuesta]] = :idconjrpta,[[id_pregunta]] = :idpregunta ,[[id_tpregunta]] = :idtpregunta,[[id_capitulo]] = :idcapitulo,[[id_formato]] = :idformato,[[id_conjunto_pregunta]] = :idconjprta,[[id_version]] = :idversion, [[id_junta]] = :idjunta WHERE [[id_respuesta]] = \".$_idrespuesta;\n }else{\n $g_sql=\"\";\n } \n \n /*Quitando separadores de miles \",\"*/\n $_valor=str_replace(\",\",\"\",$valor);\n \n if (is_numeric($_valor)) { \n return [$g_sql,$_valor];\n }else{\n return [$g_sql,NULL];\n } \n \n \n \n }", "function gaMatch_addPlayerResult($kidPlayerId, $win, $draw, $lost) {\n //??????????????????? does record already exist - what if player change ?????????\n $match = array_search ( $kidPlayerId , $this->gamatch_gamePlayerMap);\n if ($match === FALSE) {\n $newGame = new stdData_gameUnit_extended;\n $newGame->stdRec_loadRow($row);\n $this->gamatch_gamePlayerMap[$newGame->game_kidPeriodId] = $newGame;\n ++$this->game_opponents_count;\n $this->game_opponents_kidPeriodId[] = $kidPlayerId;\n $this->game_opponents_wins[] = $win;\n $this->game_opponents_draws[] = $draw;\n $this->game_opponents_losts[] = $lost;\n $this->gagArrayGameId[] = 0;\n } else {\n $this->game_opponents_wins[$match] += $win;\n $this->game_opponents_draws[$match] += $draw;\n $this->game_opponents_losts[$match] += $lost;\n }\n}", "public function add()\n {\n $data=$this->M_mtk->add();\n echo json_encode($data);\n }", "private function addDetail()\n { \n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n $Tickets = new Tickets($params);\n \n if($_REQUEST['changed_status'] != 0)\n {\n \n $Tickets->setStatus($_REQUEST['changed_status']);\n $Tickets->update();\n //save log \n $this->saveLog($_REQUEST['changed_status'], $_REQUEST['ticket_id'], null);\n }\n \n $data = array();\n $data['subject'] = stripslashes(trim($_REQUEST['subject']));\n $data['notes'] = stripslashes(trim($_REQUEST['notes']));\n $data['user_id'] = $_SESSION['LOGIN_USER']['userId'];\n \n //$Tickets = new Tickets($params);\n $details_id = $Tickets->addDetails($data);\n\n if($details_id)\n {\n $files = $this->getUploadedFiles();\n $this->saveAttachments($files, $_REQUEST['ticket_id'], $details_id);\n }\n \n //Send Email To resolvers, source, etc.\n $this->sendEmail($_REQUEST['ticket_id'], $data['subject']);\n \n \n \n echo '[{\"isError\":0, \"message\":\"Details added Successfully.\"}]';\n exit;\n }", "function Add($table,$values,$rediract){\n\t\t$insert = \"insert into $table values(Null,$values)\";\n\t\t$run = $this->connect->query($insert);\n\t\t\n\t\t\n\t\tif($run){\n\t\t\techo \"<script>location.href='$rediract=Added-Successfully';</script>\";\n\t\t}else {\n\t\t\techo \"<script>location.href='$rediract=Added-Error';</script>\";\n\t\t} // else close\n\t\t\n\t}", "function edit_imagresult($result_id) \r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$this->load->model('morders_wdb');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n\t\t$data['form_purpose'] = $this->uri->segment(3);\r\n\t\t$data['order_id'] = $this->uri->segment(4);\r\n $data['location_id'] \t= $_SESSION['location_id'];\r\n\t\t$data['title'] \t\t\t\t= \"Record Imaging Result\";\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['now_time'] = date(\"H:i\",$data['now_id']);\r\n \r\n if(count($_POST)) {\r\n // User has posted the form\r\n $data['order_id'] \t= $_POST['order_id'];\r\n $data['init_notes'] \t= $_POST['notes'];\r\n $data['init_result_date'] = $_POST['result_date'];\r\n $data['init_result_remarks']= $_POST['result_remarks'];\r\n $data['init_result_ref'] = $_POST['result_ref'];\r\n\t\t\t// Static information\r\n\t\t\t$data['order_info'] = $this->memr_rdb->get_one_imaging_result($data['order_id']);\r\n\t\t\t$data['session_id'] \t= $data['order_info'][0]['session_id'];\r\n\t\t\t$data['name'] \t\t\t\t= $data['order_info'][0]['name'];\r\n\t\t\t$data['birth_date'] \t\t= $data['order_info'][0]['birth_date'];\r\n\t\t\t$data['supplier_name'] \t\t= $data['order_info'][0]['supplier_name'];\r\n\t\t\t$data['product_id'] \t\t= $data['order_info'][0]['product_id'];\r\n\t\t\t$data['product_code'] \t= $data['order_info'][0]['product_code'];\r\n\t\t\t$data['description'] \t\t= $data['order_info'][0]['description'];\r\n\t\t\t$data['supplier_ref'] \t\t= $data['order_info'][0]['supplier_ref'];\r\n\t\t\t$data['result_status'] \t= $data['order_info'][0]['result_status'];\r\n\t\t\t$data['remarks'] \t\t\t= $data['order_info'][0]['remarks'];\r\n\t\t\t$data['result_id'] \t\t= $data['order_info'][0]['result_id'];\r\n\t\t\t$data['result_remarks'] \t\t\t= $data['order_info'][0]['result_remarks'];\r\n\t\t\t$data['result_ref'] \t\t\t= $data['order_info'][0]['result_ref'];\r\n if(isset($_POST['close_order'])) { \r\n\t\t\t\t$data['close_order'] \t\t\t= $_POST['close_order'];//TRUE;\r\n\t\t\t} else {\r\n\t\t\t\t$data['close_order'] \t\t\t= \"FALSE\";\t\t\t\t\r\n\t\t\t}\r\n } else {\r\n // First time form is displayed\r\n if ($data['form_purpose'] == \"new_result\") {\r\n // New user\r\n\t\t $data['room_info'] = array();\r\n $data['room_id'] = \"\";\r\n $data['category_id'] = \"\";\r\n $data['init_room_name'] = \"\";\r\n $data['init_description'] = \"\";\r\n } else {\r\n // Existing result row\r\n\t\t\t\t$data['order_info'] = $this->memr_rdb->get_one_imaging_result($data['order_id']);\r\n $data['session_id'] \t= $data['order_info'][0]['session_id'];\r\n $data['name'] \t\t\t\t= $data['order_info'][0]['name'];\r\n $data['birth_date'] \t\t= $data['order_info'][0]['birth_date'];\r\n $data['supplier_name'] \t\t= $data['order_info'][0]['supplier_name'];\r\n $data['product_id'] \t\t= $data['order_info'][0]['product_id'];\r\n $data['product_code'] \t= $data['order_info'][0]['product_code'];\r\n $data['description'] \t\t= $data['order_info'][0]['description'];\r\n $data['supplier_ref'] \t\t= $data['order_info'][0]['supplier_ref'];\r\n $data['result_status'] \t= $data['order_info'][0]['result_status'];\r\n $data['remarks'] \t\t\t= $data['order_info'][0]['remarks'];\r\n $data['result_id'] \t\t= $data['order_info'][0]['result_id'];\r\n $data['init_result_date'] = $data['order_info'][0]['result_date'];\r\n $data['init_notes'] \t\t= $data['order_info'][0]['notes'];\r\n $data['image_path'] \t\t= $data['order_info'][0]['image_path'];\r\n $data['result_staff_id'] \t= $data['order_info'][0]['staff_id'];\r\n $data['date_ended'] \t\t= $data['order_info'][0]['date_ended'];\r\n $data['init_result_remarks'] \t\t= $data['order_info'][0]['result_remarks'];\r\n $data['init_result_ref'] \t\t= $data['order_info'][0]['result_ref'];\r\n } //endif ($data['form_purpose'] == \"new_result\")\r\n } //endif(count($_POST))\r\n \r\n\t\t$data['patient_id'] = $data['order_info'][0]['patient_id'];\r\n $data['patient_info'] = $this->memr_rdb->get_patient_details($data['patient_id']);\r\n $data['patient_info']['name'] = $data['patient_info']['patient_name'];\r\n\t\t$this->load->vars($data);\r\n // Run validation\r\n\t\tif ($this->form_validation->run('edit_imag_result') == FALSE){\r\n // Return to incomplete form\r\n if ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_wap\";\r\n //$new_body = \"ehr/ehr_orders_edit_imagresult_wap\";\r\n $new_body = \"ehr/ehr_indv_edit_imagresults_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n } else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_html\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_html\";\r\n $new_body = \"ehr/ehr_indv_edit_imagresults_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n }\r\n if($data['user_rights']['section_orders'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n $this->load->view($new_header);\t\t\t\r\n $this->load->view($new_banner);\t\t\t\r\n $this->load->view($new_sidebar);\t\t\t\r\n $this->load->view($new_body);\t\t\t\r\n $this->load->view($new_footer);\t\t\t\r\n } else {\r\n //echo \"\\nValidated successfully.\";\r\n //echo \"<pre>\";\r\n //print_r($data);\r\n //echo \"</pre>\";\r\n //echo \"<br />Insert record\";\r\n if($data['close_order'] == \"TRUE\") {\r\n //echo \"Change status \".$data['close_order'];\r\n\t\t\t\t$upd_order_array['order_id'] \t\t= $data['order_id'];\r\n\t\t\t\t$upd_order_array['result_status'] \t= \"Received\";\r\n if($data['offline_mode']){\r\n $upd_order_array['synch_out'] = $data['now_id'];\r\n }\r\n\t\t\t\t$upd_order_data = $this->morders_wdb->update_imaging_order($upd_order_array);\r\n }\r\n\t\t\t// Update records\r\n\t\t\t$upd_result_array['result_id'] = $data['result_id'];\r\n\t\t\t$upd_result_array['staff_id'] = $_SESSION['staff_id'];\r\n\t\t\t$upd_result_array['result_date'] = $data['init_result_date'];\r\n\t\t\t$upd_result_array['notes'] \t\t= $data['init_notes'];\r\n if($data['offline_mode']){\r\n $upd_result_array['synch_out'] = $data['now_id'];\r\n }\r\n\t\t\t$upd_result_data = $this->morders_wdb->update_imaging_result($upd_result_array);\r\n $new_page = base_url().\"index.php/ehr_individual_history/list_history_imaging/\".$data['patient_id'];\r\n header(\"Status: 200\");\r\n header(\"Location: \".$new_page);\r\n } //endif ($this->form_validation->run('edit_imag_result') == FALSE)\r\n }", "function add($input = array(), $rID){\n $this->delete_by('OrderId', $rID);\n \n //now cycle through and add all new records\n if (count($input))\n {\n //submit query\n foreach ($input as $k => $array)\n {\n if ($array['Qty'] >= 1)\n {\n $array['OrderId'] = $rID;\n $r[$k] = $this->save($array);\n }\n \n }\n \n }\n \n return $r;\n }", "function show_round()\n{\n $bdd = DB_connect();\n\n // On récupère de la table matches les informations sur la partie\n $req_match = $bdd->query('SELECT * FROM matches WHERE id = \\''.$_SESSION['match']['id'].'\\'');\n $data_match = $req_match->fetch();\n\n // On récupère de la table rounds tous les rounds de la partie\n $req_round = $bdd->query('SELECT * FROM rounds WHERE match_id = \\''.$_SESSION['match']['id'].'\\'');\n while($data_round = $req_round->fetch())\n $tab[$data_round['id']] = $data_round;\n // On sélectionne le dernier round en mémoire du match\n $round = $tab[max(array_keys($tab))];\n\n $_SESSION['match']['previous_user'] = $round['actual_user'];\n\n // On détermine si l'on est le user1 ou le user2 dans la partie\n if ($data_match['user1_id'] == $_SESSION['user']['id'])\n {\n $_SESSION['match']['user_me'] = 1;\n $_SESSION['match']['user_me_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_me_score'] = $round['user1_score'];\n $_SESSION['match']['user_enemy'] = 2;\n $_SESSION['match']['user_enemy_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user2_score'];\n }\n else\n {\n $_SESSION['match']['user_me'] = 2;\n $_SESSION['match']['user_me_id'] = $data_match['user2_id'];\n $_SESSION['match']['user_me_score'] = $round['user2_score'];\n $_SESSION['match']['user_enemy'] = 1;\n $_SESSION['match']['user_enemy_id'] = $data_match['user1_id'];\n $_SESSION['match']['user_enemy_score'] = $round['user1_score'];\n }\n\n // Si la partie est finie, on n'affiche pas la map\n if ($data_match['end'])\n {\n echo '<h3>La partie est finie !</h3>';\n if ($_SESSION['match']['user_me_score'] > $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Bravo ! Tu as GAGNÉ.</h3>';\n }\n else if ($_SESSION['match']['user_me_score'] < $_SESSION['match']['user_enemy_score'])\n {\n echo '<h3>Dommage ! Tu as PERDU.</h3>';\n }\n else\n {\n echo '<h3>Bravo ! Vous êtes arrivés EX AEQUO.</h3>';\n }\n return (0);\n }\n\n // On enregistre la map dans le $_SESSION\n $map = string_to_map($round['map']);\n $_SESSION['match']['map'] = $map;\n\n // On affiche la map à jour\n echo '<table id=\"map\">';\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td></td>';\n else\n echo '<td>'.$j.'</td>';\n }\n echo '</tr>';\n for ($i = 'A'; isset($map[$i]); $i++)\n {\n echo '<tr>';\n for ($j = 0; $j <= 6; $j++)\n {\n if ($j == 0)\n echo '<td>'.$i.'</td>';\n else\n {\n if ($map[$i][$j] == 3)\n $background_color = 'red';\n else if ($map[$i][$j] == 4)\n $background_color = 'green';\n else\n $background_color = 'white';\n echo \"<td style='background-color:$background_color'></td>\";\n }\n }\n echo '</tr>';\n }\n echo '</table>';\n\n if ($round['actual_user'] == $_SESSION['match']['user_me'] ||\n ($round['actual_user'] == 0 && $_SESSION['match']['user_me'] != 1))\n {\n // On récupère le nom de l'ennemi dans la table users\n $req_enemy_login = $bdd->query('SELECT login FROM users WHERE id = \\''.$_SESSION['match']['user_enemy_id'].'\\'');\n $data_enemy_login = $req_enemy_login->fetch();\n\n echo '<h3>C\\'est au tour de '.$data_enemy_login['login'].'</h3>';\n echo '<form method=\"POST\" action=\"game.php\">\n <input type=\"submit\" name=\"reload_submit\" value=\"↻ Rafraîchir\">\n </form>';\n return (1);\n }\n else\n {\n echo '<h3>C\\'est à ton tour !</h3>\n <form method=\"POST\" action=\"#\">\n <br>\n <input type=\"text\" name=\"coord\" placeholder=\"Case\" required><br><br>\n <input type=\"submit\" value=\"Jouer\">\n </form>';\n return (0);\n }\n}", "function gr_tipo5($_idrespuesta,$valor){\n \n $tableRpta=$this->_tablerpta;\n if(empty($_idrespuesta) and isset($valor)){\n $g_sql=\"INSERT INTO $tableRpta ([[ra_entero]],[[id_conjunto_respuesta]],[[id_pregunta]],[[id_tpregunta]],[[id_capitulo]],[[id_formato]],[[id_conjunto_pregunta]],[[id_version]],[[id_junta]]) VALUES (:valor, :idconjrpta, :idpregunta, :idtpregunta, :idcapitulo, :idformato,:idconjprta,:idversion,:idjunta)\";\n }else if(!empty($_idrespuesta) and isset($valor)){\n $g_sql=\"UPDATE $tableRpta SET [[ra_entero]] = :valor,[[id_conjunto_respuesta]] = :idconjrpta,[[id_pregunta]] = :idpregunta ,[[id_tpregunta]] = :idtpregunta,[[id_capitulo]] = :idcapitulo,[[id_formato]] = :idformato,[[id_conjunto_pregunta]] = :idconjprta,[[id_version]] = :idversion, [[id_junta]] = :idjunta WHERE [[id_respuesta]] = \".$_idrespuesta;\n }else{\n $g_sql=\"\";\n } \n \n /*Guardando $_valor para tipo entero se realiza el cambio por si el entero trae\n separadores de miles */\n $_valor=str_replace(\",\",\"\",$valor);\n $_valor=str_replace(\".\",\"\",$_valor);\n \n if (is_numeric($_valor)) { \n return [$g_sql,$_valor];\n }else{\n return [$g_sql,NULL];\n } \n \n \n }", "function incrementRound($gameId){\n\t$conn = getDB();\n\t$sql = \"UPDATE games SET round = round + 1 WHERE id=\".$gameId;\n\tif(!$conn->query($sql)){\n\t\tcloseDB($conn);\n\t\techo \"\\nFailed to increment round for gameId: \" . $gameId;\n\t\treturn false;\n\t}\n\tcloseDB($conn);\n\treturn true;\n}", "function add_activity_result($result) {\n\t\t$this->_activity_result[] = $result;\n\t}", "public function append_schedule($tid)\n\t{\n\t\t$max_round = $this->m_tournament->get_setting_byID($tid)->round;\n\t\t//set sid\n\t\t$index_date = $this->m_schedule->get_row_schedule();\n\t\t$this->createSchedule($tid, $i);\n\t\tif($index_date!=0)\n\t\t{\n\t\t\t$sid = $this->m_schedule->get_min_id_schedule($tid);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sid = 1;\n\t\t}\n\t\tfor ($rnd=1; $rnd <= $max_round+1; $rnd++) { \n\t\t\t$matches = $this->m_match->get_match_data($tid,$rnd);\n\t\t\tforeach ($matches as $m) \n\t\t\t{\n\t\t\t\t$this->m_schedule->append_schedule($m['match_id'], $sid);\n\t\t\t\t$sid++;\n\t\t\t}\t\n\t\t}\n\t\t$status = array('status'=>3);\n\t\t$this->m_tournament->update_status($status, $tid);\n\t\tredirect(site_url('adm'));\n\t}", "function crea_id_ric(){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$q_crea_id_imm = \"SELECT * FROM ultimo_id_ric LIMIT 1\";\n\t$r_crea_id_imm = $db->query($q_crea_id_imm);\n\t$ro_crea_id_imm = mysql_fetch_array($r_crea_id_imm);\n\t$id_ric = $ro_crea_id_imm['id_ric'];\n\t$q_agg=\"update ultimo_id_ric set id_ric = id_ric+1\";\n\t$r_agg=$db->query($q_agg);\n\t\n\treturn $id_ric;\n}", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "public function additionPart()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `part`(`companyparta`, `companyparte`, `billnumberpart`, `datebillpart`, `namepcsparta`,\n `namepcsparte`, `nopart`, `pricepart`, `discountpart`, `totalpart`, `notspart`, `idopart`, `deletepart`)\n VALUES ('$this->companyparta' ,'$this->companyparte' ,'$this->billnumberpart' ,'$this->datebillpart' ,'$this->namepcsparta' \n ,'$this->namepcsparte' ,'$this->nopart' ,'$this->pricepart' ,'$this->discountpart' ,'$this->totalpart' ,'$this->notspart' ,'$this->idopart' ,'$this->deletepart')\");\n $result = $sql->execute();\n //$idair = $dbh->lastInsertId();\n ///return array ($result,$idair);\n return $result;\n }", "private function rapportToevoegenAction()\n {\n if (isset($_POST) && !empty($_POST))\n {\n //maakt een rapport(vult de gegevens in de ticket)\n //en zet de status op gesloten\n $this->model->maakRapport();\n //stuurt je naar de ticket pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> rapport is toegevoegd. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Rapport toevoegen', 1);\n $this->forward('ticket', 'admin');\n } else\n {\n //geeft de ticket mee om later de ticket en klant id te gebruiken.\n $ticket = $this->model->geefTicket();\n $this->view->set('ticket', $ticket);\n }\n }", "public function add(RP $rp) {\n if (($pos = array_search($rp->team, $this->teams)) === false) {\n $this->teams[] = $rp->team;\n $pos = count($this->teams) - 1;\n }\n $this->rps[$pos][(string)$rp->division][$rp->boat_role][] = $rp;\n }", "public function add()\n {\n \n // 1 charge la class client dans models\n // 2 instantantie la class client (Cree objet de type client)\n $this->loadModel(\"Chambres\") ;\n // 3 apell de la methode getAll() display all room from database\n $datas = $this->model->getAll() ;\n \n //save room added \n $this->model->insert() ; \n \n // 4 Affichage du tableua\n \n $this->render('chambre',compact('datas')) ;\n }", "public function datumAddFromId($id){\n $sql = \"select persnr,datum from dzeitsoll where id='$id'\";\n $res = $this->db->query($sql);\n $rows = $res->fetchAll();\n $row = $rows[0];\n $datum = $row['datum'];\n $persnr = $row['persnr'];\n $sqlinsert = \"insert into dzeitsoll (persnr,datum,oe) values('$persnr','$datum','-')\";\n $this->db->query($sqlinsert);\n return $this->db->insertId();\n }", "public function add(){\n if ($_POST) {\n if ($_POST[\"operation\"] == 'egreso'){\n $_POST[\"amount\"] = $_POST[\"amount\"]*(-1);\n }\n if ($this->transactions->save(\"transactions\", $_POST)) {\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }else{\n $this->redirect(array(\"controller\"=>\"transactions\", \"method\"=>\"add\"));\n }\n }\n \n $this->set(\"accounts\", $this->transactions->find(\"accounts\"));\n $this->set(\"categories\", $this->transactions->find(\"categories\"));\n $this->_view->setView(\"add\");\n /* }else{\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }*/\n }", "public function newsolution() {\n // collect round and floor from POST data\n $round = Input::get('round');\n $floor = Input::get('floor');\n\n $ajaxResponse = ['msg' => ''];\n // dont save if 10 minutes left\n if($this->timeSinceRound(null, true) > -600) {\n $ajaxResponse['msg'] = 'newRoundSoon';\n } elseif ($round != $this->currentRound()) {\n $ajaxResponse['msg'] = 'cannotSaveSolutionForOtherRound';\n } elseif ($floor > $this->maxFloor()) {\n $ajaxResponse['msg'] = 'floorNotAvailable';\n } else {\n // collect the rest of POST data\n $solution = Input::get('solution');\n $solutionparams = Input::get('solutionparams');\n // calculate team karma\n $karma = $this->teamkarma($floor, $solution);\n\n //prepare data save to db\n $data = array(\n 'tot_round' => $round,\n 'floor' => $floor,\n 'user_id' => Auth::user()->id,\n 'karma' => $solutionparams['luck'] ? 50 : 100,\n 'maxrank' => $karma['maxrank'],\n 'maxevol' => $karma['maxevol'],\n 'gamespeed' => $solutionparams['gamespeed'],\n 'luck' => $solutionparams['luck'],\n 'karma_multiplier' => $karma['karmaMultiplier'],\n 'note' => $solutionparams['note'],\n 'unit_id_1' => $solution[0]['unitId'],\n 'unit_rank_1' => $solution[0]['rank'],\n 'unit_trans_1' => $solution[0]['trans']\n );\n for ($i=1; $i < 12; $i++) {\n if (!isset($solution[$i])) {\n break;\n }\n $data['unit_id_'.($i+1)] = $solution[$i]['unitId'];\n $data['unit_rank_'.($i+1)] = $solution[$i]['rank'];\n $data['unit_trans_'.($i+1)] = $solution[$i]['trans'];\n }\n $sid = DB::table('tot_solutions')->insertGetId($data);\n\n // vote for my solution\n $solution = $this->getSolutions(null, false, $sid)[0];\n $voteType = $solutionparams['luck'] == 1 ? 1 : 2;\n $calculatedKarma = $this->karmaPoint($voteType, $solution->karmamultiplier, $solution->luck);\n //prepare data save to db\n $data = array(\n 'round' => $solution->round,\n 'floor' => $solution->floor,\n 'tot_solution_id' => $solution->sid,\n 'user_id' => Auth::user()->id,\n 'vote_type' => $voteType,\n 'karma_vote' => $calculatedKarma,\n 'old_karma' => $solution->karma\n );\n DB::table('tot_solution_votes')->insert($data);\n\n //update solution karma\n DB::table('tot_solutions')->where('id', $sid)->update(['karma' => $solution-> karma + $calculatedKarma]);\n $ajaxResponse['msg'] = 'ok';\n }\n\n $ajaxResponse['solutions'] = $this->formattedSolutions();\n $ajaxResponse['myroundvotes'] = $this->getMyVotes($round);\n $ajaxResponse['roundvotes'] = $this->getRoundVotes($this->currentRound());\n echo json_encode($ajaxResponse, JSON_NUMERIC_CHECK);\n }", "function add() {\n\n\t\t// assign values from $_POST to class variables\n\t\t$this -> personal_id = $this -> input -> post('personal_id', TRUE);\n\n\t\t$this -> movable_number = $this -> input -> post('movable_number', TRUE);\n\n\t\t$this -> series_number = $this -> input -> post('series_number', TRUE);\n\n\t\t$this -> unit = $this -> input -> post('unit', TRUE);\n\n\t\t$this -> comment = $this -> input -> post('comment', TRUE);\n\t\t//tr_date_add\n\n\t\t$this -> give_date = tr_date_add($this -> input -> post('give_date', TRUE));\n\n\t\t$this -> take_date = tr_date_add($this -> input -> post('take_date', TRUE));\n\n\t\t$ok = $this -> db -> insert('movable', $this);\n\n\t\tif ($ok) {\n\n\t\t\t$this -> res = $this -> db -> insert_id();\n\t\t\t//$data['lastid'] = $this->db->insert_id() ;\n\n\t\t}\n\n\t\treturn $this -> res;\n\n\t}", "function add_day() {\n\t\t\t$date = new DateTime($this->entry_date);\n\t\t\t\n\t\t\t$qry = sprintf(\"INSERT INTO %s (tkr_id, entry_date, open, high, low, close, volume, adj_close) \n\t\t\t\t\tVALUES (%d,'%s',%8.2f,%8.2f,%8.2f,%8.2f,%d,%8.2f)\",\n\t\t\t\t\tmysql_real_escape_string(HISTORICAL_TBL), $this->tkr_id, mysql_real_escape_string($date->format('Y-m-d')),\n\t\t\t\t\t$this->open, $this->high, $this->low, $this->close, $this->vol, $this->adj_close);\n\t\t\tmysql_query($qry) or die(mysql_error());\n\t\t\t}", "public function addstepsAction(){\n\n\t echo $this->ModelObj->addstepandgetnewrow($this->Request); exit;\n\n\t}", "public function add() {\n\t\t\n\t\t$data = array(\n\t\t\t'user_id' => $this->_user_id,\n\t\t\t'date' => $this->_date,\n\t\t\t'time_of_day' => $this->_time_of_day,\n\t\t\t'type_id' => $this->_type_id,\n\t\t\t'route_id' => $this->_route_id,\n\t\t\t'distance' => $this->_distance,\n\t\t\t'time' => $this->_time,\n\t\t\t'shoe_id' => $this->_shoe_id,\n\t\t\t'quality' => $this->_quality,\n\t\t\t'effort' => $this->_effort,\n\t\t\t'weather_ids' => $this->_weather_ids,\n\t\t\t'temperature' => $this->_temperature,\n\t\t\t'notes' => $this->_notes,\n\t\t\t'field' => $this->_field,\n\t\t\t'placement' => $this->_placement,\n\t\t\t'group_min_age' => $this->_group_min_age,\n\t\t\t'group_max_age' => $this->_group_max_age,\n\t\t\t'group_age_size' => $this->_group_age_size,\n\t\t\t'group_age_placement' => $this->_group_age_placement,\n\t\t\t'group_gender_size' => $this->_group_gender_size,\n\t\t\t'group_gender_placement' => $this->_group_gender_placement,\n\t\t\t'active' => $this->_active\n\t\t);\n\t\t$this->db->insert($this->_table,$data);\n\t\t\n\t\treturn true;\n\t}", "public function index()\n {\n $roundNo = e(Input::get('round'));\n $id = e(Route::input('id'));\n if(strlen($roundNo) == 0) {\n $roundNo = e(Route::input('round'));\n if($roundNo == null) $roundNo = 1;\n }\n $round = Round::where('EventID', '=', $id)->where('RoundNumber', '=', $roundNo)->firstOrFail();\n $roundsForEvent = Round::where('EventID', '=', $id)->orderBy('RoundNumber')->get();\n $roundsForEventSelect = array();\n foreach($roundsForEvent as $r) {\n $coursename = $r->course !== null ? $r->course->Name : '[deleted course]';\n $roundsForEventSelect[$r->RoundNumber] = $r->RoundNumber . ': ' . $coursename;\n }\n $event = CyclingEvent::find($id);\n\n $results = DB::table('results')\n ->select(DB::raw('results.*, duration + timepenalty as TotalTime,divisions.DivisionID,divisions.DivisionName, teams.Name as TeamName,teams.Colour,concat(lower(countries.code), \".png\")'))\n ->leftJoin('eventrider', function($join) {\n $join->on('results.ridername', '=', 'eventrider.ridername')\n ->on('results.eventid', '=', 'eventrider.eventid');\n })\n ->leftJoin('divisions', 'eventrider.divisionid', '=', 'divisions.divisionid')\n ->leftJoin('teamrider', function($join) {\n $join->on('results.ridername', '=', 'teamrider.ridername')\n ->on('results.eventid','=','teamrider.eventid');\n })\n ->leftJoin('teams', 'teamrider.teamid', '=', 'teams.teamid')\n ->leftJoin('profiledata', 'profiledata.fullname', '=', 'results.ridername')\n ->leftJoin('countries', 'countries.name', '=', 'profiledata.country')\n ->where('roundid', '=', $round->RoundID)\n ->orderByRaw('Duration + TimePenalty, AvSpeed desc')\n ->get();\n\n return View::make('results', array('results' => $results, 'event' => $event, 'round' => $round, 'roundsForEvent' => $roundsForEventSelect));\n }", "function saveOrder() {\n\t\n\t\t// Check for request forgeries\n\t\tdefined('_JEXEC') or die( 'Invalid Token' );\n\t\n\t\t// Instanz der Tabelle\n\t\t$row = JTable::getInstance( 'turniere', 'TableCLM' );\n\t\t$row->load( $this->id ); // Daten zu dieser ID laden\n\n\t $clmAccess = clm_core::$access; \n\t\tif (($row->tl != clm_core::$access->getJid() AND $clmAccess->access('BE_tournament_edit_round') !== true) OR $clmAccess->access('BE_tournament_edit_round') === false) {\n\t\t\t$this->app->enqueueMessage( JText::_('TOURNAMENT_NO_ACCESS'),'warning' );\n\t\t\treturn false;\n\t\t}\n\t\n\t\t$cid\t\t= clm_core::$load->request_array_int('cid');\n\t\n\t\t$total\t\t= count( $cid );\n\t\t$order\t\t= clm_core::$load->request_array_int('order');\n\t\n\t\t$row =JTable::getInstance( 'turnier_runden', 'TableCLM' );\n\t\t$groupings = array();\n\t\n\t\t// update ordering values\n\t\tfor( $i=0; $i < $total; $i++ ) {\n\t\t\t$row->load( (int) $cid[$i] );\n\t\t\t// track categories\n\t\t\t$groupings[] = $row->turnier;\n\t\n\t\t\tif ($row->ordering != $order[$i]) {\n\t\t\t\t$row->ordering = $order[$i];\n\t\t\t\tif (!$row->store()) {\n\t\t\t\t\t$this->app->enqueueMessage( $db->getErrorMsg(),'error' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// execute updateOrder for each parent group\n\t\t$groupings = array_unique( $groupings );\n\t\tforeach ($groupings as $group){\n\t\t\t$row->reorder('sid = '.(int) $group);\n\t\t}\n\t\t\t\t\t\t\t\t\t \n\t\t$this->app->enqueueMessage( JText::_('NEW_ORDERING_SAVED') );\n\t\n\t\t$this->adminLink->makeURL();\n\t\t$this->app->redirect( $this->adminLink->url );\n\t\n\t}", "function add_is_cetak_kartu($no_rm) {\n // update \n $data = $this->get_by_no_rm($no_rm);\n $update = array(\n 'is_cetak_kartu' => '1'\n );\n\n\n $this->db->where('no_rm', $no_rm);\n $this->db->update('pasien', $update);\n }", "function add_tt_1_alkes() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal $_POST, $adodb, $ses;\n\t\t$record = $_POST;\n\t\tforeach ($record as $k => $v) $record[$k] = trim($v);\n\n\t\t$rsx = $adodb->Execute(\"SELECT * FROM tt_1_alkes ORDER by no_tt DESC LIMIT 1\");\n\t\t$tahun_data = date('Y',$rsx->fields['date_insert']);\n\t\t$tahun_now = date('Y');\n\n\n\t\tif($rsx->fields['urut_no_tt'] == ''){\n\t\t\t$urut_no_tt = 1;\n\t\t}else{\n\t\t\tif($tahun_data == $tahun_now){\n\t\t\t\t$urut_no_tt = $rsx->fields['urut_no_tt'] + 1;\n\t\t\t}else{\n\t\t\t\t$urut_no_tt = 1;\n\t\t\t}\n\t\t}\n\n\t\t$sqly = \"SELECT\n\t\t\tsubdit\n\t\tFROM\n\t\t\tsubdit\n\t\tWHERE\n\t\t\tid_subdit = '\".$_POST['kode_subdit'].\"'\n\t\t\";\n\t\t//print $sqly;\n\t\t$lastno = $rsx->fields['urut_no_tt'];\n\t\t$lastno = $lastno[2].$lastno[3].$lastno[4].$lastno[5].$lastno[6];\n\t\t$lastno = intval($lastno);\n\t\t$lastno = $lastno + $urut_no_tt;\n\n\t\t$rsy = $adodb->Execute($sqly);\n\t\t$subdit = $rsy->fields['subdit'];\n\t\t$a = date('d-m/Y');\n\t\t$no = str_pad($lastno, 5, \"0\", STR_PAD_LEFT);\n\t\t$urut_no_tt = $subdit.\"/\".$no.\"/\".$a;\n\n \t\t$record['urut_no_tt'] = $urut_no_tt;\n\n\n\t\t$rs = $adodb->Execute(\"SELECT * FROM tt_1_alkes WHERE no_tt = '{$record['oldpkvalue']}'\");\n\t\tif ($rs && ! $rs->EOF) {\n\t\t\t$adodb->Execute($adodb->GetUpdateSQL($rs, $record, 1));\n\t\t\t$st = \"Updated\";\n\t\t} else {\n\t\t\t$record['insert_by'] = $ses->loginid;\n\t\t\t$record['date_insert'] = time();\n\t\t\t$rs = $adodb->Execute(\"SELECT * FROM tt_1_alkes WHERE no_tt = NULL\");\n\t\t\t$adodb->Execute($adodb->GetInsertSQL($rs, $record));\n\t\t\t$st = \"Added\";\n\t\t}\n\t\t//print_r($st);exit();\n\t\t$status = \"Successfull $st '<b>{$record['urut_no_tt']}</b>'\";\n\t\t$this->log($status);\n\n\t\t$_block = new block();\n\t\t$_block->set_config('title', 'Status');\n\t\t$_block->set_config('width', \"90%\");\n\t\t$_block->parse(array(\"*\".$status));\n\t\treturn $_block->get_str();\n\t}", "function operondetail($id){\n\t\t$sql=\"SELECT Operon.id as id,size,Operon.protein_gene_number as protein_gene_number,Operon.rna_gene_number as rna_gene_number,similar_operon_number,reference,Species.id as species_id,Species.name as species_name,three_letter_name,KEGG_GENOME_ID,VIMSS_url,NC.id as NC_id,NC.NC_id as NC_name,NC.description as NC_description FROM Operon,Species,NC WHERE Operon.id=$id AND Operon.species_id=Species.id AND Operon.NC_id=NC.id\";\n\t\t$result=mysql_query($sql) or die(\"Can not query $sql \".mysql_error());\n\t\t$row1=mysql_fetch_array($result,MYSQL_ASSOC);\n\t\tprint \"<table width=80% border=0 align=center>\\n<tr>\";\n\t\tprint \"<td width=33%>&nbsp;</td>\";\n\t\tprint \"<td width=34%><div align=center>Operon information: ID=<b>\".$row1['id'].\"</b></div></td>\\n\";\n\t\tprint \"<td width=33% align=right valign=center><form id=\\\"operonListForm\\\" name=\\\"operonListForm\\\" method=\\\"post\\\" action=\\\"addToSelectedOperon.php\\\">\";\n\t\tprint \"<input type=hidden id=operon$id name=operon$id value=$id>\";\n\t\tprint \"<input type=submit name=submit value=\\\"Add operon $id to selected operons\\\">\";\n\t\tprint \"</form></td>\";\n\t\tprint \"</tr></table>\";\n\t\t$operon1_id=$row1['id'];\n\t\tprint \"<table align=center width=80% border=1>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td width=20% align=right><b>Operon ID</b></td>\";\n\t\tprint \"<td width=80%>\".$row1['id'].\"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>Size</b></td>\";\n\t\tprint \"<td>\".$row1['size'].\"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>Protein gene number</b></td>\";\n\t\tprint \"<td>\".$row1['protein_gene_number'].\"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>RNA gene number</b></td>\";\n\t\tprint \"<td>\".$row1['rna_gene_number'].\"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>Similar operon number</b></td>\";\n\t\tprint \"<td><a href=displaySimilarOperon.php?operon1_id=\".$row1['id'].\"&source=1>\".$row1['similar_operon_number'].\"</a></td>\";;\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>Genes</b></td>\";\n\t\tprint \"<td>\";\n\t\t$sql_genes=\"SELECT Gene.id as id,gi,strand,start,end,synonym,COG_number,product,ODB FROM Gene,Operon_Gene WHERE Operon_Gene.gene_id=Gene.id AND operon_id=$id\";\n\t\t$result_gene=mysql_query($sql_genes) or die(\"Can not query $sql_genes, \".mysql_error());\n\t\t$n=mysql_num_rows($result_gene);\n\t\tprint \"<table border=0>\";\n\t\t$headitems=array(\"GI\",\"Start\",\"End\",\"Strand\",\"Synonym\",\"COG\",\"Product\");\n\t\t$width=array(\"10%\",\"10%\",\"10%\",\"5%\",\"10%\",\"10%\",\"45%\");\n\t\t$align=array(\"center\",\"center\",\"center\",\"center\",\"center\",\"center\",\"left\");\n\t\tprint_table_head($headitems,$width,$align);\n\t\t$flag=0;\n\t\t$gene_synonyms=array();\n\t\tfor($i=0;$i<$n;$i++){\n\t\t\t$r=mysql_fetch_array($result_gene,MYSQL_ASSOC);\n\t\t\tprint \"<tr>\";\n\t\t\tprint \"<td align=center valign=top><a href=genedetail.php?id=\".$r['id'].\">\".$r['gi'].\"</a></td>\";\n\t\t\tprint \"<td align=center valign=top>\".$r['start'].\"</td>\";\n\t\t\tprint \"<td align=center valign=top>\".$r['end'].\"</td>\";\n\t\t\tprint \"<td align=center valign=top>\".$r['strand'].\"</td>\";\n\t\t\tprint \"<td align=center valign=top><a href=genedetail.php?id=\".$r['id'].\">\".$r['synonym'].\"</a></td>\";\n\t\t\tprint \"<td align=center valign=top>\";\n\t\t\t$items=explode(',',$r['COG_number']);\n\t\t\tforeach($items as $COG_value){\n\t\t\t\tif(strlen($COG_value)>1){\n\t\t\t\t\tprint \"<a href=http://www.ncbi.nlm.nih.gov/COG/grace/wiew.cgi?$COG_value>\";\n\t\t\t\t\tprint $COG_value;\n\t\t\t\t\tprint \"</a>&nbsp;<br>\";\n\t\t\t\t}else{\n\t\t\t\t\tprint \"&nbsp;\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tprint \"</td>\";\n\t\t\tprint \"<td align=left valign=top>\".$r['product'].\"</td>\";\n\t\t\tprint \"</tr>\";\n\t\t\tif($r['ODB']>0){\n\t\t\t\t$flag=$r['ODB'];\n\t\t\t}\n\t\t\tarray_push($gene_synonyms,$r['synonym']);\n\t\t}\n\t\tprint \"</table>\";\n\t\tprint \"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>Species name</b></td>\";\n\t\tprint \"<td>\";\n\t\tprint \"<a href=\\\"displayNC.php?id=\".$row1['species_id'].\"\\\">\";\n\t\tprint $row1['species_name'];\n\t\tprint \"</a>\";\n\t\tprint \"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>NC name</b></td>\";\n\t\tprint \"<td>\";\n\t\tprint \"<a href=\\\"displayNCoperon.php?id=\".$row1['NC_id'].\"&page=1\\\">\";\n\t\tprint $row1['NC_name'];\n\t\tprint \"</a>\";\n\t\tprint \"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>NC description</b></td>\";\n\t\tprint \"<td>\";\n\t\tprint \"<a href=\\\"displayNCoperon.php?id=\".$row1['NC_id'].\"&page=1\\\">\";\n\t\tprint $row1['NC_description'];\n\t\tprint \"</a>\";\n\t\tprint \"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>ODB info</b></td>\";\n\t\tprint \"<td>\";\n\t\t$link=\"http://odb.kuicr.kyoto-u.ac.jp/odb2.rb?org=\".$row1['three_letter_name'].\"&genome_id=\".$row1['KEGG_GENOME_ID'].\"&genes=\".join(\",\",$gene_synonyms);\n\t\tif($flag==0){\n\t\t\tprint \"No information available in ODB.\";\n\t\t}elseif($flag==1){\n\t\t\tprint \"There is a known operon with literature information, click <a href=\\\"$link\\\">here</a> to show.\";\n\t\t}elseif($flag==2){\n\t\t\tprint \"There is a putative operon in ODB, click <a href=\\\"$link\\\">here</a> to show.\";\n\t\t}\n\t\tprint \"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td align=right><b>VIMSS info</b></td>\";\n\t\tprint \"<td>\";\n\t\tif(strlen($row1['VIMSS_url'])>0){\n\t\t\tprint \"Click <a href=http://www.microbesonline.org/operons/\".$row1['VIMSS_url'].\">here</a> to show related information in VIMSS.\";\n\t\t}else{\n\t\t\tprint \"No information available in VIMSS operon database.\";\n\t\t}\n\t\tprint \"</td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"<tr><td align=right><b>Reference</b></td><td>\\n\";\n\t\tif(strlen(trim($row1['reference']))>0){\n\t\t\t$refs=split(\",\",$row1['reference']);\n\t\t\tforeach ($refs as $ref) {\n\t\t\t\tprint \"<a href=\\\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=$ref\\\">$ref</a>&nbsp;\";\n\t\t\t}\n\t\t}else{\n\t\t\tprint \"No literature information available.\";\n\t\t}\n\t\tprint \"</td></tr>\\n\";\n\t\tprint \"<tr>\\n\";\n\t\tprint \"<td colspan=2>\";\n\t\tprint \"<div align=center><b>Search for similar operons with: \".$row1['id'].\"</b></div>\";\n\t\tinclude \"operon_query_form.php\";\n\t\tprint \"</b></td>\";\n\t\tprint \"</tr>\\n\";\n\t\tprint \"</table>\\n\";\n}", "public function additionCastumer()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `castumer`(nameca ,namece ,phonec ,areac ,deletc)VALUES('$this->nameca', '$this->namece', '$this->phonec', '$this->areac', '$this->deletc')\");\n $result = $sql->execute();\n $id = $dbh->lastInsertId();\n\treturn array ($result,$id);\n }", "function PassRound($PassRound, $idGame, $idPlace)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.place SET fkStatusPlace = '1' WHERE idPlace = '$idPlace'\");\n $req = $dbh->query(\"UPDATE fishermenland.place SET fkStatusPlace = '2' WHERE fkGamePlace = '$idGame' AND OrderPlace = '$PassRound'\");\n}", "function macro_roundregister($args) {\n $round_id = getattr($args, 'round_id');\n if (!is_round_id($round_id)) {\n return macro_error('Invalid round identifier');\n }\n\n // validate round id\n $round = round_get($round_id);\n if (!$round) {\n return macro_error('Invalid round identifier');\n }\n $round_parameters = round_get_parameters($round_id);\n if (!getattr($round_parameters, \"rating_update\")) {\n return \"\";\n }\n\n global $identity_user;\n $is_registered = $identity_user && round_is_registered($round['id'], $identity_user['id']);\n\n if ($is_registered) {\n $class = \"round-registered\";\n $msg = \"<p>Te-ai inscris la <em>\".html_escape($round['title']).\"</em>.\"\n .\" <a href=\\\"\".html_escape(url_round_register_view($round['id'])).\"\\\">\"\n .\"Vezi cine s-a mai inscris\"\n .\"</a>.</p>\";\n \n if ($round['state'] == 'waiting') {\n $msg .= \"<p>In caz ca nu mai poti participa te poti deinscrie\"\n .\" <a href=\\\"\".html_escape(url_round_register($round['id']))\n .\"\\\">aici</a>.</p>\";\n }\n }\n else {\n // too late?\n if ('waiting' == $round['state']) {\n $class = \"round-register\";\n $msg = \"<p>Nu esti inscris la \"\n .\"<em>\".html_escape($round['title']).\"</em>! \"\n .\"Daca vrei sa ti se modifice modifice rating-ul dupa \"\n .\"acest concurs trebuie sa te inscrii pana la ora \"\n .format_date($round['start_time'], \"%H:%M, %d&nbsp;%b&nbsp;%Y.\").\"</p>\"\n .\"<p><a href=\\\"\".html_escape(url_round_register($round['id'])).\"\\\">\"\n .\"<strong>Inscrie-te acum!</strong></a> &nbsp; \"\n .\" <a href=\\\"\".html_escape(url_round_register_view($round['id'])).\"\\\">\"\n .\"Vezi cine e inscris\"\n .\"</a></p>\"\n .\"<p>Poti sa participi la concurs si fara sa te inscrii \"\n .\"insa nu ti se va schimba rating-ul.</p>\";\n }\n elseif ('running' == $round['state']) {\n $class = \"round-expired\";\n $msg = \"<p>Nu se mai pot face inscrieri la \"\n .\"<em>\".html_escape($round['title']).\"</em> \"\n .\"<strong><em>insa mai poti participa</em></strong>.</p>\"\n .\"<p>Trebuia sa te inscrii inainte de ora \"\n .format_date($round['start_time'], \"%H:%M, %d&nbsp;%b&nbsp;%Y\")\n .\" daca vroiai sa ti se modifice rating-ul la finalul \"\n .\"rundei. Acum poti sa participi dar nu ti se va modifica \"\n .\"rating-ul.</p>\"\n .\"<p><a href=\\\"\".html_escape(url_round_register_view($round['id'])).\"\\\">\"\n .\"Vezi cine s-a inscris\"\n .\"</a></p>\";\n }\n else {\n // 'complete' == $round['state']\n $class = \"round-expired\";\n $msg = \"<p>Nu se mai pot face inscrieri la \"\n .\"<em>\".html_escape($round['title']).\"</em>. \"\n .\"Runda s-a incheiat.</p>\"\n .\"<p><a href=\\\"\".html_escape(url_round_register_view($round['id'])).\"\\\">\"\n .\"Vezi cine s-a inscris\"\n .\"</a></p>\";\n }\n }\n\n $msg = \"<div class=\\\"{$class}\\\">{$msg}</div>\";\n\n return $msg;\n}", "function srvsadd($srvsid)\n {\n $db= new DB();\n $db->open();\n if($srvsid==0)\n {\n $sql = \"Select srvs_main.sr_id, srvs_main.cname, srvs_main.cpname, srvs_main.add1, srvs_main.add2, \n city.citname,\n district.dstname, \n state.stname, \n country.cntname, \n srvs_main.pin,\n srvs_main.tel,\n srvs_main.fax, \n srvs_main.mob,\n srvs_main.mail,\n srvs_main.web,\n srvs_main.cno,\n srvs_main.amail,\n\t\t\t\tsrvs_main.srvs_auth\n\n from srvs_main, city, district, state, country\n where srvs_main.sr_id='$srvsid' and\n srvs_main.city=city.citid and\n srvs_main.dist=district.dstid and\n srvs_main.stat=state.stid and\n srvs_main.cout=country.cntid\";\n }\n else {\n $sql = \"Select srvs_main.sr_id, srvs_main.cname, srvs_main.cpname, srvs_main.add1, srvs_main.add2, \n city.citname,\n district.dstname, \n state.stname, \n country.cntname, \n srvs_main.pin,\n srvs_main.tel,\n srvs_main.fax, \n srvs_main.mob,\n srvs_main.mail,\n srvs_main.web,\n srvs_main.cno,\n srvs_main.amail,\n\t\t\t\tsrvs_main.srvs_auth\n \n\t\t from srvs_main, city, district, state, country\n where srvs_main.sr_id='$srvsid' and\n srvs_main.city=city.citid and\n srvs_main.dist=district.dstid and\n srvs_main.stat=state.stid and\n srvs_main.cout=country.cntid\";\n \n } \n \n $result2 = mysql_query($sql);\n\n $cisrvs =0;\n $srvsData;\n while($row = mysql_fetch_array($result2))\n {\n $srid = $row['sr_id'];\n $cname = $row['cname'];\n $cpname = $row['cpname']; \n $add1 = $row['add1'];\n $add2 = $row['add2'];\n $city = $row['citname'];\n $dist = $row['dstname'];\n $stat = $row['stname'];\n $cont = $row['cntname'];\n $pin = $row['pin'];\n $tel = $row['tel']; \n $fax = $row['fax'];\n $mob = $row['mob'];\n $mail = $row['mail']; \n $web = $row['web'];\n $cno = $row['cno'];\n $amail = $row['amail'];\n $srvs_auth = $row['srvs_auth'];\n\t\t\t\t \n $srvsmain = new srvsmain();\n $srvsmain->setSrvsid($srid);\n $srvsmain->setCname($cname);\n $srvsmain->setCpname($cpname);\n $srvsmain->setAdd1($add1);\n $srvsmain->setAdd2($add2);\n $srvsmain->setCity($city);\n $srvsmain->setDist($dist);\n $srvsmain->setStat($stat);\n $srvsmain->setCont($cont);\n\t\t\t\t $srvsmain->setPin($pin);\n $srvsmain->setTel($tel);\n $srvsmain->setFax($fax);\n $srvsmain->setMob($mob);\n $srvsmain->setMail($mail);\n $srvsmain->setWeb($web);\n $srvsmain->setCno($cno);\n $srvsmain->setAmail($amail);\n $srvsmain->setSrvs_auth($srvs_auth);\n\t\t\t\t \n $srvsData[$cisrvs] = $srvsmain;\n $cisrvs = $cisrvs+1;\n \n return $srvsData;\n \n \n }\n \n}", "public function actionAdd(){\n Yii::$app->timeZone = 'Asia/Jakarta';\n Yii::$app->response->format = Response::FORMAT_JSON;\n $response = null;\n\n if(Yii::$app->request->isPost){\n $data = Yii::$app->request->post();\n\n $presensi_mahasiswa = PresensiDetail::find()\n ->where(['id_presensi' => $data['id_presensi']])\n ->andWhere(['nim' => $data['nim'] ])\n ->one();\n\n $mengambil_matkul = Mengambil::find()\n ->innerJoinWith('mengajar')\n ->innerJoinWith('mengajar.tbPresensis')\n ->where(['tb_presensi.id_presensi' => $data['id_presensi']])\n ->andWhere(['nim' => $data['nim'] ])\n ->one();\n\n\n // jika mahasiswa belum presensi dan benar-benar mengambil matkul\n if ($presensi_mahasiswa==null && $mengambil_matkul!=null){\n $model = new PresensiDetail();\n\n $model->id_presensi = $data['id_presensi'];\n $model->nim = $data['nim'];\n $model->status = \"hadir\";\n $model->lat = $data['lat'];\n $model->lng= $data['lng'];\n $model->waktu = date('Y-m-d H:i:s');\n $model->jarak = $data['jarak'];\n $model->proses = \"pending\";\n\n // check\n $presensi = Presensi::findOne($model->id_presensi);\n\n if ($presensi==null){\n $response['code'] = '404';\n $response['status'] = 'Failed';\n $response['message'] = 'Not found';\n } else if ($presensi->status == \"open\"){\n if ($model->save()){\n $response['code'] = '200';\n $response['status'] = 'OK';\n $response['message'] = 'Presensi success';\n } else {\n $response['status'] = 'Failed';\n }\n } else {\n $response['code'] = '403';\n $response['status'] = 'Forbidden';\n $response['message'] = 'Presensi closed';\n }\n // jika mahasiswa tidak mengambil matakuliah\n } else if ($mengambil_matkul==null) {\n $response['code'] = '403';\n $response['status'] = 'Forbidden';\n $response['message'] = 'Tidak terdaftar di matakuliah ini';\n // jika mahasiswa sudah presensi\n } else {\n $response['code'] = '500';\n $response['status'] = 'Error';\n }\n }\n\n return $response;\n }", "public function correct_tp_results($id,$acc_number,$total,$trader,$investor)\n\t{\n\n \t\t $this->db->query(\"UPDATE pamm_tp_results SET pamm_tp_total = pamm_tp_total + $total, pamm_tp_trader = pamm_tp_trader + $trader, pamm_tp_investor = pamm_tp_investor + $investor WHERE pamm_tp_id=$id AND pamm_tp_account=$acc_number\");\n\t}", "public function nextRound() {\n $this->round++;\n }", "function add_correct_answer($params)\n {\n $this->db->insert('correct_answers',$params);\n return $this->db->insert_id();\n }", "function add_perumahan__pembangunan_rumah($params)\n {\n $this->db->insert('perumahan__pembangunan_rumah',$params);\n return $this->db->insert_id();\n }", "function AddTour($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.game SET TourGame = TourGame + '1' WHERE idGame = '$idGame'\");\n}", "public function add(ResultInterface $result): void\n {\n $this->results[] = $result;\n }", "function add_finish_trip_detail($params)\n {\n $this->db->insert('Finish_trip_details',$params);\n return $this->db->insert_id();\n }", "function add() {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'workname' => $this->input->post('workname'),\n 'description' => $this->input->post('description'),\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n redirect('jcline/index');\n } else {\n $data['_view'] = 'jcline/add';\n $this->load->view('layouts/main', $data);\n }\n }", "public function getResult($id){\n\n $vote_pour= DB::table('survey_vouter')->where('survey_id', $id )->where('vote','Pour')->count();\n $vote_contre= DB::table('survey_vouter')->where('survey_id', $id )->where('vote','Contre')->count();\n $result = $vote_pour * 100/($vote_pour + $vote_contre);\n //var_dump($result);\n Survey::where('id',$id)->update(['resultat'=>$result]);\n return $result;\n }", "public function actionAdd($id)//wyświetlanie\n {\n $query = Dish::find()->where(['id_dania' => $id])->one();\n //nie ma takiego\n if(!$query)\n { \n \\Yii::$app->getSession()->setFlash('warning', 'Nie ma takiego dania');\n return $this->goBack('index');\n }\n \n $koszyk = Yii::$app->session->get('zamowione');\n $jest=false; \n\n if (is_array($koszyk)) {\n foreach ($koszyk as $key => $pozycja) {\n if ($pozycja['id'] == $id) {\n $jest=1;\n $koszyk[$key]['ilosc']++;\n }\n \n }}\n if(!$jest)\n {\n $koszyk[]=['id' => $id, 'nazwa' => $query->nazwa_dania,'porcja'=>'mała' , 'cena'=>$query->koszt_dania,'ilosc' => 1];\n }\n Yii::$app->session->set('zamowione',$koszyk);\n \n return $this->render('index', ['settings' => $koszyk]);\n }" ]
[ "0.57428235", "0.5709192", "0.56578064", "0.5487106", "0.54536265", "0.5443193", "0.54367644", "0.5353914", "0.53331846", "0.53331846", "0.53323746", "0.53142905", "0.5299736", "0.5238555", "0.52384204", "0.5219647", "0.5190561", "0.51560086", "0.51444936", "0.5085695", "0.50803953", "0.50796485", "0.5070888", "0.5067669", "0.50629914", "0.50551736", "0.50551736", "0.5043288", "0.5021882", "0.5021533", "0.5012064", "0.5011047", "0.49959525", "0.49945185", "0.4976398", "0.49706692", "0.4968735", "0.49649325", "0.49502978", "0.4921672", "0.4920574", "0.49173334", "0.49044496", "0.49033883", "0.4885599", "0.48829594", "0.48648125", "0.4862161", "0.4852956", "0.48523012", "0.48451987", "0.48411787", "0.4839021", "0.48390165", "0.48376375", "0.48343518", "0.48308256", "0.48204365", "0.48136246", "0.48108327", "0.48098058", "0.48024732", "0.479535", "0.47911507", "0.4790164", "0.47880048", "0.47810546", "0.47782236", "0.47744998", "0.47738525", "0.47693157", "0.476853", "0.47684503", "0.47660646", "0.47561857", "0.47556722", "0.4755446", "0.47554198", "0.47498733", "0.47481033", "0.47477227", "0.47440904", "0.47410518", "0.47363973", "0.473216", "0.47187263", "0.47158575", "0.47153485", "0.4715346", "0.47123805", "0.4708739", "0.47039527", "0.47020984", "0.47010252", "0.47006336", "0.46993613", "0.46981332", "0.46955743", "0.46939173", "0.46917287" ]
0.6760309
0
Season Results Zobrazeni vysledku sezony $sid= Season ID $mode= p (players) t (teams)
function SeasonResults($sid = 0,$mode = "p"){ global $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players; global $db_admin,$db_league_seasons_rounds_results_players,$db_league_teams; $res_rounds = mysql_query("SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id FROM $db_league_seasons_rounds_results_players AS lsrrp JOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=".(float)$rid." JOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id JOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id WHERE lsrrp.league_season_round_result_player_round_id=".(float)$rid." ORDER BY lsrrp.league_season_round_result_player_place ASC") or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); switch ($mode){ case "p": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $nick = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_PLAYER_NICK."</td>\n"; $guid = " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_ROUND_GUID."</td>\n"; $table_width = "600"; echo Menu(); break; case "t": $res_round = mysql_query("SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name FROM $db_league_seasons_rounds AS lsr JOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id JOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id WHERE lsr.league_season_round_id=".(float)$rid) or die ("<strong>File:</strong> ".__FILE__."<br /><strong>Line:</strong>".__LINE__."<br />".mysql_error()); $nick = ""; $guid = ""; $table_width = "400"; break; default: echo ""; } $ar_round = mysql_fetch_array($res_round); $league_name = stripslashes($ar_round['league_league_name']); $season_id = $ar_round['league_season_round_season_id']; $season_name = stripslashes($ar_round['league_season_name']); $round_num = $ar_round['league_season_round_num']; echo "<table width=\"".$table_wifth."\" cellspacing=\"2\" cellpadding=\"1\" class=\"eden_main_table\">\n"; echo " <tr>\n"; echo " <td colspan=\"3\" align=\"left\">"; if ($_GET['action'] == "results_add"){echo "<h5 style=\"margin:20px 0px 0px 0px;\">".$league_name." > <a href=\"modul_league.php?action=rounds&sid=".$season_id."&project=".$_SESSION['project']."\" target=\"_self\">".$season_name."</a> > "._LEAGUE_SEASON_ROUND." ".$round_num."</h5>";} if ($_GET['action'] == "results_add"){echo "<form action=\"sys_save.php?action=results_add&rid=".$rid."sid=".$season_id."\" method=\"post\" enctype=\"multipart/form-data\">";} echo " </td>\n"; echo " </tr>\n"; echo " <tr style=\"background-color:#dce3f1;\">\n"; echo " <td width=\"50\" align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_POSITION."</td>\n"; echo " <td align=\"left\" class=\"eden_title\">"._LEAGUE_SEASON_POINTS."</td>\n"; echo $nick; echo $guid; echo " <td width=\"200\" align=\"left\" class=\"eden_title\">"._LEAGUE_TEAM."</td>\n"; echo " </tr>\n"; switch ($mode){ case "p": $i=1; while ($ar_rounds = mysql_fetch_array($res_rounds)){ if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">".$i."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_season_round_result_player_points']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_team_name']."</td>\n"; echo "</tr>\n"; $i++; } break; case "t": $i=1; while ($ar_rounds = mysql_fetch_array($res_rounds)){ if ($i % 2 == 0){ $cat_class = "cat_level1_even";} else { $cat_class = "cat_level1_odd";} echo "<tr class=\"".$cat_class."\" onmouseover=\"this.className='cat_over'\" onmouseout=\"this.className='".$cat_class."'\">\n"; echo " <td width=\"50\" align=\"right\" valign=\"middle\">".$i."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_season_round_result_player_points']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['admin_nick']."</td>\n"; echo " <td width=\"200\" align=\"left\">".$ar_rounds['league_season_round_allowed_player_guid']."</td>\n"; echo " <td align=\"left\">".$ar_rounds['league_team_name']."</td>\n"; echo "</tr>\n"; $i++; } break; default; echo ""; } echo "</table>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LeagueSeasonTeamsResults(){\n\t\n\tglobal $db_league_leagues,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_teams,$db_league_awards;\n\tglobal $db_country,$db_league_seasons_rounds;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\t$result .= \"<table style=\\\"width:400px;\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\t$result .= \"\t<tr>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:40px;\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:60px;text-align:center;\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:50px;\\\">\"._CMN_COUNTRY.\"</td>\\n\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t$result .= \"\t</tr>\\n\";\n \t$res_results_teams = mysql_query(\"\n\tSELECT lt.league_team_id, lt.league_team_name, lsrt.league_season_result_team_team_sub_id, lsrt.league_season_result_team_points, c.country_shortname, c.country_name, ls.league_season_end \n\tFROM $db_league_seasons_results_teams AS lsrt \n\tJOIN $db_league_teams AS lt ON lt.league_team_id = lsrt.league_season_result_team_team_id \n\tJOIN $db_country AS c ON c.country_id = lt.league_team_country_id \n\tJOIN $db_league_seasons AS ls ON ls.league_season_id = \".(integer)$_GET['sid'].\" \n\tWHERE lsrt.league_season_result_team_season_id = \".(integer)$_GET['sid'].\" \n\tORDER BY lsrt.league_season_result_team_points DESC LIMIT 10\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$i = 1;\n\twhile ($ar_results_teams = mysql_fetch_array($res_results_teams)){\n\t\t// Call function\n\t\t$ar_award = LeagueCheckAwards(2,(integer)$_GET['sid'],0,(integer)$ar_results_teams['league_season_result_team_team_sub_id']);\n\t\t\n\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t$result .= \"\t<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t$result .= \"\t\t<td align=\\\"right\\\" valign=\\\"top\\\">\"; if($ar_award['league_award_place']){$result .= \"<img src=\\\"\".$url_league_awards.$ar_award['league_award_img'].\"\\\" alt=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" title=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" />\";} else { $result .= \"<strong>\".$i.\"</strong>\";} $result .= \"</td>\\n\";\n\t\t$result .= \"\t\t<td valign=\\\"top\\\" align=\\\"right\\\">\".$ar_results_teams['league_season_result_team_points'].\"</td>\\n\";\n\t\t$result .= \"\t\t<td valign=\\\"top\\\" align=\\\"center\\\"><img src=\\\"\".$url_flags.$ar_results_teams['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_results_teams['country_name']).\"\\\" title=\\\"\".stripslashes($ar_results_teams['country_name']).\"\\\" /></td>\\n\";\n\t \t$result .= \"\t\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=league_team&mode=team_home&ltid=\".$ar_results_teams['league_team_id'].\"&lang=\".$_GET['lang'].\"&filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_teams['league_team_name']).\"</a></td>\\n\";\n\t\t$result .= \"\t</tr>\\n\";\n\t\t$i++;\n\t}\n\t// Show button for setting awards only if season is over\n\tif ($ar_results_teams['league_season_end'] < date(\"Y-m-d H:i:s\")){\n\t\t$result .= \"\t<tr>\\n\";\n\t\t$result .= \"\t\t<td colspan=\\\"5\\\"><br /><form action=\\\"sys_save.php?action=league_awards_give_to_teams&sid=\".$_GET['sid'].\"\\\" method=\\\"post\\\" name=\\\"form1\\\" enctype=\\\"multipart/form-data\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$_GET['sid'].\"\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t\t$result .= \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_AWARD_SUBMIT_TEAM.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t\t$result .= \"\t\t</form>\\n\";\n\t\t$result .= \"\t\t</td>\\n\";\n\t\t$result .= \"\t</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\t\n\treturn $result;\n}", "function LeagueSeasonPlayersResults(){\n\t\n\tglobal $db_admin,$db_admin_contact,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_seasons,$db_league_seasons_results_players;\n\tglobal $db_country,$db_league_seasons_rounds,$db_league_players,$db_league_awards;\n\tglobal $eden_cfg;\n\tglobal $url_flags,$url_league_awards;\n\t\n\t$result = \"\";\n\t$result .= \"<table style=\\\"width:500px;\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\t$result .= \"\t<tr>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:40px;\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\" style=\\\"width:60px;\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._CMN_COUNTRY.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\";\n\t$result .= \"\t\t<td class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\";\n\t$result .= \"\t</tr>\";\n \t$res_results_players = mysql_query(\"\n\tSELECT lsrp.league_season_result_player_player_id, a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, \n\tlsrp.league_season_result_player_points, c.country_shortname, c.country_name, agid.admin_guid_guid \n\tFROM $db_league_seasons_results_players AS lsrp \n\tJOIN $db_league_players AS lp ON lp.league_player_id = lsrp.league_season_result_player_player_id \n\tJOIN $db_admin AS a ON a.admin_id = lp.league_player_admin_id \n\tJOIN $db_admin_contact AS ac ON ac.aid = a.admin_id \n\tJOIN $db_admin_guids AS agid ON agid.aid = a.admin_id AND agid.admin_guid_game_id = lp.league_player_game_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id = lp.league_player_team_id \n\tJOIN $db_country AS c ON c.country_id = ac.admin_contact_country \n\tWHERE lsrp.league_season_result_player_season_id = \".(integer)$_GET['sid'].\" \n\tORDER BY lsrp.league_season_result_player_points DESC LIMIT 10\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$i = 1;\n\twhile ($ar_results_players = mysql_fetch_array($res_results_players)){\n\t\t// Call function\n\t\t$ar_award = LeagueCheckAwards(1,(integer)$_GET['sid'],(integer)$ar_results_players['league_season_result_player_player_id'],0);\n\t\t\n\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t$result .= \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t$result .= \"\t<td align=\\\"right\\\" valign=\\\"top\\\">\"; if($ar_award['league_award_place']){$result .= \"<img src=\\\"\".$url_league_awards.$ar_award['league_award_img'].\"\\\" alt=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" title=\\\"\".stripslashes($ar_award['league_award_name']).\"\\\" />\";} else {$result .= \"<strong>\".$i.\"</strong>\";} $result .= \"</td>\";\n\t\t$result .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\".$ar_results_players['league_season_result_player_points'].\"</td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\"><img src=\\\"\".$url_flags.$ar_results_players['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_results_players['country_name']).\"\\\" title=\\\"\".stripslashes($ar_results_players['country_name']).\"\\\" /></td>\";\n\t \t$result .= \"\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=player&amp;mode=player_acc&amp;id=\".$ar_results_players['admin_id'].\"&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_players['admin_nick']).\"</a></td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\">\".$ar_results_players['admin_guid_guid'].\"</td>\";\n\t\t$result .= \"\t<td valign=\\\"top\\\"><a href=\\\"\".$eden_cfg['url'].\"index.php?action=league_team&amp;mode=team_home&amp;ltid=\".$ar_results_players['league_team_id'].\"&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\".stripslashes($ar_results_players['league_team_name']).\"</a></td>\";\n\t\t$result .= \"</tr>\";\n\t\t$i++;\n\t}\n\t$result .= \"\t<tr>\\n\";\n\t$result .= \"\t\t<td colspan=\\\"5\\\"><br /><form action=\\\"sys_save.php?action=league_awards_give_to_players&sid=\".$_GET['sid'].\"\\\" method=\\\"post\\\" name=\\\"form1\\\" enctype=\\\"multipart/form-data\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$_GET['sid'].\"\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t$result .= \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_AWARD_SUBMIT_PLAYER.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t$result .= \"\t\t</form>\\n\";\n\t$result .= \"\t\t</td>\\n\";\n\t$result .= \"\t</tr>\\n\";\n\t$result .= \"</table>\\n\";\n\t\n\treturn $result;\n}", "function display_player_stats($res) {\n\n echo '<br><div class=\"stat-sheet\"><h3>Regular Season Stats</h3><br>';\n\n // Table header:\n echo '<table class=\"player-tbl\" cellspacing=\"5\" cellpadding=\"5\"\n width=\"75%\">\n\t<tr class=\"player-stat-heading\">\n\t\t<td align=\"left\"><b>Year</b></td>\n\t\t<td align=\"left\"><b>Team</b></td>\n\t\t<td align=\"left\"><b>Lg</b></td>\n\t\t<td align=\"left\"><b>G</b></td>\n\t\t<td align=\"left\"><b>Min</b></td>\n\t\t<td align=\"left\"><b>Pts</b></td>\n\t\t<td align=\"left\"><b>PPG</b></td>\n\t\t<td align=\"left\"><b>FGM</b></td>\n\t\t<td align=\"left\"><b>FGA</b></td>\n\t\t<td align=\"left\"><b>FGP</b></td>\n\t\t<td align=\"left\"><b>FTM</b></td>\n\t\t<td align=\"left\"><b>FTA</b></td>\n\t\t<td align=\"left\"><b>FTP</b></td>\n\t\t<td align=\"left\"><b>3PM</b></td>\n\t\t<td align=\"left\"><b>3PA</b></td>\n\t\t<td align=\"left\"><b>3PP</b></td>\n\t\t<td align=\"left\"><b>ORB</b></td>\n\t\t<td align=\"left\"><b>DRB</b></td>\n\t\t<td align=\"left\"><b>TRB</b></td>\n\t\t<td align=\"left\"><b>RPG</b></td>\n\t\t<td align=\"left\"><b>AST</b></td>\n\t\t<td align=\"left\"><b>APG</b></td>\n\t\t<td align=\"left\"><b>STL</b></td>\n\t\t<td align=\"left\"><b>BLK</b></td>\n\t\t<td align=\"left\"><b>TO</b></td>\n\t\t<td align=\"left\"><b>PF</b></td>\n\t</tr>\n';\n\n // Fetch and print all the records:\n while ($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) {\n echo '<tr class=\"player-stat\">\n\t\t\t<td align=\"left\">' . $row['year'] . '</td>\n\t\t\t<td align=\"left\">' . $row['team'] . '</td>\n\t\t\t<td align=\"left\">' . $row['lg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['g'] . '</td>\n\t\t\t<td align=\"left\">' . $row['min'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pts'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ppg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fga'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fta'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpa'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['orb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['drb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['trb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['rpg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ast'] . '</td>\n\t\t\t<td align=\"left\">' . $row['apg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['stl'] . '</td>\n\t\t\t<td align=\"left\">' . $row['blk'] . '</td>\n\t\t\t<td align=\"left\">' . $row['turnover'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pf'] . '</td>\n\t\t</tr>\n\t\t';\n }\n\n echo '</table></div>';\n\n}", "function get_standing_team_db($idSeason)\n{\n require('./model/connect_db.php');\n $sql = \"select t.idTeam, t.nameTeam, sum(r.Points) as points from team t, race r, season s where r.idTeam = t.idTeam and s.idseason = '%d' and s.idseason = r.idseason group by t.nameTeam order by points desc \";\n $request = sprintf($sql,$idSeason);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $standing = array();\n while($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $standing[] = $line;\n }\n return $standing;\n}", "function showGames( $curDivision=\"\" ) {\n\n/* ... define values for template variables to display on page */\n if ($curDivision == \"\") {\n $data['title'] = \"Playoffs - \".$this->config->item( 'siteName' );\n }\n else {\n $data['title'] = \"Division \".$curDivision.\" Playoffs - \".$this->config->item( 'siteName' );\n }\n\n/* ... get the schedule details from the database */ \n if ($curDivision == \"\") { \n $data['tournDetails'] = $this->Model_Tournament->getAllDetails();\n $data['tournHeader'] = \"League Playoff Schedule\";\n }\n else {\n $data['tournDetails'] = $this->Model_Tournament->getDivDetails( $curDivision );\n $data['tournHeader'] = \"Division \".$curDivision.\" Playoff Schedule\";\n }\n\n/* ... replace seeding placeholders in the schedule with appropriate team ids */\n for ($i=0; $i < count( $data['tournDetails'] ); $i++) {\n\n if ($data['tournDetails'][$i]['Status'] == \"SCHEDULED\") {\n if ($curDivision == \"\") {\n $seedDiv = substr( $data['tournDetails'][$i]['TournamentID'], 0, 1 );\n }\n else {\n $seedDiv = $curDivision;\n }\n if ($data['tournDetails'][$i]['HomeTeamID'] == NULL && $data['tournDetails'][$i]['HomeSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['HomeSeed'], $seedDiv );\n $data['tournDetails'][$i]['HomeTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n if ($data['tournDetails'][$i]['VisitTeamID'] == NULL && $data['tournDetails'][$i]['VisitSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['VisitSeed'], $seedDiv );\n $data['tournDetails'][$i]['VisitTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n }\n }\n \n/* ... set the name of the page to be displayed */\n $data['main'] = \"schedule/sched_tournamentMaster\";\n\n $this->index( $data );\n \n/* ... time to go */\n return;\n }", "public function getSeasons();", "public function get_teams($sportFK,$tsid)\n\t{\n\t\t$this->db->select('e.id,ep.id as epid,p.id as pid,p.name as pname');\n\t\t$this->db->from('tournament_template as tt');\n\t\t$this->db->join('tournament AS t', 't.tournament_templateFK = tt.id', 'INNER');\n\t\t$this->db->join('tournament_stage AS ts', 't.id = ts.tournamentFK', 'INNER');\n\t\t$this->db->join('event AS e', 'ts.id = e.tournament_stageFK', 'INNER');\n\t\t$this->db->join('event_participants AS ep', 'e.id = ep.eventFK', 'INNER');\n\t\t$this->db->join('participant AS p', 'ep.participantFK = p.id', 'left');\n\t\t$this->db->WHERE(\"tt.sportFK =\".$sportFK.\"\");\n\t\t$this->db->WHERE(\"ts.id = $tsid \");\n\t\t//$this->db->WHERE(\"e.startdate > '\".$this->today.\"' \");\n\t\t$this->db->group_by('ep.participantFK');\n\t\t$this->db->order_by(\"e.startdate,e.id,ts.id\");\n\t\t$result = $this->db->get();\n\t\treturn $result->result();\n\t}", "function crawl_games_per_season($param_season, $param_gameType, $param_team) {\n\t\n\t$base_link = 'http://www.nhl.com/ice/schedulebyseason.htm';\n\t\t\n\t$html_games = file_get_html(\"$base_link?season=$param_season&gameType=$param_gameType&team=$param_team\");\n\t\n\tif(!$html_games) {\n\t\techo 'GET HTML FALSE <br>';\n\t}\n\t\n\t$games_list = array();\n\t\n\t\n\tforeach($html_games->find('table[class=data schedTbl] tbody tr') as $match) {\n\t\t\n\t\t//Don't take into account where column is less than 6, filtering out header and blank rows.\n\t\tif(count($match->find('td')) == 6) {\n\t\t\t\n\t\t\t //Need to check if it's the FINAL result by checking if it starts with 'FINAL:'.\n\t\t\t //Additionally read out teams involved, determine winner/loser, and if there has been overtime.\n\t\t\t \n\t\t\t $item_result = $match->find('td.tvInfo', 0)->plaintext;\n\t\t\t $item_result_split = explode(' ', $item_result);\n\t\t\t \n\t\t\t \n\t\t\t if($item_result_split[1] == 'FINAL:') {\n\t\t\t \t\n\t\t\t\t$item['final'] = $item_result_split[1];\n\t\t\t\t$item['visiting_team'] = $item_result_split[3];\n\t\t\t\t$item['visiting_team_score'] = trim($item_result_split[4], '()');\n\t\t\t\t$item['home_team'] = $item_result_split[8];\n\t\t\t\t$item['home_team_score'] = trim($item_result_split[9], '()');\n\t\t\t\t$item['overtime'] = $item_result_split[10];\n\t\t\t\t \n\t\t\t\t$item_date = $match->find('td.date .skedStartDateSite', 0)->plaintext;\n\t\t\t\t$item['date'] = date(\"Y-m-d\", strtotime($item_date));\n\t\t\t\t \n\t\t\t\t//No need for retrieve teams directly, because we need to analyze result string above, and retrieve more information.\n\t\t\t\t//$item['visiting_team'] = $match->find('td.team', 0)->plaintext;\n\t\t\t\t//$item['home_team'] = $match->find('td.team', 1)->plaintext;\n\t\t\t\t \n\t\t\t\t//Read out the link to the \"Recap\" article.\n\t\t\t\t$item['recap'] = $match->find('td.skedLinks a', 0)->href;\n\t\t\t\t \n\t\t\t\t$games_list[] = $item;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t}\n\t\n\treturn $games_list;\n\n}", "function AddResults($rid){\n\t\n\tglobal $db_league_leagues,$db_league_seasons_rounds,$db_league_seasons,$db_clan_games,$db_league_seasons_round_allowed_players;\n\tglobal $db_admin,$db_admin_contact,$db_country,$db_league_seasons_rounds_results_players,$db_league_teams;\n\tglobal $url_flags;\n\t\n \t// CHECK PRIVILEGIES\n\tif ($_GET['action'] == \"results_add\" || $_GET['action'] == \"results_show\"){\n\t\tif (CheckPriv(\"groups_league_season_add\") <> 1) { echo _NOTENOUGHPRIV;exit;}\n\t} else {\n\t\techo _NOTENOUGHPRIV;exit;\n\t}\n\t\n\t$res_rounds = mysql_query(\"SELECT a.admin_nick, lt.league_team_name, lsrrp.league_season_round_result_player_points, lsrap.league_season_round_allowed_player_guid, lsrrp.league_season_round_result_player_player_id, c.country_shortname,c.country_name \n\tFROM $db_league_seasons_rounds_results_players AS lsrrp \n\tJOIN $db_league_seasons_round_allowed_players AS lsrap ON lsrap.league_season_round_allowed_player_player_id=lsrrp.league_season_round_result_player_player_id AND lsrap.league_season_round_allowed_player_season_round_id=\".(float)$rid.\" \n\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\tLEFT JOIN $db_admin_contact AS ac ON ac.aid=a.admin_id \n\tLEFT JOIN $db_country AS c ON c.country_id=ac.admin_contact_country \n\tWHERE lsrrp.league_season_round_result_player_round_id=\".(float)$rid.\" \n\tORDER BY lsrrp.league_season_round_result_player_place ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$nick = \"\";\n\t\t\t$team = \"\";\n\t\t\t$table_width = \"857\";\n\t\t\t\n\t\t\techo Menu();\n\t\t\t\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$res_round = mysql_query(\"SELECT lsr.league_season_round_id, lsr.league_season_round_classified, lsr.league_season_round_season_id, lsr.league_season_round_date, lsr.league_season_round_num, l.league_league_id, l.league_league_name, ls.league_season_name \n\t\t\tFROM $db_league_seasons_rounds AS lsr \n\t\t\tJOIN $db_league_seasons AS ls ON ls.league_season_id=lsr.league_season_round_season_id \n\t\t\tJOIN $db_league_leagues AS l ON l.league_league_id=ls.league_season_league_id \n\t\t\tWHERE lsr.league_season_round_id=\".(float)$rid) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$flag = \"\t\t<td width=\\\"20\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._CMN_COUNTRY.\"</td>\\n\";\n\t\t\t$nick = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t\t$team = \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\t$table_width = \"600\";\n\t\tbreak;\n\t\tdefault:\n\t\t\techo \"\";\n\t}\n\t$ar_round = mysql_fetch_array($res_round);\n\t$league_name = stripslashes($ar_round['league_league_name']);\n\t$season_id = $ar_round['league_season_round_season_id'];\n\t$season_name = stripslashes($ar_round['league_season_name']);\n\t$round_num = $ar_round['league_season_round_num'];\n\t\n\techo \"<table width=\\\"\".$table_width.\"\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\techo \"\t<tr>\\n\";\n\techo \"\t\t<td colspan=\\\"3\\\" align=\\\"left\\\">\";\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<h5 style=\\\"margin:20px 0px 0px 0px;\\\">\".$league_name.\" > <a href=\\\"modul_league.php?action=rounds&sid=\".$season_id.\"&project=\".$_SESSION['project'].\"\\\" target=\\\"_self\\\">\".$season_name.\"</a> > \"._LEAGUE_SEASON_ROUND.\" \".$round_num.\"</h5>\";}\n\t\t\t\t\tif ($_GET['action'] == \"results_add\"){echo \"<form action=\\\"sys_save.php?action=results_add&rid=\".$rid.\"sid=\".$season_id.\"\\\" method=\\\"post\\\" enctype=\\\"multipart/form-data\\\">\";}\n\techo \"\t\t</td>\\n\";\n\techo \"\t</tr>\\n\";\n\techo \"\t<tr style=\\\"background-color:#dce3f1;\\\">\\n\";\n\techo \"\t\t<td width=\\\"50\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POSITION.\"</td>\\n\";\n\techo \"\t\t<td align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_POINTS.\"</td>\\n\";\n\techo $flag;\n\techo $nick;\n\techo \"\t\t<td width=\\\"200\\\" align=\\\"left\\\" class=\\\"eden_title\\\">\"._LEAGUE_SEASON_ROUND_GUID.\"</td>\\n\";\n\techo $team;\n\techo \"\t</tr>\\n\";\n\tswitch ($_GET['action']){\n\t\tcase \"results_add\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_round['league_season_round_classified'] >= $i){\n\t\t\t\t$ar_rounds = mysql_fetch_array($res_rounds);\n\t\t\t\tif ($ar_rounds['league_season_round_result_player_player_id']){ $guid = $ar_rounds['league_season_round_allowed_player_guid'].\" (PID \".$ar_rounds['league_season_round_result_player_player_id'].\")\";} else {$guid =\"\";}\n\t\t\t\techo \"<tr align=\\\"left\\\" valign=\\\"top\\\" onmouseover=\\\"this.style.backgroundColor='FFDEDF'\\\" onmouseout=\\\"this.style.backgroundColor='FFFFFF'\\\" style=\\\"background-color: #FFFFFF;\\\">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_num\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"round_player_data[\".$i.\"_place]\\\" value=\\\"\".$i.\"\\\">\";\n\t\t\t\techo \"\t\t\".$i.\"\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input name=\\\"round_player_data[\".$i.\"_points]\\\" size=\\\"5\\\" value=\\\"\".$ar_rounds['league_season_round_result_player_points'].\"\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\";\n\t\t\t\techo \"\t\t<input type=\\\"text\\\" name=\\\"round_player_data[\".$i.\"_player_guid]\\\" size=\\\"25\\\" value=\\\"\".$guid.\"\\\" autocomplete=\\\"off\\\" onkeyup=\\\"ajax_showOptions(this,'getAllowedPlayerGuidByLetters=1&rid=\".$rid.\"&project=\".$_SESSION['project'].\"',event)\\\">\";\n\t\t\t\techo \"\t</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\techo \"\t<tr align=\\\"left\\\" valign=\\\"top\\\">\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" colspan=\\\"3\\\"><br />\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"round\\\" value=\\\"\".$round_num.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"rid\\\" value=\\\"\".$rid.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"sid\\\" value=\\\"\".$season_id.\"\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"submit\\\" value=\\\"\"._LEAGUE_SEASON_ROUND_RESULTS_SAVE.\"\\\" class=\\\"eden_button\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"confirm\\\" value=\\\"true\\\">\\n\";\n\t\t\techo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$_SESSION['project'].\"\\\">\\n\";\n\t\t \tif ($ar_rounds){echo \"\t\t\t<input type=\\\"hidden\\\" name=\\\"results_mode\\\" value=\\\"edit\\\">\\n\";}\n\t\t\techo \"\t\t\t</form>\\n\";\n\t\t\techo \"\t\t</td>\\n\";\n\t\t\techo \"\t</tr>\\n\";\n\t\tbreak;\n\t\tcase \"results_show\":\n\t\t\t$i=1;\n\t\t\twhile ($ar_rounds = mysql_fetch_array($res_rounds)){\n\t\t\t\techo \"\t<tr \"; if ($i % 2 == 0){echo \"class=\\\"suda\\\"\";} else {echo \"class=\\\"licha\\\"\";} echo \">\\n\";\n\t\t\t\techo \"\t<td width=\\\"50\\\" align=\\\"right\\\" valign=\\\"middle\\\">\".$i.\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_season_round_result_player_points'].\"</td>\\n\";\n\t \t\t\techo \"\t<td valign=\\\"top\\\"><img src=\\\"\".$url_flags.$ar_rounds['country_shortname'].\".gif\\\" alt=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" title=\\\"\".stripslashes($ar_rounds['country_name']).\"\\\" /></td>\";\n\t \t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['admin_nick'].\"</td>\\n\";\n\t\t\t\techo \"\t<td width=\\\"200\\\" align=\\\"left\\\">\".$ar_rounds['league_season_round_allowed_player_guid'].\"</td>\\n\";\n\t\t\t\techo \"\t<td align=\\\"left\\\">\".$ar_rounds['league_team_name'].\"</td>\\n\";\n\t\t\t\techo \"</tr>\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\tbreak;\n\t\tdefault;\n\t\t\techo \"\";\n\t}\n\techo \"</table>\\n\";\n}", "function perd_load_scores_semester( $appGlobals, $classDate=NULL, $kidPeriodId=NULL, $gameType=NULL, $periodId=NULL,$mode='u') {\n}", "function get_standing_driver_db($idSeason)\n{\n require('./model/connect_db.php');\n $sql = \"select p.idPilot, p.namePilot, p.pilotNumber, t.idTeam, t.nameTeam, sum(r.Points) as points from pilot p, team t, race r, season s where r.idPilot = p.idpilot and p.idteam = t.idTeam and s.idseason = '%d' and s.idseason = r.idseason group by p.namepilot order by points desc \";\n $request = sprintf($sql,$idSeason);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $standing = array();\n while($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $standing[] = $line;\n }\n return $standing;\n}", "function ShowTeamShowPlayers($team_id,$team_sub_id,$game_id,$mode = 1,$allowed_player_id = 0){\n\t\n\tglobal $db_league_players,$db_admin,$db_admin_guids,$db_clan_games;\n\t\n\tif ($mode == 2){\n\t\t$admin_guids = \"\";\n\t\t$sub_team = \"\";\n\t} else {\n\t\t$res_game = mysql_query(\"SELECT clan_games_game FROM $db_clan_games WHERE clan_games_id = \".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t$ar_game = mysql_fetch_array($res_game);\n\t\t$sub_team = \"<tr style=\\\"background: #DCE3F1;\\\">\\n\";\n\t\t$sub_team .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">Sub Team - \".$ar_game['clan_games_game'].\"</td>\\n\";\n\t \t$sub_team .= \"</tr>\\n\";\n\t}\n\t$output = $sub_team;\n\t$res_player = mysql_query(\"\n\tSELECT a.admin_id, a.admin_nick, a.admin_team_own_id, ag.admin_guid_guid, lp.league_player_id, lp.league_player_position_captain, lp.league_player_position_assistant, lp.league_player_position_player \n\tFROM $db_league_players AS lp \n\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\tLEFT JOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_game_id=\".(integer)$game_id.\" \n\tWHERE lp.league_player_team_id=\".(integer)$team_id.\" AND lp.league_player_game_id=\".(integer)$game_id) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$num = mysql_num_rows($res_player);\n\t$output .= \"<tr style=\\\"background: #ff8080;\\\">\\n\";\n\tif ($num > 0){\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\" class=\\\"eden_title_middle\\\">ID</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_PLAYER_POSITION.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title_middle\\\"></td>\\n\";\n\t} else {\n\t\t$output .= \"\t<td colspan=\\\"5\\\" class=\\\"eden_title_middle\\\">\"._LEAGUE_TEAM_NO_PLAYER_IN_SUB.\"</td>\\n\";\n\t}\n\t$output .= \"</tr>\\n\";\n\t$cislo = 0;\n\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level2_even\";} else { $cat_class = \"cat_level2_odd\";}\n\t\t$output .= \"<tr class=\\\"\".$cat_class.\"\\\">\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t$output .= \"\t<td width=\\\"120\\\" valign=\\\"middle\\\">\";\n\t\t\t\t\t\tif ($mode == 2){\n\t\t\t\t\t\t\t$output .= \"<img src=\\\"./images/sys_\"; \n\t\t\t\t\t\t\tif (in_array($ar_player['league_player_id'],$allowed_player_id)){\n\t\t\t\t\t\t\t\t$output .= \"yes\"; $alt = _LEAGUE_PLAYER_PLAY;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$output .= \"no\"; $alt = _LEAGUE_PLAYER_NO_PLAY;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t$output .= \".gif\\\" width=\\\"15\\\" height=\\\"15\\\" alt=\\\"\".$alt.\"\\\" title=\\\"\".$alt.\"\\\"> \"; \n\t\t\t\t\t\t} \n\t\t\t\t\t\t$output .= \"<strong>\".stripslashes($ar_player['admin_nick']).\"</strong>\";\n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; \n\t\t\t\t\tif (LeagueCheckPrivileges(\"O\",$ar_player['admin_id'],$team_id,\"\") == $team_id){$output .= _LEAGUE_PLAYER_POSITION_O; $comma = \", \";} else {$comma = \"\";}\n\t\t\t\t\tif (LeagueCheckPrivileges(\"C\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_C;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"A\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_A;} \n\t\t\t\t\tif (LeagueCheckPrivileges(\"P\",$ar_player['admin_id'],$team_id,$team_sub_id) == 1){$output .= $comma._LEAGUE_PLAYER_POSITION_P;} \n\t\t$output .= \"\t</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if ($ar_player['admin_guid_guid'] != \"\"){ $output .= stripslashes($ar_player['admin_guid_guid']);} else {$output .= \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} $output .= \"</td>\\n\";\n\t\t$output .= \"\t<td align=\\\"left\\\" valign=\\\"top\\\"></td>\\n\";\n\t\t$output .= \"</tr>\\n\";\n\t\t$cislo++;\n\t}\n\t\n\treturn $output;\n}", "public function index($season)\n {\n return Team::all('id', 'name', 'location', 'stadium', 'season');\n }", "public function getStatistics($seasonId)\n {\n $query = \"SELECT IPLAYER.id, IPLAYER.voornaam AS firstname, IPLAYER.naam AS name, \n ISPS.gespeelde_sets AS setsPlayed, ISPS.gewonnen_sets AS setsWon, ISPS.gespeelde_punten AS pointsPlayed,\n ISPS.gewonnen_punten AS pointsWon, ISPS.gespeelde_matchen as matchesPlayed, ISPS.gewonnen_matchen AS matchesWon,\n ISPS.speeldagen_aanwezig AS roundsPresent\n FROM intra_spelers IPLAYER\n INNER JOIN intra_spelerperseizoen ISPS ON ISPS.speler_id = IPLAYER.Id\n WHERE ISPS.seizoen_id = ? AND IPLAYER.is_lid = 1\n ORDER BY ISPS.speeldagen_aanwezig desc, ISPS.gewonnen_matchen desc, ISPS.basispunten desc\";\n $stmt = $this->db->prepare($query);\n $stmt->execute([$seasonId]);\n return $stmt->fetchAll();\n }", "function ListAllowedPlayers(){\n\t\n\tglobal $db_admin,$db_admin_guids,$db_league_teams,$db_league_teams_sub,$db_league_teams_sub_leagues,$db_league_leagues,$db_league_players,$db_clan_games,$db_league_seasons_round_allowed_players;\n\t\n\tif ($_GET['mode'] != \"league\"){\n\t\t\n\t\techo Menu();\n\t\t\n\t\tKillUse($_SESSION['loginid']);\n\t}\n\techo \"<table width=\\\"857\\\" cellspacing=\\\"2\\\" cellpadding=\\\"1\\\" class=\\\"eden_main_table\\\">\\n\";\n\tif ($_GET['lid'] == 0){\n\t\techo \"\t<tr>\\n\";\n\t\techo \"\t\t<td>\"._LEAGUE_NO_LEAGUE_ID.\"</td>\\n\";\n \t\techo \"\t</tr>\\n\";\n\t} else {\n\t\techo \"\t<tr>\\n\";\n\t\tif ($_GET['show'] != \"id\" && $_GET['show'] != \"season_players_all_guid\"){\n\t\t\techo \"\t\t<td width=\\\"30\\\" valign=\\\"middle\\\" class=\\\"eden_title\\\">ID</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_TEAM.\"</td>\\n\";\n\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_PLAYER_NICK.\"</td>\\n\";\n\t\t}\n\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\" class=\\\"eden_title\\\">\"._LEAGUE_GUID.\"</td>\\n\";\n\t\techo \"\t</tr>\\n\";\n\t\t//$msg = LeagueGenerateListAllowedPlayers((float)$_GET['lid'],(float)$_GET['sid'],(float)$_GET['rid']);\n\t\tswitch ($_GET['show']){\n\t \t\tcase \"id\":\n\t \t\t\t$colspan = 1;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players \n\t\t\t\tWHERE league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY league_season_round_allowed_player_guid\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t \t\tbreak;\n\t\t\tcase \"season_players_all\":\n\t\t\t\t$colspan = 4;\n\t \t\tbreak;\n\t\t\tcase \"season_players_all_guid\":\n\t \t\t\t$colspan = 1;\n\t \t\tbreak;\n\t\t\tdefault:\n\t \t\t\t$colspan = 4;\n\t\t\t\t$res_round = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, lt.league_team_id, lt.league_team_name, ll.league_league_id, ll.league_league_game_id, lsrap.league_season_round_allowed_player_guid \n\t\t\t\tFROM $db_league_seasons_round_allowed_players AS lsrap \n\t\t\t\tJOIN $db_league_leagues AS ll ON ll.league_league_id=lsrap.league_season_round_allowed_player_league_id \n\t\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=lsrap.league_season_round_allowed_player_team_id \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lsrap.league_season_round_allowed_player_admin_id \n\t\t\t\tWHERE lsrap.league_season_round_allowed_player_season_round_id=\".(float)$_GET['rid'].\" \n\t\t\t\tORDER BY lsrap.league_season_round_allowed_player_team_sub_id ASC, a.admin_nick ASC\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$_GET['show'] = \"all\";\n\t\t}\n\t\t\n\t\t$cislo = 0;\n\t\t// pro zobrazeni povolenych hracu\n\t\tif ($_GET['show'] == \"id\" || $_GET['show'] == \"all\"){\n\t\t\twhile ($ar_round = mysql_fetch_array($res_round)){\n\t\t\t\tif ($cislo % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\tif ($_GET['show'] != \"id\"){\n\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_round['admin_id'].\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_round['league_team_name']).\"</td>\\n\";\n\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_round['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t}\n\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\"; if (empty($ar_round['league_season_round_allowed_player_guid'])){echo \"<span class=\\\"red\\\">\"._LEAGUE_PLAYER_NO_GUID.\"</span>\";} else {echo stripslashes($ar_round['league_season_round_allowed_player_guid']);} echo \"</td>\\n\";\n\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t$cislo++;\n\t\t\t}\n\t\t\tunset($ar_round);\n\t\t}\n\t\t// pro zobrazeni vsech hracu\n\t\tif ($_GET['show'] == \"season_players_all\" || $_GET['show'] == \"season_players_all_guid\"){\n\t\t\t$res_team = mysql_query(\"\n\t\t\tSELECT lt.league_team_id, lt.league_team_name, ltsl.league_teams_sub_league_team_sub_id, ltsl.league_teams_sub_league_league_id \n\t\t\tFROM $db_league_teams_sub_leagues AS ltsl \n\t\t\tJOIN $db_league_teams AS lt ON lt.league_team_id=ltsl.league_teams_sub_league_team_id \n\t\t\tWHERE ltsl.league_teams_sub_league_league_id=\".(integer)$_GET['lid']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\twhile ($ar_team = mysql_fetch_array($res_team)){\n\t\t\t\t$res_player = mysql_query(\"\n\t\t\t\tSELECT a.admin_id, a.admin_nick, ag.admin_guid_guid, lp.league_player_id \n\t\t\t\tFROM $db_league_players AS lp \n\t\t\t\tJOIN $db_admin AS a ON a.admin_id=lp.league_player_admin_id \n\t\t\t\tJOIN $db_admin_guids AS ag ON ag.aid=lp.league_player_admin_id AND ag.admin_guid_league_guid_id=\".(integer)$ar_team['league_teams_sub_league_league_id'].\" AND ag.admin_guid_guid != '' \n\t\t\t\tWHERE lp.league_player_team_sub_id=\".(integer)$ar_team['league_teams_sub_league_team_sub_id']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$i=1;\n\t\t\t\twhile ($ar_player = mysql_fetch_array($res_player)){\n\t\t\t\t\tif ($i % 2 == 0){ $cat_class = \"cat_level1_even\";} else { $cat_class = \"cat_level1_odd\";}\n\t\t\t\t\techo \"<tr class=\\\"\".$cat_class.\"\\\" onmouseover=\\\"this.className='cat_over'\\\" onmouseout=\\\"this.className='\".$cat_class.\"'\\\">\\n\";\n\t\t\t\t\tif ($_GET['show'] != \"season_players_all_guid\"){\n\t\t\t\t\t\techo \"\t\t<td width=\\\"30\\\" align=\\\"right\\\" valign=\\\"top\\\">\".$ar_player['admin_id'].\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td width=\\\"150\\\" align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_team['league_team_name']).\"</td>\\n\";\n\t\t\t\t \t\techo \"\t\t<td valign=\\\"middle\\\"><strong>\".stripslashes($ar_player['admin_nick']).\"</strong></td>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\t\t<td align=\\\"left\\\" valign=\\\"top\\\">\".stripslashes($ar_player['admin_guid_guid']).\"</td>\\n\";\n\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\techo \"</table>\\n\";\n}", "public function getSeasonSelect()\n\t{\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n\t\t$options = array(JHTML::_('select.option', 0, JText::_($this->getParam('seasons_text'))));\n \n $query->select('s.id AS value, s.name AS text');\n $query->from('#__sportsmanagement_season AS s');\n $query->where('s.published = 1');\n $query->order('s.name DESC');\n\n \n\t\t$db->setQuery($query);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t$res = $db->loadObjectList();\n\t\tif ($res) {\n\t\t\t$options = array_merge($options, $res);\n\t\t}\n\t\t//return JHTML::_('select.genericlist', $options, 's', 'class=\"jlajaxmenu-select\" onchange=\"jlamnewproject('.$module->id.');\"', 'value', 'text', $this->getSeasonId());\n\t\treturn $options;\n\t}", "function get_seasons($idDiscipline)\n{\n require('./model/connect_db.php');\n $sql = \"select s.idSeason,s.year from Season s where s.idDiscipline ='%d'\";\n $request = sprintf($sql,$idDiscipline);\n $result = mysqli_query($link,$request) or die (utf8_encode(\"request error\") . $request);\n\n $season= array();\n while ($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $season[] = $line;\n }\n return $season;\n\n}", "public function get_seasons()\n\t\t{\n\t\t\t/*\n\t\t\treturn $this->get_seasonteams();\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->execute();\n\t\t\t//print_r($objs);\n\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$season = ORM::factory('Sportorg_Seasons_Base',$obj['season_id']);\n\t\t\t\t$retArr[] = $season->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t\t*/\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->execute();\n\t\t\t//print_r($objs);\n\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$season = ORM::factory('Sportorg_Seasons_Base',$obj['season_id']);\n\t\t\t\t$retArr[] = $season->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}", "function galaxy_show_ranking_player() {\n\tglobal $db;\n\tglobal $pub_order_by, $pub_date, $pub_interval;\n\n\tif (!isset($pub_order_by)) {\n\t\t$pub_order_by = \"general\";\n\t}\n\tif ($pub_order_by != \"general\" && $pub_order_by != \"fleet\" && $pub_order_by != \"research\") {\n\t\t$pub_order_by = \"general\";\n\t}\n\n\tif (!isset($pub_interval)) {\n\t\t$pub_interval = 1;\n\t}\n\tif (($pub_interval-1)%100 != 0 || $pub_interval > 1401) {\n\t\t$pub_interval = 1;\n\t}\n\t$limit_down = $pub_interval;\n\t$limit_up = $pub_interval + 99;\n\n\t$order = array();\n\t$ranking = array();\n\t$ranking_available = array();\n\n\tswitch ($pub_order_by) {\n\t\tcase \"general\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\tbreak;\n\t\tcase \"fleet\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\tbreak;\n\t\tcase \"research\":\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_RESEARCH, \"arrayname\" => \"research\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_POINTS, \"arrayname\" => \"general\");\n\t\t$table[] = array(\"tablename\" => TABLE_RANK_PLAYER_FLEET, \"arrayname\" => \"fleet\");\n\t\tbreak;\n\t}\n\t$i=0;\n\n\tif (!isset($pub_date)) {\n\t\t$request = \"select max(datadate) from \".$table[$i][\"tablename\"];\n\t\t$result = $db->sql_query($request);\n\t\tlist($last_ranking) = $db->sql_fetch_row($result);\n\t}\n\telse $last_ranking = $pub_date;\n\n\t$request = \"select rank, player, ally, points, username\";\n\t$request .= \" from \".$table[$i][\"tablename\"].\" left join \".TABLE_USER;\n\t$request .= \" on sender_id = user_id\";\n\t$request .= \" where rank between \".$limit_down.\" and \".$limit_up;\n\t$request .= isset($last_ranking) ? \" and datadate = \".mysql_real_escape_string($last_ranking) : \"\";\n\t$request .= \" order by rank\";\n\t$result = $db->sql_query($request);\n\n\twhile (list($rank, $player, $ally, $points, $username) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$player][$table[$i][\"arrayname\"]] = array(\"rank\" => $rank, \"points\" => $points);\n\t\t$ranking[$player][\"ally\"] = $ally;\n\t\t$ranking[$player][\"sender\"] = $username;\n\n\t\tif ($pub_order_by == $table[$i][\"arrayname\"]) {\n\t\t\t$order[$rank] = $player;\n\t\t}\n\t}\n\n\t$request = \"select distinct datadate from \".$table[$i][\"tablename\"].\" order by datadate desc\";\n\t$result_2 = $db->sql_query($request);\n\twhile ($row = $db->sql_fetch_assoc($result_2)) {\n\t\t$ranking_available[] = $row[\"datadate\"];\n\t}\n\n\tfor ($i ; $i<3 ; $i++) {\n\t\treset($ranking);\n\t\twhile ($value = current($ranking)) {\n\t\t\t$request = \"select rank, player, ally, points, username\";\n\t\t\t$request .= \" from \".$table[$i][\"tablename\"].\" left join \".TABLE_USER;\n\t\t\t$request .= \" on sender_id = user_id\";\n\t\t\t$request .= \" where player = '\".mysql_real_escape_string(key($ranking)).\"'\";\n\t\t\t$request .= isset($last_ranking) ? \" and datadate = \".mysql_real_escape_string($last_ranking) : \"\";\n\t\t\t$request .= \" order by rank\";\n\t\t\t$result = $db->sql_query($request);\n\n\t\t\twhile (list($rank, $player, $ally, $points, $username) = $db->sql_fetch_row($result)) {\n\t\t\t\t$ranking[$player][$table[$i][\"arrayname\"]] = array(\"rank\" => $rank, \"points\" => $points);\n\t\t\t\t$ranking[$player][\"ally\"] = $ally;\n\t\t\t\t$ranking[$player][\"sender\"] = $username;\n\n\t\t\t\tif ($pub_order_by == $table[$i][\"arrayname\"]) {\n\t\t\t\t\t$order[$rank] = $player;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnext($ranking);\n\t\t}\n\t}\n\n\t$ranking_available = array_unique($ranking_available);\n\n\treturn array($order, $ranking, $ranking_available);\n}", "function ShowInfoPlayers($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idPlace, PondFishesPlace, FishedFishesPlace, ReleasedFishesPlace, OrderPlace, PseudoPlayer, RankingPlayer, DescriptionStatus FROM fishermenland.place\n INNER JOIN fishermenland.player ON place.fkPlayerPlace = player.idPlayer\n INNER JOIN fishermenland.status ON place.fkStatusPlace = status.idStatus WHERE fkGamePlace = '$idGame' ORDER BY OrderPlace ASC\");\n\n return $req;\n}", "public function populateMatchStandings(){\n\t\t $team = new Application_Model_Mapper_Team();\n\t\t //cath all teams\n\t\t $teamList=$team->fetchAll();\n\t\t $prosGoal= null;\n\t\t $agaistGoal=null;\n\t\t if(count($teamList)>0){\n\t\t \t foreach($teamList as $row){\n\t\t \t \t //begin team statistics by 0\n\t\t \t \t $row->setWins(0);\n\t\t \t \t $row->setLosses(0);\n\t\t \t \t $row->setPoints(0);\n\t\t \t \t $row->setDraws(0);\n\t\t \t \t //catch all matches by team\n\t\t $championship = $this->seachMatchByTeam($row->getId());\n\t\t foreach ($championship as $match) {\n\t\t //if a team is a visitor team goals of visitor team it is\n\t\t \t $prosGoal=$match['goalVisitorTeam'];\n\t\t \t $agaistGoal=$match['goalHomeTeam'];\n\t\t \t //if a team is a home team goals of home team it is\n\t\t \t if($match['idHomeTeam']==$row->getId()){\n\t\t \t \t $prosGoal=$match['goalHomeTeam'];\n\t\t \t \t $agaistGoal=$match['goalVisitorTeam'];\n\t\t \t }\n\t\t \t //if team win\n\t\t \t if($agaistGoal<$prosGoal){\n\t\t \t \t$row->setWins($row->getWins()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+3);\n\t\t \t }//if team lost\n\t\t \t elseif($agaistGoal>$prosGoal){\n\t\t \t \t$row->setLosses($row->getLosses()+1);\n\t\t \t }//if team draw\n\t\t \t else{\n\t\t \t \t$row->setDraws($row->getDraws()+1);\n\t\t \t \t$row->setPoints($row->getPoints()+1);\n\t\t \t }\n\t\t }\n\t\t //update table team\n\t\t $team->updateTeam($row);\n\t\t \t }\n\t\t }\n\t}", "private function loopThroughSeason($driver, $constructor, $resultSeason, $seasonRounds, $circuitId, $resultsDriver, $resultsConstructor, $categorie) {\n // Checking the categorie, 1 and 3 are driver categories\n if ($categorie == 1 || $categorie == 3) {\n if (!empty($resultsDriver)) {\n unset($resultsDriver);\n\n $resultsDriver = array();\n }\n\n // Looping through all the races\n for ($i=0; $i < $seasonRounds; $i++) { \n $driverResults = array();\n $result = false;\n\n if ($resultSeason[$i]->getSeason() == $this->currentYear) {\n // In the current year we take every race in account\n $resultsRace = $resultSeason[$i]->getResults();\n $raceSeason = $resultSeason[$i]->getSeason();\n\n // Looping through the resutls\n $driverResults = $this->loopThroughRace($driver, $constructor, $resultsRace, 0, $circuitId, $this->multiplier, $resultsDriver, true, $raceSeason, $categorie);\n \n $result = true;\n } \n if ($resultSeason[$i]->getCircuit()->getCircuitId() == $circuitId && $this->currentYear != $resultSeason[$i]->getSeason()) {\n // Else only where the circuit is equal to where is raced\n $resultsRace = $resultSeason[$i]->getResults();\n $raceSeason = $resultSeason[$i]->getSeason();\n\n // Looping through the resutls\n $driverResults = $this->loopThroughRace($driver, $constructor, $resultsRace, 0, $circuitId, $this->multiplier, $resultsDriver, false, $raceSeason, $categorie);\n \n $result = true;\n }\n\n // Checking if result was found\n if ($result) {\n // Checking if it is the current season if so, return right away\n if ($this->currentYear != $resultSeason[$i]->getSeason()) {\n // Pushing the results to the array\n array_push($resultsDriver, $driverResults);\n\n // Returning the filled array\n return $resultsDriver;\n } else {\n // Pushing the results to the array\n array_push($resultsDriver, $driverResults);\n }\n }\n }\n\n // Returning the filled array\n return $resultsDriver;\n } else {\n // Checking if the constructor results are filled\n if (!empty($constructorResults)) {\n unset($constructorResults);\n\n $constructorResults = array();\n }\n\n // Looping through all the races\n for ($i=0; $i < $seasonRounds; $i++) { \n $constructorResults = array();\n $result = false;\n\n if ($resultSeason[$i]->getSeason() == $this->currentYear) {\n // In the current year we take every race in account\n $resultsRace = $resultSeason[$i]->getResults();\n $raceSeason = $resultSeason[$i]->getSeason();\n\n // Looping through the resutls\n $constructorResults = $this->loopThroughRace($driver, $constructor, $resultsRace, 0, $circuitId, $this->multiplier, $resultsDriver, true, $raceSeason, $categorie);\n \n $result = true;\n } \n if ($resultSeason[$i]->getCircuit()->getCircuitId() == $circuitId && $this->currentYear != $resultSeason[$i]->getSeason()) {\n // Else only where the circuit is equal to where is raced\n $resultsRace = $resultSeason[$i]->getResults();\n $raceSeason = $resultSeason[$i]->getSeason();\n\n // Looping through the resutls\n $constructorResults = $this->loopThroughRace($driver, $constructor, $resultsRace, 0, $circuitId, $this->multiplier, $resultsDriver, false, $raceSeason, $categorie);\n \n $result = true;\n }\n\n // Checking if result was found\n if ($result) {\n // Checking if it is the current season if so, return right away\n if ($this->currentYear != $resultSeason[$i]->getSeason()) {\n // Pushing the results to the array\n array_push($resultsConstructor, $constructorResults);\n\n // Returning the filled array\n return $resultsConstructor;\n } else {\n // Pushing the results to the array\n array_push($resultsConstructor, $constructorResults);\n }\n }\n }\n\n // Returning the filled array\n return $resultsConstructor;\n }\n }", "public function show(Season $season)\n {\n //\n }", "public function show(Season $season)\n {\n //\n }", "function get_standing_team($idSeason)\n{\n $table_standing = get_standing_team_db($idSeason);\n return $table_standing;\n}", "function getPlayinTeams(){\n return array(\n //winner to [25]\n array('name'=>'UCLA','elo'=>1542,'off'=>114.1,'def'=>96.8,'tempo'=>64.7),\n array('name'=>'Michigan State','elo'=>1596,'off'=>107.7,'def'=>92.2,'tempo'=>68.6),\n //winner to [17]\n array('name'=>'Texas Southern','elo'=>1395,'off'=>99.7,'def'=>104.3,'tempo'=>72.0),\n array('name'=>'Mt. St Marys','elo'=>1278,'off'=>96.1,'def'=>99.7,'tempo'=>62.2),\n //winner to [9]\n array('name'=>'Drake','elo'=>1540,'off'=>114.6,'def'=>98.6,'tempo'=>66.8),\n array('name'=>'Wichita State','elo'=>1592,'off'=>110.7,'def'=>97.7,'tempo'=>67.6),\n //winner to [1]\n array('name'=>'Appalachian State','elo'=>1378,'off'=>100.1,'def'=>103.0,'tempo'=>65.7),\n array('name'=>'Norfolk St','elo'=>1310,'off'=>101.3,'def'=>103.6,'tempo'=>67.7),\n );\n}", "public function getSeason(){\n if ($this->season == NULL){\n $rss = selectQueryGetAll($this->dsseason->select_query());\n $this->season = $this->dsseason->rdisplay($rss[0]['KOID']);\n }\n return $this->season;\n }", "function listTeams() {\n global $oDbHelper;\n\n $sQuery = \"SELECT * FROM team WHERE competition_id = \" . COMPETITION_ID;\n $oResult = $oDbHelper->executeQuery($sQuery);\n $oDbHelper->printDbResult($oResult);\n}", "function fantacalcio_get_titolari_riserve_fisse($pl_votes, $competition_round, $c_id) {\n $sql = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.has_played = 0 \" .\n \"AND f.position = 1 \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d'\";\n $result = db_query($sql, $competition_round, $c_id);\n while ($row = db_fetch_array($result)) {\n\n $role = $row['role'];\n $t_id = $row['t_id'];\n \n #1a riserva dello stesso ruolo\n $sqla = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.position = 2 \" .\n \"AND f.has_played = 0 \" .\n \"AND p.role = '%d' \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d' \" .\n \"AND f.t_id = '%d' \";\n $resulta = db_query($sqla, $role, $competition_round, $c_id, $t_id);\n\n if (db_affected_rows($resulta) > 0) {\n\n while ($rowa = db_fetch_array($resulta)) {\n $pl_id = $rowa['pl_id'];\n \n #se con il voto entra la prima riserva\n if (in_array($pl_id, $pl_votes)) {\n $sqlb = \"UPDATE {fanta_lineups} set has_played = 1 \" .\n \"WHERE pl_id = '%d' \" .\n \"AND t_id = '%d' \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\";\n $resultb = db_query($sqlb, $pl_id, $t_id, $c_id, $competition_round);\n }\n #se senza voto cerco la seconda riserva\n else {\n $sqlb = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.position = 3 \" .\n \"AND f.has_played = 0 \" .\n \"AND p.role = '%d' \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d' \" .\n \"AND f.t_id = '%d' \";\n $resultb = db_query($sqlb, $role, $competition_round, $c_id, $t_id);\n while ($rowb = db_fetch_array($resultb)) {\n $pl_id = $rowb['pl_id'];\n if (in_array($pl_id, $pl_votes)) {\n $sqlc = \"UPDATE {fanta_lineups} set has_played = 1 \" .\n \"WHERE pl_id = '%d' \" .\n \"AND t_id = '%d' \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\";\n $resultc = db_query($sqlc, $pl_id, $t_id, $c_id, $competition_round);\n }\n }\n }\n }\n }\n\n #nessuna prima riserva ancora non entrata\n else {\n $sqlb = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.position = 3 \" .\n \"AND f.has_played = 0 \" .\n \"AND p.role = '%d' \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d' \" .\n \"AND f.t_id = '%d' \";\n $resultb = db_query($sqlb, $role, $competition_round, $c_id, $t_id);\n while ($rowb = db_fetch_array($resultb)) {\n $pl_id = $rowb['pl_id'];\n if (in_array($pl_id, $pl_votes)) {\n $sqlc = \"UPDATE {fanta_lineups} set has_played = 1 \" .\n \"WHERE pl_id = '%d' \" .\n \"AND t_id = '%d' \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\";\n $resultc = db_query($sqlc, $pl_id, $t_id, $c_id, $competition_round);\n }\n }\n }\n\n }\n}", "public function season()\n {\n $this->load->view('admin/header');\n $data['all_hotels'] = $this->hotelInfoModel->getHotelList();\n $data['seasons'] = $this->common_model->getAll('sett_season');\n $this->load->view('setting/season',$data);\n $this->load->view('admin/footer');\n }", "function divisions($sc2id) {\n\t\t\n\t\t$bnetprofile = ($sc2id);\n \t$html = file_get_contents($bnetprofile);\n \t\n \t$preg_fourvfour = preg_match_all(\n\t\t'/<div class=\"ladder\" data-tooltip=\"#best-team-4\">.*?<span class=\"(.*?)\">.*?<div class=\"tooltip-title\">Highest Ranked in 4v4<\\/div>.*?<strong>Division:<\\/strong> (.*?)<br \\/>.*?<strong>Rank:<\\/strong> (.*?)<\\/div>/s',\n\t\t$html,\n\t\t$games,\n\t\tPREG_SET_ORDER\n\t\t);\n\t\n\t\t\n\t\treturn $games;\n\t}", "function xstats_displayRanking( $gameId ) {\n include ('../../inc.conf.php');\n echo( \"<H3>Skrupel Rang nach Spielende</H3>\");\n $ranking = array();\n for($k=1; $k<=10; $k++) {\n $result = @mysql_query(\"SELECT * FROM skrupel_spiele WHERE id='$gameId'\") or die(mysql_error());\n $result = @mysql_fetch_array($result);\n $playerId = $result['spieler_'.$k];\n $playerRank = $result['spieler_'.$k.'_platz'];\n if($playerId != 0) {\n $ranking[] = '<tr><td>'.\n '<strong>'.$playerRank.'. </strong>'.\n '<img src=\"../../daten/'.$result['spieler_'.$k.'_rasse'].'/bilder_allgemein/menu.png\" height=\"18\" class=\"beveled\">'.\n ' <strong><font color=\"'.$spielerfarbe[$k].'\"> '.\n xstats_getPlayerNick($playerId).'</font></strong></td><td>als '.$result['spieler_'.$k.'_rassename'].\n ':</td><td align=\"center\">'.$result['spieler_'.$k.'_planeten'].'</td><td align=\"center\">'.\n $result['spieler_'.$k.'_schiffe'].'</td><td align=\"center\">'.\n $result['spieler_'.$k.'_basen'].'</td></tr>';\n }\n }\n natsort( $ranking );\n echo( '<table border=\"0\">');\n echo '<tr><td colspan=\"2\"><img src=\"../../lang/de/topics/dieimperien.gif\" width=\"140\"></td>';\n echo '<td><img src=\"../../bilder/aufbau/rang_2.gif\"></td>';\n echo '<td><img src=\"../../bilder/aufbau/rang_3.gif\"></td>';\n echo '<td><img src=\"../../bilder/aufbau/rang_1.gif\"></td>';\n echo '<td>';\n foreach( $ranking as $rankLine) {\n echo( $rankLine);\n }\n echo( '</table>');\n}", "public function getPlayersForMatchWithStatistics( $id_match, $id_season, $order_by = false )\n\t{\n\t\t$id_match\t= intval( $id_match );\n\t\t$id_season\t= intval( $id_season );\n\t\t$order_by\t= ( false === $order_by )? 'status_order, p4.position, num_times_rotated DESC' : $order_by;\n\n\t\t$query = <<<QUERY\nSELECT\n\tmp4.id_match,\n\tmp4.available,\n\tp4.id_player,\n\tp4.name,\n\tp4.position,\n\tp4.email,\n\tp4.sanitized_name,\n\tp4.middle_name,\n\tp4.image_url,\n\t(\n\t\tSELECT\n\t\t\tCOUNT( mp1.id_match ) AS num\n\t\tFROM\n\t\t\tmatches_player mp1\n\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\tWHERE\n\t\t\tp1.id_player = p4.id_player AND\n\t\t\tm2.id_season = $id_season AND\n\t\t\tm2.status = 'closed' AND\n\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\tm2.id_match != $id_match AND\n\t\t\tmp1.available = 'available'\n\t) AS num_times_rotated,\n\t(\n\t\t(\n\t\t\t1 * (\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT( mp1.id_match ) AS num\n\t\t\t\tFROM\n\t\t\t\t\tmatches_player mp1\n\t\t\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\t\t\tWHERE\n\t\t\t\t\tp1.id_player = p4.id_player AND\n\t\t\t\t\tm2.id_season = $id_season AND\n\t\t\t\t\tm2.status = 'closed' AND\n\t\t\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\tm2.id_match != $id_match AND\n\t\t\t\t\tmp1.available = 'available'\n\t\t\t)\n\t\t)\n\t\t- \n\t\t(\n\t\t\t(\n\t\t\t\t0.25 * (\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tCOUNT( m4.id_match ) AS num\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmatches m4\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tm4.id_season = $id_season AND\n\t\t\t\t\t\t\tm4.id_match != $id_match AND\n\t\t\t\t\t\t\tm4.status = 'closed' AND\n\t\t\t\t\t\t\tm4.type IN ( 'league', 'cup' )\n\t\t\t\t\t) - (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tCOUNT( mp3.id_match ) AS num\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmatches_player mp3\n\t\t\t\t\t\t\tINNER JOIN matches m5 USING ( id_match )\n\t\t\t\t\t\t\tINNER JOIN player p3 USING ( id_player )\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp3.id_player = p4.id_player AND\n\t\t\t\t\t\t\tm5.id_season = $id_season AND\n\t\t\t\t\t\t\tm5.status = 'closed' AND\n\t\t\t\t\t\t\tm5.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\t\t\tm5.id_match != $id_match AND\n\t\t\t\t\t\t\tmp3.available IN ( 'available', 'injuried', 'called', 'if_necessary' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t+\n\t\t\t(\n\t\t\t\t1 * (\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tCOUNT( mp1.id_match ) AS num\n\t\t\t\t\tFROM\n\t\t\t\t\t\tmatches_player mp1\n\t\t\t\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\t\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp1.id_player = p4.id_player AND\n\t\t\t\t\t\tm2.id_season = $id_season AND\n\t\t\t\t\t\tm2.status = 'closed' AND\n\t\t\t\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\t\tm2.id_match != $id_match AND\n\t\t\t\t\t\tmp1.available = 'missed'\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t) AS rotate_index,\n\t(\n\t\tCASE\n\t\t\tWHEN mp4.available = 'called' THEN 1\n\t\t\tWHEN mp4.available = 'available' THEN 2\n\t\t\tWHEN mp4.available = 'if_necessary' THEN 3\n\t\t\tELSE 4\n\t\tEND\n\t) AS status_order\nFROM\n\tmatches_player mp4\n\tINNER JOIN player p4 USING( id_player )\nWHERE\n\tmp4.id_match = $id_match\nORDER BY\n\t$order_by\nQUERY;\n\n\t\tif ( !$players = $this->database->query( $query, 'Get players for a match' ) )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$url = $this->getClass( 'Url' );\n\t\tforeach ( $players as &$player )\n\t\t{\n\t\t\t$player['player_url']\t= $url->buildUrl( 'player', 'index', array( $player['sanitized_name'] ) );\n\t\t}\n\n\t\treturn $players;\n\t}", "function getTeamRankings ($gameId) {\n\tglobal $bdd;\n\t$req = $bdd->prepare('\n\t\tSELECT (\n\t\t\tSELECT login\n\t\t\tFROM joueurs\n\t\t\tWHERE id_joueur = i.joueur\n\t\t\tLIMIT 1\n\t\t) AS name, i.joueur as joueur, (\n SELECT IFNULL(sum(nbpoints), 0)\n\t\t\tFROM infos_flashs\n\t\t\tWHERE i.joueur = joueur AND i.partie = partie AND nbpoints IS NOT NULL\n\t\t) AS score\n\t\tFROM inscriptions i\n\t\tWHERE partie = :game_id\n\t\tGROUP BY joueur, name\n\t\tORDER BY score DESC;\n\t');\n\t$req->execute(array(\n\t\t'game_id' => $gameId\n\t));\n\t$rankings = array();\n\twhile ($row = $req->fetch()) {\n\t\t$rankings[] = array(\n\t\t\t'name' => $row['name'],\n\t\t\t'score' => strval($row['score']),\n\t\t\t'team' => intval(getEquipeJoueurPartieActive($gameId, $row['joueur']))\n\t\t);\n\t}\n\treturn $rankings;\n}", "function getTeams(){\n return array(\n //Gonzaga ~96%\n array('name'=>'Gonzaga','elo'=>1870,'off'=>126.8,'def'=>88.8,'tempo'=>74.8),\n array(),\n //Missouri 53%\n array('name'=>'Oklahoma','elo'=>1534,'off'=>112.1,'def'=>94.1,'tempo'=>67.7),\n array('name'=>'Missouri','elo'=>1548,'off'=>110.9,'def'=>94.9,'tempo'=>68.7),\n //Creighton 70%\n array('name'=>'Creighton','elo'=>1650,'off'=>115.6,'def'=>92.8,'tempo'=>69.1),\n array('name'=>'UCSB','elo'=>1496,'off'=>109.9,'def'=>96.3,'tempo'=>66.1),\n //Virginia 73%\n array('name'=>'Virginia','elo'=>1682,'off'=>116.3,'def'=>92.3,'tempo'=>60.1),\n array('name'=>'Ohio','elo'=>1507,'off'=>113.7,'def'=>101.2,'tempo'=>69.3),\n // USC 55%\n array('name'=>'USC','elo'=>1628,'off'=>113.6,'def'=>89.9,'tempo'=>67,3),\n array(),\n //Kansas 79%\n array('name'=>'Kansas','elo'=>1701,'off'=>110.3,'def'=>87.9,'tempo'=>68.3),\n array('name'=>'E Washington','elo'=>1469,'off'=>108.4,'def'=>100.3,'tempo'=>72.4),\n //Oregon 65%\n array('name'=>'Oregon','elo'=>1669,'off'=>115.1,'def'=>96.0,'tempo'=>67.2),\n array('name'=>'VCU','elo'=>1558,'off'=>106.2,'def'=>88.8,'tempo'=>69.8),\n //Iowa 86%\n array('name'=>'Iowa','elo'=>1710,'off'=>124.2,'def'=>93.9,'tempo'=>70.0),\n array('name'=>'Grand Canyon','elo'=>1383,'off'=>104.2,'def'=>95.8,'tempo'=>65.5),\n //Michigan 87%\n array('name'=>'Michigan','elo'=>1727,'off'=>120.1,'def'=>87.9,'tempo'=>66.8),\n array(),\n //LSU 55%\n array('name'=>'LSU','elo'=>1633,'off'=>120.5,'def'=>99.4,'tempo'=>70.8),\n array('name'=>'St Bonaventure','elo'=>1597,'off'=>112.0,'def'=>89.8,'tempo'=>65.2),\n //Colorado 56%\n array('name'=>'Colorado','elo'=>1639,'off'=>115.1,'def'=>92.0,'tempo'=>66.4),\n array('name'=>'Georgetown','elo'=>1593,'off'=>108.4,'def'=>92.9,'tempo'=>69.6),\n //Florida State 65%\n array('name'=>'Florida State','elo'=>1632,'off'=>117.1,'def'=>93.6,'tempo'=>70.6),\n array('name'=>'UNCG','elo'=>1519,'off'=>104.8,'def'=>95.2,'tempo'=>68.5),\n //BYU 62%\n array('name'=>'BYU','elo'=>1632,'off'=>113.8,'def'=>91.4,'tempo'=>68.0),\n array(),\n //Texas 78%\n array('name'=>'Texas','elo'=>1705,'off'=>114.5,'def'=>92.5,'tempo'=>69.2),\n array('name'=>'Abilene Christian','elo'=>1481,'off'=>103.7,'def'=>92.2,'tempo'=>70.0),\n //UCONN 59%\n array('name'=>'UCONN','elo'=>1610,'off'=>114.3,'def'=>90.9,'tempo'=>66.0),\n array('name'=>'Maryland','elo'=>1546,'off'=>111.6,'def'=>91.5,'tempo'=>65.3),\n //Alabama 90%\n array('name'=>'Alabama','elo'=>1753,'off'=>112.4,'def'=>86.0,'tempo'=>73.9),\n array('name'=>'Iona','elo'=>1371,'off'=>101.1,'def'=>100.7,'tempo'=>68.3),\n //Baylor 92%\n array('name'=>'Baylor','elo'=>1806,'off'=>124.0,'def'=>93.0,'tempo'=>68.4),\n array('name'=>'Hartford','elo'=>1359,'off'=>98.2,'def'=>99.5,'tempo'=>66.7),\n //UNC 60%\n array('name'=>'North Carolina','elo'=>1624,'off'=>110.8,'def'=>89.3,'tempo'=>71.8),\n array('name'=>'Wisconsin','elo'=>1553,'off'=>113.2,'def'=>89.1,'tempo'=>64.9),\n //Villanova 60%\n array('name'=>'Villanova','elo'=>1634,'off'=>119.3,'def'=>95.3,'tempo'=>65.1),\n array('name'=>'Winthrop','elo'=>1558,'off'=>105.8,'def'=>95.4,'tempo'=>73.6),\n //Purdue 68%\n array('name'=>'Purdue','elo'=>1622,'off'=>114.3,'def'=>90.6,'tempo'=>66.5),\n array('name'=>'North Texas','elo'=>1484,'off'=>106.1,'def'=>92.9,'tempo'=>63.1),\n //Texas Tech 52%\n array('name'=>'Texas Tech','elo'=>1595,'off'=>113.1,'def'=>90.7,'tempo'=>65.4),\n array('name'=>'Utah State','elo'=>1576,'off'=>106.4,'def'=>88.5,'tempo'=>68.9),\n //Arkansas 66%\n array('name'=>'Arkansas','elo'=>1679,'off'=>112.2,'def'=>89.2,'tempo'=>73.1),\n array('name'=>'Colgate','elo'=>1559,'off'=>111.6,'def'=>99.9,'tempo'=>72.5),\n //Florida 52%\n array('name'=>'Florida','elo'=>1550,'off'=>111.7,'def'=>92.7,'tempo'=>68.7),\n array('name'=>'Virginia Tech','elo'=>1530,'off'=>110.7,'def'=>94.1,'tempo'=>66.2),\n //Ohio St 85%\n array('name'=>'Ohio State','elo'=>1681,'off'=>123.0,'def'=>96.1,'tempo'=>67.1),\n array('name'=>'Oral Roberts','elo'=>1373,'off'=>109.4,'def'=>106.7,'tempo'=>71.8),\n //Illinois 92%\n array('name'=>'Illinois','elo'=>1807,'off'=>119.7,'def'=>87.6,'tempo'=>70.7),\n array('name'=>'Drexel','elo'=>1362,'off'=>107.8,'def'=>104.8,'tempo'=>64.2),\n //Georgia Tech 51%\n array('name'=>'Loyola Chicago','elo'=>1655,'off'=>111.1,'def'=>85.9,'tempo'=>64.2),\n array('name'=>'Georgia Tech','elo'=>1659,'off'=>114.0,'def'=>94.1,'tempo'=>67.8),\n //Tennessee 51%\n array('name'=>'Tennessee','elo'=>1602,'off'=>109.5,'def'=>87.0,'tempo'=>67.3),\n array('name'=>'Oregon State','elo'=>1591,'off'=>110.0,'def'=>98.4,'tempo'=>65.4),\n //Oklahoma St 74%\n array('name'=>'Oklahoma State','elo'=>1700,'off'=>110.8,'def'=>90.6,'tempo'=>72.0),\n array('name'=>'Liberty','elo'=>1517,'off'=>110.8,'def'=>101.0,'tempo'=>63.1),\n //SD State 66%\n array('name'=>'San Diego State','elo'=>1697,'off'=>111.5,'def'=>88.8,'tempo'=>66.1),\n array('name'=>'Syracuse','elo'=>1574,'off'=>114.5,'def'=>96.9,'tempo'=>69.2),\n //West Virginia 69%\n array('name'=>'West Virginia','elo'=>1633,'off'=>116.8,'def'=>95.1,'tempo'=>69.6),\n array('name'=>'Morehead State','elo'=>1492,'off'=>100.9,'def'=>95.5,'tempo'=>65.6),\n //Clemson 52%\n array('name'=>'Clemson','elo'=>1571,'off'=>107.6,'def'=>90.0,'tempo'=>64.2),\n array('name'=>'Rutgers','elo'=>1556,'off'=>109.3,'def'=>89.8,'tempo'=>67.8),\n //Houston 88%\n array('name'=>'Houston','elo'=>1742,'off'=>119.6,'def'=>89.4,'tempo'=>64.9),\n array('name'=>'Cleveland State','elo'=>1395,'off'=>101.5,'def'=>98.7,'tempo'=>66.3),\n );\n}", "function get_mil_fielding_stats($player_id) {\n global $db;\n $query = 'SELECT f.player_id,\n f.year,\n f.year - YEAR(p.date_of_birth) AS age,\n f.team_id,\n f.league_id,\n l.abbr as league,\n f.level_id,\n f.split_id,\n po.pos_name,\n f.tc,\n f.a,\n f.po,\n f.er,\n f.ip,\n f.g,\n f.gs,\n f.e,\n f.dp,\n f.tp,\n f.pb,\n f.sba,\n f.rto,\n f.ipf,\n f.plays,\n f.plays_base,\n f.roe,\n f.opps_0,\n f.opps_made_0,\n f.opps_1,\n f.opps_made_1,\n f.opps_2,\n f.opps_made_2,\n f.opps_3,\n f.opps_made_3,\n f.opps_4,\n f.opps_made_4,\n f.opps_5,\n f.opps_made_5,\n f.zr,\n concat(p.first_name,\" \",p.last_name) AS player\n , t.name as city\n , t.nickname\n , t.abbr\n FROM players_career_fielding_stats f INNER JOIN players p ON\n f.player_id = p.player_id\n INNER JOIN teams t ON f.team_id = t.team_id\n INNER JOIN positions po ON f.position = po.position\n INNER JOIN leagues l ON b.league_id = l.league_id\n WHERE f.level_id <> 1 AND f.player_id = :player_id\n ORDER BY f.year, f.level_id, t.abbr, po.pos_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':player_id', $player_id);\n $statement->execute();\n $mil_fielding_stats = $statement->fetchAll();\n $statement->closeCursor();\n return $mil_fielding_stats;\n}", "function getSportsDays($params = array()){\r\n $seasonID = trim($this->seasonInfo['id']);\r\n if(!$seasonID) {\r\n $this->errorMessage[] = 'SeasonID is not specified';\r\n return array();\r\n }\r\n $leagueID = trim($this->seasonInfo['league_id']);\r\n if(!$leagueID) {\r\n $this->errorMessage[] = 'leagueID is not specified';\r\n return array();\r\n }\r\n if(!is_array($params)) $params = array();\r\n // $this->dbInstance()->queryParams['fields'] = '*';\r\n $this->dbInstance()->queryParams['table'] = 'league_season_sportsday';\r\n\r\n\r\n if(isset($params['scheduledAfter']) && intval($params['scheduledAfter'])){\r\n $scheduledAfter = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` > \".intval($params['scheduledAfter']).\")\";\r\n }\r\n if(isset($params['scheduledBefore']) && intval($params['scheduledBefore'])){\r\n $scheduledBefore = \"&& (SELECT COUNT(`id`) FROM `league_season_sportsday_game` WHERE `sportsday_id` = `league_season_sportsday`.`id` && `datetime` < \".intval($params['scheduledBefore']).\")\";\r\n }\r\n $this->dbInstance()->queryParams['where'] = \"\r\n `league_id` = :leagueID && \r\n `season_id` = :seasonID \" . \r\n $scheduledAfter . \r\n $scheduledBefore;\r\n\r\n $this->dbInstance()->queryParams['params'] = array(\r\n 'leagueID' => $leagueID,\r\n 'seasonID' => $seasonID\r\n );\r\n \r\n $this->dbInstance()->queryParams['order'] = $this->dbInstance()->calcORDERcondition($params, 'sort', 'DESC');\r\n \r\n // $offset = ($page - 1) * $limit;\r\n $this->dbInstance()->queryParams['limit'] = $this->dbInstance()->calcLIMITcondition($params);\r\n $result = $this->dbInstance()->select();\r\n\r\n if(isset($params['extend'])){\r\n if(!is_array($params['extend'])) $params['extend'] = array($params['extend']);\r\n if(in_array('games', $params['extend'])){\r\n foreach ($result as $key => $value) {\r\n $result[$key]['games'] = $this->getSportsDayGames(\r\n $result[$key]['id'], \r\n array(\r\n 'scheduledAfter'=>$params['scheduledAfter'],\r\n 'scheduledBefore'=>$params['scheduledBefore']\r\n )\r\n );\r\n }\r\n }\r\n }\r\n\r\n return $result;\r\n }", "function getPlayersFromClub($idclub){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players WHERE fk_club=\".escapeString($idclub).\" ORDER by rating DESC\";\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "public function getSeasonStats()\n {\n return $this->season_stats;\n }", "public function getCurrentSeasonInfo() {\n\t\t// infomration about the current season \n\t\n\t\t// grab a couple of useful variables\n\t\t$modx\t\t\t= $this->modx;\n\t\t\n\t\t// current timestamp to compare\n\t\t$nowtime\t\t= time();\n\t\t\n\t\t$query\t\t\t= $this->modx->newQuery('Seasons');\n\t\t$query->sortby('start','ASC');\n\t\t$query->where(array(\n\t\t\t\"start:<=\" => $nowtime,\n\t\t\t\"end:>=\" => $nowtime\n\t\t));\n\t\t\n\t\t// We only want to return a single season\n\t\t$query->limit(1);\n\t\t$seasons\t\t= $modx->getCollection('Seasons',$query);\n\t\t\n\t\tif (count($seasons) > 0) {\t\t\t\n\t\t\tforeach ($seasons as $season) {\n\t\t\t\t$s\t\t= $season->toArray();\t\n\t\t\t}\n\t\t} else {\n\t\t\t$s\t\t\t= false;\n\t\t}\n\t\t\n\t\treturn $s;\t\n\t}", "function get_team_player_pitching_stats($year,$team_id) {\n global $db;\n $query = 'SELECT concat(players.first_name, \" \", players.last_name) AS player\n , g\n , gs\n , ip\n , ab\n , ha\n , k\n , bb\n , bf\n , war\n , k9\n , bb9\n , HR9\n , WHIP\n , `K/BB`\n , BABIP\n , ERA\n , FIP\n , xFIP\n , ERAminus\n , ERAplus\n , FIPminus\n , CalcPitching.player_id\n\n\n FROM CalcPitching INNER JOIN players ON CalcPitching.player_id = players.player_id\n\n WHERE year = :year AND CalcPitching.team_id = :team_id\n ORDER BY gs DESC, players.last_name';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $pitchers = $statement->fetchAll();\n $statement->closeCursor();\n return $pitchers;\n}", "function getResultForSeason($join_on, $field_name,$history_col,$table_name) {\n /*\n * Function used for the first report to count how many times people searched for each result of a parameter.\n * For example for Type parameter how many times they searched for\n *\n * */\n global $mysqli;\n\n $sql = \"select `$field_name`, COALESCE(count(search_history.$history_col),0) AS `count`\n from `$table_name` left join search_history on $join_on = search_history.$history_col group by `$field_name` order by `count` asc \";\n\n// echo $sql;\n $result = $mysqli->query( $sql );\n return $result->fetch_all( MYSQLI_ASSOC );\n}", "function show_sessions( $type, $info, $db)\n{\n\t$found;\n\t$studentPsid = $info->getPsid();\n\t\n\t$result = $db->query( \"select * from Sessions where Sessions.psid = '$studentPsid' order by Sessions.year desc,Sessions.month desc,Sessions.day desc,Sessions.hour desc,Sessions.min desc,Sessions.second desc\");\n\t\n\t$rows = $result->num_rows;\n\t\n\tif ( $rows < 1 ) \n\t{\n\t\techo \"No sessions have been logged for this student: <br/>\";\n\t\n\t}\n\telse\n\t{\n\t\tif ( $type > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < $rows; $i++ )\n\t\t\t{\n\t\t\t\t$row = $result->fetch_array();\n\t\t\t\t$dateString = $row['year'].\"-\".$row['month'].\"-\".$row['day'].\"-\".$row['hour'].\"-\".$row['min'].\"-\".$row['second'];\n\t\t\t\t$psid = $row['psid'];\n\t\t\t\t$rdo = $psid.\":\".$dateString;\n\t\t\t\techo \"Select Session $i: PeopleSoft: $psid Date: $dateString : <input type='radio' value='$rdo' name='rdochoice' /><br/>\";\n\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ( $i = 0; $i < $rows; $i++ )\n\t\t\t{\n\t\t\t\t$row = $result->fetch_array();\n\t\t\t\techo \"Select Session $i: PeopleSoft: \". $row['psid']. \" Date: \".$row['year'].\"-\".$row['month'].\"-\".$row['day'].\"-\".$row['hour'].\"-\".$row['min'].\"-\".$row['second'].\"</br>\";\n\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t}\n\t\n\t$infoString = serialize( $info );\n\t$_SESSION['student'] = $infoString;\n\t\n\treturn;\n}", "function b_minitable_show( ) {\n global $xoopsDB;\n $module_handler =& xoops_gethandler('module');\n $module =& $module_handler->getByDirname('cricketstats');\n //Get config for News module\n $config_handler =& xoops_gethandler('config');\n if ($module) {\n $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));\n }\n \n //Season id\n $sql = \"SELECT SeasonID, SeasonName FROM \".$xoopsDB->prefix(\"cricket_seasonnames\").\" WHERE SeasonDefault=1\";\n $cricket_seasonname = $xoopsDB->query($sql);\n $cricket_seasonname = $xoopsDB->fetchArray($cricket_seasonname);\n $cricket_season_id = $cricket_seasonname['SeasonID'];\n $cricket_seasonname = $cricket_seasonname['SeasonName']; \n \n //League id\n $sql2 = \"SELECT LeagueID, LeagueName FROM \".$xoopsDB->prefix(\"cricket_leaguenames\").\" WHERE LeagueDefault=1\";\n $cricket_leaguename = $xoopsDB->query($sql2);\n $cricket_leaguename = $xoopsDB->fetchArray($cricket_leaguename);\n $cricket_league_id = $cricket_leaguename['LeagueID'];\n $cricket_leaguename = $cricket_leaguename['LeagueName']; \n\n //For win, draw and lost?\n $cricket_for_win = $moduleConfig['forwin'];\n $cricket_for_draw = $moduleConfig['fordraw'];\n $cricket_for_lose = $moduleConfig['forloss'];\n \n //Query to get teams from selected season & league\n $cricket_get_teams = $xoopsDB->query(\"SELECT DISTINCT\n O.OpponentName AS name,\n O.OpponentID AS id\n FROM \".$xoopsDB->prefix(\"cricket_opponents\").\" O, \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n WHERE LM.LeagueMatchSeasonID = '$cricket_season_id' AND\n\t\t\t\t\t\tLM.LeagueMatchLeagueID = '$cricket_league_id' AND\n (O.OpponentID = LM.LeagueMatchHomeID OR\n O.OpponentID = LM.LeagueMatchAwayID)\n ORDER BY name\");\n \n //Lets read teams into the table\n $i = 0;\n while($cricket_data = $xoopsDB->fetchArray($cricket_get_teams))\n {\n $team[$cricket_data['id']]['name'] = $cricket_data['name'];\n $team[$cricket_data['id']]['homewins'] = 0;\n $team[$cricket_data['id']]['awaywins'] = 0;\n $team[$cricket_data['id']]['homeloss'] = 0;\n $team[$cricket_data['id']]['awayloss'] = 0;\n $team[$cricket_data['id']]['hometie'] = 0;\n $team[$cricket_data['id']]['awaytie'] = 0;\n $team[$cricket_data['id']]['homerunsfor'] = 0;\n $team[$cricket_data['id']]['homerunsagainst'] = 0;\n $team[$cricket_data['id']]['awayrunsfor'] = 0;\n $team[$cricket_data['id']]['awayrunsagainst'] = 0;\n $team[$cricket_data['id']]['matches'] = 0;\n }\n \n //Match data\n $query = $xoopsDB->query(\"SELECT\n LM.LeagueMatchID AS mid, \n LM.LeagueMatchHomeID as homeid,\n LM.LeagueMatchAwayID as awayid, \n LM.LeagueMatchHomeRuns as homeruns,\n LM.LeagueMatchAwayRuns as awayruns \n FROM\n \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n \tWHERE\n LM.LeagueMatchSeasonID = '$cricket_season_id' AND LM.LeagueMatchLeagueID = '$cricket_league_id' AND\n\t\t\t\t\t\t\t\tLM.LeagueMatchHomeRuns IS NOT NULL\");\n while ($cricket_matchdata = $xoopsDB->fetchArray($query)) {\n $cricket_hometeam = $cricket_matchdata['homeid'];\n $cricket_awayteam = $cricket_matchdata['awayid'];\n \n $team[$cricket_hometeam]['matches'] = $team[$cricket_hometeam]['matches'] + 1;\n $team[$cricket_awayteam]['matches'] = $team[$cricket_awayteam]['matches'] + 1;\n \n $team[$cricket_hometeam]['homerunsfor'] = $team[$cricket_hometeam]['homerunsfor'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsagainst'] = $team[$cricket_awayteam]['awayrunsagainst'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsfor'] = $team[$cricket_awayteam]['awayrunsfor'] + $cricket_matchdata['awayruns'];\n $team[$cricket_hometeam]['homerunsagainst'] = $team[$cricket_hometeam]['homerunsagainst'] + $cricket_matchdata['awayruns'];\n \n $rundiff = $cricket_matchdata['homeruns'] - $cricket_matchdata['awayruns'];\n if ($rundiff > 0) {\n $team[$cricket_hometeam]['homewins'] = $team[$cricket_hometeam]['homewins'] + 1;\n $team[$cricket_awayteam]['awayloss'] = $team[$cricket_awayteam]['awayloss'] + 1;\n }\n elseif ($rundiff == 0) {\n $team[$cricket_hometeam]['hometie'] = $team[$cricket_hometeam]['hometie'] + 1;\n $team[$cricket_awayteam]['awaytie'] = $team[$cricket_awayteam]['awaytie'] + 1;\n }\n elseif ($rundiff < 0) {\n $team[$cricket_hometeam]['homeloss'] = $team[$cricket_hometeam]['homeloss'] + 1;\n $team[$cricket_awayteam]['awaywins'] = $team[$cricket_awayteam]['awaywins'] + 1;\n }\n }\n $cricket_get_deduct = $xoopsDB->query(\"SELECT points, teamid FROM \".$xoopsDB->prefix(\"cricket_deductedpoints\").\" WHERE seasonid = '$cricket_season_id' AND leagueid = '$cricket_league_id'\");\n while ($cricket_d_points = $xoopsDB->fetchArray($cricket_get_deduct)) {\n $team[$cricket_d_points[\"teamid\"]]['d_points'] = $cricket_d_points['points'];\n }\n foreach ($team as $teamid => $thisteam) {\n $temp_points = isset($thisteam['d_points']) ? $thisteam['d_points'] : 0;\n $cricket_points[$teamid] = ($thisteam['homewins'] * $cricket_for_win) + ($thisteam['awaywins'] * $cricket_for_win) + ($thisteam['hometie'] * $cricket_for_draw) + ($thisteam['awaytie'] * $cricket_for_draw) + $temp_points;\n $cricket_runsfor[$teamid] = $thisteam['homerunsfor'] + $thisteam['awayrunsfor'];\n $cricket_runsagainst[$teamid] = $thisteam['homerunsagainst'] + $thisteam['awayrunsagainst'];\n }\n array_multisort($cricket_points, SORT_NUMERIC, SORT_DESC, $cricket_runsfor, SORT_NUMERIC, SORT_DESC, $cricket_runsagainst, SORT_NUMERIC, SORT_DESC, $team, SORT_STRING, SORT_ASC);\n \n //Print the table\n $block['title'] = _BL_CRICK_MINITABLE;\n $block['content'] = \"<table width='100%' cellspacing='2' cellpadding='2' border='0'>\n <tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_TEAM.\"</u></span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_POINTS.\"</u></span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_RUNS.\"</u></span></td> \n </tr></table><marquee behavior='scroll' direction='up' width='100%' height='100' scrollamount='1' scrolldelay='60' onmouseover='this.stop()' onmouseout='this.start()'><table width='100%' cellspacing='2' cellpadding='2' border='0'>\";\n foreach ($team as $teamid => $thisteam)\n {\n $block['content'] .= \"<tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: normal;'>\".$thisteam['name'].\"</span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_points[$teamid].\"</span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_runsfor[$teamid].\"-\".$cricket_runsagainst[$teamid].\"</span></td>\n </tr>\";\n }\n $block['content'] .= \"</table><br><div align=\\\"center\\\"><a href=\\\"\".XOOPS_URL.\"/modules/cricketstats/index.php\\\">\"._BL_CRICK_GOTOMAIN.\"</a></div></marquee>\";\n return $block;\n}", "public function getSeasonId();", "function getRecord($player, $season, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t$matches = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT * FROM Games WHERE SeasonID = '$season' AND MatchType = '$type' AND Status = 'Complete' AND (ChallengerID = '$player' OR DefenderID = '$player')\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matches[] = $row;\n\t}\n\n\t$matchesPlayed = 0;\n\t$matchesWon = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($value['ChallengerID'] == $player || $value['DefenderID'] == $player) {\n\t\t\t$matchesPlayed++;\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$matchesWon++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $matchesWon . '-' . ($matchesPlayed - $matchesWon);\n}", "public function getLeagueSelect($season)\n\t{\t\t\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n $query->select('l.id AS value, l.name AS text');\n $query->from('#__sportsmanagement_league AS l');\n $query->join('INNER','#__sportsmanagement_project AS p on l.id = p.league_id');\n $query->join('INNER','#__sportsmanagement_season AS s on s.id = p.season_id ');\n $query->where('s.id = ' . $season );\n $query->where('s.published = 1');\n $query->where('l.published = 1');\n $query->group('l.name');\n $query->order('l.name');\n \n \n\t\t$db->setQuery($query);\n \n $this->getLeagueSelect = $query->dump();\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t$res = $db->loadObjectList();\n\t\tif ($res) \n {\n $options = array(JHTML::_('select.option', 0, JText::_($this->getParam('leagues_text'))));\n\t\t\t$options = array_merge($options, $res);\n\t\t}\n//\t\treturn JHTML::_('select.genericlist', $options, 'l', 'class=\"jlnav-select\"', 'value', 'text', $this->getLeagueId());\n\t\treturn $options;\n\t}", "function getStills($rTMDBID, $rSeason, $rEpisode)\n{\n global $rSettings, $rAdminSettings;\n if (strlen($rAdminSettings[\"tmdb_language\"]) > 0) {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"] . \"&language=\" . $rAdminSettings[\"tmdb_language\"];\n } else {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"];\n }\n return json_decode(file_get_contents($rURL), true);\n}", "public function run()\n {\n \t//Jessica Jones\n \tfor($i = 1; $i <= 2; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '13',\n\t\t\t 'serie_id' => '1',\n\t\t ]);\n\t }\n\n\t //Game of Thrones\n\t for($i = 1; $i <= 6; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '10',\n\t\t\t 'serie_id' => '2',\n\t\t ]);\n\t }\n\n\t DB::table('seasons')->insert([\n\t\t 'number' => '7',\n\t\t 'episode_number' => '7',\n\t\t 'serie_id' => '2',\n\t ]);\n\n\t DB::table('seasons')->insert([\n\t\t 'number' => '8',\n\t\t 'episode_number' => '6',\n\t\t 'serie_id' => '2',\n\t ]);\n\n\t //Westworld\n\t for($i = 1; $i <= 2; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '10',\n\t\t\t 'serie_id' => '3',\n\t\t ]);\n\t }\n\n\t //Brooklynn Nine-Nine\n\t DB::table('seasons')->insert([\n\t\t 'number' => '1',\n\t\t 'episode_number' => '22',\n\t\t 'serie_id' => '4',\n\t ]);\n\n\t for($i = 2; $i <= 3; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '23',\n\t\t\t 'serie_id' => '4',\n\t\t ]);\n\t }\n\n\t for($i = 4; $i <= 5; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '22',\n\t\t\t 'serie_id' => '4',\n\t\t ]);\n\t }\n\n\t //How i met your mother\n\t for($i = 1; $i <= 2; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '22',\n\t\t\t 'serie_id' => '5',\n\t\t ]);\n\t }\n\n\t DB::table('seasons')->insert([\n\t\t 'number' => '3',\n\t\t 'episode_number' => '20',\n\t\t 'serie_id' => '5',\n\t ]);\n\n\t for($i = 4; $i <= 9; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '24',\n\t\t\t 'serie_id' => '5',\n\t\t ]);\n\t }\n\n }", "function get_football_seasons() {\n\t$currseasonstring = $lastseasonstring = $lastlastseasonstring = '';\n\t$seasonout[] = array();\n\t$currentyear = date(\"Y\");\n\t$currentmonth = date(\"m\");\n\t\n\tif ( $currentmonth > 2 ) {\n\t\t$seasonout[0] = (string)$currentyear . '-' . (string)($currentyear + 1);\n\t\t$seasonout[1] = (string)($currentyear - 1) . '-' . (string)$currentyear;\n\t\t$seasonout[2] = (string)($currentyear - 2) . '-' . (string)($currentyear - 1);\n\t} else {\n\t\t$seasonout[0] = (string)($currentyear - 1) . '-' . (string)($currentyear);\n\t\t$seasonout[1] = (string)($currentyear - 2) . '-' . (string)($currentyear - 1);\n\t\t$seasonout[2] = (string)($currentyear - 3) . '-' . (string)($currentyear - 2);\n\t}\n\treturn $seasonout;\n\n}", "public function getScores()\n {\n \t$url = 'http://www.nfl.com/liveupdate/scorestrip/ss.json';\n \t$content = file_get_contents($url);\n \t$ss_json = json_decode($content, true);\n \t\n $url = 'http://www.nfl.com/liveupdate/scores/scores.json';\n $content = file_get_contents($url);\n $scores_json = json_decode($content, true);\n\n foreach ($ss_json['gms'] as $game) {\n // Map game data to game\n $eid = $game[\"eid\"];\n $game['data'] = $scores_json[$eid];\n \n // Get team IDs\n $home_team = DB::table('team')->where('abbr', $game['data']['home']['abbr'])->value('id');\n $away_team = DB::table('team')->where('abbr', $game['data']['away']['abbr'])->value('id');\n \n // Save teams\n if (! $home_team > 0) {\n \tprint \"Inserting home team into DB<br/>\";\n $home_team = DB::table('team')->insertGetId([\n 'name' => $game['hnn'],\n 'abbr' => $game['data']['home']['abbr']\n ]);\n } else {\n print \"Updating home team in DB<br/>\";\n DB::table('team')->where('id',$home_team)->update(['name' => $game['hnn']]);\n }\n if (! $away_team > 0) {\n print \"Inserting away team into DB<br/>\";\n $away_team = DB::table('team')->insertGetId([\n 'name' => $game['vnn'],\n 'abbr' => $game['data']['away']['abbr']\n ]);\n } else {\n print \"Updating away team in DB<br/>\";\n DB::table('team')->where('id',$away_team)->update(['name' => $game['vnn']]);\n }\n \n // Determine start time\n $year = substr($eid,0,4);\n $month = substr($eid,4,2);\n $day = substr($eid,6,2);\n $time = explode(':',$game['t']);\n $hours = $time[0] + 12;\n $minutes = $time[1];\n $seconds = 0;\n $start = date(\"Y-m-d H:i:s\", mktime($hours, $minutes, $seconds, $month, $day, $year));\n \n // Pull game ID\n $gid = DB::table('game')\n ->where('home_team_id', $home_team)\n ->where('away_team_id', $away_team)\n ->value('id');\n \n // Save game\n if (! $gid > 0) {\n print \"Inserting game for \". $home_team .\" \". $away_team .\" \". $start .\"<br/>\";\n $gid = DB::table('game')->insertGetId([\n \t'eid' => $eid,\n 'home_team_id' => $home_team,\n \t 'away_team_id' => $away_team,\n 'start' => $start\n ]);\n }\n \n // Save scores\n print \"Inserting scores \". $game['data']['home']['score']['T'] .\" \". $game['data']['away']['score']['T'] .\"<br/>\";\n if ($game['data']['home']['score']['T'] != Null && $game['data']['home']['score']['T'] != Null) {\n DB::table('score')->insert([\n 'game_id' => $gid,\n 'home_q1' => $game['data']['home']['score']['1'],\n 'home_q2' => $game['data']['home']['score']['2'],\n 'home_q3' => $game['data']['home']['score']['3'],\n 'home_q4' => $game['data']['home']['score']['4'],\n 'home_q5' => $game['data']['home']['score']['5'],\n 'away_q1' => $game['data']['away']['score']['1'],\n 'away_q2' => $game['data']['away']['score']['2'],\n 'away_q3' => $game['data']['away']['score']['3'],\n 'away_q4' => $game['data']['away']['score']['4'],\n 'away_q5' => $game['data']['away']['score']['5']\n ]);\n }\n print \"<p>----------------------------------------</p>\";\n }\n\n $response = array('exit_code' => 'success');\n //return $response;\n }", "public function getSeasonId()\n {\n return $this->season_id;\n }", "function display_teamsingleschedule($season, $team, $output = 'html', $week = null)\n{\n\tglobal $tpl, $db;\n\n\tif (empty($season)) {\n\t\t// default to this year\n\t\t$season = get_current_season();\n\t}\n\n\tif (!is_numeric($season)) {\n\t\tdisplay_message(\"Invalid season\", SCHEDULE_HEADER);\n\t\treturn;\n\t}\n\n\t$user = user_logged_in();\n\n\t$gamesstmt = $db->prepare('SELECT games.week, games.start, games.home_score, games.away_score, home_teams.abbreviation AS home_team_abbr, away_teams.abbreviation AS away_team_abbr FROM ' . TOTE_TABLE_GAMES . ' AS games LEFT JOIN ' . TOTE_TABLE_SEASONS . ' AS seasons ON games.season_id=seasons.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS home_teams ON games.home_team_id=home_teams.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS away_teams ON games.away_team_id=away_teams.id WHERE seasons.year=:year AND (games.away_team_id=:away_team_id OR games.home_team_id=:home_team_id) ORDER BY week');\n\t$gamesstmt->bindParam(':year', $season, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':away_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':home_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->execute();\n\n\t$tz = date_default_timezone_get();\n\tdate_default_timezone_set('UTC');\n\t$teamgames = array();\n\twhile ($game = $gamesstmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$game['start'] = strtotime($game['start']);\n\t\t$game['localstart'] = get_local_datetime($game['start'], (!empty($user['timezone']) ? $user['timezone'] : null));\n\t\t$teamgames[(int)$game['week']] = $game;\n\t}\n\tdate_default_timezone_set($tz);\n\t\n\t$gamesstmt = null;\n\n\t$seasonweeks = get_season_weeks($season);\n\n\tfor ($i = 1; $i <= $seasonweeks; $i++) {\n\t\tif (!isset($teamgames[$i])) {\n\t\t\t$teamgames[$i] = array('bye' => true);\n\t\t}\n\t}\n\tksort($teamgames);\n\n\t$teamstmt = $db->prepare('SELECT teams.home, teams.team FROM . ' . TOTE_TABLE_TEAMS . ' WHERE id=:team_id');\n\t$teamstmt->bindParam(':team_id', $team, PDO::PARAM_INT);\n\t$teamstmt->execute();\n\t$teamobj = $teamstmt->fetch(PDO::FETCH_ASSOC);\n\t$teamstmt = null;\n\n\thttp_headers();\n\n\t$tpl->assign('team', $teamobj);\n\tif (empty($week)) {\n\t\t$tpl->assign('allseasons', array_reverse(get_seasons()));\n\t}\n\t$mobile = mobile_browser();\n\tif ($mobile) {\n\t\t$tpl->assign('mobile', true);\n\t}\n\n\t$tpl->assign('year', $season);\n\t$tpl->assign('games', $teamgames);\n\tif (!empty($week))\n\t\t$tpl->assign('week', $week);\n\n\tif ($output == 'js')\n\t\t$tpl->assign('js', true);\n\n\t$tpl->display('teamsingleschedule.tpl');\n}", "function getPlayersGames($page)\n\t{\n\t\t$uid = $_SESSION[\"uid\"];\n\t\t$games = array();\n\t\t\n\t\t\n\t\t$query = ($page == \"ord\") ? \n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid'\n\t\t\tAND i.uid <>\n\t\t\tALL (\n\t\t\t\tSELECT DISTINCT o.uid\n\t\t\t\tFROM games g1, orders o\n\t\t\t\tWHERE g1.gid = g.gid\n\t\t\t\tAND g.gid = o.gid\n\t\t\t\tAND g.year = o.year\n\t\t\t\tAND g.season = o.season\n\t\t\t\t);\" \n\t\t\t:\n\t\t\t\"SELECT DISTINCT g.gid, g.year, g.season, g.players, g.running\n\t\t\tFROM games g, in_game i\n\t\t\tWHERE g.gid = i.gid\n\t\t\tAND i.uid = '$uid';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($games, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "public static function fetch_data($opt)\r\n {\r\n $result = ($opt == 'all') ? db::sql(\"SELECT * FROM `superrugby_2016_scores_18`\", DB_NAME):\r\n db::sql(\"SELECT * FROM `superrugby_2016_scores_18` WHERE Team = '$opt'\", DB_NAME);\r\n $return_result = null;\r\n if (mysqli_num_rows($result)){\r\n while(list($round, $match_id, $player_id, $first_name, $last_name, $country, $position, $bonus_points, $full_appearance, $part_appearance, $win, $draw,\t$away_win, $away_draw, $try, $assist, $conversion, $penalty, $drop_goal, $yellow_card, $red_card, $man_of_the_match) = mysqli_fetch_array($result)){\r\n $return_result[] = array(\r\n 'round'=>$round,\r\n 'match_id'=>$match_id,\r\n 'player_id'=>$player_id,\r\n 'first_name'=>$first_name,\r\n 'last_name'=>$last_name,\r\n 'team'=>$country,\r\n 'position'=>$position,\r\n 'bonus_points'=>$bonus_points,\r\n 'full_appearance'=>$full_appearance,\r\n 'part_appearance'=>$part_appearance,\r\n 'win'=>$win,\r\n 'draw'=>$draw,\r\n 'away_win'=>$away_win,\r\n 'away_draw'=>$away_draw,\r\n 'try'=>$try,\r\n 'assist'=>$assist,\r\n 'conversion'=>$conversion,\r\n 'penalty'=>$penalty,\r\n 'drop_goal'=>$drop_goal,\r\n 'yellow_card'=>$yellow_card,\r\n 'red_card'=>$red_card,\r\n 'man_of_the_match'=>$man_of_the_match\r\n );\r\n }\r\n }\r\n return $return_result;\r\n }", "function getTrend($player, $season, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t$matches = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT * FROM Games WHERE SeasonID = '$season' AND MatchType = '$type' AND Status = 'Complete' AND (ChallengerID = '$player' OR DefenderID = '$player') ORDER BY MatchID DESC\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matches[] = $row;\n\t}\n\n\t$trend = '';\n\t$trendCount = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($trendCount > 0) {\n\t\t\t$tempTrend = '';\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$tempTrend = 'Won';\n\t\t\t} else {\n\t\t\t\t$tempTrend = 'Lost';\n\t\t\t}\n\t\t\tif ($tempTrend == $trend) {\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$trend = 'Won';\n\t\t\t\t$trendCount++;\n\t\t\t} else {\n\t\t\t\t$trend = 'Lost';\n\t\t\t\t$trendCount++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $trend . ' ' . $trendCount;\n}", "function loading_season($idDiscipline)\n{\n $list_seasons = get_seasons($idDiscipline);\n return $list_seasons;\n}", "public function index()\n {\n $season = DB::table('tblleague')->orderBy('League', 'DESC')->First();\n\n $ranks = DB::table('tblclubstats')\n ->select(DB::raw('count(club) as matches, sum(win) as win, sum(lose) as lose, sum(draw) as draw, sum(goalsFor) as goalsFor, sum(goalsAgainst) as goalsAgainst, sum(points) as points, sum(goalsDiff) as diff, club, League'))\n ->where('League', $season->League)\n ->orderBy('points', 'DESC')\n ->orderBy('diff', 'DESC')\n ->groupBy('club', 'League')\n ->get();\n\n $goals = DB::table('tblplayerstats')\n ->select(DB::raw('sum(goals) as goals, player, League'))\n ->where('League', $season->League)\n ->orderBy('goals', 'DESC')\n ->groupBy('player', 'League')\n ->paginate(6);\n\n $assists = DB::table('tblplayerstats')\n ->select(DB::raw('sum(assists) as assists, player, League'))\n ->where('League', $season->League)\n ->orderBy('assists', 'DESC')\n ->groupBy('player', 'League')\n ->paginate(6);\n\n (!empty($ranks)) ? $ranks = $ranks : $ranks = 'Null';\n (!empty($goals)) ? $goals = $goals : $goals = 'Null';\n (!empty($assists)) ? $assists = $assists : $assists = 'Null';\n\n return view('ranks', compact('ranks', 'season', 'goals', 'assists'));\n }", "function result_screen($mode = 'reg')\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$ADMIN->page_title = \"Statistic Center Results\";\r\n\r\n\t\t$ADMIN->page_detail = \"&nbsp;\";\r\n\r\n\t\t//+---------------------\r\n\r\n\t\tif (!checkdate($IN['to_month'], $IN['to_day'], $IN['to_year']))\r\n\t\t{\r\n\t\t\t$ADMIN->error(\"The 'Date To:' time is incorrect, please check the input and try again\");\r\n\t\t}\r\n\r\n\t\tif (!checkdate($IN['from_month'], $IN['from_day'], $IN['from_year']))\r\n\t\t{\r\n\t\t\t$ADMIN->error(\"The 'Date From:' time is incorrect, please check the input and try again\");\r\n\t\t}\r\n\r\n\t\t//+---------------------\r\n\r\n\t\t$to_time = mktime(12, 0, 0, $IN['to_month'], $IN['to_day'], $IN['to_year']);\r\n\t\t$from_time = mktime(12, 0, 0, $IN['from_month'], $IN['from_day'], $IN['from_year']);\r\n\r\n\t\t$human_to_date = getdate($to_time);\r\n\t\t$human_from_date = getdate($from_time);\r\n\r\n\t\t//+---------------------\r\n\r\n\t\tif ($mode == 'reg')\r\n\t\t{\r\n\t\t\t$table = 'Registration Statistics';\r\n\r\n\t\t\t$sql_table = 'ibf_members';\r\n\t\t\t$sql_field = 'joined';\r\n\r\n\t\t\t$ADMIN->page_detail = \"Showing the number of users registered. (Note: All times based on GMT)\";\r\n\t\t} else\r\n\t\t{\r\n\t\t\tif ($mode == 'topic')\r\n\t\t\t{\r\n\t\t\t\t$table = 'New Topic Statistics';\r\n\r\n\t\t\t\t$sql_table = 'ibf_topics';\r\n\t\t\t\t$sql_field = 'start_date';\r\n\r\n\t\t\t\t$ADMIN->page_detail = \"Showing the number of topics started. (Note: All times based on GMT)\";\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tif ($mode == 'post')\r\n\t\t\t\t{\r\n\t\t\t\t\t$table = 'Post Statistics';\r\n\r\n\t\t\t\t\t$sql_table = 'ibf_posts';\r\n\t\t\t\t\t$sql_field = 'post_date';\r\n\r\n\t\t\t\t\t$ADMIN->page_detail = \"Showing the number of posts. (Note: All times based on GMT)\";\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($mode == 'msg')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$table = 'PM Sent Statistics';\r\n\r\n\t\t\t\t\t\t$sql_table = 'ibf_messages';\r\n\t\t\t\t\t\t$sql_field = 'msg_date';\r\n\r\n\t\t\t\t\t\t$ADMIN->page_detail = \"Showing the number of sent messages. (Note: All times based on GMT)\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tswitch ($IN['timescale'])\r\n\t\t{\r\n\t\t\tcase 'daily':\r\n\t\t\t\t$sql_date = \"%w %U %m %Y\";\r\n\t\t\t\t$php_date = \"F jS - Y\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'monthly':\r\n\t\t\t\t$sql_date = \"%m %Y\";\r\n\t\t\t\t$php_date = \"F Y\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t// weekly\r\n\t\t\t\t$sql_date = \"%U %Y\";\r\n\t\t\t\t$php_date = \" [F Y]\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t$stmt = $ibforums->db->query(\"SELECT MAX($sql_field) as result_maxdate,\r\n\t\t\t\t COUNT(*) as result_count,\r\n\t\t\t\t DATE_FORMAT(from_unixtime($sql_field),'$sql_date') AS result_time\r\n\t\t\t\t FROM $sql_table\r\n\t\t\t\t WHERE $sql_field > '$from_time'\r\n\t\t\t\t AND $sql_field < '$to_time'\r\n\t\t\t\t GROUP BY result_time\r\n\t\t\t\t ORDER BY $sql_field {$IN['sortby']}\");\r\n\r\n\t\t$running_total = 0;\r\n\t\t$max_result = 0;\r\n\r\n\t\t$results = array();\r\n\r\n\t\t$SKIN->td_header[] = array(\"Date\", \"20%\");\r\n\t\t$SKIN->td_header[] = array(\"Result\", \"70%\");\r\n\t\t$SKIN->td_header[] = array(\"Count\", \"10%\");\r\n\r\n\t\t//+-------------------------------\r\n\r\n\t\t$ADMIN->html .= $SKIN->start_table(ucfirst($IN['timescale']) . \" \" . $table . \" ({$human_from_date['mday']} {$this->month_names[$human_from_date['mon']]} {$human_from_date['year']} to\" . \" {$human_to_date['mday']} {$this->month_names[$human_to_date['mon']]} {$human_to_date['year']})\");\r\n\r\n\t\tif ($stmt->rowCount())\r\n\t\t{\r\n\r\n\t\t\twhile ($row = $stmt->fetch())\r\n\t\t\t{\r\n\r\n\t\t\t\tif ($row['result_count'] > $max_result)\r\n\t\t\t\t{\r\n\t\t\t\t\t$max_result = $row['result_count'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$running_total += $row['result_count'];\r\n\r\n\t\t\t\t$results[] = array(\r\n\t\t\t\t\t'result_maxdate' => $row['result_maxdate'],\r\n\t\t\t\t\t'result_count' => $row['result_count'],\r\n\t\t\t\t\t'result_time' => $row['result_time'],\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($results as $pOOp => $data)\r\n\t\t\t{\r\n\r\n\t\t\t\t$img_width = intval(($data['result_count'] / $max_result) * 100 - 8);\r\n\r\n\t\t\t\tif ($img_width < 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$img_width = 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$img_width .= '%';\r\n\r\n\t\t\t\tif ($IN['timescale'] == 'weekly')\r\n\t\t\t\t{\r\n\t\t\t\t\t$date = \"Week #\" . strftime(\"%W\", $data['result_maxdate']) . date($php_date, $data['result_maxdate']);\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\t$date = date($php_date, $data['result_maxdate']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t\t\t $date,\r\n\t\t\t\t \"<img src='{$SKIN->img_url}/bar_left.gif' width='4' height='11' alt=''><img src='{$SKIN->img_url}/bar.gif' width='$img_width' height='11' alt=''><img src='{$SKIN->img_url}/bar_right.gif' width='4' height='11' alt=''>\",\r\n\t\t\t\t \"<div class='center'>{$data['result_count']}</div>\",\r\n\t\t\t\t ));\r\n\t\t\t}\r\n\r\n\t\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t\t '&nbsp;',\r\n\t\t\t \"<div class='right'><b>Total</b></div>\",\r\n\t\t\t \"<div class='center'><b>$running_total</b></div>\",\r\n\t\t\t ));\r\n\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$ADMIN->html .= $SKIN->add_td_basic(\"No results found\", \"center\");\r\n\t\t}\r\n\r\n\t\t$ADMIN->html .= $SKIN->end_table();\r\n\r\n\t\t$ADMIN->output();\r\n\r\n\t}", "function showteam( $ffanumber, $lastname )\n{\n\t\t$db_hostname = 'gungahlinunitedfc.org.au';\n\t\t$db_username = 'gufcweb_dev';\n\t\t$db_password = 'deve!oper';\n\t\t$db_database = 'gufcweb_player';\n\n \t$mysqli = new mysqli($db_hostname,$db_username,$db_password, $db_database);\n\n\t\t$playerteam = \"\";\n\t\t\n\t\t$sqlinner = \" SELECT * FROM gufcdraws.player where FFANumber = '\".$ffanumber.\"' and LastName = '\".$lastname.\"' and display = 'Y'\";\n\n\t\t$sqlexample1 = \" SELECT * FROM gufcdraws.player where FFANumber = 28069631 and LastName = 'Chilmaid' and display = 'Y' \";\n\t\t$sqlexample2 = \" SELECT * FROM gufcdraws.player where fkteamid = 'U16 Div 2 Boys' and display = 'Y' \";\n\t\t\n\t\t$r_queryinner = $mysqli->query($sqlinner);\n\n\t\t$todays_date = date(\"Y-m-d\");\t\t\t\t\t\t\n\n\t\t$msg = 'No player found.';\t\n\n\t\techo '<table class=\"table\" align=\"center\" border=\"1\" >';\n\t\techo '<th>First Name</th>';\n\t\techo '<th>Last Name</th>';\n\t\techo '<th>Team Name</th>';\n\n\t\tif ( ! $r_queryinner )\n\t\t{\n\t\t\techo 'Player not found'; \n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sqlteam = \" SELECT FirstName,LastName,fkteamid FROM gufcdraws.player where fkteamid = '\".$playerteam.\"' and display = 'Y'\";\n\t\t\t\n\t\t\t$r_queryteam = $mysqli->query($sqlteam);\n\t\t\t\n\t\t\tif ( $r_queryteam ) {\n\t\t\t\n\t\t\t\t$rowteam = mysqli_fetch_assoc($r_queryteam)\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>'.$rowteam['FirstName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['LastName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['fkteamid'].'</td>';\n\t\t\t\techo '</tr>';\n\t\t\t}\n\t\t\techo '</table>';\n\t\t\techo '<p/>';\n\t\t}\n}", "function show_awards_listing($db,$id,$fm)\r\n{\r\n global $PHP_SELF, $bluebdr, $greenbdr, $yellowbdr;\r\n\r\n if ($db->Exists(\"SELECT * FROM seasons\")) {\r\n //$db->QueryRow(\"SELECT aw.season, se.SeasonID, se.SeasonName FROM awards aw INNER JOIN seasons se ON aw.season = se.SeasonID WHERE se.SeasonName NOT LIKE '%KO%' GROUP BY aw.season ORDER BY se.SeasonName DESC\");\r\n $db->QueryRow(\"SELECT aw.season, se.SeasonID, se.SeasonName FROM awards aw INNER JOIN seasons se ON aw.season = se.SeasonID GROUP BY aw.season ORDER BY se.SeasonName DESC\");\r\n echo \"<table width=\\\"100%\\\" cellpadding=\\\"10\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\r\n echo \" <tr>\\n\";\r\n echo \" <td align=\\\"left\\\" valign=\\\"top\\\">\\n\";\r\n echo \"<table width=\\\"100%\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\r\n echo \"<tr>\\n\";\r\n echo \" <td align=\\\"left\\\" valign=\\\"top\\\">\\n\";\r\n echo \" <font class=\\\"10px\\\">You are here:</font> <a href=\\\"/index.php\\\">Home</a> &raquo; <font class=\\\"10px\\\">Awards</font></p>\\n\";\r\n echo \" </td>\\n\";\r\n //echo \" <td align=\\\"right\\\" valign=\\\"top\\\">\\n\";\r\n //require (\"navtop.php\");\r\n //echo \" </td>\\n\";\r\n echo \"</tr>\\n\";\r\n echo \"</table>\\n\";\r\n\r\n echo \"<b class=\\\"16px\\\">Player Awards</b><br><br>\\n\";\r\n\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n // Schedule Select Box\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n echo \"<table width=\\\"100%\\\" border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"3\\\" bordercolor=\\\"$bluebdr\\\" align=\\\"center\\\">\\n\";\r\n echo \" <tr>\\n\";\r\n echo \" <td bgcolor=\\\"$bluebdr\\\" class=\\\"whitemain\\\" height=\\\"23\\\">SEASON SELECTOR</td>\\n\";\r\n echo \" </tr>\\n\";\r\n echo \" <tr>\\n\";\r\n echo \" <td class=\\\"trrow1\\\" valign=\\\"top\\\" bordercolor=\\\"#FFFFFF\\\" class=\\\"main\\\">\\n\";\r\n\r\n echo \" <p><select name=ccl_mode onChange=\\\"gotosite(this.options[this.selectedIndex].value)\\\">\\n\";\r\n echo \" <option>select a season</option>\\n\";\r\n echo \" <option>===============</option>\\n\";\r\n\r\n for ($i=0; $i<$db->rows; $i++) {\r\n $db->GetRow($i);\r\n $db->BagAndTag();\r\n\r\n // output\r\n $id = $db->data['SeasonID'];\r\n $season = $db->data['SeasonID'];\r\n $sename = $db->data['SeasonName'];\r\n\r\n echo \" <option value=\\\"$PHP_SELF?season=$season&sename=$sename&ccl_mode=2\\\">\" . $db->data['SeasonName'] . \" season</option>\\n\";\r\n\r\n }\r\n\r\n echo \" </select></p>\\n\";\r\n\r\n echo \" </td>\\n\";\r\n echo \" </tr>\\n\";\r\n echo \"</table>\\n\";\r\n\r\n echo \" </td>\\n\";\r\n echo \" </tr>\\n\";\r\n echo \"</table>\\n\";\r\n\r\n } else {\r\n\r\n echo \"<table width=\\\"100%\\\" cellpadding=\\\"10\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\r\n echo \" <tr>\\n\";\r\n echo \" <td align=\\\"left\\\" valign=\\\"top\\\">\\n\";\r\n echo \" <p>There are no player awards in the database.</p>\\n\";\r\n echo \" <p>&laquo; <a href=\\\"/index.php\\\">back to homepage</a></p>\\n\";\r\n echo \" </td>\\n\";\r\n echo \" </tr>\\n\";\r\n echo \"</table>\\n\";\r\n }\r\n}", "function getAllPlayers(){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by rating DESC\";\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "function showGames()\n{\n $email = trim($_SESSION['login']);\n $dbEmail = R::getAll(\"SELECT * FROM users WHERE email = '$email'\");\n if (!empty($dbEmail)) {\n $user_id = $dbEmail[0]['id'];\n $games = R::getAll(\"SELECT * FROM games WHERE `user_id` = '$user_id'\");\n if (!empty($games)) {\n echo \"<table class='games'>\";\n echo \"<thead><tr>\n <td>#</td>\n <td>Cas hry</td>\n <td>Data hry</td>\n </tr></thead>\";\n $count = 1;\n foreach ($games as $game) {\n echo \"<tr>\n <td>\" . $count . \"</td>\";\n echo \"<td>\" . $game['time'] . \"</td>\";\n echo \"<td>\" . $game['data'] . \"</td>\";\n echo \"</tr>\";\n $count++;\n }\n echo \"</table>\";\n } else {\n echo \"No games yet!\";\n }\n }\n}", "function getRank($player, $season, $type) {\n\tif ($type == 'Ladder') { // We rank ladder standings by RPI\n\t\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t\t$players = array();\n\n\n\t\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE LadderSeason = '$season'\");\n\t\twhile($row = mysqli_fetch_assoc($playerResult)) {\n\t\t\t$players[] = $row;\n\t\t}\n\n\t\tforeach($players as $key => $value) {\n\t\t\t$players[$key]['rpi'] = getRPI($players[$key]['PlayerID'], $season, $type);\n\t\t}\n\n\t\tforeach ($players as $key => $row) {\n\t\t\t$rpi[$key] = $row['rpi'];\n\t\t}\n\n\t\tarray_multisort($rpi, SORT_DESC, $players);\n\t\t\n\t\tforeach ($players as $key => $value) {\n\t\t\tif ($players[$key]['PlayerID'] === $player) {\n\t\t\t\treturn $key+1;\n\t\t\t}\n\t\t}\n\n\t} else { // We rank league standings by least number of losses with an RPI tie-breaker\n\t\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t\t$players = array();\n\n\n\t\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE LadderSeason = '$season'\");\n\t\twhile($row = mysqli_fetch_assoc($playerResult)) {\n\t\t\t$players[] = $row;\n\t\t}\n\n\t\tforeach($players as $key => $value) {\n\t\t\t$players[$key]['losses'] = substr(getRecord($players[$key]['PlayerID'], $season, $type), -1);\n\t\t}\n\n\t\tforeach ($players as $key => $row) {\n\t\t\t$losses[$key] = $row['losses'];\n\t\t}\n\n\t\tarray_multisort($losses, SORT_ASC, $players);\n\t\t\n\t\tforeach ($players as $key => $value) {\n\t\t\tif ($players[$key]['PlayerID'] === $player) {\n\t\t\t\treturn $key+1;\n\t\t\t}\n\t\t}\n\t}\n}", "public function pastSeasons(){\n $json = file_get_contents('http://ergast.com/api/f1/seasons.json?limit=100');\n $f1json = json_decode($json);\n return view('seasons.pastRaces')\n ->with([\n 'f1json' => $f1json\n ]);\n }", "function get_archieved_games_results($odds_season) {\n\t\n//$odds_season = '2013-14';\n\n/* odds_limit is used to check if the games is an even match. If not, we don't bother using it. \n\tThe odds archive files contains multiple odds notations for a two way situation, including\n\tthe US odds (like -125). The US odds is only available for the favorite team, so only need\n\tto check one end of the\trange. Ex.: -130 is ~1.76 in decimal notation, so it should fit in \n\tour range of 1.75 - 2.1. \n*/\n//$odds_limit = -130;\n$odds_archive = file('odds_archive/nhl odds '.$odds_season.'.csv');\n\n$line_number = 1;\n\nforeach($odds_archive as $odds_line) {\n\t\n\tif($line_number != 1) {\n\t\t\n\t\t$odds_columns = explode(',', $odds_line);\n\t\t\n\t\t$i=0;\n\t\t\t\t\t\t\n\t\tforeach($odds_columns as $column) {\n\t\t\tswitch($i) {\n\t\t\t\tcase 0:\n\t\t\t\t\t$current_date = $column;\n\t\t\t\tcase 3:\n\t\t\t\t\t$current_team = $column;\n\t\t\t\tcase 7:\n\t\t\t\t\t$current_score = $column;\t\n\t\t\t\tcase 8:\n\t\t\t\t\t$current_odds = $column;\t\n\t\t\t\tcase 10:\n\t\t\t\t\t$current_overtime = $column;\t\n\t\t\t}\n\t\t\t$i++;\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\tif($line_number % 2 == 0) {\n\t\t\t$visitor_team = $current_team;\n\t\t\t$visitor_score = $current_score;\n\t\t\t$visitor_odds = $current_odds;\n\t\t\t$visitor_overtime = $current_overtime;\n\t\t} else {\n\n\t\t\n//\t\t\t$save_to_db = false;\n\t\t\t$save_to_db = true;\n\t\t\tif(substr($current_odds, 0, 1) == '-') {\n\t\t\t\t/*if($current_odds >= $odds_limit) {\n\t\t\t\t\t$save_to_db = true;\n\t\t\t\t}*/\n\t\t\t\t$odds_to_use = $current_odds;\n\t\t\t} elseif (substr($visitor_odds, 0, 1) == '-') {\n\t\t\t\t/*if($visitor_odds >= $odds_limit) {\n\t\t\t\t\t$save_to_db = true;\n\t\t\t\t}*/\n\t\t\t\t$odds_to_use = $visitor_odds;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($save_to_db) {\n\t\t\t\t\n\t\t\t\t$date_length = strlen($current_date);\n\t\t\t\tif($date_length == 4) {\n\t\t\t\t\t$date_year = substr($odds_season, 0, 4);\n\t\t\t\t\t$date_month = substr($current_date, 0, $date_length-2);\n\t\t\t\t} else {\n\t\t\t\t \t$date_year = '20'.substr($odds_season, 5, 2);\n\t\t\t\t \t$date_month = '0'.substr($current_date, 0, $date_length-2);\n\t\t\t\t }\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$date_day = substr($current_date, $date_length-2, 2);\n\t\t\t\t$date_to_use = $date_year.'-'.$date_month.'-'.$date_day;\n\t\t\t\t\n\t\t\t\t//if($date_to_use >= '2013-10-01' && $date_to_use <= '2014-04-13') {\n\t\t\t\t\t\t\n\t\t\t\t\t$message_value[] = $date_to_use.' | '.$visitor_team.'-'.$current_team;\n\t\t\t\t\t\n\t\t\t\t\t$query = \"INSERT INTO matches(date, visitor, home, odds_us) VALUES ('$date_to_use', '$visitor_team', '$current_team', '$odds_to_use')\";\n\t\t\t\t\t\n\t\t\t\t\tif(!mysqli_query(DBi::$conn, $query)) { echo mysqli_error(DBi::$conn); }\n\t\t\t\t\t\n\t\t\t\t\t$game_id = mysqli_insert_id(DBi::$conn);\n\t\t\t\t\t\n\t\t\t\t\tif($visitor_score > $current_score) {\n\t\t\t\t\t\t$result = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result = 2;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//echo 'Visitor OT'.$visitor_overtime.'|';\n\t\t\t\t\t//echo 'Home OT'.$current_overtime.'<br>';\n\t\t\t\t\t\n\t\t\t\t\tif($visitor_overtime == 1 || $current_overtime == 1) {\n\t\t\t\t\t\t$overtime = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$overtime = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//echo 'OT:'.$overtime.'<br>';\n\t\t\t\t\t$query2 = \"INSERT INTO results(game_id, result, overtime) VALUES ($game_id, $result, $overtime)\";\n\t\t\t\t\t\n\t\t\t\t\tif(!mysqli_query(DBi::$conn, $query2)) { echo mysqli_error(DBi::$conn); }\n\t\t\t\t\t\n\t\t\t\t//}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\t\n\t}\n\t\n\t$line_number++;\n\n}\n\n}", "public function archiveShow(Season $season)\n {\n $results = DB::table('results')->select(DB::raw('team_id, SUM(points) as points '))->where('season_id', $season->id)->groupBy('team_id')->get();\n $results = $results->map(function ($array, $key) {\n $array = (array)$array;\n $array['team'] = Team::withTrashed()->where('id', $array['team_id'])->first();\n $array = (object)$array;\n return $array;\n });\n $resultsSorted = array();\n //dd($results);\n foreach (config('constants.classes')[$season->id] as $class => $cars) {\n $resultsSorted[$class] = $results->filter(function ($result, $key) use ($cars) {\n $team = Team::withTrashed()->where('id', $result->team_id)->first();\n return in_array($team->car, $cars);\n });\n\n /*$resultsSorted[$class] = $resultsSorted[$class]->sortByDesc(function ($result, $key) {\n return $result->points;\n });*/\n\n $resultsSorted[$class] = $resultsSorted[$class]->sort(function ($a, $b) use ($season) {\n if (floor($a->points) == floor($b->points)) {\n /*if(floor($a->points) == 0 && $a->points != $b->points){\n return ($a->points > $b->points) ? -1 : 1;\n }else{*/\n $minPos = 0;\n $abort = false;\n while (!$abort) {\n $minA = $a->team->results()->where([['season_id','=',$season->id],['position','>',$minPos]])->min('position');\n $minB = $b->team->results()->where([['season_id','=',$season->id],['position','>',$minPos]])->min('position');\n\n if ($minA === null && $minB === null) {\n $abort = true;\n continue;\n }\n if ($minA === null && $minB !== null) {\n return 1;\n } elseif ($minA ==! null && $minB === null) {\n return -1;\n }\n\n if ($minA != $minB) {\n return ($minA < $minB) ? -1 : 1;\n } else {\n $countA = $a->team->results()->where([['season_id','=',$season->id],['position','=',$minA]])->count();\n $countB = $b->team->results()->where([['season_id','=',$season->id],['position','=',$minB]])->count();\n\n if ($countA != $countB) {\n return ($countA > $countB) ? -1 : 1;\n } else {\n $minPos = $minA;\n }\n }\n }\n //}\n return 0;\n } else {\n return ($a->points > $b->points) ? -1 : 1;\n }\n });\n\n $resultsSorted[$class] = $resultsSorted[$class]->values();\n }\n //dd($resultsSorted);\n $teamResults = array();\n $rounds = Round::where('season_id', $season->id)->get();\n $teams = Team::withTrashed()->where('season_id', $season->id)->has('results')->with('results')->get();\n foreach ($teams as $team) {\n $roundresults = [];\n foreach ($rounds as $round) {\n $roundresult = '-';\n if ($team->results->contains('round_id', $round->id)) {\n $roundresult = floor($team->results->where('round_id', $round->id)->first()->points);\n }\n $roundresults[$round->number] = $roundresult;\n }\n $teamResults[$team->id] = $roundresults;\n }\n $first = array_keys($resultsSorted)[0];\n //dd($resultsSorted);\n return view('archive.showSeason', compact('resultsSorted', 'rounds', 'first', 'teamResults', 'season'));\n }", "function get_race_team_db($idTeam)\n{\n require('./model/connect_db.php');\n $sql = \"select r.position, r.points, s.year, c.nameCircuit, c.place, p.namePilot, p.pilotNumber, p.idPilot from race r, circuit c, season s, pilot p where r.idTeam = '%d' and r.idPilot = p.idPilot and r.idCircuit = c.idCircuit and r.idSeason = s.idSeason\";\n $request = sprintf($sql,$idTeam);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $race_team = array();\n while($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $race_team[] = $line;\n }\n return $race_team;\n}", "function getAllTeams(){\r\n /*for testing purposes only, replace with request to db\r\n return array(\r\n array(\"name\" => \"Usine\", \"score\" => 2000),\r\n array(\"name\" => \"Abattoirs\", \"score\" => 1000),\r\n array(\"name\" => \"Caserne\", \"score\" => 1200),\r\n array(\"name\" => \"Asile\", \"score\" => 5000),\r\n array(\"name\" => \"Zombie\", \"score\" => -10000)\r\n );*/\r\n\r\n //$GLOBALS['link'] = connect();\r\n $res = mysqli_query($GLOBALS['link'], 'select `id`, `name`, `score` from teams;');\r\n\r\n return fetch_result($res);\r\n}", "function get_circuits_season($idSeason)\n{\n require('./model/connect_db.php');\n $sql = \"select c.idCircuit, c.nameCircuit, c.place from Circuit c where c.idSeason = '%d'\";\n $request = sprintf($sql,$idSeason);\n $result = mysqli_query($link,$request) or die (utf8_encode(\"request error\") . $request);\n\n $circuit_season= array();\n while ($line = mysqli_fetch_assoc($result) and isset($line))\n {\n $circuit_season[] = $line;\n }\n return $circuit_season;\n}", "function get_team_p_war_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT p.player_id\n , CONCAT(pl.first_name,\" \",pl.last_name) as player\n , round(p.war,1) as war\n FROM CalcPitching p INNER JOIN players pl ON p.player_id=pl.player_id\n WHERE p.year = :year AND p.team_id = :team_id\n ORDER BY p.war DESC\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_p_war_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_p_war_leaders;\n}", "public function get_seasonteams()\n\t\t{\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->execute();\n\t\t//\tprint_r($objs);\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t//\t\tprint_r($obj);\n\t\t\t\t$team = ORM::factory('Sportorg_Team',$obj['team_id']);\n\n\t\t\t\t$retArr[] = $team->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}", "function players(){\n\t\t$this->autoRender = false;\n\t\t$this->response->type('json');\n\t\t\n\t\t$this->loadModel('Player'); // player module to fetch player data\n\t\t\n\t\t$team_id = $this->request->data('teamid'); //team id from request\n\t\t\n\t\ttry {\n\t\t\t$players = $this->Player->find('all', array('conditions' => array('team_id' => $team_id))); //players by team_id\n\t\t}catch (Exception $e){\n\t\t\techo $this->dbError;\n\t\t}\n\t\tif (!empty($players)){\n\t\t\techo json_encode($players);\n\t\t}else{\n\t\t\techo $this->noResult;\n\t\t}\n\t\t\n\t}", "function get_team_whip_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT p.player_id\n , CONCAT(pl.first_name,\" \",pl.last_name) AS player\n , p.whip\n FROM CalcPitching p INNER JOIN players pl ON p.player_id=pl.player_id\n INNER JOIN team_history_record t ON p.team_id=t.team_id AND p.year=t.year\n WHERE p.year = :year AND p.team_id = :team_id\n AND p.g >= 35\n ORDER BY p.whip\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_whip_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_whip_leaders;\n}", "function get_match($season_id, $division_id, $match_id)\n{\n\theader('Content-Type: application/json');\n\t$db_connection = db_open();\n\n\t/*\n\t * Get the list of matches\n\t*/\n\tif ($result = $db_connection->query(\"SELECT * FROM matches WHERE match_id=$match_id\"))\n\t{\n\t\tif ($result->num_rows < 1)\n\t\t{\n\t\t\thttp_response_code(404);\n\t\t}\n\t\telse \n\t\t{\n\t\t\twhile ($row = $result->fetch_assoc())\n\t\t\t{\n\t\t\t\tmatch_row_to_response($db_connection, $row);\n\t\t\t}\n\t\t}\n\t\t$result->free();\n\t}\n\telse \n\t{\n\t\thttp_response_code(400);\t\n\t\techo \"Failed query to MySQL: (\" . $db_connection->errno . \") \" . $db_connection->error;\n\t}\n\n\tdb_close($db_connection);\n}", "function getDivDetails( $division ) {\n\n/* ... data declarations */\n $tournDetails = array();\n\n/* ... form the database query */\n $this->db->select( 'GameID, Date, Time, Diamond, HomeSeed, VisitSeed, HomeTeamID, HomeScore, VisitTeamID, VisitScore, Notes, Status, TournamentID, WinnerNextGame, LoserNextGame' );\n $whereClause = \"Status IN ('PLAYED', 'SCHEDULED', 'RAINOUT') AND TournamentID LIKE '\".$division.\"%'\";\n $this->db->where( $whereClause );\n $this->db->order_by( 'Date', 'asc' );\n $this->db->order_by( 'Time', 'asc' );\n $this->db->order_by( 'Diamond', 'asc' );\n\n/* ... perform the query */\n $sqlQuery = $this->db->get( 'Tournament' );\n\n/* ... now to roll through the retrieved data */\n foreach ($sqlQuery->result_array() as $dbRow) {\n $tournDetails[] = $dbRow;\n }\n\n/* ... time to go */\n return( $tournDetails );\n }", "public function getTeams();", "function ShowInfoGames($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idGame, LakeFishesGame, LakeReproductionGame, PondReproductionGame, EatFishesGame, FirstPlayerGame, TourGame, SeasonTourGame, MaxPlayersGame, MaxReleaseGame, DescriptionType, (SELECT COUNT(idPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS OccupedPlaces, (SELECT SUM(PondFishesPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS SumPondFishes\n FROM fishermenland.game\n INNER JOIN fishermenland.type ON game.fkTypeGame = type.idType WHERE idGame = '$idGame'\");\n\n return $req;\n}", "public function getChampionshipSeasons()\n {\n $championships = $this->teams->map(function ($team) {\n return ($team->position == 1) ? $team->season->year : null;\n })->toArray();\n\n return implode(array_filter($championships), ', ');\n }", "function galaxy_ShowAvailableRanking($type) {\n\tglobal $db;\n\n\t$ranking = array();\n\n\tswitch ($type) {\n\t\tcase \"player\":\n\t\t$table_points = TABLE_RANK_PLAYER_POINTS;\n\t\t$table_fleet = TABLE_RANK_PLAYER_POINTS;\n\t\t$table_research = TABLE_RANK_PLAYER_POINTS;\n\t\tbreak;\n\n\t\tcase \"ally\":\n\t\t$table_points = TABLE_RANK_ALLY_POINTS;\n\t\t$table_fleet = TABLE_RANK_ALLY_POINTS;\n\t\t$table_research = TABLE_RANK_ALLY_POINTS;\n\t\tbreak;\n\t}\n\n\t$request = \"select distinct datadate from \".$table_points.\" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"points\"] = true;\n\t}\n\n\t$request = \"select distinct datadate from \".$table_fleet.\" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"fleet\"] = true;\n\t}\n\n\t$request = \"select distinct datadate from \".$table_research.\" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"research\"] = true;\n\t}\n\n\twhile ($value = current($ranking)) {\n\t\techo date(\"Y-m-d H:i:s\", key($ranking)+4).\"=\";\n\t\tif (isset($value[\"points\"])) echo \"P\";\n\t\tif (isset($value[\"fleet\"])) echo \"F\";\n\t\tif (isset($value[\"research\"])) echo \"R\";\n\t\techo \"<|>\";\n\t\tnext($ranking);\n\t}\n\texit();\n}", "function get_team_fipm_leaders($year,$team_id) {\n global $db;\n $query = 'SELECT p.player_id\n , CONCAT(pl.first_name,\" \",pl.last_name) AS player\n , p.FIPminus\n FROM CalcPitching p INNER JOIN players pl ON p.player_id=pl.player_id\n INNER JOIN team_history_record t ON p.team_id=t.team_id AND p.year=t.year\n WHERE p.year = :year AND p.team_id = :team_id\n AND p.g >= 35\n ORDER BY p.FIPminus\n LIMIT 3';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':team_id', $team_id);\n $statement->execute();\n $team_fipm_leaders = $statement->fetchAll();\n $statement->closeCursor();\n return $team_fipm_leaders;\n}", "public static function getRelieversByTeam(\n $team_id,\n $season,\n $ds\n ) {\n $day = substr($ds, -2);\n $month = substr($ds, 0, 2);\n $ds = \"$season-$month-$day\";\n $table = RetrosheetTables::RETROSHEET_HISTORICAL_PITCHING;\n $query =\n \"SELECT DISTINCT player_id\n FROM $table\n WHERE last_team = '$team_id'\n AND pitcher_type = 'R'\n AND split = 'Total'\n AND season = $season\n AND ds = '$ds'\";\n $pitchers = exe_sql(DATABASE, $query);\n $pitcher_array = array();\n foreach ($pitchers as $pitcher) {\n $pitcher_id = $pitcher['player_id'];\n $pitcher_array[$pitcher_id] = \"'$pitcher_id'\";\n }\n return $pitcher_array;\n }", "function month_matches($month){\n\t\t$this->db->select('name,active_round,id');\n\t\t$this->db->where('active_round >',0);\n\t\t$championships=$this->db->get('championships')->result();\n\t\t$active_rounds=array();\n\t\t$champs=array();\n\t\t$champs_complete=array();\n\t\tforeach($championships as $row){\n\t\t\t$active_rounds[]=$row->active_round;\n\t\t\t$champs[]=$row->id;\n\t\t\t$champs_complete[$row->active_round]=$row;\n\t\t}\n\t\t\n\t\t//SACO LOS GRUPOS ACTIVOS\n\t\t$this->db->select('id,round_id');\n\t\t$this->db->where_in('round_id',$active_rounds);\n\t\t$groups=$this->db->get('groups')->result();\n\t\t$active_groups=array();\n\t\t$groups_complete=array();\n\t\tforeach($groups as $row){\n\t\t\t$active_groups[]=$row->id;\n\t\t\t$groups_complete[$row->id]=$row->round_id;\n\t\t}\n\t\t\n\t\t//SACO LOS EQUIPOS POR CAMPEONATO ACTIVO\n\t\t$this->db->select('team_id');\n\t\t$this->db->where_in('championship_id',$champs);\n\t\t$championships_teams=$this->db->get('championships_teams')->result();\n\t\t$champs_teams=array();\n\t\tforeach($championships_teams as $row)\n\t\t\t$champs_teams[]=$row->team_id;\n\t\t\n\t\t//SACO EQUIPOS ACTIVOS POR CAMPEONATO ACTIVO\n\t\t$this->db->where_in('id',$champs_teams);\n\t\t$teams=$this->db->get('teams')->result();\n\t\t$champs_teams=array();\n\t\tforeach($teams as $row)\n\t\t\t$champs_teams[$row->id]=$row;\n\t\t\n\t\t//SACO PARTIDOS DE LOS GRUPOS ACTIVOS\n\t\t$this->db->where_in('group_id',$active_groups);\n\t\t$this->db->where('MONTH(date_match)',$month,FALSE);\n\t\t$this->db->where('YEAR(date_match)','YEAR(NOW())',FALSE);\n\t\t$this->db->order_by('date_match','asc');\n\t\t$this->db->join('matches_teams','matches.id = matches_teams.match_id');\n\t\t$mats=$this->db->get('matches')->result();\n\t\t\n\t\t$matches=array();\n\t\tforeach($mats as $key=>$match){\n\t\t\t$matches[$key]=$match;\n\t\t\t$matches[$key]->team_id_home=$champs_teams[$match->team_id_home];\n\t\t\t$matches[$key]->team_id_away=$champs_teams[$match->team_id_away];\n\t\t\t$matches[$key]->championship=$champs_complete[$groups_complete[$match->group_id]];\n\t\t}\n\t\t\n\t\treturn $matches;\n\t}", "function updateTeams($players, $json) {\n\n\tunset($teams);\n\t$teams = array( 'won' => array(), 'lost' => array() );\n\tforeach ($players as $player) {\n\t\tif ($player['state'] == 'Won') {\n\t\t\tarray_push($teams['won'], $player['id']);\n\t\t} else {\n\t\t\tarray_push($teams['lost'], $player['id']);\n\t\t}\n\t}\n\t\n\t//updateWinnerTeam($teams['won']);\n\tunset($jsonteam);\n\tforeach ($json['teams'] as &$jsonteam) {\n\t\t$foundteam = 0;\n\t\t\n\t\tforeach ($jsonteam['players'] as $jsonplayer) {\n\t\t\tforeach ($teams['won'] as $thisplayer) {\n\t\t\t\tif ($jsonplayer['token'] == $thisplayer) $foundteam++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($foundteam == 3) {\n\t\t\techo 'updating team with win<br>';\n\t\t\t$jsonteam['wins']++;\n\t\t\t$jsonteam['rating']++;\n\t\t\t//$jsonteam['pendinggames']--;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t//updateLosingTeam($teams['lost']);\n\tunset($jsonteam);\n\tforeach ($json['teams'] as &$jsonteam) {\n\t\t$foundteam = 0;\n\t\t\n\t\tforeach ($jsonteam['players'] as $jsonplayer) {\n\t\t\tforeach ($teams['lost'] as $thisplayer) {\n\t\t\t\tif ($jsonplayer['token'] == $thisplayer) $foundteam++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($foundteam == 3) {\n\t\t\techo 'updating team with win<br>';\n\t\t\t$jsonteam['losses']++;\n\t\t\t$jsonteam['rating']--;\n\t\t\t//$jsonteam['pendinggames']--;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn true;\n}", "public function getParlayCardCards($id, $playerId)\n {\n if(!$playerId) \n $this->getParlayWinners($id);\n \n $rs = $this->db->query(\"Select id , firstName, lastName from Users where id in (Select distinct playerId from SportPlayerCards where parlayCardId = ?) order by screenName\", array($id));\n $names = $rs->result();\n \n $rs = $this->db->query(\"Select * from SportParlayConfig where parlayCardId = ?\", array($id));\n $config = $rs->row();\n \n $results = array();\n $rs = $this->db->query(\"Select * from SportGameResults where parlayCardId = ?\", array($id));\n foreach($rs->result() as $row)\n $results[$row->sportScheduleId] = $row->winner;\n \n $answers = array();\n $rs = $this->db->query(\"Select * from SportParlayCards where parlayCardId = ? order by sequence\", array($id));\n foreach($rs->result() as $row)\n {\n if($row->overUnderScore && isset($results[$row->id]))\n $row->winner = $results[$row->id];\n elseif(!$row->overUnderScore && isset($results[$row->sportScheduleId]))\n $row->winner = $results[$row->sportScheduleId];\n else\n $row->winner = 0;\n \n if($row->overUnderScore)\n $answers[$row->id] = $row;\n else\n $answers[$row->sportScheduleId] = $row;\n }\n \n $cards = array();\n if(!$playerId)\n {\n $rs = $this->db->query(\"Select c.*, p.firstName, p.lastName from SportPlayerCards c\n Inner join Users p on p.id = c.playerId \n where parlayCardId = ? order by wins DESC limit 50\", array($id));\n }\n else\n {\n $rs = $this->db->query(\"Select c.*, p.firstName, p.lastName from SportPlayerCards c\n Inner join Users p on p.id = c.playerId \n where parlayCardId = ? and playerId = ? order by wins DESC\", array($id, $playerId));\n }\n \n foreach($rs->result() as $index => $row)\n {\n $cards[$index]['title'] = \"#\" . $row->id . \" \" . $row->firstName . \" \" . $row->lastName . \" (\" . $row->playerId . \") (Wins: \" . $row->wins . \" Losses: \" . $row->losses . \")\";\n $picks_temp = explode(\":\", $row->picksHash);\n foreach($picks_temp as $temp)\n {\n $key_value = explode(\"|\", $temp);\n $cards[$index]['cards'][$key_value[0]] = $key_value[1];\n }\n }\n \n return compact('config', 'answers', 'cards', 'names');\n }", "function teams(){\n\t\t$this->autoRender = false;\n\t\t$this->response->type('json');\n\t\ttry {\n\t\t\t$teams = $this->Team->find('all');\n\t\t}catch (Exception $e){\n\t\t\techo $this->dbError;\n\t\t}\n\t\tif (!empty($teams)){\n\t\t\techo json_encode($teams);\n\t\t}else{\n\t\t\techo $this->noResult;\n\t\t}\n\t}", "public function getSeasonCalendar(Season $season)\n {\n $gamesArray = array();\n\n foreach ($season->teams as $key=>$team) {\n $date = $team->date;\n $teamnumber = $team->team;\n $playerId = $team->group_user_id;\n \n //Gameday\n $gamesArray[$date]['datum'] = $date;\n $gamesArray[$date][$teamnumber][$playerId]['teamId'] = $team->id;;\n if (isset($gamesArray[$date][$teamnumber]['player1']) === false) {\n $gamesArray[$date][$teamnumber]['player1'] = $playerId;\n } else {\n $gamesArray[$date][$teamnumber]['player2'] = $playerId;\n } \n $gamesArray[$date]['teamIds'][$team->id]['teamId'] = $team->id;\n $gamesArray[$date]['teamIds'][$team->id]['team'] = $teamnumber;\n $gamesArray[$date]['teamIds'][$team->id]['groupUserId'] = $playerId;\n $gamesArray[$date]['teamIds'][$team->id]['replacement'] = $team->ask_for_replacement;\n }\n return $this->createJsonSeason($gamesArray, $season);\n }", "public function index()\n {\n $games= DB::select('SELECT p1.nume as echipa1,left(g.ora,5) as hour,\n p2.nume as echipa2,g.*\n FROM games g join posts p1 on g.idteam1=p1.id \n join posts p2 on g.idteam2=p2.id where result2 is null order by data asc');\n\n $results= DB::table('games')\n ->select('p.nume as echipa1','t.nume as echipa2','games.ora as hour','games.*')\n ->join('posts as p', 'p.id', '=', 'games.idteam1')\n ->join('posts as t', 't.id', '=', 'games.idteam2')\n ->where('p.idsport','=','1')\n ->where('t.idsport','=','1')\n ->whereNotNull('games.result2')\n ->orderBy('games.data','desc','games.ora','desc')\n ->paginate(5);\n $resultsb= DB::table('games')\n ->select('p.nume as echipa1','t.nume as echipa2','games.ora as hour','games.*')\n ->join('posts as p', 'p.id', '=', 'games.idteam1')\n ->join('posts as t', 't.id', '=', 'games.idteam2')\n ->where('p.idsport','=','2')\n ->where('t.idsport','=','2')\n ->whereNotNull('games.result2')\n ->orderBy('games.data','desc','games.ora','desc')\n ->paginate(5);\n $resultsh= DB::table('games')\n ->select('p.nume as echipa1','t.nume as echipa2','games.ora as hour','games.*')\n ->join('posts as p', 'p.id', '=', 'games.idteam1')\n ->join('posts as t', 't.id', '=', 'games.idteam2')\n ->where('p.idsport','=','3')\n ->where('t.idsport','=','3')\n ->whereNotNull('games.result2')\n ->orderBy('games.data','desc','games.ora','desc')\n ->paginate(5);\n return view('games.index')->with(compact('games',$games,'results',$results,'resultsb',$resultsb,'resultsh',$resultsh));\n\n }", "protected function processResultsByTeam($ws,$level,&$teamCount,&$newPool,$teams,$header='Team Standings',$headerLabels)\n { \n }", "public static function getSeason(): string {\n\n // On obtient d'abord la date du jour au format Datetime.\n $today = new DateTime();\n\n // On cherche dans chaque tableau de saison si le mois actuel correspond.\n foreach(self::$seasons as $key => $season){\n\n // Si une correspondance est trouvée, on retourne la clef, qui s'avère être le nom de la saison.\n if(in_array($today->format(\"m\"), $season)){\n\n return $key;\n }\n }\n // Ne devrait jamais apparaître.\n return(\"Aucune saison en cours\");\n }", "function galaxy_show_ranking_unique_player($player, $last = false) {\n\tglobal $db;\n\n\t$ranking = array();\n\n\t$request = \"select datadate, rank, points\";\n\t$request .= \" from \".TABLE_RANK_PLAYER_POINTS;\n\t$request .= \" where player = '\".mysql_real_escape_string($player).\"'\";\n\t$request .= \" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate, $rank, $points) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"general\"] = array(\"rank\" => $rank, \"points\" => $points);\n\t\tif ($last) break;\n\t}\n\n\t$request = \"select datadate, rank, points\";\n\t$request .= \" from \".TABLE_RANK_PLAYER_FLEET;\n\t$request .= \" where player = '\".mysql_real_escape_string($player).\"'\";\n\t$request .= \" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate, $rank, $points) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"fleet\"] = array(\"rank\" => $rank, \"points\" => $points);\n\t\tif ($last) break;\n\t}\n\n\t$request = \"select datadate, rank, points\";\n\t$request .= \" from \".TABLE_RANK_PLAYER_RESEARCH;\n\t$request .= \" where player = '\".mysql_real_escape_string($player).\"'\";\n\t$request .= \" order by datadate desc\";\n\t$result = $db->sql_query($request);\n\twhile (list($datadate, $rank, $points) = $db->sql_fetch_row($result)) {\n\t\t$ranking[$datadate][\"research\"] = array(\"rank\" => $rank, \"points\" => $points);\n\t\tif ($last) break;\n\t}\n\n\treturn $ranking;\n}", "function getPlayerFantasyStats($Field = '', $Where = array(), $multiRecords = FALSE, $PageNo = 1, $PageSize = 15)\n {\n $Params = array();\n if (!empty($Field)) {\n $Params = array_map('trim', explode(',', $Field));\n $Field = '';\n $FieldArray = array(\n 'MatchNo' => 'M.MatchNo',\n 'SeriesGUID' => 'M.SeriesGUID',\n 'MatchLocation' => 'M.MatchLocation',\n 'MatchStartDateTime' => 'DATE_FORMAT(CONVERT_TZ(M.MatchStartDateTime,\"+00:00\",\"' . DEFAULT_TIMEZONE . '\"), \"' . DATE_FORMAT . ' \") MatchStartDateTime',\n 'TeamNameLocal' => 'TL.TeamName AS TeamNameLocal',\n 'TeamNameVisitor' => 'TV.TeamName AS TeamNameVisitor',\n 'TeamNameShortLocal' => 'TL.TeamNameShort AS TeamNameShortLocal',\n 'TeamNameShortVisitor' => 'TV.TeamNameShort AS TeamNameShortVisitor',\n 'TeamFlagLocal' => 'IF(TL.TeamFlag IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/TeamFlag/\",\"team.png\"), CONCAT(\"' . BASE_URL . '\",\"uploads/TeamFlag/\",TL.TeamFlag)) TeamFlagLocal',\n 'TeamFlagVisitor' => 'IF(TV.TeamFlag IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/TeamFlag/\",\"team.png\"), CONCAT(\"' . BASE_URL . '\",\"uploads/TeamFlag/\",TV.TeamFlag)) TeamFlagVisitor',\n 'TotalPoints' => 'TP.TotalPoints',\n 'PlayerSelectedPercent' => 'TP.SelectionPercent PlayerSelectedPercent',\n 'TotalTeams' => '(SELECT COUNT(UserTeamName) FROM `sports_users_teams` WHERE `MatchID` = M.MatchID) TotalTeams'\n );\n if ($Params) {\n foreach ($Params as $Param) {\n $Field .= (!empty($FieldArray[$Param]) ? ',' . $FieldArray[$Param] : '');\n }\n }\n }\n $this->db->select('M.MatchGUID');\n if (!empty($Field))\n $this->db->select($Field, FALSE);\n $this->db->from('tbl_entity E, sports_matches M, sports_teams TL, sports_teams TV, sports_team_players TP');\n $this->db->where(\"E.EntityID\", \"M.MatchID\", FALSE);\n $this->db->where(\"M.MatchID\", \"TP.MatchID\", FALSE);\n $this->db->where(\"M.TeamIDLocal\", \"TL.TeamID\", FALSE);\n $this->db->where(\"M.TeamIDVisitor\", \"TV.TeamID\", FALSE);\n if (!empty($Where['SeriesID'])) {\n $this->db->where(\"TP.SeriesID\", $Where['SeriesID']);\n }\n if (!empty($Where['MatchID'])) {\n $this->db->where(\"TP.MatchID\", $Where['MatchID']);\n }\n if (!empty($Where['PlayerID'])) {\n $this->db->where(\"TP.PlayerID\", $Where['PlayerID']);\n }\n if (!empty($Where['StatusID'])) {\n $this->db->where(\"E.StatusID\", $Where['StatusID']);\n }\n if (!empty($Where['OrderBy']) && !empty($Where['Sequence'])) {\n $this->db->order_by($Where['OrderBy'], $Where['Sequence']);\n } else {\n $this->db->order_by('M.MatchStartDateTime', 'DESC');\n }\n\n /* Total records count only if want to get multiple records */\n if ($multiRecords) {\n $TempOBJ = clone $this->db;\n $TempQ = $TempOBJ->get();\n $Return['Data']['TotalRecords'] = $TempQ->num_rows();\n if ($PageNo != 0) {\n $this->db->limit($PageSize, paginationOffset($PageNo, $PageSize)); /* for pagination */\n }\n } else {\n $this->db->limit(1);\n }\n $Query = $this->db->get();\n if ($Query->num_rows() > 0) {\n if ($multiRecords) {\n $Return['Data']['Records'] = $Query->result_array();\n return $Return;\n } else {\n return $Query->row_array();\n }\n }\n return FALSE;\n }", "function xstats_displayAllFights( $gameId ) {\n include ('../../inc.conf.php');\n echo '<br><h4>Liste aller Raumk&auml;mpfe nach Runden</h4>';\n $query = \"SELECT * FROM skrupel_xstats_ships ships,skrupel_xstats_shipvsship shipvsship WHERE shipvsship.shipid=ships.shipid AND (shipvsship.fightresult=2 OR shipvsship.fightresult=3) AND shipvsship.gameid=\".$gameId.\" AND ships.gameid=\".$gameId.\" ORDER BY turn,shipvsship.id\";\n $result = @mysql_query( $query ) or die(mysql_error());\n echo '<table class=\"shiptable\" border=\"0\">';\n echo '<tr><th>Runde</th><th colspan=\"3\">Kampf</th><th>H&uuml;llenschaden</tr>';\n while ($row = mysql_fetch_array($result)) {\n echo \"<tr>\";\n //turn\n echo '<td class=\"highlight\">'.$row['turn'].'</td>';\n echo '<td>';\n //get victorous ship\n $query = \"SELECT * FROM skrupel_xstats_ships WHERE gameid=\".$gameId.\" AND shipid=\".$row['enemyshipid'];\n $victoryResult = @mysql_query( $query ) or die(mysql_error());\n $victoryRow = mysql_fetch_array($victoryResult);\n echo xstats_getShipFullDescription( $gameId, $victoryRow['shipid'], $victoryRow['shiprace'], $victoryRow['picturesmall'], $victoryRow['experience'], $row['turn'],$victoryRow['shipclass'],$victoryRow['shipname']);\n echo '</td><td>';\n if( $row['fightresult'] == 2) {\n $turnToUse = $row['turn'];\n echo ' zerst&ouml;rt ';\n }else {\n echo ' erobert ';\n //display the formerly owner of this ship\n $turnToUse = $row['turn']-1;\n }\n echo '</td><td>';\n echo xstats_getShipFullDescription( $gameId, $row['shipid'], $row['shiprace'], $row['picturesmall'], $row['experience'], $turnToUse,$row['shipclass'],$row['shipname']);\n echo '</td>';\n //get hull damage of winning ship\n $query = \"SELECT * FROM skrupel_xstats_shipvsship WHERE shipid=\".$row['enemyshipid'].\" AND enemyshipid=\".$row['shipid'].\" AND gameid=\".$gameId;\n $winnerResult = @mysql_query( $query ) or die(mysql_error());\n $winnerResult = mysql_fetch_array($winnerResult);\n $hullDamage = $winnerResult['hulldamage'];\n echo '<td>'.$hullDamage.'%';\n //hull damage bar\n echo '<div class=\"hulldamage\">';\n echo '<div style=\"width: '.(100-$hullDamage).'%\"></div>';\n echo '</div>';\n echo '</td>';\n echo \"</tr>\";\n }\n echo '</table>';\n}", "public function getTeams(string $league, int $season = null)\n {\n $season = $season ?? date('Y');\n\n return Cache::remember('season_teams_'.$league.'_'.$season, $this->cacheTime, function () use ($league, $season) {\n $response = $this->client->request('GET', 'getavailableteams/'.$league.'/'.$season);\n\n return collect(\n json_decode(\n (string) $response->getBody()\n )\n )->transform(function ($item, $key) {\n return [\n 'id' => $item->TeamId,\n 'name' => $item->TeamName,\n 'shortName' => $item->ShortName,\n 'icon' => $item->TeamIconUrl,\n 'win' => 0,\n 'loss' => 0,\n ];\n })->keyBy('id');\n });\n }", "protected function createJsonSeason($gamesArray, Season $season)\n {\n $getNow = new \\Carbon\\Carbon();\n $getNow->addDay(-1);\n $nextDate = new \\Carbon\\Carbon();\n $nextDate->addDay(14);\n\n $arrayJson = array();\n $arrayJson['seasonData'] = $season;\n $arrayJson['absenceData'] = $this->absence->getSeasonAbsenceArray($season->id);\n $arrayJson['groupUserData'] = $this->team->getSeasonUsers($season->id);\n $arrayJson['generateGroupUserData'] = $season->group->groupUsers;\n\n $x=0;\n $y=0;\n foreach ($gamesArray as $game) {\n $datum = $game['datum'];\n\n $prepareGroupUser = $arrayJson['generateGroupUserData'] ;\n if(count($arrayJson['groupUserData']) > 0){\n $prepareGroupUser = $arrayJson['groupUserData'];\n }\n \n foreach($prepareGroupUser AS $groupUser){\n $arrayJson['data'][$y]['user'][$groupUser['id']]['groupUser'] = $groupUser['id'];\n $arrayJson['data'][$y]['user'][$groupUser['id']]['team'] = \"\";\n $arrayJson['data'][$y]['user'][$groupUser['id']]['teamId'] =\"\";\n $arrayJson['data'][$y]['user'][$groupUser['id']]['replacement'] = 0;\n }\n \n if ($getNow <= \\Carbon\\Carbon::parse($datum) && $nextDate >= \\Carbon\\Carbon::parse($datum)) {\n $arrayJson['currentPlayDay'] = $y;\n $nextDate->addDay(-14);\n }\n\n for ($z=1;$z<=4;$z++) {\n $team = 'team'.$z;\n $teamplayerOne = isset($game[$team]['player1']) === true ? $game[$team]['player1'] : \"\";\n $teamplayerTwo = isset($game[$team]['player2']) === true ? $game[$team]['player2'] : \"\";\n\n isset($arrayJson['stats'][$teamplayerOne][$team]) === true ? $arrayJson['stats'][$teamplayerOne][$team]++ : $arrayJson['stats'][$teamplayerOne][$team] = 1;\n isset($arrayJson['stats'][$teamplayerTwo][$team]) === true ? $arrayJson['stats'][$teamplayerTwo][$team]++ : $arrayJson['stats'][$teamplayerTwo][$team] = 1;\n isset($arrayJson['stats'][$teamplayerOne]['total']) === true ? $arrayJson['stats'][$teamplayerOne]['total']++ : $arrayJson['stats'][$teamplayerOne]['total'] = 1;\n isset($arrayJson['stats'][$teamplayerTwo]['total']) === true ? $arrayJson['stats'][$teamplayerTwo]['total']++ : $arrayJson['stats'][$teamplayerTwo]['total'] = 1;\n \n $x++;\n $teamId = 0;\n $arrayJson['data'][$y]['day'] = $datum;\n if($teamplayerOne > 0){\n $teamId = isset($game[$team][$teamplayerOne]['teamId']) === true ? $game[$team][$teamplayerOne]['teamId'] : \"\";\n\n $arrayJson['data'][$y]['user'][$teamplayerOne]['groupUser'] = $teamplayerOne;\n $arrayJson['data'][$y]['user'][$teamplayerOne]['team'] = $team;\n $arrayJson['data'][$y]['user'][$teamplayerOne]['teamId'] = $teamId;\n if(isset($game['teamIds'][$teamId]['replacement']) === true){\n $arrayJson['data'][$y]['user'][$teamplayerOne]['replacement'] = $game['teamIds'][$teamId]['replacement'];\n }\n }\n\n if($teamplayerTwo > 0){\n $teamId = isset($game[$team][$teamplayerTwo]['teamId']) === true ? $game[$team][$teamplayerTwo]['teamId'] : \"\";\n\n $arrayJson['data'][$y]['user'][$teamplayerTwo]['groupUser'] = $teamplayerTwo;\n $arrayJson['data'][$y]['user'][$teamplayerTwo]['team'] = $team;\n $arrayJson['data'][$y]['user'][$teamplayerTwo]['teamId'] = $teamId;\n if(isset($game['teamIds'][$teamId]['replacement']) === true){\n $arrayJson['data'][$y]['user'][$teamplayerTwo]['replacement'] = $game['teamIds'][$teamId]['replacement'];\n }\n }\n /** end new array to build the calendar */\n\n }\n /** new array to build the calendar */\n $arrayJson['data'][$y]['day'] = $datum;\n if(isset($game['teamIds']) === true){\n foreach($game['teamIds'] AS $teamIds){\n $teamId = $teamIds['teamId'];\n $arrayJson['data'][$y]['teams'][$teamId]['teamId'] = $teamId;\n $arrayJson['data'][$y]['teams'][$teamId]['team'] = $teamIds['team'];\n $arrayJson['data'][$y]['teams'][$teamId]['groupUserId'] = $teamIds['groupUserId'];\n }\n } \n /** end new array to build the calendar */\n $y++;\n }\n return $arrayJson;\n }", "public function calculateAllTeamsPlayerValues(){\n $view= $this->view;\n $view->setNoRender();\n $peopleService = parent::getService('people','people');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n Service::loadModels('rally', 'rally');\n $season = $leagueService->getCurrentSeason();\n $peopleService->calculateNewValuesForAllPlayers($season);\n echo \"good\";\n }", "function get_standing_driver($idSeason)\n{\n $table_standing = get_standing_driver_db($idSeason);\n return $table_standing;\n}", "function load_sports(){\n\tglobal $conn, $show_debug, $sports;\n\t\n\t$sports=array();\n\t\n\t$sql = \"SELECT id,\n\t\t\tdescription,\n\t\t\tdisplay_index\n\t\tFROM sporttype\n\t\tORDER BY display_index ASC;\";\n\t$result = $conn->query($sql);\n\tif($show_debug && !$result)echo mysqli_error($conn);\n\t\n\tif ($result->num_rows > 0) {\n\t\t// output data of each row\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\tif(is_numeric($row[\"id\"])){\n\t\t\t\t$sports[$row[\"id\"]]=array(\n\t\t\t\t\t\"description\" => $row[\"description\"],\n\t\t\t\t\t\"display_index\" => $row[\"display_index\"]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}", "public function testRanking()\n {\n\n $results = [\n\n [\n \"bracket\" => \"WB\",\n \"rounds\" => [\n [\n\n \"round\" => 1,\n \"matches\" => [\n [\n \"name\" => \"1.1\",\n \"scores\" => [\n [\"player_id\" => \"Dan\", \"score\" => 2],\n [\"player_id\" => \"Taru\", \"score\" => 0],\n ]\n ],\n [\n \"name\" => \"1.2\",\n \"scores\" => [\n [\"player_id\" => \"Michael\", \"score\" => 1],\n [\"player_id\" => \"JP\", \"score\" => 0],\n ]\n ],\n [\n \"name\" => \"1.3\",\n \"scores\" => [\n [\"player_id\" => \"Phelix\", \"score\" => 0],\n [\"player_id\" => \"Sykes\", \"score\" => 2],\n ]\n ],\n [\n \"name\" => \"1.4\",\n \"scores\" => [\n [\"player_id\" => \"Calvin\", \"score\" => 1],\n [\"player_id\" => \"Jordan\", \"score\" => 4],\n ]\n ]\n ]\n ],\n [\n \"round\" => 2,\n \"matches\" => [\n [\n \"name\" => \"2.1\",\n \"scores\" => [\n [\"player_id\" => \"Jordan\", \"score\" => 2],\n [\"player_id\" => \"Sykes\", \"score\" => 1],\n ]\n ],\n [\n \"name\" => \"2.2\",\n \"scores\" => [\n [\"player_id\" => \"Michael\", \"score\" => 0],\n [\"player_id\" => \"Dan\", \"score\" => 5],\n ]\n ]\n ]\n ],\n [\n \"round\" => 3,\n \"matches\" => [\n [\n \"name\" => \"3.1\",\n \"scores\" => [\n [\"player_id\" => \"Dan\", \"score\" => 1],\n [\"player_id\" => \"Jordan\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 4,\n \"matches\" => [\n [\n \"name\" => \"4.1\",\n \"scores\" => [\n [\"player_id\" => \"Dan\", \"score\" => 2],\n [\"player_id\" => \"Phelix\", \"score\" => 4],\n ]\n ]\n ]\n ]\n ]\n ],\n [\n \"bracket\" => \"LB\",\n \"rounds\" => [\n\n [\n\n \"round\" => 1,\n \"matches\" => [\n [\n \"name\" => \"1.1L\",\n \"scores\" => [\n [\"player_id\" => \"Phelix\", \"score\" => 1],\n [\"player_id\" => \"Taru\", \"score\" => 0],\n ]\n ],\n [\n \"name\" => \"1.2L\",\n \"scores\" => [\n [\"player_id\" => \"JP\", \"score\" => 2],\n [\"player_id\" => \"Calvin\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 2,\n \"matches\" => [\n [\n \"name\" => \"2.1L\",\n \"scores\" => [\n [\"player_id\" => \"Sykes\", \"score\" => 2],\n [\"player_id\" => \"Phelix\", \"score\" => 3],\n ]\n ],\n [\n \"name\" => \"2.2L\",\n \"scores\" => [\n [\"player_id\" => \"Michael\", \"score\" => 2],\n [\"player_id\" => \"JP\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 3,\n \"matches\" => [\n [\n \"name\" => \"3.1L\",\n \"scores\" => [\n [\"player_id\" => \"Phelix\", \"score\" => 2],\n [\"player_id\" => \"Michael\", \"score\" => 0],\n ]\n ]\n ]\n ],\n [\n \"round\" => 4,\n \"matches\" => [\n [\n \"name\" => \"4.1L\",\n \"scores\" => [\n [\"player_id\" => \"Jordan\", \"score\" => 2],\n [\"player_id\" => \"Phelix\", \"score\" => 3],\n ]\n ]\n ]\n ]\n ]\n ]\n ];\n\n $response = DoubleElimination::generateStageLeaderboard($results);\n\n //print_r($response);\n\n $this->assertNotEmpty($response);\n }", "function getQuizzesByStreamId($id) {\n $response = array();\n $sql = \"select q.id,q.questionIds,q.description,q.descriptionShort,q.difficulty,q.allotedTime,q.maxScore,q.rec,q.conceptsTested, q.l2Ids, q.l3Ids, q.typeId, f.id as fid, f.firstName,f.lastName from quizzes q, faculty f where q.facultyId=f.id and q.streamId=:id\";\n try {\n $db = getConnection();\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"id\", $id);\n $stmt->execute();\n $records = $stmt->fetchAll(PDO::FETCH_OBJ);\n $db = null;\n $response[\"status\"] = SUCCESS;\n $response[\"data\"] = $records;\n } catch (PDOException $e) {\n $response[\"status\"] = ERROR;\n $response[\"data\"] = EXCEPTION_MSG;\n phpLog($e->getMessage());\n }\n sendResponse($response);\n}" ]
[ "0.65013796", "0.64354765", "0.596145", "0.5950508", "0.5843987", "0.5732962", "0.57239294", "0.56512773", "0.5606506", "0.5581604", "0.5528315", "0.55240315", "0.5465417", "0.546038", "0.53826463", "0.5326893", "0.53207844", "0.5304753", "0.5302938", "0.5300947", "0.5270942", "0.5259565", "0.5229024", "0.5229024", "0.52203053", "0.5219834", "0.5211865", "0.5206089", "0.52006924", "0.5133451", "0.511311", "0.51065195", "0.5100114", "0.50786835", "0.5078512", "0.5072104", "0.50697035", "0.50516987", "0.5021253", "0.5020606", "0.501807", "0.50172335", "0.5012683", "0.5010308", "0.4999427", "0.49929428", "0.49839157", "0.4980625", "0.49797365", "0.496435", "0.49613535", "0.49496368", "0.49388725", "0.49264812", "0.4923734", "0.4918056", "0.49048644", "0.49023238", "0.49016544", "0.48957837", "0.4894392", "0.48875803", "0.48830628", "0.48749012", "0.48696285", "0.48647106", "0.4861828", "0.48520744", "0.4851254", "0.48500133", "0.48479933", "0.48328406", "0.481809", "0.48173422", "0.481556", "0.4811944", "0.4804945", "0.48033947", "0.48017883", "0.47965428", "0.4795914", "0.47905314", "0.4788397", "0.478463", "0.47822928", "0.477774", "0.47630566", "0.4762925", "0.4759532", "0.47574887", "0.4750512", "0.475016", "0.47488567", "0.47443885", "0.4743983", "0.47436908", "0.47425753", "0.47422612", "0.47408006", "0.47368982" ]
0.7893726
0
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424" ]
0.0
-1
Generates the password hash.
public function hashPassword($password) { return crypt($password, $this->generateSalt()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateHash (string $password): string;", "private function generate_pass()\n {\n echo password_hash('admin', PASSWORD_BCRYPT);\n }", "public function pwgen()\n\t{\n\t\t// $timetarget = 0.05;\n\t\t// $cost = 8;\n\t\t// do {\n\t\t// \t$cost++;\n\t\t// \t$start = microtime(true);\n\t\t// \tpassword_hash(\"testing\", PASSWORD_BCRYPT, ['cost' => $cost]);\n\t\t// \t$end = microtime(true);\n\t\t// \techo \"{$cost}<br><hr>\";\n\t\t// } while (($end - $start) < $timetarget);\n\t\t// selesai mencari $argon2i$v=19$m=1024,t=2,p=2$czZrU3NmSkwyZWFCZzZqcg$4BCXT3Xjj+nwslQZOa8I2rO760hSmVmzCiSQ/8cfcDs\n\n\t\t$a = password_hash('admin', PASSWORD_ARGON2I);\n\t\techo \"{$a}<br>\";\n\t\t$b = password_verify('superadmin', $a);\n\t\techo \"{$b}\";\n\t\tdie();\n\t}", "public static function generateHash($password) {\n\t$chars = array(1 => '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');\n\t$max = count($chars);\n\t$prefix = '';\n\t$postfix = '';\n\tfor ($i = 0; $i < 16; $i++) {\n\t $prefix .= $chars[mt_rand(1,$max)];\n\t $postfix .= $chars[mt_rand(1,$max)];\n\t}\n\treturn $prefix.self::hash($prefix.$password.$postfix).$postfix;\n }", "public static function generatePassword()\n {\n return bcrypt(str_random(35));\n }", "function cafet_generate_hashed_pwd(string $password): string\n {\n $salt = base64_encode(random_bytes(32));\n $algo = in_array(Config::hash_algo, hash_algos()) ? Config::hash_algo : 'sha256';\n \n return $algo . '.' . $salt . '.' . cafet_digest($algo, $salt, $password);\n }", "public static function generatePassword()\n {\n return bcrypt(str_random(35));\n }", "public static function generatePassword()\n {\n return bcrypt(str_random(35));\n }", "public function generatePasswordHash($password)\n {\n $this->password_hash = Yii::$app->security->generatePasswordHash($password);\n }", "public function generatePasswordHash($password)\n {\n return Yii::$app->security->generatePasswordHash($password);\n }", "public function createHash($password){\r\n $options = [\r\n 'cost' => 10,\r\n ];\r\n $hash = password_hash($password, PASSWORD_DEFAULT, $options);\r\n return $hash;\r\n}", "public function GetPasswordHash ();", "public static function getGeneratedPasswordHash($password) {\n\t\tif (self::checkIsAvailableCryptBlowFish()) {\n\n\t\t\t$salt = '$2y$11$' . substr(md5(uniqid(mt_rand(), true)), 0, 22);\n\t\t\treturn crypt($password, $salt);\n\t\t}\n\n\t\treturn md5($password);\n\t}", "public static function generatePassword() {\r\n return StringGenerator::generateRandomAlphaAndNumbersAndSpecial(12);\r\n }", "public function generateHash($password)\n {\n return password_hash($password, PASSWORD_BCRYPT);\n }", "public function generateHash()\n {\n do {\n $hash = Security::randomString(8);\n } while ($this->exists(['hash' => $hash]));\n\n return $hash;\n }", "function GenerateHashPassword($pass){\n\treturn password_hash($pass, PASSWORD_DEFAULT);\n}", "public static function generate_password()\n\t{\n\t\t$chars = array(\n\t\t\t'a','b','c','d','e','f','g','h','i','j','k','l','m','n',\n\t\t\t'o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D',\n\t\t\t'E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T',\n\t\t\t'U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9','0',\n\t\t\t'!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','~',\n\t\t\t'}','[',']','|','/','?','>','<',':',';'\n\t\t);\n\n\t\t$new_pw = '';\n\t\tfor($i=0;$i<20;$i++)\n\t\t{\n\t\t\t$new_pw .= $chars[rand(0, count($chars)-1)];\n\t\t}\n\n\t\treturn $new_pw;\n\t}", "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 CreateHash($password){\n\t$salt = date('U'); //creates different password each time\n\t$pass = crypt($password, $salt);\n\treturn $pass;\n}", "protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}", "public function generate_pw(){\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n $pass = str_shuffle($alphabet);\n $pass = substr($pass, 0, 8);\n $this->setPassword($pass);\n return $pass; //turn the array into a string\n }", "public function password() {\n return Hash::make('MonsterRXBOCS');\n }", "function wp_hash_password( $password ) {\n\t\t$cost = apply_filters( 'wp_hash_password_cost', 10 );\n\n\t\treturn password_hash( $password, PASSWORD_DEFAULT, [ 'cost' => $cost ] );\n\t}", "function generatePassword($password)\n{\n $password = hash('sha256', hash('sha256', $password)); // . \"brightisagoodguy1234567890\" . strtolower($password));\n \n return $password;\n \n}", "function hashPassword($password) {\n $cost = 10;\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt;\n return crypt($password, $salt);\n }", "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "private function genPass() {\r\n $random = 0;\r\n $rand78 = \"\";\r\n $randpass = \"\";\r\n $pass = \"\";\r\n $maxcount = rand( 4, 9 );\r\n // The rand() limits (min 4, max 9) don't actually limit the number\r\n // returned by rand, so keep looping until we have a password that's\r\n // more than 4 characters and less than 9.\r\n if ( ($maxcount > 8) or ( $maxcount < 5) ) {\r\n do {\r\n $maxcount = rand( 4, 9 );\r\n } while ( ($maxcount > 8) or ( $maxcount < 5) );\r\n }\r\n $rand78 = \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-=_+abcdefghijklmnopqrstuvwxyz\";\r\n for ( $count = 0; $count <= $maxcount; $count++ ) {\r\n $random = rand( 0, 77 );\r\n $randpass = substr( $rand78, $random, 1 );\r\n $pass = $pass . $randpass;\r\n }\r\n $pass = substr( $pass, 0, 8 ); // Just in case\r\n return($pass);\r\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}", "public function createPassword($password){\r\n return password_hash($password, PASSWORD_DEFAULT);\r\n }", "public function generateHash()\n {\n $userContext = new UserContext();\n\n foreach ($this->providers as $provider) {\n $provider->updateUserContext($userContext);\n }\n\n $parameters = $userContext->getParameters();\n\n // Sort by key (alphanumeric), as order should not make hash vary\n ksort($parameters);\n\n return hash('sha256', serialize($parameters));\n }", "function generatePassword() {\n\t//* (c) Hitech Scripts 2003\n\t//* For more information, visit http://www.hitech-scripts.com\n\t//* modified for phpgiftreg by Chris Clonch\n\tmt_srand((double) microtime() * 1000000);\n\t$newstring = \"\";\n\tif ($GLOBALS[\"OPT\"][\"password_length\"] > 0) {\n\t\twhile(strlen($newstring) < $GLOBALS[\"OPT\"][\"password_length\"]) {\n\t\t\tswitch (mt_rand(1,3)) {\n\t\t\t\tcase 1: $newstring .= chr(mt_rand(48,57)); break; // 0-9\n\t\t\t\tcase 2: $newstring .= chr(mt_rand(65,90)); break; // A-Z\n\t\t\t\tcase 3: $newstring .= chr(mt_rand(97,122)); break; // a-z\n\t\t\t}\n\t\t}\n\t}\n\treturn $newstring;\n}", "public function generatePassword() {\n $generator = new UriSafeTokenGenerator();\n $token = $generator->generateToken();\n return substr($token, 0, 6);\n }", "public function calculateHash($password)\n\t{\n\t\treturn md5($password . str_repeat('*enter any random salt here*', 10));\n\t}", "private function generateMD5Pass() {\n $plaintext = $this->generator->generateString(8, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^+');\n $hash = md5($plaintext);\n return $hash;\n }", "public function generatePassword()\n {\n $a = $this->generateUsername();\n $b = random_int(0, 9);\n $c = random_int(0, 9);\n $d = random_int(0, 9);\n return \"$a$b$c$d\";\n }", "public function hash_pword($hashme){\n return password_hash($hashme, PASSWORD_BCRYPT);/* md5(sha1($hashme)) */;\n\n}", "function getPasswordHash($password)\r\n {\r\n return ( hash( 'whirlpool', $password ) );\r\n }", "function generatePW($email){\n $pw = password_hash($email,PASSWORD_DEFAULT);\n return $pw;\n }", "private function generatePassword() {\n // account is not wide open if conventional logins are permitted\n $guid = '';\n\n for ($i = 0; ($i < 8); $i++) {\n $guid .= sprintf(\"%x\", mt_rand(0, 15));\n }\n\n return $guid;\n }", "public static function generatePassword()\n\t{\n\t\t$consonants = array(\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\");\n\t\t$vocals = array(\"a\", \"e\", \"i\", \"o\", \"u\");\n\n\t\t$password = '';\n\n\t\tsrand((double)microtime() * 1000000);\n\t\tfor ($i = 1; $i <= 4; $i++) {\n\t\t\t$password .= $consonants[rand(0, 19)];\n\t\t\t$password .= $vocals[rand(0, 4)];\n\t\t}\n\t\t$password .= rand(0, 9);\n\n\t\treturn $password;\n\t}", "private function generatePasswordHash($string)\n\t{\n\t\t$string = is_string($string) ? $string : strval($string);\n\t\t$pwHash = encrypto($string);\n\t\treturn $pwHash;\n\t}", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}", "function generatePassword() {\n //Initialize the random password\n $password = '';\n\n //Initialize a random desired length\n $desired_length = rand(8, 12);\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for ($length = 0; $length < $desired_length; $length++) {\n //Append a random ASCII character (including symbols)\n $password .= $characters[mt_rand(0, strlen($characters) - 1)];\n }\n\n return $password;\n }", "public function generatePassword()\n {\n $characters = str_shuffle('abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789');\n\n return substr($characters, 0, 6);\n }", "public static function generateHash()\n {\n $result = '';\n $charPool = '0123456789abcdefghijklmnopqrstuvwxyz';\n for ($p = 0; $p < 15; $p++) {\n $result .= $charPool[mt_rand(0, strlen($charPool) - 1)];\n }\n\n return sha1(md5(sha1($result)));\n }", "function makeHash($password) {\r\n return crypt($password, makeSalt());\r\n}", "function returnGeneratedPassword ($_passwordLength) {\n\t\treturn substr(\n\t\t\tstr_shuffle(\n\t\t\t\tstrtolower(sha1(rand().time().\"245kngr6poksalmqwytwdihixqFGXYFJJUNT3ZSUAP90EB17VCMZcBHVEord8L\"))),0, $_passwordLength);\n\t}", "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 static function make(string $password, $algo = PASSWORD_DEFAULT) : string {\n\t return password_hash($password, $algo);\n }", "public static function generatePassword() {\n\t\t$consonants = array (\n\t\t\t\t\"b\",\n\t\t\t\t\"c\",\n\t\t\t\t\"d\",\n\t\t\t\t\"f\",\n\t\t\t\t\"g\",\n\t\t\t\t\"h\",\n\t\t\t\t\"j\",\n\t\t\t\t\"k\",\n\t\t\t\t\"l\",\n\t\t\t\t\"m\",\n\t\t\t\t\"n\",\n\t\t\t\t\"p\",\n\t\t\t\t\"r\",\n\t\t\t\t\"s\",\n\t\t\t\t\"t\",\n\t\t\t\t\"v\",\n\t\t\t\t\"w\",\n\t\t\t\t\"x\",\n\t\t\t\t\"y\",\n\t\t\t\t\"z\" \n\t\t);\n\t\t$vocals = array (\n\t\t\t\t\"a\",\n\t\t\t\t\"e\",\n\t\t\t\t\"i\",\n\t\t\t\t\"o\",\n\t\t\t\t\"u\" \n\t\t);\n\t\t\n\t\t$password = '';\n\t\t\n\t\tsrand ( ( double ) microtime () * 1000000 );\n\t\tfor($i = 1; $i <= 4; $i ++) {\n\t\t\t$password .= $consonants [rand ( 0, 19 )];\n\t\t\t$password .= $vocals [rand ( 0, 4 )];\n\t\t}\n\t\t$password .= rand ( 0, 9 );\n\t\t\n\t\treturn $password;\n\t}", "public function generateSecurePassword()\n {\n\n try {\n // Generate the random salt, \n // replace byte por byte for utf8 support\n $this->_salt = strtr(base64_encode(mcrypt_create_iv(22, MCRYPT_DEV_URANDOM)), '+', '.');\n\n // generate the password with the salt\n $this->password = password_hash($this->password, PASSWORD_BCRYPT, ['salt' => $this->_salt]);\n } catch (\\Exception $ex) {\n \\kerana\\Exceptions::showError('LoginError', $ex);\n }\n }", "function lmhash($password = \"\") {\n $password = strtoupper($password);\n $password = substr($password, 0, 14);\n $password = str_pad($password, 14, chr(0));\n $p16 = $this->E_P16($password);\n for ($i = 0; $i < sizeof($p16); $i++) {\n $p16[$i] = sprintf(\"%02X\", $p16[$i]);\n }\n return join(\"\", $p16);\n }", "public function makePassword($pw)\n\t\t{\n\t\t\treturn $this->useHash ? sha1($pw . $this->salt) : $pw;\n\t\t}", "private static function _password($password, $hash)\n\t{\n\t\treturn md5(md5(md5($password)));\n\t}", "public function generarPassword() {\n $caracteres = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJCLMNOPQRSTUVWXYZ1234567890\";\n\n $aleatorio = '';\n for ($i = 0; $i < 5; $i++) {\n $caracter = rand(0, strlen($caracteres));\n $caracter = substr($caracteres, $caracter, 1);\n $aleatorio = $aleatorio . '' . $caracter;\n }\n\n return md5($aleatorio);\n }", "public static function makePassword()\n {\n $pass = \"\";\n $chars = array(\n \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\",\n \"a\", \"A\", \"b\", \"B\", \"c\", \"C\", \"d\", \"D\", \"e\", \"E\", \"f\", \"F\", \"g\", \"G\", \"h\", \"H\", \"i\", \"I\", \"j\", \"J\",\n \"k\", \"K\", \"l\", \"L\", \"m\", \"M\", \"n\", \"N\", \"o\", \"O\", \"p\", \"P\", \"q\", \"Q\", \"r\", \"R\", \"s\", \"S\", \"t\", \"T\",\n \"u\", \"U\", \"v\", \"V\", \"w\", \"W\", \"x\", \"X\", \"y\", \"Y\", \"z\", \"Z\");\n\n $count = count($chars) - 1;\n\n srand((double) microtime() * 1000000);\n\n for ($i = 0; $i < 8; $i++) {\n $pass .= $chars[rand(0, $count)];\n }\n\n return ($pass);\n }", "public function hashPassword($password)\n { \t\n \treturn md5($password);\n\t}", "function _hash_password($password)\n {\n //return altered pw\n\n }", "function generateSaltPassword () {\n\treturn base64_encode(random_bytes(12));\n}", "public static function generateRandomPassword ()\n {\n return rand(10000, 99999);\n }", "function generatePasswordHash($password = '', $nonce = '')\n{\n\t// validate inputs\n\tif (empty($password)\n\t\t|| empty($nonce)\n\t\t|| strlen($nonce) < 3\n\t){\n\t\treturn '';\n\n\t} // end if (empty($password) || empty($nonce) || strlen($nonce) < 3)\n\n\t// find the number of string parts\n\t$count = floor(strlen($password) / 3);\n\n\t// initialize array\n\t$temp = [];\n\n\t// disassemble password\n\tfor ($n=0; $n<4; $n++)\n\t{\n\t\t$temp[] = substr($password, $n*$count, $count);\n\n\t} // end for ($n=0; $n<3; $n++)\n\n\t// reassemble\n\treturn @md5(md5($temp[0]).md5($nonce[0]).md5($temp[1]).md5($nonce[1]).md5($temp[2]).md5($nonce[2]).md5($temp[3]).md5($nonce[3]).md5('&K#D&GV%A#G*&##N)1S6^&H'));\n\n}", "function pw_hash($password)\n{\n // A higher \"cost\" is more secure but consumes more processing power\n $cost = 10;\n\n // Create a random salt\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n\n // Prefix information about the hash so PHP knows how to verify it later.\n // \"$2a$\" Means we're using the Blowfish algorithm. The following two digits are the cost parameter.\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt;\n\n // Hash the password with the salt\n $hashed = crypt($password, $salt);\n\n return $hashed;\n}", "public static function hash($password){\n\t\t\treturn password_hash($password, PASSWORD_DEFAULT, self::getCost());\n\t\t}", "private function Hasher($password) {\r\n return password_hash($password, PASSWORD_BCRYPT);\r\n }", "function generateRandomPassword(){\n $n = 10;\n $result = bin2hex(random_bytes($n));\n return $result;\n }", "function get_password_hash( $password )\r\n\t\t{\r\n\t\t\treturn hash_hmac( 'sha256', $password, 'c#haRl891', false );\r\n\t\t\t\r\n\t\t}", "public function genaratepassword() {\r\r\n $length = 10;\r\r\n $alphabets = range('A', 'Z');\r\r\n $numbers = range('0', '9');\r\r\n $additional_characters = array('1', '3');\r\r\n $final_array = array_merge($alphabets, $numbers, $additional_characters);\r\r\n $password = '';\r\r\n while ($length--) {\r\r\n $key = array_rand($final_array);\r\r\n $password .= $final_array[$key];\r\r\n }\r\r\n return $password;\r\r\n }", "public static function hash($password): string\n {\n return md5($password);\n }", "public static function hash($password) {\r\n\t\treturn md5($password);\r\n\t}", "public function hash_user_pass($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n\n//PASSWORD_DEFAULT is a default function in PHP it contains BCRYPT algo at backend PHP is using BCRYPT currently\n//as it is most secure password hashing algorithm using today the term DEFAULT means that if another hashing algorithm is introduced in\n//future it will automatically updated to the library ny PHP so the developer has no need to update in the code.\n $hashing = password_hash($password.$salt, PASSWORD_DEFAULT);\n $hash = array(\"salt\" => $salt, \"hashing\" => $hashing);\n\n return $hash;\n\n}", "function createNewPassword() {\n\t $genKey = \"0123456789abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ!@#$%&*()_+\";//set the random generator key from a-z and A-Z and 0-9\n\t $pass = array(); //declare $pass as the variable to store array\n\t $genKeyLength = strlen($genKey) - 1; //put the length -1 in cache\n\t for ($i = 0; $i < 10; $i++) {\n\t $n = rand(0, $genKeyLength);//set $n to store the generated random key\n\t $pass[] = $genKey[$n]; //set $pass to store the array of generated key\n\t }\n\t return implode($pass); // used implode turn the array into a string\n\t}", "function hash_clients_pass($pass){\n\t//Get pepper options\n\t// require_once 'api-config.php';\n\n\t// echo \"<br>SHIT<br> \". getPepper() . \"<br>\";\n\t// $pepper = getPepper() ;\n\n\t$config_options = getConfigOptions();\n\n\t$pepper = $config_options['pepper'];\n\t$cost = $config_options['peppercost'];\n\n\t$hashedPass = password_hash($pass.$pepper, PASSWORD_DEFAULT, $cost);\n\n\treturn $hashedPass;\n}", "static private function getChangePasswordHash() {\r\n\t\treturn self::getRandomHash();\r\n\t}", "function HashPassword($input)\n{\n//Credits: http://crackstation.net/hashing-security.html\n//This is secure hashing the consist of strong hash algorithm sha 256 and using highly random salt\n$salt = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)); \n$hash = hash(\"sha256\", $salt . $input); \n$final = $salt . $hash; \nreturn $final;\n}", "public static function generatePassword ($length = 6 /* For generating tokens, 24 is recommended instead */, $numeric = false)\r\n\t{\r\n\t\t# Generate a numeric password if that is what is required\r\n\t\tif ($numeric) {\r\n\t\t\t\r\n\t\t\t# Start a string and build up the password\r\n\t\t\t$password = '';\r\n\t\t\tfor ($i = 0; $i < $length; $i++) {\r\n\t\t\t\t$password .= rand (0, 9);\r\n\t\t\t}\r\n\t\t\treturn $password;\r\n\t\t\t\r\n\t\t# Otherwise do an alphanumeric password; code from http://www.php.net/openssl-random-pseudo-bytes#96812\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t# Prefer OpenSSL implementation\r\n\t\t\tif (function_exists ('openssl_random_pseudo_bytes')) {\r\n\t\t\t\t$password = bin2hex (openssl_random_pseudo_bytes ($length, $strong));\t// bin2hex used so that characters guaranteed to be 0-9a-f, easily usable in a URL\r\n\t\t\t\tif ($strong == TRUE) {\r\n\t\t\t\t\treturn substr ($password, 0, $length);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Fallback to mt_rand if PHP <5.3 or no OpenSSL available\r\n\t\t\t$characters = '0123456789';\r\n\t\t\t$characters .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/+'; \r\n\t\t\t$charactersLength = strlen ($characters) - 1;\r\n\t\t\t$password = '';\r\n\t\t\tfor ($i = 0; $i < $length; $i++) {\r\n\t\t\t\t$password .= $characters[mt_rand (0, $charactersLength)];\r\n\t\t\t}\r\n\t\t\treturn $password;\r\n\t\t}\r\n\t}", "public function generate_new_passwords() {\n // all users added with \"password\" will be automatically sent a welcome message\n // and new password\n $resetpassword = 'password'; \n // get users\n $user_list = $this->get_user->get_all_users();\n // go through users \n foreach($user_list as $user) {\n // check if password is \"password\"\n $user_id = $user->user_id;\n if ($this->get_user->check_password($user_id, $resetpassword) == 1) {\n // generate simple random password\n $newpassword = uniqid();\n // write new password to database\n $data = array(\n 'password' => $newpassword\n );\n $this->get_user->update('user_id', $user_id, $data);\n // email user new password \n $this->send_password_mail($user_id, $newpassword);\n }\n \n }\n \n \n }", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "function generarPassword() {\n\t\t$str = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n\t\t$cad = \"\";\n\t\tfor ($i = 0; $i < 8; $i++) {\n\t\t\t$cad .= substr($str, rand(0, 62), 1);\n\t\t}\n\t\treturn $cad;\n\t}", "public function hashPassword(string $password): string\n {\n try {\n return sodium_bin2hex(sodium_crypto_generichash($password, \"\", 32));\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not generate password hash.', 0, $e);\n }\n }", "function generate_random_password($len = 8)\n {\n }", "function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }", "public static function hashPassword($password){\n $config = App_DI_Container::get('ConfigObject');\n $module = strtolower(CURRENT_MODULE);\n return sha1($config->{$module}->security->passwordsalt . $password);\n //return sha1($password);\n }", "public function generatePassword(int $length = 16): string \n {\n return bcrypt(str_random($length));\n }", "public function generateHash()\n {\n $this->hash = sha1(serialize($this->toArray()));\n }", "function generatePassword(&$Model, $length = 6) {\r\n\t\textract($this->settings[$Model->alias]);\r\n\t\t$salt = '';\r\n\t\tforeach ($passwordPolicies as $name => $policy) {\r\n\t\t\tif (isset($policy['salt'])) {\r\n\t\t\t\t$salt .= $policy['salt'];\r\n\t\t\t}\r\n\t\t\tif (isset($policy['length'])) {\r\n\t\t\t\t$length = max ($length, $policy['length']);\r\n\t\t\t}\r\n\t\t\tif ($name == $passwordPolicy) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$_id = $Model->id;\r\n\t\t$_data = $Model->data;\r\n\t\tdo {\r\n\t\t\t$Model->create();\r\n\t\t\t$password = $this->__generateRandom($length, $salt);\r\n\t\t\t$Model->data[$Model->alias][$fields['password']] = Security::hash($password, null, true);\r\n\t\t\t$Model->data[$Model->alias][$fields['password_confirm']] = $password;\r\n\t\t} while (!$Model->validates());\r\n\t\t$Model->create();\r\n\t\t$Model->id = $_id;\r\n\t\t$Model->data = $_data;\r\n\t\treturn $password;\r\n\t}", "function get_password_hash($password) {\n return crypt($password, \"$2a$07$\" . salt() . \"$\");\n}", "public static function generateHash($salt, $password) {\n $hash = crypt($password, $salt);\n return substr($hash, 29);\n }", "public function hash_password($password)\n {\n return password_hash($password, PASSWORD_BCRYPT, array('cost' => 13));\n }", "function genPassword($length=7){\n $newPass = \"\";\n for ($i = 0; $i < $length; $i++) {\n if (rand(0,1)){\n if (rand(0,1)){\n $newPass .= chr(rand(97,122));\n }else{\n $newPass .= chr(rand(65,90));\n }\n }else{\n $newPass .= chr(rand(48,57));\n }\n }\n return $newPass;\n}", "public function testGeneratePassword() {\n // Asking for a password 15 characters long\n $password = security::generate_password( 15 );\n\n // Make sure it's 15 characters\n $this->assertEquals( 15, strlen( $password ) );\n }", "function generateHash($plainText, $salt = null) // used in confirm-password.php, class.newuser.php, class.user.php, user-login.php, user-update-account.php\r\n\r\n{\r\n\r\n\tif ($salt === null)\r\n\r\n\t{\r\n\r\n\t\t$salt = substr(md5(uniqid(rand(), true)), 0, 25);\r\n\r\n\t}\r\n\r\n\telse\r\n\r\n\t{\r\n\r\n\t\t$salt = substr($salt, 0, 25);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\treturn $salt . sha1($salt . $plainText);\r\n\r\n}", "public function hash(string $password): string\n {\n return password_hash(\n $password,\n $this->config->get('api_settings.password.algorithm'),\n [\n 'memory_cost' => $this->config->get('api_settings.password.memory_cost'),\n 'time_cost' => $this->config->get('api_settings.password.time_cost'),\n 'threads' => $this->config->get('api_settings.password.threads')\n ]\n );\n }", "protected function generatePassword($prefix)\n {\n return $this->mathRandom->getUniqueHash($prefix);\n }", "public function hash($password) {\n\n return md5($password);\n }", "function XileroPasswordGenerator(string $username, string $password)\n {\n return md5($password . strtolower($username) . config('hashing.cipher_key'));\n }", "function makePassword() {\n $alphaNum = array(2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, g, h, i, j, k, m, n, p, q, r, s, t, u, v, w, x, y, z);\n srand ((double) microtime() * 1000000);\n $pwLength = \"7\"; // this sets the limit on how long the password is.\n for($i = 1; $i <=$pwLength; $i++) {\n $newPass .= $alphaNum[(rand(0,31))];\n }\n return ($newPass);\n}", "protected function makePassword($username, $password)\n\t{\n // \n\t\t// For version < 6 return md5(\"RS\" . $username . $password);\n return hash('sha256', md5('RS' . $username . $password)); \n\t}", "public function GetPasswordHash() {\n return $this->passwdHash;\n }", "public function encryptPassword($password) {\n return $this->crypto()->generateHash($password);\n }", "public static function make(string $value): string\n {\n return password_hash($value, PASSWORD_DEFAULT);\n }" ]
[ "0.7827893", "0.7688143", "0.7620867", "0.74186283", "0.732633", "0.731628", "0.72858495", "0.72858495", "0.7278988", "0.7139249", "0.7129045", "0.70919985", "0.7082377", "0.7027825", "0.70250845", "0.70067877", "0.6996234", "0.69781065", "0.69382405", "0.69306505", "0.6930255", "0.6910751", "0.69012994", "0.68916184", "0.6874935", "0.68732715", "0.6871035", "0.6786745", "0.67859334", "0.678389", "0.67799276", "0.67769647", "0.67737246", "0.67511576", "0.6730639", "0.6714665", "0.6713474", "0.6710658", "0.6704584", "0.6695745", "0.6659359", "0.66308594", "0.6627256", "0.66270924", "0.6615689", "0.6615371", "0.660333", "0.65902627", "0.6587723", "0.65847814", "0.65721315", "0.65644974", "0.6560458", "0.6558805", "0.6550064", "0.6543084", "0.65329397", "0.6529385", "0.65220475", "0.6518951", "0.65103257", "0.65036404", "0.650162", "0.6490791", "0.6490437", "0.64876074", "0.647907", "0.64783144", "0.64768255", "0.64736915", "0.6470986", "0.64626396", "0.64616555", "0.64498615", "0.6447587", "0.64393145", "0.6436101", "0.6435989", "0.6422048", "0.64120644", "0.6406474", "0.6404435", "0.6404366", "0.63996315", "0.6395975", "0.6390826", "0.6387975", "0.63871527", "0.6385809", "0.6379225", "0.63695407", "0.63674897", "0.6362171", "0.6361107", "0.6347424", "0.6345192", "0.6345137", "0.6344111", "0.63376296", "0.63229704", "0.6322659" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('username',$this->username,true); $criteria->compare('password',$this->password,true); $criteria->compare('email',$this->email,true); $criteria->compare('profile',$this->profile,true); $criteria->compare('fio',$this->fio,true); $criteria->compare('about',$this->about,true); $criteria->compare('dob',$this->dob,true); $criteria->compare('profession',$this->profession,true); $criteria->compare('image_name',$this->image_name,true); $criteria->compare('image_thumb',$this->image_thumb,true); $criteria->compare('user_status',$this->user_status,true); $criteria->compare('create_time',$this->create_time,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.5979308", "0.5970091", "0.59315383", "0.5928182", "0.59239197", "0.5891605", "0.588925", "0.5849558", "0.58478904", "0.58265656", "0.5818011", "0.5813345", "0.5808009", "0.5790819", "0.57766616", "0.57694167", "0.5765023", "0.57642305", "0.57522315", "0.5740738", "0.5738047", "0.5727545", "0.5724201", "0.5723084", "0.57225823", "0.5721401", "0.5718913", "0.5714439", "0.5712011", "0.5707315", "0.5694636", "0.5680138", "0.56711453", "0.5670484", "0.56703377", "0.56703377", "0.56703377", "0.5669673", "0.56673825", "0.56659126", "0.5656451", "0.5651109", "0.56498116", "0.564325", "0.5635642", "0.5633513", "0.56310356", "0.56235486", "0.56176996", "0.5612909", "0.560956", "0.5595046", "0.5579938", "0.557241", "0.5556209", "0.5550101", "0.55487776", "0.5547998", "0.5547349", "0.5535324", "0.5534813", "0.55342954", "0.55319065", "0.5525128", "0.55199116", "0.5518253", "0.55144674", "0.5509604", "0.55057275", "0.550087", "0.550019", "0.54966915", "0.54966915", "0.54966915", "0.54954666", "0.54937917", "0.5492664", "0.5492298", "0.5490264", "0.5489261", "0.54850507" ]
0.0
-1
Au pire changer BDD et mettre tag dans produit
public function getById($id) { $sql = "SELECT produit.*, artiste.nom as auteur, tag.nom as theme FROM produit, produit_artiste, artiste, produit_tag, tag WHERE produit.id = ? AND produit_artiste.id_produit = ? AND produit_artiste.id_artiste = artiste.id AND produit_tag.id_produit = ? AND produit_tag.id_tag = tag.id"; $pdo = $this->getPDO()->prepare($sql); $pdo->execute([$id, $id, $id]); $produit = $pdo->fetchAll(PDO::FETCH_ASSOC); $theme = []; foreach ($produit as $p) { $theme[] = $p["theme"]; } $theme = implode(" ", $theme); $product = call_user_func_array("array_merge", $produit); $product["theme"] = $theme; return $product; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddOrderTag()\n {\n }", "public function test_detachTagRequest() {\n\n }", "public function test_getReplenishmentProcessTags() {\n\n }", "public function testAddReplenishmentTag()\n {\n }", "public function test_addReplenishmentProcessTag() {\n\n }", "public function test_getTagRequest() {\n\n }", "public function testDeleteOrderTag()\n {\n }", "public function test_attachTagRequest() {\n\n }", "public function test_createTagRequest() {\n\n }", "public function testDeleteReplenishmentTag()\n {\n }", "public function test_getOrderLineActivityTags() {\n\n }", "public function testGetReplenishmentTags()\n {\n }", "public function testAddPackingPlanTag()\n {\n }", "public function testAddLowStockTag()\n {\n }", "public function getTag()\n {\n }", "public function test_addOrderLineActivityTag() {\n\n }", "public function testEditWithNewTag() {\n $this->markTestIncomplete('Not implemented yet.');\n }", "public function testAddExternalShipmentTag()\n {\n }", "public function test_addItemCategoryTag() {\n\n }", "public function test_addLowStockTag() {\n\n }", "public function testDeletePackingPlanTag()\n {\n }", "public function testAddVendorComplianceSurveyTag()\n {\n }", "protected function drukowanie()\n {\n for($i=0,$c=count($this->tags); $i<$c; $i++){\n $this->szkielet = $this->swap( $this->szkielet , $this->install($i) );\n }\n\n }", "public function testTag()\n {\n $tag1 = $this->objFromFixture('Tag', 'tag1');\n $tag2 = $this->objFromFixture('Tag', 'tag2');\n $entry1 = $this->objFromFixture('News', 'item1');\n $entry2 = $this->objFromFixture('News', 'item2');\n $entry3 = $this->objFromFixture('News', 'item3');\n\n $this->assertEquals($tag1->News()->count(), 6, 'Tag 1 to items');\n $this->assertEquals($tag2->News()->count(), 4, 'Tag 2 to items');\n $this->assertEquals($entry1->Tags()->count(), 1, 'Tags on item 1');\n $this->assertEquals($entry2->Tags()->count(), 2, 'Tags on item 2');\n $this->assertEquals($entry3->Tags()->count(), 0, 'Tags on item 0');\n }", "public function test_getCartonActivityTags() {\n\n }", "public function test_getExternalShipmentTags() {\n\n }", "public function testAddItemSubCategoryTag()\n {\n }", "public function test_addExternalShipmentTag() {\n\n }", "public function testDeleteLowStockTag()\n {\n }", "public function testGetExternalShipmentTags()\n {\n }", "public function test_getBillingCodeTypeTags() {\n\n }", "public function test_addCustomerTag() {\n\n }", "public function testDeleteVendorComplianceSurveyTag()\n {\n }", "public function processTag()\n {\n $tags = '';\n\n $articles = $this->dao->select('id, keywords')->from(TABLE_ARTICLE)->fetchPairs('id', 'keywords'); \n foreach($articles as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_ARTICLE)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags = $keywords;\n }\n\n $products = $this->dao->select('id, keywords')->from(TABLE_PRODUCT)->fetchPairs('id', 'keywords'); \n foreach($products as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_PRODUCT)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags .= ',' . $keywords;\n }\n\n $categories = $this->dao->select('id, keywords')->from(TABLE_CATEGORY)->fetchPairs('id', 'keywords'); \n foreach($categories as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_CATEGORY)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags .= ',' . $keywords;\n }\n\n $this->loadModel('tag')->save($tags);\n }", "public function testGetOrderTags()\n {\n }", "function doTagStuff(){}", "public function testGetPackingPlanTags()\n {\n }", "abstract protected function getTag() : Tag;", "public function testGetTagbyValidTagId() {\n\t\t// Count the number of rows and save this for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\n\t\t// Create a new tag and insert it into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->insert($this->getPDO());\n\n\t\t// Grab the data from mySQL and check the fields against our expectations\n\t\t$pdoTag= Tag::getTagByTagId($this->getPDO(), $tag->getTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertLessThan($pdoTag->getTagId(), 0);\n\t\t$this->assertEquals($pdoTag->getTagLabel(), $this->VALID_TAG_LABEL);\n\t}", "public function getTag(): string;", "public function test_deleteReplenishmentProcessTag() {\n\n }", "function commandes_trig_bank_reglement_en_attente($flux){\r\n\t// Si on est dans le bon cas d'un paiement de commande et qu'il y a un id_commande et que la commande existe toujours\r\n\tif ($id_transaction = $flux['args']['id_transaction']\r\n\t AND $transaction = sql_fetsel(\"*\",\"spip_transactions\",\"id_transaction=\".intval($id_transaction))\r\n\t\tAND $id_commande = $transaction['id_commande']\r\n\t\tAND $commande = sql_fetsel('id_commande, statut, id_auteur, mode', 'spip_commandes', 'id_commande='.intval($id_commande))){\r\n\r\n\t\t$statut_commande = $commande['statut'];\r\n\t\t$transaction_mode = $transaction['mode'];\r\n\t\t$commande_mode = $commande['mode'];\r\n\t\t$statut_nouveau = 'attente';\r\n\t\tif ($statut_nouveau !== $statut_commande OR $transaction_mode !==$commande_mode){\r\n\t\t\tspip_log(\"commandes_trig_bank_reglement_en_attente marquer la commande #$id_commande statut=$statut_nouveau mode=$transaction_mode\",'commandes');\r\n\t\t\t//on met a jour la commande\r\n\t\t\tinclude_spip(\"action/editer_commande\");\r\n\t\t\tcommande_modifier($id_commande,array('statut'=>$statut_nouveau,'mode'=>$transaction_mode));\r\n\t\t}\r\n\t}\r\n\r\n\treturn $flux;\r\n}", "public function testDeleteExternalShipmentTag()\n {\n }", "public function testGetValidTagByTagContent() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\t\t// create a new Tag and insert to into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->insert($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Tag::getTagByTagContent($this->getPDO(), $tag->getTagName());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertCount(1, $results);\n\t\t\t\t// grab the result from the array and validate it\n\t\t$pdoTag = $results[0];\n\t\t\t\t$this->assertEquals($pdoTag->getTagName(), $this->VALID_TAGCONTENT);\n\t}", "public function tags()\r\n {\r\n }", "public function getTag();", "public function getTag();", "public function testChangeTag()\n {\n $table = Tag::table();\n $tr = $table->tr();\n $th = $tr->th();\n $this->assertEquals(trim((string) $th), \"<th>\\n</th>\");\n\n $td = $th->setTag('td');\n $this->assertEquals(trim((string) $td), \"<td>\\n</td>\");\n }", "private function runTag()\n {\n $num = (int) $this->ask('How many records do you want to create for the tags table?');\n factory(Tag::class, $num)->create();\n }", "private function checkTagId($tag){\n\n try {\n\n $random = new Random();\n\n $existing_tags = Tags::findFirst(\n [\n 'conditions' => 'name = :name:',\n 'bind' => [\n 'name' => $tag\n ]\n ]\n );\n\n if (!$existing_tags){\n $clients_tags = new ClientsTags();\n $randomClintTagUuid = new Random();\n $tagsClientsUuid = $randomClintTagUuid->Uuid();\n $uuid = $random->Uuid();\n\n $tag_id = str_replace('-', '', $uuid);\n\n //findFirst client\n $existing_client = Clients::findFirst(\n [\n 'conditions' => 'name = :name:',\n 'bind' => [\n 'name' => $this->session->get(\"client_id\")\n ]\n ]\n );\n\n //set clients and tags relationship\n $clients_tags->setId($tagsClientsUuid)\n ->setClientId($existing_client->id)\n ->setTagId($tag_id)\n ->create();\n\n } else {\n $tag_id = $existing_tags->getId();\n }\n return $tag_id;\n\n } catch (\\PDOException $e) {\n throw new ServiceException($e->getMessage(). $e->getCode(), $e);\n }\n }", "public function test_addCartonActivityTag() {\n\n }", "public function testGetDecksWithTag() {\n $title = \"Deck1\";\n $tags = array(\"aaa\", \"bbb\", \"ccc\");\n $deckid_1 = $this->user->add_deck($title, $tags, true, $this->con);\n\n // add the deck 2\n $title = \"Deck2\";\n $tags = array(\"aaa\", \"bbb\", \"ddd\");\n $deckid_2 = $this->user->add_deck($title, $tags, true, $this->con);\n\n // add the deck 3\n $title = \"Deck3\";\n $tags = array(\"aaa\", \"ccc\", \"eee\");\n $deckid_3 = $this->user->add_deck($title, $tags, true, $this->con);\n\n $deckids_aaa = Tag::get_decks_with_tag(\"aaa\", $this->con);\n $deckids_aaa_exp = array($deckid_1, $deckid_2, $deckid_3);\n $this->assertEquals($deckids_aaa_exp, $deckids_aaa);\n\n $deckids_ccc = Tag::get_decks_with_tag(\"ccc\", $this->con);\n $deckids_ccc_exp = array($deckid_1, $deckid_3);\n $this->assertEquals($deckids_ccc_exp, $deckids_ccc);\n \n // delete decks\n delete_from(\"decks\", \"\", \"\", $this->con);\n // delete tags\n delete_from(\"tags\", \"\", \"\", $this->con);\n }", "public function tagAction() {\n\n $tag = null;\n\n $qhits = $this->di->request->getGet('hits') ? $this->di->request->getGet('hits') : $this->di->session->get('qhits');\n $qhits = $qhits ? $qhits : 10;\n $this->di->session->set('qhits', $qhits);\n $page = $this->di->request->getGet('page') ? $this->di->request->getGet('page') : 0;\n\n if ($this->di->request->getGet('tag')) {\n $tag = $this->di->request->getGet('tag');\n } else {\n $url = $this->url->create('question');\n $this->response->redirect($url);\n }\n\n $t = new \\Enax\\Tags\\Tags();\n $t->setDI($this->di);\n $tagname = $t->find($tag);\n\n $count = $this->questions->query(\"COUNT(*) AS count\")\n ->from('question AS q')\n ->join('tag2question AS t2q', 'q.id = t2q.idQuestion')\n ->where(\"t2q.idTag = \" . $tag)\n ->execute();\n\n $get = array('tag' => $tag, 'hits' => $qhits, 'page' => $page);\n\n if ($count[0]->count == 0) {\n $pagelinks = $this->pager->paginateGet(1, 'question/tag', $get, $this->customhits);\n } else {\n $pagelinks = $this->pager->paginateGet($count[0]->count, 'question/tag', $get, $this->customhits);\n }\n\n $all = $this->questions->query(\"q.*\")\n ->from('question AS q')\n ->join('tag2question AS t2q', 'q.id = t2q.idQuestion')\n ->where(\"t2q.idTag = \" . $tag)\n ->limit($qhits)\n ->offset($page)\n ->groupBy('q.id')\n ->orderBy('q.created DESC')\n ->execute();\n $all = $this->getRelatedData($all);\n\n $this->theme->setTitle($tagname->getProperties()['name']);\n $this->views->add('forum/forum', [\n 'content' => $all,\n 'pages' => $pagelinks,\n 'title' => 'Frågor om ' . $tagname->getProperties()['name'],\n ]);\n\n $title = $count[0]->count == 1 ? $count[0]->count .' fråga' : $count[0]->count .' frågor';\n $this->views->add('tags/view', [\n 'title' => $title,\n 'tags' => $tagname,\n ]);\n }", "public function get_tag()\n {\n }", "public function insertTagsFromModx()\n {\n\n $tags = DB::table('modx_tours_tags')->where('title', '<>', 'data_viezda')->where('title', '<>', 'travel_type')->get();\n foreach ($tags as $tag) {\n\n $existFixValue = ToursTagsValues::where('value', $tag->value)->first();\n $tagAttribute = ToursTags::where('title', $tag->title)->first();\n\n // Check or insert new tag value\n\n if ($existFixValue) {\n $valueId = $existFixValue->id;\n } else {\n $newTaggFixValue = new ToursTagsValues;\n\n $newTaggFixValue->tag_id = $tagAttribute->id;\n $newTaggFixValue->value = $tag->value;\n $newTaggFixValue->alias = $tag->alias;\n $newTaggFixValue->date = $tag->date;\n\n $newTaggFixValue->save();\n\n $valueId = $newTaggFixValue->id;\n }\n\n // Insert relation tag to tour\n\n /* check exist */\n $exist = ToursTagsRelation::join('tours_tags', 'tours_tags.id', '=', 'tour_tags_relations.tag_id')\n ->join('tours_tags_values', 'tours_tags_values.id', 'tour_tags_relations.value')\n ->where('tour_tags_relations.tour_id', $tag->tour_id)\n ->where('tours_tags.title', $tag->title)\n ->where('tours_tags_values.value', $tag->value)\n ->exists();\n\n /* create relation */\n if (!$exist) {\n $tagRelation = new ToursTagsRelation();\n\n $tagRelation->tour_id = $tag->tour_id;\n $tagRelation->tag_id = $tagAttribute->id;\n\n /* value id if fix value */\n $tagRelation->value = $valueId;\n\n $tagRelation->save();\n }\n\n }\n }", "public function test_addLegacyLowstockContactTag() {\n\n }", "public function test_getItemCategoryTags() {\n\n }", "public function find_tag_by_desc() {\n $tag_desc = $_POST['tag'];\n $srv = new LogService($this->getEntityManager(), $this->app, $this->getUser());\n $tag = $srv->find_tag_by_description($tag_desc);\n $json_tag = json_encode(['id' => $tag['id']]);\n echo $json_tag;\n }", "function calculer_meta_tags(){\n\n include_spip('inc/texte');\n\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif (isset($GLOBALS['contexte']['id_article'])){\n\t\t$id_objet = $GLOBALS['contexte']['id_article'];\n\t\t$objet = 'article';\n\t} elseif (isset($GLOBALS['contexte']['id_rubrique'])) {\n\t\t$id_objet = $GLOBALS['contexte']['id_rubrique'];\n\t\t$objet = 'rubrique';\n\t} else {\n\t\t$objet = 'sommaire';\n\t}\n\n\t/* META TAGS */\n\n\t// If the meta tags configuration is activate\n\t$meta_tags = array();\n\n\tswitch ($objet) {\n\t\tcase 'sommaire':\n\t\t\t$meta_tags = $config['meta_tags']['tag'];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$table = table_objet_sql($objet);\n\t\t\t$id_table_objet = id_table_objet($objet);\n\t\t\t$title = couper(sql_getfetsel(\"titre\", $table, \"$id_table_objet = \" . intval($id_objet)), 64);\n\t\t\t$requete = sql_allfetsel(\"descriptif,texte\", $table, \"$id_table_objet = \" . intval($id_objet));\n\t\t\tif ($requete) $description = couper(implode(\" \", $requete[0]), 150, '');\n\t\t\t// Get the value set by default\n\t\t\tforeach ($config['meta_tags']['default'] as $name => $option){\n\t\t\t\tif ($option=='sommaire'){\n\t\t\t\t\t$meta_tags[$name] = $config['meta_tags']['tag'][$name];\n\t\t\t\t} elseif ($option=='page') {\n\t\t\t\t\tif ($name=='title') $meta_tags['title'] = $title;\n\t\t\t\t\tif ($name=='description') $meta_tags['description'] = $description;\n\t\t\t\t} elseif ($option=='page_sommaire') {\n\t\t\t\t\tif ($name=='title') $meta_tags['title'] = $title . (($title!='') ? ' - ' : '') . $config['meta_tags']['tag'][$name];\n\t\t\t\t\tif ($name=='description') $meta_tags['description'] = $description . (($description!='') ? ' - ' : '') . $config['meta_tags']['tag'][$name];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the meta tags rubrique and articles editing is activate (should overwrite other setting)\n\t\t\tif ($config['meta_tags']['activate_editing']=='yes' && ($objet=='article' || $objet=='rubrique')){\n\t\t\t\t$result = sql_select(\"*\", \"spip_seo\", \"id_objet = \" . intval($id_objet) . \" AND objet = \" . sql_quote($objet));\n\t\t\t\twhile ($r = sql_fetch($result)){\n\t\t\t\t\tif ($r['meta_content']!='')\n\t\t\t\t\t\t$meta_tags[$r['meta_name']] = $r['meta_content'];\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn $meta_tags;\n}", "public function test_addBillingCodeTypeTag() {\n\n }", "public function test_deleteLowStockTag() {\n\n }", "function tag($id)\n{\n global $app;\n\n $details = $app->calibre->tagDetails($id);\n if (is_null($details)) {\n $app->getLog()->debug(\"no tag\");\n $app->notFound();\n }\n $app->render('tag_detail.html', [\n 'page' => mkPage(getMessageString('tag_details'), 4, 3),\n 'tag' => $details['tag'],\n 'books' => $details['books']]);\n}", "public function testPostTag() : void\n {\n $request = [\n 'name' => static::$tagName\n ];\n\n $response = $this->actingAs(static::$user, 'api')\n ->post('/api/tag', $request);\n\n $response->assertStatus(201);\n\n $response->assertJsonStructure([\n 'id',\n 'name'\n ]);\n }", "function deletetag()\n{\n\t$tag\t\t= \t$_POST['tag'];\n\t\n\t$rs \t= mysql_query (\"SELECT id tagnodes WHERE name=$tag\");\n\t$row \t= mysql_fetch_array($rs);\n\t$id \t= $firstname_row['id'];\n\t\n\tshowSuccessMessage();\n}", "public function test_deleteBillingCodeTypeTag() {\n\n }", "public function testCreateTagAdmin(): void\n {\n // given\n $expectedStatusCode = 200;\n $admin = $this->createUser([User::ROLE_USER, User::ROLE_ADMIN]);\n $this->logIn($admin);\n\n // when\n $crawler = $this->httpClient->request('GET', '/tag/create');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n $form = $crawler->selectButton('stwórz')->form();\n $form['tag[name]']->setValue('Test Tag');\n $this->httpClient->submit($form);\n $this->httpClient->followRedirect();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n $this->assertStringContainsString('Dodawanie powiodło się', $this->httpClient->getResponse()->getContent());\n }", "public function testGetVendorComplianceSurveyTags()\n {\n }", "function updateTag($name = array(), $table,$table_id, $table_field =null,$otps=array())\n\t{\n\t\tif(!$table_id || !$table) return false;\n\n\t\t// xoa cac ban ghi cu\n\t\t$where = array();\n\t\t$where['table'] = $table;\n\t\t$where['table_id'] = $table_id;\n\t\tif($table_field)\n\t\t\t$where['table_field'] = $table_field;\n\t\tif ($table_cat = array_get($otps,'table_cat',null))\n\t\t\t$where[] = \" `table_cat` ='\". $table_cat.\"'\";\n\t\tif ($table_type = array_get($otps,'table_type',null))\n\t\t\t$where[] = \" `table_type` ='\". $table_type.\"'\";\n\t\tmodel('tag_value')->del_rule($where);\n\n\t\t// Kiem tra tag nay da ton tai hay chua\n\t\tif(!$name)\n\t\t\treturn false;\n\t\t$ids = array();\n\t\t// them hoac kiem tra tag\n\t\tforeach((array)$name as $row){\n\t\t\t$data = array();\n\t\t\t$data['status'] = 1;\n\t\t\t$data['name'] = $row;\n\t\t\t$data['seo_url'] = convert_vi_to_en($row);\n\t\t\tif($info = $this->read(array('where' => $data))){\n\t\t\t\t$ids[] = $info->id;\n\t\t\t} else {\n\t\t\t\t$id = 0;\n\t\t\t\t$this->create($data, $id);\n\t\t\t\t$ids[] = $id;\n\t\t\t}\n\t\t}\n\t\t// neu co ids tag thi them vao tag value\n\t\tif(!$ids) return true;\n\n\t\t// them moi tag\n\t\tforeach($ids as $row){\n\t\t\t$item = array();\n\t\t\t$item['table'] = $table;\n\t\t\t$item['table_id'] = $table_id;\n\t\t\tif($table_field)\n\t\t\t\t$item['table_field'] = $table_field;\n\t\t\tif($table_cat)\n\t\t\t\t$item['table_cat'] = $table_cat;\n\t\t\tif($table_type)\n\t\t\t\t$item['table_type'] = $table_type;\n\t\t\t$item['tag_id'] = $row;\n\t\t\tmodel('tag_value')->create($item);\n\t\t}\n\t\treturn true;\n\t}", "private function addTag()\n {\n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n \n $data = array();\n $tagTitle = stripslashes(trim($_REQUEST['tag']));\n $tag = Utils::sanitize($tagTitle);\n \n $Tickets = new Tickets($params);\n $Tickets->addTag($tag, $tagTitle);\n \n echo '[{\"isError\":0, \"message\":\"Successfully added tag\"}]';\n exit;\n }", "public function testTags()\n\t{\n\t\t$this->call('GET', '/api/tags');\n\t}", "public function test_deleteTagRequest() {\n\n }", "public function testDeleteItemSubCategoryTag()\n {\n }", "public function testTagDetach()\n {\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_EXECUTE,\n 'target_class' => 'tagger',\n 'target_field' => 'detach',\n 'value' => 'detach_tag',\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n \n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'detach tag person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check tag\n $this->notSeeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function tags();", "public function testCreateSuperfund()\n {\n }", "public function run()\n {\n Tag::create([\n 'title' => 'Новый',\n 'type' => 0,\n ]);\n Tag::create([\n 'title' => 'В разработке',\n 'type' => 0,\n ]);\n Tag::create([\n 'title' => 'Завершен',\n 'type' => 0,\n ]);\n\n Tag::create([\n 'title' => 'Новая',\n 'type' => 1,\n ]);\n Tag::create([\n 'title' => 'В разработке',\n 'type' => 1,\n ]);\n Tag::create([\n 'title' => 'На проверке',\n 'type' => 1,\n ]);\n Tag::create([\n 'title' => 'Завершена',\n 'type' => 1,\n ]);\n }", "public function testGetTagByTagLabel() {\n\t\t// Count the number of rows and save this for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\n\t\t// Create a new tag and insert it into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->insert($this->getPDO());\n\n\t\t// Grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Tag::getTagByTagLabel($this->getPDO(), $tag->getTagLabel());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\BrewCrew\\\\Tag\", $results);\n\n\t\t// Grab the result from the array and validate it\n\t\t$pdoTag = $results[0];\n\t\t$this->assertEquals($pdoTag->getTagLabel(), $this->VALID_TAG_LABEL);\n\t}", "public function setATagParts() {}", "function iptsr_internal_deb($debata_id) {\n\t$rocnik = cpdb_fetch_one_value(\"select rocnik from debata left join soutez using (soutez_ID) where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t$status = true;\n\tcpdb_transaction();\n\t\n\t// vycistit\n\t$status &= cpdb_exec(\"delete from clovek_debata_ibody where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t// --- debateri\n\t// (podle poharovych bodu)\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_debata.clovek_ID, clovek_debata.debata_ID, :rocnik, 'debater', debata_tym.body * 0.1 from clovek_debata left join debata_tym on clovek_debata.debata_ID = debata_tym.debata_ID and substring(clovek_debata.role,1,1) = elt(debata_tym.pozice + 1,'n','a') where clovek_debata.debata_ID = :debata_id and find_in_set(clovek_debata.role,'a1,a2,a3,n1,n2,n3')\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\t\n\t// --- rozhodci\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_ID, debata_ID, :rocnik, 'rozhodci', 1 from clovek_debata where debata_ID = :debata_id and role = 'r'\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\n\t// --- treneri\n\t$treneri_dostanou = array();\n\t\n\tif (cpdb_fetch_all(\"select clovek_ID, ibody from clovek_debata_ibody where debata_ID = :debata_id and role = 'debater'\", array(\":debata_id\"=>$debata_id), $debateri)) {\n\t\tforeach ($debateri as $debater) {\n\t\t\t$pocet_treneru = cpdb_fetch_all(\"\n\t\t\t\tselect\n\t\t\t\t\tdk.clovek_ID as clovek_ID\n\t\t\t\tfrom\n\t\t\t\t\tclovek d, clovek_klub dk\n\t\t\t\twhere\n\t\t\t\t\td.clovek_ID = :clovek_ID\n\t\t\t\t\tand d.klub_ID = dk.klub_ID\n\t\t\t\t\tand dk.role = 't'\n\t\t\t\t\tand dk.rocnik = :rocnik\n\t\t\t\t\", array(\":clovek_ID\"=>$debater[\"clovek_ID\"], \":rocnik\"=>$rocnik), $treneri);\n\t\t\t\n\t\t\tforeach ($treneri as $trener) {\n\t\t\t\t$treneri_dostanou[$trener[\"clovek_ID\"]] += 0.1 * $debater[\"ibody\"] / $pocet_treneru;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tforeach ($treneri_dostanou as $trener_cid => $trener_ib) {\n\t\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'trener', :ibody)\", array(\":clovek_id\"=>$trener_cid, \":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik, \":ibody\"=>$trener_ib));\n\t}\n\t\n\t// --- organizatori\n\t$dostanou = 0.15; // kolik IB je z debaty\n\t$zasluhy_primych = 1; // defaultni zasluhy u primych ogranizatoru\n\t$celkem_zasluhy = 0;\n\t$zasluhy = array();\n\t\n\t// primi\n\tcpdb_fetch_all(\n\t\t\"select clovek_ID from clovek_debata where clovek_debata.role = 'o' and debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id), $res_primi);\n\t\n\tforeach ($res_primi as $org) {\n\t\t$celkem_zasluhy += $zasluhy_primych;\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $zasluhy_primych;\n\t}\n\t\n\t// neprimi\n\tcpdb_fetch_all(\"\n\t\tselect\n\t\t\tclovek_turnaj.clovek_ID,\n\t\t\tclovek_turnaj.mocnost\n\t\tfrom\n\t\t\tdebata, clovek_turnaj\n\t\twhere\n\t\t\tdebata.debata_ID = :debata_id\n\t\t\tand clovek_turnaj.turnaj_ID = debata.turnaj_ID\n\t\t\tand clovek_turnaj.role = 'o'\n\t\", array(\":debata_id\"=>$debata_id), $res_neprimi);\n\t\n\tforeach($res_neprimi as $org) {\n\t\t$celkem_zasluhy += $org[\"mocnost\"];\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $org[\"mocnost\"];\n\t}\n\t\n\tforeach($zasluhy as $org_cid => $org_zasluhy) {\n\t\t$status &= cpdb_exec(\n\t\t\t\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'organizator', :ibody)\",\n\t\t\tarray(\n\t\t\t\t\":clovek_id\" => $org_cid,\n\t\t\t\t\":debata_id\" => $debata_id,\n\t\t\t\t\":rocnik\" => $rocnik,\n\t\t\t\t\":ibody\" => $dostanou * $org_zasluhy / $celkem_zasluhy\n\t\t\t)\n\t\t);\n\t}\n\t\n\t// zaver\n\tif ($status) {\n\t\tcpdb_commit();\n\t} else {\n\t\tcpdb_rollback();\n\t}\n}", "public function _handle_tags_new($type_id, $type = 'default', $tags = ''){\n\n if($tags){\n $entity = $this->getEntityManager()->getRepository('NewsBundle:TagsEntity');\n $list_tags = explode(',', $tags);\n if(!empty($list_tags)){\n foreach($list_tags as $tag){\n $query = $entity->createQueryBuilder('pk');\n $query->select(\"pk\");\n $query->where('pk.type = :type');\n $query->andWhere('pk.type_id = :type_id');\n $query->andWhere('pk.tag_name = :tag_name');\n $query->setParameter('type', $type);\n $query->setParameter('type_id', $type_id);\n $query->setParameter('tag_name', $tag);\n $get_tag_exists = $query->getQuery()->getResult();\n\n if(empty($get_tag_exists)) {\n\n //Create tag in database\n $create = new TagsEntity();\n $create->setTypeID($type_id);\n $create->setType($type);\n $create->setTag_Name($tag);\n $create->setStatus(1);\n $create->setCreated_Date(time());\n $em = $this->getEntityManager();\n $em->persist($create);\n $em->flush();\n\n }\n }\n }\n\n //delete tag if it isn't exists in list atgs\n $query = $entity->createQueryBuilder('pk');\n $query->select(\"pk\");\n $query->where('pk.type = :type');\n $query->andWhere('pk.type_id = :type_id');\n $query->andWhere($query->expr()->notIn('pk.tag_name', ':list_tags'));\n $query->setParameter('type', $type);\n $query->setParameter('type_id', $type_id);\n $query->setParameter('list_tags', $list_tags);\n $list_tags_delete = $query->getQuery()->getResult();\n if(!empty($list_tags_delete)) {\n foreach ($list_tags_delete as $tag) {\n $entity_delete = $entity->findOneBy(array('id' => $tag->getID()));\n $em = $this->getEntityManager();\n $em->remove($entity_delete);\n $em->flush();\n }\n }\n\n return TRUE;\n }\n\n return FALSE;\n }", "public function testGetAllValidTags() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\t\t// create a new Tag and insert to into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->insert($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Tag::getAllTags($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertCount(1, $results);\n\t\t\t\t// grab the result from the array and validate it\n\t\t$pdoTag = $results[0];\n\t\t\t\t$this->assertEquals($pdoTag->getTagName(), $this->VALID_TAGCONTENT);\n\t}", "public function test_deleteItemCategoryTag() {\n\n }", "public function test_deleteCartonActivityTag() {\n\n }", "public function tag(): string;", "public function test_getLowStockTags() {\n\n }", "public function testTagAttach()\n {\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_EXECUTE,\n 'target_class' => 'tagger',\n 'target_field' => 'attach',\n 'value' => 'attach_tag',\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n \n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'tag person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag2->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function test_listBundlesForTagsRequest() {\n\n }", "public function testGetTag() {\n $expected = [\n 'tag' => 'example',\n 'htmlTag' => 'example',\n 'template' => '',\n 'displayType' => Decoda::TYPE_BLOCK,\n 'allowedTypes' => Decoda::TYPE_BOTH,\n 'aliasFor' => '',\n 'attributes' => [],\n 'mapAttributes' => [],\n 'htmlAttributes' => [],\n 'aliasAttributes' => [],\n 'escapeAttributes' => true,\n 'lineBreaks' => Decoda::NL_CONVERT,\n 'autoClose' => false,\n 'preserveTags' => false,\n 'onlyTags' => false,\n 'contentPattern' => '',\n 'stripContent' => false,\n 'parent' => [],\n 'childrenWhitelist' => [],\n 'childrenBlacklist' => [],\n 'maxChildDepth' => -1,\n 'persistContent' => true\n ];\n\n $this->assertEquals($expected, $this->object->getTag('example'));\n\n try {\n $this->object->getTag('fakeTag');\n $this->assertTrue(false);\n } catch (\\Exception $e) {\n $this->assertTrue(true);\n }\n }", "public function tagged( $tag );", "function getTag(): string\n\t{\n\t\treturn $this->username.\"#\".$this->discriminator;\n\t}", "public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}", "public function run()\n {\n\n \tfactory(Tag::class, 29) ->create();\n\n \t$name = 'humor';\n Tag::create([\n \t'name' => $name,\n \t'slug' => str_slug($name)\n ]);\n\n $name = 'romance';\n Tag::create([\n \t'name' => $name,\n \t'slug' => str_slug($name)\n ]);\n\n $name = 'terror';\n Tag::create([\n \t'name' => $name,\n \t'slug' => str_slug($name)\n ]);\n\n $name = 'thriller';\n Tag::create([\n \t'name' => $name,\n \t'slug' => str_slug($name)\n ]);\n\n $name = 'ciencia ficción';\n Tag::create([\n \t'name' => $name,\n \t'slug' => str_slug($name)\n ]);\n\n\n }", "public function createTagDetail($data) {\n\t\t$status = false;\n\t\tif (count ( $data ) > 0) {\n\t\t\t$detail = array ();\n\t\t\t$tag_id = $this->getContentTagID ();\n\t\t\tforeach ( $data as $rawdata ) {\n\t\t\t\t$system_language_id = (array_key_exists ( 'system_language_id', $rawdata ) ? $rawdata ['system_language_id'] : 0);\n\t\t\t\t$content_tag_detail_title = (array_key_exists ( 'content_tag_detail_title', $rawdata ) ? $rawdata ['content_tag_detail_title'] : null);\n\t\t\t\t$detail [] = array (\n\t\t\t\t\t\t'content_tag_id' => $tag_id,\n\t\t\t\t\t\t'system_language_id' => $system_language_id,\n\t\t\t\t\t\t'content_tag_detail_title' => $content_tag_detail_title,\n\t\t\t\t\t\t'content_tag_detail_created_date' => $rawdata ['log_created_date'],\n\t\t\t\t\t\t'content_tag_detail_created_by' => $rawdata ['log_created_by'],\n\t\t\t\t\t\t'content_tag_detail_modified_date' => $rawdata ['log_modified_date'],\n\t\t\t\t\t\t'content_tag_detail_modified_by' => $rawdata ['log_modified_by'] \n\t\t\t\t);\n\t\t\t}\n\t\t\tif (is_array ( $detail ) && count ( $detail ) > 0) {\n\t\t\t\t$status = true;\n\t\t\t\t$ITagDetail = $this->getDatabase ();\n\t\t\t\t$ITagDetail->insert ();\n\t\t\t\t$ITagDetail->into ( 'content_tag_detail' );\n\t\t\t\t$ITagDetail->columns ( array (\n\t\t\t\t\t\t'content_tag_id',\n\t\t\t\t\t\t'system_language_id',\n\t\t\t\t\t\t'content_tag_detail_title',\n\t\t\t\t\t\t'content_tag_detail_created_date',\n\t\t\t\t\t\t'content_tag_detail_created_by',\n\t\t\t\t\t\t'content_tag_detail_modified_date',\n\t\t\t\t\t\t'content_tag_detail_modified_by' \n\t\t\t\t) );\n\t\t\t\t$ITagDetail->values ( $detail, 'multiple' );\n\t\t\t\t$ITagDetail->execute ();\n\t\t\t\tif (! $ITagDetail->affectedRows ()) {\n\t\t\t\t\t$status = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $status;\n\t}", "public function test_deleteOrderLineActivityTag() {\n\n }", "protected function _parseDescTag() {}", "public function test_deleteExternalShipmentTag() {\n\n }", "function opdsByTag($initial, $id, $page)\n{\n global $app, $globalSettings;\n\n // parameter checking\n if (!is_numeric($id) || !is_numeric($page)) {\n $app->getLog()->warn('opdsByTag: invalid tag id ' . $id . ' or page id ' . $page);\n $app->halt(400, \"Bad parameter\");\n }\n\n $filter = getFilter();\n $tl = $app->calibre->tagDetailsSlice($globalSettings['lang'], $id, $page, $globalSettings[PAGE_SIZE], $filter);\n $books1 = $app->calibre->titleDetailsFilteredOpds($tl['entries']);\n $books = array_map('checkThumbnailOpds', $books1);\n $gen = mkOpdsGenerator($app);\n $cat = $gen->booksForTagCatalog(\n null,\n $books,\n $initial,\n $tl['tag'],\n false,\n $tl['page'],\n getNextSearchPage($tl),\n getLastSearchPage($tl)\n );\n mkOpdsResponse($app, $cat, OpdsGenerator::OPDS_MIME_ACQ);\n}", "public function setDefaultTags()\n {\n\n if (!ToursTags::where('title', 'data_viezda')->exists()) {\n $newTag = new ToursTags();\n $newTag->title = 'data_viezda';\n $newTag->alias = 'Дата выезда';\n $newTag->save();\n\n $tagDataId = $newTag->id;\n } else {\n $tag = ToursTags::where('title', 'data_viezda')->select('id')->first();\n $tagDataId = $tag->id;\n }\n\n // Set default tag travel_type\n\n if (!ToursTags::where('title', 'travel_type')->exists()) {\n $newTag = new ToursTags();\n $newTag->title = 'travel_type';\n $newTag->alias = 'Способ путешествия';\n $newTag->save();\n\n $tagTravelId = $newTag->id;\n } else {\n $tag = ToursTags::where('title', 'travel_type')->select('id')->first();\n $tagTravelId = $tag->id;\n }\n\n return [0 => $tagTravelId, 1 => $tagDataId];\n\n }", "protected function setTags()\n {\n /*todo check role and flush based on tags*/\n $this->authBasedTag();\n }", "function dynamicTagsMethod ($bean, $event, $arguments)\n {\n if ($bean->fetched_row['description'] !== $bean->description) {\n $link = \"tag_link\"; //name of relationship: bean to Tags\n $tags = [\"tag\"=> []]; //array for relating tags\n\n //retreive tags already related to the target record\n if ($bean->load_relationship($link)) {\n $relatedTags = $bean->$link->getBeans();\n if (!empty($relatedTags)) {\n\n //tag relationships cannot survive this hook\n //so to preserve already related tags, we must re-relate them\n foreach ($relatedTags as $relatedTag) {\n array_push($tags[tag],$relatedTag->name); \n }\n }\n }\n $desc = $bean->description;\n $desc = preg_replace(\"/\\r|\\n/\", \" \",$desc); //convert line breaks to spaces\n $descArray = [];\n $tagArray = [];\n $tagField = $bean->getTagField();\n $tagFieldProperties = $bean->field_defs[$tagField];\n $descArray = explode(\" \", $desc); //split description into array items at each space\n foreach ($descArray as $key => $descValue){\n if (substr($descValue, 0, 1) == '#') {\n $descValue = substr($descValue,1); \n array_push($tagArray,$descValue); //makes array of only those words beginning with hashtag\n foreach($tagArray as $tagName){\n $tagName = preg_replace('/[.,;:?!)}]/', '', $tagName); //removes punctuation from each word\n array_push($tags[tag],$tagName); //adds hashtag words as tags\n }\n }\n }\n\n //create and relate new and exiting tag records\n $SugarFieldTag = new SugarFieldTag();\n $SugarFieldTag->apiSave($bean, $tags, $tagField, $tagFieldProperties);\n }\n }", "public function testGetLowStockTags()\n {\n }" ]
[ "0.6227458", "0.6175804", "0.61684805", "0.61051464", "0.6064148", "0.6038669", "0.59423625", "0.5894972", "0.5832576", "0.5813255", "0.579089", "0.5781856", "0.56795704", "0.5673445", "0.56663877", "0.56636375", "0.5660746", "0.56462187", "0.56305146", "0.5607749", "0.5585092", "0.5575357", "0.5570221", "0.5555966", "0.55504954", "0.55481875", "0.5527975", "0.5525967", "0.55106103", "0.5509174", "0.54880154", "0.54693526", "0.54686636", "0.54661673", "0.54612076", "0.54551744", "0.545244", "0.54486907", "0.54451734", "0.544365", "0.54395896", "0.54355", "0.54328454", "0.5429341", "0.5424186", "0.54013777", "0.54013777", "0.53974444", "0.53934187", "0.53898656", "0.53822505", "0.53802407", "0.5372227", "0.5365042", "0.53623074", "0.536149", "0.5350711", "0.5345046", "0.53419685", "0.53389037", "0.5331104", "0.5315897", "0.52968824", "0.52890635", "0.5286539", "0.5281324", "0.5271902", "0.5263368", "0.5262937", "0.5259548", "0.5255697", "0.5253762", "0.52509993", "0.5249589", "0.5248723", "0.5248004", "0.52455187", "0.5241467", "0.5240338", "0.5240178", "0.5239375", "0.52368945", "0.5228862", "0.5228727", "0.51964146", "0.5182492", "0.5176822", "0.5172783", "0.51675636", "0.5160779", "0.51563454", "0.51503134", "0.51419115", "0.51341724", "0.51304054", "0.51281345", "0.5127824", "0.512254", "0.51157635", "0.5115049", "0.5097604" ]
0.0
-1
"Attaching event listeners by event name fails if preceded by detachment of all listeners for that type." Test contains 4 steps: assigning event manager to dummy service with single log event listener attached attaching second log listener detaching all log listeners attaching different listener
public function testBug1331() { $di = new Phalcon\Di; $di->set('componentX', function() use ($di) { $component = new LeDummyComponent(); $eventsManager = new Phalcon\Events\Manager; $eventsManager->attach('log', $di->get('MyFirstWeakrefListener')); $component->setEventsManager($eventsManager); return $component; }); $di->set('firstListener', 'MyFirstWeakrefListener'); $di->set('secondListener', 'MySecondWeakrefListener'); // ----- TESTING STEP 1 - SIGNLE 'LOG' LISTENER ATTACHED $component = $di->get('componentX'); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MyFirstWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); // ----- TESTING STEP 2 - SECOND 'LOG' LISTENER ATTACHED $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertCount(2, $logListeners); $firstLister = array_shift($logListeners); $secondLister = array_shift($logListeners); $this->assertInstanceOf('MyFirstWeakrefListener', $firstLister); $this->assertInstanceOf('MySecondWeakrefListener', $secondLister); // ----- TESTING STEP 3 - ALL 'LOG' LISTENER DETACHED $component->getEventsManager()->detachAll('log'); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertEmpty($logListeners); // ----- TESTING STEP 4 - SINGLE 'LOG' LISTENER ATTACHED SECOND TIME $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MySecondWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBug1331BackwardCompatibility()\n\t{\n\t\t$di = new Phalcon\\Di;\n\t\t$di->set('componentX', function() use ($di) {\n\t\t\t$component = new LeDummyComponent();\n\t\t\t$eventsManager = new Phalcon\\Events\\Manager;\n\t\t\t$eventsManager->attach('log', $di->get('MyFirstWeakrefListener'));\n\t\t\t$component->setEventsManager($eventsManager);\n\t\t\treturn $component;\n\t\t});\n\n\t\t$di->set('firstListener', 'MyFirstWeakrefListener');\n\t\t$di->set('secondListener', 'MySecondWeakrefListener');\n\n\t\t// ----- TESTING STEP 1 - SIGNLE 'LOG' LISTENER ATTACHED\n\n\t\t$component = $di->get('componentX');\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\n\t\t$this->assertInstanceOf('MyFirstWeakrefListener', $logListeners[0]);\n\t\t$this->assertCount(1, $logListeners);\n\n\t\t// ----- TESTING STEP 2 - SECOND 'LOG' LISTENER ATTACHED\n\n\t\t$component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener'));\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\n\t\t$this->assertCount(2, $logListeners);\n\t\t$firstLister = array_shift($logListeners);\n\t\t$secondLister = array_shift($logListeners);\n\t\t$this->assertInstanceOf('MyFirstWeakrefListener', $firstLister);\n\t\t$this->assertInstanceOf('MySecondWeakrefListener', $secondLister);\n\n\t\t// ----- TESTING STEP 3 - ALL 'LOG' LISTENER DETACHED\n\n\t\t$oldErrorLevel = error_reporting(E_ALL & ~E_DEPRECATED);\n\n\t\t@$component->getEventsManager()->dettachAll('log');\n\n\t\terror_reporting($oldErrorLevel);\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\t\t$this->assertEmpty($logListeners);\n\n\t\t// ----- TESTING STEP 4 - SINGLE 'LOG' LISTENER ATTACHED SECOND TIME\n\n\t\t$component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener'));\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\n\t\t$this->assertInstanceOf('MySecondWeakrefListener', $logListeners[0]);\n\t\t$this->assertCount(1, $logListeners);\n\t}", "function testShouldCheckIfListenersExist()\n {\n $this->assertFalse($this->emitter->hasListeners());\n $this->assertFalse($this->emitter->hasListeners('foo'));\n\n // check with \"foo\" listener\n $this->emitter->on('foo', $this->createTestCallback('foo'));\n\n $this->assertTrue($this->emitter->hasListeners());\n $this->assertTrue($this->emitter->hasListeners('foo'));\n\n // check event without any listeners\n $this->assertFalse($this->emitter->hasListeners('bar'));\n\n // check event with a global listener\n $this->emitter->on(EventEmitterInterface::ANY_EVENT, $this->createTestCallback('global'));\n\n $this->assertTrue($this->emitter->hasListeners('bar'));\n }", "public function testAttach()\n {\n $event = new EventManager();\n\n /** @var \\Closure $closure */\n $closure = function () {\n return $this->listeners;\n };\n\n $this->mvcKeeper->attach($event);\n\n $getListeners = $closure->bindTo($this->mvcKeeper, get_class($this->mvcKeeper));\n $listeners = $getListeners();\n\n foreach ($listeners as $listener) {\n $this->assertInstanceOf('Zend\\Stdlib\\CallbackHandler', $listener);\n }\n }", "public function testListenerRegistered(): void\n {\n $this->assertEventHasListener(QueryExecuted::class, QueryExecutedEventsListener::class);\n }", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function testAttachsToSharedEventManager()\n {\n $target = new CheckJobCreatePermissionListener();\n\n $events = $this->getMockBuilder('\\Zend\\EventManager\\SharedEventManager')\n ->disableOriginalConstructor()\n ->getMock();\n\n $events->expects($this->once())\n ->method('attach')\n ->with('Jobs/Acl/Assertion/Create', AssertionEvent::EVENT_ASSERT, array($target, 'checkCreatePermission'));\n\n $target->attachShared($events);\n }", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function testAddListenerWithPriority()\n {\n // Arrange\n $callstack = [];\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$callstack) {\n $callstack[] = 1;\n }, 1);\n\n $communicator->addListener(function () use (&$callstack) {\n $callstack[] = 2;\n }, 2);\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertEquals([\n 2,\n 1\n ], $callstack);\n }", "public function testComDayCqDamCoreImplEventDamEventAuditListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.core.impl.event.DamEventAuditListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testFireEventWithInternalFiredEvent()\n {\n $eventManager = new EventManager;\n $event = 'foor.bar';\n $eventManager->listen(EventManager::FIRED, function ($newEvent) use ($event) {\n $this->assertEquals($newEvent, $event);\n });\n $eventManager->fire($event);\n }", "protected function setupListeners()\n {\n //\n }", "public function testGetSubscribedEvents()\n {\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $events = $listener->getSubscribedEvents();\n\n $this->assertTrue(in_array('prePersist', $events));\n $this->assertTrue(in_array('preUpdate', $events));\n $this->assertTrue(in_array('postLoad', $events));\n $this->assertTrue(in_array('postRemove', $events));\n }", "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 testComDayCqDamCoreImplDamChangeEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.core.impl.DamChangeEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testComAdobeCqSocialActivitystreamsListenerImplEventListenerHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.activitystreams.listener.impl.EventListenerHandler';\n\n $crawler = $client->request('POST', $path);\n }", "protected function registerListeners()\n {\n }", "public function testComDayCqDamScene7ImplScene7DamChangeEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.scene7.impl.Scene7DamChangeEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testComDayCqDamS7damCommonS7damDamChangeEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.s7dam.common.S7damDamChangeEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function attachListeners($services, $eventManager, $listeners)\n {\n $lazyListeners = [];\n\n foreach ($listeners as $name => $options) {\n $options = $this->normalizeListenerOptions($name, $options);\n\n if ($options['lazy'] && null !== $options['attach']) {\n foreach ($options['attach'] as $spec) {\n $lazyListeners[] = [\n 'service' => $options['service'],\n 'event' => $spec['event'],\n 'method' => $spec['method'],\n 'priority' => $spec['priority'],\n ];\n }\n continue;\n }\n\n if ($services->has($options['service'])) {\n $listener = $services->get($options['service']);\n } elseif (class_exists($options['service'], true)) {\n $listener = new $options['service']();\n } else {\n throw new \\UnexpectedValueException(sprintf(\n 'Class or service %s does not exists. Cannot create listener instance.',\n $options['service']\n ));\n }\n\n if ($listener instanceof ListenerAggregateInterface) {\n $listener->attach($eventManager, $options['priority']);\n continue;\n }\n\n foreach ($options['attach'] as $spec) {\n $callback = $spec['method'] ? [ $listener, $spec['method'] ] : $listener;\n $eventManager->attach($spec['event'], $callback, $spec['priority']);\n }\n }\n\n if (!empty($lazyListeners)) {\n /* @var \\Core\\Listener\\DeferredListenerAggregate $aggregate */\n $aggregate = $services->get('Core/Listener/DeferredListenerAggregate');\n $aggregate->setListeners($lazyListeners)\n ->attach($eventManager);\n }\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function attachEvents();", "public function attachEvents();", "public function shouldDiscoverEvents()\n {\n return true;\n }", "public function process(ContainerBuilder $container)\n {\n if (!$container->hasDefinition('synd_metrics.metric_listener')) {\n return;\n }\n \n $definition = $container->getDefinition('synd_metrics.metric_listener');\n \n foreach ($this->getEvents($container) as $eventName) {\n $definition->addMethodCall('addListenedEvent', array($eventName));\n }\n }", "public function testRemoveListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n $callback = function () use (&$listenerCalled) {\n $listenerCalled = true;\n };\n\n // Act\n $communicator->addListener($callback);\n $communicator->removeListener($callback);\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertFalse($listenerCalled);\n }", "public function bindEventListeners(ContainerInterface $container)\n {\n foreach ($container->findTaggedServiceIds('behat.events_listener') as $id => $tag) {\n $container->get($id)->registerListeners($this);\n }\n }", "public function testEventCallBackPatch()\n {\n }", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function attach(EventManagerInterface $events)\n {\n foreach ($this->hooks as $name => $spec) {\n $listeners[] = $events->attach($spec['event'], array($this, \"do$name\"));\n }\n }", "public function setEventsManager(ManagerInterface $eventsManager): void;", "public function testEventCallBackCreate()\n {\n }", "public function testEventWithClosure()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', function ($newSecret) use ($secret) {\n $this->assertEquals($newSecret, $secret);\n });\n $eventManager->fire('secret', $secret);\n }", "abstract function HookEvents();", "public static function refreshListeners(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Reset event listeners on all models\n\t\t\tforeach (TestSettings::$modelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t\tforeach (TestSettings::$seededModelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t}\n\t}", "public function listeners($eventName);", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }", "public static function loadListeners()\n {\n $manager = self::instance();\n $plugins = Plugin::loaded();\n\n foreach ($plugins as $plugin) {\n $events = Plugin::getData($plugin, 'events')->getArrayCopy();\n foreach ($events as $name => $config) {\n if (is_numeric($name)) {\n $name = $config;\n $config = [];\n }\n\n $class = App::className($name, 'Event');\n $config = (array) $config;\n\n if ($class !== false) {\n $listener = new $class($config);\n $manager->on($listener, $config);\n }\n }\n }\n }", "public function testComDayCqWcmWebservicesupportImplReplicationEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.webservicesupport.impl.ReplicationEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testEmittedEventName()\n {\n $expected = array(\n 'request.before_send' => 'onBeforeSend'\n );\n $this->assertEquals($expected, DaWandaPlugin::getSubscribedEvents());\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "public function attach(EventManagerInterface $e, $priority = 100)\n {\n $shared = $e->getSharedManager();\n\t\t$this->listeners[] = $shared->attach('*', Event::EVENT_SOMETHING, [$this, 'logMessage']);\n \t\t//*** DATABASE EVENTS LAB: complete an \"attach()\" for INSERT and SELECT table operations\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_INSERT, [$this, 'logInsert'], $priority);\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_SELECT, [$this, 'logSelect'], $priority);\n }", "private function _registerGraphQlListeners()\n {\n $invalidate = [$this->getGql(), 'invalidateCaches'];\n\n $this->getProjectConfig()->on(ProjectConfig::EVENT_ADD_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_REMOVE_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_UPDATE_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_REBUILD, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_AFTER_APPLY_CHANGES, $invalidate);\n $this->getElements()->on(Elements::EVENT_AFTER_SAVE_ELEMENT, $invalidate);\n $this->getElements()->on(Elements::EVENT_AFTER_DELETE_ELEMENT, $invalidate);\n $this->getStructures()->on(Structures::EVENT_AFTER_MOVE_ELEMENT, $invalidate);\n }", "public function attach(EventManagerInterface $events)\n {\n $sm = $this->getServiceManager();\n $em = $this->getEventManager();\n $shared = $em->getSharedManager();\n \n $this->listeners = array(\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_BOOTSTRAP, \n array($this, 'logout'), \n 1000002\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_BOOTSTRAP, \n array($this, 'authenticateRequest'), \n 1000001\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_BOOTSTRAP, \n array($this, 'prepareAuthorise'), \n 1000000\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_ROUTE, \n array($this, 'authoriseRoute')\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_DISPATCH,\n array($this, 'authoriseModule'),\n 10\n ),\n $shared->attach(\n 'Zend\\View\\View', \n ViewEvent::EVENT_RENDERER, \n array($this, 'updateView')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_AUTHENTICATE, \n array($this, 'doLocalAuthentication')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_LOGIN_FORM_BUILD, \n array('ZucchiSecurity\\Authentication\\Plugin\\Local', 'extendLoginForm')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_LOGOUT_FORM_BUILD, \n array('ZucchiSecurity\\Authentication\\Plugin\\Local', 'extendLogoutForm')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_LOGIN_FORM_BUILD, \n array('ZucchiSecurity\\Authentication\\Plugin\\Captcha', 'extendLoginForm')\n ),\n );\n }", "public function attach(EventManagerInterface $eventManager, $priority = 100)\n {\n $shared = $eventManager->getSharedManager();\n $this->listeners[] = '???';\n }", "public function listen($events, $listener = null): void;", "public function testFireEventWithInternalOnException()\n {\n $eventManager = new EventManager;\n $eventManager->listen(EventManager::ON_EXCEPTION, function ($ex) {\n $this->assertTrue($ex instanceof \\Exception);\n });\n $eventManager->listen('thrown', function () {\n throw new \\Exception('');\n });\n $eventManager->fire('thrown');\n }", "public function shouldDiscoverEvents(): bool\n {\n return false;\n }", "public function testEventCallBackGetInboundReferences()\n {\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('received.node.void', [$this, 'onReceivedNodeVoid']);\n $this->listeners[] = $events->attach('received.node.receipt', [$this, 'onReceivedNodeReceipt']);\n }", "public function testDetachIsAnEmptyImplementation()\n {\n $target = new CheckJobCreatePermissionListener();\n\n $this->assertNull($target->detachShared(new \\Zend\\EventManager\\SharedEventManager()));\n }", "function eventRegister($eventName, EventListener $listener);", "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 }", "protected function addEventListenerTagsOnServiceDefinition(Definition $eventListenerDefinition, array $groupConfig, array $tagsConfig): void\n {\n // Define event listener on events\n foreach ($groupConfig as $eventsGroupName => $eventsGroupConfig) {\n foreach ($eventsGroupConfig['events'] as $eventName => $eventConfig) {\n foreach ($eventConfig['metrics'] as &$metricConfig) {\n // Parse each metric to get configuration tags (client and group tags)\n // Their values are defined in the configuration\n // Whereas metrics tags values are defined when the event is actually sent.\n // So, both \"tags\" types are handled differently.\n $metricConfig['configurationTags'] = \\array_merge(\n $tagsConfig,\n $eventsGroupConfig['tags'] ?? []\n );\n // Prefix the metric name.\n $metricConfig['name'] = $this->metricsPrefix.$metricConfig['name'];\n }\n // Set all the metrics config array in the object\n // One event can send several metrics. Multiple metrics will be handled in the EventListener.\n $eventListenerDefinition\n ->addTag('kernel.event_listener', [\n 'event' => $eventName,\n 'method' => 'handleEvent',\n ])\n ->addMethodCall('addEventToListen', [\n $eventName,\n $eventConfig,\n ]);\n }\n }\n\n // Define event listener on kernel terminate\n $eventListenerDefinition->addTag(\n 'kernel.event_listener',\n [\n 'event' => KernelEvents::TERMINATE,\n 'method' => 'onKernelTerminate',\n 'priority' => -100,\n ]\n );\n $eventListenerDefinition->addTag(\n 'kernel.event_listener',\n [\n 'event' => KernelEvents::RESPONSE,\n 'method' => 'onKernelResponse',\n 'priority' => -100,\n ]\n );\n if ($this->isSymfonyConsoleComponentLoaded()) {\n // Define event listener on console terminate\n $eventListenerDefinition->addTag(\n 'kernel.event_listener',\n [\n 'event' => ConsoleEvents::TERMINATE,\n 'method' => 'onConsoleTerminate',\n 'priority' => -100,\n ]\n );\n }\n }", "public function setEventManager(EventManagerInterface $events)\n {\n\n $entityManager = $this->entityManager;\n $role_id = $this->auth_user_role;\n // echo \" the fuck? ... not sure why this runs twice\";\n $events->attach('load-person', function (EventInterface $e) use ($entityManager, $role_id) {\n $person = $e->getParam('person');\n $hat = $person->getHat();\n $form = $e->getParam('form');\n $hat_options = $form->get('user')->get('person')->get('hat')\n ->getValueOptions();\n $hats_allowed = array_column($hat_options, 'value');\n if (! in_array($hat->getId(), $hats_allowed)) {\n $message = sprintf(\n 'The person identified by id %d, %s %s, wears the hat %s, '\n . 'but people in that category do not have user accounts '\n . 'in this system.',\n $person->getId(),\n $person->getFirstName(),\n $person->getLastname(),\n $hat\n );\n $controller = $e->getTarget();\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n }\n\n /**\n * this needs work. there are rare cases where one and the same\n * person may legitimately have to have more than one user account,\n * only one of which can be active at any one time, and each having\n * a different role from the other: 'submitter' vs any of the other\n * roles.\n */\n $user = $entityManager->getRepository('InterpretersOffice\\Entity\\User')\n ->findOneBy(['person' => $person]);\n //->getUser(['entity'=>'person','id' => $person->getId()]);\n if ($user) {\n $container = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager();\n\n $message = sprintf(\n 'We can\\'t create a new user account because this person '\n . ' (%s %s, id %d) already has one. ',\n $person->getFirstname(),\n $person->getLastname(),\n $person->getId()\n );\n $acl = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager()->get('acl');\n if ($acl->isAllowed($role_id, $user->getResourceId())) {\n $helper = $container->get('ViewHelperManager')->get('url');\n $url = $helper('users/edit', ['id' => $user->getId()]);\n $message .= sprintf(\n 'You can <a href=\"%s\">edit it</a> if you want to.',\n $url\n );\n }\n $controller = $e->getTarget();\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n }\n });\n // are they authorized to edit this user account?\n $events->attach('load-user', function (EventInterface $e) use ($role_id) {\n $resource_id = $e->getParam('user')->getResourceId();\n $acl = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager()->get('acl');\n if (! $acl->isAllowed($role_id, $resource_id)) {\n $controller = $e->getTarget();\n $message = \"Access denied to {$resource_id}'s user account\";\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n } else {\n $services = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager();\n $services->get(Entity\\Listener\\UpdateListener::class)\n ->setAuth($this->auth);\n }\n });\n\n return parent::setEventManager($events);\n }", "public function testEventCallBackDelete()\n {\n }", "public function testFireEventWithClass()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', 'Underlay\\Tests\\Events\\Test@call', function (\n $receivedSecret\n )\n use (\n $secret\n ) {\n $this->assertEquals($secret, $receivedSecret);\n });\n $eventManager->fire('secret', $secret);\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }", "public function eventsEventStop(UnitTester $I)\n {\n $I->wantToTest('Events\\Event - stop()');\n\n $number = 0;\n $eventsManager = new Manager();\n\n $propagationListener = function (Event $event, $component, $data) use (&$number) {\n $number++;\n\n $event->stop();\n };\n\n $eventsManager->attach('some-type', $propagationListener);\n $eventsManager->attach('some-type', $propagationListener);\n\n $eventsManager->fire('some-type:beforeSome', $this);\n\n $I->assertEquals(1, $number);\n }", "function ibase_set_event_handler($event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}", "public function setEventsManager(ManagerInterface $eventsManager);", "public static function getSubscribedEvents()\n {\n echo 'Test';\n }", "public function testGetEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function listeners($event);", "public function attach(string $event, callable $listener, int $priority = 0): void;", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "public function testOrgApacheSlingEventImplEventingThreadPool()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.event.impl.EventingThreadPool';\n\n $crawler = $client->request('POST', $path);\n }", "public function testRegistersListener()\n {\n $this->application[\"security.authentication_providers\"] = array(\n $this->getMock(\"\\Silex\\Provider\\SecurityServiceProvider\")\n );\n $this->application[\"users\"] = $this->getMockBuilder(\"\\Metagist\\UserProvider\")\n ->disableOriginalConstructor()\n ->getMock();\n $this->application[\"monolog\"] = $this->getMock(\"\\Psr\\Log\\LoggerInterface\");\n \n $listener = $this->application[OpauthSecurityServiceProvider::LISTENER];\n $this->assertInstanceOf(\"\\Metagist\\OpauthListener\", $listener);\n }", "private function processAny($listener,$e) {\n if($e->name == $listener[0] && $this->isWithin()) {\n $this->emit($listener[1],$e);\n }\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public function testAggregateEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "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 testEvents(string $class): void\n {\n $reflection = new ReflectionClass($class);\n // Avoid checking abstract classes, interfaces, and the like\n if (!$reflection->isInstantiable()) {\n $this->markTestSkipped(\"Class [$class] is not instantiable\");\n }\n\n // All event classes must implement EventListenerInterface\n $requiredInterface = $this->interface;\n $this->assertTrue($reflection->implementsInterface($requiredInterface), \"Class [$class] does not implement [$requiredInterface]\");\n\n // Instantiate the event class and get implemented events list\n $event = new $class();\n $implemented = $event->implementedEvents();\n $this->assertTrue(is_array($implemented), \"implementedEvents() of [$class] returned a non-array\");\n $this->assertFalse(empty($implemented), \"implementedEvents() of [$class] returned an empty array\");\n\n // Test that we each event's handler is actually callable\n // See: https://api.cakephp.org/3.4/class-Cake.Event.EventListenerInterface.html#_implementedEvents\n foreach ($implemented as $name => $handler) {\n if (is_array($handler)) {\n $this->assertFalse(empty($handler['callable']), \"Handler for event [$name] in [$class] is missing 'callable' key\");\n $this->assertTrue(is_string($handler['callable']), \"Handler for event [$name] in [$class] has a non-string 'callable' key\");\n $handler = $handler['callable'];\n }\n\n $this->assertTrue(method_exists($event, $handler), \"Method [$handler] does not exist in [$class] for event [$name]\");\n $this->assertTrue(is_callable([$event, $handler]), \"Method [$handler] is not callable in [$class] for event [$name]\");\n }\n }", "protected function _loadListeners() {\n\t\tforeach (array_keys($this->config('listeners')) as $name) {\n\t\t\t$this->_loadListener($name);\n\t\t}\n\t}", "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}", "public function testComAdobeCqSocialActivitystreamsListenerImplModerationEventExten()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.activitystreams.listener.impl.ModerationEventExtension';\n\n $crawler = $client->request('POST', $path);\n }", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function attach(EventManagerInterface $eventManager, $priority = 1)\n {\n $this->listeners[] = $eventManager->attach(Event::EVENT_DETECT, [$this, 'detect'], $priority);\n $this->listeners[] = $eventManager->attach(Event::EVENT_FOUND, [$this, 'found'], $priority);\n $this->listeners[] = $eventManager->attach(Event::EVENT_ASSEMBLE, [$this, 'assemble'], $priority);\n }", "public static function getSubscribedEvents()\n\t{\n\t\treturn array(\n\t\t\tBrowserTestCase::TEST_ENDED_EVENT => array('onTestEnd', 0),\n\t\t);\n\t}", "public function test_event_notification()\n {\n $this->event_notification_helper('event_method', true);\n }", "public function testEventHandlerRegistration() {\n\t\t$storage = $this->getStorageMock();\n\t\t$eventHandlerRegistry = Application::getInstance()->getDiContainer()->getEventHandlerRegistry();\n\t\t$session = $this->getSession(null, array(), $storage, true);\n\n\t\t$this->assertTrue(in_array($session, $eventHandlerRegistry->getEventHandlers(\n\t\t\t\tEvent::TYPE_APPLICATION_BEFORE_CONTROLLER_RUN), true),\n\t\t\t'Autoregistration failed for APPSTART event');\n\n\t\t$this->assertTrue(in_array($session, $eventHandlerRegistry->getEventHandlers(\n\t\t\t\tEvent::TYPE_APPLICATION_AFTER_CONTROLLER_RUN), true),\n\t\t\t'Autoegistration failed for APPFINISH event');\n\n\t\t$session->removeEventHandler();\n\n\t\t$this->assertFalse(in_array($session, $eventHandlerRegistry->getEventHandlers(\n\t\t\t\tEvent::TYPE_APPLICATION_BEFORE_CONTROLLER_RUN), true),\n\t\t\t'Unregistration failed for APPSTART event');\n\n\t\t$this->assertFalse(in_array($session, $eventHandlerRegistry->getEventHandlers(\n\t\t\t\tEvent::TYPE_APPLICATION_AFTER_CONTROLLER_RUN), true),\n\t\t\t'Unregistration failed for APPFINISH event');\n\n\t\t$session->registerEventHandler();\n\n\t\t$this->assertTrue(in_array($session, $eventHandlerRegistry->getEventHandlers(\n\t\t\t\tEvent::TYPE_APPLICATION_BEFORE_CONTROLLER_RUN), true),\n\t\t\t'Manual registration failed for APPSTART event');\n\n\t\t$this->assertTrue(in_array($session, $eventHandlerRegistry->getEventHandlers(\n\t\t\t\tEvent::TYPE_APPLICATION_AFTER_CONTROLLER_RUN), true),\n\t\t\t'Manual registration failed for APPFINISH event');\n\t}", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "protected function getEventDispatcherService()\n {\n $this->services['event_dispatcher'] = $instance = new \\Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher($this);\n\n $instance->addListenerService('kernel.request', array(0 => 'knp_menu.listener.voters', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_blog.blog_menu_listener', 1 => 'addGlobal'), 90);\n $instance->addListenerService('victoire_core.article_menu.contextual', array(0 => 'victoire_blog.article_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.article_menu.contextual', array(0 => 'victoire_blog.article_settings_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.blog_menu.contextual', array(0 => 'victoire_blog.blog_menu.contextual', 1 => 'addBlogContextual'), 0);\n $instance->addListenerService('victoire_core.article_template_menu.contextual', array(0 => 'victoire_blog.article_template_menu.menu_listener.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.blog_menu.contextual', array(0 => 'victoire_blog.blog_page_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire.widget_filter.form.pre_set_data', array(0 => 'victoire.widget_filter.form.listener.presetdata', 1 => 'manageExtraFiltersFields'), 1);\n $instance->addListenerService('victoire.widget_filter.form.pre_submit', array(0 => 'victoire.widget_filter.form.listener.presubmit', 1 => 'manageExtraFiltersFields'), 1);\n $instance->addListenerService('victoire.widget_filter.form.date.set_default_value', array(0 => 'victoire.widget_filter.blog.set.default.values.form.listener', 1 => 'setDefaultDateValue'), 1);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_business_page.business_template_menu_listener', 1 => 'addGlobal'), 50);\n $instance->addListenerService('victoire_core.business_template_menu.contextual', array(0 => 'victoire_core.business_template_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_core.menu_dispatcher', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.backend_menu.global', array(0 => 'victoire_core.backend_menu_listener', 1 => 'addGlobal'), 100);\n $instance->addListenerService('kernel.controller', array(0 => 'victoire_core.listener.controller_listener', 1 => 'preExecuteAutorun'), 0);\n $instance->addListenerService('victoire.on_render_page', array(0 => 'victoire_core.view_css_listener', 1 => 'onRenderPage'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_i18n.kernelrequest.listener', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.media_menu_listener', 1 => 'addGlobal'), 60);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.page_menu_listener', 1 => 'addGlobal'), 100);\n $instance->addListenerService('victoire_core.page_menu.contextual', array(0 => 'victoire_core.page_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_sitemap.sitemap_menu_listener', 1 => 'addGlobal'), 70);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.template_menu_listener', 1 => 'addGlobal'), 80);\n $instance->addListenerService('victoire_core.template_menu.contextual', array(0 => 'victoire_core.template_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_twig.kernelrequest.listener', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_view_reference.cache_warmer', 1 => 'warmUp'), 0);\n $instance->addSubscriberService('response_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ResponseListener');\n $instance->addSubscriberService('streamed_response_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\StreamedResponseListener');\n $instance->addSubscriberService('locale_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\LocaleListener');\n $instance->addSubscriberService('validate_request_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ValidateRequestListener');\n $instance->addSubscriberService('translator_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\TranslatorListener');\n $instance->addSubscriberService('session_listener', 'Symfony\\\\Bundle\\\\FrameworkBundle\\\\EventListener\\\\SessionListener');\n $instance->addSubscriberService('session.save_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\SaveSessionListener');\n $instance->addSubscriberService('fragment.listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\FragmentListener');\n $instance->addSubscriberService('debug.debug_handlers_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\DebugHandlersListener');\n $instance->addSubscriberService('router_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\RouterListener');\n $instance->addSubscriberService('security.firewall', 'Symfony\\\\Component\\\\Security\\\\Http\\\\Firewall');\n $instance->addSubscriberService('security.rememberme.response_listener', 'Symfony\\\\Component\\\\Security\\\\Http\\\\RememberMe\\\\ResponseListener');\n $instance->addSubscriberService('twig.exception_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ExceptionListener');\n $instance->addSubscriberService('monolog.handler.console', 'Symfony\\\\Bridge\\\\Monolog\\\\Handler\\\\ConsoleHandler');\n $instance->addSubscriberService('swiftmailer.email_sender.listener', 'Symfony\\\\Bundle\\\\SwiftmailerBundle\\\\EventListener\\\\EmailSenderListener');\n $instance->addSubscriberService('sensio_framework_extra.controller.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\ControllerListener');\n $instance->addSubscriberService('sensio_framework_extra.converter.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\ParamConverterListener');\n $instance->addSubscriberService('sensio_framework_extra.view.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\TemplateListener');\n $instance->addSubscriberService('sensio_framework_extra.cache.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\HttpCacheListener');\n $instance->addSubscriberService('sensio_framework_extra.security.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\SecurityListener');\n $instance->addSubscriberService('troopers_alertifybundle.event_listener', 'Troopers\\\\AlertifyBundle\\\\EventListener\\\\AlertifyListener');\n $instance->addSubscriberService('fos_user.security.interactive_login_listener', 'FOS\\\\UserBundle\\\\EventListener\\\\LastLoginListener');\n $instance->addSubscriberService('fos_user.listener.authentication', 'FOS\\\\UserBundle\\\\EventListener\\\\AuthenticationListener');\n $instance->addSubscriberService('fos_user.listener.flash', 'FOS\\\\UserBundle\\\\EventListener\\\\FlashListener');\n $instance->addSubscriberService('fos_user.listener.resetting', 'FOS\\\\UserBundle\\\\EventListener\\\\ResettingListener');\n $instance->addSubscriberService('victoire_core.cache_subscriber', 'Victoire\\\\Bundle\\\\CoreBundle\\\\EventSubscriber\\\\CacheSubscriber');\n $instance->addSubscriberService('victoire_i18n.locale_subscriber', 'Victoire\\\\Bundle\\\\I18nBundle\\\\Subscriber\\\\LocaleSubscriber');\n $instance->addSubscriberService('victoire_view_reference.listener', 'Victoire\\\\Bundle\\\\ViewReferenceBundle\\\\Listener\\\\ViewReferenceListener');\n\n return $instance;\n }", "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 ibase_set_event_handler($connection, $event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}", "protected function registerEvents(): void\n {\n Event::listen(MessageLogged::class, function (MessageLogged $e) {\n if( app()->bound('current-context') )\n app('current-context')->log((array)$e);\n });\n }", "public function attachListener(\n $listener,\n /*# string */ $eventName = '',\n /*# int */ $priority = 50\n )/*# : EventManagerInterface */;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function register(): void\n {\n $eventManager = EventManager::getInstance();\n\n $this->discoverEvents();\n\n foreach ($this->getListeners() as $moduleName => $moduleEvents) {\n foreach ($moduleEvents as $eventName => $eventListeners) {\n foreach (array_unique($eventListeners) as $listener) {\n $eventManager->addEventHandler(\n $moduleName,\n $eventName,\n [$listener, 'handle']\n );\n }\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 }", "protected function expectAddEvent()\n {\n $this->eventPublisher->expects($this->once())\n ->method('addEvent')\n ->with(['uuid' => '123']);\n }", "protected function getEventsManager() {}", "public function testImplementsEventNameAwareInterface(): void\n {\n $event = new CollectionEvent(\n $this->eventName,\n $this->persistService,\n $this->entityManager,\n $this->logger,\n $this->params\n );\n\n $this->assertInstanceOf(EventNameAwareInterface::class, $event);\n }", "private function init() {\n\t\tforeach (Config::get('app/events/loaders') as $loader => $parameters) {\n\t\t\t//Ignore disabled loaders\n\t\t\tif (isset($parameters['enabled']) && !$parameters['enabled'])\n\t\t\t\tcontinue;\n\n\t\t\t$driver = PHPLoader::getDriverClass(\"events\",$loader);\n\n\t\t\t$res = call_user_func([$driver,'load'],$this,$parameters);\n\t\t\tif ($res && is_array($res))\n\t\t\t\t$this->listeners = array_merge($this->listeners,$res);\n\t\t}\n\t}", "private function _registerConfigListeners()\n {\n $projectConfigService = $this->getProjectConfig();\n\n // Field groups\n $fieldsService = $this->getFields();\n $projectConfigService\n ->onAdd(Fields::CONFIG_FIELDGROUP_KEY . '.{uid}', [$fieldsService, 'handleChangedGroup'])\n ->onUpdate(Fields::CONFIG_FIELDGROUP_KEY . '.{uid}', [$fieldsService, 'handleChangedGroup'])\n ->onRemove(Fields::CONFIG_FIELDGROUP_KEY . '.{uid}', [$fieldsService, 'handleDeletedGroup']);\n\n // Fields\n $projectConfigService\n ->onAdd(Fields::CONFIG_FIELDS_KEY . '.{uid}', [$fieldsService, 'handleChangedField'])\n ->onUpdate(Fields::CONFIG_FIELDS_KEY . '.{uid}', [$fieldsService, 'handleChangedField'])\n ->onRemove(Fields::CONFIG_FIELDS_KEY . '.{uid}', [$fieldsService, 'handleDeletedField']);\n\n // Block Types\n $matrixService = $this->getMatrix();\n $projectConfigService\n ->onAdd(Matrix::CONFIG_BLOCKTYPE_KEY . '.{uid}', [$matrixService, 'handleChangedBlockType'])\n ->onUpdate(Matrix::CONFIG_BLOCKTYPE_KEY . '.{uid}', [$matrixService, 'handleChangedBlockType'])\n ->onRemove(Matrix::CONFIG_BLOCKTYPE_KEY . '.{uid}', [$matrixService, 'handleDeletedBlockType']);\n\n // Volumes\n $volumesService = $this->getVolumes();\n $projectConfigService\n ->onAdd(Volumes::CONFIG_VOLUME_KEY . '.{uid}', [$volumesService, 'handleChangedVolume'])\n ->onUpdate(Volumes::CONFIG_VOLUME_KEY . '.{uid}', [$volumesService, 'handleChangedVolume'])\n ->onRemove(Volumes::CONFIG_VOLUME_KEY . '.{uid}', [$volumesService, 'handleDeletedVolume']);\n Event::on(Fields::class, Fields::EVENT_AFTER_DELETE_FIELD, [$volumesService, 'pruneDeletedField']);\n\n // Transforms\n $transformService = $this->getAssetTransforms();\n $projectConfigService\n ->onAdd(AssetTransforms::CONFIG_TRANSFORM_KEY . '.{uid}', [$transformService, 'handleChangedTransform'])\n ->onUpdate(AssetTransforms::CONFIG_TRANSFORM_KEY . '.{uid}', [$transformService, 'handleChangedTransform'])\n ->onRemove(AssetTransforms::CONFIG_TRANSFORM_KEY . '.{uid}', [$transformService, 'handleDeletedTransform']);\n\n // Site groups\n $sitesService = $this->getSites();\n $projectConfigService\n ->onAdd(Sites::CONFIG_SITEGROUP_KEY . '.{uid}', [$sitesService, 'handleChangedGroup'])\n ->onUpdate(Sites::CONFIG_SITEGROUP_KEY . '.{uid}', [$sitesService, 'handleChangedGroup'])\n ->onRemove(Sites::CONFIG_SITEGROUP_KEY . '.{uid}', [$sitesService, 'handleDeletedGroup']);\n\n // Sites\n $projectConfigService\n ->onAdd(Sites::CONFIG_SITES_KEY . '.{uid}', [$sitesService, 'handleChangedSite'])\n ->onUpdate(Sites::CONFIG_SITES_KEY . '.{uid}', [$sitesService, 'handleChangedSite'])\n ->onRemove(Sites::CONFIG_SITES_KEY . '.{uid}', [$sitesService, 'handleDeletedSite']);\n\n // Routes\n Event::on(Sites::class, Sites::EVENT_AFTER_DELETE_SITE, [Craft::$app->getRoutes(), 'handleDeletedSite']);\n\n // Tags\n $tagsService = $this->getTags();\n $projectConfigService\n ->onAdd(Tags::CONFIG_TAGGROUP_KEY . '.{uid}', [$tagsService, 'handleChangedTagGroup'])\n ->onUpdate(Tags::CONFIG_TAGGROUP_KEY . '.{uid}', [$tagsService, 'handleChangedTagGroup'])\n ->onRemove(Tags::CONFIG_TAGGROUP_KEY . '.{uid}', [$tagsService, 'handleDeletedTagGroup']);\n Event::on(Fields::class, Fields::EVENT_AFTER_DELETE_FIELD, [$tagsService, 'pruneDeletedField']);\n\n // Categories\n $categoriesService = $this->getCategories();\n $projectConfigService\n ->onAdd(Categories::CONFIG_CATEGORYROUP_KEY . '.{uid}', [$categoriesService, 'handleChangedCategoryGroup'])\n ->onUpdate(Categories::CONFIG_CATEGORYROUP_KEY . '.{uid}', [$categoriesService, 'handleChangedCategoryGroup'])\n ->onRemove(Categories::CONFIG_CATEGORYROUP_KEY . '.{uid}', [$categoriesService, 'handleDeletedCategoryGroup']);\n Event::on(Fields::class, Fields::EVENT_AFTER_DELETE_FIELD, [$categoriesService, 'pruneDeletedField']);\n Event::on(Sites::class, Sites::EVENT_AFTER_DELETE_SITE, [$categoriesService, 'pruneDeletedSite']);\n\n // User group permissions\n $userPermissionsService = $this->getUserPermissions();\n $projectConfigService\n ->onAdd(UserGroups::CONFIG_USERPGROUPS_KEY . '.{uid}.permissions', [$userPermissionsService, 'handleChangedGroupPermissions'])\n ->onUpdate(UserGroups::CONFIG_USERPGROUPS_KEY . '.{uid}.permissions', [$userPermissionsService, 'handleChangedGroupPermissions'])\n ->onRemove(UserGroups::CONFIG_USERPGROUPS_KEY . '.{uid}.permissions', [$userPermissionsService, 'handleChangedGroupPermissions']);\n\n // User groups\n $userGroupsService = $this->getUserGroups();\n $projectConfigService\n ->onAdd(UserGroups::CONFIG_USERPGROUPS_KEY . '.{uid}', [$userGroupsService, 'handleChangedUserGroup'])\n ->onUpdate(UserGroups::CONFIG_USERPGROUPS_KEY . '.{uid}', [$userGroupsService, 'handleChangedUserGroup'])\n ->onRemove(UserGroups::CONFIG_USERPGROUPS_KEY . '.{uid}', [$userGroupsService, 'handleDeletedUserGroup']);\n\n // User field layout\n $usersService = $this->getUsers();\n $projectConfigService\n ->onAdd(Users::CONFIG_USERLAYOUT_KEY, [$usersService, 'handleChangedUserFieldLayout'])\n ->onUpdate(Users::CONFIG_USERLAYOUT_KEY, [$usersService, 'handleChangedUserFieldLayout'])\n ->onRemove(Users::CONFIG_USERLAYOUT_KEY, [$usersService, 'handleChangedUserFieldLayout']);\n Event::on(Fields::class, Fields::EVENT_AFTER_DELETE_FIELD, [$usersService, 'pruneDeletedField']);\n\n // Global sets\n $globalsService = $this->getGlobals();\n $projectConfigService\n ->onAdd(Globals::CONFIG_GLOBALSETS_KEY . '.{uid}', [$globalsService, 'handleChangedGlobalSet'])\n ->onUpdate(Globals::CONFIG_GLOBALSETS_KEY . '.{uid}', [$globalsService, 'handleChangedGlobalSet'])\n ->onRemove(Globals::CONFIG_GLOBALSETS_KEY . '.{uid}', [$globalsService, 'handleDeletedGlobalSet']);\n Event::on(Fields::class, Fields::EVENT_AFTER_DELETE_FIELD, [$globalsService, 'pruneDeletedField']);\n\n // Sections\n $sectionsService = $this->getSections();\n $projectConfigService\n ->onAdd(Sections::CONFIG_SECTIONS_KEY . '.{uid}', [$sectionsService, 'handleChangedSection'])\n ->onUpdate(Sections::CONFIG_SECTIONS_KEY . '.{uid}', [$sectionsService, 'handleChangedSection'])\n ->onRemove(Sections::CONFIG_SECTIONS_KEY . '.{uid}', [$sectionsService, 'handleDeletedSection']);\n Event::on(Sites::class, Sites::EVENT_AFTER_DELETE_SITE, [$sectionsService, 'pruneDeletedSite']);\n\n // Entry Types\n $projectConfigService\n ->onAdd(Sections::CONFIG_SECTIONS_KEY . '.{uid}.' . Sections::CONFIG_ENTRYTYPES_KEY . '.{uid}', [$sectionsService, 'handleChangedEntryType'])\n ->onUpdate(Sections::CONFIG_SECTIONS_KEY . '.{uid}.' . Sections::CONFIG_ENTRYTYPES_KEY . '.{uid}', [$sectionsService, 'handleChangedEntryType'])\n ->onRemove(Sections::CONFIG_SECTIONS_KEY . '.{uid}.' . Sections::CONFIG_ENTRYTYPES_KEY . '.{uid}', [$sectionsService, 'handleDeletedEntryType']);\n Event::on(Fields::class, Fields::EVENT_AFTER_DELETE_FIELD, [$sectionsService, 'pruneDeletedField']);\n\n // GraphQL Scopes\n $gqlService = $this->getGql();\n $projectConfigService\n ->onAdd(Gql::CONFIG_GQL_SCHEMAS_KEY . '.{uid}', [$gqlService, 'handleChangedSchema'])\n ->onUpdate(Gql::CONFIG_GQL_SCHEMAS_KEY . '.{uid}', [$gqlService, 'handleChangedSchema'])\n ->onRemove(Gql::CONFIG_GQL_SCHEMAS_KEY . '.{uid}', [$gqlService, 'handleDeletedSchema']);\n }", "protected function setUp()\n {\n parent::setUp();\n //Prepare the listener to save tokens\n $dispatcher = $this->engine->getDispatcher();\n $dispatcher->listen(ProcessInterface::EVENT_PROCESS_INSTANCE_CREATED,\n function (ProcessInstanceCreatedEvent $payload) {\n $this->storage[$payload->instance->getId()] = [\n 'processId' => $payload->process->getId(),\n 'data' => [],\n 'tokens' => [],\n 'status' => 'ACTIVE',\n ];\n });\n $dispatcher->listen(ProcessInterface::EVENT_PROCESS_INSTANCE_COMPLETED,\n function (ProcessInstanceCompletedEvent $payload) {\n $this->storage[$payload->instance->getId()]['status'] = 'COMPLETED';\n });\n $dispatcher->listen(ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n function (ActivityActivatedEvent $event) {\n $id = $event->token->getInstance()->getId();\n $this->storage[$id]['tokens'][$event->token->getId()] = [\n 'elementId' => $event->activity->getId(),\n 'status' => $event->token->getStatus(),\n ];\n });\n $dispatcher->listen(ActivityInterface::EVENT_ACTIVITY_COMPLETED,\n function (ActivityCompletedEvent $event) {\n $id = $event->token->getInstance()->getId();\n $this->storage[$id]['tokens'][$event->token->getId()] = [\n 'elementId' => $event->activity->getId(),\n 'status' => $event->token->getStatus(),\n ];\n });\n $dispatcher->listen(ActivityInterface::EVENT_ACTIVITY_CLOSED,\n function (ActivityClosedEvent $event) {\n $id = $event->token->getInstance()->getId();\n $this->storage[$id]['tokens'][$event->token->getId()] = [\n 'elementId' => $event->activity->getId(),\n 'status' => $event->token->getStatus(),\n ];\n });\n //Prepare a clean storage.\n $this->storage = [];\n }", "public function listen($event, $listener);", "public function testComDayCqReplicationAuditReplicationEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.replication.audit.ReplicationEventListener';\n\n $crawler = $client->request('POST', $path);\n }" ]
[ "0.69945896", "0.67635643", "0.6375402", "0.6313861", "0.62157464", "0.60791045", "0.60077304", "0.596841", "0.5953877", "0.58550787", "0.5840508", "0.58236134", "0.57880807", "0.57793", "0.57509434", "0.57075226", "0.570751", "0.56983125", "0.5659151", "0.5617767", "0.55777985", "0.5555846", "0.5555846", "0.5526103", "0.5509769", "0.55094814", "0.5477472", "0.546839", "0.5444418", "0.5433214", "0.5428988", "0.54204077", "0.5415877", "0.5415072", "0.5401976", "0.538042", "0.5380187", "0.5375242", "0.5368133", "0.5353755", "0.5345861", "0.531839", "0.53151834", "0.5310406", "0.5309175", "0.5298635", "0.52980745", "0.5289374", "0.5275269", "0.52696246", "0.52652097", "0.5259606", "0.5259561", "0.5248363", "0.52456594", "0.52452654", "0.5232473", "0.5231038", "0.5228815", "0.5224814", "0.52146846", "0.52125317", "0.5211114", "0.5195971", "0.51940256", "0.5185904", "0.51824915", "0.5159627", "0.5156826", "0.51554763", "0.515199", "0.5150686", "0.51488507", "0.5146472", "0.51420957", "0.51391155", "0.51379603", "0.5103287", "0.50879323", "0.50845474", "0.5076365", "0.50740266", "0.5072646", "0.50706464", "0.5065467", "0.5064095", "0.50604576", "0.5060155", "0.5044673", "0.5022988", "0.50217944", "0.50214696", "0.50210994", "0.50118625", "0.50115144", "0.5005105", "0.49993676", "0.49983177", "0.49936032", "0.49843216" ]
0.70835644
0
"Attaching event listeners by event name fails if preceded by detachment of all listeners for that type." Test contains 4 steps: assigning event manager to dummy service with single log event listener attached attaching second log listener detaching all log listeners attaching different listener NOTE: This test looks the same as above but it checks dettachAll() instead of detachAll() method. To be DELETED when dettachAll() will not supported any more.
public function testBug1331BackwardCompatibility() { $di = new Phalcon\Di; $di->set('componentX', function() use ($di) { $component = new LeDummyComponent(); $eventsManager = new Phalcon\Events\Manager; $eventsManager->attach('log', $di->get('MyFirstWeakrefListener')); $component->setEventsManager($eventsManager); return $component; }); $di->set('firstListener', 'MyFirstWeakrefListener'); $di->set('secondListener', 'MySecondWeakrefListener'); // ----- TESTING STEP 1 - SIGNLE 'LOG' LISTENER ATTACHED $component = $di->get('componentX'); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MyFirstWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); // ----- TESTING STEP 2 - SECOND 'LOG' LISTENER ATTACHED $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertCount(2, $logListeners); $firstLister = array_shift($logListeners); $secondLister = array_shift($logListeners); $this->assertInstanceOf('MyFirstWeakrefListener', $firstLister); $this->assertInstanceOf('MySecondWeakrefListener', $secondLister); // ----- TESTING STEP 3 - ALL 'LOG' LISTENER DETACHED $oldErrorLevel = error_reporting(E_ALL & ~E_DEPRECATED); @$component->getEventsManager()->dettachAll('log'); error_reporting($oldErrorLevel); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertEmpty($logListeners); // ----- TESTING STEP 4 - SINGLE 'LOG' LISTENER ATTACHED SECOND TIME $component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener')); $logListeners = $component->getEventsManager()->getListeners('log'); $this->assertInstanceOf('MySecondWeakrefListener', $logListeners[0]); $this->assertCount(1, $logListeners); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBug1331()\n\t{\n\t\t$di = new Phalcon\\Di;\n\t\t$di->set('componentX', function() use ($di) {\n\t\t\t$component = new LeDummyComponent();\n\t\t\t$eventsManager = new Phalcon\\Events\\Manager;\n\t\t\t$eventsManager->attach('log', $di->get('MyFirstWeakrefListener'));\n\t\t\t$component->setEventsManager($eventsManager);\n\t\t\treturn $component;\n\t\t});\n\n\t\t$di->set('firstListener', 'MyFirstWeakrefListener');\n\t\t$di->set('secondListener', 'MySecondWeakrefListener');\n\n\t\t// ----- TESTING STEP 1 - SIGNLE 'LOG' LISTENER ATTACHED\n\n\t\t$component = $di->get('componentX');\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\n\t\t$this->assertInstanceOf('MyFirstWeakrefListener', $logListeners[0]);\n\t\t$this->assertCount(1, $logListeners);\n\n\t\t// ----- TESTING STEP 2 - SECOND 'LOG' LISTENER ATTACHED\n\n\t\t$component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener'));\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\n\t\t$this->assertCount(2, $logListeners);\n\t\t$firstLister = array_shift($logListeners);\n\t\t$secondLister = array_shift($logListeners);\n\t\t$this->assertInstanceOf('MyFirstWeakrefListener', $firstLister);\n\t\t$this->assertInstanceOf('MySecondWeakrefListener', $secondLister);\n\n\t\t// ----- TESTING STEP 3 - ALL 'LOG' LISTENER DETACHED\n\n\t\t$component->getEventsManager()->detachAll('log');\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\t\t$this->assertEmpty($logListeners);\n\n\t\t// ----- TESTING STEP 4 - SINGLE 'LOG' LISTENER ATTACHED SECOND TIME\n\n\t\t$component->getEventsManager()->attach('log', $di->get('MySecondWeakrefListener'));\n\n\t\t$logListeners = $component->getEventsManager()->getListeners('log');\n\n\t\t$this->assertInstanceOf('MySecondWeakrefListener', $logListeners[0]);\n\t\t$this->assertCount(1, $logListeners);\n\t}", "function testShouldCheckIfListenersExist()\n {\n $this->assertFalse($this->emitter->hasListeners());\n $this->assertFalse($this->emitter->hasListeners('foo'));\n\n // check with \"foo\" listener\n $this->emitter->on('foo', $this->createTestCallback('foo'));\n\n $this->assertTrue($this->emitter->hasListeners());\n $this->assertTrue($this->emitter->hasListeners('foo'));\n\n // check event without any listeners\n $this->assertFalse($this->emitter->hasListeners('bar'));\n\n // check event with a global listener\n $this->emitter->on(EventEmitterInterface::ANY_EVENT, $this->createTestCallback('global'));\n\n $this->assertTrue($this->emitter->hasListeners('bar'));\n }", "public function testAttach()\n {\n $event = new EventManager();\n\n /** @var \\Closure $closure */\n $closure = function () {\n return $this->listeners;\n };\n\n $this->mvcKeeper->attach($event);\n\n $getListeners = $closure->bindTo($this->mvcKeeper, get_class($this->mvcKeeper));\n $listeners = $getListeners();\n\n foreach ($listeners as $listener) {\n $this->assertInstanceOf('Zend\\Stdlib\\CallbackHandler', $listener);\n }\n }", "public function testListenerRegistered(): void\n {\n $this->assertEventHasListener(QueryExecuted::class, QueryExecutedEventsListener::class);\n }", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function testGetSubscribedEvents()\n {\n $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);\n $events = $listener->getSubscribedEvents();\n\n $this->assertTrue(in_array('prePersist', $events));\n $this->assertTrue(in_array('preUpdate', $events));\n $this->assertTrue(in_array('postLoad', $events));\n $this->assertTrue(in_array('postRemove', $events));\n }", "protected function attachListeners($services, $eventManager, $listeners)\n {\n $lazyListeners = [];\n\n foreach ($listeners as $name => $options) {\n $options = $this->normalizeListenerOptions($name, $options);\n\n if ($options['lazy'] && null !== $options['attach']) {\n foreach ($options['attach'] as $spec) {\n $lazyListeners[] = [\n 'service' => $options['service'],\n 'event' => $spec['event'],\n 'method' => $spec['method'],\n 'priority' => $spec['priority'],\n ];\n }\n continue;\n }\n\n if ($services->has($options['service'])) {\n $listener = $services->get($options['service']);\n } elseif (class_exists($options['service'], true)) {\n $listener = new $options['service']();\n } else {\n throw new \\UnexpectedValueException(sprintf(\n 'Class or service %s does not exists. Cannot create listener instance.',\n $options['service']\n ));\n }\n\n if ($listener instanceof ListenerAggregateInterface) {\n $listener->attach($eventManager, $options['priority']);\n continue;\n }\n\n foreach ($options['attach'] as $spec) {\n $callback = $spec['method'] ? [ $listener, $spec['method'] ] : $listener;\n $eventManager->attach($spec['event'], $callback, $spec['priority']);\n }\n }\n\n if (!empty($lazyListeners)) {\n /* @var \\Core\\Listener\\DeferredListenerAggregate $aggregate */\n $aggregate = $services->get('Core/Listener/DeferredListenerAggregate');\n $aggregate->setListeners($lazyListeners)\n ->attach($eventManager);\n }\n }", "public function testAttachsToSharedEventManager()\n {\n $target = new CheckJobCreatePermissionListener();\n\n $events = $this->getMockBuilder('\\Zend\\EventManager\\SharedEventManager')\n ->disableOriginalConstructor()\n ->getMock();\n\n $events->expects($this->once())\n ->method('attach')\n ->with('Jobs/Acl/Assertion/Create', AssertionEvent::EVENT_ASSERT, array($target, 'checkCreatePermission'));\n\n $target->attachShared($events);\n }", "public function testAddListenerWithPriority()\n {\n // Arrange\n $callstack = [];\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$callstack) {\n $callstack[] = 1;\n }, 1);\n\n $communicator->addListener(function () use (&$callstack) {\n $callstack[] = 2;\n }, 2);\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertEquals([\n 2,\n 1\n ], $callstack);\n }", "public static function refreshListeners(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Reset event listeners on all models\n\t\t\tforeach (TestSettings::$modelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t\tforeach (TestSettings::$seededModelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t}\n\t}", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function testComDayCqDamCoreImplEventDamEventAuditListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.core.impl.event.DamEventAuditListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testComDayCqDamCoreImplDamChangeEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.core.impl.DamChangeEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testFireEventWithInternalFiredEvent()\n {\n $eventManager = new EventManager;\n $event = 'foor.bar';\n $eventManager->listen(EventManager::FIRED, function ($newEvent) use ($event) {\n $this->assertEquals($newEvent, $event);\n });\n $eventManager->fire($event);\n }", "public function testRemoveListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n $callback = function () use (&$listenerCalled) {\n $listenerCalled = true;\n };\n\n // Act\n $communicator->addListener($callback);\n $communicator->removeListener($callback);\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertFalse($listenerCalled);\n }", "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 attachEvents();", "public function attachEvents();", "public function detach(EventManagerInterface $events)\r\n {\r\n foreach ($this->listeners as $index => $listener) {\r\n if ($events->detach($listener)) {\r\n unset($this->listeners[$index]);\r\n }\r\n }\r\n }", "protected function setupListeners()\n {\n //\n }", "public function testComDayCqDamS7damCommonS7damDamChangeEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.s7dam.common.S7damDamChangeEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "public function shouldDiscoverEvents()\n {\n return true;\n }", "public function testDetachIsAnEmptyImplementation()\n {\n $target = new CheckJobCreatePermissionListener();\n\n $this->assertNull($target->detachShared(new \\Zend\\EventManager\\SharedEventManager()));\n }", "protected function registerListeners()\n {\n }", "public static function loadListeners()\n {\n $manager = self::instance();\n $plugins = Plugin::loaded();\n\n foreach ($plugins as $plugin) {\n $events = Plugin::getData($plugin, 'events')->getArrayCopy();\n foreach ($events as $name => $config) {\n if (is_numeric($name)) {\n $name = $config;\n $config = [];\n }\n\n $class = App::className($name, 'Event');\n $config = (array) $config;\n\n if ($class !== false) {\n $listener = new $class($config);\n $manager->on($listener, $config);\n }\n }\n }\n }", "public function testComDayCqDamScene7ImplScene7DamChangeEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.scene7.impl.Scene7DamChangeEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function bindEventListeners(ContainerInterface $container)\n {\n foreach ($container->findTaggedServiceIds('behat.events_listener') as $id => $tag) {\n $container->get($id)->registerListeners($this);\n }\n }", "public function listeners($eventName);", "public function getListeners($name = null);", "public function shouldDiscoverEvents(): bool\n {\n return false;\n }", "public function testGetEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function setEventsManager(ManagerInterface $eventsManager): void;", "public function testComAdobeCqSocialActivitystreamsListenerImplEventListenerHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.activitystreams.listener.impl.EventListenerHandler';\n\n $crawler = $client->request('POST', $path);\n }", "public function hasListeners($name);", "public function listen($events, $listener = null): void;", "public function attach(EventManagerInterface $events)\n {\n foreach ($this->hooks as $name => $spec) {\n $listeners[] = $events->attach($spec['event'], array($this, \"do$name\"));\n }\n }", "public function detachShared(SharedEventManagerInterface $events)\n\t\t{\n\t\t\tforeach ($this->listeners as $index => $listener) {\n\t\t\t if ($events->detach($index, $listener)) {\n\t\t\t\t unset($this->listeners[$index]);\n\t\t\t }\n\t\t }\n\t\t}", "public static function getSubscribedEvents()\n\t{\n\t\treturn array(\n\t\t\tBrowserTestCase::TEST_ENDED_EVENT => array('onTestEnd', 0),\n\t\t);\n\t}", "public function testEventCallBackPatch()\n {\n }", "public function testEventCallBackDelete()\n {\n }", "public function getListeners(): array;", "public function detachListener(\n $listener,\n /*# string */ $eventName = ''\n )/*# : EventManagerInterface */;", "public function detach(EventManagerInterface $events)\n {\n array_walk($this->listeners, array($events,'detach'));\n $this->listeners = array();\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }", "public function clearListeners()\n {\n $this->listeners = array();\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $i => $listener) {\n if ($events->getSharedManager()->detach(MainProcessor::EVENT_MANAGER_ID, $listener)) {\n unset($this->listeners[$i]);\n }\n }\n }", "protected function _loadListeners() {\n\t\tforeach (array_keys($this->config('listeners')) as $name) {\n\t\t\t$this->_loadListener($name);\n\t\t}\n\t}", "public function detach(EventManagerInterface $em)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($em->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($listener[$index]);\n }\n }\n }", "public function testEvents(string $class): void\n {\n $reflection = new ReflectionClass($class);\n // Avoid checking abstract classes, interfaces, and the like\n if (!$reflection->isInstantiable()) {\n $this->markTestSkipped(\"Class [$class] is not instantiable\");\n }\n\n // All event classes must implement EventListenerInterface\n $requiredInterface = $this->interface;\n $this->assertTrue($reflection->implementsInterface($requiredInterface), \"Class [$class] does not implement [$requiredInterface]\");\n\n // Instantiate the event class and get implemented events list\n $event = new $class();\n $implemented = $event->implementedEvents();\n $this->assertTrue(is_array($implemented), \"implementedEvents() of [$class] returned a non-array\");\n $this->assertFalse(empty($implemented), \"implementedEvents() of [$class] returned an empty array\");\n\n // Test that we each event's handler is actually callable\n // See: https://api.cakephp.org/3.4/class-Cake.Event.EventListenerInterface.html#_implementedEvents\n foreach ($implemented as $name => $handler) {\n if (is_array($handler)) {\n $this->assertFalse(empty($handler['callable']), \"Handler for event [$name] in [$class] is missing 'callable' key\");\n $this->assertTrue(is_string($handler['callable']), \"Handler for event [$name] in [$class] has a non-string 'callable' key\");\n $handler = $handler['callable'];\n }\n\n $this->assertTrue(method_exists($event, $handler), \"Method [$handler] does not exist in [$class] for event [$name]\");\n $this->assertTrue(is_callable([$event, $handler]), \"Method [$handler] is not callable in [$class] for event [$name]\");\n }\n }", "public function listeners($event);", "public function getImplementedListeners(): iterable;", "public function testAggregateEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "public function detach(EventManagerInterface $eventManager)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($eventManager->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function eventsEventStop(UnitTester $I)\n {\n $I->wantToTest('Events\\Event - stop()');\n\n $number = 0;\n $eventsManager = new Manager();\n\n $propagationListener = function (Event $event, $component, $data) use (&$number) {\n $number++;\n\n $event->stop();\n };\n\n $eventsManager->attach('some-type', $propagationListener);\n $eventsManager->attach('some-type', $propagationListener);\n\n $eventsManager->fire('some-type:beforeSome', $this);\n\n $I->assertEquals(1, $number);\n }", "private function _registerGraphQlListeners()\n {\n $invalidate = [$this->getGql(), 'invalidateCaches'];\n\n $this->getProjectConfig()->on(ProjectConfig::EVENT_ADD_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_REMOVE_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_UPDATE_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_REBUILD, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_AFTER_APPLY_CHANGES, $invalidate);\n $this->getElements()->on(Elements::EVENT_AFTER_SAVE_ELEMENT, $invalidate);\n $this->getElements()->on(Elements::EVENT_AFTER_DELETE_ELEMENT, $invalidate);\n $this->getStructures()->on(Structures::EVENT_AFTER_MOVE_ELEMENT, $invalidate);\n }", "public function testEventWithClosure()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', function ($newSecret) use ($secret) {\n $this->assertEquals($newSecret, $secret);\n });\n $eventManager->fire('secret', $secret);\n }", "public function detach(EventManagerInterface $events)\n {\n $sharedManager = $events->getSharedManager();\n\n foreach ($this->listeners as $index => $listeners) {\n if ($listeners === $this) {\n continue;\n }\n\n if ($listeners instanceof ListenerAggregateInterface) {\n $listeners->detach($events);\n }\n\n $events->detach($listeners);\n }\n\n /** @var array $sharedListeners */\n foreach ($this->sharedListeners as $id => $sharedListeners) {\n foreach ($sharedListeners as $index => $listener) {\n if ($listener === $this) {\n continue;\n }\n\n if ($listener instanceof ListenerAggregateInterface) {\n $listener->detach($events);\n }\n\n $sharedManager->detach($listener, $id);\n }\n }\n }", "private function processAny($listener,$e) {\n if($e->name == $listener[0] && $this->isWithin()) {\n $this->emit($listener[1],$e);\n }\n }", "public function testEventCallBackGetInboundReferences()\n {\n }", "abstract function HookEvents();", "public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected static function getListenerEvents($listeners, $basePath)\n {\n $listenerEvents = [];\n\n foreach ($listeners as $listener) {\n try {\n $listener = new ReflectionClass(\n static::classFromFile($listener, $basePath)\n );\n } catch (ReflectionException $e) {\n continue;\n }\n\n if (! $listener->isInstantiable()) {\n continue;\n }\n\n foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {\n if (! Str::is('handle*', $method->name) ||\n ! isset($method->getParameters()[0])) {\n continue;\n }\n\n $listenerEvents[$listener->name.'@'.$method->name] =\n Reflector::getParameterClassNames($method->getParameters()[0]);\n }\n }\n\n return array_filter($listenerEvents);\n }", "public function testEmittedEventName()\n {\n $expected = array(\n 'request.before_send' => 'onBeforeSend'\n );\n $this->assertEquals($expected, DaWandaPlugin::getSubscribedEvents());\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('received.node.void', [$this, 'onReceivedNodeVoid']);\n $this->listeners[] = $events->attach('received.node.receipt', [$this, 'onReceivedNodeReceipt']);\n }", "function detach($observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::unsetStaticObserver($nameHash);\n }\n }", "public function detachAll(string $event_name):bool{\r\n $this->storage[$event_name]=[];\r\n return true;\r\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function process(ContainerBuilder $container)\n {\n if (!$container->hasDefinition('synd_metrics.metric_listener')) {\n return;\n }\n \n $definition = $container->getDefinition('synd_metrics.metric_listener');\n \n foreach ($this->getEvents($container) as $eventName) {\n $definition->addMethodCall('addListenedEvent', array($eventName));\n }\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function testEventCallBackCreate()\n {\n }", "public function setEventsManager(ManagerInterface $eventsManager);", "public function attach(EventManagerInterface $events)\n {\n $sm = $this->getServiceManager();\n $em = $this->getEventManager();\n $shared = $em->getSharedManager();\n \n $this->listeners = array(\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_BOOTSTRAP, \n array($this, 'logout'), \n 1000002\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_BOOTSTRAP, \n array($this, 'authenticateRequest'), \n 1000001\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_BOOTSTRAP, \n array($this, 'prepareAuthorise'), \n 1000000\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_ROUTE, \n array($this, 'authoriseRoute')\n ),\n $shared->attach(\n 'Zend\\Mvc\\Application', \n MvcEvent::EVENT_DISPATCH,\n array($this, 'authoriseModule'),\n 10\n ),\n $shared->attach(\n 'Zend\\View\\View', \n ViewEvent::EVENT_RENDERER, \n array($this, 'updateView')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_AUTHENTICATE, \n array($this, 'doLocalAuthentication')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_LOGIN_FORM_BUILD, \n array('ZucchiSecurity\\Authentication\\Plugin\\Local', 'extendLoginForm')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_LOGOUT_FORM_BUILD, \n array('ZucchiSecurity\\Authentication\\Plugin\\Local', 'extendLogoutForm')\n ),\n $shared->attach(\n 'ZucchiSecurity',\n SecurityEvent::EVENT_LOGIN_FORM_BUILD, \n array('ZucchiSecurity\\Authentication\\Plugin\\Captcha', 'extendLoginForm')\n ),\n );\n }", "protected function attachDefaultListeners()\r\n {\r\n $events = $this->events();\r\n $events->attach('restrictAccess', array($this, '_restrictAccess'));\r\n }", "public function testFireEventWithInternalOnException()\n {\n $eventManager = new EventManager;\n $eventManager->listen(EventManager::ON_EXCEPTION, function ($ex) {\n $this->assertTrue($ex instanceof \\Exception);\n });\n $eventManager->listen('thrown', function () {\n throw new \\Exception('');\n });\n $eventManager->fire('thrown');\n }", "public function attach(EventManagerInterface $e, $priority = 100)\n {\n $shared = $e->getSharedManager();\n\t\t$this->listeners[] = $shared->attach('*', Event::EVENT_SOMETHING, [$this, 'logMessage']);\n \t\t//*** DATABASE EVENTS LAB: complete an \"attach()\" for INSERT and SELECT table operations\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_INSERT, [$this, 'logInsert'], $priority);\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_SELECT, [$this, 'logSelect'], $priority);\n }", "protected function addEventListenerTagsOnServiceDefinition(Definition $eventListenerDefinition, array $groupConfig, array $tagsConfig): void\n {\n // Define event listener on events\n foreach ($groupConfig as $eventsGroupName => $eventsGroupConfig) {\n foreach ($eventsGroupConfig['events'] as $eventName => $eventConfig) {\n foreach ($eventConfig['metrics'] as &$metricConfig) {\n // Parse each metric to get configuration tags (client and group tags)\n // Their values are defined in the configuration\n // Whereas metrics tags values are defined when the event is actually sent.\n // So, both \"tags\" types are handled differently.\n $metricConfig['configurationTags'] = \\array_merge(\n $tagsConfig,\n $eventsGroupConfig['tags'] ?? []\n );\n // Prefix the metric name.\n $metricConfig['name'] = $this->metricsPrefix.$metricConfig['name'];\n }\n // Set all the metrics config array in the object\n // One event can send several metrics. Multiple metrics will be handled in the EventListener.\n $eventListenerDefinition\n ->addTag('kernel.event_listener', [\n 'event' => $eventName,\n 'method' => 'handleEvent',\n ])\n ->addMethodCall('addEventToListen', [\n $eventName,\n $eventConfig,\n ]);\n }\n }\n\n // Define event listener on kernel terminate\n $eventListenerDefinition->addTag(\n 'kernel.event_listener',\n [\n 'event' => KernelEvents::TERMINATE,\n 'method' => 'onKernelTerminate',\n 'priority' => -100,\n ]\n );\n $eventListenerDefinition->addTag(\n 'kernel.event_listener',\n [\n 'event' => KernelEvents::RESPONSE,\n 'method' => 'onKernelResponse',\n 'priority' => -100,\n ]\n );\n if ($this->isSymfonyConsoleComponentLoaded()) {\n // Define event listener on console terminate\n $eventListenerDefinition->addTag(\n 'kernel.event_listener',\n [\n 'event' => ConsoleEvents::TERMINATE,\n 'method' => 'onConsoleTerminate',\n 'priority' => -100,\n ]\n );\n }\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }", "public static function getSubscribedEvents()\n {\n echo 'Test';\n }", "public function testComAdobeCqSocialActivitystreamsListenerImplModerationEventExten()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.activitystreams.listener.impl.ModerationEventExtension';\n\n $crawler = $client->request('POST', $path);\n }", "public function attach(EventManagerInterface $eventManager, $priority = 100)\n {\n $shared = $eventManager->getSharedManager();\n $this->listeners[] = '???';\n }", "public function testFireEventWithClass()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', 'Underlay\\Tests\\Events\\Test@call', function (\n $receivedSecret\n )\n use (\n $secret\n ) {\n $this->assertEquals($secret, $receivedSecret);\n });\n $eventManager->fire('secret', $secret);\n }", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function testComDayCqWcmWebservicesupportImplReplicationEventListener()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.webservicesupport.impl.ReplicationEventListener';\n\n $crawler = $client->request('POST', $path);\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $i => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$i]);\n }\n }\n\n return empty($this->listeners);\n }", "public function clearListeners(string $event): void;", "public function detachShared(SharedEventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $callback) {\n if ($events->detach('', $callback)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function testGetEvents()\n {\n }", "public function testOrgApacheSlingEventImplEventingThreadPool()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.event.impl.EventingThreadPool';\n\n $crawler = $client->request('POST', $path);\n }", "public function truncateEventClosures(): void\n {\n $this->listeners = [];\n }", "public function setEventManager(EventManagerInterface $events)\n {\n\n $entityManager = $this->entityManager;\n $role_id = $this->auth_user_role;\n // echo \" the fuck? ... not sure why this runs twice\";\n $events->attach('load-person', function (EventInterface $e) use ($entityManager, $role_id) {\n $person = $e->getParam('person');\n $hat = $person->getHat();\n $form = $e->getParam('form');\n $hat_options = $form->get('user')->get('person')->get('hat')\n ->getValueOptions();\n $hats_allowed = array_column($hat_options, 'value');\n if (! in_array($hat->getId(), $hats_allowed)) {\n $message = sprintf(\n 'The person identified by id %d, %s %s, wears the hat %s, '\n . 'but people in that category do not have user accounts '\n . 'in this system.',\n $person->getId(),\n $person->getFirstName(),\n $person->getLastname(),\n $hat\n );\n $controller = $e->getTarget();\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n }\n\n /**\n * this needs work. there are rare cases where one and the same\n * person may legitimately have to have more than one user account,\n * only one of which can be active at any one time, and each having\n * a different role from the other: 'submitter' vs any of the other\n * roles.\n */\n $user = $entityManager->getRepository('InterpretersOffice\\Entity\\User')\n ->findOneBy(['person' => $person]);\n //->getUser(['entity'=>'person','id' => $person->getId()]);\n if ($user) {\n $container = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager();\n\n $message = sprintf(\n 'We can\\'t create a new user account because this person '\n . ' (%s %s, id %d) already has one. ',\n $person->getFirstname(),\n $person->getLastname(),\n $person->getId()\n );\n $acl = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager()->get('acl');\n if ($acl->isAllowed($role_id, $user->getResourceId())) {\n $helper = $container->get('ViewHelperManager')->get('url');\n $url = $helper('users/edit', ['id' => $user->getId()]);\n $message .= sprintf(\n 'You can <a href=\"%s\">edit it</a> if you want to.',\n $url\n );\n }\n $controller = $e->getTarget();\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n }\n });\n // are they authorized to edit this user account?\n $events->attach('load-user', function (EventInterface $e) use ($role_id) {\n $resource_id = $e->getParam('user')->getResourceId();\n $acl = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager()->get('acl');\n if (! $acl->isAllowed($role_id, $resource_id)) {\n $controller = $e->getTarget();\n $message = \"Access denied to {$resource_id}'s user account\";\n $controller->flashMessenger()->addErrorMessage($message);\n return $controller->redirect()->toRoute('users');\n } else {\n $services = $e->getTarget()->getEvent()->getApplication()\n ->getServiceManager();\n $services->get(Entity\\Listener\\UpdateListener::class)\n ->setAuth($this->auth);\n }\n });\n\n return parent::setEventManager($events);\n }", "public function getListeners($eventName): array;" ]
[ "0.7127162", "0.6781595", "0.63583195", "0.6212212", "0.59697783", "0.58513314", "0.58121955", "0.58090234", "0.57643217", "0.57622194", "0.5736965", "0.571459", "0.5603445", "0.55999464", "0.559756", "0.5580654", "0.55109173", "0.55109173", "0.5507117", "0.5504725", "0.54952055", "0.5494528", "0.5489307", "0.54839396", "0.54457647", "0.54281986", "0.54041964", "0.54012376", "0.5375756", "0.53323", "0.52948576", "0.5291317", "0.5287123", "0.5285609", "0.5278175", "0.527695", "0.52725387", "0.5265356", "0.5256251", "0.5249277", "0.5242131", "0.52376086", "0.5229969", "0.52277833", "0.5219676", "0.52194244", "0.5212556", "0.5212556", "0.5212556", "0.5212556", "0.52122134", "0.51935613", "0.5192628", "0.51889056", "0.5186743", "0.5183806", "0.51828456", "0.517039", "0.51563734", "0.5147648", "0.51375073", "0.5135596", "0.5132925", "0.5132609", "0.5131118", "0.51300544", "0.5127275", "0.51247674", "0.5115804", "0.511503", "0.5100457", "0.5100415", "0.50933367", "0.5082683", "0.5077356", "0.5076669", "0.5068242", "0.50650746", "0.5054078", "0.5051342", "0.5050597", "0.501939", "0.50125426", "0.50119585", "0.5011305", "0.5006227", "0.50025046", "0.49738127", "0.49636242", "0.4962918", "0.49551842", "0.49394244", "0.49194553", "0.49150342", "0.4911353", "0.4908745", "0.4895187", "0.4893364", "0.48914605", "0.4885856" ]
0.7113836
1
protected $_orderby = array('coupon_id' => 'DESC', 'order_amount' => 'DESC');
public function _format_row($row) { $row['config'] = !empty($row['config']) ? unserialize($row['config']) : array();// 活动配置 return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrder()\n {\n return 50;\n }", "public function &getOrderBy();", "public function order();", "function getOrder()\n {\n return 20;\n }", "function getOrder()\n {\n return 20;\n }", "function getOrder()\n {\n return 10;\n }", "function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 30;\n }", "function getOrder(){\n\t\treturn $this->order;\n\t}", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 2;\n }", "function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 2;\n }", "public function getOrder()\n {\n return 5;\n }", "public function getOrder()\n {\n return 5;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 1;\n }", "function getOrder()\n {\n return 4;\n }", "function getOrder()\n {\n return 4;\n }", "function getOrder()\n {\n return 0;\n }", "function getOrder()\n {\n return 0;\n }", "public function getOrder()\n {\n return 40;\n }", "public function getOrder()\n {\n return 120;\n }", "public function getOrder()\n {\n return 120;\n }", "public function getOrder()\n {\n return 100;\n }", "public function getOrder()\n {\n return 100;\n }", "public function getOrder()\r\n {\r\n return 5;\r\n }", "public function getOrder()\r\n {\r\n return 5;\r\n }", "public function getOrder()\n {\n\n }", "public function getOrder()\n {\n return 10;\n }", "public function getOrder()\n {\n return 10;\n }", "public function getOrder()\n {\n return 10;\n }", "public function getOrder()\n {\n return 10;\n }", "public function getOrder()\n {\n return 10;\n }", "public function getOrder()\n {\n return 15;\n }", "public function orderField(): array\n {\n return ['id' => 'desc'];\n }", "public function order()\n {\n return $this->order;\n }", "public function getOrder()\n {\n return 20;\n }", "public function getOrder()\n {\n return 20;\n }", "public function order()\n {\n return 117;\n }", "public function getOrder()\n {\n return 130;\n }", "public function getSortOrder();", "public function getSortOrder();", "public function getSortOrder();", "public function getOrder()\n {\n return 140;\n }", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "public function get_order() {\n return 500;\n }", "public function getOrder()\n {\n return 3;\n }", "public function getOrder()\n {\n return 3;\n }", "function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}", "function getOrder()\n {\n return 7;\n }", "function getOrder()\n {\n return 7;\n }", "public function getOrder() {\n return 1;\n }", "public function getOrder()\n {\n return 110;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }", "public function getOrder()\n {\n return 1;\n }" ]
[ "0.71457356", "0.69236326", "0.6833512", "0.67882466", "0.67882466", "0.67563796", "0.6754603", "0.66720504", "0.6658025", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.6615248", "0.66149074", "0.6588012", "0.6587107", "0.6587107", "0.6566045", "0.6566045", "0.6566045", "0.6566045", "0.65627605", "0.65627605", "0.6557731", "0.6557731", "0.6556969", "0.65535134", "0.65535134", "0.6553113", "0.6553113", "0.6549951", "0.6549951", "0.6549297", "0.654655", "0.654655", "0.654655", "0.654655", "0.654655", "0.65398943", "0.6539138", "0.65193295", "0.65068024", "0.65068024", "0.6503198", "0.65009904", "0.6470643", "0.6470643", "0.6470643", "0.6465539", "0.64584875", "0.64584875", "0.64584875", "0.64584875", "0.64584875", "0.64584875", "0.6447858", "0.6447858", "0.6447858", "0.6447858", "0.6447858", "0.6447858", "0.6447858", "0.6447858", "0.6447858", "0.6435665", "0.64305615", "0.64305615", "0.642439", "0.64173025", "0.64173025", "0.6413959", "0.64137125", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077", "0.6392077" ]
0.0
-1
Display a listing of the resource.
public function index() { // Return log data. return view('admin.submission_log', [ 'config' => $this->configData, 'adminSections' => $this->adminSections, 'logData' => $this->logData ]); }
{ "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) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1