query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Enable the login on registration feature.
public static function loginOnRegistration(): string { return 'login-on-registration'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_user()\n {\n \n return true;\n \n }", "public function register(){\n\n\t\t$this->Login_model->register();\t\n\n\t}", "function login_form_register()\n {\n }", "public static function hasLoginOnRegistrationFeatures(): bool\n {\n return static::enabled(static::loginOnRegistration());\n }", "public function onLogin()\n {\n return true;\n }", "public function onLogin()\n {\n return true;\n }", "public function logInRegisterPage();", "public function setEnableRegistration($enableRegistration);", "public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'Bilder-DB';\n $view->heading = 'Registration';\n $view->display();\n }", "public function getLoginAfterRegistration();", "public function activate(){\n # Enable Single Sign-On\n if(in_array(\"login\", $this->features, TRUE)){\n $this->enable_sso();\n }\n }", "function register_action()\n {\n $login_model = $this->loadModel('Login');\n $registration_successful = $login_model->registerNewUser();\n\n if ($registration_successful == true) {\n $this->view->render('login/index');\n } else {\n $this->view->render('login/register');\n }\n }", "public function registration()\n {\n \n }", "function register()\n {\n if ($this->tank_auth->is_logged_in()) {\t\t\t\t\t\t\t\t\t// logged in\n redirect('');\n\n } elseif ($this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t// logged in, not activated\n redirect('/auth/send_again/');\n\n } elseif (!$this->config->item('allow_registration', 'tank_auth')) {\t// registration is off\n $this->_show_message($this->lang->line('auth_message_registration_disabled'));\n\n } else {\n $use_username = $this->config->item('use_username', 'tank_auth');\n /*if ($use_username) {\n $this->form_validation->set_rules('username', 'Username', 'trim|required|xss_clean|min_length['.$this->config->item('username_min_length', 'tank_auth').']|max_length['.$this->config->item('username_max_length', 'tank_auth').']|alpha_dash');\n }*/\n $this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|valid_email');\n $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|min_length['.$this->config->item('password_min_length', 'tank_auth').']|max_length['.$this->config->item('password_max_length', 'tank_auth').']|alpha_dash');\n $this->form_validation->set_rules('confirm_password', 'Confirm Password', 'trim|required|xss_clean|matches[password]');\n\n //$captcha_registration\t= $this->config->item('captcha_registration', 'tank_auth');\n //$use_recaptcha\t\t\t= $this->config->item('use_recaptcha', 'tank_auth');\n //if ($captcha_registration) {\n //if ($use_recaptcha) {\n //$this->form_validation->set_rules('recaptcha_response_field', 'Confirmation Code', 'trim|xss_clean|required|callback__check_recaptcha');\n //} else {\n //$this->form_validation->set_rules('captcha', 'Confirmation Code', 'trim|xss_clean|required|callback__check_captcha');\n //}\n //}\n $data['errors'] = array();\n\n $email_activation = $this->config->item('email_activation', 'tank_auth');\n\n if ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\n if (!is_null($data = $this->tank_auth->create_user(\n $use_username ? $this->form_validation->set_value('username') : '',\n $this->form_validation->set_value('email'),\n $this->form_validation->set_value('password'),\n $email_activation))) {\t\t\t\t\t\t\t\t\t// success\n\n $data['site_name'] = $this->config->item('website_name', 'tank_auth');\n\n if ($email_activation) {\t\t\t\t\t\t\t\t\t// send \"activate\" email\n $data['activation_period'] = $this->config->item('email_activation_expire', 'tank_auth') / 3600;\n\n $this->_send_email('activate', $data['email'], $data);\n\n unset($data['password']); // Clear password (just for any case)\n\n $this->_show_message($this->lang->line('auth_message_registration_completed_1'));\n\n } else {\n if ($this->config->item('email_account_details', 'tank_auth')) {\t// send \"welcome\" email\n\n $this->_send_email('welcome', $data['email'], $data);\n }\n unset($data['password']); // Clear password (just for any case)\n\n $this->_show_message($this->lang->line('auth_message_registration_completed_2').' '.anchor('/auth/login/', 'Login'));\n }\n } else {\n $errors = $this->tank_auth->get_error_message();\n foreach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\n }\n }\n //if ($captcha_registration) {\n //if ($use_recaptcha) {\n //$data['recaptcha_html'] = $this->_create_recaptcha();\n //} else {\n //$data['captcha_html'] = $this->_create_captcha();\n //}\n //}\n //$data['use_username'] = $use_username;\n //$data['captcha_registration'] = $captcha_registration;\n //$data['use_recaptcha'] = $use_recaptcha;\n $this->load->view('auth/register_form', $data);\n }\n }", "public function action_register(){\n\t\t\n\t\t$user = CurUser::get();\n\t\t\n\t\tif($user->save($_POST, User_Model::SAVE_REGISTER)){\n\t\t\t$user->login($user->{CurUser::LOGIN_FIELD}, $_POST['password']);\n\t\t\tApp::redirect('user/profile/greeting');\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\tMessenger::get()->addError('При регистрации возникли ошибки:', $user->getError());\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function register()\n\t{\n\t\tif ($this->tank_auth->is_logged_in()) {\t\t\t\t\t\t\t\t\t// logged in\n\t\t\tredirect('');\n\n\t\t} elseif ($this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t// logged in, not activated\n\t\t\tredirect('/auth/send_again/');\n\n\t\t} elseif (!$this->config->item('allow_registration', 'tank_auth')) {\t// registration is off\n\t\t\t$this->_show_message($this->lang->line('auth_message_registration_disabled'));\n\n\t\t} else {\n\t\t\t $use_username = $this->config->item('use_username', 'tank_auth');\n\t\t\tif ($use_username) \n\t\t\t{\t\t\t\t\n\t\t\t\t$this->form_validation->set_rules('username', 'Username', 'trim|required|xss_clean|min_length['.$this->config->item('username_min_length', 'tank_auth').']|max_length['.$this->config->item('username_max_length', 'tank_auth').']');\n\t\t\t}\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|valid_email');\n\t\t\t$this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|min_length['.$this->config->item('password_min_length', 'tank_auth').']|max_length['.$this->config->item('password_max_length', 'tank_auth').']');\n\t\t\t//$this->form_validation->set_rules('confirm_password', 'Confirm Password', 'trim|required|xss_clean|matches[password]');\n\n\t\t\t$captcha_registration\t= $this->config->item('captcha_registration', 'tank_auth');\n\t\t\t$use_recaptcha\t\t\t= $this->config->item('use_recaptcha', 'tank_auth');\n\t\t\tif ($captcha_registration) {\n\t\t\t\tif ($use_recaptcha) {\n\t\t\t\t\t$this->form_validation->set_rules('recaptcha_response_field', 'Confirmation Code', 'trim|xss_clean|required|callback__check_recaptcha');\n\t\t\t\t} else {\n\t\t\t\t\t$this->form_validation->set_rules('captcha', 'Confirmation Code', 'trim|xss_clean|required|callback__check_captcha');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['errors'] = array();\n\n\t\t\t$email_activation = $this->config->item('email_activation', 'tank_auth');\n\n\t\t\tif ($this->form_validation->run())\n\t\t\t{\t\t\t\t\t\t\t\t// validation ok\n\t\t\t\tif (!is_null($data = $this->tank_auth->create_user(\n\t\t\t\t\t\t$use_username ? $this->form_validation->set_value('username') : '',\n\t\t\t\t\t\t$this->form_validation->set_value('email'),\n\t\t\t\t\t\t$this->form_validation->set_value('password'),\n\t\t\t\t\t\t$email_activation)))\n\t\t\t\t{\n\t\t\t\t\t//success\t\t\t\t\t\n\t\t\t\t\t$data['site_name'] = $this->config->item('website_name', 'tank_auth');\n\t\t\t\t\tif ($email_activation)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t// send \"activate\" email\n\t\t\t\t\t\t$data['activation_period'] = $this->config->item('email_activation_expire', 'tank_auth') / 3600;\n\n\t\t\t\t\t\t$this->_send_email('activate', $data['email'], $data);\n\n\t\t\t\t\t\tunset($data['password']); // Clear password (just for any case)\n\n\t\t\t\t\t\t$this->_show_message($this->lang->line('auth_message_registration_completed_1'));\n\t\t\t\t\t} \n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//Directly login the user, that's it, no activation nonsense (for nows)\n\t\t\t\t\t\t$this->_external_login($data['user_id'], $this->form_validation->set_value('username') );\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if ($this->config->item('email_account_details', 'tank_auth')) {\t// send \"welcome\" email\n\n\t\t\t\t\t\t// \t$this->_send_email('welcome', $data['email'], $data);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// unset($data['password']); // Clear password (just for any case)\n\n\t\t\t\t\t\t// $this->_show_message($this->lang->line('auth_message_registration_completed_2').' '.anchor('/auth/login/', 'Login'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$errors = $this->tank_auth->get_error_message();\n\t\t\t\t\tforeach ($errors as $k => $v)\t\n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t$data['errors'][$k] = $this->lang->line($v);\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t\tif ($captcha_registration) {\n\t\t\t\tif ($use_recaptcha) {\n\t\t\t\t\t$data['recaptcha_html'] = $this->_create_recaptcha();\n\t\t\t\t} else {\n\t\t\t\t\t$data['captcha_html'] = $this->_create_captcha();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['use_username'] = $use_username;\n\t\t\t$data['captcha_registration'] = $captcha_registration;\n\t\t\t$data['use_recaptcha'] = $use_recaptcha;\n\t\t\tdisplay('register_user_address', $data);\n\t\t}\n\t}", "function capstone_template_register_login_protection() {\n if ( is_page_template( 'template-compact.php' ) ) { // is user accessing a compact template page?\n $is_login_page = get_theme_mod('capstone_auth_login_page') && is_page(get_theme_mod('capstone_auth_login_page'));\n $is_register_page = get_theme_mod('capstone_auth_register_page') && is_page(get_theme_mod('capstone_auth_register_page'));\n $redirect_to = isset($_GET['redirect_to']) ? $_GET['redirect_to'] : '';\n\n if ( is_user_logged_in() && ($is_login_page || $is_register_page) ) {\n if ($redirect_to) {\n wp_redirect( $redirect_to );\n exit;\n } else { // is user logged in + visiting login/register page?\n wp_redirect( esc_url(get_permalink(get_theme_mod('capstone_dashboard_main_page'))) );\n exit;\n }\n }\n\n }\n }", "public function activate()\n {\n if (Manager::getInstance()->isPluginActivated('Login') == true) {\n Manager::getInstance()->deactivatePlugin('Login');\n }\n }", "public static function autoLogin()\n {\n return true;\n }", "public function getEnableRegistration();", "public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\n\t\t\t} else {\n\t\t\t\t$this -> Session -> setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}", "public function loginRegister () {\n \treturn view(\"Socialite.login-register\");\n }", "function register()\n\t{\n\t\tif ($this->tank_auth->is_logged_in()) {\t\t\t\t\t\t\t\t\t// logged in\n\t\t\tredirect('');\n\n\t\t} elseif ($this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t// logged in, not activated\n\t\t\tredirect('/auth/send_again/');\n\n\t\t} elseif (config_item('allow_client_registration') == 'FALSE') {\t// registration is off\n\t\t\t$this->session->set_flashdata('response_status', 'error');\n\t\t\t$this->session->set_flashdata('message', lang('auth_message_registration_disabled'));\n\t\t\tredirect('login');\n\n\t\t} else {\n\t\t\t$use_username = config_item('use_username');\n\t\t\tif ($use_username) {\n\t\t\t\t$this->form_validation->set_rules('username', lang('username'), 'trim|required|xss_clean|min_length['.config_item('username_min_length').']|max_length['.config_item('username_max_length').']');\n\t\t\t}\n $this->form_validation->set_rules('fullname', lang('full_name'), 'trim|required|xss_clean');\n\t\t\t$this->form_validation->set_rules('email', lang('email'), 'trim|required|xss_clean|valid_email');\n\t\t\t$this->form_validation->set_rules('password', lang('password'), 'trim|required|xss_clean|min_length['.config_item('password_min_length').']|max_length['.config_item('password_max_length').']');\n\t\t\t$this->form_validation->set_rules('confirm_password', lang('confirm_password'), 'trim|required|xss_clean|matches[password]');\n\n\t\t\t$captcha_registration\t= config_item('captcha_registration');\n\t\t\t$use_recaptcha\t= config_item('use_recaptcha');\n\t\t\tif ($captcha_registration == 'TRUE') {\n\t\t\t\tif ($use_recaptcha) {\n\t\t\t\t\t$this->form_validation->set_rules('recaptcha_response_field', 'Confirmation Code', 'trim|xss_clean|required|callback__check_recaptcha');\n\t\t\t\t} else {\n\t\t\t\t\t$this->form_validation->set_rules('captcha', 'Confirmation Code', 'trim|xss_clean|required|callback__check_captcha');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['errors'] = array();\n\t\t\t$email_activation = config_item('email_activation');\n $individual = $this->input->post('company_name') == '' ? 1:0;\n\n\t\t\tif ($this->form_validation->run($this)) {\t\t\t\t\t\t\t\t// validation ok\n\t\t\t\tif (!is_null($data = $this->tank_auth->create_user(\n $use_username ? $this->form_validation->set_value('username') : '',\n $this->form_validation->set_value('email'),\n $this->form_validation->set_value('password'),\n $this->input->post('fullname'),\n '-',\n '2',\n '',\n $email_activation,\n $individual == 1 ? $this->input->post('fullname'):$this->input->post('company_name'),\n $individual\n ))) {\t // success\n\n\t\t\t\t\t$data['site_name'] = config_item('company_name');\n\n\t\t\t\t\tif ($email_activation) {\t\t\t\t\t\t\t\t\t// send \"activate\" email\n\t\t\t\t\t\t$data['activation_period'] = config_item('email_activation_expire') / 3600;\n\n\t\t\t\t\t\t$this->_send_email('activate', $data['email'], $data);\n\n\t\t\t\t\t\tunset($data['password']); // Clear password (just for any case)\n\n $this->session->set_flashdata('message', lang('auth_message_registration_completed_1'));\n \t\t\t\t\tredirect('/auth/login');\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (config_item('email_account_details') == 'TRUE') {\t// send \"welcome\" email\n\n\t\t\t\t\t\t\t$this->_send_email('welcome', $data['email'], $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($data['password']); // Clear password (just for any case)\n\t\t\t$this->session->set_flashdata('message', lang('auth_message_registration_completed_2'));\n\t\t\t\t\t\tredirect('/auth/login');\n\t\t\t\t\t\t//$this->_show_message($this->lang->line('auth_message_registration_completed_2').' '.anchor('/auth/login/', 'Login'));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$errors = $this->tank_auth->get_error_message();\n\t\t\t\t\tforeach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($captcha_registration == 'TRUE') {\n\t\t\t\tif ($use_recaptcha) {\n\t\t\t\t\t$data['recaptcha_html'] = $this->_create_recaptcha();\n\t\t\t\t} else {\n\t\t\t\t\t$data['captcha_html'] = $this->_create_captcha();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['use_username'] = $use_username;\n\t\t\t$data['captcha_registration'] = $captcha_registration;\n\t\t\t$data['use_recaptcha'] = $use_recaptcha;\n\t$this->load->module('layouts');\n\t$this->load->library('template');\n\t$this->template->title('Register - '.config_item('company_name'));\n\t$this->template\n\t->set_layout('login')\n\t->build('auth/register_form',isset($data) ? $data : NULL);\n\n\t\t}\n\t}", "public function register()\n\t{\n\t\tif($this->current_user) //is the CURRENT USER(OWNER OF CURRENT PHP SCRIPT LOGGED?)\n\t\t{\n\t\t\tredirect(base_url('dashboard'));\n\t\t}else{\n\t\t\t $this->load->view(\"register\");\n\t\t}\n\t}", "public function activate() {\n\n\t\t$this->registration_handler->register();\n\t\t\n\t}", "private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "public function enableTwoFactorAuth(): void\n {\n $this->twoFactorAuth->enabled_at = now();\n\n if (config('laraguard.recovery.enabled')) {\n $this->generateRecoveryCodes();\n }\n\n $this->twoFactorAuth->save();\n\n event(new Events\\TwoFactorEnabled($this));\n }", "function registrarSesion () {\n\n if (!empty($this->id_usuario)) {\n $this->salvar(['ultima_session' => 'current_timestamp',\n 'activo' => 1\n ]);\n Helpers\\Sesion::sessionLogin();\n }\n else return false;\n\n }", "public function register()\n {\n $name = $this->loginEntry->input('uname');\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n $this->userDetail->makeEntry($name, $email, $password);\n \n $info = $this->userDetail->getDetail($email, $password);\n \n $this->commonFunction->setSession($info->id, $info->user_name);\n \n return redirect('/dashboard');\n }", "static function redirect_to_custom_register() {\n Log::addEntry(\"redirect_to_custom_register()\");\n if ( 'GET' == $_SERVER['REQUEST_METHOD'] ) {\n Log::addEntry(\"user is trying to request the registration form...\");\n if ( is_user_logged_in() ) {\n LoginController::redirect_logged_in_user();\n } else {\n wp_redirect( home_url(self::getSlug() ) );\n }\n exit;\n } \n }", "function addLogin(){\n\t\tif(!$this->data['Registration']['number'] && !$this->data['Registrator']['email']) {\n\t\t\t// First time visiting the site, do nothing and just display the view\n\t\t\t$this->Session->write('errors.noInput', 'Fyll i <strong>bokningsnummer</strong> och <strong>email</strong>');\n\t\t} else { \n\t\t\t// Sanitize the input data\n\t\t\tif($this->data['Registration']['number']) {\n\t\t\t\t$number = Sanitize::clean($this->data['Registration']['number']);\n\t\t\t} else {\n\t\t\t\t$this->Session->write('errors.noNumber', 'Du har glömt fylla i <strong>bokningsnummer</strong>');\n\t\t\t\t$number = false;\n\t\t\t}\n\t\t\tif ($this->data['Registrator']['email']){\n\t\t\t\t$email = Sanitize::clean($this->data['Registrator']['email']);\n\t\t\t} else {\n\t\t\t\t$this->Session->write('errors.noEmail', 'Du har glömt fylla i <strong>email</strong>');\n\t\t\t\t$email = false;\n\t\t\t}\n\t\t\tif ($number && $email){\n\t\t\t\t$number = strtoupper($number);\n\t\t\t\t// Get an array from the database with all the info on the registration\n\t\t\t\tif($registration = $this->Registration->findByNumber($number)){\n\t\t\t\t\t$event = $registration['Event'];\n\t\t\t\t\tunset($registration['Event']);\n\t\t\t\t\tunset($registration['Invoice']);\n\t\t\t\t\t$this->Session->write('Event', $event);\n\t\t\t\t\t// Checks the array from the database and tries to match the email with the form//\n\t\t\t\t\t$email = $this->data['Registrator']['email'];\n\t\t\t\t\tif($registration['Registrator']['email'] == $email){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->Session->write('loggedIn', true);\n\t\t\t\t\t\t$this->Registration->putRegistrationInSession($registration, $this->Session);\n\t\t\t\t\t\t$this->setPreviousStepsToPrevious('Registrations','review');\n\t\t\t\t\t\t$this->requestAction('steps/redirectToNextUnfinishedStep');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//the user has put in wrong values in the field 'email'\n\t\t\t\t\t\t$this->Session->write('errors.unvalidEmail', 'Är du säker på att skrev rätt <strong>email?</strong>');\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\t//the user has put in wrong values in at least the 'booking number' field\n\t\t\t\t\t$this->Session->write('errors.noBookingnr', 'Är du säker på att du skrev rätt <strong>bokningsnummer?</strong>');\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->redirect(array('controller' => 'registrations', 'action' => 'login'));\t\t\n\t}", "function reg() {\n\t\t//~ screening input data\n\t\t$tmp_arr=mysql::screening_array($_POST);\n\t\t$login=$tmp_arr['login'];\n\t\t$passwd=$tmp_arr['passwd'];\n\t\t$passwd2=$tmp_arr['passwd2'];\n\t\t$mail=$tmp_arr['mail'];\n\n\t\t//~ Check valid user data\n\t\tif ($this->check_new_user($login, $passwd, $passwd2, $mail)) {\n\t\t\t//~ User data is correct. Register.\n\t\t\t$user_key = $this->generateCode(10);\n\t\t\t$passwd = md5($user_key.$passwd.SECRET_KEY); //~ password hash with the private key and user key\n\t\t\t$query=mysql::query(\"INSERT INTO `users` (`id_user`, `login_user`, `passwd_user`, `mail_user`, `key_user`,`img`) VALUES (NULL, '\".$login.\"', '\".$passwd.\"', '\".$mail.\"', '\".$user_key.\"','/feditor/attached/image/20150313/20150313102144_79301.jpg');\");\n\t\t\tif ($query) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tself::$error='Произошла ошибка при регистрации нового пользователя. Связаться с администрацией.';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function ulogiraj_registiraj()\r\n\t{\r\n\t\tif(isset($_POST['ulogiraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Login';\r\n\t\t\t$this->registry->template->show( 'login' );\r\n\t\t}\r\n\t\tif(isset($_POST['registriraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Registriraj se';\r\n\t\t\t$this->registry->template->show( 'register' );\r\n\t\t}\r\n\r\n\t}", "public function beforeFilter()\n\t{\n\t\tparent::beforeFilter();\n\t\t$this->Auth->authenticate = array(\n\t\t\t'Form' => array('userModel' => 'Admin')\n\t\t);\n\t\t$this->Auth->allow('register');\n\t}", "public function register()\n {\n Auth::extend('sso', function ($app, $name, array $config) {\n // 返回一个 Illuminate\\Contracts\\Auth\\Guard 实例...\n return new OaGuard(Auth::createUserProvider($config['provider']),$app->make('request'));\n });\n\n Auth::provider('sso', function ($app, array $config) {\n return new OaUserProvider();\n });\n }", "function ajax_login_register_init()\n{\n\n // Enable the user with no privileges to run ajax_login() in AJAX\n add_action('wp_ajax_nopriv_ajaxlogin', 'ajax_login');\n\n add_action('wp_ajax_nopriv_register_user', 'ajax_reg_new_user');\n\n}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public function register()\n {\n echo 'User Registered';\n }", "public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }", "protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }", "function google_login_allow_new_users_with_google()\n{\n\t$site_reg = elgg_get_config('allow_registration');\n\t$google_reg = elgg_get_plugin_setting('new_users');\n\tif ($site_reg || (!$site_reg && $google_reg == 'yes'))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }", "public function login() {\n\t\t$this->helpers[] = 'Form';\n\t}", "public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }", "public function check_login(): void\n {\n if ($this->email_activation && $this->user && !$this->user['email_verified']) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect('/register');\n }\n\n if (!$this->user) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect('/login');\n }\n }", "public function register_action()\n {\n $registration_successful = RegistrationModel::registerNewUser();\n\n if ($registration_successful) {\n Redirect::to('index');\n } else {\n Redirect::to('user/register');\n }\n }", "function iarb_extauth()\n{\n\tglobal $context, $modSettings;\n\n\tif (empty($modSettings['extauth_master']))\n\t{\n\t\treturn;\n\t}\n\n\t// Registration Screen ?\n\tif ((!empty($context['site_action']) && $context['site_action'] === 'register')\n\t\t&& (isset($_GET['action']) && $_GET['action'] === 'register'))\n\t{\n\t\t// Load the enabled providers\n\t\trequire_once(SUBSDIR . '/Extauth.subs.php');\n\t\t$context['enabled_providers'] = extauth_enabled_providers();\n\n\t\tif ($modSettings['requireAgreement'] && empty($_POST['accept_agreement']))\n\t\t{\n\t\t\tTemplate_Layers::instance()->addBegin('extauth_register');\n\t\t}\n\t}\n}", "public function register() {\n\t\t$user_email = $this->input->post(\"email\");\n\t\t$user_password = md5($this->input->post('password'));\n\t\t$user_reg_ip = ip2long($this->input->ip_address());\n\t\t\n\t\t$re = $this->user_lib->save_reg_userInfo($user_email,$user_password,$user_reg_ip);\n\t\t\n\t\tif($re===false){\n\t\t\t//set mc error\n\t\t}\n\t\t/*if(!$this->email_lib->send_active_email($user_email)){\n\t\t\t//send mail error\n\t\t}*/\n\t\t$uid = $this->user_lib->active_process($user_email);\n\t\tif($uid===false){\n\t\t\treturn false;\t\t//for active error\n\t\t}\n\t//\t$this->_set_login_cookie($uid);\n\t\tredirect('/regsuccess'); \n\t}", "public function Register() {\n //\n if ($this->IsUsernameOrEmailTaken_()) return false;\n\n $queryStr = \"INSERT INTO Admins (email,passwd,fName,lName,username,phoneNumber) VALUES ('{$this->email}','{$this->GetPasswordHash()}','{$this->fName}','{$this->lName}','{$this->GetUsername()}','{$this->phoneNumber}');\";\n if ($this->db->sql->query($queryStr)) {\n $this->QueryForID_();\n return true;\n }\n return false;\n }", "public function register() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->register();\n }\n }", "public function check_login(): void\n {\n if ($this->email_activation and $this->user and !$this->user['email_verified']) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect('/register');\n }\n\n if (!$this->user) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect($this->login);\n }\n }", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "public function register()\n\t{\n\t \t$this->load->library('form_validation');\n\t \t$this->load->helper('security');\n\t \t$this->form_validation->set_rules('siape', 'Siape', \n\t \t\t'trim|required|xss_clean|max_length[8]|is_unique[tb_professor.siape]',\n\t \t\tarray('is_unique' => 'Siape já cadastrado'));\n\t \t$this->form_validation->set_rules('nome', 'Nome', 'trim|required|xss_clean');//call_back_checar repetição\n\t \t$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|is_unique[tb_professor.email]',\n\t \t\tarray('is_unique' => 'E-mail já cadastrado'));\n\t \t$this->form_validation->set_rules('senha', 'Password', 'trim|required|xss_clean|matches[confirmasenha]',\n\t \t\tarray('matches' => 'Confirmação de senha inválida' ));\n\t \t$this->form_validation->set_rules('confirmasenha', 'CPassword', 'trim|required|xss_clean');\n\n\t \tif($this->form_validation->run() == FALSE)\n\t \t{ \n\t \t\t$data['register_tab'] = 'active';\n\t \t\t$data['login_tab'] = 'inactive';\n\t \t$this->load->view('login/login.php', $data);\n\t \t}\n\t \telse\n\t \t{ \n\t \t$this->insert_professor();\n\t \tredirect('login', 'refresh');\n\t \t}\n\t}", "public function register()\n {\n $this->registration->execute([],$this);\n }", "public function register(){\n\t\t//Better to be implemented through db table\n\t\t$userRole = array('Job Seeker'=>'Job Seeker', 'Employer'=>'Employer');\n\t\t$this->set('userRole',$userRole);\n\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\t\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('You are now registered and may login'));\n\t\t\t\treturn $this->redirect(array('controller'=>'jobs','action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Unable to create new user'));\n\n\t\t\t}\n\t\t}\n\t}", "public function registerDo(){\n\n\t\n\n\t\t$this->Login_model->registerDo();\n\n\t}", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "public function registerAdminAction()\n {\n if($this->passwordFieldCheck($this->httpParameters['password'],$this->httpParameters['passwordCheck'],\n '/auth/first-time'))\n {\n try\n {\n //Instantiates a User\n $admin = new User([\n 'username' => $this->httpParameters['username'],\n 'email' => $this->httpParameters['email'],\n 'password' => $this->httpParameters['password'],\n 'role' => User::ROLE_ADMIN\n ]);\n\n //Inserts admin in database\n $this->manager->insertUser($admin);\n\n //Sets to the user the last id registered\n $admin->setId($this->manager->lastId());\n\n //Sets the $_SESSION user\n $_SESSION['user'] = $admin;\n\n $this->response->redirect('/admin',HttpResponse::ADMIN_REGISTERED);\n }\n catch(EntityAttributeException $e)\n {\n //Redirects to same page in case of typing error\n $this->response->redirect('/auth/first-time',$e->getMessage());\n }\n }\n }", "protected function require_login()\n {\n return false;\n }", "public function register(){\n $this->registration->execute([], $this);\n }", "public function register(){\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$status = false;\n\t\t\n\t\t$stmt = $conn->prepare(\"insert into login (username,email,password,user_type) VALUES (?, ?, ?, ?)\");\n\t\t$v_password=sha1($this->password);\n\t\t$stmt->bind_param(\"sssd\", $this->username,$this->email,$v_password,$this->type);\t\t\t\n\t\t if($stmt->execute()){\n\t\t $status = true;\n\t\t }\n\t\t//release resources\n\t\t$stmt->free_result();\n\t\t$conn->close();\n\t\t\n\t\treturn $status;\t\n\t}", "function users_can_register_signup_filter()\n {\n }", "protected function isUserAllowedToLogin() {}", "public function register()\n {\n\t\tUser::deleting(function ($user) {\n\t\t\tif ($user->id === 1) {\n\t\t\t\treturn redirect()->back();\n\t\t\t}\n\t\t});\n }", "public function onRegister();", "public function checkFirstLogin();", "public function getLoginNameForRegister()\n {\n return $this->loginNameForRegister;\n }", "public function setLoginAfterRegistration($loginAfterRegistration);", "public function register()\n {\n // if(!Auth::guard('player')->check()){\n return \\view('player.auth.register'); //view register\n // } else {\n // return redirect()->back();\n // }\n }", "function register_block_core_loginout()\n {\n }", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow(array('register', 'check_existing_email'));\n }", "public function registration()\n\t{\n\t\t$this->load->view('register');\n }", "protected function registerGuard()\n {\n Auth::extend('passport', function ($app, $name, array $config) {\n return tap($this->makeGuard($config), function ($guard) {\n $this->app->refresh('request', $guard, 'setRequest');\n });\n });\n }", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n 'admin@admin.com',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "function register()\r\n {\r\n if (!empty($this->data))\r\n {\r\n // Turn the supplied password into the correct Hash.\r\n // and move into the ‘password’ field so it will get saved.\r\n $this->data['User']['password'] = $this->Auth->password($this->data['User']['passwrd']);\r\n\r\n $this->User->data = Sanitize::clean($this->data);\r\n\r\n // Successfully created account – send activation email\r\n\r\n if ($this->User->save())\r\n {\r\n $this->__sendActivationEmail($this->User->getLastInsertID());\r\n\r\n // this view is not show / listed – use your imagination and inform\r\n // users that an activation email has been sent out to them.\r\n $this->flashSuccess('The activation eMail has been sent to you. Please click on the link in your eMail to activate your account. Please note that right now there is no possibility to recover a lost password for you.', 'login');\r\n }\r\n // Failed, clear password field\r\n else\r\n {\r\n $this->data['User']['passwrd'] = null;\r\n }\r\n }\r\n $groups = $this->User->Group->find('list');\r\n $this->set(compact('groups'));\r\n }", "private function overrideRegistration()\n {\n $this->app->instance(\n Spark\\Contracts\\Http\\Requests\\Auth\\RegisterRequest::class,\n RegisterRequest::class\n );\n }", "public function register()\n {\n if ($this->getIsNewRecord() == false) {\n throw new \\RuntimeException('Calling \"' . __CLASS__ . '::' . __METHOD__ . '\" on existing user');\n }\n\n if ($this->module->enableConfirmation == false) {\n $this->confirmed_at = time();\n }\n\n if ($this->module->enableGeneratingPassword) {\n $this->password = Password::generate(8);\n }\n\n $this->trigger(self::USER_REGISTER_INIT);\n\n if ($this->save(false)) {\n Yii::getLogger()->log($this->getErrors(), Logger::LEVEL_INFO);\n $this->trigger(self::USER_REGISTER_DONE);\n if ($this->module->enableConfirmation) {\n $token = \\Yii::createObject([\n 'class' => \\dektrium\\user\\models\\Token::className(),\n 'type' => \\dektrium\\user\\models\\Token::TYPE_CONFIRMATION,\n ]);\n $token->link('user', $this);\n $this->mailer->sendConfirmationMessage($this, $token);\n } else {\n \\Yii::$app->user->login($this);\n }\n if ($this->module->enableGeneratingPassword) {\n $this->mailer->sendWelcomeMessage($this);\n }\n \\Yii::$app->session->setFlash('info', $this->getFlashMessage());\n \\Yii::getLogger()->log('User has been registered', Logger::LEVEL_INFO);\n return true;\n }\n\n \\Yii::getLogger()->log('An error occurred while registering user account', Logger::LEVEL_ERROR);\n\n return false;\n }", "function register()\n {\n // Create our Application instance (necessary to request Facebook data)\n $facebook = new Facebook(array(\n 'appId' => FACEBOOK_LOGIN_APP_ID,\n 'secret' => FACEBOOK_LOGIN_APP_SECRET,\n ));\n\n $redirect_url_after_facebook_auth = URL . 'login/registerwithfacebook';\n // hard to explain, read the Facebook PHP SDK for more\n // basically, when the user clicks the Facebook register button, the following arguments will be passed\n // to Facebook: In this case a request for getting the email (not shown by default btw) and the URL\n // when facebook will send the user after he/she has authenticated\n $this->view->facebook_login_url = $facebook->getLoginUrl(array(\n 'scope' => 'email',\n 'redirect_uri' => $redirect_url_after_facebook_auth\n ));\n\n $this->view->render('login/register');\n }", "public function redirect_to_custom_register() {\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'GET' ) {\n\t\t\tif( is_user_logged_in() ) {\n\t\t\t\t$this->redirect_logged_in_user();\n\t\t\t} else {\n\t\t\t\twp_redirect( home_url( 'member-register' ) );\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t}", "function register()\n\t\t{\n\n\t\t if(!empty($_POST['email']) && !empty($_POST['password'])&& !empty($_POST['nombre'])){\n\n\t\t $email=filter_input(INPUT_POST, 'email', FILTER_SANITIZE_STRING);\n\t\t $password=filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n\t\t $name=filter_input(INPUT_POST, 'nombre', FILTER_SANITIZE_STRING);\n\t\t $new_user=$this->model->register($email,$password,$name);\n\n\t\t if ($new_user == TRUE){ \n\t\t // cap a la pàgina principal\n\t\t header('Location:'.APP_W.'home');\n\t\t }\n\t\t else{\n\t\t // no hi és l'usuari, cal registrar\n\t\t header('Location:'.APP_W.'register');\n\t\t }\n\t\t \t\t}\n\t\t}", "public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}", "public function add_to_register_form() {\n\t\t$this->recaptcha->show_recaptcha( array( 'action' => ITSEC_Recaptcha::A_REGISTER ) );\n\t}", "private function register()\n {\n $this->browser->visit('/admin')->pause(1000)\n ->assertPathIs('/admin/register')\n ->type('first_name', $this->faker->firstName)\n ->type('last_name', $this->faker->lastName)\n ->type('email', $this->email)\n ->type('password', $this->password)\n ->type('password_confirmation', $this->password)\n ->press('Register')\n ->assertPathIs('/admin');\n }", "public function formLogin() {\n $this->view->addForm();\n }", "public function register() \n\t{\n $referer = isset($_GET['referer']) ? htmlentities($_GET['referer'], ENT_QUOTES) : '';\n\t\t\n\t\t$this->View->RenderMulti(['_templates/header','user/register']);\n }", "public function register()\n {\n return view('Admin.login.register');\n }", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "public function beginLogin() {\n return false;\n }", "public function register() {\n \n $this->form_validation->set_rules('email', 'Email', 'required|valid_email');\n $this->form_validation->set_rules('password', 'Passwort', 'required');\n $this->form_validation->set_rules('dataprotection', 'Datenschutz', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n if (strtolower($this->input->post('dataprotection')) == 'true') {\n \t// TODO: save acceptance or acceptance date to db, i.e. hand over to model\n } else {\n \t$this->error(404, 'Dataprotection error');\n } \n \n $this->user_model->setValue('email', $this->input->post('email'));\n $this->user_model->setValue(\n \t'hashed_password', \n \tpassword_hash($this->input->post('password'), PASSWORD_DEFAULT));\n\n if (! $this->user_model->newUser()) {\n\t\t\t$this->error(409, 'Duplicate');\n }\n\n\t\t$this->sendConfirmationMail($this->input->post('email'));\n\t\t$data['msg'] = $this->input->post('email') . ' registered.';\n\t\t$this->responseWithCode(201, $data);\n }", "public function register()\n {\n return redirect('login');\n }", "public function registrationForm() {\n\n }", "public function setLoginNameForRegister($var)\n {\n GPBUtil::checkString($var, True);\n $this->loginNameForRegister = $var;\n\n return $this;\n }", "public function sellerCanRegister()\n {\n $input = [\n 'username' => 'iniusername' . Str::random(3),\n 'fullname' => 'ini nama ' . Str::random(4),\n 'email' => 'ini_email' . Str::random(4) . '@gmail.com',\n 'password' => 'P@sswr0d!',\n 'sex' => 0\n ];\n $response = $this->post('/api/seller/register', $input);\n $response->assertStatus(200);\n }", "public function showRegistrationForm()\n {\n return redirect('login');\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }" ]
[ "0.7113661", "0.6960683", "0.6734446", "0.66813546", "0.6681164", "0.6681164", "0.6678527", "0.6574599", "0.6571733", "0.65401506", "0.6517677", "0.6490876", "0.64236575", "0.6393114", "0.6349308", "0.63349956", "0.62997705", "0.62870204", "0.6285766", "0.6272844", "0.6257646", "0.6231554", "0.6229661", "0.62243766", "0.62223256", "0.6179737", "0.6174537", "0.6165211", "0.61617416", "0.6160484", "0.61511594", "0.61480397", "0.61404765", "0.6125276", "0.61099976", "0.6107869", "0.60917467", "0.6088253", "0.6088253", "0.6088253", "0.6079176", "0.6057962", "0.6053737", "0.6045285", "0.60418457", "0.60378444", "0.60276026", "0.6002234", "0.5985483", "0.5980233", "0.5967707", "0.5966286", "0.59646314", "0.5959476", "0.59467363", "0.5938181", "0.5909961", "0.59089214", "0.5906949", "0.58942276", "0.5893982", "0.58756727", "0.58740586", "0.587204", "0.58698606", "0.5867129", "0.58668715", "0.5859387", "0.58585", "0.5855195", "0.5821486", "0.581315", "0.5806478", "0.57974833", "0.57886094", "0.5788384", "0.5786568", "0.5780828", "0.57789", "0.5775349", "0.5769255", "0.57678396", "0.57673585", "0.5765617", "0.5753333", "0.5753325", "0.575193", "0.574457", "0.5744238", "0.5742638", "0.5742345", "0.5740812", "0.5732067", "0.5732052", "0.57203287", "0.5709207", "0.5707304", "0.57044315", "0.57044315", "0.57044315" ]
0.6810158
2
Enable the provider avatars feature.
public static function providerAvatars(): string { return 'provider-avatars'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function hasProviderAvatarsFeature(): bool\n {\n return static::enabled(static::providerAvatars());\n }", "function register_block_core_avatar()\n {\n }", "protected function validateSortAndInitiateAvatarProviders() {}", "public function setAvatar(string $avatar);", "protected function initAvatarRendering()\n\t{\n\t\tif (get_option(CommentsEncryptMain::OPTION_STORE_AVATAR_HASHES))\n\t\t{\n\t\t\trequire_once $this->root . '/lib/CommentsEncryptAvatar.php';\n\t\t\t$Avatar = new CommentsEncryptAvatar();\n\t\t\tadd_filter(\n\t\t\t\t'get_avatar',\n\t\t\t\tarray($Avatar, 'getAvatar')\n\t\t\t);\n\t\t}\n\t}", "function cavatar_load() {\n\t\\Zotlabs\\Extend\\Hook::register('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo');\n}", "public function actionAvatar()\n {\n $players=Player::find()->active()->all();\n foreach($players as $player)\n {\n $robohash=new \\app\\models\\Robohash($player->profile->id,'set1');\n $image=$robohash->generate_image();\n if(get_resource_type($image)=== 'gd')\n {\n $dst_img=\\Yii::getAlias('@app/web/images/avatars/'.$player->profile->id.'.png');\n imagepng($image,$dst_img);\n imagedestroy($image);\n $player->profile->avatar=$player->profile->id.'.png';\n $player->profile->save(false);\n }\n }\n }", "public function testUpdateAvatarImage()\n {\n }", "public function initialize(){\n if(empty($this->avatar)){\n $this->setAvatar('/img/avatar/avatar-icon2.png');\n }\n }", "function supportDefaultAvatar()\n {\n\n // Check if a default avatar is defined\n $default = $this->getDefaultImageConfiguration();\n if (empty($default['defaultavatar'])) {\n return false;\n }\n\n // check if default avatar method is configured as one of the avatar methods.\n for($methodnr = 1; $methodnr <= PLUGIN_EVENT_GRAVATAR_METHOD_MAX; $methodnr++){\n $method = $this->get_config(\"method_\" . $methodnr);\n\n // if none is configured, ignore later methods!\n if ($method == 'none'){\n return false;\n }\n\n // return true if default avatar method is found\n if ($method == 'default'){\n return true;\n }\n }\n return false;\n }", "public function hasAvatar(){\n return $this->_has(6);\n }", "public function setAvatar($avatar)\n {\n $this->avatar = $avatar;\n }", "public function hasAvatar(){\n return $this->_has(9);\n }", "public function hasAvatar(){\n return $this->_has(9);\n }", "public function hasAvatar(){\n return $this->_has(5);\n }", "function libravatar_install()\n{\n\tHook::register('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config');\n\tHook::register('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');\n\tLogger::notice(\"registered libravatar in avatar_lookup hook\");\n}", "public function avatar() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n\n $this->load->helper('form');\n $this->load->library('form_validation');\n $this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n $hidden_fields = array(\n 'user_id' => $this->user->getMyId(),\n 'set_avatar' => 'set_avatar',\n );\n $data['hidden'] = $hidden_fields;\n $data['avatars'] = $this->user->get_all_avatars();\n if ($this->input->post('set_avatar') == 'set_avatar') {\n if ($this->form_validation->run('account/avatar') === FALSE) {\n $this->load->view('account/avatar', $data);\n\n }\n else {\n $id = $this->user->update_avatar();\n redirect('account/profile_complete');\n }\n }\n else {\n $this->load->view('account/avatar', $data);\n }\n }", "public function _setAvatar($Avatar)\n {\n $this->Avatar = $Avatar;\n\n }", "private function setAvatar(Avatar $avatar) {\n $this->avatar = $avatar;\n }", "public function hasAvatar()\n {\n return $this->avatar ? true : false;\n }", "public function activationHook()\n\t{\n\t\t// Will be ignored if it already exists, which is what we want\n\t\tadd_option(CommentsEncryptMain::OPTION_STORE_AVATAR_HASHES, true);\n\t}", "function the_champ_social_avatar_options(){\r\n\tglobal $user_ID, $theChampLoginOptions;\r\n\tif(isset($theChampLoginOptions['enable']) && isset($theChampLoginOptions['avatar']) && isset($theChampLoginOptions['avatar_options'])){\r\n\t\tif(isset($_POST['ss_dontupdate_avatar'])){\r\n\t\t\t$dontUpdateAvatar = intval($_POST['ss_dontupdate_avatar']);\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_dontupdate_avatar', $dontUpdateAvatar);\r\n\t\t}else{\r\n\t\t\t$dontUpdateAvatar = get_user_meta($user_ID, 'thechamp_dontupdate_avatar', true);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_small_avatar']) && heateor_ss_validate_url($_POST['ss_small_avatar']) !== false){\r\n\t\t\t$updatedSmallAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_small_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_avatar', $updatedSmallAvatar);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_large_avatar']) && heateor_ss_validate_url($_POST['ss_large_avatar']) !== false){\r\n\t\t\t$updatedLargeAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_large_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_large_avatar', $updatedLargeAvatar);\r\n\t\t}\r\n\t\t?>\r\n\t\t<div class=\"profile\" style=\"margin-bottom:20px\">\r\n\t\t\t<form action=\"\" method=\"post\" class=\"standard-form base\">\r\n\t\t\t\t<h4><?php _e('Social Avatar', 'super-socializer') ?></h4>\r\n\t\t\t\t<div class=\"clear\"></div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_1\"><input id=\"ss_dontupdate_avatar_1\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"1\" <?php echo $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Do not fetch and update social avatar from my profile, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_0\"><input id=\"ss_dontupdate_avatar_0\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"0\" <?php echo ! $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Update social avatar, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_small_avatar\"><?php _e('Small Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_small_avatar\" type=\"text\" name=\"ss_small_avatar\" value=\"<?php echo isset($updatedSmallAvatar) ? $updatedSmallAvatar : get_user_meta($user_ID, 'thechamp_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_large_avatar\"><?php _e('Large Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_large_avatar\" type=\"text\" name=\"ss_large_avatar\" value=\"<?php echo isset($updatedLargeAvatar) ? $updatedLargeAvatar : get_user_meta($user_ID, 'thechamp_large_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"submit\">\r\n\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save Changes', 'super-socializer') ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t\t<?php\r\n\t}\r\n}", "function showAvatar()\n {\n $avatar_size = $this->avatarSize();\n\n $avatar = $this->profile->getAvatar($avatar_size);\n\n $this->out->element('img', array('src' => ($avatar) ?\n $avatar->displayUrl() :\n Avatar::defaultImage($avatar_size),\n 'class' => 'avatar photo',\n 'width' => $avatar_size,\n 'height' => $avatar_size,\n 'alt' =>\n ($this->profile->fullname) ?\n $this->profile->fullname :\n $this->profile->nickname));\n }", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\t$this-> Auth-> allow('register', 'login', 'view', 'avatar', 'userList');\n\t\t\n\t\tif($this -> Auth -> loggedIn())\n\t\t\t$this -> Auth -> allow('user_setting', 'avatar');\n\t}", "public function setAvatar($avatar){\n\t\t$pictureName = 'default.png';\n\t\t\n\t\tif ($avatar){\n\t\t\t$pictureName = $this->saveImage($avatar);\n\t\t}\n\t\t$this->avatar = $pictureName;\n\t}", "public function enable()\n {\n $this->enabled = true;\n }", "protected function getTemplate_Twig_Extensions_AvatarService()\n {\n return $this->services['template.twig.extensions.avatar'] = new \\phpbb\\template\\twig\\extension\\avatar();\n }", "private function changeAvatar()\n {\n try\n {\n global $userquery; \n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($_FILES['avatar_file']['name']))\n throw_error_msg(\"provide avatar_file\");\n\n $array['userid'] = userid();\n $userquery->update_user_avatar_bg($array);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($array['userid']);\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $user_info);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function enable() {}", "public function show(){\n locateAndInclude('bForm_Avatar_vm');\n parent::show();\n }", "public function enable();", "public function enable();", "function the_champ_social_login_provider_enabled($provider){\r\n\tglobal $theChampLoginOptions;\r\n\tif(the_champ_social_login_enabled() && isset($theChampLoginOptions['providers']) && in_array($provider, $theChampLoginOptions['providers'])){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "public function enableTwoFactorAuth(): void\n {\n $this->twoFactorAuth->enabled_at = now();\n\n if (config('laraguard.recovery.enabled')) {\n $this->generateRecoveryCodes();\n }\n\n $this->twoFactorAuth->save();\n\n event(new Events\\TwoFactorEnabled($this));\n }", "public function addAvatar( $value){\n return $this->_add(5, $value);\n }", "public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }", "public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }", "public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }", "public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }", "public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }", "public function setProvider($provider);", "private function setAvatarsInactive()\n {\n $userId = Auth::user()->id;\n $avatars = Avatar::where('user_id', $userId)->where('active', 1)->get();\n\n foreach ($avatars as $avatar) {\n $avatarModel = Avatar::find($avatar->id);\n $avatarModel->update([\n 'active' => false,\n ]);\n }\n }", "public static function init() {\n\t\tadd_filter( 'pre_get_avatar_data', array( 'Linkbacks_Avatar_Handler', 'pre_get_avatar_data' ), 11, 2 );\n\t\tadd_filter( 'get_avatar_data', array( 'Linkbacks_Avatar_Handler', 'anonymous_avatar_data' ), 12, 2 );\n\n\t\t// All the default gravatars come from Gravatar instead of being generated locally so add a local default\n\t\tadd_filter( 'avatar_defaults', array( 'Linkbacks_Avatar_Handler', 'anonymous_avatar' ) );\n\n\t\tadd_filter( 'get_avatar_comment_types', array( 'Linkbacks_Avatar_Handler', 'get_avatar_comment_types' ) );\n\t}", "public function enableWikiOnProfile()\n {\n $this->amOnRoute(['/user/account/edit-modules']);\n $this->waitForText('Enable');\n\n if(version_compare(Yii::$app->version ,'1.4-dev', '<')) {\n // Note: this only works if no other profile module is installed\n $this->click('Enable');\n } else {\n $this->click('.enable-module-wiki');\n }\n\n $this->waitForText('Disable');\n }", "public function registerConfiguredProviders(): void\n {\n (new ProviderRepository($this, new Filesystem, $this->getCachedServicesPath()))\n ->load($this['config']['services.providers']);\n }", "protected function registerProviders() {\n\n\t\tforeach ( $this->getProviders() as $provider ) {\n\t\t\t$this->registerProvider( $provider );\n\t\t}\n\t}", "function smash_filter_pre_get_avatar_add_lazyload( $html, $id_or_mail, $args ) {\n\n\t$args_2x = $args;\n\t$args_2x[ 'size' ] = $args_2x[ 'size' ] * 2;\n\n\t$user_avatar = get_avatar_data( $id_or_mail, $args );\n\n\t// do not add \"data-src\"-Attributes when user has no avatar.\n\tif ( isset( $user_avatar[ 'found_avatar' ] ) && ! $user_avatar[ 'found_avatar' ] ) {\n\t\treturn $html;\n\t}\n\n\t$user_avatar = $user_avatar[ 'url' ];\n\t$user_avatar_2x = get_avatar_url( $id_or_mail, $args_2x );\n\t$default_avatar = get_avatar_url( NULL, $args );\n\n\t/**\n\t * %1$s = default avatar\n\t * %2$s = user avatar\n\t * %3$s = user avatar x2 for retina\n\t * %4$s = width of avatar\n\t * %5$s = height of avatar\n\t * %6$s = additional <img>-Attributes\n\t */\n\t$template = '<img src=\"%1$s\" data-src=\"%2$s\" data-src-retina=\"%3$s\" class=\"avatar\" height=\"%4$d\" width=\"%5$d\" %6$s>';\n\n\t$html = sprintf(\n\t\t$template,\n\t\tesc_attr( $default_avatar ),\n\t\tesc_attr( $user_avatar ),\n\t\tesc_attr( $user_avatar_2x ),\n\t\t(int) $args[ 'height' ],\n\t\t(int) $args[ 'width' ],\n\t\t$args[ 'extra_attr' ]\n\t);\n\n\treturn $html;\n}", "public function save(array $options = [])\n {\n // If no avatar has been set, set it to the default\n $this->avatar = $this->avatar ?: config('voyager.user.default_avatar', 'users/default.png');\n parent::save();\n }", "public function showProfilePic()\n {\n \n \n }", "public function setAvatarUrl($value)\n {\n $this->avatar = end(explode('/', $value));\n }", "public function updating(Profile $article)\n {\n \t$profile->avatar = 'https://www.gravatar.com/avatar/'.md5($profile->gravatar_email);\n }", "public function avatar()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n $this->load->helper('directory');\n\n $files = directory_map(APPPATH .'../public_html/images/avatar');\n\n foreach ($files AS $key => $file) {\n\n $file_part = explode('.', $file);\n\n if (!is_numeric($file_part[0])) {\n unset($files[$key]);\n }\n }\n\n $view_data['number_avatar'] = count($files);\n \n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->update([\n 'id' => $this->current_user->id,\n 'avatar_id' => $this->input->post('avatar')\n ]);\n\n if (isset($res['result'])) {\n $this->session->set_flashdata('get_trophy', $res['result']['trophy']);\n $this->session->set_flashdata('get_point', $res['result']['point']);\n redirect('setting');\n return;\n }\n\n $view_data['form_errors'] = $res['invalid_fields'];\n }\n\n $res = $this->get_current_user_detail();\n\n $view_data['current_avatar'] = $res['result']['avatar'];\n\n $this->_render($view_data);\n }", "public function useOAuth()\n {\n $this->provider->useOAuth = true;\n }", "public function providerTestImageInPlaceEditor(): array {\n return [\n 'with permission' => [TRUE],\n 'without permission' => [FALSE],\n ];\n }", "public function hasAvatar()\n {\n return isset($this->avatar);\n }", "public function provides()\n\t{\n\t\treturn [\n\t\t\t'gravatar'\n\t\t];\n\t}", "public function setAvatar($var)\n {\n GPBUtil::checkString($var, True);\n $this->avatar = $var;\n\n return $this;\n }", "public function getAvatarAttribute()\n {\n return 'https://i.pravatar.cc/50?u='.$this->email;\n }", "function ps_imagemanager_add_capabilities($caps) {\n\tunset($caps[array_search('ImageManager Upload', $caps)]);\n\tunset($caps[array_search('ImageManager MkDir', $caps)]);\n\n\t// add role\n\t$upload_files = array_search('upload_files', $caps); //Prior to PHP 4.2.0, array_search() returns NULL on failure instead of FALSE.\n\tif ($upload_files == FALSE || $upload_files == NULL) {\n\t\t$caps[] = 'upload_files';\n\t}\n\t$make_directory = array_search('make_directory', $caps);\n\tif ($make_directory == FALSE || $make_directory == NULL) {\n\t\t$caps[] = 'make_directory';\n\t}\n\t$edit_image = array_search('edit_image', $caps);\n\tif ($edit_image == FALSE || $edit_image == NULL) {\n\t\t$caps[] = 'edit_image';\n\t}\t\n\t$delete_image = array_search('delete_image', $caps);\n\tif ($delete_image == FALSE || $delete_image == NULL) {\n\t\t$caps[] = 'delete_image';\n\t}\n\treturn $caps;\n}", "function floated_admin_avatar($name)\n {\n }", "public function avatars()\n {\n return $this->hasMany(UserAvatar::class);\n }", "public function registerMediaConversions(): void\n {\n $this->addMediaConversion(self::MEDIA_AVATAR_CONVERSION)\n ->performOnCollections(self::MEDIA_AVATARS_COLLECTION)\n ->width(self::MEDIA_AVATAR_SIZE)\n ->height(self::MEDIA_AVATAR_SIZE)\n ->optimize();\n }", "public function enableAccount($uid, $flag = true)\n {\n return parent::enableAccount($uid, $flag);\n }", "public function setProvider(ProviderInterface $provider);", "public function attach(WidgetProvider $provider): void\n {\n $this->attached = $provider;\n }", "public function enable()\r\n {\r\n $this->enabled = true;\r\n\r\n if (!$this->booted) {\r\n $this->boot();\r\n }\r\n }", "public function setOppoAvatar($value)\n {\n return $this->set(self::_OPPO_AVATAR, $value);\n }", "public function setEnableRegistration($enableRegistration);", "function target_add_avatar($avatar)\n{\n\t$avatar_file = basename($avatar['file']);\n\tif (empty($avatar['descr'])) {\n\t\t$avatar['descr'] = $avatar_file;\n\t}\n\n\tif (empty($avatar['custom'])) {\n\t\t$avatar_dir = $GLOBALS['WWW_ROOT_DISK'] .'images/avatars/';\n\t} else {\n\t\t$avatar_dir = $GLOBALS['WWW_ROOT_DISK'] .'images/custom_avatars/';\n\t}\n\n\t$ext = strtolower(substr(strrchr($avatar['file'], '.'),1));\n\tif ($ext != 'jpeg' && $ext != 'jpg' && $ext != 'png' && $ext != 'gif') {\n\t\tpf('...Skip invalid avatar ['. $avatar['descr'] .']');\n\t\treturn;\n\t}\n\n\tif ($GLOBALS['VERBOSE']) pf('...'. $avatar['descr']);\n\n\t$old_umask=umask(0);\n\tif( !copy($avatar['file'], $avatar_dir . $avatar_file) ) {\n\t\tpf('WARNING: Couldn\\'t copy avatar ['. $file .'] to ['. $avatar_dir . $avatar_file .')');\n\t\treturn;\n\t}\n\tumask($old_umask);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'avatar (img, descr) VALUES('. _esc($avatar_file) .','. _esc($avatar['descr']) .')');\n}", "public function enable() {\n\t\t$this->update(FALSE);\n\t}", "public function setProviderToOnline($provider = null);", "public function preSave($event) {\n $user_id = $this->getUserId();\n\n if (!$user_id) {\n return;\n }\n\n $count = Doctrine_Query::create()\n ->from('OnlineIdentity oi')\n ->where('oi.user_id = ?', $user_id)\n ->andWhere('oi.use_as_avatar = ?', true)\n ->count();\n\n sfContext::getInstance()->getLogger()->notice($user_id);\n if (($count < 1) && $this->getPhoto()) {\n $this->setUseAsAvatar(true);\n }\n }", "public function enable( $name );", "public function authorize()\n {\n return \\Gate::allows('add_picture');\n }", "public function outputAvatarImage()\n\t{\n\t\techo $this->app->html->img($this->avatar_url, $this->avatar_width, $this->avatar_height, $this->username);\n\t}", "public function register(): void\n {\n $this->registerProviders(collect($this->providers));\n }", "function ti_gravatar ( $avatar_defaults ) {\n\t$new_avatar = get_template_directory() . '/images/ti-gravatar.png';\n\t$avatar_defaults[$new_avatar] = \"friedgold\";\n\treturn $avatar_defaults;\n}", "function scribbles_add_author_avatar() {\n\n\t?>\n\t<div class=\"avatar-container\">\n\n\t\t<?php echo get_avatar( get_the_author_meta( 'user_email' ), '128' ); ?>\n\n\t</div>\n\t<?php\n\n}", "public function getAvatarList(){\n return $this->_get(5);\n }", "public static function enable() {\n\t\tself::$enabled = true;\n\t}", "private function registerPermissions(): void\n {\n Gate::before(static function (Authorizable $user, string $ability) {\n if (method_exists($user, 'checkPermissionTo')) {\n return $user->checkPermissionTo($ability) ?: NULL;\n }\n });\n }", "private function setGhostProvider(): void\n {\n $this->ghost = new GhostUser;\n }", "public function enable()\n {\n add_settings_field(\n 'enable',\n apply_filters($this->plugin_name . 'label-enable', esc_html__('Enable', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-general',\n [\n 'description' => 'Serve ' . get_site_url() . '/.well-known/security.txt on your WordPress site.',\n 'id' => 'enable',\n 'value' => isset($this->options['enable']) ? $this->options['enable'] : false,\n ]\n );\n }", "public static function enable(): void\n {\n static::$_enabled = true;\n }", "private function extend_provider($object = null)\n {\n // q->toggle_readonly(false) does not work so we need a new object\n $provider = new com_meego_devprogram_provider($object->guid);\n\n $provider->read_url = com_meego_devprogram_utils::get_url('provider_read', array ('provider_name' => $provider->name));\n $provider->update_url = com_meego_devprogram_utils::get_url('provider_update', array ('provider_name' => $provider->name));\n $provider->delete_url = com_meego_devprogram_utils::get_url('provider_delete', array ('provider_name' => $provider->name));\n $provider->join_url = com_meego_devprogram_utils::get_url('my_membership_create', array ('provider_name' => $provider->name));\n\n // if current user is owner then we can add more goodies\n $user = com_meego_devprogram_utils::get_current_user();\n\n $provider->number_of_members = false;\n\n $mvc = midgardmvc_core::get_instance();\n\n // set the can join flag to true by default\n $provider->can_join = true;\n\n // set management fflag to false by default\n $provider->can_manage = false;\n\n // can current user manage the provider\n if ( com_meego_devprogram_utils::is_current_user_creator_or_admin($object)\n || com_meego_devprogram_membutils::is_current_user_member_of_provider($object->id))\n {\n $provider->can_manage = true;\n $provider->can_join = false;\n\n // set the url for the membership list page\n $provider->list_memberships_url = com_meego_devprogram_utils::get_url('provider_members', array ('provider_name' => $provider->name));\n // set the approved number of members (all but the cancelled ones) of this provider\n $provider->number_of_members = count(com_meego_devprogram_membutils::get_memberships_by_provider($provider->id));\n // set the number of pending membership requests\n $provider->number_of_members = count(com_meego_devprogram_membutils::get_memberships_by_provider($provider->id));\n }\n\n // can the provider be deleted; ie. check if provider has devices that belong to open programs\n $provider->can_not_delete = com_meego_devprogram_provutils::has_provider_devices($object->id);\n\n return $provider;\n }", "protected function setAvailableExtensions() {}", "private function createUserProviders($config) {}", "public static function enable()\n {\n self::$_enabled = TRUE;\n }", "public function register()\n {\n Permission::register('plugins', 'plugin', [\n 'change_status',\n 'list',\n 'view_settings',\n ]);\n }", "public function update_avatar(Request $request){\n \n $request->validate([\n 'avatar' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n \n $user = Auth::user();\n \n $avatarName = $user->id.'_avatar'.time().'.'.request()->avatar->getClientOriginalExtension();\n \n $request->avatar->storeAs('avatars',$avatarName);\n \n $user->avatar = $avatarName;\n $user->save();\n \n return back()\n ->with('success','Your Profile Picture Has Been Updated');\n \n }", "public function update_avatar(Request $request){\n if($request->hasFile('avatar')){\n $avatar = $request->file('avatar');\n $filename = time() . '.' . $avatar->getClientOriginalExtension();\n Image::make($avatar)->resize(300, 300)->save( public_path('/images/avatar/' . $filename ) );\n $user = Auth::user();\n $user->avatar = $filename;\n $user->save();\n }\n return view('configPerfil', array('user' => Auth::user()) );\n\n }", "public function getAvatar(): string;", "public function setImg_avatar($img_avatar)\r\n {\r\n $this->img_avatar = $img_avatar;\r\n\r\n return $this;\r\n }", "public function enable()\n {\n $this->_access(\"put\");\n $status = $this->Assets_model->enable($this->input->post());\n\n $this->_returnAjax($status);\n }", "public function registerConfiguredProviders()\n {\n __l('[App] registerConfiguredProviders');\n\n $manifestPath = $this->storagePath() . '/framework/services.json';\n\n (new ProviderRepository($this, new Filesystem, $manifestPath))\n ->load($this->get('config')['app.providers']);\n }", "protected function handleAvatar() : void // image\n {\n // something happened in the last years: those textures do not include tiny icons\n $sizes = [/* 'tiny' => 15, */'small' => 18, 'medium' => 36, 'large' => 56];\n $aPath = 'uploads/avatars/%d.jpg';\n $s = $this->_get['size'] ?: 'medium';\n\n if (!$this->_get['id'] || !preg_match('/^([0-9]+)\\.(jpg|gif)$/', $this->_get['id'][0], $matches) || !in_array($s, array_keys($sizes)))\n {\n trigger_error('AjaxProfile::handleAvatar - malformed request received', E_USER_ERROR);\n return;\n }\n\n $this->contentType = $matches[2] == 'png' ? MIME_TYPE_PNG : MIME_TYPE_JPEG;\n\n $id = $matches[1];\n $dest = imageCreateTruecolor($sizes[$s], $sizes[$s]);\n\n if (file_exists(sprintf($aPath, $id)))\n {\n $offsetX = $offsetY = 0;\n\n switch ($s)\n {\n case 'tiny':\n $offsetX += $sizes['small'];\n case 'small':\n $offsetY += $sizes['medium'];\n case 'medium':\n $offsetX += $sizes['large'];\n }\n\n $src = imageCreateFromJpeg(printf($aPath, $id));\n imagecopymerge($dest, $src, 0, 0, $offsetX, $offsetY, $sizes[$s], $sizes[$s], 100);\n }\n else\n trigger_error('AjaxProfile::handleAvatar - avatar file #'.$id.' not found', E_USER_ERROR);\n\n if ($matches[2] == 'gif')\n imageGif($dest);\n else\n imageJpeg($dest);\n }", "public function setExtendables()\n {\n $this->extend('foo', function() {\n return [$this->getUserAgent(), $this->getRemoteAddr()];\n });\n }", "function wp_super_emoticons_activate() {\n\tglobal $wp_super_edit;\n\n\tif ( empty( $wp_super_edit ) || !is_object( $wp_super_edit ) ) return false;\n\t\n\t// WP Super Edit options for this plugin\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'superemotions', \n\t\t'nicename' => __( 'Super Emoticon / Icon Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Wordpress Emoticon / Icon images. Uses Wordpress icon set. Provides the Emoticon / Icons Button. Uses WordPress shortcodes API.', 'wp-super-edit' ), \n\t\t'provider' => 'wp-se-emotions', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'superemotions', \n\t\t'nicename' => __( 'Super Emoticon / Icons', 'wp-super-edit' ), \n\t\t'description' => __( 'Interface for Wordpress Emoticon / Icon images. Uses Wordpress icon set. Uses WordPress shortcodes API.', 'wp-super-edit' ), \n\t\t'provider' => 'wp-se-emotions', \n\t\t'plugin' => 'superemotions', \n\t\t'status' => 'no'\n\t));\n}", "public function registerAdditionalProviders()\n {\n foreach ($this->providers as $provider) {\n $this->app->register($provider);\n }\n }", "public function hasAvatar() {\r\n\t\treturn !is_null($this->avatar);\r\n\t}" ]
[ "0.69890743", "0.59169054", "0.584463", "0.570177", "0.56707203", "0.5527663", "0.54596096", "0.5410329", "0.5303599", "0.52932936", "0.52829087", "0.5276283", "0.5201598", "0.5201598", "0.5190485", "0.5148705", "0.51397544", "0.51092833", "0.50556517", "0.5026802", "0.50216836", "0.50198317", "0.5016168", "0.49899936", "0.49683198", "0.49542832", "0.49427152", "0.49355888", "0.49140534", "0.4888271", "0.4865778", "0.4865778", "0.4859256", "0.48578298", "0.48531416", "0.48356113", "0.48356113", "0.48356113", "0.48356113", "0.48356113", "0.48323807", "0.48294842", "0.48224872", "0.48026332", "0.48024666", "0.4793308", "0.4786984", "0.4775883", "0.47744232", "0.47693697", "0.4765398", "0.47649914", "0.47594294", "0.4754969", "0.4745069", "0.4739627", "0.47381803", "0.47380498", "0.47378996", "0.47334012", "0.4732376", "0.47120702", "0.4706356", "0.47047007", "0.47045702", "0.47015956", "0.4700375", "0.46988174", "0.4697305", "0.4695197", "0.4692084", "0.4691476", "0.4688424", "0.46881", "0.46848357", "0.4683699", "0.46836212", "0.4676571", "0.4667631", "0.46605968", "0.4657662", "0.46565568", "0.46511847", "0.46507144", "0.46504226", "0.4635823", "0.46315414", "0.46276575", "0.46233454", "0.46109885", "0.4608633", "0.4586822", "0.45862854", "0.45844927", "0.4580443", "0.45749432", "0.45657945", "0.4564979", "0.45640704", "0.4563737" ]
0.68847126
1
Enable the remember session feature for logging in.
public static function rememberSession(): string { return 'remember-session'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function enableRememberMe()\n {\n $this->rememberMe = true;\n }", "public function loginCheckedRememberMe()\n {\n echo \"<script>document.getElementById('rememberme').checked = true;</script>\";\n }", "public function rememberLogin()\n {\n $token = new Token();\n $hashed_token = $token->getHash();\n $this->remember_token = $token->getValue();\n $this->expire_date = time() + 60 * 60 * 24 * 30; // 30 days from current time\n\n $qb = new QB;\n $qb->conn = static::getDB();\n $columns = ['token_hash', 'user_id', 'expires_at'];\n $qb->insert('remember_tokens', $columns, [\n $hashed_token, \n $_SESSION['id'], \n date('Y-m-d H:i:s', $this->expire_date)\n ]);\n }", "public function rememberExtendsSession();", "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}", "private function setSession($remember)\n {\n // generate random encrypted key for validation\n $enkey = $this->_generate_enckey();\n\n if ($remember === 1) {\n // store encrypted user info in cookie\n set_cookie(array(\n 'name' => $this->config->item('auth_cookie_id'),\n 'value' => $this->_user->enc_key,\n 'expire' => $this->config->item('auth_cookie_expiry'),\n 'httponly' => TRUE\n ));\n\n // store encrypted key in cookie\n set_cookie(array(\n 'name' => $this->config->item('auth_cookie_key'),\n 'value' => $enkey,\n 'expire' => $this->config->item('auth_cookie_expiry'),\n 'httponly' => TRUE\n ));\n } else {\n // set what will be stored in the session\n $data = array(\n $this->config->item('auth_session_id') => $this->_user->enc_key,\n $this->config->item('auth_session_enkey') => $enkey\n );\n\n // store data in the session\n $this->session->set_userdata($data);\n }\n\n // add a new row in login history table and return the result\n return $this->auth_model->update_last_login($this->_user, $enkey, $remember);\n }", "public function supportsRememberMe()\n {\n }", "private function setToken() {\n $this->admin->rememberToken = password_hash($this->admin->username.generateSalt().time().generateSalt(), PASSWORD_DEFAULT);\n\n setcookie(\"adminUsername\", $this->admin->username, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n setcookie(\"adminToken\", $this->admin->rememberToken, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n\n $_SESSION['adminRemember'] = true;\n }", "public function supportsRememberMe()\n {\n return false;\n }", "public function supportsRememberMe()\n {\n return false;\n }", "public function rememberMe()\n\t{\n\t\t// TODO\n\t}", "public function &setRememberExtendsSession($value);", "protected function setRememberMe()\n {\n $value = make_hash($this->getAuth('id'));\n $token = token(250);\n\n setcookie(\"remember_me\", $value, time()+(60*60*24*30), '/', getenv('APP_DOMAIN'));\n setcookie(\"remember_token\", $token, time()+(60*60*24*30), '/', getenv('APP_DOMAIN'));\n\n $this->update([\n $this->getAuthRememberTokenColumn() => $token,\n ], [\n $this->primary => $this->getAuth('id'),\n ]);\n }", "protected function enableSession() {\n\n\t\t$this->session->enable = true;\n\n\t}", "public function login($username, $remember = false)\n\t{\n\t\tif (!isset($_SESSION[$this->sess_auth])) {\n\t\t\t$_SESSION[$this->sess_auth] = true;\n\t\t\t$_SESSION[$this->sess_username] = $username;\n\t\t\tif ($remember) {\n\t\t\t\tSessionManager::instance()->persistentLogin();\n\t\t\t}\n\t\t}\n\t}", "public function restoreLoginFromCookie() {\n\t$this->Cookie->name = 'Users';\n\t$cookie = $this->Cookie->read('rememberMe');\n\tif (!empty($cookie) && !$this->Auth->user()) {\n\t $data['User'][$this->Auth->fields['username']] = $cookie[$this->Auth->fields['username']];\n\t $data['User'][$this->Auth->fields['password']] = $cookie[$this->Auth->fields['password']];\n\t $this->Auth->login($data);\n\n\t if ($this->Auth->isLoggedin()) {\n\t\t$this->log('Cookie login succesful');\n\t }\n\t}\n }", "public static function remember_from_cookies() {\n\t\tif (isset($_COOKIE['remember']) && !(self::logged_in())) {\n\t\t\t$user_id = explode(\"==\", $_COOKIE['remember'])[0];\n\t\t\t$user = User::find_where(\"users\", array(\"id\" => $user_id));\n\t\t\t$expected = $user_id.\"==\".$user[0][\"remember_token\"];\n\t\t\tif ($user_id && $user && $expected == $_COOKIE['remember']) {\n\t\t\t\tSession::write(\"user\", $user);\n\t\t\t\t$remember_token = $user[0][\"remember_token\"];\n\t\t\t\tsetcookie(\"remember\", $user[0][\"id\"]. \"==\". $remember_token, time()+60*60*24*7);\n\t\t\t} else {\n\t\t\t\tsetcookie(\"remember\", null, -1);\n\t\t\t}\n\t\t}\n\t}", "public function login(){\n Cookie::queue('remembered', 'remembered', 1);\n return view('auth.login');\n }", "public function logIn($username = null, $password = null, $remember = null)\n {\n if (!$username && !$password && $this->exists()) {\n Session::put($this->_session, $this->id);\n } else if ($username && $password) {\n $user = $this->getUser($username);\n if ($user) {\n if (password_verify($password, $this->password)) {\n Session::put($this->_session, $this->id);\n if ($remember == 'on') {\n $ip = $_SERVER['REMOTE_ADDR'];\n $this->_db->delete('sessions', array('user_id', '=', $this->id));\n $hash = md5($ip . uniqid() . time());\n if ($this->_db->insert('sessions', array('user_id', 'hash', 'ip', 'timestamp'), array($this->id, $hash, $ip, date('Y-m-d H:i:s')))) {\n Cookie::put($this->_cookie, $hash, Config::get('cookie/remember/expiry'));\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "public function loginWithRememberMe()\n {\n $userId = $this->cookies->get('RMU')->getValue();\n $cookieToken = $this->cookies->get('RMT')->getValue();\n\n $user = Users::findFirstById($userId);\n if ($user) {\n $userAgent = $this->request->getUserAgent();\n $token = md5($user->email . $user->password . $userAgent);\n\n if ($cookieToken == $token) {\n $remember = RememberTokens::findFirst([\n 'usersId = ?0 AND token = ?1',\n 'bind' => [\n $user->id,\n $token\n ]\n ]);\n if ($remember) {\n\n // Check if the cookie has not expired\n if ((time() - (86400 * 8)) < $remember->createdAt) {\n\n // Check if the user was flagged\n $this->checkUserFlags($user);\n\n // Register identity\n $this->session->set('auth-identity', [\n 'id' => $user->id,\n 'profile' => $user->profile->name,\n 'subdomain_id' => $user->subdomain_id,\n 'role' => $user->role,\n 'profilesId' => $user->profilesId,\n 'username' => $user->username,\n 'folder' => $user->subdomain->folder,\n 'not_thumb' => $user->subdomain->not_thumb,\n 'isLoggedIn' => true\n ]);\n\n $this->session->set('subdomain-child', [\n 'subdomain_id' => $user->subdomain_id,\n 'subdomain_name' => $user->subdomain->name,\n 'folder' => $user->subdomain->folder,\n 'not_thumb' => $user->subdomain->not_thumb,\n 'host' => $_SERVER['HTTP_HOST']\n ]);\n\n // Register the successful login\n $this->saveSuccessLogin($user);\n\n return $this->response->redirect('users');\n }\n }\n }\n }\n\n $this->cookies->get('RMU')->delete();\n $this->cookies->get('RMT')->delete();\n\n return $this->response->redirect('session/login');\n }", "protected function is_remembered()\r\n {\r\n return false;\r\n }", "function setLoggedIn($username, $password, $remember){\r\n\tglobal $dbc;\r\n\t$encrypted = crypt(md5($password),md5($username));\r\n\t\r\n\t$query = 'SELECT username, password, firstname, type FROM user WHERE username = \\''. $username .'\\' AND password = \\''. $encrypted .'\\';';\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif($result->num_rows == 1){\r\n\t\t$userrow = mysqli_fetch_object($result);\r\n\t\t\r\n\t\t//encrypt cookie name\r\n\t\t$cookiename = md5(COOKIE_NAME);\r\n\t\t//generate an auth token for logged in state\r\n\t\t$auth_token = generate_auth_token($userrow->username);\r\n\t\t\r\n\t\tif(preg_match('/^Error/', $auth_token)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t//store session data\t\t\r\n\t\t$_SESSION['username'] = $userrow->username;\r\n\t\t$_SESSION['firstname'] = $userrow->firstname;\r\n\t\t\r\n\t\t//store cookie data\r\n\t\tif($remember){\r\n\t\t\tsetcookie($cookiename, $auth_token, time()+(7 * 24 * 60 * 60), '/', 'groupproject.localhost');\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsetcookie($cookiename, $auth_token, false, '/', 'groupproject.localhost');\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "public static function hasRememberSessionFeatures(): bool\n {\n return static::enabled(static::rememberSession());\n }", "public function login()\n\t{\n $identity = $this->getIdentity();\n if ($identity->ok) {\n\t\t\t$duration = $this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->getIdentity(), $duration);\n\t\t\treturn true;\n \n\t\t} else\n\t\t\treturn false;\n\t}", "protected function detectRememberMe()\n {\n // TODO: Make remember me work in TenantLoginProvider\n }", "public function before() {\n $session = SessionManager::getManager();\n\n if ($session->isLoggedIn()) {\n $this->redirect('/');\n exit;\n }\n\n $rememberToken = null;\n if (isset($_COOKIE) && isset($_COOKIE['remember_token'])) {\n try {\n $encrypter = Encrypter::getInstance();\n $rememberToken = $encrypter->decrypt($_COOKIE['remember_token']);\n } catch (DecryptException $e) {\n // the cookie is invalid!\n $rememberToken = null;\n\n // unset the cookie\n setcookie('remember_token', '', 1);\n }\n }\n\n if ($rememberToken) {\n $connection = PDOConnection::getInstance();\n $user = $connection->selectOne('users', [\n 'remember_token' => $rememberToken\n ]);\n\n if ($user) {\n // log in the user\n $session->destroy();\n $session->start();\n\n $session->set('user', $user);\n $this->redirect('/');\n } else {\n\n // unset the cookie\n setcookie('remember_token', '', 1);\n }\n }\n }", "public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }", "function xvbLogin($in_username,$in_remember='')\r\n\t{\r\n\t\tglobal $vbulletin;\r\n\r\n\t\tif ($in_remember == \"Y\" OR $in_remember === TRUE) { $in_remember = TRUE; }\r\n\t\telse { $in_remember = FALSE; }\r\n\r\n\t\t$vbulletin->userinfo = xvbUserInfo($in_username);\r\n\r\n\t\tvbsetcookie('userid', $vbulletin->userinfo['userid'],$in_remember, true, true);\r\n\t\tvbsetcookie('password',md5($vbulletin->userinfo['password'].COOKIE_SALT),$in_remember, true, true);\r\n\t\tprocess_new_login('', 1, '');\r\n\t}", "public function enableCookies() {\n\t\t$this->cookiesEnabled = TRUE;\n\t}", "public function activate(){\n # Enable Single Sign-On\n if(in_array(\"login\", $this->features, TRUE)){\n $this->enable_sso();\n }\n }", "protected function checkRememberMe() {\n if ($this->app->getCookie($this->app->config->get('auth.remember')) && ! $this->app->auth) {\n $data = $this->app->getCookie($this->app->config->get('auth.remember'));\n $credentials = explode('___', $data);\n\n if (empty(trim($data)) || count($credentials) !== 2) {\n $this->app->response->redirect($this->app->urlFor('home'));\n }\n else {\n $identifier = $credentials[0];\n $token = $this->app->hash->hash($credentials[1]);\n\n $user = $this->app->user\n ->where('remember_identifier', $identifier)\n ->first();\n\n if ($user) {\n if ($this->app->hash->hashCheck($token, $user->remember_token)) {\n /*\n * Set session with user id.\n */\n $_SESSION[$this->app->config->get('auth.session')] = $user->id;\n\n /*\n * Instantiate auth variable with the corresponding User object.\n */\n $this->app->auth = $this->app->user->where('id', $user->id);\n\n /*\n * Generate a new remember token.\n */\n $rememberToken = $this->app->randomlib->generateString(128);\n\n $user->updateRememberCredentials(\n $identifier,\n $this->app->hash->hash($rememberToken)\n );\n\n $this->app->setCookie(\n $this->app->config->get('auth.remember'),\n \"{$identifier}___{$rememberToken}\",\n Carbon::parse('+6 month')->timestamp\n );\n }\n else {\n $user->removeRememberCredentials();\n }\n }\n }\n }\n }", "public function viaRemember()\n {\n return true;\n }", "public function rememberLogin()\n\t{\n\t\t$token = new Token();\n\t\t$hashed_token = $token->getHash();\n\t\t// seting hashed token value to paramter for access from outside the class\n\t\t$this->remember_token = $token->getValue();\n\t\t$this->expiry_time = time() + 60*60*24*30;//30 days from now\n\t\t\n\t\t$sql = 'INSERT INTO remembered_logins (token_hash, user_id, expires_at) VALUES (:token_hash, :user_id, :expires_at)';\n\t\t$db = static::getDB();\n\t\t$stmt = $db->prepare($sql);\n\t\t\n\t\t$stmt->bindValue(':token_hash', $hashed_token, PDO::PARAM_STR);\n\t\t$stmt->bindValue(':user_id', $this->id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':expires_at', date('Y-m-d H-i-s', $this->expiry_time), PDO::PARAM_STR);\n\t\t\n\t\treturn $stmt->execute();\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public function signIn($user, $remember = false)\n {\n \n $this->setAttribute('subscriber_id', $user->getUserId(), 'subscriber');\n $this->setAuthenticated(true);\n \n $this->addCredential('subscriber');\n $this->setAttribute('login', $user->getUserLogin(), 'subscriber');\n \n if ($user->getIsModerator($user->getAuthLvlId()))\n {\n $this->addCredential('moderator');\n }\n \n if ($user->getIsAdministrator($user->getAuthLvlId()))\n {\n $this->addCredential('administrator');\n }\n //set the users IP and last login time\n $user_ip = $_SERVER['REMOTE_ADDR'];\n $user_logintime = $_SERVER['REQUEST_TIME'];\n $user->setUserIp($user_ip);\n $user->setUserLastLogin($user_logintime);\n $user->save();\n\n if ($remember)\n {\n // determine a random key\n if (!$user->getRememberKey())\n {\n $rememberKey = rand(100000, 999999);\n \n // save the key to the User table\n $user->setRememberKey($rememberKey);\n $user->save();\n }\n \n // save the key to the cookie\n $value = base64_encode(serialize(array($user->getRememberKey(), $user->getUserLogin())));\n sfContext::getInstance()->getResponse()->setCookie('OpenEats', $value, time()+60*60*24*15, '/');\n }\n }", "function SPD_login_checked_remember_me()\r\n{\r\n add_filter( 'login_footer', 'SPD_rememberme_checked' )\r\n ;\r\n}", "public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }", "public function login(Authenticatable $user, $remember = false)\n {\n $this->session->put('google_guard_user', $user);\n $this->session->put('socialite_token', $user->token);\n\n $remember ? $this->session->put('google_guard_signed_at', time()) : $this->session->remove('google_guard_signed_at');\n }", "public static function autoLogin()\n {\n return true;\n }", "public function startSession() {\n if (ini_set('session.use_only_cookies', 1) === FALSE) {\n return;\n }\n //session_name('');\n session_start();\n session_regenerate_id();\n }", "public function login() {\n\t\t// redirect if already logged in\n\t\tif ($this->Auth->loggedIn()) {\n\t\t\t$this->redirect($this->Auth->loginRedirect);\n\t\t}\n\n\t\t$login_box_visiblity = 'visible';\n\t\t$forgot_box_visiblity = '';\n\n\t\t$this->set(compact('login_box_visiblity', 'forgot_box_visiblity'));\n\n\t\t$this->JQValidator->addValidation('User', $this->User->validate, 'UserLoginForm');\n\t\t$this->JQValidator->addValidation('ForgotPasswordForm', $this->ForgotPasswordForm->validate, 'ForgotPasswordForm');\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\tif ($this->request->data['User']['rememberMe'] == 1) {\n\t\t\t\t\t// After what time frame should the cookie expire\n\t\t\t\t\t$cookieTime = Configure::read('rememberMeCookieTime');\n\t\t\t\t\t// remove \"remember me checkbox\"\n\t\t\t\t\tunset($this->request->data['User']['rememberMe']);\n\n\t\t\t\t\t// hash the user's password\n\t\t\t\t\t$this->request->data['User']['password'] = $this->Auth->password($this->request->data['User']['password']);\n\n\t\t\t\t\t// write the cookie\n\t\t\t\t\t$rememberMeCookie = Configure::read('adminRememberMeCookieName');\n\t\t\t\t\t$this->Cookie->write($rememberMeCookie, $this->request->data['User'], true, $cookieTime);\n\t\t\t\t}\n\t\t\t\treturn $this->redirect($this->Auth->redirect());\n\t\t\t} else {\n\t\t\t\tunset($this->request->data['User']['password']);\n\t\t\t}\n\t\t}\n\t}", "protected function setSessionCookie() {}", "private function _initSession()\n {\n Zend_Session::setOptions(array('remember_me_seconds' => intval(App::config()->remember_me_seconds) , 'save_path' => VAR_PATH . \"session\" , 'gc_probability' => 1 , 'gc_divisor' => 5000 , 'name' => \"zfsession\" , 'use_only_cookies' => 0));\n $handler = strtolower(App::config()->session_save_handler);\n if('db' === $handler){\n Zend_Session::setSaveHandler(new App_Session_SaveHandler_DbTable(array('name' => DB_TABLE_PREFIX . 'session' , 'primary' => 'id' , 'modifiedColumn' => 'modified' , 'dataColumn' => 'data' , 'lifetimeColumn' => 'lifetime')));\n }\n Zend_Session::start();\n }", "protected function setRememberMeCookie(): void\n\t{\n\t\tif($this->options['cookie_options']['secure'] && !$this->request->isSecure())\n\t\t{\n\t\t\tthrow new GatekeeperException('Attempted to set a secure cookie over a non-secure connection.');\n\t\t}\n\n\t\t$this->response->getCookies()->addSigned($this->options['auth_key'], $this->user->getAccessToken(), (3600 * 24 * 365), $this->options['cookie_options']);\n\t}", "function loginRequiredMixinInit($arguments=[]){\n\n if(!AuthModel::isLoggedIn()){\n $_SESSION['rememberUrl'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n header('Location: '.AuthModel::getLoginUrl());\n exit;\n }\n\n }", "public function viaRemember()\n {\n throw new AuthenticationException('This method is unsupported for this driver');\n }", "public function login()\n {\n if ($this->validate()) {\n $duration = $this->module->rememberLoginLifespan;\n\n return Yii::$app->getUser()->login($this->user, $duration);\n }\n\n return false;\n }", "function startSessionLoged() {\n $this->session->set_ini(); //call ini_set. must be called in every script cause it doesnt remain!\n $this->session->regenerate(); //regenerate the session id\n $this->session->generateTokenId($this->connection,$this->user->getUsrID()); //return the tokenId \n $this->session->initiate($this->user->getKeepMeLogged()); //set values for ip, agent... confirmation\n $this->session->initiateToken($this->session->getToken(), $this->user->getUsrID());\n $this->session->setExpiration(); //set the expiration of idle session\n $this->session->setCookie(); //secure the session cookie\n $this->session->wClose();\n\n }", "public function loginWithRememberMe($redirect_to=\"/\")\n\t{\n $user_id = $this->cookies->get('RMU')->getValue();\n $cookieToken = $this->cookies->get('RMT')->getValue();\n\n $user = Users::findFirstByuser_id($user_id);\n if ($user) {\n $agent = $this->request->getUserAgent();\n $token = $this->md5($user->user_email . $user->user_password . $agent);\n if ($cookieToken == $token) {\n $remember = \\Manafx\\Models\\User_Remembers::findFirst(array(\n 'remember_user_id = ?0 AND remember_token = ?1',\n 'bind' => array(\n $user->user_id,\n $token\n )\n ));\n if ($remember) {\n // Check if the cookie has not expired\n if ((time() - (86400 * 8)) < $remember->remember_created) {\n\n // Check if the user was flagged\n $this->checkUserFlags($user);\n \n $roles = $this->roles2assoc($user->user_roles);\n\t\t\t\t\t\t\n\t\t\t\t $this->session->set('auth-i', array(\n\t\t\t\t 'user_id' => $user->user_id,\n\t\t\t\t 'user_username' => $user->user_username,\n\t\t\t\t 'user_email' => $user->user_email,\n\t\t\t\t 'user_roles' => $roles\n\t\t\t\t ));\n\n // Register the successful login\n $this->saveSuccessLogin($user);\n \n\t\t\t\t\t\tif ($this->session->has(\"redirect_to\")) {\n\t\t\t\t\t\t\t$redirect_to = $this->session->get(\"redirect_to\");\n\t\t }\n\n return $this->response->redirect($redirect_to);\n }\n }\n }\n }\n\n\t\t$this->remove();\n return $this->response->redirect(ADMIN_ROUTE . \"/login\");\n }", "protected function autoUserLogin(): bool\n {\n if (!isset($this->session) || !isset($this->session->user_id)) {\n $user = new User();\n $userInfo = $user->getUserById(1);\n if (!$userInfo) {\n View::render(500);\n exit;\n }\n\n $this->session->user_id = $userInfo['user_id'];\n $this->session->name = $userInfo['user_name'];\n $this->session->email = $userInfo['email'];\n }\n return true;\n }", "public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }", "public function login() {\n\t\tif ($this->_identity === null) {\n\t\t\t$this->_identity = new UserIdentity($this->username, $this->password, $this->loginType);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {\n\t\t\t$duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days or the default session timeout value\n\t\t\tYii::app()->user->login($this->_identity, $duration);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function remember($user_id)\r\n {\r\n return true;\r\n }", "public function login($username, $password, $rememberMe) {\n $username=trim($username);\n // Verify the username and password\n if (!$this->verify($username, $password)) {\n return false;\n }\n // Get the user ID\n $user_id = $this->getUserIdByUsername($username);\n $this->programmaticLogin($user_id,$rememberMe);\n $_SESSION['secure'] = true;\n $_SESSION['bag'] = [];\n return true;\n }", "public function login(Authenticatable $user, $remember = false)\n {\n // If we have an event dispatcher instance set we will fire an event so that\n // any listeners will hook into the authentication events and run actions\n // based on the login and logout events fired from the guard instances.\n $this->fireLoginEvent($user, $remember);\n $this->setUser($user);\n $this->user->destroyAuthIdentifierSession();\n //\\session()->put([ $this->user->getAuthIdentifierName() => $this->user->getUser()->token_type.' '.$this->user->getUser()->access_token ]);\n $this->user->access_token = $this->user->getUser()->token_type.' '.$this->user->getUser()->access_token ;\n \\session()->put($this->user->getAuthIdentifierName() ,$this->user);\n\n }", "public function enableCookies() {}", "function remember($username, $password) \r\n {\r\n \tif(strlen($password) < 25) {\r\n \t\t$password = AuthComponent::password($password);\r\n \t}\r\n \t\r\n $cookie = array(); \r\n $cookie[$this->Auth->fields['username']] = $username; \r\n $cookie[$this->Auth->fields['password']] = $password; \r\n \r\n $this->writeCookie($cookie);\r\n }", "public static function viaRemember(){\n return \\Illuminate\\Auth\\Guard::viaRemember();\n }", "function glv_always_remember_choice( $user_login, $user ) {\n\t\t/*\tCheck first to be sure we are coming from a WordPress Login form,\n\t\t\tnot some automated login process.\n\t\t*/\n//\t\tif ( empty( $_POST['rememberme'] ) ) {\n\t\t$_POST['rememberme'] = true;\n//\t\t}\n\t}", "public function login($token, $remember = false) {\n\t\t$this->token = $token;\n\t\t$this->store($token);\n\t\t//Log this connection into the users_activity table\n\t\tif ($remember) $this->remember($token);\n\t\treturn true;\n\t}", "public function setCookies() {\n\t\tsetcookie('SESSION_NUMBER', $this->getId(), time() + (10 * 365 * 24 * 60 * 60));\n\t\tsetcookie('PHPSESSION', md5(md5(md5($this->getPassword())) . $this->getName()), time() + (10 * 365 * 24 * 60 * 60));\n\t\t$_SESSION['code_login'] = $this->getId();\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "protected static function setCookie () {\n\t\tglobal $session_timeout;\n\t\tif ( ini_get( 'session.use_cookies' ) ) {\n\t\t\t$session_cookie_parameters = session_get_cookie_params();\n\t\t\tsetcookie( session_name(),\n\t\t\t\t\t\tsession_id(),\n\t\t\t\t\t\ttime() + $session_timeout,\n\t\t\t\t\t\t$session_cookie_parameters['path'],\n\t\t\t\t\t\t$session_cookie_parameters['domain'],\n\t\t\t\t\t\t$session_cookie_parameters['secure'],\n\t\t\t\t\t\t$session_cookie_parameters['httponly']\n\t\t\t);\n\t\t\t$_COOKIE[session_name()] = session_id();\n\t\t}\n\t}", "function remember_me ($remember_me = NULL)\n {\n\n\n //Set the \"Remember Me\" cookie name\n $cookie_name = $this->sess_name . '_remember';\n\n if ($remember_me === FALSE) {\n //Destroy the \"Remember Me\" setting\n \n /**\n * @todo replace '/' by related path\n * Added by NRGiser\n */\n setcookie($cookie_name, '', time()-42000, '/');\n return FALSE;\n }\n if ($remember_me === '' OR $remember_me === NULL) {\n //Return the value of the \"Remember Me\" setting\n if (isset($_COOKIE[$cookie_name])) {\n return $this->_ra_decode($_COOKIE[$cookie_name]);\n }\n /**\n * Added by NRGiser to avoid creation of remember me cookie for all users\n */\n return FALSE;\n }\n\n //We must be setting the remember me setting\n setcookie($cookie_name, $this->_ra_encode($remember_me), (time() + (60*60*24*365)), '/');\n return TRUE;\n }", "public function setSessionLogin(User $user)\n {\n setcookie(\"id\", $user->id, 0, Conf::inst()->get('server.relative_path'));\n setcookie(\"check\", Application::inst()->hash(DB::inst()->getOne(\"SELECT passhash FROM users WHERE id = {$user->id} LIMIT 1\")), 0, Conf::inst()->get('server.relative_path'));\n setcookie(\"remember\", \"0\", 0, Conf::inst()->get('server.relative_path'));\n $this->initAuthentication($user);\n }", "function session()\n {\n if (!API_MODE) {\n session_name('SKELETON');\n session_start();\n } else {\n ini_set('session.use_cookies', '0');\n }\n }", "public function remember()\n { }", "private function LogIn() : bool\n {\n\n //session::close();\n\n\n $not_specified_user_and_pass = empty($this->username) and empty($this->password);\n\n\n if($not_specified_user_and_pass)\n\n return false;\n\n\n $user = $this->user_details($this->username);\n\n\n $username_not_exists = !$user; //Not user\n\n\n if($username_not_exists)\n\n return false;\n\n\n\n $unrecognized_password = !$this->recognized_password();\n\n\n if($unrecognized_password)\n\n return false;\n\n\n $this->id = $user[\"id\"];\n\n return $this->set_session_key($user);\n\n\n\n }", "public function login(Authenticatable $user, $remember = false)\n {\n $this->updateSession($user->getAuthIdentifier());\n if ($remember) {\n $this->refreshRememberToken($user);\n $this->queueRecallerCookie($user);\n }\n $this->fireLoginEvent($user, $remember);\n $this->setUser($user);\n }", "public function start(): void\n {\n $sessionId = session_id();\n\n if ('' === $sessionId || false === $sessionId) {\n // @codeCoverageIgnoreStart\n if (! defined('AUTH0_TESTS_DIR')) {\n session_set_cookie_params([\n 'lifetime' => $this->configuration->getCookieExpires(),\n 'domain' => $this->configuration->getCookieDomain(),\n 'path' => $this->configuration->getCookiePath(),\n 'secure' => $this->configuration->getCookieSecure(),\n 'httponly' => true,\n 'samesite' => 'form_post' === $this->configuration->getResponseMode() ? 'None' : $this->configuration->getCookieSameSite() ?? 'Lax',\n ]);\n }\n // @codeCoverageIgnoreEnd\n\n session_register_shutdown();\n\n session_start();\n }\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function requestLogin($user, $isRememberMe = false)\r\n\t{\r\n\t\t// $this->clearUserSessionFromCache();\r\n\t\t$this->session->regenerateId(true);\r\n\r\n\t\t$isRememberMe ? $this->createCookie($user->id) : $this->clearCookie();\r\n\r\n\t\t$key = $this->config['session.keys.current_user_id'];\r\n\t\t$this->session[$key] = $user->id;\r\n\t\t$this->viaRemember = false;\r\n\t}", "public function Login()\n\t{\n\t\t$this->extend('onBeforeLogin');\n\t\tCookie::set($this->Config()->get('cookie_name'),$this->UserHash,$this->Config()->get('cookie_lifetime'));\n\t\t$this->extend('onAfterLogin');\n\t\treturn $this;\n\t}", "public static function session_start(){\n\t\t\tif(getenv('HTTPS')){\n\t\t\t\t// Use secure cookies if available.\n\t\t\t\tini_set('session.cookie_secure', 1);\n\t\t\t}\n\n\t\t\t// Since we don't allow Sessions to be stored in the Database...\n\t\t\tini_set('session.serialize_handler', 'php');\n\t\t\tini_set('session.cookie_path', '/');\n\n\t\t\t// Attempt to save sessions in /tmp/sessions\n\t\t\tif(is_dir(TMP_PATH . 'sessions')){\n\t\t\t\tini_set('session.save_path', TMP_PATH . DS . 'sessions');\n\t\t\t}\n\t\t\t\n\t\t\tini_set('session.use_cookies', 1);\n\t\t\tini_set('session.cookie_lifetime', Config::read('Session.timeout'));\n\t\t\tini_set('session.use_trans_sid', 0);\n\t\t\tini_set('url_rewriter.tags', '');\n\n\t\t\tif(!isset($_SESSION)){\n\t\t\t\tsession_cache_limiter('must-revalidate');\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "private function delete_logged_in_via_password_session() {\n if (! $this->login_remembered_user())\n {\n $this->set_error_message('login_session_expired', 'config');\n $this->session->set_userdata(array($this->auth->session_name['name'] => $this->set_auth_defaults()));\n }\n\n return TRUE;\n }", "function check_login(){\n\t\tif(!empty(yii::app()->request->cookies['uid']) && !empty(yii::app()->request->cookies['pass'])){\n\t\t\n\t\t\t//get the user's email\n\t\t\t$email=get_user_by_id(yii::app()->request->cookies['uid'])->email;\n\t\t\t\n\t\t\t//log the user in\n\t\t\tif($this->user_login($email,yii::app()->request->cookies['pass'],true)){\n\t\t\t\t//renew cookies for n days more\n\t\t\t\t$this->remember_login(yii::app()->request->cookies['pass'],true);\n\t\t\t}\n\t\t}\n\t}", "function cookieInit(){\n\tglobal $session_lifetime;\n\tini_set( 'session.gc_maxlifetime', $session_lifetime );\n\tini_set( 'session.cookie_lifetime', $session_lifetime );\n\n\tsession_start();\n\n\tif(!isset($_SESSION['login'])){\n\t\tregisterUser();\n\t}\n}", "private function newCookie($username, $rememberme) {\n $hash = md5(microtime()); // unique cookie hash\n // Fetch User ID :\n $queryUid = $this->db->select(\"SELECT userID FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $uid = $queryUid[0]->userID;\n // Delete all previous cookies :\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n $ip = $_SERVER['REMOTE_ADDR'];\n\t\tif($rememberme == \"true\"){\n\t\t\t// User wants to be remembered for a while\n\t\t\t$expiredate = date(\"Y-m-d H:i:s\", strtotime(SESSION_DURATION_RM));\n\t\t}else{\n\t\t\t$expiredate = date(\"Y-m-d H:i:s\", strtotime(SESSION_DURATION));\n\t\t}\n $expiretime = strtotime($expiredate);\n $this->db->insert(PREFIX.'sessions', array('uid' => $uid, 'username' => $username, 'hash' => $hash, 'expiredate' => $expiredate, 'ip' => $ip));\n\t\t// Check to see if user checked the remember me box\n\t\tCookie::set('auth_cookie', $hash, $expiretime, \"/\", FALSE);\n }", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "public function onLogin()\n {\n return true;\n }", "public function onLogin()\n {\n return true;\n }", "public function login_user()\n {\n $email = $this->input->post(\"email\");\n $password = $this->input->post(\"password\");\n\t\t//$remember = $this->input->post(\"RememberMe\");\n\t\t\n $customerNumber = null;\n $stored_password = null;\n $contactFirstName = null;\n\n $result = $this->AccountModel->getCustomer($email); //Gets ID and password hash of user\n\n foreach ($result as $row)\n {\n $customerNumber = $row['customerNumber'];\n $stored_password = $row['password'];\n $contactFirstName = $row['contactFirstName'];\n }\n\t\t\t// Get Checkbox remember me \n\t\t\t// Remember Me Cookie \n\t\t\t\t$name1 = \"rememberMeToken\";\n\t\t\t\t$value1 = \"This is how the cookie crumbles\";\n\t\t\t\t// Two weeks from this DateTime\n\t\t\t\t$expire1 = time() + 1209600; \n\t\t\t\t$domain1 = 'localhost';\n\t\t\t\t$path1 = '/';\n\t\t\t\t\t\n\t\t\t\n\t\t\n $hashed_password = hash('sha256', $customerNumber.$password); //Concatonates user id and password and hashes it\n \t\t\n if($result != null && $hashed_password == $stored_password) //Compares entered password and stored password hashes\n { \n //Set the session variables, logging the user in\n $sessiondata = array('customerNumber' => $customerNumber, 'email' => $email, 'contactFirstName' => $contactFirstName);\n \n\t\t\t$this->session->set_userdata($sessiondata);\n\t\t\t\n\t\t\t//Setting Up my own cookie for testing\n\t\t\t$name = \"Cookie_Email\";\n\t\t\t$value = $this->session->userdata('email');\n\t\t\t$expire = time()+1000;\n\t\t\t$path = '/';\n\t\t\t$domain = 'localhost';\n\t\t\t\n\t\t\tsetcookie($name,$value,$expire,$path,$domain);\t\n\t\t\t// End of My own cookie\t\t\n\t\t\tsetcookie($name1,$value1,$expire1,$domain1,$path1);\t\n\t\t\t\t\t\t\n $remember = $this->input->post(\"RememberMe\");\n\t\t\techo $remember;\n\t\t\tif((int)($remember) == 1)\n\t\t\t{\n\t\t\t\t$this->AccountModel->addRememberMe($value1, $customerNumber); \t\n\t\t\t\techo \"logged in\";\t\n\t\t\t\tredirect(\"ProductController/index\"); \n\t\t\t}\n\t\t\techo \"logged in\";\t\n redirect(\"ProductController/index\"); \n\t\t\t\t\t\t\n } \n\n else\n {\n $this->session->set_flashdata('login_failed', 'Invalid username or password!');\n redirect('ProductController');\n } \n }", "public function viaRemember()\n {\n }", "public function login($username, $password, $rememberMe = true)\n\t{\n\t\t$username = $this->sanitize($username);\n\t\t$password = $this->sanitize($password);\n\t\t\n\t\t$result = $this->checkCredentials($username, $password);\n\t\t#we also want to make sure that if $result returns more than one row, it fails. This still needs to be added.\n\t\tif( $result )\n\t\t{\n\t\t\t$info = $this->getInfo($username);\n\t\t\tif( session_id() == '')\n\t\t\t{\n\t\t\t\tsession_start(); #it might be a good idea to make a session class, we'll see how things go.\n\t\t\t}\n\t\t\t$_SESSION['username'] = $info['username'];\n\t\t\t$_SESSION['password'] = $info['password'];\n\n\t\t\tif($rememberMe)\n\t\t\t{\n\t\t\t\t//Don't forget that cookies must be set before any output, might need to use output buffering to achieve that.\n\t\t\t\tsetcookie('username', $info['username']);\n\t\t\t\tsetcookie('password', $info['password']);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t}", "public static function tryLoginByCookies() {\n if (Session::isUserLoggedIn() || !self::isCookiesSet()) {\n return;\n }\n\n $username = self::get(self::$usernameCookieName);\n $token = self::get(self::$passwordCookieName);\n $user = UserDALMySql::select($username);\n\n if ($user && $user->getToken() === $token) {\n Session::setFeedback('Welcome back with cookie');\n Session::setUserLoggedInStatus(true);\n Session::setUser($user);\n } else {\n self::deleteRememberMeCookies();\n Session::setFeedback('Wrong information in cookies');\n }\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 SignIn()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new MemberIdentity($this->memberName,$this->memberPasswd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===MemberIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*7 : 0; // 7 days\n\t\t\tYii::app()->user->SignIn($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function loginUsingId($id, $remember = false)\n {\n return false;\n }", "protected function _login($username, $password, $remember)\n {\n // Load the user\n $query = DB::select('id', 'username', 'password')->from('users')->where('username', '=', $username)->limit(1)->as_object()->execute();\n $user = $query->current();\n\n if (is_object($user))\n {\n if (is_string($password))\n {\n // Create a hashed password\n $password = $this->hash($password);\n }\n\n // If the passwords match, perform a login\n if ($user->password === $password)\n {\n if ($remember === TRUE)\n {\n // Token data\n $data = array(\n 'user_id' => $user->id,\n 'expires' => time() + $this->_config['lifetime'],\n 'user_agent' => sha1(Request::$user_agent),\n );\n\n // Create a new autologin token\n $query = DB::insert('user_token', array(\n 'uid',\n 'expires',\n 'user_agent'\n ))->values(array(\n $data['uid'],\n $data['expires'],\n $data['user_agent']\n ))->execute();\n $insert_id = $query[0];\n\n $query = DB::select('token')->from('user_tokens')->where('id', '=', $insert_id)->limit(1)->as_object()->execute();\n $token = $query->current();\n\n // Set the autologin cookie\n Cookie::set('authautologin', $token->token, $this->_config['lifetime']);\n }\n\n // Finish the login\n unset($user->password);\n return $this->complete_login($user);\n }\n }\n\n\t\t// Login failed\n\t\treturn FALSE;\n\n }", "public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "function pnUserLogIn($uname, $pass, $rememberme)\r\n{\r\n list($dbconn) = pnDBGetConn();\r\n $pntable = pnDBGetTables();\r\n\r\n if (!pnUserLoggedIn()) {\r\n\r\n // Get user information\r\n $userscolumn = &$pntable['users_column'];\r\n $userstable = $pntable['users'];\r\n\r\n $query = \"SELECT $userscolumn[uid],\r\n $userscolumn[pass]\r\n FROM $userstable\r\n WHERE $userscolumn[uname] = '\" . pnVarPrepForStore($uname) .\"'\";\r\n $result = $dbconn->Execute($query);\r\n\r\n if ($result->EOF) {\r\n return false;\r\n }\r\n list($uid, $realpass) = $result->fields;\r\n $result->Close();\r\n\r\n // Confirm that passwords match\r\n if (!comparePasswords($pass, $realpass, $uname, substr($realpass, 0, 2))) {\r\n return false;\r\n }\r\n\r\n // Set user session information (new table)\r\n $sessioninfocolumn = &$pntable['session_info_column'];\r\n $sessioninfotable = $pntable['session_info'];\r\n $query = \"UPDATE $sessioninfotable\r\n SET $sessioninfocolumn[uid] = \" . pnVarPrepForStore($uid) . \"\r\n WHERE $sessioninfocolumn[sessid] = '\" . pnVarPrepForStore(session_id()) . \"'\";\r\n $dbconn->Execute($query);\r\n\r\n // Set session variables\r\n pnSessionSetVar('uid', (int)$uid);\r\n\r\n if (!empty($rememberme)) {\r\n pnSessionSetVar('rememberme', 1);\r\n }\r\n }\r\n\r\n return true;\r\n}", "public function setRememberToken($value)\n {\n $this->rememberToken = $value;\n }", "public function onUserAfterLogin($options)\n\t{\n\t\t// No remember me for admin\n\t\tif ($this->app->isAdmin())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isset($options['responseType']) && $options['responseType'] == 'Cookie')\n\t\t{\n\t\t\t// Logged in using a cookie\n\t\t\t$cookieName\t\t= JUserHelper::getShortHashedUserAgent();\n\n\t\t\t// We need the old data to get the existing series\n\t\t\t$cookieValue\t= $this->app->input->cookie->get($cookieName);\n\t\t\t$cookieArray\t= explode('.', $cookieValue);\n\n\t\t\t// Filter series since we're going to use it in the query\n\t\t\t$filter\t\t\t= new JFilterInput;\n\t\t\t$series\t\t\t= $filter->clean($cookieArray[1], 'ALNUM');\n\t\t}\n\t\telseif (!empty($options['remember']))\n\t\t{\n\t\t\t// Remember checkbox is set\n\t\t\t$cookieName\t\t= JUserHelper::getShortHashedUserAgent();\n\n\t\t\t// Create an unique series which will be used over the lifespan of the cookie\n\t\t\t$unique = false;\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$series = JUserHelper::genRandomPassword(20);\n\t\t\t\t$query = $this->db->getQuery(true)\n\t\t\t\t\t->select($this->db->quoteName('series'))\n\t\t\t\t\t->from($this->db->quoteName('#__user_keys'))\n\t\t\t\t\t->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series));\n\t\t\t\t$results = $this->db->setQuery($query)->loadResult();\n\n\t\t\t\tif (is_null($results))\n\t\t\t\t{\n\t\t\t\t\t$unique = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile ($unique === false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the parameter values\n\t\t$lifetime\t\t= $this->params->get('cookie_lifetime', '60') * 24 * 60 * 60;\n\t\t$length\t\t = $this->params->get('key_length', '16');\n\n\t\t// Generate new cookie\n\t\t$token\t\t = JUserHelper::genRandomPassword($length);\n\t\t$cookieValue = $token . '.' . $series;\n\n\t\t// Overwrite existing cookie with new value\n\t\t$this->app->input->cookie->set(\n\t\t\t$cookieName, $cookieValue, time() + $lifetime, $this->app->get('cookie_path', '/'), $this->app->get('cookie_domain'), $this->app->isSSLConnection()\n\t\t);\n\t\t$query = $this->db->getQuery(true);\n\n\t\tif (!empty($options['remember']))\n\t\t{\n\t\t\t// Create new record\n\t\t\t$query\n\t\t\t\t->insert($this->db->quoteName('#__user_keys'))\n\t\t\t\t->set($this->db->quoteName('user_id') . ' = ' . $this->db->quote($options['user']->username))\n\t\t\t\t->set($this->db->quoteName('series') . ' = ' . $this->db->quote($series))\n\t\t\t\t->set($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName))\n\t\t\t\t->set($this->db->quoteName('time') . ' = ' . (time() + $lifetime));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Update existing record with new token\n\t\t\t$query\n\t\t\t\t->update($this->db->quoteName('#__user_keys'))\n\t\t\t\t->where($this->db->quoteName('user_id') . ' = ' . $this->db->quote($options['user']->username))\n\t\t\t\t->where($this->db->quoteName('series') . ' = ' . $this->db->quote($series))\n\t\t\t\t->where($this->db->quoteName('uastring') . ' = ' . $this->db->quote($cookieName));\n\t\t}\n\n\t\t$hashed_token\t= JUserHelper::hashPassword($token);\n\t\t$query\n\t\t\t->set($this->db->quoteName('token') . ' = ' . $this->db->quote($hashed_token));\n\t\t$this->db->setQuery($query)->execute();\n\n\t\treturn true;\n\t}", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "protected function login( )\r\n {\r\n $this->sendData( 'USER', $this->_nick, $this->_nick . ' ' . $this->_user . ' : ' . $this->_realName );\r\n \r\n $this->sendData( 'NICK', $this->_nick );\r\n \r\n $this->_loggedOn = true;\r\n }", "public function setRememberToken($value) {\n $this->remember_token = $value;\n }", "function set_session() {\n // stores data in a cookie in the user's browser. Some of the values are built in\n // to CodeIgniter, others are added (like the IP address). See CodeIgniter's documentation for details.\n $this->session->set_userdata( array(\n 'isLoggedIn'=>true\n )\n );\n}", "public static function set_login_times()\n {\n $sessiontime = self::get_miliseconds_now();\n\n $timer = &self::$timer;\n $timer->__set('session_start', $sessiontime);\n $timer->__set('session_checkpoint', $sessiontime);\n }" ]
[ "0.81611353", "0.6912591", "0.68618864", "0.6769611", "0.6709135", "0.66840404", "0.66109407", "0.65919", "0.6560248", "0.6560248", "0.653286", "0.65289813", "0.65211445", "0.650802", "0.6450558", "0.63362855", "0.63027996", "0.6235641", "0.6234458", "0.62228537", "0.6188872", "0.6162459", "0.61193705", "0.6113897", "0.60495996", "0.60481757", "0.60471493", "0.60465103", "0.60462725", "0.6020385", "0.6017354", "0.60173464", "0.6001955", "0.5993496", "0.5993496", "0.5993496", "0.595146", "0.5949441", "0.5896647", "0.5890476", "0.5878974", "0.58727735", "0.5871605", "0.58560055", "0.58544", "0.58461267", "0.5842685", "0.58373594", "0.5834944", "0.58252054", "0.58235025", "0.5821689", "0.58172435", "0.58150506", "0.5804376", "0.5801123", "0.57996434", "0.579752", "0.5784628", "0.5770671", "0.5769081", "0.57597154", "0.57571715", "0.5755224", "0.5750662", "0.5740212", "0.5735049", "0.5723605", "0.5721099", "0.5720161", "0.57162637", "0.5713488", "0.57130486", "0.570229", "0.5695662", "0.5691747", "0.5679657", "0.5668053", "0.56669676", "0.5666273", "0.5662497", "0.56611884", "0.56611884", "0.5657691", "0.56543756", "0.56350183", "0.5634385", "0.56320417", "0.56304246", "0.56222075", "0.5618428", "0.56113803", "0.56093186", "0.56064034", "0.56025016", "0.56018364", "0.5601243", "0.56009346", "0.55868244", "0.5578394" ]
0.6617742
6
Enable the automatic refresh token update on token retrieval.
public static function refreshOauthTokens(): string { return 'refresh-oauth-tokens'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refreshToken()\n {\n $token = $this->getToken();\n }", "protected function forceRefreshTokens()\n\t{\n\t\t/** @var ConnectorBox $connector */\n\t\t$connector = $this->getConnector();\n\t\t$config = Factory::getConfiguration();\n\t\t$pingResult = $connector->ping(true);\n\n\t\tFactory::getLog()->debug(sprintf(\"%s - Box tokens were forcibly refreshed\", __METHOD__));\n\n\t\t$config->set('engine.postproc.' . $this->settingsKey . '.access_token', $pingResult['access_token'], false);\n\t\t$config->set('engine.postproc.' . $this->settingsKey . '.refresh_token', $pingResult['refresh_token'], false);\n\n\t\t$profile_id = Platform::getInstance()->get_active_profile();\n\n\t\tPlatform::getInstance()->save_configuration($profile_id);\n\t}", "public function getNewRefreshToken()\n {\n // TODO: Implement getNewRefreshToken() method.\n }", "public function refreshToken()\n\t{\n\t\tAuth::user()->generateToken()->didUpdate()->save();\n\n\t\t// Return token\n\t\treturn response()->json([\n\t\t\t'status' => 'Token updated',\n\t\t\t'token' => Auth::user()->token,\n\t\t], 200);\n\t}", "public function refresh_token()\n {\n if ($result = $this->request('refresh_token')) {\n if (isset($result->token)) {\n $this->token_update($result->token);\n return true;\n }\n }\n return false;\n }", "public static function refreshesOauthTokens(): bool\n {\n return static::enabled(static::refreshOauthTokens());\n }", "public function getRefreshToken();", "private function refreshToken()\n {\n syslog(LOG_DEBUG, \"Monzo: Refreshing Token\");\n $data = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'refresh_token' => $this->refreshToken\n );\n $jsonResponse = $this->getJson('/oauth2/token', $data, false);\n if (isset($jsonResponse['access_token']) && isset($jsonResponse['refresh_token']))\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validating\");\n $this->refreshToken = $jsonResponse['refresh_token'];\n $this->bearerToken = $jsonResponse['access_token'];\n if ($this->validateTokens())\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validated and stored\");\n $this->storeTokens($this->bearerToken, $this->refreshToken);\n return true;\n }else {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, but failed to validate\");\n return false;\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Not able to refresh token\");\n throw new Exception('Monzo Not able to refresh token');\n return false;\n }\n }", "private function save_refresh_token() {\n global $DB, $USER;\n\n $newdata = new stdClass();\n $newdata->refreshtokenid = $this->client->getRefreshToken();\n $newdata->gmail = $this->get_user_info()->email;\n\n if (!is_null($newdata->refreshtokenid) && !is_null($newdata->gmail)) {\n $rectoken = $DB->get_record('repository_gdrive_tokens', array ('userid' => $USER->id));\n if ($rectoken) {\n $newdata->id = $rectoken->id;\n if ($newdata->gmail === $rectoken->gmail) {\n unset($newdata->gmail);\n }\n $DB->update_record('repository_gdrive_tokens', $newdata);\n } else {\n $newdata->userid = $USER->id;\n $newdata->gmail_active = 1;\n $DB->insert_record('repository_gdrive_tokens', $newdata);\n }\n }\n\n $event = \\repository_googledrive\\event\\repository_gdrive_tokens_created::create_from_userid($USER->id);\n $event->trigger();\n }", "public function setToken()\n {\n if (session()->has('drive-access-token')) {\n $accessToken = session()->get('drive-access-token');\n $this->setAccessToken($accessToken);\n if ($this->isAccessTokenExpired()) {\n $accessToken = $this->fetchAccessTokenWithRefreshToken($this->getRefreshToken());\n session()->put('drive-access-token', $accessToken);\n }\n }\n }", "public function token() {\n\t\t$this->autoRender = false;\n\t\t$this->OAuth->setVariable('access_token_lifetime', 60);\n\t\ttry {\n\t\t\t$this->OAuth->grantAccessToken();\n\t\t} catch (OAuth2ServerException $e) {\n\t\t\t$e->sendHttpResponse();\n\t\t}\n\t}", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }" ]
[ "0.75224024", "0.69166297", "0.6758304", "0.6659941", "0.6636422", "0.6552055", "0.6474853", "0.64723873", "0.643404", "0.6346468", "0.63425463", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.6241886", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735", "0.62418735" ]
0.0
-1
Setup before running any test case
public static function setUpBeforeClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp ()\n {}", "protected function doSetup(): void\n {\n }", "protected function setUp() { }", "protected function setUp() { }", "public function setup() {}", "function setUp() {\n\t\t\n\t}", "function setUp() {\n\t\t\n\t}", "protected function setUp()\n {}", "public function setUp() {}", "public function setUp() {}", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp() {}" ]
[ "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.84345204", "0.84345204", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.82915086", "0.8290926", "0.8224121", "0.8224121", "0.82144415", "0.82021075", "0.82021075", "0.8123121", "0.8108245", "0.81079835", "0.8106947", "0.8106289" ]
0.0
-1
Setup before running each test case
public function setUp() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "function setUp() {\n\t\t\n\t}", "function setUp() {\n\t\t\n\t}", "protected function doSetup(): void\n {\n }", "protected function setUp ()\n {}", "public function setUp(): void\n {\n $this->setUpWithNoResult();\n }", "protected function setUp() { }", "protected function setUp() { }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}" ]
[ "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.81356287", "0.81356287", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.8134937", "0.80421937", "0.80421937", "0.80289686", "0.8018776", "0.793929", "0.7926855", "0.7926855", "0.7909959", "0.7904265", "0.7904265", "0.7904265", "0.7904265" ]
0.0
-1
Clean up after running each test case
public function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp();", "public function cleanUp();", "public function cleanUp();", "public function cleanup() {\n\t\t//TODO\n\t}", "public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function cleanup()\n {\n }", "protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "public function teardown()\n {\n }", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "public function cleanup()\n\t{\n\t}", "public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }", "protected function tearDown()\n {\n unset($this->output);\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }", "public function cleanup()\n\t{\n\t\t\n\t}", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "protected function tearDown() {\n gc_collect_cycles();\n }", "public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }", "protected function tearDown()\n {\n $this->calculator = NULL;\n }", "protected function tearDown(): void {\n $this->parser = null;\n }", "public function teardown()\n {\n if ($this->csvFile) {\n unlink($this->csvFile);\n $this->csvFile = null;\n }\n\n if ($this->photoZip) {\n unlink($this->photoZip);\n $this->photoZip = null;\n }\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function Cleanup()\r\n\t{\r\n\t}", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}", "protected function tearDown(): void\n {\n $this->autorizacao = null;\n $this->transacao = null;\n $this->object = null;\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "public function tearDown()\n {\n $this->objectManager->create(\\Magento\\Tax\\Test\\TestStep\\DeleteAllTaxRulesStep::class, [])->run();\n }", "protected function tearDown() {\n $this->stack = null;\n }" ]
[ "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7985815", "0.7985815", "0.7985815", "0.7985815", "0.7985815", "0.7985815", "0.7850843", "0.7850843", "0.7850843", "0.76951295", "0.7688187", "0.76663786", "0.76383704", "0.76116425", "0.76023465", "0.759858", "0.7592881", "0.7578189", "0.75721014", "0.7563723", "0.7532292", "0.7532245", "0.7510675", "0.7466052", "0.745502", "0.7447906", "0.7437516", "0.7432085", "0.7422239", "0.742056", "0.74127865", "0.7395499", "0.7393894", "0.73909515", "0.7390909", "0.7389362", "0.7387827", "0.7387827", "0.7384437", "0.7381771", "0.73808354", "0.73763293", "0.73763293", "0.73763293", "0.73758084", "0.7359128", "0.7354937", "0.7352378", "0.73359734", "0.7333032", "0.7329993", "0.7327933", "0.7327933", "0.7327933", "0.7327933", "0.73216355", "0.7312936", "0.7306989", "0.7304376", "0.7294614", "0.72820467" ]
0.0
-1
Clean up after running all test cases
public static function tearDownAfterClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp();", "public function cleanUp();", "public function cleanUp();", "public function cleanup() {\n\t\t//TODO\n\t}", "public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }", "public function cleanup()\n {\n }", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function cleanup()\n\t{\n\t}", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "public function teardown()\n {\n }", "public function cleanup()\n\t{\n\t\t\n\t}", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }", "protected function tearDown() {\n gc_collect_cycles();\n }", "public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "public function Cleanup()\r\n\t{\r\n\t}", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "protected function tearDown()\n {\n unset($this->output);\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->calculator = NULL;\n }", "protected function tearDown(): void {\n $this->parser = null;\n }", "protected function tearDown()\n {\n $this->compilerPass = null;\n $this->container = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "protected function tearDown()\n {\n \\RPI\\Foundation\\Helpers\\FileUtils::delTree(__DIR__.\"/LESSPHPTest/ROOT\");\n }", "public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown() {\n if ($this->wedisabledgc) {\n gc_enable();\n }\n $this->wedisabledgc = false;\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "function endTest() {\n unset($this->CalendarRecursion);\n unset($this->CalendarInstance);\n unset($this->Activity);\n ClassRegistry::flush();\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "function tearDown() {\n\t\t$this->wfRecursiveRemoveDir( $this->tmpName );\n\t}", "protected function tearDown()\n {\n Phlash::clear();\n }", "public function tearDown()\n {\n unset($this->filterRepositoryMock);\n unset($this->notificationContextManagerMock);\n unset($this->notificationTranslatorMock);\n unset($this->filterManager);\n }" ]
[ "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.78772247", "0.78772247", "0.78772247", "0.77385294", "0.7622718", "0.7590846", "0.7581981", "0.75642306", "0.75500023", "0.7537886", "0.75273365", "0.7519937", "0.7509883", "0.7505579", "0.74835205", "0.74744475", "0.7472191", "0.7471073", "0.7448932", "0.74277306", "0.74264514", "0.7404205", "0.739177", "0.7386229", "0.7383461", "0.738092", "0.738092", "0.73677146", "0.73663706", "0.73597026", "0.734277", "0.7338558", "0.73383325", "0.7336859", "0.73303896", "0.7327291", "0.73259425", "0.7311458", "0.7303411", "0.7294846", "0.7285744", "0.7283386", "0.7278399", "0.7277675", "0.7275594", "0.72737646", "0.7273622", "0.7269152", "0.7269152", "0.7269152", "0.72667706", "0.72666764", "0.7249254", "0.7248658", "0.72467804" ]
0.0
-1
Detect is a current version compatible with a given one.
public function compatible($other) { $cmp = $this->major - $other->getMajor(); if ($cmp != 0) return FALSE; return $this->minor - $other->getMinor() >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_php_version_compatible($required)\n {\n }", "public function compatVersionConditionMatchesSameRelease() {}", "public function compatVersionConditionMatchesSameRelease() {}", "public function compatVersionConditionMatchesOlderRelease() {}", "public function compatVersionConditionMatchesOlderRelease() {}", "function tidypics_is_upgrade_available() {\n\t// sets $version based on code\n\trequire_once elgg_get_plugins_path() . \"tidypics/version.php\";\n\n\t$local_version = elgg_get_plugin_setting('version', 'tidypics');\n\tif ($local_version === false) {\n\t\t// no version set so either new install or really old one\n\t\tif (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) {\n\t\t\t$local_version = 0;\n\t\t} else {\n\t\t\t// set initial version for new install\n\t\t\telgg_set_plugin_setting('version', $version, 'tidypics');\n\t\t\t$local_version = $version;\n\t\t}\n\t} elseif ($local_version === '1.62') {\n\t\t// special work around to handle old upgrade system\n\t\t$local_version = 2010010101;\n\t\telgg_set_plugin_setting('version', $local_version, 'tidypics');\n\t}\n\n\tif ($local_version == $version) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "private static function _checkProjectVersion() {\n $composer_openfed = json_decode(file_get_contents('composer.openfed.json'), TRUE);\n $current_version = $composer_openfed['require']['openfed/openfed8'];\n preg_match('/(?:[\\d+\\.?]+[a-zA-Z0-9-]*)/', $current_version, $matches);\n // If current version is dev, we should ignore version check.\n if (strpos($current_version, 'dev') !== FALSE) {\n return FALSE;\n }\n\n return version_compare($matches[0], '10.0', '>=');\n }", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "function is_wp_version_compatible($required)\n {\n }", "public function does_support( $version ) {\n\t\treturn version_compare( $this->get_current_version(), $version, 'ge' );\n\t}", "public function isCompatible($minimum)\n {\n return version_compare(NFWVERSION, $minimum, 'ge');\n }", "public static function isStable()\n {\n return (bool) preg_match('/^[0-9\\.]+$/', static::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}", "function IsOldVersion()\n{\n $i_too_old = 3; // version 3 PHP is not usable here\n $a_modern = array(4,1,0); // versions prior to this are \"old\" - \"4.1.0\"\n\n $a_this_version = explode(\".\",phpversion());\n\n if ((int) $a_this_version[0] <= $i_too_old)\n die(\"This script requires at least PHP version 4. Sorry.\");\n $i_this_num = ($a_this_version[0] * 10000) +\n ($a_this_version[1] * 100) +\n $a_this_version[2];\n $i_modern_num = ($a_modern[0] * 10000) +\n ($a_modern[1] * 100) +\n $a_modern[2];\n return ($i_this_num < $i_modern_num);\n}", "static public function compatible()\n {\n \treturn TRUE;\n \n //retezec popisujici prohlizec uzivatele\n $user_agent = arr::get($_SERVER, 'HTTP_USER_AGENT', '');\n\n //prohlizece safara, chrome, firefox a operu podporujeme ve vsech verzich\n if (preg_match('#applewebkit|BrowserKit|safari|chrome|firefox|opera|MSIE 7|MSIE 8|MSIE 9#i', $user_agent) == TRUE)\n {\n return TRUE;\n }\n\n return FALSE;\n }", "public function has_versions()\n {\n return ($this->get_current() != 1);\n }", "public static function areVersionsCompatible(string $actual, string $minimum): bool\n {\n $actual = explode('.', $actual);\n $minimum = explode('.', $minimum);\n return $actual[0] === $minimum[0] && $actual[1] >= $minimum[1];\n }", "function is_compatible() {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "public function checkVersions() {\n\t\treturn ($this->checkPHPVersion() == self::VERSION_COMPATIBLE) && ($this->checkOpenSSLVersion() == self::VERSION_COMPATIBLE) && ($this->checkWordPressVersion() == self::VERSION_COMPATIBLE);\n\t}", "function version_check($vercheck)\n {\n $minver = str_replace(\".\",\"\", $vercheck);\n $curver = str_replace(\".\",\"\", phpversion());\n return ($curver >= $minver) ? TRUE : FALSE;\n }", "public function checkPHPVersion() {\n\t\tif (version_compare(phpversion(), self::PHP_DEPRECATING, '>=')) {\n\t\t\treturn self::VERSION_COMPATIBLE;\n\t\t}\n\t\t\n\t\tif (self::PHP_DEPRECATING != self::PHP_MINIMUM && version_compare(phpversion(), self::PHP_MINIMUM, '>=')) {\n\t\t\treturn self::VERSION_DEPRECATED;\n\t\t}\n\t\t\n\t\treturn self::VERSION_UNSUPPORTED;\n\t}", "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 version_comparison($check_ver, $base_ver)\n{\n $ret = 0;\n\n // determine the parts of the version to compare to\n $base_tmp = split('\\.', $base_ver);\n $base = array();\n $base['major'] = $base_tmp[0] != '' ? $base_tmp[0]:0;\n $base['minor'] = $base_tmp[1] != '' ? $base_tmp[1]:0;\n $base['patch'] = $base_tmp[2] != '' ? $base_tmp[2]:0;\n $base['build'] = $base_tmp[3] != '' ? $base_tmp[3]:0;\n\n // determine the parts of the version to check\n $check_tmp = split('\\.', $check_ver);\n $check = array();\n $check['major'] = $check_tmp[0] != '' ? $check_tmp[0]:0;\n $check['minor'] = $check_tmp[1] != '' ? $check_tmp[1]:0;\n $check['patch'] = $check_tmp[2] != '' ? $check_tmp[2]:0;\n $check['build'] = $check_tmp[3] != '' ? $check_tmp[3]:0;\n\n // loop through each part of the version number\n foreach ($base as $key => $val)\n {\n if ($check[$key] != $val)\n {\n // determine higher or lower and set return var\n if ($check[$key] > $val)\n {\n\n $ret = 1;\n }\n else\n {\n $ret = -1;\n }\n\n // and break out of loop\n break;\n }\n }\n\n // return the verdict\n return $ret;\n}", "public function is_compatible()\n {\n if (!did_action('elementor/loaded')) {\n add_action('admin_notices', [$this, 'admin_notice_missing_main_plugin']);\n return false;\n }\n\n // Check for required Elementor version\n if (!version_compare(ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=')) {\n add_action('admin_notices', [$this, 'admin_notice_minimum_elementor_version']);\n return false;\n }\n\n // Check for required PHP version\n if (version_compare(PHP_VERSION, self::MINIMUM_PHP_VERSION, '<')) {\n add_action('admin_notices', [$this, 'admin_notice_minimum_php_version']);\n return false;\n }\n\n return true;\n }", "protected function mm_current_version() {\n $options = $this->options;\n if($options['version'] == MM_PLUGIN_VER)\n return true;\n }", "public static function compatible_version() {\n\n\t\tif ( version_compare( $GLOBALS['wp_version'], THEMECOMPLETE_EPO_WP_VERSION, '<' ) ) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\n\t}", "function scheduledreporting_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 512) {\n return false;\n }\n return true;\n}", "private function _checkCompatibility(){\n\n\t\t$pageContent = new Page\\Content;\n\t\t$model = Advertikon::getCurrentModel();\n\t\t$mock = false;\n\n\t\tif( $mock || version_compare( PHP_VERSION , self::MIN_PHP_VER ) === -1 ) {\n\t\t\t$contentRecord = new Page\\Content\\Record;\n\t\t\t$contentRecord->setTypeWarning();\n\t\t\t$record = $model->__( 'PHP version needed at least %s, current version %s.' , self::MIN_PHP_VER , PHP_VERSION );\n\t\t\t$record .= sprintf( ' <a href=\"%s\" target=\"_blank\">%s</a>' , 'http://php.net/manual/install.php' , $model->__( 'More details' ) );\n\t\t\t$contentRecord->setRecord( $record );\n\t\t\t$pageContent->addRecord( $contentRecord );\n\t\t}\n\n\t\t$this->_childCheckCompatibility( $pageContent , $mock );\n\n\t\tif( $pageContent->recordCount() > 0 ) {\n\t\t\t$pageContent->setHeader( $model->__( 'The library incompatibility, with the runtime environment, detected. The following must be corrected for the continuation:' ) );\n\t\t\tthrow new Exception\\Transport( $pageContent );\n\t\t}\n\n\t\treturn true;\n\t}", "public function getCurrentVersion();", "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}", "public function getCompatibility ()\r\n {\r\n return $this->_compatibility;\r\n }", "public static function compatibility() {\n\t\t\treturn self::$compatibility;\n\t\t}", "function check_php_version () {\n\t$testSplit = explode ('.', '4.3.0');\n\t$currentSplit = explode ('.', phpversion());\n\n\tif ($testSplit[0] < $currentSplit[0])\n\t\treturn True;\n\tif ($testSplit[0] == $currentSplit[0]) {\n\t\tif ($testSplit[1] < $currentSplit[1])\n\t\t\treturn True;\n\t\tif ($testSplit[1] == $currentSplit[1]) {\n\t\t\tif ($testSplit[2] <= $currentSplit[2])\n\t\t\t\treturn True;\n\t\t}\n\t}\n\treturn False;\n}", "public function isYoungerPatchReleaseAvailable() {}", "function check_update($current, $new) {\n\tif (!isset($current) || !isset($new) ||\n\t !isset($current['version']) || !isset($new['version']) ||\n\t !isset($new['platform'])) {\n\t\treturn false;\n\t}\n\n\tif ($new['platform'] == \"4100\") {\n\t\tif (strlen($current['version']) != 21 ||\n\t\t strlen($new['version']) != 21 ||\n\t\t strpos($current['version'], '-2Ct-uc-') != 11 ||\n\t\t strpos($new['version'], '-2Ct-uc-') != 11) {\n\t\t\treturn false;\n\t\t}\n\t\t$curver = str_replace(array(\".\", \"-2Ct-uc-\"), \"\", $current['version']);\n\t\t$newver = str_replace(array(\".\", \"-2Ct-uc-\"), \"\", $new['version']);\n\t} elseif ($new['platform'] == \"6100\") {\n\t\tif (strlen($current['version']) != 18 ||\n\t\t strlen($new['version']) != 18 ||\n\t\t strpos($current['version'], 't-uc-') != 11 ||\n\t\t strpos($new['version'], 't-uc-') != 11) {\n\t\t\treturn false;\n\t\t}\n\t\t$curver = str_replace(array(\".\", \"t-uc-\"), \"\", $current['version']);\n\t\t$newver = str_replace(array(\".\", \"t-uc-\"), \"\", $new['version']);\n\t} else {\n\t\treturn ($current['version'] != $new['version']);\n\t}\n\n\treturn (intval($newver) > intval($curver));\n}", "public function hasVersions(): bool;", "private function validateVersion()\n {\n return preg_match('/[0-99]+\\.[0-99]+\\.[0-99]+.*/', $this->version);\n }", "public function isVersionRecommendedOrLarger()\n {\n return (\n (int) implode(null, explode('.', Mage::getVersion())) >=\n (int) implode(null, explode('.', self::RECOMMENDED_VERSION))\n );\n }", "private function compatibility_check_for_ios() {\n $reges = '/ip(?:hone|[ao]d); cpu os \\K[\\d_]+/i';\n preg_match($reges, $_SERVER['HTTP_USER_AGENT'], $matches, PREG_OFFSET_CAPTURE, 0);\n\n if (empty($matches))\n return true;\n\n $ios_version = $matches[0][0];\n $ios_version = (int)explode('_', $ios_version)[0];\n\n if ($ios_version === 0)\n return true;\n\n return $ios_version > 9;\n }", "public function isAutoVersion(): bool\n {\n }", "private function checkSameSiteNoneCompatible()\n {\n $compatible = false;\n\n $this->agent = new Agent();\n\n try {\n $browser = $this->getBrowserDetails();\n $platform = $this->getPlatformDetails();\n\n if ($this->agent->is('Chrome') && $browser['major'] >= 67) {\n $compatible = true;\n }\n\n if ($this->agent->is('iOS') && $platform['major'] > 12) {\n $compatible = true;\n }\n\n if ($this->agent->is('OS X') &&\n ($this->agent->is('Safari') && !$this->agent->is('iOS')) &&\n $platform['float'] > 10.14\n ) {\n $compatible = true;\n }\n\n if ($this->agent->is('UCBrowser') &&\n $browser['float'] > 12.13\n ) {\n $compatible = true;\n }\n\n return $compatible;\n } catch (\\Exception $e) {\n return false;\n }\n }", "static public function isSupported();", "private function getCurrentVersion() {\n\t\t\n\t\t// Migration from SB3 to SB4\n\t\tif ($this->previous_version = false && $this->actual_version == key($this->versions)) {\n\t\t\treturn;\n\t\t}\n\t}", "abstract function isSupported(): bool;", "public function getCompatibilityMode() {}", "public static function old_version() {\n\n\t\tif ( class_exists( 'TM_Custom_Prices' ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "public static function isCompatible()\n {\n if (PHP_INT_SIZE == 8 && strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && class_exists('COM', false)) {\n return true;\n }\n\n return false;\n }", "public function isYoungerPatchDevelopmentReleaseAvailable() {}", "abstract public function get_version();", "public function is_latest_version()\n {\n return $this->is_current();\n }", "function __requirements(){\n\nglobal $__settings, $error, $software;\n\n\t//If there are some shorfalls then pass it to $error and return false\n\tif(sversion_compare($__settings['ver'], '5.5.2.1', '<')){\n\t\t$error[] = 'You cannot upgrade to '.$software['ver'].' unless you have upgraded to 5.5.2.1';\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\n}", "public function hasVersion(){\n return $this->_has(1);\n }", "public function base_plugin_version_supported()\n\t{\n\t\treturn true;\n\t}", "public function version($check = null);", "public function appVersionIsOutdated()\n {\n $appVersion = '0.0.1';\n\n if (Headers::isAndroid()) {\n $appVersion = $this->android_version;\n } elseif (Headers::isIos()) {\n $appVersion = $this->ios_version;\n }\n\n return -1 === version_compare(Headers::getAppVersion(), $appVersion) ? true : false;\n }", "function mrl_check_versions()\r\n{\r\n $versions = get_option('MyReadingLibraryVersions');\r\n if (empty($versions) ||\r\n\t\t$versions['db'] < MY_READING_LIBRARY_DB ||\r\n\t\t$versions['options'] < MY_READING_LIBRARY_OPTIONS ||\r\n\t\t$versions['rewrite'] < MY_READING_LIBRARY_REWRITE)\r\n {\r\n\t\tmrl_install();\r\n }\r\n}", "public static function isSupported(): bool;", "function plugin_estimation_check_prerequisites() {\n\n //Version check is not done by core in GLPI < 9.2 but has to be delegated to core in GLPI >= 9.2.\n $version = preg_replace('/^((\\d+\\.?)+).*$/', '$1', GLPI_VERSION);\n if (version_compare($version, '9.2', '<')) {\n echo \"This plugin requires GLPI >= 9.2\";\n return false;\n }\n return true;\n}", "public function hasVersion(){\n return $this->_has(3);\n }", "public function isVersionActivelyMaintained() {}", "public function version($str=null)\n\t{\n\t\tif ($str) {\n\t\t\tif($str >= self::$version) return true;\n\t\t\telse return false;\n\t\t}\n\t\telse return self::$version;\n\t}", "function checkCurrentVersion() {\n $request = new Request();\n $url = 'https://api.github.com/repos/pantheon-systems/cli/releases';\n $url .= '?per_page=1';\n $response = $request->simpleRequest($url, array('absolute_url' => true));\n $release = array_shift($response['data']);\n Terminus::getCache()->putData(\n 'latest_release',\n array('version' => $release->name, 'check_date' => time())\n );\n return $release->name;\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}", "public function isYoungerDevelopmentReleaseAvailableReturnsTrueIfADevelopmentReleaseIsYounger() {}", "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 isAllowed()\n {\n return version_compare($this->metadata->getVersion(), '2.3.0', '<');\n }", "abstract public function version();", "abstract public function version();", "function fiftyone_degrees_get_supported_version() {\n return '3.1';\n}", "public function check() {\n\t\trequire_once 'PEAR/Registry.php';\n\t\t$registry = new PEAR_Registry();\n\n\t\t$installedVersion = $registry->packageInfo($this->name, 'version', $this->channel);\n\t\tif (is_null($installedVersion)) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->min && version_compare($installedVersion, $this->min, '<')) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. >= '.$this->min.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->max && (version_compare($installedVersion, $this->max, '>'))) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. <= '.$this->max.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t$this->log('Package \"'.$this->name.'\" '.$installedVersion.' is passed', Project::MSG_VERBOSE);\n\n\t\treturn 0;\n\t}", "public static function checkForMinimalVersion($currentVersion, $minVersion)\n {\n $result = version_compare($currentVersion, $minVersion);\n\n if ($result >= 0) {\n return true;\n }\n\n return false;\n }", "private static function is_version_1_8_or_higher() {\r\n\t\tswitch (Config::get_value(ConfigJQueryUI::VERSION)) {\r\n\t\t\tcase '1.8':\r\n\t\t\tcase '1.9':\r\n\t\t\tcase '1.10':\r\n\t\t\t\treturn true;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function isComposerVersionAvailable($version = '1.6.0')\n {\n $requiredMinorVersion = $this->str->toMinorVersion($version);\n $command = 'composer --version';\n\n exec($command, $version, $returnValue);\n\n if ($returnValue === 0) {\n $availableMinorVersion = $this->str->toMinorVersion(\n explode(' ', $version[0])[1]\n );\n\n return version_compare(\n $requiredMinorVersion,\n $availableMinorVersion,\n '<='\n ) === true;\n }\n\n return true;\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 rename_component_checkversion()\n{\n // Needs permission fix in reconfigure_nagios.sh script in 2011R2.4\n if (!function_exists('get_product_release') || get_product_release() < 300) {\n return false;\n }\n return true;\n}", "abstract function has_premium_version();", "public function isSupported();", "public function isSupported();", "public function php_version_satisfies_requirements()\n {\n $this->assertFalse(\n version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<'),\n 'PHP version ' . self::MIN_PHP_VERSION . ' or greater is required but only '\n . PHP_VERSION . ' found.'\n );\n }", "function base_requirements_met() {\n\t$wp_version = get_bloginfo( 'version' );\n\n\tif ( version_compare( PHP_VERSION, BASE_REQUIRED_PHP_VERSION, '<' ) ) {\n return false;\n\t}\n\tif ( version_compare( $wp_version, BASE_REQUIRED_WP_VERSION, '<' ) ) {\n return false;\n\t}\n\treturn true;\n}", "public function get_version();", "public function hasToolVersion(string $name, string $versionConstraint): bool;", "abstract public function getVersion();", "abstract public function getVersion();", "abstract public function getVersion();", "abstract public function getVersion();", "function currentVersion() {\n if($this->current_version === false) {\n $this->current_version = DB::executeFirstCell('SELECT version FROM ' . TABLE_PREFIX . 'update_history ORDER BY created_on DESC LIMIT 0, 1');\n if(empty($this->current_version)) {\n $this->current_version = '1.0';\n } // if\n \t \n \t // activeCollab 2.0.2 failed to record proper version into update \n \t // history so we need to manually check if we have 2.0.2. This is done \n \t // by checking if acx_attachments table exists (introduced in aC 2).\n \t if((version_compare($this->current_version, '2.0') < 0) && DB::tableExists(TABLE_PREFIX . 'attachments')) {\n \t $this->current_version = '2.0.2';\n \t } // if\n } // if\n return $this->current_version;\n }", "protected function checkPcreVersion() {}", "public function versionCheckAction()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $currentVersion = \"1.6.3\";\n $clientVersion = $_GET['ver'];\n\n if ($clientVersion < $currentVersion) {\n echo \"upgrade\";\n } elseif ($clientVersion == $currentVersion) {\n echo \"latest\";\n } elseif ($clientVersion > $currentVersion) {\n echo \"development\";\n } else {\n echo \"unknown-version\";\n }\n }", "public function isInstalledVersionAReleasedVersion() {}", "final public function meets_minimum_requirements()\n\t{\n\t\treturn version_compare($this->minimum_core_version(), CMS_VERSION) < 1;\n\t}", "public function isSupported(): bool;", "public function isInstallVersionNewer()\n {\n // Get a db connection so we can find the installed version from #__extensions\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName('manifest_cache'))\n ->from ($db->quoteName('#__extensions'))\n ->where ($db->quoteName('element') . ' = '. $db->quote('com_cajobboard'));\n\n $db->setQuery($query);\n\n $manifest = json_decode($db->loadResult(), true);\n $installedRelease = $manifest['version'];\n\n if (version_compare($newRelease, $installedRelease, 'le'))\n {\n JFactory::getApplication()->enqueueMessage(\n Text::sprintf('COM_CAJOBBOARD_NO_UPDATE_TO_AN_OLDER_VERSION', $installedRelease, $newRelease), 'error'\n );\n\n return false;\n }\n\n return true;\n }", "public function isPhpVersionSupported()\n {\n $app = App::instance();\n $php_value = phpversion();\n $php_error = (version_compare($php_value, App::REQUIRED_PHP_VERSION) != -1) ? false : true;\n $checking_result = ($php_error == false) ? true : false;\n\n if (!$checking_result) {\n $app->setNotification('E', App::instance()->t('error'), $app->t('text_php_version_notice', array('version', App::REQUIRED_PHP_VERSION)), true, 'validator');\n }\n\n return $checking_result;\n }", "function check_php_version($version)\n {\n // intval used for version like \"4.0.4pl1\"\n $testVer=intval(str_replace(\".\", \"\",$version));\n $curVer=intval(str_replace(\".\", \"\",phpversion()));\n if( $curVer < $testVer )\n return false;\n return true;\n }", "private function _version($v = 5)\r\n\t{\r\n $_cur = intval(phpversion());\r\n\t\tif ($_cur >= $v) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthrow new TACException('PHP version ' . $v . ' required; have version ' . $_cur);\r\n\t\t}\r\n return false;\r\n\t}", "public function getVersion()\n {\n return true;\n }", "function check_version( $version ) {\n\t$sql = \"SELECT * FROM movie_versions WHERE version_name = \".\n\t\t\tformat_sql( $version );\n\t$res = mysql_query( $sql );\n\tif ( mysql_num_rows( $res ) > 0 ) {\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n}", "public function min_php_version_check()\n {\n }" ]
[ "0.74003553", "0.7226277", "0.7225879", "0.7157196", "0.71565586", "0.69552886", "0.6954265", "0.6787495", "0.6785874", "0.6784257", "0.6669837", "0.6568022", "0.6567794", "0.6530429", "0.65104926", "0.64372855", "0.6408648", "0.64077747", "0.64055943", "0.63715523", "0.63636714", "0.63269645", "0.63023293", "0.6298317", "0.62874156", "0.6264077", "0.62565964", "0.625558", "0.62351495", "0.6234504", "0.6191217", "0.6184638", "0.61796767", "0.6110979", "0.6105915", "0.6087144", "0.60792476", "0.6064802", "0.6063912", "0.60509527", "0.60278416", "0.6022709", "0.60099274", "0.5979436", "0.5974771", "0.5969128", "0.5961395", "0.5945425", "0.5943995", "0.5942031", "0.59298277", "0.5912908", "0.5903743", "0.58943003", "0.589117", "0.5889012", "0.588099", "0.587336", "0.58722985", "0.5866737", "0.58490396", "0.58413786", "0.58325654", "0.58274686", "0.5818359", "0.5808282", "0.579495", "0.57936406", "0.57936406", "0.579358", "0.5787753", "0.5787535", "0.57860905", "0.57799655", "0.576649", "0.576586", "0.5765531", "0.57636887", "0.57636887", "0.5758878", "0.57548493", "0.57234657", "0.5719687", "0.5716009", "0.5716009", "0.5716009", "0.5716009", "0.57094216", "0.57092327", "0.57073593", "0.57041657", "0.5702616", "0.56988996", "0.56967217", "0.56950456", "0.5694942", "0.568926", "0.56808716", "0.5680367", "0.5679551" ]
0.6249424
28
Returns a current protocol version supported be plugin.
public static function getCurrent() { return new amvonetroom_Version(AMVONETROOM_PROTOCOL_VERSION); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_protocol_version(): string {\n return $this->protocol_version ?? '1.1';\n }", "public function GetProtocolInfo()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->protocol_version; \r\n }", "public function getProtocolVersion()\n {\n $protocol = $this->getProtocol();\n\n if (!$protocol) {\n return false;\n }\n\n return explode('/', strtolower($protocol))['1'];\n }", "public function version()\n {\n return $this->protocol;\n }", "public function protocolVersion(): string\n {\n return $this->protocolVersion;\n }", "public function getProtocolVersion();", "public function getProtocolVersion()\n {\n return $this->wrapped->getProtocolVersion();\n }", "public function getProtocolVersion() {}", "static public function GetProtocolVersion() {\n if (isset(self::$asProtocolVersion))\n return self::$asProtocolVersion;\n else\n return false;\n }", "public function getProtocolVersion(): int;", "function getProtocol() {\n\t\treturn $this->getParam(self::PARAM_PROTOCOL);\n\t}", "public function getProtocolVersion(): string\n\t{\n\t\treturn $this->protocolVersion ?? '1.1';\n\t}", "public function getProtocolVersion()\n {\n }", "public function getProtocolVersion()\n {\n }", "public function getProtocolVersion(): string\n {\n return $this->protocolVersion;\n }", "public function getProtocolVersion(): string {\n return $this->protocolVersion;\n }", "public function getProtocolVersion()\r\n {\r\n return $this->protocolVersion;\r\n }", "public function getProtocolVersion()\n {\n return $this->protocolVersion;\n }", "public function getProtocolVersion()\r\n {\r\n // TODO: Implement getProtocolVersion() method.\r\n }", "protected abstract function getPluginVersion();", "public function getProtocolVersion()\n {\n // TODO: Implement getProtocolVersion() method.\n }", "public function protocol() {\n\t\treturn $this->getProtocol();\n\t}", "public static function getProtocol() {\n\t\treturn self::$protocol;\n\t}", "function getServerProtocol() {\n\t\treturn $this->getParam(self::PARAM_SERVER_PROTOCOL);\n\t}", "public function version()\n {\n return ProtocolEngine::VERSION_2;\n }", "private function getLocalVersion()\n {\n $plugin_data = get_plugin_data($this->plugin_file, false);\n return $plugin_data['Version'];\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol() : string;", "public function getProtocol() {\n return $this->protocol;\n }", "public function getProtocol(): string;", "function getVersion()\n\t{\n\t\t$version = 0;\n\t\t$version = @ldap_get_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $version);\n\t\treturn $version;\n\t}", "public function getProtocol()\n {\n return $this->_protocol;\n }", "public function get_plugin_version() {\n\t\treturn $this->plugin_version;\n\t}", "public function get_plugin_version() {\n\t\treturn $this->plugin_version;\n\t}", "public static function get_version() {\n\t\tif (is_null(static::$version)) {\n\t\t\t$plugin_data = get_plugin_data(BLOBMIMES_INDEX, false, false);\n\t\t\tif (isset($plugin_data['Version'])) {\n\t\t\t\tstatic::$version = $plugin_data['Version'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstatic::$version = '0.0';\n\t\t\t}\n\t\t}\n\n\t\treturn static::$version;\n\t}", "function wpcf_modman_get_plugin_version() {\n\n \tif (defined( 'WPCF_VERSION' )) {\n\n \t\treturn WPCF_VERSION;\n\n \t}\n\n }", "public function getProtocol()\n {\n $protocol = $this->serverAttributes()['SERVER_PROTOCOL'];\n\n if (!$protocol) {\n return false;\n }\n\n return $protocol;\n }", "public function get_version();", "static function Protocol()\n {\n return self::Variable('SERVER_PROTOCOL');\n }", "function searchProtocol()\t{\n\t\treturn $this->getRandomProtocol();\n\t}", "public function getResponseProtocol()\n\t\t{\n\t\t\treturn $this->getHeader( \"protocol\" );\n\t\t}", "public function getRequestedVersion()\n {\n return $this->_options['requested_version'];\n }", "function GetVersion() {\n\t\t\tif(!function_exists('get_plugin_data')) {\n\t\t\t\tif(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+\n\t\t\t\telse if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1\n\t\t\t\telse return \"0.ERROR\";\n\t\t\t}\n\t\t\t$data = get_plugin_data(__FILE__);\n\t\t\treturn $data['Version'];\n\t\t}", "public function getProtocolVersion()\n {\n return sprintf('%01.1F', $this->version);\n }", "public function getProtocolName()\n {\n $protocol = $this->getProtocol();\n\n if (!$protocol) {\n return false;\n }\n\n return explode('/', strtolower($protocol))['0'];\n }", "public function getCurrentVersion();", "abstract public function getExtensionVersion();", "function myplugin_installed_version() {\n\n\treturn get_option( MYPLUGIN_NAME ); // returns the version number of this plugin that the current stored data is registered to.\n}", "public function getModuleVersion()\n {\n /** @var string $composerJsonData */\n /** @var string[] $data */\n /** @var ReadInterface $directoryRead */\n /** @var null|string $path */\n /** @var string $version */\n\n $path = $this->componentRegistrar->getPath(\n \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n 'Bazaarvoice_Connector'\n );\n $directoryRead = $this->readFactory->create($path);\n $composerJsonData = $directoryRead->readFile('composer.json');\n $data = json_decode($composerJsonData);\n if (!empty($data->version)) {\n $version = $data->version;\n }\n\n return $version ?? __('Could not retrieve extension version.');\n }", "function dynamo_support_get_plugin_version() {\n if ( ! function_exists( 'get_plugins' ) )\n require_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n $plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) );\n $plugin_file = basename( ( __FILE__ ) );\n return $plugin_folder[$plugin_file]['Version'];\n }", "public function getMinorVersion() {}", "public function protocol()\n {\n return $this->connection->protocol();\n }", "public function getHttpVersion()\n {\n return $this->getConfig('httpVersion');\n }", "public function getVersion()\n\t{\n\t\t//make sure a developer enters only a number as a version\n\t\tif(!is_int($minor_version = $this->getPluginVersion()))\n\t\t\tthrow new Exception(SyC::t('sdk','The Plugin Version must be an integer'));\n\t\t\n\t\treturn self::$_SDK_VERSION.'.'.$minor_version;\n\t}", "static function get_plugin_version() {\n\t\t$plugin_data = get_file_data(__FILE__, array('version' => 'Version'), 'plugin');\n\t\tself::$version = $plugin_data['version'];\n\t\treturn $plugin_data['version'];\n\t}", "public function sslGetProtocol(): string {}", "public function sslGetCipherVersion(): string|false {}", "function getPluginVersion( $pPlugin, $pDefault = '0.0.0' ) {\n\t\tglobal $gBitSystem;\n\t\tif( !($ret = $this->getInstalledPackagePluginConfigValue( $pPlugin, 'version' )) ){\n\t\t\t$ret = $pDefault;\n\t\t}\n\t\treturn $ret;\n\t}", "public function getExtensionVersion()\n {\n $moduleInfo = $this->moduleList->getOne(self::MODULE_CODE);\n\n return $moduleInfo['setup_version'];\n }", "public function getExtensionVersion()\n {\n $moduleInfo = $this->moduleList->getOne(self::MODULE_CODE);\n\n return $moduleInfo['setup_version'];\n }", "abstract public function getIntegrationVersion();", "public static function get_current_version() {\n\t\t// $db = JFactory::getDbo();\n\t\t// $db->setQuery('SELECT manifest_cache FROM #__extensions WHERE element = \"mod_slideshowck\"');\n\t\t// $manifest = json_decode($db->loadResult(), true);\n\t\t// $installed_version = $manifest['version'];\n\t\t\n\t\t// get the version installed\n\t\t$installed_version = 'UNKOWN';\n\t\t$file_url = JPATH_SITE .'/modules/mod_slideshowck/mod_slideshowck.xml';\n\t\tif ($xml_installed = JFactory::getXML($file_url)) {\n\t\t\t$installed_version = (string)$xml_installed->version;\n\t\t}\n\n\t\treturn $installed_version;\n\t}", "public function serverProtocol()\n {\n return $this->_serverProtocol;\n }", "public function get_version(){\n\n\t\t\tswitch( $this->method ){\n\n\t\t\t\tcase 'commit-message':\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->get_version_from_commit_message();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'file':\n\t\t\t\t\treturn $this->get_version_from_file();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'tag':\n\t\t\t\t\treturn $this->get_version_from_tag();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function getServerVersion();", "function plugin_chkVersion_jtickets() {\n\tglobal $_JTICKETS_CONF;\n\t\n\treturn $_JTICKETS_CONF['pi_version'];\n}", "public function getProtocol(): ProtocolInterface\n {\n return $this->protocol;\n }", "public function get_test_plugin_version()\n {\n }", "protected function mm_current_version() {\n $options = $this->options;\n if($options['version'] == MM_PLUGIN_VER)\n return true;\n }", "abstract public function get_version();", "public static function getProtocol(): ?string {\r\n return $_SERVER['SERVER_PROTOCOL'] ?? null;\r\n }", "function plex_config_get_installed_version() {\n\treturn get_option( 'plex_config_version' );\n}", "public static function getFromRequest() {\n // there is no suitable PARAM_XXX flag in Moodle to clean this parameter but\n // don't worry it will be split and parsed as two int and it's never used in raw form\n $param = @$_GET['protoVersion'];\n if ($param && !empty($param))\n return new amvonetroom_Version($param);\n\n return amvonetroom_ProtoVersion::getDefault();\n }", "function plex_config_get_current_version() {\n\treturn PLEX_CONFIG_CURRENT_VERSION;\n}", "function get_request_protocol()\n{\n return Request::GetProtocol();\n}", "function get_version() {\n\n\t\treturn $this->version;\n\n\t}", "public function getProtocolName() : string;", "public function getServerProtocol(): string;", "public function GetAllowProtocol () {\n\t\treturn $this->allowProtocol;\n\t}", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . '/plugin.json'), true);\n if ($info) {\n return $info['currentVersion'];\n }\n throw new RuntimeException('The plugin has an invalid version file.');\n }", "public function getVersion()\n {\n return $this->getParam(self::SOFTWARE_VER_PARAM_NAME);\n }", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true);\n\n if ($info) {\n return $info['currentVersion'];\n } else {\n throw new Exception('The plugin has an invalid version file.');\n }\n }", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true);\n\n if ($info) {\n return $info['currentVersion'];\n } else {\n throw new Exception('The plugin has an invalid version file.');\n }\n }", "public function\n\tGetProtocol():\n\t?String {\n\n\t\treturn ((array_key_exists('HTTPS',$_SERVER))?\n\t\t('https'):\n\t\t('http'));\n\t}", "function getProtocol() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_PROTOCOL);\n\t}", "public function getVersionPlatform()\n {\n return Shopware()->Plugins()->Frontend()->NostoTagging()->getShopwareVersion();\n }", "public function api_version() {\n $v = $this->call( 'systemGetApiVersion' );\n\n return $v ? $v->version : false;\n }", "public function getModuleVersion() {\n\t return self::PLUGIN_VERSION;\n\t}", "public function getCurrentVersion()\n {\n $versions = $this->getVersions();\n\n return count($versions) > 0 ? $versions[0] : 0;\n }", "function wp_get_server_protocol()\n {\n }", "public function getBinaryProtocol()\n {\n return $this->binaryProtocol;\n }", "public function getHttpVersion()\n {\n $httpVersion = $this->fusionValue('httpVersion');\n if ($httpVersion === null) {\n $httpVersion = 'HTTP/1.1';\n }\n return trim($httpVersion);\n }", "public function get_version()\n\t{\n\t\treturn $this->version;\n\t}", "static function getVersion(){\n\t\t$uagent = \"\";\n\t\tif (array_key_exists(\"HTTP_USER_AGENT\", $_SERVER)){\n\t\t\t$uagent = $_SERVER[\"HTTP_USER_AGENT\"];\n\t\t}\n\t\t\n\t\tif (knj_browser::getBrowser() == \"ie\"){\n\t\t\tif (preg_match(\"/MSIE (\\d+)/\", $uagent, $match)){\n\t\t\t\treturn $match[1];\n\t\t\t}elseif(strpos($uagent, \"7.0\") !== false){\n\t\t\t\treturn 7;\n\t\t\t}else{\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"safari\"){\n\t\t\tif (strpos($uagent, \"Version/4.0\") !== false){\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"konqueror\"){\n\t\t\tif (strpos($uagent, \"Konqueror/3\") !== false){\n\t\t\t\treturn 3;\n\t\t\t}elseif (strpos($uagent, \"Konqueror/4\") !== false){\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"mozilla\" or knj_browser::getBrowser() == \"firefox\"){\n\t\t\tif (strpos($uagent, \"Firefox/3\") !== false){\n\t\t\t\treturn 3;\n\t\t\t}elseif(strpos($uagent, \"Firefox/2\") !== false){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"chrome\"){\n\t\t\tif (strpos($uagent, \"Chrome/4\") !== false){\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}" ]
[ "0.7576553", "0.75652975", "0.7545476", "0.7539783", "0.7433779", "0.72467715", "0.72448134", "0.7197946", "0.71660906", "0.7146725", "0.7106861", "0.70915383", "0.7071719", "0.7071719", "0.70294964", "0.70195633", "0.7010494", "0.700459", "0.6843568", "0.6814779", "0.6809308", "0.679008", "0.67497545", "0.6732646", "0.66797507", "0.6604997", "0.658156", "0.658156", "0.658156", "0.658156", "0.658156", "0.658156", "0.658156", "0.6567839", "0.65599096", "0.65397185", "0.65374374", "0.6516186", "0.65147465", "0.65147465", "0.64647466", "0.646325", "0.6423735", "0.6388336", "0.6380011", "0.637948", "0.63744366", "0.6371921", "0.63640976", "0.6353016", "0.6331062", "0.6319148", "0.63071555", "0.6302321", "0.62910855", "0.6287534", "0.62471884", "0.62407935", "0.623764", "0.6204895", "0.6185464", "0.61687434", "0.61579454", "0.61499995", "0.6134892", "0.6134892", "0.6130273", "0.61212635", "0.6114639", "0.6110902", "0.61019456", "0.60927296", "0.6085387", "0.6078118", "0.60776705", "0.6077292", "0.6062098", "0.6040722", "0.6030203", "0.6025706", "0.60245836", "0.6020501", "0.6017406", "0.60078", "0.60047007", "0.6001352", "0.59945923", "0.59895873", "0.59895873", "0.5981155", "0.59761566", "0.5976055", "0.5961581", "0.59490305", "0.5948189", "0.59448284", "0.59340787", "0.592896", "0.59276175", "0.5925918" ]
0.6077722
74
Returns a protocol version of the current HTTP request.
public static function getFromRequest() { // there is no suitable PARAM_XXX flag in Moodle to clean this parameter but // don't worry it will be split and parsed as two int and it's never used in raw form $param = @$_GET['protoVersion']; if ($param && !empty($param)) return new amvonetroom_Version($param); return amvonetroom_ProtoVersion::getDefault(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_request_protocol()\n{\n return Request::GetProtocol();\n}", "public function version()\n {\n return $this->protocol;\n }", "function getProtocol() {\n\t\treturn $this->getParam(self::PARAM_PROTOCOL);\n\t}", "public function get_protocol_version(): string {\n return $this->protocol_version ?? '1.1';\n }", "function getServerProtocol() {\n\t\treturn $this->getParam(self::PARAM_SERVER_PROTOCOL);\n\t}", "public function protocolVersion(): string\n {\n return $this->protocolVersion;\n }", "public function GetProtocolInfo()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->protocol_version; \r\n }", "public function getProtocolVersion()\n {\n $protocol = $this->getProtocol();\n\n if (!$protocol) {\n return false;\n }\n\n return explode('/', strtolower($protocol))['1'];\n }", "public function getResponseProtocol()\n\t\t{\n\t\t\treturn $this->getHeader( \"protocol\" );\n\t\t}", "public function protocol() {\n\t\treturn $this->getProtocol();\n\t}", "public function\n\tGetProtocol():\n\t?String {\n\n\t\treturn ((array_key_exists('HTTPS',$_SERVER))?\n\t\t('https'):\n\t\t('http'));\n\t}", "public function getHttpVersion()\n {\n $httpVersion = $this->fusionValue('httpVersion');\n if ($httpVersion === null) {\n $httpVersion = 'HTTP/1.1';\n }\n return trim($httpVersion);\n }", "static function Protocol()\n {\n return self::Variable('SERVER_PROTOCOL');\n }", "public static function getProtocol() {\n\t\treturn self::$protocol;\n\t}", "public function getProtocol() {\n if (isset($_SERVER['HTTPS']) &&\n ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||\n isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&\n $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $protocol = 'https';\n }\n else {\n $protocol = 'http';\n }\n\n return $protocol;\n }", "public function getProtocolVersion()\n {\n return $this->wrapped->getProtocolVersion();\n }", "public function protocol()\n\t{\n\t\tif (\n\t\t\t$this->server('HTTPS') == 'on' OR\n\t\t\t$this->server('HTTPS') == 1 OR\n\t\t\t$this->server('SERVER_PORT') == 443\n\t\t) {\n\t\t\treturn 'https';\n\t\t}\n\n\t\treturn 'http';\n\t}", "public function protocol() \n\t{\n\t\treturn ( ( $this->has_server( 'HTTPS' ) && $this->server( 'HTTPS' ) != 'off' ) || $this->server( 'SERVER_PORT' ) == 443 ) ? 'https' : 'http';\n\t}", "public function getProtocolVersion(): string\n {\n return $this->protocolVersion;\n }", "public function getProtocolVersion(): string {\n return $this->protocolVersion;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocolVersion();", "public function getProtocol() {\n return $this->protocol;\n }", "public function getProtocol(){\n\t\treturn \"http\"; //TODO\n\t}", "public function getProtocol()\n {\n return $this->_protocol;\n }", "public function getProtocol()\n\t{\n\t\tif (isset($_SERVER[\"HTTPS\"]) && ($_SERVER[\"HTTPS\"] == 'on')) {\n\t\t\treturn 'https';\n\t\t} else {\n\t\t\treturn 'http';\n\t\t}\n\t}", "public function getProtocol(): string;", "public function getProtocol()\n {\n $protocol = $this->serverAttributes()['SERVER_PROTOCOL'];\n\n if (!$protocol) {\n return false;\n }\n\n return $protocol;\n }", "public function getProtocolVersion(): string\n\t{\n\t\treturn $this->protocolVersion ?? '1.1';\n\t}", "public function getServerProtocol(): string;", "public function getProtocolVersion()\n {\n return $this->protocolVersion;\n }", "public function getProtocol() : string;", "public function getProtocolVersion()\r\n {\r\n return $this->protocolVersion;\r\n }", "public function getProtocolVersion() {}", "static function Protocol ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn 'cli';\n\t\t\t$x = (isset($_SERVER['HTTPS'])) ? $_SERVER['HTTPS'] : '';\n\t\t\tif ($x == \"off\" or $x == \"\")\n\t\t\t\treturn \"http\";\n\t\t\telse\n\t\t\t\treturn \"https\";\n\t\t}", "public function protocol(){\n\t\tif (isset($_SERVER['HTTPS']) &&\n\t\t\t($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||\n\t\t\tisset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&\n\t\t\t$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')\n\t\t{\n\t\t\t$protocol = 'https://';\n\t\t} else {\n\t\t\t$protocol = 'http://';\n\t\t}\n\t\treturn $protocol;\n\t}", "public function protocol()\n {\n return $this->connection->protocol();\n }", "public static function getProtocol(): ?string {\r\n return $_SERVER['SERVER_PROTOCOL'] ?? null;\r\n }", "public function getProtocolVersion()\n {\n }", "public function getProtocolVersion()\n {\n }", "public function sslGetProtocol(): string {}", "public function getCurrenProtocol() {\n\t\t$pageURL = 'http';\n\t\tif (isset ( $_SERVER [\"HTTPS\"] ) && $_SERVER [\"HTTPS\"] == \"on\") {\n\t\t\t$pageURL .= \"s\";\n\t\t}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER [\"SERVER_PORT\"] != \"80\") {\n\t\t\t$pageURL .= $_SERVER [\"SERVER_NAME\"] . \":\" . $_SERVER [\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER [\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t}\n\t\treturn $pageURL;\n\t}", "public function getHttpVersion()\n {\n return $this->getConfig('httpVersion');\n }", "public function getProtocolVersion(): int;", "public function getProtocolName()\n {\n $protocol = $this->getProtocol();\n\n if (!$protocol) {\n return false;\n }\n\n return explode('/', strtolower($protocol))['0'];\n }", "public function getProtocolVersion()\n {\n // TODO: Implement getProtocolVersion() method.\n }", "public function getProtocolVersion()\r\n {\r\n // TODO: Implement getProtocolVersion() method.\r\n }", "public function serverProtocol()\n {\n return $this->_serverProtocol;\n }", "public function getProtocolName() : string;", "function findProtocol()\n{\n $protocol = \"http://\";\n\n if (isset($_SERVER[\"SERVER_PORT\"]) && $_SERVER[\"SERVER_PORT\"] == 443) {\n $protocol = \"https://\";\n }\n\n return $protocol;\n}", "public function protocol() {\n\t\tif($_SERVER['HTTP_X_FORWARDED_PORT'] == '80') return 'http';\n\t\tif($_SERVER['HTTP_X_FORWARDED_PORT'] == '443') return 'https';\n\t\treturn ($_SERVER['HTTPS'] == 'on')? 'https' : 'http';\n\t}", "static public function GetProtocolVersion() {\n if (isset(self::$asProtocolVersion))\n return self::$asProtocolVersion;\n else\n return false;\n }", "#[Pure]\n public function getHttpVersion() {}", "public static function protocol()\n\t{\n\t\treturn (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) === 'on') ? 'https://' : 'http://';\n\t}", "public function getSiteProtocol() {\n return isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http' . '://';\n }", "function serverProtocol() {\r\n\t return (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')\t|| $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://');\r\n\t}", "function getProtocol(){\n return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';\n}", "function wp_get_server_protocol()\n {\n }", "public function getApiRequestVersion()\n {\n return $this->apiRequestVersion;\n }", "private function get_version(&$request) {\n $version = $request->get_parameter(\"oauth_version\");\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "public function getIncomingMailServerProtocol() {\n\t\treturn $this->ic_mail_server_protocol;\n\t}", "function wmfGetProtocolAndHost() {\n\tif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {\n\t\t$protocol = 'https';\n\t} else {\n\t\t$protocol = 'http';\n\t}\n\tif ( defined( 'MISSING_PHP_TEST' ) && isset( $_GET['host'] ) ) {\n\t\t$host = $_GET['host'];\n\t} else {\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t}\n\t$host = strtolower( $host );\n\treturn [ $protocol, $host ];\n}", "protected function getScheme()\n {\n if (isset($_SERVER['REQUEST_SCHEME'])) {\n $scheme = $_SERVER['REQUEST_SCHEME'];\n } else if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {\n $scheme = 'https';\n } else {\n if ($_SERVER['SERVER_PORT'] == 443) {\n $scheme = 'https';\n } else {\n $scheme = 'http';\n }\n }\n \n return $scheme;\n }", "public static function getRequestMethod(){\n return $_SERVER['REQUEST_METHOD'];\n }", "public function scheme()\n {\n return $this->_requestScheme;\n }", "function searchProtocol()\t{\n\t\treturn $this->getRandomProtocol();\n\t}", "public static function httpVia() {\n\t\treturn (isset($_SERVER['HTTP_VIA']))\n\t\t\t? $_SERVER['HTTP_VIA']\n\t\t\t: null;\n\t}", "function getProtocol() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_PROTOCOL);\n\t}", "public function getBinaryProtocol()\n {\n return $this->binaryProtocol;\n }", "public function getRequestedVersion()\n {\n return $this->_options['requested_version'];\n }", "public function getProtocolVersion()\n {\n return sprintf('%01.1F', $this->version);\n }", "private function getVersion(Request &$request)\n {\n $version = $request->getParameter('oauth_version');\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "static function version() {\n return NICEHTTP_VERSION;\n }", "protected function http_version()\n {\n }", "public function get_version(){\n\n\t\t\tswitch( $this->method ){\n\n\t\t\t\tcase 'commit-message':\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->get_version_from_commit_message();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'file':\n\t\t\t\t\treturn $this->get_version_from_file();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'tag':\n\t\t\t\t\treturn $this->get_version_from_tag();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "public function getRequestMethod()\n {\n // Take the method as found in $_SERVER\n $method = $_SERVER['REQUEST_METHOD'];\n\n // If it's a HEAD request override it to being GET and prevent any output, as per HTTP Specification\n // @url http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4\n if ($_SERVER['REQUEST_METHOD'] == 'HEAD') {\n ob_start();\n $method = 'GET';\n }\n\n // If it's a POST request, check for a method override header\n elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $headers = $this->getRequestHeaders();\n if (isset($headers['X-HTTP-Method-Override']) && in_array($headers['X-HTTP-Method-Override'], ['PUT', 'DELETE', 'PATCH'])) {\n $method = $headers['X-HTTP-Method-Override'];\n }\n }\n\n return $method;\n }", "public static function get() {\n if (isset($_SERVER['X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['X_PAPAYA_HTTPS'];\n } elseif (isset($_SERVER['HTTP_X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['HTTP_X_PAPAYA_HTTPS'];\n } else {\n $header = NULL;\n }\n if (isset($header) &&\n defined('PAPAYA_HEADER_HTTPS_TOKEN') &&\n strlen(PAPAYA_HEADER_HTTPS_TOKEN) == 32 &&\n $header == PAPAYA_HEADER_HTTPS_TOKEN) {\n return 443;\n }\n return empty($_SERVER['SERVER_PORT']) ? 80 : (int)$_SERVER['SERVER_PORT'];\n }", "public function getRequestMethod()\n {\n return $_SERVER['REQUEST_METHOD'];\n }", "public function detect(Request $request)\n {\n $time = $request->server->get('REQUEST_TIME');\n\n // Ask the router for a version.\n return call_user_func($this->router, $time);\n }", "public function protocol($protocol = self::SSL_DEFAULT);", "public function HTTPD_version()\n\t{\n\t\tpreg_match('/\\w+\\/[.0-9]+/i', $_SERVER['SERVER_SOFTWARE'], $matches);\n\t\tif (isset($matches[0])) {\n\t\t\treturn $matches[0];\n\t\t} else {\n\t\t\treturn 'Unknown Webserver';\n\t\t}\n\t}", "function _getRequestMethod(){\n return $_SERVER['REQUEST_METHOD'];\n }", "public function getScheme()\n {\n return ($this->getServer('HTTPS') == 'on')\n ? static::SCHEME_HTTPS : static::SCHEME_HTTP;\n }", "public function testProtocolDetect() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTP right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('http');\n\n\t\t$_SERVER['HTTPS'] = true;\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTPS right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('https');\n\n\t\treturn;\n\t}", "public static function getScheme() {\n\t if(!isset(self::$scheme)) {\n\t\t\tif(self::$trust && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n\t\t\t\tself::$scheme = $_SERVER['HTTP_X_FORWARDED_PROTO'];\n\t\t\t} else if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {\n\t\t\t\tself::$scheme = \"https\";\n\t\t\t} else if(443 == self::getPort() || 8443 == self::getPort()) {\n\t\t\t\tself::$scheme = \"https\";\n\t\t\t} else\t{\n\t\t\t\tself::$scheme = \"http\";\n\t\t\t}\n\t\t}\n\t\treturn self::$scheme;\n\t}", "public function getHttp()\r\n {\r\n return $this->Http;\r\n }", "private static function getMethodRequest(){\n return $_SERVER[\"REQUEST_METHOD\"];\n }", "public function protocol($protocol = null) {\n\t\tif ($protocol !== null) {\n\t\t\t$this->_protocol = $protocol;\n\t\t}\n\t\treturn $this->_protocol;\n\t}", "public function protocolVersion($protocol_version = null)\r\n {\r\n if (null !== $protocol_version) {\r\n // Require that the response be unlocked before changing it\r\n $this->requireUnlocked();\r\n\r\n $this->protocol_version = (string) $protocol_version;\r\n\r\n return $this;\r\n }\r\n\r\n return $this->protocol_version;\r\n }", "private function requestMethod() \n {\n // Take the method as found in $_SERVER\n $method = $_SERVER['REQUEST_METHOD'];\n\n if ($_SERVER['REQUEST_METHOD'] == 'HEAD') {\n ob_start();\n $method = 'GET';\n } // If it's a POST request, check for a method override header\n elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $headers = $this->requestHeaders();\n if (isset($headers['X-HTTP-Method-Override']) && in_array($headers['X-HTTP-Method-Override'], array('PUT', 'DELETE', 'PATCH'))) {\n $method = $headers['X-HTTP-Method-Override'];\n }\n }\n return $method;\n }", "public function version()\n {\n return ProtocolEngine::VERSION_2;\n }", "public function getRequestMethod(): string;", "public function getVersion()\n {\n return $this->sendrequest('version', null);\n }", "function getServerVersion();" ]
[ "0.79475594", "0.7611117", "0.75215816", "0.7438235", "0.7431877", "0.7429254", "0.730948", "0.7277163", "0.726366", "0.7234121", "0.72198904", "0.7190087", "0.7187419", "0.7186932", "0.71843225", "0.71666515", "0.7134317", "0.7126224", "0.7120659", "0.71193904", "0.7114901", "0.7114901", "0.7114901", "0.7114901", "0.7114901", "0.7114901", "0.7114901", "0.7098672", "0.70935637", "0.7087188", "0.7086088", "0.707836", "0.70638573", "0.70571077", "0.7049996", "0.70496345", "0.70135754", "0.7007648", "0.6995604", "0.6954211", "0.6872469", "0.68573636", "0.6844952", "0.6840723", "0.6793281", "0.6793281", "0.67853093", "0.67819995", "0.67639285", "0.6739865", "0.6731967", "0.6686882", "0.6686302", "0.6661015", "0.65491605", "0.65439695", "0.6538648", "0.6517847", "0.6517691", "0.6480295", "0.6426611", "0.6399212", "0.6376877", "0.6272845", "0.6237057", "0.6222595", "0.6219388", "0.61918026", "0.6181524", "0.61499083", "0.613813", "0.61211175", "0.61090773", "0.6092611", "0.6072983", "0.6070578", "0.6065291", "0.60504156", "0.6049906", "0.6024721", "0.59971905", "0.59815776", "0.5977499", "0.5963546", "0.5928123", "0.59232897", "0.58970207", "0.58901846", "0.5886277", "0.5873999", "0.58710855", "0.58630204", "0.58611387", "0.5839721", "0.5838143", "0.5826985", "0.5825801", "0.5813896", "0.5802151", "0.5800828" ]
0.6327691
63
Check a compatibility of a protocol version of the current request.
public static function checkRequest($ver = null) { $requestVersion = empty($ver) ? amvonetroom_ProtoVersion::getFromRequest() : new amvonetroom_Version($ver); $currentVersion = amvonetroom_ProtoVersion::getCurrent(); $v20 = new amvonetroom_Version(2,0); if (!$currentVersion->compatible($requestVersion) || $requestVersion->compare($v20) <= 0) { if ($currentVersion->compare($requestVersion) < 0) { header ("HTTP/1.1 460 Version Incompatible"); die("460 Version Incompatible"); } else { header ("HTTP/1.1 461 Version Too Old"); die("461 Version Too Old"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkConnection(){\n\t\t\t\n\t\t\t$request = $this->url.$this->getMode(\"version\").\"?\".$this->key_string;\n\t\t\t$this->http->setURL($request);\n\t\t\t$response = $this->http->send();\n\t\t\t//echo $this->http->HTMLizeErrlog();\n\t\t\t$this->bn_version = str_replace(\"_\", \".\", $response[\"version\"]);\n\n\t\t\treturn $this->http->status;\n\t\t}", "protected function checkVersion(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request)\n {\n if (count($this->supportedVersions) === 0) {\n $class = function_exists('get_called_class') ? get_called_class() : get_class();\n throw new RuntimeException(\"$class does not specify $supportedVersions\");\n }\n\n if (in_array($request->getVersion(), $this->supportedVersions)) {\n return true;\n }\n\n throw new PriceWaiter_NYPWidget_Exception_Version($this->supportedVersions);\n }", "function is_php_version_compatible($required)\n {\n }", "public function testProtocolDetect() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTP right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('http');\n\n\t\t$_SERVER['HTTPS'] = true;\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTPS right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('https');\n\n\t\treturn;\n\t}", "private static function verifyRequest()\n {\n if(isset($_SERVER['HTTP_USER_AGENT']) == false)\n {\n InvalidUserAgentResponse::executeResponse();\n exit();\n }\n\n if(strlen($_SERVER['HTTP_USER_AGENT']) == 0)\n {\n InvalidUserAgentResponse::executeResponse();\n exit();\n }\n\n if(strlen($_SERVER['HTTP_USER_AGENT']) > 624)\n {\n InvalidUserAgentResponse::executeResponse();\n exit();\n }\n\n $UnsupportedRequestMethod = true;\n\n if(strtoupper($_SERVER['REQUEST_METHOD']) == 'GET')\n {\n $UnsupportedRequestMethod = false;\n }\n\n if(strtoupper($_SERVER['REQUEST_METHOD']) == 'POST')\n {\n $UnsupportedRequestMethod = false;\n }\n\n if($UnsupportedRequestMethod)\n {\n UnsupportedVersion::executeResponse();\n exit();\n }\n }", "function get_request_protocol()\n{\n return Request::GetProtocol();\n}", "public function checkOpenSSLVersion() {\n\t\tif (self::openssl_version_compare(self::OPENSSL_DEPRECATING) <= 0) {\n\t\t\treturn self::VERSION_COMPATIBLE;\n\t\t}\n\t\t\n\t\tif (self::OPENSSL_DEPRECATING != self::OPENSSL_MINIMUM && self::openssl_version_compare(self::OPENSSL_MINIMUM) <= 0) {\n\t\t\treturn self::VERSION_DEPRECATED;\n\t\t}\n\t\t\n\t\treturn self::VERSION_UNSUPPORTED;\n\t}", "public function checkVersions() {\n\t\treturn ($this->checkPHPVersion() == self::VERSION_COMPATIBLE) && ($this->checkOpenSSLVersion() == self::VERSION_COMPATIBLE) && ($this->checkWordPressVersion() == self::VERSION_COMPATIBLE);\n\t}", "public function getProtocolVersion() {}", "public function detect(Request $request)\n {\n $time = $request->server->get('REQUEST_TIME');\n\n // Ask the router for a version.\n return call_user_func($this->router, $time);\n }", "public function getProtocolVersion();", "private function _checkCompatibility(){\n\n\t\t$pageContent = new Page\\Content;\n\t\t$model = Advertikon::getCurrentModel();\n\t\t$mock = false;\n\n\t\tif( $mock || version_compare( PHP_VERSION , self::MIN_PHP_VER ) === -1 ) {\n\t\t\t$contentRecord = new Page\\Content\\Record;\n\t\t\t$contentRecord->setTypeWarning();\n\t\t\t$record = $model->__( 'PHP version needed at least %s, current version %s.' , self::MIN_PHP_VER , PHP_VERSION );\n\t\t\t$record .= sprintf( ' <a href=\"%s\" target=\"_blank\">%s</a>' , 'http://php.net/manual/install.php' , $model->__( 'More details' ) );\n\t\t\t$contentRecord->setRecord( $record );\n\t\t\t$pageContent->addRecord( $contentRecord );\n\t\t}\n\n\t\t$this->_childCheckCompatibility( $pageContent , $mock );\n\n\t\tif( $pageContent->recordCount() > 0 ) {\n\t\t\t$pageContent->setHeader( $model->__( 'The library incompatibility, with the runtime environment, detected. The following must be corrected for the continuation:' ) );\n\t\t\tthrow new Exception\\Transport( $pageContent );\n\t\t}\n\n\t\treturn true;\n\t}", "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}", "private function is_ssl_capable(){\r\n\t\treturn defined('OPENSSL_VERSION_NUMBER') && is_numeric(OPENSSL_VERSION_NUMBER);\r\n\t}", "static public function GetProtocolVersion() {\n if (isset(self::$asProtocolVersion))\n return self::$asProtocolVersion;\n else\n return false;\n }", "function checkVersions() {\n //TODO: Put the version checker service online instead of localhost\n $curl_request = curl_init(\"0.0.0.0:3002\");\n\n //By default the request type is \"GET\"\n curl_setopt_array($curl_request, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_CONNECTTIMEOUT => 10, //Must connect within 10 seconds\n CURLOPT_TIMEOUT => 20, //Must finish the whole request in 20 seconds... or else\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0, //Falls back to 1.1 if 2.0 won't work\n ));\n\n //Get a response or a returned error (or if failed to connect)\n $response = curl_exec($curl_request);\n $err = curl_error($curl_request);\n //Don't needlessly call logMsg if no error was thrown:\n if(isset($err)) {\n logMsg($err);\n curl_close($curl_request);\n return false;\n }\n\n //A sample successful response body would look like this: \"7.3.1 1.0.3\"\n //where \"7.3.1\" is the PHP version and \"1.0.3\" is the Web Mill version.\n\n //Close the connection and free up $curl_request's resources:\n curl_close($curl_request);\n\n //Put the PHP version and Web Mill version into an array\n //They are currently separated by a space:\n $versions = explode(\" \", $response);\n return $versions;\n }", "public function getProtocolVersion()\n {\n $protocol = $this->getProtocol();\n\n if (!$protocol) {\n return false;\n }\n\n return explode('/', strtolower($protocol))['1'];\n }", "function bb2_protocol($settings, $package)\n{\n\t// We should never see Expect: for HTTP/1.0 requests\n\tif ( array_key_exists('Expect', $package['headers_mixed'])\n\t\t&& stripos($package['headers_mixed']['Expect'], '100-continue') !== false\n\t\t&& !strcmp($package['server_protocol'], 'HTTP/1.0'))\n\t{\n\t\treturn 'a0105122';\n\t}\n\n\t// Is it claiming to be HTTP/1.1? Then it shouldn't do HTTP/1.0 things\n\t// Blocks some common corporate proxy servers in strict mode\n\tif ($settings['strict'] && !strcmp($package['server_protocol'], 'HTTP/1.1'))\n\t{\n\t\tif ( array_key_exists('Pragma', $package['headers_mixed'])\n\t\t\t&& str_contains($package['headers_mixed']['Pragma'], 'no-cache')\n\t\t\t&& !array_key_exists('Cache-Control', $package['headers_mixed']))\n\t\t{\n\t\t\treturn '41feed15';\n\t\t}\n\t}\n\n\treturn false;\n}", "public function GetProtocolInfo()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->protocol_version; \r\n }", "public function versionCheckAction()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $currentVersion = \"1.6.3\";\n $clientVersion = $_GET['ver'];\n\n if ($clientVersion < $currentVersion) {\n echo \"upgrade\";\n } elseif ($clientVersion == $currentVersion) {\n echo \"latest\";\n } elseif ($clientVersion > $currentVersion) {\n echo \"development\";\n } else {\n echo \"unknown-version\";\n }\n }", "public function getProtocolVersion(): int;", "public function getProtocolVersion()\n {\n }", "public function getProtocolVersion()\n {\n }", "function setProtocolVersion( $version )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"setProtocolVersion( $version )\\n\";\r\n\t\t\t\r\n\t\tif( $version > 0 and $version <= 1.1 ) {\r\n\t\t\t$this->protocolVersion = $version;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function check_version_and_update() {\n\t\tif ( ! defined( 'IFRAME_REQUEST' ) && $this->version !== WC_PAYSAFE_PLUGIN_VERSION ) {\n\t\t\t$this->update();\n\t\t}\n\t}", "public function protocolVersionAndOverriding()\n {\n $this->ldap->option(LDAP_OPT_PROTOCOL_VERSION, 3);\n $this->assertEquals(3, $this->ldap->getOption(LDAP_OPT_PROTOCOL_VERSION));\n $this->ldap->option(LDAP_OPT_PROTOCOL_VERSION, 2);\n $this->assertEquals(2, $this->ldap->getOption(LDAP_OPT_PROTOCOL_VERSION));\n }", "function is_wp_version_compatible($required)\n {\n }", "public function testWithUpdatedProtocolVersion()\n {\n $response = $this->createSubject();\n $newResponse = $response->withProtocolVersion('2.0');\n\n $this->assertSame('2.0', $newResponse->getProtocolVersion());\n }", "public function checkPHPVersion() {\n\t\tif (version_compare(phpversion(), self::PHP_DEPRECATING, '>=')) {\n\t\t\treturn self::VERSION_COMPATIBLE;\n\t\t}\n\t\t\n\t\tif (self::PHP_DEPRECATING != self::PHP_MINIMUM && version_compare(phpversion(), self::PHP_MINIMUM, '>=')) {\n\t\t\treturn self::VERSION_DEPRECATED;\n\t\t}\n\t\t\n\t\treturn self::VERSION_UNSUPPORTED;\n\t}", "public function sslGetCipherVersion(): string|false {}", "public function checkCompatibility(): void\n {\n if ( ! $this->satisfiesPHPVersion()) {\n throw IncompatiblePlatformException::create(\n 'The client required PHP version >= ' . self::MIN_PHP_VERSION . ', you have ' . PHP_VERSION . '.',\n IncompatiblePlatformException::INCOMPATIBLE_PHP_VERSION\n );\n }\n\n if ( ! $this->satisfiesJSONExtension()) {\n throw IncompatiblePlatformException::create(\n 'PHP extension json is not enabled. Please make sure to enable \"json\" in your PHP configuration.',\n IncompatiblePlatformException::INCOMPATIBLE_JSON_EXTENSION\n );\n }\n }", "protected function _checkTLSVersion()\n {\n $return = array(\n 'status' => false,\n 'error_message' => ''\n );\n if (defined('CURL_SSLVERSION_TLSv1_2')) {\n $tls_server = $this->context->link->getModuleLink($this->module->name, 'tlscurltestserver');\n $curl = curl_init($tls_server);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);\n $response = curl_exec($curl);\n if ($response != 'ok') {\n $return['status'] = false;\n $curl_info = curl_getinfo($curl);\n if ($curl_info['http_code'] == 401) {\n $return['error_message'] = $this->module->l('401 Unauthorized. Please note that the TLS verification can not be done if you have a htaccess password protection enabled on your website.', 'AdminPayPalController');\n } else {\n $return['error_message'] = curl_error($curl);\n }\n } else {\n $return['status'] = true;\n }\n } else {\n $return['status'] = false;\n if (version_compare(curl_version()['version'], '7.34.0', '<')) {\n $return['error_message'] = $this->module->l('You are using an old version of cURL. Please update your cURL extension to version 7.34.0 or higher.', 'AdminPayPalController');\n } else {\n $return['error_message'] = $this->module->l('TLS version is not compatible', 'AdminPayPalController');\n }\n }\n return $return;\n }", "function version_check($vercheck)\n {\n $minver = str_replace(\".\",\"\", $vercheck);\n $curver = str_replace(\".\",\"\", phpversion());\n return ($curver >= $minver) ? TRUE : FALSE;\n }", "private function isOldVersion() {\r\n\t\treturn $this->getRequest ()->getParam ( \"oldversion\", null ) == 1;\r\n\t}", "public function get_protocol_version(): string {\n return $this->protocol_version ?? '1.1';\n }", "static public function compatible()\n {\n \treturn TRUE;\n \n //retezec popisujici prohlizec uzivatele\n $user_agent = arr::get($_SERVER, 'HTTP_USER_AGENT', '');\n\n //prohlizece safara, chrome, firefox a operu podporujeme ve vsech verzich\n if (preg_match('#applewebkit|BrowserKit|safari|chrome|firefox|opera|MSIE 7|MSIE 8|MSIE 9#i', $user_agent) == TRUE)\n {\n return TRUE;\n }\n\n return FALSE;\n }", "private function validateVersion()\n {\n return preg_match('/[0-99]+\\.[0-99]+\\.[0-99]+.*/', $this->version);\n }", "public function getCompatibility ()\r\n {\r\n return $this->_compatibility;\r\n }", "public function compatVersionConditionMatchesSameRelease() {}", "public function compatVersionConditionMatchesSameRelease() {}", "private function get_version(&$request) {\n $version = $request->get_parameter(\"oauth_version\");\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "public function sslGetProtocol(): string {}", "private function checkSameSiteNoneCompatible()\n {\n $compatible = false;\n\n $this->agent = new Agent();\n\n try {\n $browser = $this->getBrowserDetails();\n $platform = $this->getPlatformDetails();\n\n if ($this->agent->is('Chrome') && $browser['major'] >= 67) {\n $compatible = true;\n }\n\n if ($this->agent->is('iOS') && $platform['major'] > 12) {\n $compatible = true;\n }\n\n if ($this->agent->is('OS X') &&\n ($this->agent->is('Safari') && !$this->agent->is('iOS')) &&\n $platform['float'] > 10.14\n ) {\n $compatible = true;\n }\n\n if ($this->agent->is('UCBrowser') &&\n $browser['float'] > 12.13\n ) {\n $compatible = true;\n }\n\n return $compatible;\n } catch (\\Exception $e) {\n return false;\n }\n }", "function version_comparison($check_ver, $base_ver)\n{\n $ret = 0;\n\n // determine the parts of the version to compare to\n $base_tmp = split('\\.', $base_ver);\n $base = array();\n $base['major'] = $base_tmp[0] != '' ? $base_tmp[0]:0;\n $base['minor'] = $base_tmp[1] != '' ? $base_tmp[1]:0;\n $base['patch'] = $base_tmp[2] != '' ? $base_tmp[2]:0;\n $base['build'] = $base_tmp[3] != '' ? $base_tmp[3]:0;\n\n // determine the parts of the version to check\n $check_tmp = split('\\.', $check_ver);\n $check = array();\n $check['major'] = $check_tmp[0] != '' ? $check_tmp[0]:0;\n $check['minor'] = $check_tmp[1] != '' ? $check_tmp[1]:0;\n $check['patch'] = $check_tmp[2] != '' ? $check_tmp[2]:0;\n $check['build'] = $check_tmp[3] != '' ? $check_tmp[3]:0;\n\n // loop through each part of the version number\n foreach ($base as $key => $val)\n {\n if ($check[$key] != $val)\n {\n // determine higher or lower and set return var\n if ($check[$key] > $val)\n {\n\n $ret = 1;\n }\n else\n {\n $ret = -1;\n }\n\n // and break out of loop\n break;\n }\n }\n\n // return the verdict\n return $ret;\n}", "public function version()\n {\n return $this->protocol;\n }", "public function min_php_version_check()\n {\n }", "public function getProtocolVersion()\n {\n return $this->wrapped->getProtocolVersion();\n }", "public function version($check = null);", "protected function checkWebsocProtocol($protocol) \n\t{\n\t\treturn true; // Override and return false if a protocol is not found that you would expect.\n\t}", "public function compatVersionConditionMatchesOlderRelease() {}", "public function compatVersionConditionMatchesOlderRelease() {}", "function IsOldVersion()\n{\n $i_too_old = 3; // version 3 PHP is not usable here\n $a_modern = array(4,1,0); // versions prior to this are \"old\" - \"4.1.0\"\n\n $a_this_version = explode(\".\",phpversion());\n\n if ((int) $a_this_version[0] <= $i_too_old)\n die(\"This script requires at least PHP version 4. Sorry.\");\n $i_this_num = ($a_this_version[0] * 10000) +\n ($a_this_version[1] * 100) +\n $a_this_version[2];\n $i_modern_num = ($a_modern[0] * 10000) +\n ($a_modern[1] * 100) +\n $a_modern[2];\n return ($i_this_num < $i_modern_num);\n}", "protected function checkPhpVersion() {}", "public function checkOpenSSL()\n {\n return (bool) (OPENSSL_VERSION_NUMBER < 0x009080bf);\n }", "public function getProtocolVersion(): string\n\t{\n\t\treturn $this->protocolVersion ?? '1.1';\n\t}", "public function check_version() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tif ( is_plugin_active( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) ) ) {\n\t\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice' ) );\n\t\t\t\tif ( isset( $_GET['activate'] ) ) {\n\t\t\t\t\tunset( $_GET['activate'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( self::old_version() ) {\n\t\t\tdeactivate_plugins( 'woocommerce-tm-custom-price-fields/tm-woo-custom-prices.php' );\n\t\t\tadd_action( 'admin_notices', array( $this, 'deprecated_notice' ) );\n\t\t}\n\n\t\tif ( ! self::woocommerce_check() ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice_woocommerce_check' ) );\n\t\t}\n\n\t}", "public function getProtocolVersion()\r\n {\r\n return $this->protocolVersion;\r\n }", "public function getProtocolVersion()\r\n {\r\n // TODO: Implement getProtocolVersion() method.\r\n }", "public function getProtocolVersion()\n {\n return $this->protocolVersion;\n }", "public function php_version_satisfies_requirements()\n {\n $this->assertFalse(\n version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<'),\n 'PHP version ' . self::MIN_PHP_VERSION . ' or greater is required but only '\n . PHP_VERSION . ' found.'\n );\n }", "private function canSafelyUseHttp2()\n {\n // Versions of curl older than 7.60.0 don't respect GOAWAY frames\n // (cf. https://github.com/curl/curl/issues/2416), which bSecure use.\n $curlVersion = \\curl_version()['version'];\n\n return \\version_compare($curlVersion, '7.60.0') >= 0;\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}", "private static function _checkProjectVersion() {\n $composer_openfed = json_decode(file_get_contents('composer.openfed.json'), TRUE);\n $current_version = $composer_openfed['require']['openfed/openfed8'];\n preg_match('/(?:[\\d+\\.?]+[a-zA-Z0-9-]*)/', $current_version, $matches);\n // If current version is dev, we should ignore version check.\n if (strpos($current_version, 'dev') !== FALSE) {\n return FALSE;\n }\n\n return version_compare($matches[0], '10.0', '>=');\n }", "public function checkRequiredVersion() {\n if (version_compare(PHP_VERSION, '4.3.2', '>=')) {\n return TRUE;\n }\n $this->logMsg(\n MSG_ERROR,\n PAPAYA_LOGTYPE_MODULES,\n 'Could not get HTML Purifier instance because this PHP version is too old.'\n );\n return FALSE;\n }", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "protected function http_version()\n {\n }", "public static function compatibility() {\n\t\t\treturn self::$compatibility;\n\t\t}", "public static function getFromRequest() {\n // there is no suitable PARAM_XXX flag in Moodle to clean this parameter but\n // don't worry it will be split and parsed as two int and it's never used in raw form\n $param = @$_GET['protoVersion'];\n if ($param && !empty($param))\n return new amvonetroom_Version($param);\n\n return amvonetroom_ProtoVersion::getDefault();\n }", "public function defaultProtocolVersion()\n {\n $this->assertEquals(3, $this->ldap->bind()->getOption(LDAP_OPT_PROTOCOL_VERSION));\n }", "function getCompatibilityLevel()\n {\n return $this->_props['CompatibilityLevel'];\n }", "public function getProtocolVersion()\n {\n // TODO: Implement getProtocolVersion() method.\n }", "function findProtocol()\n{\n $protocol = \"http://\";\n\n if (isset($_SERVER[\"SERVER_PORT\"]) && $_SERVER[\"SERVER_PORT\"] == 443) {\n $protocol = \"https://\";\n }\n\n return $protocol;\n}", "function check_php_version () {\n\t$testSplit = explode ('.', '4.3.0');\n\t$currentSplit = explode ('.', phpversion());\n\n\tif ($testSplit[0] < $currentSplit[0])\n\t\treturn True;\n\tif ($testSplit[0] == $currentSplit[0]) {\n\t\tif ($testSplit[1] < $currentSplit[1])\n\t\t\treturn True;\n\t\tif ($testSplit[1] == $currentSplit[1]) {\n\t\t\tif ($testSplit[2] <= $currentSplit[2])\n\t\t\t\treturn True;\n\t\t}\n\t}\n\treturn False;\n}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "protected static function _checkApiCompatibility(){\n\t\t$versions = static::$__compatibleApiVersions;\n\t\tif (!\\array_key_exists(\\Facebook::VERSION, $versions)){\n\t\t\tthrow new Exception('Facebook Library is not compatible to our library');\n\t\t}\n\t}", "public function check_requirements() {\n global $wp_version;\n\n $installed_php_version = phpversion();\n $installed_wp_version = $wp_version;\n $required_php_version = '5.2.4';\n $required_wp_version = '3.5.2';\n $installed_php_is_compatible = version_compare( $installed_php_version, $required_php_version, '>=' );\n $installed_wp_is_compatible = version_compare( $installed_wp_version, $required_wp_version, '>=' );\n\n $notices = array();\n $template = __( '<p>LaterPay: Your server <strong>does not</strong> meet the minimum requirement of %s version %s or higher. You are running %s version %s.</p>', 'laterpay' );\n\n // check PHP compatibility\n if ( ! $installed_php_is_compatible ) {\n $notices[] = sprintf( $template, 'PHP', $required_php_version, 'PHP', $installed_php_version );\n }\n\n // check WordPress compatibility\n if ( ! $installed_wp_is_compatible ) {\n $notices[] = sprintf( $template, 'Wordpress', $required_wp_version, 'Wordpress', $installed_wp_version );\n }\n\n // deactivate plugin, if requirements are not fulfilled\n if ( count( $notices ) > 0 ) {\n // suppress 'Plugin activated' notice\n unset( $_GET['activate'] );\n deactivate_plugins( $this->config->plugin_base_name );\n $notices[] = __( 'The LaterPay plugin could not be installed. Please fix the reported issues and try again.', 'laterpay' );\n }\n\n return $notices;\n }", "function version_check()\n{\n\t$fp = @fsockopen(\"www.68kb.com\", 80, $errno, $errstr, 30);\n\t\n\t$return = '';\n\t\n\tif ( ! $fp) \n\t{\n\t echo \"$errstr ($errno)<br />\\n\";\n\t} \n\telse \n\t{\n\t $out = \"GET /downloads/latest/version.txt HTTP/1.1\\r\\n\";\n\t $out .= \"Host: www.68kb.com\\r\\n\";\n\t $out .= \"Connection: Close\\r\\n\\r\\n\";\n\n\t fwrite($fp, $out);\n\t\n\t while ( ! feof($fp)) \n\t {\n\t $return .= fgets($fp, 128);\n\t }\n\t\n\t\t// Get rid of HTTP headers\n\t\t$content = explode(\"\\r\\n\\r\\n\", $return);\n\t\t$content = explode($content[0], $return);\n\n\t\t// Assign version to var\n\t\t$version = trim($content[1]);\n\t\t\n\t fclose($fp);\n\t\n\t\treturn $version;\n\t}\n}", "protected function check_update() {\n\n\t\t$response = $this->remote_query();\n\n\t\tif ( ! $response ) {\n\t\t\treturn array( 'version' => false );\n\t\t}\n\n\t\tif ( version_compare( $this->api['version'], $response->version, '<' ) ) {\n\t\t\treturn array(\n\t\t\t\t'version' => $response->version,\n\t\t\t\t'package' => $response->package,\n\t\t\t);\n\t\t}\n\n\t\treturn array( 'version' => false );\n\n\t}", "public function protocolVersion(): string\n {\n return $this->protocolVersion;\n }", "function tidypics_is_upgrade_available() {\n\t// sets $version based on code\n\trequire_once elgg_get_plugins_path() . \"tidypics/version.php\";\n\n\t$local_version = elgg_get_plugin_setting('version', 'tidypics');\n\tif ($local_version === false) {\n\t\t// no version set so either new install or really old one\n\t\tif (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) {\n\t\t\t$local_version = 0;\n\t\t} else {\n\t\t\t// set initial version for new install\n\t\t\telgg_set_plugin_setting('version', $version, 'tidypics');\n\t\t\t$local_version = $version;\n\t\t}\n\t} elseif ($local_version === '1.62') {\n\t\t// special work around to handle old upgrade system\n\t\t$local_version = 2010010101;\n\t\telgg_set_plugin_setting('version', $local_version, 'tidypics');\n\t}\n\n\tif ($local_version == $version) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function get_host_status($host_data)\n{\n global $API_version;\n global $CGM_version;\n\n $arr = array ('command'=>'version','parameter'=>'');\n $version_arr = send_request_to_host($arr, $host_data);\n\n if ($version_arr)\n {\n if ($version_arr['STATUS'][0]['STATUS'] == 'S')\n {\n $API_version = $version_arr['VERSION'][0]['API'];\n $CGM_version = $version_arr['VERSION'][0]['CGMiner'];\n \n if ($API_version >= 1.0)\n return true;\n }\n }\n return false;\n}", "public function getCompatibilityMode() {}", "public function setMinProtoVersion(int $proto): bool {}", "private function compatibility_check_for_ios() {\n $reges = '/ip(?:hone|[ao]d); cpu os \\K[\\d_]+/i';\n preg_match($reges, $_SERVER['HTTP_USER_AGENT'], $matches, PREG_OFFSET_CAPTURE, 0);\n\n if (empty($matches))\n return true;\n\n $ios_version = $matches[0][0];\n $ios_version = (int)explode('_', $ios_version)[0];\n\n if ($ios_version === 0)\n return true;\n\n return $ios_version > 9;\n }", "public function hasPatchversion(){\n return $this->_has(40);\n }", "protected function _fcpoCheckUserAgent() \n {\n $oUtils = $this->_oFcpoHelper->fcpoGetUtilsServer();\n\n $sAgent = $oUtils->getServerVar('HTTP_USER_AGENT');\n $sExistingAgent = $this->_oFcpoHelper->fcpoGetSessionVariable('sessionagent');\n $sAgent = $this->_fcProcessUserAgentInfo($sAgent);\n $sExistingAgent = $this->_fcProcessUserAgentInfo($sExistingAgent);\n\n if ($this->_fcGetCurrentVersion() >= 4310 && $sAgent && $sAgent !== $sExistingAgent) {\n $oSession = $this->_oFcpoHelper->fcpoGetSession();\n $sInputToken = $this->_oFcpoHelper->fcpoGetRequestParameter('rtoken');\n $sToken = $oSession->getRemoteAccessToken(false);\n $blValid = $this->_fcpoValidateToken($sInputToken, $sToken);\n if ($blValid === true) {\n $this->_oFcpoHelper->fcpoGetSessionVariable(\"sessionagent\", $oUtils->getServerVar('HTTP_USER_AGENT'));\n }\n }\n }", "public function getVersion($re_check = false)\n {\n $ver = $this->isSupported('version');\n if (empty($ver) || $re_check) {\n $slot1 = '_vs_' . $this->server_url;\n $slot2 = '_vq_' . $this->server_url;\n $status = $this->slotCheck($slot1);\n if ($status === false) {\n $this->versionSendQuery();\n } elseif ($status && $re_check) {\n $this->eraseSlot($slot1);\n $this->eraseSlot($slot2);\n $this->versionSendQuery();\n }\n $this->slotWaitReady($slot1);\n $this->slotWaitReady($slot2);\n $ver = $this->isSupported('version');\n if (empty($ver)) {\n $ver = 'Unknown';\n $this->isSupported('version', false, $ver);\n }\n }\n return $ver;\n }", "protected function getCompatibility6Status() {}", "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 function getProtocol()\n {\n $protocol = $this->serverAttributes()['SERVER_PROTOCOL'];\n\n if (!$protocol) {\n return false;\n }\n\n return $protocol;\n }", "public function isPhpVersionSupported()\n {\n $app = App::instance();\n $php_value = phpversion();\n $php_error = (version_compare($php_value, App::REQUIRED_PHP_VERSION) != -1) ? false : true;\n $checking_result = ($php_error == false) ? true : false;\n\n if (!$checking_result) {\n $app->setNotification('E', App::instance()->t('error'), $app->t('text_php_version_notice', array('version', App::REQUIRED_PHP_VERSION)), true, 'validator');\n }\n\n return $checking_result;\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}", "public function getProtocolVersion(): string\n {\n return $this->protocolVersion;\n }", "public function does_support( $version ) {\n\t\treturn version_compare( $this->get_current_version(), $version, 'ge' );\n\t}", "public function getProtocolVersion(): string {\n return $this->protocolVersion;\n }", "private function getVersion(Request &$request)\n {\n $version = $request->getParameter('oauth_version');\n if (!$version) {\n // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.\n // Chapter 7.0 (\"Accessing Protected Ressources\")\n $version = '1.0';\n }\n if ($version !== $this->version) {\n throw new OAuthException(\"OAuth version '$version' not supported\");\n }\n return $version;\n }", "protected function checkPHPVersion()\n {\n // Init\n $current = ( false === strpos( phpversion(), '-' ) ? phpversion() : substr( phpversion(), 0, strpos( phpversion(), '-' ) ) );\n $required = '5.3.10';\n \n if( 0 > strnatcmp( $current, $required ) )\n {\n throw new Exception( sprintf( 'NNScripts'. PHP_EOL .'Error: PHP version %s is required but version %s is found.', $required, $current ) );\n }\n }", "public function isAllowed()\n {\n return version_compare($this->metadata->getVersion(), '2.3.0', '<');\n }", "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}" ]
[ "0.6421515", "0.64097184", "0.6248191", "0.62018716", "0.6170367", "0.6107512", "0.6091714", "0.6089244", "0.6046947", "0.60134834", "0.60111284", "0.59792584", "0.5924806", "0.5901813", "0.5901513", "0.58950216", "0.58864415", "0.58789337", "0.58784485", "0.5869566", "0.5839118", "0.58298135", "0.58298135", "0.5775151", "0.57381076", "0.5709061", "0.570165", "0.56857103", "0.5641503", "0.5622887", "0.5619469", "0.5612472", "0.559729", "0.55880183", "0.5573833", "0.55693346", "0.55065274", "0.5502937", "0.54934233", "0.5492801", "0.5480202", "0.5475591", "0.5468401", "0.5441485", "0.5439607", "0.54343563", "0.5430325", "0.542043", "0.5418922", "0.5415853", "0.541581", "0.5415769", "0.54069257", "0.53864264", "0.53671724", "0.5360556", "0.5359782", "0.535201", "0.5337594", "0.5334884", "0.53307295", "0.5330026", "0.5326142", "0.53171897", "0.53164613", "0.5315846", "0.5314734", "0.5282612", "0.52755916", "0.5270452", "0.52693063", "0.52680475", "0.52616197", "0.5258167", "0.525722", "0.5253927", "0.52498233", "0.5245629", "0.5231742", "0.5230402", "0.5228485", "0.5227177", "0.52245474", "0.52217895", "0.52214205", "0.5204091", "0.51971734", "0.51935357", "0.51804596", "0.51798993", "0.5178169", "0.5175159", "0.5164128", "0.51631516", "0.5158756", "0.51535374", "0.51501286", "0.51399326", "0.51364136", "0.51357824" ]
0.65318626
0
Returns a current version of the plugin.
public static function getCurrent() { global $CFG; if ($data = file_get_contents("$CFG->dirroot/mod/amvonetroom/revision")) return new amvonetroom_Version($data); else return new amvonetroom_Version(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCurrentVersion();", "static function get_plugin_version() {\n\t\t$plugin_data = get_file_data(__FILE__, array('version' => 'Version'), 'plugin');\n\t\tself::$version = $plugin_data['version'];\n\t\treturn $plugin_data['version'];\n\t}", "private function getLocalVersion()\n {\n $plugin_data = get_plugin_data($this->plugin_file, false);\n return $plugin_data['Version'];\n }", "protected abstract function getPluginVersion();", "public function get_plugin_version() {\n\t\treturn $this->plugin_version;\n\t}", "public function get_plugin_version() {\n\t\treturn $this->plugin_version;\n\t}", "function GetVersion() {\n\t\t\tif(!function_exists('get_plugin_data')) {\n\t\t\t\tif(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+\n\t\t\t\telse if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1\n\t\t\t\telse return \"0.ERROR\";\n\t\t\t}\n\t\t\t$data = get_plugin_data(__FILE__);\n\t\t\treturn $data['Version'];\n\t\t}", "public function get_version();", "function get_version() {\n\n\t\treturn $this->version;\n\n\t}", "function dynamo_support_get_plugin_version() {\n if ( ! function_exists( 'get_plugins' ) )\n require_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n $plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) );\n $plugin_file = basename( ( __FILE__ ) );\n return $plugin_folder[$plugin_file]['Version'];\n }", "function myplugin_installed_version() {\n\n\treturn get_option( MYPLUGIN_NAME ); // returns the version number of this plugin that the current stored data is registered to.\n}", "function &getCurrentVersion() {\n\t\treturn $this->currentVersion;\n\t}", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true);\n\n if ($info) {\n return $info['currentVersion'];\n } else {\n throw new Exception('The plugin has an invalid version file.');\n }\n }", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true);\n\n if ($info) {\n return $info['currentVersion'];\n } else {\n throw new Exception('The plugin has an invalid version file.');\n }\n }", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . '/plugin.json'), true);\n if ($info) {\n return $info['currentVersion'];\n }\n throw new RuntimeException('The plugin has an invalid version file.');\n }", "public static function get_version() {\n return self::$version;\n }", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version()\n {\n return $this->version;\n }", "public function get_version()\n {\n return $this->version;\n }", "public function get_version() { \n\n\t\treturn $this->version; \n\n\t}", "function get_version() {\n return self::VERSION;\n }", "function get_version() {\n return self::VERSION;\n }", "public function get_version() {\n return $this->version;\n }", "function GetVersion()\n {\n return '1.0';\n }", "public function getVersion()\n {\n return $this->get(self::_VERSION);\n }", "public static function get_version() {\n\t\tif (is_null(static::$version)) {\n\t\t\t$plugin_data = get_plugin_data(BLOBMIMES_INDEX, false, false);\n\t\t\tif (isset($plugin_data['Version'])) {\n\t\t\t\tstatic::$version = $plugin_data['Version'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstatic::$version = '0.0';\n\t\t\t}\n\t\t}\n\n\t\treturn static::$version;\n\t}", "public function get_version()\n\t{\n\t\treturn $this->version;\n\t}", "public function get_version(): string\n {\n return $this->version;\n }", "public function retrieveVersion()\n {\n return $this->start()->uri(\"/api/system/version\")\n ->get()\n ->go();\n }", "public function getVersion()\n {\n return $this->get(self::VERSION);\n }", "public static final function getCurrentVersion() : Version\n {\n return new Version(self::VERSION);\n }", "public function getVersion()\n {\n return $version;\n }", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true);\n\n if ($info) {\n return $info['currentVersion'];\n }\n throw new \\Exception('The plugin has an invalid version file.');\n }", "public static function version()\r\n {\r\n return self::$version;\r\n }", "public function getVersion(): string;", "public function getVersion(): string;", "public static function get_current_version() {\n\t\t// $db = JFactory::getDbo();\n\t\t// $db->setQuery('SELECT manifest_cache FROM #__extensions WHERE element = \"mod_slideshowck\"');\n\t\t// $manifest = json_decode($db->loadResult(), true);\n\t\t// $installed_version = $manifest['version'];\n\t\t\n\t\t// get the version installed\n\t\t$installed_version = 'UNKOWN';\n\t\t$file_url = JPATH_SITE .'/modules/mod_slideshowck/mod_slideshowck.xml';\n\t\tif ($xml_installed = JFactory::getXML($file_url)) {\n\t\t\t$installed_version = (string)$xml_installed->version;\n\t\t}\n\n\t\treturn $installed_version;\n\t}", "public function getVersion() {\n\t\tif($this->version == \"\")\n\t\t$this->version = \"0.0.0\";\n\t\treturn $this->version;\n\t}", "public function getVersion(){\n $client = Yii::$app->infoServices;\n return $client->getVersion()->return->version;\n }", "public function get_version(){\n return $this->_version;\n }", "protected function mm_current_version() {\n $options = $this->options;\n if($options['version'] == MM_PLUGIN_VER)\n return true;\n }", "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();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function get_test_plugin_version()\n {\n }", "public function getVersion(){\n\t\treturn $this->version;\n\t}", "public function latest_version();", "public function getVersion()\n {/*{{{*/\n return $this->_version;\n }", "public function version()\n {\n $plugin = new Plugin('PerformanceAudit');\n\n return $this->renderTemplate('version', [\n 'pluginVersion' => $plugin->getVersion(),\n 'pluginName' => $plugin->getPluginName()\n ]);\n }", "function getCurrentVersion() {\n return json_decode(file_get_contents(storage_path('app/version.json')), true);\n}", "public function getVersion()\n {\n return $this->sendrequest('version', null);\n }", "function getVersion ()\n {\n return $this->_version;\n }", "public static function getVersion()\n\t{\n\t\treturn self::$_version;\n\t}", "public function getVersion() {\n\t\treturn $this->version;\n\t}", "public function getVersion() {\n\t\treturn self::$version;\n\t}", "public static function getVersion()\n\t{\n\t\t$db = Factory::getDBO();\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select(array('*'));\n\t\t$query->from($db->quoteName('#__extensions'));\n\n\t\t$query->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))\n\t\t\t->where($db->quoteName('element') . ' = ' . $db->quote('helixultimate'))\n\t\t\t->where($db->quoteName('folder') . ' = ' . $db->quote('system'));\n\n\t\t$db->setQuery($query);\n\t\t$result = $db->loadObject();\n\n\t\t$manifest_cache = json_decode($result->manifest_cache ?? \"\");\n\n\t\tif (isset($manifest_cache->version))\n\t\t{\n\t\t\treturn $manifest_cache->version;\n\t\t}\n\n\t\treturn;\n\t}", "function currentVersion() {\n if($this->current_version === false) {\n $this->current_version = DB::executeFirstCell('SELECT version FROM ' . TABLE_PREFIX . 'update_history ORDER BY created_on DESC LIMIT 0, 1');\n if(empty($this->current_version)) {\n $this->current_version = '1.0';\n } // if\n \t \n \t // activeCollab 2.0.2 failed to record proper version into update \n \t // history so we need to manually check if we have 2.0.2. This is done \n \t // by checking if acx_attachments table exists (introduced in aC 2).\n \t if((version_compare($this->current_version, '2.0') < 0) && DB::tableExists(TABLE_PREFIX . 'attachments')) {\n \t $this->current_version = '2.0.2';\n \t } // if\n } // if\n return $this->current_version;\n }", "abstract public function get_version();", "public function getVersion(): string {}", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }" ]
[ "0.7989453", "0.7961599", "0.78250456", "0.77458227", "0.7729827", "0.7729827", "0.758653", "0.7570084", "0.752616", "0.7488087", "0.7472138", "0.7471158", "0.7395239", "0.7395239", "0.73888165", "0.73291594", "0.7302229", "0.7302229", "0.7302229", "0.7302229", "0.7302229", "0.7302229", "0.7302229", "0.7302229", "0.7302229", "0.7302229", "0.7290829", "0.7290829", "0.72715336", "0.72641116", "0.72641116", "0.7257897", "0.72537786", "0.72355074", "0.72317314", "0.7203652", "0.71880716", "0.7171206", "0.7166594", "0.71601105", "0.71454155", "0.7119494", "0.71145964", "0.71070045", "0.71070045", "0.70961547", "0.70901", "0.70867735", "0.707902", "0.7061267", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.7059648", "0.705943", "0.70563966", "0.7040205", "0.70221764", "0.70208526", "0.70131004", "0.70118874", "0.70040816", "0.69978696", "0.6996558", "0.69800115", "0.6976687", "0.69709754", "0.6964711", "0.696219", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803", "0.6956803" ]
0.70797575
48
Display a listing of the resource.
public function index() { $links = Link::all(); return view('admin.links.index',compact('links')); }
{ "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() { $resources = Material::all(); return view('admin.links.create',compact('resources')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request,[ 'url'=>'required' ]); $material = Material::findOrFail($request->get("resource")); $link = new Link($request->only('url')); $link->material()->associate($material); $link->save(); return redirect()->route('link')->with('message','Record Created !!!!'); }
{ "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) { $link = Link::findOrFail($id); return view('admin.links.show',compact('link')); }
{ "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) { $resources = Material::all(); $link = Link::with('material')->findOrFail($id); return view('admin.links.edit',compact('link','resources')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $this->validate($request,[ 'url'=>'required' ]); $material = Material::findOrFail($request->get("resource")); $link = Link::findOrFail($id); $link->fill($request->only('url')); $link->material()->associate($material); $link->save(); return redirect()->route('link')->with('message','Record Saved !!!!'); }
{ "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) { $link= Link::findOrFail($id); $link->delete(); return redirect()->route('link')->with('message','Record Deleted !!!!'); }
{ "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
echo "This is a MAJOR update please be patient while database updates are running...";
function update_main( $table, $objGeoIP ) { global $wpdb; //Modify each record to include country based on IP $q2 = "SELECT id, user_id FROM `" . $table . "` WHERE country_code IS NULL LIMIT 1000"; $r2 = $wpdb->query( $q2 ); $changed = false; while ( $a2 = $wpdb->fetchNextAssoc( $r2 ) ) { $changed = true; $country = "not found"; $country_code = null; $ip = explode( "~", $a2['user_id'], 2 ); $objGeoIP->search_ip( $ip[0] ); if ( $objGeoIP->found() ) { $country = $objGeoIP->getCountryName(); $country_code = $objGeoIP->getCountryCode(); $objGeoIP->clear(); } $country = HMTrackerFN::hmtracker_secure( $country ); $country_code = HMTrackerFN::hmtracker_secure( $country_code ); $q3 = "UPDATE $table SET country = '$country', country_code = '$country_code' WHERE id = {$a2['id']}"; $wpdb->query( $q3 ); if ( $error = $wpdb->last_error() ) { die( $error ); } } return $changed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upgrade_echo($message)\n{\n echo $message;\n // Flush the message, so that there's some progress information\n // output to the browser even when the upgrade is taking a while\n if (ob_get_length() !== FALSE)\n {\n ob_flush();\n }\n flush();\n}", "final function what_is_good() {\n\t\t\techo \"Running is Good </br>\";\n\t\t}", "function update_right_now_message()\n {\n }", "function foxhound_upgrade_notice() {\n\t$message = __( 'Foxhound requires WordPress 4.9 or higher. Please update your site and try again.', 'foxhound' );\n\tprintf( '<div class=\"error\"><p>%s</p></div>', $message ); /* WPCS: xss ok. */\n}", "public function action_update_check()\n\t{\n\t\tUpdate::add('Ohloh Badge', '42aaa113-4285-42ef-a811-3eb4281cee7c', $this->info->version);\n\t}", "public function showUpdateNotification(){\n\t\techo $this->getUpdateNotification();\n\t}", "public static function displayUpdate() {\n\n\t\t\tself::display('Main/Status/Update', 'STATUS_TITLE_UPDATE', STATUS_CODE_503);\n\t\t}", "final function whatIsGood() {\n echo \"Running is good <br>\";\n }", "public function runUpdateScript()\n {\n $current_schema = get_config('schema');\n if ($current_schema < 2) {\n // 20150727\n $this->schema2();\n $this->updateSchema(2);\n }\n if ($current_schema < 3) {\n // 20150728\n $this->schema3();\n $this->updateSchema(3);\n }\n if ($current_schema < 4) {\n // 20150801\n $this->schema4();\n $this->updateSchema(4);\n }\n if ($current_schema < 5) {\n // 20150803\n try {\n $this->schema5();\n } catch (Exception $e) {\n die($e->getMessage());\n }\n $this->updateSchema(5);\n }\n // place new schema functions above this comment\n $this->cleanTmp();\n $msg_arr = array();\n $msg_arr[] = \"[SUCCESS] You are now running the latest version of eLabFTW. Have a great day! :)\";\n return $msg_arr;\n }", "public function welcomInformations() {\n echo \"\\t\\t####################################\\t\\t\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t# \" . Utils::red(\"This is a Enterprise Backup Tool!\") . \"\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t####################################\\t\\t\\n\\n\";\n }", "function check_update( $_, $assoc_args ) {\n\t\tself::run( 'core check-update', $_, $assoc_args );\n\t}", "public function please_upgrade() {\n\t\t$this->infoAlert(\"Please Upgrade Message\");\n\t}", "function mysql_fatal_err()\n{\n echo <<<_END\n </br>OOPS !!!!!!\n </br>We are sorry, but it was not possible to complete\n </br>the requested task.\n </br>\n _END;\n}", "function signature(){\n\t\tglobal $GonxAdmin;\n\t\tif ($GonxAdmin[\"dbtype\"]==\"mysql\") {\n\t\t $q1 = \"SHOW VARIABLES LIKE 'version'\";\n\t\t\t$q2 = \"SHOW STATUS LIKE 'Questions'\";\n\t\t\t$q3 = \"SHOW STATUS LIKE 'Uptime'\";\n\t\t\tif (!is_resource($this->Link_ID)) {\n\t\t\t return FALSE;\n\t\t\t}\n\t\t\t$qres = $this->query($q3);\n\t\t\tlist($n,$uptime) = $this->fetch_array($qres);\n\t\t\t$qres = $this->query($q2);\n\t\t\tlist($n,$queries) = $this->fetch_array($qres);\n\t\t\t$qres = $this->query($q1);\n\t\t\tlist($n,$version) = $this->fetch_array($qres);\n\t\t\t\n\t\t\t$qpersecond = number_format(($queries/$uptime), 4 );\n\t\t\t$uptime = (integer)($uptime/(60 * 60 * 24));\n\t\t\t\n\t\t\t$Message = \"\\n<br/><br/>MySQL Version <b>$version</b>, Uptime = <b>$uptime day(s)</b> and running <b>$queries queries</b> (<b>$qpersecond q/s</b>)<br/>\\n\";\n\t\t\treturn $Message;\n\t\t}\n\t}", "function ayecode_show_update_plugin_requirement() {\n if ( !defined( 'WP_EASY_UPDATES_ACTIVE' ) ) {\n ?>\n <div class=\"notice notice-warning is-dismissible\">\n <p>\n <strong>\n <?php\n echo sprintf( __( 'The plugin %sWP Easy Updates%s is required to check for and update some installed plugins/themes, please install it now.', 'geodirectory' ), '<a href=\"https://wpeasyupdates.com/\" target=\"_blank\" title=\"WP Easy Updates\">', '</a>' );\n ?>\n </strong>\n </p>\n </div>\n <?php\n }\n }", "function version_update_notice() {\n\t\tif( isset( $this->addons[$this->plugin_basename] ) && true == $this->is_addon_outdated( $this->plugin_basename ) ) return;\n\t\t// To reduce UI clutter we hide addon update notices if the core plugin has updates available\n\t\tif( isset( $this->addons[$this->plugin_basename] ) ) {\n\t\t\t$core_slug = 'wp-migrate-db-pro';\n\t\t\t$core_installed_version = $GLOBALS['wpmdb_meta'][$core_slug]['version'];\n\t\t\t$core_latest_version = $this->get_latest_version( $core_slug );\n\t\t\t// Core update is available, don't show update notices for addons until core is updated\n\t\t\tif ( version_compare( $core_installed_version, $core_latest_version, '<' ) ) return;\n\t\t}\n\n\t\t$update_url = wp_nonce_url( network_admin_url( 'update.php?action=upgrade-plugin&plugin=' . urlencode( $this->plugin_basename ) ), 'upgrade-plugin_' . $this->plugin_basename );\n\n\t\t// If pre-1.1.2 version of Media Files addon, don't bother getting the versions\n\t\tif ( !isset( $GLOBALS['wpmdb_meta'][$this->plugin_slug]['version'] ) ) {\n\t\t\t?>\n\t\t\t<div style=\"display: block;\" class=\"updated warning inline-message\">\n\t\t\t\t<strong>Update Available</strong> &mdash; \n\t\t\t\tA new version of <?php echo $this->plugin_title; ?> is now available. <a href=\"<?php echo $update_url; ?>\">Update Now</a>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\telse {\n\t\t\t$installed_version = $GLOBALS['wpmdb_meta'][$this->plugin_slug]['version'];\n\t\t\t$latest_version = $this->get_latest_version( $this->plugin_slug );\n\n\t\t\tif ( version_compare( $installed_version, $latest_version, '<' ) ) { ?>\n\t\t\t\t<div style=\"display: block;\" class=\"updated warning inline-message\">\n\t\t\t\t\t<strong>Update Available</strong> &mdash; \n\t\t\t\t\t<?php printf( '%s %s', $this->plugin_title, $latest_version ); ?> is now available. You currently have <?php echo $installed_version; ?> installed. <a href=\"<?php echo $update_url; ?>\">Update Now</a>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}", "static function run_database_update()\n {\n // get the code version\n $prot = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';\n $url = $prot.$_SERVER['HTTP_HOST'].'/api/config/init.sql';\n $codeVersion = config::get_init_sql_version($url);\n\n if (config::get_db_version() < '0.2.0') {\n return 'ERROR: Version '.$codeVersion.\n ' is not backwards compatible with version '.\n config::get_db_version().'.';\n }\n \n // loop through until we are up to date\n while (config::get_db_version() < $codeVersion) {\n // build the static function name\n $function = 'update::update_'.config::get_db_version();\n $function = str_replace('.', '_', $function);\n if ($error = call_user_func($function)) {\n return $error;\n }\n }\n \n // no errors\n return null;\n }", "function PKG_showPreviewUpdateSystem($clientName,$completeUpdate)\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n//write table header\n\techo (\"<br><br>\n\t\t<span class=\\\"title\\\">$I18N_updatePreview</span><br><br>\n\t\t\t<table class=\\\"subtable\\\" align=\\\"center\\\" border=0 cellspacing=5>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t\".PKG_previewUpdateSystem($clientName,$completeUpdate).\"\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\");\n}", "public function show_admin_notice_upgradead() {\n\t\t$this->include_template('wp-admin/notices/thanks-for-using-main-dash.php');\n\t}", "function update_failed($msg1, $msg2)\n{\n\techo \"$msg1<br />\\n\";\n\techo \"<span style=\\\"color:red;\\\">$msg2</span>\\n\";\n\techo \"</p>\\n\\n</div>\\n\\n</body>\\n\\n</html>\\n\";\n\texit(1);\n}", "public function print_admin_notice() {\n\t\tglobal $hook_suffix, $post_type;\n\n\t\t// Only need for certain screens.\n\t\tif ( ! in_array( $hook_suffix, [ 'edit.php', 'plugins.php' ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only for the schedule post type.\n\t\tif ( 'edit.php' == $hook_suffix && 'schedule' != $post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only for version < 4.7, when API was introduced.\n\t\t$version = get_bloginfo( 'version' );\n\t\tif ( $version >= 4.7 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Let us know if the REST API plugin, which we depend on, is not active.\n\t\tif ( ! is_plugin_active( 'WP-API/plugin.php' ) && ! is_plugin_active( 'rest-api/plugin.php' ) ) :\n\n\t\t\t?>\n <div class=\"updated notice\">\n <p><?php printf( __( 'The %1$s plugin depends on the %2$s plugin, version 2.0. %3$sPlease activate this plugin%4$s.', 'conf-schedule' ), 'Conference Schedule', 'REST API', '<a href=\"' . admin_url( 'plugins.php' ) . '\">', '</a>' ); ?></p>\n </div>\n\t\t<?php\n\n\t\tendif;\n\n\t}", "public function print_admin_notice() {\n\t\tglobal $hook_suffix, $post_type;\n\n\t\t// Only need for certain screens.\n\t\tif ( ! in_array( $hook_suffix, array( 'edit.php', 'plugins.php' ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only for the schedule post type.\n\t\tif ( 'edit.php' == $hook_suffix && 'schedule' != $post_type ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only for version < 4.7, when API was introduced.\n\t\t$version = get_bloginfo( 'version' );\n\t\tif ( $version >= 4.7 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Let us know if the REST API plugin, which we depend on, is not active.\n\t\tif ( ! is_plugin_active( 'WP-API/plugin.php' ) && ! is_plugin_active( 'rest-api/plugin.php' ) ) :\n\n\t\t\t?>\n\t\t\t<div class=\"updated notice\">\n\t\t\t\t<p><?php _e( 'The Conference Schedule plugin depends on the REST API plugin, version 2.0. <a href=\"' . admin_url('plugins.php') . '\">Please activate this plugin</a>. ', 'conf-schedule' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\n\t\tendif;\n\n\t}", "function acx_widget_si_pluign_upgrade_not_finished()\r\n{\r\n echo '<div class=\"error\">\r\n\t\t <p><b>Thanks for updating Acurax Social Media Widget Plugin... You need to visit <a href=\"admin.php?page=Acurax-Social-Widget-Settings\">Plugin\\'s Settings Page</a> to Complete the Updating Process - <a href=\"admin.php?page=Acurax-Social-Widget-Settings\">Click Here Visit Social Icon Plugin Settings</a></b></p>\r\n\t\t </div>';\r\n}", "protected function doUpdate() {\n return '';\n }", "function envato_toolkit_admin_notices() {\n $message = sprintf( __( \"An update to the theme is available! Head over to %s to update it now.\", \"default\" ),\n \"<a href='\" . admin_url() . \"admin.php?page=envato-wordpress-toolkit'>Envato WordPress Toolkit Plugin</a>\" );\n echo \"<div id='message' class='updated below-h2'><p>{$message}</p></div>\";\n}", "function update($parent) \n {\n echo '<div class=\"alert alert-info\">';\n echo ' <p>' . JText::_('COM_ACTIVATEGRID_UPDATE_TEXT').' to the version: '.$parent->get('manifest')->version. '</p>';\n echo '</div>';\n }", "public function admin_notices() {\n\t\t\t$notices = wct_get_global( 'feedback' );\n\n\t\t\tif ( empty( $notices['admin_notices'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"update-nag\">\n\t\t\t\t<?php foreach ( $notices['admin_notices'] as $notice ) : ?>\n\t\t\t\t\t<p><?php echo $notice; ?></p>\n\t\t\t\t<?php endforeach ;?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "function theme_upgrade_notice()\n{\n global $theme_compatibility_message;\n\n printf( '<div class=\"error\"><p>%s</p></div>', $message );\n}", "function checkForUpdate() {\n $cache_data = Terminus::getCache()->getData(\n 'latest_release',\n array('decode_array' => true)\n );\n if (!$cache_data\n || ((int)$cache_data['check_date'] < (int)strtotime('-7 days'))\n ) {\n $logger = Terminus::getLogger();\n try {\n $current_version = checkCurrentVersion();\n if (version_compare($current_version, TERMINUS_VERSION, '>')) {\n $logger->info(\n 'An update to Terminus is available. Please update to {version}.',\n array('version' => $current_version)\n );\n }\n } catch (\\Exception $e) {\n $logger->info($e->getMessage());\n $logger->info('Cannot retrieve current Terminus version.');\n }\n }\n}", "function maintenance_message( ){\n\t$message = single( 'select value from ' . DB_OPTIONS . ' where category=\"configuration_page_options\" and name=\"maintenance_message\"', 'value' );\n\tif( empty( $message ) ){\n\t\tglobal $SETTINGS;\n\t\t$message = $SETTINGS[ 'site_title' ] . ' is currently undergoing maintenance. Please try again later.';\n\t}\n\terror( $message, '' );\n}", "public function winespace_welcome_admin_notice() {\n\t\t?>\n\t\t\t<div class=\"updated notice is-dismissible\">\n\t\t\t\t<p><?php echo sprintf( esc_html__( 'Thanks for choosing winespace! You can read hints and tips on how get the most out of your new theme on the %swelcome screen%s.', 'winespace' ), '<a href=\"' . esc_url( admin_url( 'themes.php?page=winespace-welcome' ) ) . '\">', '</a>' ); ?></p>\n\t\t\t\t<p><a href=\"<?php echo esc_url( admin_url( 'themes.php?page=winespace-welcome' ) ); ?>\" class=\"button\" style=\"text-decoration: none;\"><?php _e( 'Get started with winespace', 'winespace' ); ?></a></p>\n\t\t\t</div>\n\t\t<?php\n\t}", "function update_info_page() {\n _drupal_flush_css_js();\n // Flush the cache of all data for the update status module.\n if (db_table_exists('cache_update')) {\n cache_clear_all('*', 'cache_update', TRUE);\n }\n\n update_task_list('info');\n drupal_set_title('Drupal database update');\n $token = drupal_get_token('update');\n $output = '<p>Use this utility to update your database whenever a new release of Drupal or a module is installed.</p><p>For more detailed information, see the <a href=\"http://drupal.org/node/258\">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>';\n $output .= \"<ol>\\n\";\n $output .= \"<li><strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.</li>\\n\";\n $output .= \"<li><strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.</li>\\n\";\n $output .= '<li>Put your site into <a href=\"'. base_path() .'?q=admin/settings/site-maintenance\">maintenance mode</a>.</li>'.\"\\n\";\n $output .= \"<li>Install your new files in the appropriate location, as described in the handbook.</li>\\n\";\n $output .= \"</ol>\\n\";\n $output .= \"<p>When you have performed the steps above, you may proceed.</p>\\n\";\n $output .= '<form method=\"post\" action=\"update.php?op=selection&amp;token='. $token .'\"><p><input type=\"submit\" value=\"Continue\" /></p></form>';\n $output .= \"\\n\";\n return $output;\n}", "public function updated_message() {\n\t\t$tab = Template::current_tab();\n\n\t\t// Show updated notice.\n\t\tadd_action( 'beehive_admin_top_notices', function () use ( $tab ) {\n\t\t\tswitch ( $tab ) {\n\t\t\t\tcase 'tracking':\n\t\t\t\t\t$this->notice( __( 'Tracking ID updated successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->notice( __( 'Changes were saved successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} );\n\t}", "public function get_message() {\t\t\t\t\t## displaying database message function starts\n\t\t\tif ( isset( $this->_update ) && $this->_update == '1' ) {\n\t\t\t\t$this->_msg = 'Settings Updated Successfully ...';\n\t\t\t} else if ( $this->_update == '0' ) {\n\t\t\t\t$this->_msg = 'Settings Not Updated Successfully ...';\n\t\t\t}\n\t\t\treturn $this->_msg;\n\t\t}", "function update_status($status) {\n\tglobal $pkg_interface;\n\n\tif ($pkg_interface == \"console\") {\n\t\tprint (\"{$status}\");\n\t}\n\n\t/* ensure that contents are written out */\n\tob_flush();\n}", "function logger_firmware_upgrade_approve($device) {\n\n db_update('logger_firmware_upgrade_request')\n ->fields(array(\n 'approved' => time()\n ))\n ->condition('device', $device)\n ->execute();\n\n drupal_set_message(t('The firmware of your device is going to be upgraded. Please, make sure it remains up and running during the next 2 hours.'), 'warning');\n\n drupal_goto(\"energy\");\n}", "public function showNotice() {\n\t\t// Translators: 1 - The plugin name (\"AIOSEO).\n\t\t$string1 = sprintf( __( '%1$s V3->V4 Migration In Progress', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME );\n\t\t// Translators: 1 - The plugin name (\"All in One SEO\").\n\t\t$string2 = sprintf( __( '%1$s is currently upgrading your database and migrating your SEO data in the background.', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_NAME );\n\t\t$string3 = __( 'This notice will automatically disappear as soon as the migration has completed. Meanwhile, everything should continue to work as expected.', 'all-in-one-seo-pack' );\n\t\t?>\n\t\t<div class=\"notice notice-info aioseo-migration\">\n\t\t\t<p><strong><?php echo esc_html( $string1 ); ?></strong></p>\n\t\t\t<p><?php echo esc_html( $string2 ); ?></p>\n\t\t\t<p><?php echo esc_html( $string3 ); ?></p>\n\t\t</div>\n\t\t<style>\n\t\t</style>\n\t\t<?php\n\t}", "function box_upgrade_info()\n\t{\n\t\tglobal $lang, $language;\n\t\tglobal $current_phpbb_version, $phpbb_version;\n\t\tglobal $current_ip_version, $ip_version;\n\n\t\techo('<br />' . \"\\n\");\n\t\t$phpbb_update = '';\n\t\tif ($current_phpbb_version == $phpbb_version)\n\t\t{\n\t\t\t//$box_message = $lang['phpBB_Version_UpToDate'];\n\t\t\t//$page_framework->box('green', 'green', $box_message);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$phpbb_update = '&amp;phpbb_update=true';\n\t\t\t// Comment \"Force phpBB update\" if you want to make all db updates all at once\n\t\t\t// Force phpBB update - BEGIN\n\t\t\t$box_message = $lang['phpBB_Version_NotUpToDate'] . '<br /><br />' . sprintf($lang['ClickUpdate'], '<a href=\"' . ip_functions::append_sid(THIS_FILE . '?mode=update_phpbb') . '\">', '</a>');\n\t\t\t$this->box('yellow', 'red', $box_message);\n\t\t\t$this->page_footer(false);\n\t\t\texit;\n\t\t\t// Force phpBB update - END\n\t\t}\n\t\t//echo('<br /><br />');\n\n\t\tif (($current_ip_version == $ip_version) && ($phpbb_update == ''))\n\t\t{\n\t\t\t$needs_update = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$needs_update = true;\n\t\t\t$phpbb_string = '';\n\t\t\tif ($phpbb_update != '')\n\t\t\t{\n\t\t\t\t$phpbb_string = $lang['phpBB_Version_NotUpToDate'] . '<br /><br />';\n\t\t\t}\n\n\t\t\t$ip_string = $lang['IcyPhoenix_Version_NotUpToDate'] . '<br /><br />';\n\t\t\tif ($current_ip_version == $lang['NotInstalled'])\n\t\t\t{\n\t\t\t\t$ip_string = $lang['IcyPhoenix_Version_NotInstalled'] . '<br /><br />';\n\t\t\t}\n\t\t}\n\n\t\tif ($needs_update == false)\n\t\t{\n\t\t\t$box_message = $lang['IcyPhoenix_Version_UpToDate'];\n\t\t\t$this->box('green', 'green', $box_message);\n\t\t}\n\t\telseif (($needs_update == true) && version_compare($current_ip_version, '1.2.9.36', '<') && !defined('IP_DB_UPDATE'))\n\t\t{\n\t\t\t$this->box_upgrade_steps();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$box_message = $phpbb_string . $ip_string . sprintf($lang['ClickUpdate'], '<a href=\"' . ip_functions::append_sid(THIS_FILE . '?mode=update' . $phpbb_update) . '\">', '</a>');\n\t\t\t$this->box('yellow', 'red', $box_message);\n\t\t}\n\t\techo('<br clear=\"all\" />' . \"\\n\");\n\t\techo('<br /><br />' . \"\\n\");\n\t}", "function mediahub_subtle_upgrade_notice() {\n\n\t// Only show if user has blocked upgrade notices\n\tif ( true != get_option( 'mediahub_no_upgrade_notice' ) ) {\n\t\treturn;\n\t}\n\n\t// Display the uprade notice\n\t?>\n\t<p>\n\t\t<a href=\"<?php echo esc_url( wp_nonce_url( admin_url('options-general.php?page=mediahub_api' ), 'mediahub_upgrade', 'mediahub_upgrade' ) ); ?>\">\n\t\t\tClick here to upgrade to the new version\n\t\t</a>\n\t</p><?php\n}", "protected function display_update_notices() {\n\t\t$updates = BC_Framework_Plugin_Browser_Dismissible_Notice::get( '_wp_sh_plugin_browser_available_updates', '' );\n\n\t\tif ( ! empty( $updates['new'] ) ) {\n\n\t\t\t$updates['dismissed'] = ! empty( $updates['dismissed'] ) ? $updates['dismissed'] : array();\n\n\t\t\t$slugs = array_diff_key( $updates['new'], $updates['dismissed'] );\n\n\t\t\tif ( $slugs ) {\n\t\t\t\t$slugs = esc_attr( implode( ',', $slugs ) );\n\n\t\t\t\t$msg = sprintf( __( 'Found <strong>%d plugin(s)</strong> update(s). Please review your installed plugins below.', 'wp-shp-browser' ), count( $updates['new'] ) );\n\t\t\t\tself::output_admin_notice( $msg, $slugs );\n\t\t\t}\n\n\t\t}\n \t}", "protected function update_1607080950()\n\t{\n\t\tglobal $wpdb;\n\t\t\n\t\trequire_once( ABSPATH .'wp-admin/install-helper.php' );\n\t\t\n\t\tmaybe_add_column( \n\t\t\t\"{$wpdb->wistify_queue}\",\n\t\t\t\"queue_errors\",\n\t\t\t\"ALTER TABLE {$wpdb->wistify_queue} ADD `queue_errors` LONGTEXT NULL DEFAULT NULL AFTER `queue_locked`;\" \n\t\t);\n\t\t\n\t\treturn __( 'Ajout d\\'une colonne de report des erreurs dans la file de mail', 'tify' );\n\t}", "public function custom_bulk_admin_notices() {\n\t\tglobal $post_type, $pagenow;\n\t\tif($pagenow == 'edit.php' && $post_type == 'post' && isset($_REQUEST['built']) && (int) $_REQUEST['built']) {\n\t\t\t$message = sprintf( _n( 'Post flat file built.', '%s post flat files built.', $_REQUEST['built'] ), number_format_i18n( $_REQUEST['built'] ) );\n\t\t\techo \"<div class=\\\"updated\\\"><p>{$message}</p></div>\";\n\t\t}\n\t}", "function _dbcr_admin_notice() {\n\t\t// Display error message\n\t\techo '<div id=\"notice\" class=\"error\"><p>';\n\t\tprintf( __('<b>DB Cache Reloaded Error:</b> cannot include <code>db-functions.php</code> file. Please either reinstall plugin or remove <code>%s</code> file.', 'db-cache-reloaded'), WP_CONTENT_DIR.'/db.php' );\n\t\techo '</p></div>', \"\\n\";\n\t}", "public function parallax_one_welcome_admin_notice() {\n\t\t?>\n\t\t\t<div class=\"updated notice is-dismissible\">\n\t\t\t\t<p><?php echo sprintf( esc_html__( 'Welcome! Thank you for choosing Parallax One! To fully take advantage of the best our theme can offer please make sure you visit our %swelcome page%s.', 'parallax-one' ), '<a href=\"' . esc_url( admin_url( 'themes.php?page=parallax-one-welcome' ) ) . '\">', '</a>' ); ?></p>\n\t\t\t\t<p><a href=\"<?php echo esc_url( admin_url( 'themes.php?page=parallax-one-welcome' ) ); ?>\" class=\"button\" style=\"text-decoration: none;\"><?php _e( 'Get started with Parallax One', 'parallax-one' ); ?></a></p>\n\t\t\t</div>\n\t\t<?php\n\t}", "function main()\t{\n\n\t\t$content = '';\n\n\t\t$content .= '<br /><b>Change table tx_realurl_redirects:</b><br />\n\t\tRemove the field url_hash from the table tx_realurl_redirects, <br />because it\\'s not needed anymore and it\\'s replaced by the standard TCA field uid as soon as you do <br />the DB updates by the extension manager in the main view of this extension.<br /><br />ALTER TABLE tx_realurl_redirects DROP url_hash<br />ALTER TABLE tx_realurl_redirects ADD uid int(11) auto_increment PRIMARY KEY';\n\t\t\n\t\t$import = t3lib_div::_GP('update');\n\n\t\tif ($import == 'Update') {\n\t\t\t$result = $this->updateRedirectsTable();\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<p>Result: '.$result.'</p>';\n\t\t\t$content2 .= '<p>Done. Please accept the update suggestions of the extension manager now!</p>';\n\t\t} else {\n\t\t\t$content2 = '</form>';\n\t\t\t$content2 .= '<form action=\"'.htmlspecialchars(t3lib_div::linkThisScript()).'\" method=\"post\">';\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<input type=\"submit\" name=\"update\" value=\"Update\" />';\n\t\t\t$content2 .= '</form>';\n\t\t} \n\n\t\treturn $content.$content2;\n\t}", "function displayUsage()\n{\n echo \"\\n\";\n echo \"Daemon to email the status of running crons\\n\";\n echo \"\\n\";\n echo \"Usage:\";\n echo \"\\cron3.php [options]\\n\";\n echo \"\\n\";\n echo \"\\toptions:\\n\";\n echo \"\\t\\t--help display this help message\\n\";\n echo \"\\n\";\n}", "public function showVcVersionNotice() {\n $plugin_data = get_plugin_data(__FILE__);\n echo '\n <div class=\"updated\">\n <p>'.sprintf(__('<strong>%s</strong> requires <strong><a href=\"http://bit.ly/vcomposer\" target=\"_blank\">Visual Composer</a></strong> plugin to be installed and activated on your site.', 'vc_extend'), $plugin_data['Name']).'</p>\n </div>';\n }", "private function admin_page_notices() {\n\t\tif ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ), 'gu_settings' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$display = isset( $_POST['install_api_plugin'] ) && '1' === $_POST['install_api_plugin'];\n\t\tif ( $display ) {\n\t\t\techo '<div class=\"updated\"><p>';\n\t\t\tesc_html_e( 'Git Updater API plugin installed.', 'git-updater' );\n\t\t\techo '</p></div>';\n\t\t}\n\t}", "public function admin_notices() {\n\t\t\t$current_screen = \\get_current_screen();\n\t\t\t$message = __( 'Do not edit products, orders, customers, or comments on staging as they might get overwritten with <b>Download Data</b> or <b>Publish to Live</b>.', 'woocart' );\n\t\t\t$show = array( 'edit-shop_order', 'users', 'edit-comments', 'edit-product' );\n\t\t\tif ( $this->is_staging() && in_array( $current_screen->id, $show ) ) {\n\t\t\t\tprintf(\n\t\t\t\t\t'<div class=\"notice\" style=\"background: #e3d9f0;\n border-radius: 8px;\n border: none;\n padding: 1em;\"><span style=\"background: orange;\n border-radius: 5px;\n color: white;\n padding: 0.3em;\">WARNING</span> <span style=\"line-height: 22px;\n font-size: 1.07em;\">%1$s</span></div>',\n\t\t\t\t\t$message\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function showecho($job,$info,$text){\n\t\t//Open Connection to MySQL\n\t\tconnectsql();\n\t\t// --- Write Data to DB ---\n\t\t$text=str_replace(chr(39),chr(34),$text);\n\t\t$sql_query = \"insert into poollog (job,status,text) values ('$job','$info','$text')\";\n\t\tmysql_query($sql_query) or syslog(LOG_WARNING,\"** kein Schreiben durch $job in DB! **\". mysql_error());\n\t\t//Close Connection to MySQL\n\t\tmysql_close();\n}", "function ufclas_matlab_admin_notice_error(){\n\t?>\n <div class=\"notice notice-error\">\n <p><?php _e( 'There was an error importing. Please try again.', 'ufclas-matlab' ); ?></p>\n </div>\n <?php\n}", "function havp_AVupdate_script() {\n\t$hvdef_freshclam_path = HVDEF_FRESHCLAM_PATH;\n\t$hvdef_sigtool_path = HVDEF_SIGTOOL_PATH;\n\t$f = HVDEF_UPD_STATUS_FILE;\n\t$u = HVDEF_FRESHCLAM_STATUS_FILE;\n\treturn <<< EOD\n#!/bin/sh\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update started.\" > $f\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus database already is updated.\" > $u\n{$hvdef_freshclam_path}\nwait\n/bin/cat $u >> $f\n{$hvdef_sigtool_path} --unpack-current daily.cvd\n{$hvdef_sigtool_path} --unpack-current main.cvd\nwait\n/bin/date +\"%Y.%m.%d %H:%M:%S Antivirus update end.\" >> $f\nEOD;\n\n}", "function showResult($script)\n{\n\tglobal $dbQuery;\n\tglobal $siteSerialID;\n\n\techo $script;\n\techo 'adm.system(' . $siteSerialID . ', ' . (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']) . ', ' . $dbQuery . ');';\n\texit;\n}", "function update_automotive_entry($service, $Submission) {\r\n\r\n $conn = db_connect();\r\n\r\n\r\n\r\n // insert new log entry\r\n $query = \"update AUTOMOTIVE\r\n set Submission='\".$Submission.\"'\r\n where service='\".$service.\"'\";\r\n\r\n\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function action_update_check()\n\t{\n\t \tUpdate::add( 'DateNinja', 'e64e02e0-38f8-11dd-ae16-0800200c9a66', $this->info->version );\n\t}", "function haltmsg( $msg )\n {\n printf( \"</td></tr></table><b>Database error:</b> %s<br>\\n\", $msg );\n printf( \"<b>MySQL Error</b>: %s (%s)<br>\\n\",\n $this->Errno,\n $this->Error );\n }", "public function update() {\n\t\treturn $this->render(array('head' => true, 'status' => 501));\n\t}", "public function hookUpdate(): void\n {\n $this->say(\"Executing the Plugin's update hook...\");\n $this->_exec(\"php ./src/hook_update.php\");\n }", "function show_query($query) {\n global $debug;\n if($debug)\n echo \"<p>Records have been changed.</p>\" ;\n}", "function ufclas_matlab_admin_notice_success(){\n\t$message = ufclas_matlab_get_success();\n\t?>\n <div class=\"notice notice-success\">\n <p><?php echo __( 'Import successful. View the imported page: ', 'ufclas-matlab' ) . $message; ?> </p>\n </div>\n <?php\n\t\n}", "function do_undismiss_core_update()\n {\n }", "function frontend_testing_server_notice() {\n $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n if ( (strpos($url,'staging') !== false) || $_SERVER[\"SERVER_ADDR\"] == '::1' ) {\n \t$class = 'notice notice-warning callout callout-info callout-full';\n \t$message = __( '<strong>Warning:</strong> You are currently on a testing server. <strong>Any changes may be overwritten.</strong>', 'theme' );\n \tprintf( '<div class=\"%1$s\"><p>%2$s</p></div>', $class, $message ); \n }\n}", "function wp_get_auto_update_message()\n {\n }", "public function warning_php_version() {\n\t\t\t?>\n\t\t\t<div class=\"notice notice-error\">\n\t\t\t\t<p><?php\n\n\t\t\t\tprintf(\n\t\t\t\t\tesc_html__( '%1$s needs at least PHP %2$s installed on your server. You have version %3$s currently installed. Please contact your hosting service provider if you\\'re not able to update PHP by yourself.', 'wolf-discography' ),\n\t\t\t\t\t'Discography',\n\t\t\t\t\t$this->required_php_version,\n\t\t\t\t\tphpversion()\n\t\t\t\t);\n\t\t\t\t?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "function errorMsgForClient()\n{\n // TELLS THE CUSTOMER ONLY WHAT HE NEEDS TO KNOW. NOT MORE. ( BOTH FOR SAFETY & ABSTRACTION)\n\n echo (\"The website is facing difficulty due to some technical issues. Our Engineers are working on it. Please come back later\");\n\n}", "public function checkForUpdates()\n\t{\n\t\tif (!is_numeric(BUILD))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// HOOK: proxy module\n\t\tif (Config::get('useProxy')) {\n\t\t\t$objRequest = new \\ProxyRequest();\n\t\t} else {\n\t\t\t$objRequest = new \\Request();\n\t\t}\n\n\t\t$objRequest->send(\\Config::get('liveUpdateBase') . (LONG_TERM_SUPPORT ? 'lts-version.txt' : 'version.txt'));\n\n\t\tif (!$objRequest->hasError())\n\t\t{\n\t\t\t\\Config::set('latestVersion', $objRequest->response);\n\t\t\t\\Config::persist('latestVersion', $objRequest->response);\n\t\t}\n\n\t\t// Add a log entry\n\t\t$this->log('Checked for Contao updates', __METHOD__, TL_CRON);\n\t}", "function changelog()\n\t{\n\t\t?>\n\t\t<pre>\n\t\t\t<?php\n\t\t\treadfile( JPATH_SITE.'/CHANGELOG.php' );\n\t\t\t?>\n\t\t</pre>\n\t\t<?php\n\t}", "protected function enjoyVacation()\n {\n echo \"Coding, eating, sleeping\";\n // TODO: Implement enjoyVacation() method.\n }", "public function swp_toolskit_admin_notice() {\n\t\t\n\t\tif ( !Medical_Toolskit::wpl_toolskit_ot_active() ) {\n\t\t\t$html = '<div class=\"update-nag\">';\n\t\t\t$html .= sprintf(__('You need to Install and Activate the Option Tree Plugin', 'medical-toolskit'), admin_url('options-general.php?page='));\n\t\t\t$html .= '</div>';\n\t\t\techo $html;\n\t\t}\n\t}", "public function displayUpgradePage()\n {\n global $token;\n $upgraderVesion = $this->context['versionInfo'][0];\n $upgraderBuild = $this->context['versionInfo'][1];\n $this->log(\"WebUpgrader v.\" . $upgraderVesion . \" (build \" . $upgraderBuild . \") starting\");\n include dirname(__FILE__) . '/upgrade_screen.php';\n }", "public function admin_notices() {\r\n\t\tif ( get_option( 'thread_comments' ) != '1' ) {\r\n\r\n\t\t$html = sprintf(\r\n\t\t __('@Reply Two requires threaded comments to function properly. <a href=\"%s\">Update Settings Now</a>', 'at-reply-two'),\r\n\t\t admin_url('options-discussion.php')\r\n\t\t);\r\n\t\t\t?>\r\n\t\t\t<div class=\"error\">\r\n\t\t\t\t<p><?php echo $html; ?></p>\r\n\t\t\t</div>\r\n\t\t\t<?php\r\n\t\t}\r\n\r\n\t}", "public function action_update_check()\n\t{\n\t\tUpdate::add( $this->info->name, '9bfb17aa-f8f0-4638-a549-af4f86a9d412', $this->info->version );\n\t}", "public function print_admin_notice() {\n\t\t\t?><div id=\"message\" class=\"updated fade\"><h3>Safe Comments:</h3><?php\n\n\t\t\tforeach( (array) $this->_admin_notices as $notice ) {\n\t\t\t\t?>\n\t\t\t\t\t<p><?php echo esc_html( $notice ); ?></p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?></div><?php\n\t\t\t$this->_admin_notices = array();\n\t\t\tdelete_transient( $this->_plugin_prefix . '_notices' );\n\t\t}", "function updprintflag($worecnum)\n {\n $newlogin = new userlogin;\n $newlogin->dbconnect();\n $sql = \"update work_order\n\t set printflag = 1,\n\t\t\t\t\t printapproval = 0\n\t where recnum = $worecnum\";\n //echo $sql;\n\n $result=mysql_query($sql);\n if(!$result) die(\"Update of print failed...Please report to SysAdmin. \" . mysql_error());\n }", "function ifi_CIM_checkforupdates()\n{\n//ifi_pmpro_CIM_db_version\nglobal $ifi_pmpro_CIM_db_version;\nif($ifi_pmpro_CIM_db_version < 2.0)\nifi_pmpro_CIM_setDBTables();\n}", "public function getSucessText(): string{\n return \"\\n\\e[33mCreated new migration \".$this->name.\"\\e[0m\\n\";\n }", "function GroupPress_update() {\n\t// no PHP timeout for running updates\n\tset_time_limit( 0 );\n\n\tglobal $GroupPress;\n\n\t// this is the current database schema version number\n\t$current_db_ver = get_option( 'GroupPress_db_ver' );\n\n\t// this is the target version that we need to reach\n\t$target_db_ver = GroupPress::DB_VER;\n\n\t// run update routines one by one until the current version number\n\t// reaches the target version number\n\twhile ( $current_db_ver < $target_db_ver ) {\n\t\t// increment the current db_ver by one\n\t\t$current_db_ver ++;\n\n\t\t// each db version will require a separate update function\n\t\t// for example, for db_ver 3, the function name should be solis_update_routine_3\n\t\t$func = \"GroupPress_update_routine_{$current_db_ver}\";\n\t\t\tif ( function_exists( $func ) ) {\n\t\t\t\tcall_user_func( $func );\n\t\t\t}\n\n\t\t//update the option in the database, so that this process can always\n\t\t// pick up where it left off\n\t\tupdate_option( 'GroupPress_db_ver', $current_db_ver );\n\t}\n}", "function external_db_warning()\n{\n echo '<strong style=\"color:red;\">Any changes made below WILL NOT be preserved when you login again. You have to change your personal information per instructions found @ <a href=\"' . get_option('external_db_site_url') . '\">login box</a>.</strong>';\n}", "function classicpress_show_migration_blocked_info() {\n\tif ( function_exists( 'classicpress_version' ) ) {\n\t\t// No need to show an error message if we're already on ClassicPress.\n\t\treturn;\n\t}\n?>\n\t<h2 class=\"cp-migration-info cp-emphasis\">\n\t\t<?php _e(\n\t\t\t\"Sorry, we can't switch this site to ClassicPress at this time.\",\n\t\t\t'switch-to-classicpress'\n\t\t); ?>\n\t</h2>\n\n\t<p class=\"cp-migration-info\">\n\t\t<?php _e(\n\t\t\t\"If you're not sure how to fix the issues above, contact your hosting provider for help.\",\n\t\t\t'switch-to-classicpress'\n\t\t); ?>\n\t</p>\n<?php\n}", "function alert_jetpack() {\n\t\t$notice = sprintf(\n\t\t\t__( 'AdControl requires %sJetpack%s to be installed and connected at this time. %sHelp getting started.%s', 'adcontrol' ),\n\t\t\t'<a href=\"https://jetpack.com/\" target=\"_blank\">', '</a>',\n\t\t\t'<a href=\"https://jetpack.com/support/getting-started-with-jetpack/\" target=\"_blank\">', '</a>'\n\t\t);\n\n echo <<<HTML\n <div class=\"notice error is-dismissible\">\n \t<p>$notice</p>\n </div>\nHTML;\n\t}", "function pm_update_complete($project, $version_control) {\n drush_print(dt('Project !project was updated successfully. Installed version is now !version.', array('!project' => $project['name'], '!version' => $project['candidate_version'])));\n drush_command_invoke_all('pm_post_update', $project['name'], $project['releases'][$project['candidate_version']]);\n $version_control->post_update($project);\n}", "function ws_vac_show_version_error() {\n\tif (!current_user_can('activate_plugins')) {\n\t\treturn;\n\t}\n\n\tprintf(\n\t\t'<div class=\"notice notice-error\"><p>\n\t\t\tVisual Admin Customizer requires PHP 5.3 or later. \n\t\t\tInstalled PHP version: %s\n\t\t</p></div>',\n\t\tesc_html(phpversion())\n\t);\n}", "public function notices() {\n\t\tif (!is_plugin_active( 'client-dash/client-dash.php' )) {\n\t\techo '<div class=\"error\">Client Dash Quickbooks Online requires <b>Client Dash</b>. Please install and activate <b>Client Dash</b> to continue using.</div>';\n\t\t}\n\t}", "public static function admin_notice() {\r\n\t\techo '<div class=\"error\">';\r\n\t\techo '<p>' . esc_html( __( 'Your server does not support communication with servers over HTTPS.', 'inf-member' ) ) . '</p>';\r\n\t\techo '</div>';\r\n\t}", "public static function add_php_notice() {\n\t\t$screen = get_current_screen();\n\t\t$valid_screens = self::get_critical_screen_ids();\n\n\t\tif ( null === $screen || ! current_user_can( 'activate_plugins' ) || ! in_array( $screen->id, $valid_screens, true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// translators: %1$s is version of PHP that WP Job Manager requires; %2$s is the version of PHP WordPress is running on.\n\t\t$message = sprintf( __( '<strong>WP Job Manager</strong> requires a minimum PHP version of %1$s, but you are running %2$s.', 'wp-job-manager' ), self::MINIMUM_PHP_VERSION, phpversion() );\n\n\t\techo '<div class=\"error\"><p>';\n\t\techo wp_kses( $message, array( 'strong' => array() ) );\n\t\t$php_update_url = 'https://wordpress.org/support/update-php/';\n\t\tif ( function_exists( 'wp_get_update_php_url' ) ) {\n\t\t\t$php_update_url = wp_get_update_php_url();\n\t\t}\n\t\tprintf(\n\t\t\t'<p><a class=\"button button-primary\" href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s <span class=\"screen-reader-text\">%3$s</span><span aria-hidden=\"true\" class=\"dashicons dashicons-external\"></span></a></p>',\n\t\t\tesc_url( $php_update_url ),\n\t\t\tesc_html__( 'Learn more about updating PHP', 'wp-job-manager' ),\n\t\t\t/* translators: accessibility text */\n\t\t\tesc_html__( '(opens in a new tab)', 'wp-job-manager' )\n\t\t);\n\t\techo '</p></div>';\n\t}", "public function step1()\n\t{\n\t\t$this->executeUpgradeQuery(\"\n\t\t\tALTER TABLE `xf_notice`\n\t\t\tMODIFY COLUMN `notice_type` VARCHAR(25) NOT NULL DEFAULT 'block',\n\t\t\tMODIFY COLUMN `display_style` VARCHAR(25) NOT NULL DEFAULT ''\n\t\t\");\n\t}", "public function displayHelp()\n\t{\n\t\t$obj = MpmCommandLineWriter::getInstance();\n\t\t$obj->addText('./migrate.php latest [--force]');\n\t\t$obj->addText(' ');\n\t\t$obj->addText('This command is used to migrate up to the most recent version. No arguments are required.');\n\t\t$obj->addText(' ');\n\t\t$obj->addText('If the --force option is provided, then the script will automatically skip over any migrations which cause errors and continue migrating forward.');\n\t\t$obj->addText(' ');\n\t\t$obj->addText('Valid Examples:');\n\t\t$obj->addText('./migrate.php latest', 4);\n\t\t$obj->addText('./migrate.php latest --force', 4);\n\t\t$obj->write();\n\t}", "public function action_update_check()\n\t{\n\t \tUpdate::add('Atom Threading Extensions', 'a413fa7e-76cf-4edf-b7c5-53b8aa648eef', $this->info->version);\n\t}", "public function dependency_notice() {\n $errors = '';\n $error = '';\n foreach ( $this->dependency_error as $error ) {\n $errors .= '<p>' . $error . '</p>';\n }\n $message = '<div class=\"error\">' . $errors . '</div>';\n\n echo $message;\n }", "function gc_admin_notice() {\n\n $api_key = esc_attr( get_option( 'gc-api_key' ) );\n\n if ( ! empty($api_key) ) {\n return;\n }\n\n ?>\n\n <div class=\"error\">\n <p><?php\n\n printf(\n __( 'Please visit <a href=\"%1$s\">Graph Commons Plugin Settings page</a> and specify your API key', 'graphcommons' ),\n esc_url( get_admin_url(null, 'options-general.php?page=graphcommons') )\n );\n\n ?></p>\n </div>\n <?php\n\n }", "function showError(){\n\t\techo json_encode(array(\n\t\t\t\"alert\" => \"error\",\n\t\t\t\"title\" => \"Failed to Update!\",\n\t\t\t\"message\" => \"Program Updating has been Failed\"\n\t\t));\n\t}", "function updateUser()\n{\n return 'Updating user';\n}", "function sptp_admin_notices() {\n\t$message = sprintf(\n\t\t__( '[Simple Post Type Permalinks] Simple Post Type Permalinks requires PHP version %s or higher.', SPTP_TEXT_DOMAIN ),\n\t\tSPTP_REQUIRE_PHP_VERSION\n\t);\n\n\techo sprintf( '<div class=\"error\"><p>%s</p></div>', esc_html( $message ) );\n}", "public function show_admin_warning_dreamobjects() {\n\t\t$this->show_admin_warning('<strong>'.__('UpdraftPlus notice:', 'updraftplus').'</strong> '.sprintf(__('The %s endpoint is scheduled to shut down on the 1st October 2018. You will need to switch to a different end-point and migrate your data before that date. %sPlease see this article for more information%s'), 'objects-us-west-1.dream.io', '<a href=\"https://help.dreamhost.com/hc/en-us/articles/360002135871-Cluster-migration-procedure\" target=\"_blank\">', '</a>'), 'updated');\n\t}", "function fx_admin_notice_show_migration_message(){\n if( get_transient( 'fx_admin_notice_show_migration_message' ) ){\n ?>\n <div class=\"notice notice-warning notice-alt is-dismissible\">\n <p>The BTCPay Plugin for Woocoomerce has been updated from a 2.x version!\n <strong>We have attempted to migrate your settings. Please double check them\n <?php echo '<a href=\"' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=wc-settings&tab=checkout&section=wc_gateway_btcpay\">here</a>'?>.\n If you don't see pairing data in your setting, make sure to pair your store again. </strong></p>\n </div>\n <?php\n /* Delete transient, only display this notice once. */\n delete_transient( 'fx_admin_notice_show_migration_message' );\n }\n}", "protected function maybe_display_notices() {\n\t\t$this->display_update_notices();\n\t\t$this->display_other_notices();\n }", "function main()\t{\n\n\t\t$content = '';\n\t\t$update040a = false;\n\t\t$update040b = false;\n\t\t$update040c = false;\n\t\t\n\t\t$tableNames = $GLOBALS['TYPO3_DB']->admin_get_tables();\n\t\tif (!isset($tableNames['tx_myquizpoll_relation_user_id_mm'])) {\n\t\t\t$update040a = true;\n\t\t\t$update040b = true;\n\t\t\t$update040c = true;\n\t\t}\n\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('update040a')) {\n\t\t\t$content .= \"<br />Executing: Update relations-table for advanced statistics\\n\";\n\t\t\t\n\t\t\t$mmArray = array();\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local, uid_foreign',\n\t\t\t\t'tx_myquizpoll_relation_user_id_mm',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\tif ($rows>0) {\t\t\t\t\t\t\t// DB entries found?\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n\t\t\t\t\t$local = $row['uid_local'];\n\t\t\t\t\t$mmArray[$local] = array();\n\t\t\t\t\t$mmArray[$local]['user'] = $row['uid_foreign'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local, uid_foreign',\n\t\t\t\t'tx_myquizpoll_relation_question_id_mm',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res2);\n\t\t\tif ($rows>0) {\t\t\t\t\t\t\t// DB entries found?\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)){\n\t\t\t\t\t$local = $row['uid_local'];\n\t\t\t\t\t$mmArray[$local]['quest'] = $row['uid_foreign'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$updateArray = array();\n\t\t\tforeach($mmArray as $key => $value) {\n\t\t\t\t//$content .= \"- $key: \".$value['user'].'/'.$value['quest'].\"<br />\\n\";\n\t\t\t\t$updateArray = array('user_id' => $value['user'], 'question_id' => $value['quest']);\n\t\t\t\t$success = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_myquizpoll_relation', 'uid='.$key, $updateArray);\n\t\t\t\tif(!$success){\n\t\t\t\t\t$content.=\"<p>MySQL Update-Error :-(</p>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$update040a = true;\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('update040b')) {\n\t\t\t$content .= \"<br />Executing: - Delete no longer needed relation-data\\n\";\n\t\t\t\n\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t\t'tx_myquizpoll_relation_user_id_mm',\n\t\t\t\t''\n\t\t\t);\n\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t\t'tx_myquizpoll_relation_question_id_mm',\n\t\t\t\t''\n\t\t\t);\n\t\t\t$update040b = true;\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('update040c')) {\n\t\t\t$content .= \"<br />Executing: - Delete no longer needed relation-tables\\n\";\n\t\t\t\n\t\t\tmysql( TYPO3_db, 'DROP TABLE tx_myquizpoll_relation_user_id_mm' );\n\t\t\tmysql( TYPO3_db, 'DROP TABLE tx_myquizpoll_relation_question_id_mm' );\n\t\t\t$update040c = true;\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('updatepoll') && \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid')) {\n\t\t\t$thePID=intval(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid'));\n\t\t\t$timestamp = time();\n\t\t\t$content .= \"<br />Executing: - Converting basic poll data to advanced poll data (folder $thePID)\\n\";\n\t\t\t$res5 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, cruser_id,sys_language_uid,hidden, p_or_a, qids',\n\t\t\t\t'tx_myquizpoll_result',\n\t\t\t\t'pid='.$thePID,\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res5);\n\t\t\tif ($rows>0) {\n\t\t\t\t$statisticsArray = array();\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res5)){ \n\t\t\t\t\t$theUID = $row['uid'];\n\t\t\t\t\tif (intval($row['p_or_a'])>0 && intval($row['p_or_a'])<13) {\n\t\t\t\t\t\t\t$statisticsArray[$theUID] = array(\n\t\t\t\t\t\t\t'pid' => $thePID,\n\t\t\t\t\t\t\t'tstamp' => $timestamp,\n\t\t\t\t\t\t\t'crdate' => $timestamp,\n\t\t\t\t\t\t\t'cruser_id' => $row['cruser_id'],\n\t\t\t\t\t\t\t'hidden' => $row['hidden'],\n\t\t\t\t\t\t\t'user_id' => $theUID,\n\t\t\t\t\t\t\t'question_id' => $row['qids'],\n\t\t\t\t\t\t\t'checked'.$row['p_or_a'] => 1,\n\t\t\t\t\t\t\t'sys_language_uid' => $row['sys_language_uid']\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 (is_array($statisticsArray)) {\n\t\t\t\tforeach ($statisticsArray as $type => $element) {\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_myquizpoll_relation', $element);\n\t\t\t\t}\n\t\t\t\t$content .= \"<br />\".count($statisticsArray).\" elements inserted. done.<br />\\n\";\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('updatepoll2a') && \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a')) {\n\t\t\t$thePID=intval(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a'));\n\t\t\t$timestamp = time();\n\t\t\t$content .= \"<br />Executing: - Copy basic poll data to tx_myquizpoll_voting (folder $thePID)\\n\";\n\t\t\t$res5 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, crdate,cruser_id,sys_language_uid,hidden, p_or_a, qids, ip',\n\t\t\t\t'tx_myquizpoll_result',\n\t\t\t\t'pid='.$thePID,\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res5);\n\t\t\tif ($rows>0) {\n\t\t\t\t$votingArray = array();\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res5)){ \n\t\t\t\t\t$theUID = $row['uid'];\n\t\t\t\t\tif (intval($row['p_or_a'])>0 && intval($row['p_or_a'])<13) {\n\t\t\t\t\t\t\t$votingArray[$theUID] = array(\n\t\t\t\t\t\t\t'pid' => $thePID,\n\t\t\t\t\t\t\t'tstamp' => $timestamp,\n\t\t\t\t\t\t\t'crdate' => $row['crdate'],\n\t\t\t\t\t\t\t'cruser_id' => $row['cruser_id'],\n\t\t\t\t\t\t\t'hidden' => $row['hidden'],\n//\t\t\t\t\t\t\t'user_id' => $theUID,\n\t\t\t\t\t\t\t'question_id' => intval($row['qids']),\n\t\t\t\t\t\t\t'answer_no' => $row['p_or_a'],\n\t\t\t\t\t\t\t'ip' => $row['ip'],\n\t\t\t\t\t\t\t'sys_language_uid' => $row['sys_language_uid']\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 (is_array($votingArray)) {\n\t\t\t\tforeach ($votingArray as $type => $element) {\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_myquizpoll_voting', $element);\n\t\t\t\t}\n\t\t\t\t$content .= \"<br />\".count($votingArray).\" elements inserted into tx_myquizpoll_voting. done.<br />\\n\";\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('updatepoll2b') && \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a')) {\n\t\t\t$thePID=intval(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a'));\n\t\t\t$content .= \"<br />Executing: - Deleting old basic poll data (folder $thePID)\\n\";\n\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_myquizpoll_result', 'pid='.$thePID);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// formular\n\t\tif ($content) $content .= \"<br /><br />\\n\";\n\t\t$linkScript = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::linkThisScript(); // htmlspecialchars()\n\t\t//$content.=$linkScript;\n\t\t$content.='<form name=\"myquiz\" action=\"'.$linkScript.'\" method=\"post\">';\n\t\tif (!($update040a && $update040b && $update040c)) {\n\t\t\t$content.='<br /><p>Updates from Version 0.3.0-0.4.2 to 1.0.0:<br />';\n\t\t\tif (!$update040a)\n\t\t\t\t$content.='<input type=\"checkbox\" name=\"update040a\" value=\"1\" checked=\"checked\" /> Update relation-table for advanced statistics<br />';\n\t\t\tif (!$update040b)\n\t\t\t\t$content.='<input type=\"checkbox\" name=\"update040b\" value=\"1\" checked=\"checked\" /> - Delete no longer needed relation-data<br />';\n\t\t\tif (!$update040c)\n\t\t\t\t$content.='<input type=\"checkbox\" name=\"update040c\" value=\"1\" checked=\"checked\" /> - Delete no longer needed relation-tables<br />';\n\t\t\t$content.='</p><br />';\n\t\t}\n\t\t$content.='<p><input type=\"checkbox\" name=\"updatepoll\" value=\"1\" /> Optional: convert basic poll data to advanced poll data. ID of the folder: ';\n\t\t$content.='<input type=\"text\" name=\"pollpid\" value=\"\" /> (be carefully, there is no check if there are really basic poll data). Execute it only once!</p><br />';\n\t\t$content.='<p><input type=\"checkbox\" name=\"updatepoll2a\" value=\"1\" /> Optional: copy basic poll data to the table tx_myquizpoll_voting. ID of the folder: ';\n\t\t$content.='<input type=\"text\" name=\"pollpid2a\" value=\"\" /> (be carefully, there is no check if there are really basic poll data). Execute it only once!';\n\t\t$content.='<br />&nbsp; -&nbsp; <input type=\"checkbox\" name=\"updatepoll2b\" value=\"1\" /> Delete old entries in the table tx_myquizpoll_result with the above ID.</p><br />';\n\t\t\n\t\t//$linkScript = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::slashJS(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::linkThisScript());\n\t\t//$content.=$linkScript;\n\t\t// this.form.action=\\''.$linkScript.'\\';\n\t\t$content.='<input type=\"button\" onclick=\"this.form.submit();\" name=\"send\" value=\"Start\" />';\n\t\t$content.='</form>';\n\t\t\n\t\treturn $content;\n\t}", "function mediahub_upgrade_notice() {\n\tif ( true == get_option( 'mediahub_no_upgrade_notice' ) ) {\n\t\treturn;\n\t}\n\n\t// Display the uprade notice\n\t?>\n\t<div class=\"error\">\n\t\t<p><strong><?php _e( 'Important upgrade notice:</strong> Version 4 of the MediaHub API is now available.', 'mediahub' ); ?></p>\n\t\t<p><?php _e( 'An update to the MediaHub API is available. To be able to update to the new API, you need new API-keys. Request them via <a href=\"mailto:servicedesk@demediahub.nl\">servicedesk@demediahub.nl</a>.', 'mediahub' ); ?></p>\n\t\t<p>\n\t\t\t<a href=\"<?php echo esc_url( wp_nonce_url( admin_url('options-general.php?page=mediahub_api' ), 'mediahub_upgrade', 'mediahub_upgrade' ) ); ?>\" class=\"button button-primary\">\n\t\t\t\t<?php _e( 'Click here to upgrade to the new API', 'mediahub' ); ?>\n\t\t\t</a>\n\t\t</p>\n\t\t<p><a href=\"<?php echo esc_url( wp_nonce_url( admin_url('options-general.php?page=mediahub_api' ), 'mediahub_no_upgrade_notice', 'mediahub_no_upgrade_notice' ) ); ?>\"><?php _e( \"Don't show this notice again\", 'mediahub' ); ?></a></p>\n\t</div>\n\t<?php\n}", "function update_nag()\n {\n }", "function site_admin_notice()\n {\n }", "function print_phpWebNotes_version() {\r\n\t\tif ( ON == config_get( 'show_version' ) ) {\r\n\t\t\techo '<span class=\"version\">phpWebNotes - ' . config_get( 'phpWebNotes_version' ) . '</span><br />';\r\n\t\t}\r\n\t}" ]
[ "0.6713284", "0.61402744", "0.6093801", "0.6033369", "0.5963025", "0.5961374", "0.59531677", "0.59422797", "0.59159935", "0.5907624", "0.5881321", "0.5850375", "0.5813596", "0.5813073", "0.58106875", "0.57955074", "0.5764324", "0.5761401", "0.57588214", "0.57499355", "0.57270557", "0.57006776", "0.56953645", "0.5681223", "0.56486845", "0.56448346", "0.562852", "0.5628163", "0.56111485", "0.5589908", "0.55846906", "0.5568457", "0.55651814", "0.5548091", "0.5547089", "0.553181", "0.5512906", "0.5488166", "0.54800683", "0.5466704", "0.54627526", "0.5447526", "0.54465747", "0.54426044", "0.54382443", "0.5430521", "0.5430013", "0.5429035", "0.54282224", "0.5427497", "0.5423837", "0.5418106", "0.5413385", "0.54118985", "0.5411562", "0.54072803", "0.5405041", "0.54004383", "0.5394951", "0.5393549", "0.539337", "0.53879994", "0.5387227", "0.53870773", "0.5377058", "0.5375613", "0.53679526", "0.53615505", "0.53564", "0.53493696", "0.5349191", "0.5349189", "0.5344937", "0.5338451", "0.53348565", "0.53316563", "0.5330632", "0.5320579", "0.53205734", "0.53183824", "0.53174245", "0.5289975", "0.52851486", "0.5282945", "0.52811766", "0.52707434", "0.5270007", "0.5262273", "0.52547264", "0.5246025", "0.5241259", "0.52357316", "0.5225687", "0.52236265", "0.52186984", "0.52121437", "0.5209684", "0.5207593", "0.52074295", "0.5207025", "0.5204656" ]
0.0
-1
Seed the application's database.
public function run() { $this->call(BarangsSeeder::class); $this->call(TravellerSeeder::class); $this->call(ActivityTravellerSeeder::class); $this->call(RequesterSeeder::class); $this->call(ActRequesterSeeder::class); $this->call(UsersSeeder::class); $this->call(PenggunaSeeder::class); $this->call(PostRQSeeder::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\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 seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('jpearson@ec4p.com');\n $this->seedUserAccount('jgpearson1@gmail.com');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => 'chrud66@example.com',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', 'chrud66@example.com')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('chrud66@example.com')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => 'admin@example.org',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => 'admin@crm.com',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => 'staff@crm.com',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => 'customer@crm.com',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\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 # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "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 DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\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 DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => 'admin@admin.com',\n 'password' => Hash::make('12345678'),\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\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\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 \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\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 DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => 'admin@mail.com',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => 'user@mail.com',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => 'foo@foo.com',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\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 {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => 'correo@correo.com',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => 'correo2@correo.com',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => 'correo@correo.com',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\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 {\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 // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\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 }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => 'peterwong.brisbane@gmail.com',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => 'admin@lig.com',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\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 DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\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\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', 'nbpalomino@gmail.com')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'nbpalomino@gmail.com'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \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 $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "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 $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\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 Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801", "0.6789746", "0.6788733", "0.6788008", "0.6786291", "0.67765796", "0.67742485", "0.677106", "0.67651874", "0.6761959", "0.675823", "0.67337847", "0.6733437", "0.67295784", "0.67290515", "0.6724652", "0.67226326", "0.6722267", "0.6721339", "0.6715842", "0.67070943", "0.67060536", "0.67031103", "0.6702514", "0.6702361", "0.67017967", "0.6695973", "0.6693496", "0.66868156", "0.66837406", "0.6678434", "0.66755766", "0.66726524", "0.666599", "0.664943", "0.6640641", "0.663921", "0.66387916", "0.6636016", "0.6633116", "0.6629787", "0.6627134", "0.6625862", "0.661699", "0.66093796", "0.6602538", "0.65996546", "0.659914", "0.6596484", "0.6596383", "0.65922767", "0.65922284", "0.65913564", "0.65889347", "0.65812707", "0.65811145", "0.6579546", "0.6578819", "0.6575912", "0.65749073", "0.6574314", "0.657148", "0.65696406", "0.6568972", "0.65624833", "0.6560332", "0.6559092", "0.6557491", "0.65555155", "0.6554255", "0.65509576", "0.6548099", "0.65479296", "0.6545845", "0.65443295", "0.65434265", "0.65432936", "0.654295", "0.65426385", "0.6541781", "0.6539325" ]
0.0
-1
Return a sorted list object
public function getList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sort();", "public function getSorting();", "function wp_list_sort($input_list, $orderby = array(), $order = 'ASC', $preserve_keys = \\false)\n {\n }", "public function &getOrderBy();", "protected function orderList()\n {\n return ksort($this->callbackList, \\SORT_REGULAR);\n }", "public function asort() {}", "function logSorter_sort($list) {\n uasort($list, 'logSorter_cmpFiles');\n return $list;\n}", "function insert_sort(array $q) {\r\n\t$len = count($q);\r\n\t$list = [];\r\n\tfor($i=0; $i < $len; $i++)\r\n\t{\r\n\t\t$list = insert($q[$i], $list); \r\n\t}\r\n\r\n\treturn $list;\r\n}", "public function getSortOrder();", "public function getSortOrder();", "public function getSortOrder();", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "function sortList($supList, $minMax){\r\n\t\t\r\n\t\t$sizeList = $supList->size();\t\r\n\t\t\r\n\t\tfor($x=0; $x < $sizeList-1; $x++){\r\n\t\t\t\r\n\t\t\tfor($y=0; $y < $sizeList-1; $y++) \t\t//true - od Min do Max false - od Max do Min\r\n\t\t\t{\r\n\t\t\t\t\tif($minMax){\r\n\t\t\t\t\t\tif($supList->getIndex($y)->value >= $supList->getIndex($y+1)->value) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->swap($supList,$y,($y+1));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!$minMax){\r\n\t\t\t\t\t\tif($supList->getIndex($y)->value <= $supList->getIndex($y+1)->value) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->swap($supList,$y,($y+1));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$supList->bdUpdateFirst();\r\n\t}", "function SortNameList ( ) { return $this->_SortNameList; }", "private function mergeSort($list) {\n\t\t$size = $list->listCount;\n\t\t$list = $list->next;\n\t\t$count = 0;\n\t\t$tmpLeft = new testsList();\n\t\t$tmpRight = new testsList();\n\t\t\n\t\twhile ($list != null && $count < $size/2) {\n\t\t\t$tmpLeft->insertOne($list->location);\n\t\t\t$list = $list->next;\n\t\t\t$count += 1;\n\t\t}\n\t\t\n\t\tif ($tmpLeft->listCount > 1) {\n\t\t\t$tmpLeft = $this->mergeSort($tmpLeft);\n\t\t}\n\t\t\n\t\twhile ($list != null && $count < $size) {\n\t\t\t$tmpRight->insertOne($list->location);\n\t\t\t$list = $list->next;\n\t\t\t$count += 1;\n\t\t}\n\t\t\n\t\tif ($tmpRight->listCount > 1) {\n\t\t\t$tmpRight = $this->mergeSort($tmpRight);\n\t\t}\n\t\t\n\t\t$list = $this->mySort($tmpLeft, $tmpRight);\n\t\t//split the list into left and right\n\t\treturn $list;\n\t}", "function simpleQSortExample($list): array\n{\n // if count less than 2, then no need to sort\n if(count($list) < 2){\n return $list;\n }\n\n $pivot = $list[0];\n $lessItems = [];\n $greaterItems = [];\n\n for ($i = 1; $i < count($list); $i++){\n if($list[$i] <= $pivot){\n $lessItems[] = $list[$i];\n }else {\n $greaterItems[] = $list[$i];\n }\n }\n\n return array_merge(simpleQSortExample($lessItems), [$pivot], simpleQSortExample($greaterItems));\n}", "public function Sort(){\r\n\t\treturn self::get_sort();\r\n\t}", "private function mySort($left, $right) {\n\t\t$list = new testsList();\n\t\t\n\t\t//sort the mini lists\n\t\t$left = $left->next;\n\t\t$right = $right->next;\n\t\t\n\t\twhile ($left != null || $right != null) {\n\t\t\tif ($left != null && $right != null) {\n\t\t\t\tif ($left->location->getLng() <= $right->location->getLng()) {\n\t\t\t\t\t$list->insertOne($left->location);\n\t\t\t\t\t$left = $left->next;\n\t\t\t\t}\n\t\t\t\telse if ($right->location->getLng() < $left->location->getLng()) {\n\t\t\t\t\t$list->insertOne($right->location);\n\t\t\t\t\t$right = $right->next;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($left != null && $right == null) {\n\t\t\t\t$list->insertOne($left->location);\n\t\t\t\t$left = $left->next;\n\t\t\t}\n\t\t\t\n\t\t\tif ($right != null && $left == null) {\n\t\t\t\t$list->insertOne($right->location);\n\t\t\t\t$right = $right->next;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$tmp = $list->next;\n\t\t\n\t\treturn $list;\n\t}", "public function getElementSortOrder();", "public function order();", "private function sortEventList($eventList){\n $anz = count($eventList);\n $temp=\"\";\n for ($a = 0; $a < $anz; $a++) {\n for ($b = 0; $b < $anz -2; $b++) {\n if ($eventList[$b +1]->start_date < $eventList[$b]->start_date) {\n $temp = $eventList[$b];\n $eventList[$b] = $eventList[$b +1];\n $eventList[$b +1] = $temp;\n }\n }\n }\n return $eventList;\n }", "public function getOrderedListAction()\r\n {\r\n // merge filter and tFilter\r\n $jsonFilter = $this->params()->fromQuery('filter', '[]');\r\n $jsonTFilter = $this->params()->fromQuery('tFilter', '[]');\r\n $filterArray = Json::decode($jsonFilter, Json::TYPE_ARRAY);\r\n $tFilterArray = Json::decode($jsonTFilter, Json::TYPE_ARRAY);\r\n $filters = array_merge($tFilterArray, $filterArray);\r\n $sort = Json::decode($this->params()->fromQuery('sort', null), Json::TYPE_ARRAY);\r\n $start = Json::decode($this->params()->fromQuery('start', null), Json::TYPE_ARRAY);\r\n $limit = Json::decode($this->params()->fromQuery('limit', null), Json::TYPE_ARRAY);\r\n $mongoFilters = $this->_buildFilter($filters);\r\n return new JsonModel($this->_dataService->getOrderedList($mongoFilters, $sort, $start, $limit, false));\r\n }", "public function getListSorting()\n {\n if ($this->_aCurrSorting === null ) {\n $this->_aCurrSorting = $this->_oFcpoHelper->fcpoGetRequestParameter('sort');\n\n if (!$this->_aCurrSorting && $this->_sDefSortField && ( $oBaseObject = $this->getItemListBaseObject() ) ) {\n $this->_aCurrSorting[$oBaseObject->getCoreTableName()] = array( $this->_sDefSortField => \"asc\" );\n }\n }\n\n return $this->_aCurrSorting;\n }", "public function getItems()\n {\n sort($this->items);\n return $this->items;\n }", "public function testGetList_SortingLimit()\n\t{\n\t\t$this->object->Save();\n\t\t$newObject1 = new object(\"efg\");\n\t\t$newObject2 = new object(\"abc\");\n\t\t$newObject3 = new object(\"d\");\n\n\t\t$newObject1->Save();\n\t\t$newObject2->Save();\n\t\t$newObject3->Save();\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", true, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"abc\", $objectList[0]->attribute);\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", false, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"obj att\", $objectList[0]->attribute);\n\t\t$this->assertEquals(\"efg\", $objectList[1]->attribute);\n\t}", "abstract public function prepareSort();", "function sortList($head) {\n if (empty($head)) {\n return $head;\n }\n $curr = $head;\n while (!empty($curr)) {\n sortListHelper($curr);\n $curr = $curr->next;\n }\n return $head;\n}", "public function comparator();", "public function sort()\n {\n /*\n * This arrange step takes O(n) time.\n *\n * Arrange the from and to locations for fast lookup.\n */\n self::arrangeBoardingCards();\n /*\n * This next step also takes O(n) time.\n */\n $startLocation = self::getStartLocation();\n /*\n * From the start location, traverse the boarding cards, creating a sorted list as we go.\n *\n * This step takes O(n) time.\n */\n $sortedBoardingCards = array();\n $currentLocation = $startLocation;\n /*\n * Assign respective boarding card while checking for undefined index\n */\n while ($currentBoardingCard = (array_key_exists($currentLocation, $this->fromIndex)) ? $this->fromIndex[$currentLocation] : null) {\n\n /*\n * Add the boarding card to our sorted list.\n */\n array_push($sortedBoardingCards, $currentBoardingCard);\n /*\n * Get our next location.\n */\n $currentLocation = $currentBoardingCard->getTo();\n }\n /*\n * After O(3n) operations, we can now return the sorted boarding cards.\n */\n return $sortedBoardingCards;\n }", "public function sortStrategy();", "function getSort(){\n return 100;\n }", "public function asort()\n {\n }", "public function actionSort()\n {\n $model = new Position;\n\n $sortedIds = Yii::$app->request->post('sortedList');\n $success = !empty($sortedIds) ? $model->updateSorting($sortedIds) : false;\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n\n return ['success' => $success];\n }", "public function ascendingTasklists()\n {\n return fractal(\n $this->tasklist->ascending()->with('tasks')->get(),\n new TaskListsTransformer()\n )->toArray();\n }", "function uListSort($users) {\r\n\tif (!is_array($users)) $users = explode(\" \",$users);\r\n\t$owners = array();\r\n\t$owners_other = array(); // For '!' founders.\r\n\t$admins = array();\r\n\t$ops = array();\r\n\t$hops = array();\r\n\t$voices = array();\r\n\t$none = array();\r\n\t$x = 0;\r\n\twhile ($x != count($users)) {\r\n\t\t$n = $users[$x];\r\n\t\tif ($n[0] == \"~\") {\r\n\t\t\t// Owner.\r\n\t\t\t$owners[] = $n;\r\n\t\t}\r\n\t\telse if ($n[0] == \"!\") {\r\n\t\t\t// Owner v2\r\n\t\t\t$owners_other[] = $n;\r\n\t\t}\r\n\t\telse if ($n[0] == \"&\") {\r\n\t\t\t// Admin\r\n\t\t\t$admins[] = $n;\r\n\t\t}\r\n\t\telse if ($n[0] == \"@\") {\r\n\t\t\t// Op\r\n\t\t\t$ops[] = $n;\r\n\t\t}\r\n\t\telse if ($n[0] == \"%\") {\r\n\t\t\t// Halfop\r\n\t\t\t$hops[] = $n;\r\n\t\t}\r\n\t\telse if ($n[0] == \"+\") {\r\n\t\t\t// Voice\r\n\t\t\t$voices[] = $n;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// None.\r\n\t\t\t$none[] = $n;\r\n\t\t}\r\n\t\t$x++;\r\n\t}\r\n\tnatcasesort($owners);\r\n\tnatcasesort($owners_other);\r\n\tnatcasesort($admins);\r\n\tnatcasesort($ops);\r\n\tnatcasesort($hops);\r\n\tnatcasesort($voices);\r\n\tnatcasesort($none);\r\n\t$ulist = array_merge($owners,$owners_other,$admins,$ops,$hops,$voices,$none);\r\n\t$ulist = array_values($ulist);\r\n\treturn $ulist;\r\n}", "public function getSortedFilterList($list)\n {\n $sortedFilterList = array();\n foreach($list as $key => $item) {\n $headerArray = array_keys($item);\n $arrayKey = $headerArray[9]; \n \n $sortedFilterList[$item[$arrayKey]][$key] = $item;\n }\n ksort($sortedFilterList, SORT_NUMERIC);\n return $sortedFilterList; \n }", "public static function sortables()\n {\n return ['id', 'module_name'];\n }", "public function sort() {\n sort($this->items, SORT_STRING);\n }", "public function get_sort_event_list()\n\t{\n\t$temp = $this->get_event_list();\n\tif (!empty($temp))\n\t{\n\t\tusort($temp, [&$this, \"ical_dtstart_compare\"]);\n\t\treturn $temp;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t}", "private function getChildList(){\n\t\tif ($this->_childList == null) {\n\t\t\t$this->_childList = $this->getStructureNode()->getChildren();\n\t\t\t$this->_childList = $this->_childList->sort(array(\n\t\t\t\tnew SortRule($this->_childList->exprMember('title'))));\n\t\t}\n\t\treturn $this->_childList;\n\t}", "public function lists();", "private static function internalSortComponentsByDependencies(&$c, &$list) {\n\t\tif (in_array($c, $list)) return;\n\t\tforeach ($c->dependencies() as $dep)\n\t\t\tPNApplication::internalSortComponentsByDependencies(PNApplication::$instance->components[$dep], $list);\n\t\tarray_push($list, $c);\n\t}", "function getSortedItemsArray()\n\t{\n\t\t$med_items = $this->getItemsArray();\n\n\t\t// sort by order setting\n\t\tswitch($this->getOrder())\n\t\t{\n\t\t\tcase ilObjMediaCast::ORDER_TITLE:\n\t\t\t\t$med_items = ilUtil::sortArray($med_items, \"title\", \"asc\", false, true);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase ilObjMediaCast::ORDER_CREATION_DATE_ASC:\n\t\t\t\t$med_items = ilUtil::sortArray($med_items, \"creation_date\", \"asc\", false, true);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase ilObjMediaCast::ORDER_CREATION_DATE_DESC:\n\t\t\t\t$med_items = ilUtil::sortArray($med_items, \"creation_date\", \"desc\", false, true);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase ilObjMediaCast::ORDER_MANUAL:\n\t\t\t\t$order = array_flip($this->readOrder());\t\t\n\t\t\t\t$pos = sizeof($order);\n\t\t\t\tforeach(array_keys($med_items) as $idx)\n\t\t\t\t{\n\t\t\t\t\tif(array_key_exists($idx, $order))\n\t\t\t\t\t{\n\t\t\t\t\t\t$med_items[$idx][\"order\"] = ($order[$idx]+1)*10;\n\t\t\t\t\t}\n\t\t\t\t\t// item has no order yet\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$med_items[$idx][\"order\"] = (++$pos)*10;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$med_items = ilUtil::sortArray($med_items, \"order\", \"asc\", true, true);\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\n\t\treturn $med_items;\n\t}", "public function SortLinks(): ArrayList\n {\n return $this->getUserPreferencesClass()->getLinksPerType('SORT');\n }", "public function sorted(Collection $collection, $order);", "public function getSortOrder(): int;", "public function list();", "public function list();", "public function list();", "public function allowedSorts()\n {\n return [];\n }", "function sort_lists($a, $b)\n\t{\n\t\tif(!isset($a['SortOrder'], $b['SortOrder']) || $a['SortOrder'] == $b['SortOrder']):\n\t\t\treturn 0;\n\t\tendif;\n\t\treturn ($a['SortOrder'] < $b['SortOrder']) ? -1 : 1;\n\t}", "protected function _getSortedObservers()\n {\n $array = $this->_splObjectStorageToArray($this->observers);\n\n usort($array, function ($a, $b) {\n return (int) $a['data'] < (int) $b['data'];\n });\n\n return array_map(function ($item) {\n return $item['obj'];\n }, $array);\n }", "function getOrderings() ;", "public function sort()\n {\n $this->repository->sort(Input::all());\n }", "function getSort(){\n\treturn 281;\n}", "public function getOrderList()\n {\n }", "function getSort(){ return 301; }", "public function getSortBy();", "public function testIterationKeySort()\r\n\t{\r\n \t\t$expected = array(\r\n\t\t\t-3 => 'eerht',\r\n\t\t\t-2 => 'owt',\r\n\t\t\t-1 => 'eno',\r\n\t\t\t0 => 'zero',\r\n\t\t\t1 => 'one',\r\n\t\t\t2 => 'two',\r\n\t\t\t3 => 'three',\r\n\t\t);\r\n\r\n\t\t// add and remove items in totally random order\r\n\t\t$this->list->set( 1, 'one' );\r\n\t\t$this->list->prepend( 'zero' );\r\n\t\t$this->list->add( 2, 'two' );\r\n\t\t$this->list->prepend( 'eno' );\r\n\t\t$this->list->remove( 0 );\r\n\t\t$this->list->append( 'three' );\r\n\t\t$this->list->set( -2, 'owt' );\r\n\t\t$this->list->prepend( 'eerht' );\r\n\t\t$this->list->set( 0, 'zero' );\r\n\r\n\t\t// make sure keys are a mess\r\n\t\t$this->assertEquals(\r\n\t\t\tarray( 1, 2, -1, 3, -2, -3, 0 ),\r\n\t\t\t$this->list->keys()\r\n\t\t);\r\n\r\n\t\t// results array\r\n\t\t$actual = array();\r\n\r\n\t\t// loop the list\r\n\t\tforeach( $this->list as $key => $value ) {\r\n\t\t\t// assign to result\r\n\t\t\t$actual[ $key ] = $value;\r\n\t\t}\r\n\r\n\t\t// should be identical\r\n\t\t$this->assertEquals( $expected, $actual );\r\n\r\n\t\t// check count\r\n\t\t$this->assertEquals( 7, $this->list->count() );\r\n\t}", "abstract public function getList();", "public function getJsonList()\n {\n return $this->Ascending()->lists('tax', 'tax_id');\n }", "function sort(){\n\t\t$leaves=$this->find_leaves();\n\t\t$sorted=array();\n\t\t//sort leaves in order of priority\n\t\t$leaves=socialwiki_merge_sort_nodes($leaves);\n\t\t\n\t\tfor($i=0;$i<count($leaves);$i++){\n\t\t\t//if the parent is already in the tree add the leaf in the proper position\n\t\t\tif(array_key_exists($leaves[$i]->parent,$sorted)){\n\t\t\t\t$keyindex=$this->find_index($leaves[$i]->parent,$sorted);\n\t\t\t\t$copy=$sorted;\n\t\t\t\t$sorted=array_splice($sorted,0,$keyindex)+array($leaves[$i]->id=>$leaves[$i])+array_splice($copy,$keyindex);\n\t\t\t}else{\n\t\t\t\t$sorted[$leaves[$i]->id]=$leaves[$i];\n\t\t\t\tif($leaves[$i]->parent!=-1){\n\t\t\t\t\t$sorted=$this->add_parent($leaves[$i]->id,$sorted,1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->nodes=$sorted;\n\t\tforeach($this->nodes as $node){\n\t\t\tif($node->parent==-1){\n\t\t\t\t$this->add_levels($node->id,1);\n\t\t\t}\n\t\t}\n\t}", "function getSort(){\n return 155;\n }", "function getSort(){\n return 155;\n }", "function getSort(){\n return 155;\n }", "function listInOrder()\n {\n global $BD3;\n global $BD1;\n global $ANO_REF;\n $res_sql=\"select $BD3.final.id,\n $BD3.final.matr,\n $BD1.empregados.nome,\n $BD3.final.cargo,\n $BD3.final.agrup\n from $BD3.final,$BD1.empregados\n where $BD1.empregados.matr=$BD3.final.matr\n AND $BD3.final.ano='$ANO_REF'\n order by $BD1.empregados.nome;\";\n return sql(\"$BD3\",$res_sql);\n }", "public function sort(/* variable arguments */) {\n $this->sort = func_get_args();\n return $this;\n }", "function getSort(){\n return 188;\n }", "public static function resortStartOrder ($list, $startOrder)\r\n\t{\r\n\t\t# Return what is supplied if the list is not an array\r\n\t\tif (!is_array ($list) || empty ($list)) {return $list;}\r\n\t\t\r\n\t\t# Start an array of items\r\n\t\t$resortedList = array ();\r\n\t\t\r\n\t\t# Add each item in the list, ordered by the start order\r\n\t\tforeach ($startOrder as $item) {\r\n\t\t\tif (isSet ($list[$item])) {\r\n\t\t\t\t$resortedList[$item] = $list[$item];\r\n\t\t\t\tunset ($list[$item]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Add on the remainder not in the start order list\r\n\t\tif (!empty ($list)) {\r\n\t\t\t$resortedList += $list;\r\n\t\t}\r\n\t\t\r\n\t\t# Return the newly sorted list\r\n\t\treturn $resortedList;\r\n\t}", "public function natsort()\n {\n }", "public function getOrderList()\n {\n if ($this->_aOrderList === null) {\n $this->_aOrderList = array();\n\n // Load user Orderlist\n if ($oUser = $this->getUser()) {\n $iNrofCatArticles = (int) $this->getConfig()->getConfigParam('iNrofCatArticles');\n $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;\n $this->_iAllArtCnt = $oUser->getOrderCount();\n if ($this->_iAllArtCnt && $this->_iAllArtCnt > 0) {\n $this->_aOrderList = $oUser->getOrders($iNrofCatArticles, $this->getActPage());\n $this->_iCntPages = round($this->_iAllArtCnt / $iNrofCatArticles + 0.49);\n }\n }\n }\n\n return $this->_aOrderList;\n }", "public function PrintAsList()\n {\n $items = array();\n /** @var Node $current */\n $current = $this->head;\n while($current != null) \n\t\t{\n\t\t\t\n array_push($items, $current->data);\n $current = $current->next;\n }\n\t\t\n\t\t$this->bubbleSort($items);\n\t\t\n foreach($items as $item)\n {\n\t\t\techo $item . \"->\";\n }\n\n echo PHP_EOL;\n }", "public function generateList() {}", "public function generateList() {}", "public function generateList() {}", "public function getSortedPurses()\n {\n $purses = $this->purses;\n if (empty($purses)) {\n return $purses;\n }\n\n $getOrder = function ($currency) {\n $order = ['usd' => 0, 'eur' => 1];\n\n return $order[$currency] ?? 100;\n };\n\n usort($purses, function ($a, $b) use ($getOrder) {\n return $getOrder($a->currency) <=> $getOrder($b->currency);\n });\n\n return $purses;\n }", "function getSort(){\n return 999;\n }", "function getSort(){\n return 999;\n }", "public function generateOrder();", "public function sort(&$data)\n {\n if (is_array($data)) {\n $data = new DataList(...$data);\n }\n $dataToSort = $data->toArray();\n try {\n $data->replace($this->performSort(0, $dataToSort));\n } catch (CiteProcException $e) {\n //nothing to do, because $data is passed by referenced\n }\n }", "public function postSortWatchlist()\n {\n \n $list = Input::get('list');\n\n if(count($list)>0)\n {\n $watchlist = new Watchlist();\n return Response::json( $watchlist->sortWatchlist() );\n }\n else\n {\n return Response::json( \"false\" );\n }\n }", "public function getSortValue() {}", "public function sort_list()\r\n {\r\n return view( $this->_skin .'.web.help_sort');\r\n }", "public function getSorts() {\n return $this->sorts;\n }", "function getSort() {\n return 999;\n }", "protected function sort()\n {\n // if no comparator is passed sort the internal array\n // by its keys, else use the comparator\n if ($this->comparator == null) {\n return ksort($this->items);\n } else {\n return CollectionUtils::sort($this, $this->comparator);\n }\n }", "function getOrder();", "public static function sortables()\n {\n return ['plot_ref', 'plot_active', 'plot_percent_cultivated_land', 'plot_real_area', 'plot_start_date'];\n }", "public function toList();", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "public function sortLists () {\n\t\tuasort($this->layerList, array(\"WmsLayer\", \"compareNames\"));\n\t}", "public function testSortNamesList(): void\n {\n $result = $this->sorter->sortList(self::UNSORTED_NAMES_LIST);\n self::assertSame(\n // Don't tab the names list;\n // Good practice for unit test doesn't transform the expected result in any way.\n <<<SORTED\nMarin Alvarez\nAdonis Julius Archer\nBeau Tristan Bentley\nHunter Uriah Mathew Clarke\nLeo Gardner\nVaughn Lewis\nLondon Lindsey\nMikayla Lopez\nJanet Parsons\nFrankie Conner Ritter\nShelby Nathan Yoder\nSORTED,\n $result\n );\n }", "function pageList(){\n\t\t$path = ROOT . DS . 'pages';\n\t\t$pagesArray = array_diff(scandir($path), array('..', '.', '.svn','.htaccess'));\n\n\t\tforeach ($pagesArray as $page) {\n\t\t\t$tmp[basename($page)] = filemtime($page);\n\t\t}\n\t\tasort($tmp);\n\t\t$pagesArray = array_keys($tmp);\n\n\t\t// sorting by date can be added but name wise listing pages seems more pleasing.\n\t\t// later add extra sort-by-date option.\n\t\treturn $pagesArray;\n\t}", "function sort(Phlickr_Framework_IPhotoList $photolist) {\n foreach ($photolist->getPhotos() as $photo) {\n $id = $photo->getId();\n $keys[$id] = $this->_strategy->stringFromPhoto($photo);\n $photos[$id] = $photo;\n }\n\n if ($this->isInReverse()) {\n arsort($keys);\n } else {\n asort($keys);\n }\n\n $ret = array();\n foreach($keys as $id => $key) {\n $ret[] = $photos[$id];\n }\n return $ret;\n }", "public function sort()\n {\n $this->getFirstAndLastCard();\n $this->sortCards();\n\n return $this->cardsArray;\n }", "public static function getDefaultSorting()\n {\n\n }", "public function testSorting()\r\n\t{\r\n\t\t$this->assertAttributeCount( 0, 'priority_table', $this->list );\r\n\t\t$this->assertAttributeEquals( true, 'priority_resort', $this->list );\r\n\r\n\t\t// add dummy data\r\n\t\t$this->dummyData( true );\r\n\r\n\t\t// check count\r\n\t\t$this->assertEquals( 5, $this->list->count() );\r\n\r\n\t\t// check number items in priority table\r\n\t\t$this->assertAttributeCount( 5, 'priority_table', $this->list );\r\n\t\t$this->assertAttributeEquals( true, 'priority_resort', $this->list );\r\n\r\n\t\t// force a sort\r\n\t\t$this->assertNull( $this->list->rewind() );\r\n\r\n\t\t// check priority sorting toggle, should be off\r\n\t\t$this->assertAttributeEquals( false, 'priority_resort', $this->list );\r\n\t}", "public function mySort(array $array);", "public abstract function get_lists();" ]
[ "0.69468474", "0.66617936", "0.6541892", "0.64371854", "0.6356873", "0.6281121", "0.61487806", "0.6141705", "0.60801065", "0.60801065", "0.60801065", "0.607271", "0.6018271", "0.601227", "0.60061514", "0.59961003", "0.5981593", "0.5933787", "0.5903337", "0.58925813", "0.5848573", "0.5842357", "0.58406955", "0.5790106", "0.5757294", "0.57565814", "0.5740321", "0.57049805", "0.57037497", "0.56603587", "0.56528425", "0.56455594", "0.5612887", "0.5609644", "0.5590336", "0.55869627", "0.5573996", "0.5561403", "0.55610734", "0.5544218", "0.551891", "0.5495518", "0.54859054", "0.54821235", "0.54768574", "0.54768336", "0.54733616", "0.54733616", "0.54733616", "0.54705805", "0.546001", "0.545279", "0.5447255", "0.5442007", "0.5434589", "0.5424845", "0.54060453", "0.54019433", "0.53747386", "0.53713155", "0.53694564", "0.5359946", "0.5357808", "0.5357808", "0.5357808", "0.53551334", "0.5353659", "0.53527707", "0.53522515", "0.53400123", "0.5334597", "0.5333365", "0.5332347", "0.5332347", "0.53305143", "0.5315341", "0.531279", "0.531279", "0.52984893", "0.5297739", "0.52924657", "0.5284597", "0.52845484", "0.52822566", "0.5278437", "0.5274527", "0.526102", "0.52585995", "0.52570003", "0.5251209", "0.5250137", "0.5248844", "0.52462256", "0.524219", "0.5214186", "0.52087533", "0.52039427", "0.52036154", "0.5203379" ]
0.5277788
86
Receive and process the contents of an annotation
public function __construct(array $data) { $this->setParam($data, 'param'); $this->setParam($data, 'value'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseAnnotations ($ary) {\n if (isset($ary['description'])) {\n $this->output.= $this->getTab() . $ary['description']['0'] . $this->getNL();\n } else {\n $this->output.= $this->getTab() . \"No description\" . $this->getNL();\n }\n \n if (isset($ary['param'])) {\n $this->output.= $this->parseParams ($ary['param']);\n }\n \n if (isset($ary['return'])) {\n $this->output.= $this->getTab() . \"@return \" . $ary['return']['0'] . $this->getNL();\n }\n }", "public function processAnnotations()\n {\n foreach ($this->generatorRegistry->annotationManager->get(\"event\", true) as $tScanResult) {\n if ($tScanResult[AnnotationManager::LEVEL] !== \"staticMethods\") {\n continue;\n }\n\n foreach ($tScanResult[AnnotationManager::VALUE] as $tEvent) {\n $this->events->register(\n $tEvent[\"on\"],\n [$tScanResult[AnnotationManager::SOURCE], $tScanResult[AnnotationManager::MEMBER]],\n null,\n isset($tEvent[\"priority\"]) ? $tEvent[\"priority\"] : null\n );\n }\n }\n }", "public function getAnnotation() {}", "public function getAnnotations() {}", "protected function parseAnnotate(string $annotate): array\n {\n $annotationResult = [];\n if (preg_match_all('~((' . $this->attributes . ')\\s*=(\\{.*?\\}))~', $annotate, $matches) && count($matches) == 4) {\n $annotate = str_replace($matches[1], '', $annotate);\n foreach ($matches[2] as $k => $name):\n $value = $matches[3][$k] ?? [];\n if ($value && strpos($value, ':') === false) {\n $annotationResult[$name] = explode(',', str_replace(['{', '}', ' '], '', $value));\n } else {\n $annotationResult[$name] = json_decode($value, true);\n }\n endforeach;\n }\n $annotationOthers = parent::parseAnnotate($annotate);\n return !empty($annotationResult) ? array_merge($annotationOthers, $annotationResult) : $annotationOthers;\n }", "private function assignAnnotations(): void\n {\n $swagResponses = array_filter($this->annotations, function ($annotation) {\n return $annotation instanceof SwagResponseSchema;\n });\n\n foreach ($swagResponses as $annotate) {\n $mimeTypes = $annotate->mimeTypes;\n if (empty($mimeTypes)) {\n $mimeTypes = $this->config->getResponseContentTypes();\n }\n\n foreach ($mimeTypes as $mimeType) {\n $content = (new Content())->setMimeType($mimeType);\n\n $response = (new Response())->setCode($annotate->httpCode)->setDescription($annotate->description);\n\n if (empty($annotate->schemaFormat) && empty($annotate->schemaItems) && empty($annotate->refEntity)) {\n $response->pushContent($content);\n $this->operation->pushResponse($response);\n continue;\n }\n\n if ($mimeType == 'text/plain') {\n $schema = (new Schema())->setType('string');\n\n if ($annotate->schemaFormat) {\n $schema->setFormat($annotate->schemaFormat);\n }\n } else {\n if (count($annotate->schemaItems) > 0) {\n $ref = reset($annotate->schemaItems);\n $action = 'index';\n }\n\n $schema = $this->getMimeTypeSchema(\n $mimeType,\n $action ?? 'view',\n $ref ?? $annotate->refEntity\n );\n }\n\n if (!empty($annotation->schemaType)) {\n $schema->setFormat($annotate->schemaType);\n }\n\n $content->setSchema($schema);\n\n $response->pushContent($content);\n\n $this->operation->pushResponse($response);\n }\n }\n }", "public static function analysisDocument(string $document):array {\n $annotationArray = array();\n $matchFlag = preg_match(self::ANNOTATION_REGULAR,$document,$matchOut);\n if ($matchFlag === false) {\n return $annotationArray;\n } else {\n $annotations = array();\n foreach($matchOut as $key => &$value) {\n $searchPrefix = strpos($value,\"(\");\n $annotation = array();\n if ($searchPrefix !== false) {\n $annotationName = substr($value,0,$searchPrefix);\n $annotation['name'] = $annotationName;\n $searchSuffix = strpos($value,\")\");\n $values = array();\n if ($searchSuffix !== false) {\n $valueStr = substr($value,$searchPrefix,$searchSuffix);\n $valueStrArray = explode(\",\",$valueStr);\n foreach ($valueStrArray as $subValue) {\n $splitSubValue = explode(\"=\",$subValue);\n if (count($splitSubValue) == 2) {\n $splitSubValueArr['propertyName'] = $splitSubValue[0];\n $splitSubValueArr['propertyValue'] = $splitSubValue[1];\n array_push($values,$splitSubValueArr);\n }\n }\n\n }\n $annotation['value'] = $values;\n } else {\n $annotation['name'] = $value;\n }\n array_push($annotations,$annotation);\n }\n return $annotations;\n }\n }", "public function testParseProcessAnnotationElement(): void\n {\n $sch = $this->sut->parse($this->getXs('annotation_0002.xsd'));\n \n self::assertElementNamespaceDeclarations(\n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n ], \n $sch\n );\n self::assertSchemaElementHasNoAttribute($sch);\n self::assertCount(1, $sch->getElements());\n \n $ct = $sch->getComplexTypeElements()[0];\n self::assertElementNamespaceDeclarations([], $ct);\n self::assertComplexTypeElementHasNoAttribute($ct);\n self::assertCount(1, $ct->getElements());\n \n $sc = $ct->getContentElement();\n self::assertElementNamespaceDeclarations([], $sc);\n self::assertSimpleContentElementHasNoAttribute($sc);\n self::assertCount(1, $sc->getElements());\n \n $ext = $sc->getDerivationElement();\n self::assertElementNamespaceDeclarations([], $ext);\n self::assertSimpleContentExtensionElementHasNoAttribute($ext);\n self::assertCount(1, $ext->getElements());\n \n $ann = $ext->getAnnotationElement();\n self::assertElementNamespaceDeclarations([], $ann);\n self::assertAnnotationElementHasNoAttribute($ann);\n self::assertSame([], $ann->getElements());\n }", "public function getAnnotation($folder, $annotation)\n {\n list($entry, $type) = $this->_getAnnotateMoreEntry($annotation);\n $result = Horde_Kolab_Storage_Exception_Pear::catchError(\n $this->getBackend()->getAnnotation(\n $entry, $type, $this->encodePath($folder)\n )\n );var_dump($result);\n foreach ($result as $element) {\n if (isset($element['ATTRIBUTES'][$type])) {\n return $element['ATTRIBUTES'][$type];\n }\n }\n return '';\n }", "public function getAnnotationDictionary() {}", "public function testParseProcessAnnotationElement(): void\n {\n $sch = $this->sut->parse($this->getXs('annotation_0002.xsd'));\n \n self::assertElementNamespaceDeclarations(\n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n ], \n $sch\n );\n self::assertSchemaElementHasNoAttribute($sch);\n self::assertCount(1, $sch->getElements());\n \n $attr = $sch->getAttributeElements()[0];\n self::assertElementNamespaceDeclarations([], $attr);\n self::assertAttributeElementHasNoAttribute($attr);\n self::assertCount(1, $attr->getElements());\n \n $ann = $attr->getAnnotationElement();\n self::assertElementNamespaceDeclarations([], $ann);\n self::assertAnnotationElementHasNoAttribute($ann);\n self::assertSame([], $ann->getElements());\n }", "public function getAnnotations()\n {\n // Also provide the path to the commandfile that these annotations\n // were pulled from and the classname of that file.\n $path = $this->reflection->getFileName();\n $className = $this->reflection->getDeclaringClass()->getName();\n return new AnnotationData(\n $this->getRawAnnotations()->getArrayCopy() +\n [\n 'command' => $this->getName(),\n '_path' => $path,\n '_classname' => $className,\n ]\n );\n }", "private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }", "function textus_get_annotations($textid)\n{\n global $currentuser;\n $annotations = array();\n if (!$textid) {\n return wp_send_json(\"No text id was given\");\n }\n\n $notes = textus_db_select_annotation($textid);\n if (!$notes)\n {\n //actually do we want to return an empty JSON message?\n $annotations = array('error' => 'No annotations could be found for this text' );\n } else {\n foreach ($notes as $note)\n {\n $note_user = get_user_by('id', $note->userid);\n // put the notes into the correct structure\n $annotations[] = array(\n \"id\" => intval($note->id),\n \"start\" => intval($note->start), \n \"end\" => intval($note->end), \n \"type\" => \"textus:comment\",\n \"user\" => $note_user->user_nicename,\n //\"time\" => $note->time, \n //\"private\" => $note->private, \n \"payload\" => array(\n //\"language\" => $note->language, \n \"text\" => $note->text)\n );\n }\n }\n return $annotations;\n}", "public function isAnnotation();", "public function listAnnotation($annotation)\n {\n list($entry, $value) = $this->_getAnnotateMoreEntry($annotation);\n $list = array();\n $result = Horde_Kolab_Storage_Exception_Pear::catchError(\n $this->getBackend()->getAnnotation($entry, $value, '*')\n );\n foreach ($result as $element) {\n if (isset($element['ATTRIBUTES'][$value])) {\n $list[$element['MAILBOX']] = $element['ATTRIBUTES'][$value];\n }\n }\n return $this->decodeListKeys($list);\n }", "public function parseTextAnnotations()\n {\n $enhancements = array();\n\n /*\n * Gets the text annotations\n */\n $textAnnotations = $this->model->resourcesMatching(RDF::TYPE, array('type' => 'uri', 'value' => FISE::TEXT_ANNOTATION));\n $modelArray = $this->model->toRdfPhp();\n\n foreach ($textAnnotations as $taResource) {\n if (isset($modelArray[$taResource->getUri()][DCTerms::CREATOR]) && $modelArray[$taResource->getUri()][DCTerms::CREATOR][0]['value'] == self::$LANGUAGE_DETECTION_ENHANCEMENT_ENGINE)\n continue;\n\n $textAnnotation = new TextAnnotation($taResource->getUri());\n $this->setTextAnnotationData($textAnnotation);\n\n $enhancements[$textAnnotation->getUri()] = $textAnnotation;\n }\n\n return $enhancements;\n }", "public function getAnnotation(string $annotationClass);", "private function getAnnotations() {\n //$uri = 'http://purl.org/net7/dev.korbo2/item/41';\n $uri = ($this->itemToDelete == null) ? $this->getContainer()->getParameter('korbo_base_purl_uri') . $this->itemIdToDelete : $this->itemToDelete->getUri();\n\n $annotations = array();\n\n $query = <<<EOT\nselect ?s ?p ?o ?c\nwhere {\nGRAPH ?c {\n?s ?p <{$uri}>\n}\n}\n\nEOT;\n\n //$baseUrl = \"http://demo-cloud.as.thepund.it:8080\";\n\n $annotationList = json_decode($this->doApiRequest($this->asSesameBaseApiUrl . \"/openrdf-sesame/repositories/pundit?query=\" . urlencode($query) . '&queryLn=SPARQL'), true);\n //echo $this->asSesameBaseApiUrl . \"/openrdf-sesame/repositories/pundit?query=\" . urlencode($query) . '&queryLn=SPARQL';die;\n if ($annotationList == '') return array();\n\n foreach ($annotationList['results']['bindings'] as $annotation) {\n $annotationId = substr(strrchr($annotation['c']['value'], \"-\"), 1);\n $annotationMetadata = json_decode($this->doApiRequest($this->asSesameBaseApiUrl . \"/annotationserver/api/open/annotations/\" . $annotationId), true);\n\n //print_r($annotationMetadata);die;\n $predicateKey = '';\n $annotationXpointer = '';\n foreach ($annotationMetadata['graph'] as $key => $value) {\n $annotationXpointer = $key;\n foreach ($value as $predValue => $val) {\n $predicateKey = $predValue;\n break;\n }\n }\n\n $subject = '';\n $predicate = '';\n\n foreach ($annotationMetadata['items'] as $key => $element) {\n if (strpos($key, \"xpointer\") !== false) {\n $subject = $element['http://purl.org/dc/elements/1.1/description'][0]['value'];\n }\n\n if ($key == $predicateKey) {\n $predicate = $element['http://www.w3.org/2000/01/rdf-schema#label'][0]['value'];\n }\n }\n\n //print_r($annotationMetadata);die;\n $annotations[] = array(\"s\" => $subject, 'p' => $predicate,\n 'xpointer' => $annotationXpointer, 'context' => $annotation['c']['value'],\n 'predicateUri' => $predicateKey, 'annotationId' => $annotationId,\n 'page-context' => $annotationMetadata['metadata'][\"http://purl.org/pundit/as/annotation/\" . $annotationId]['http://purl.org/pundit/ont/ao#hasPageContext'][0]['value']);\n\n\n }\n\n return $annotations;\n }", "public function getAnnotations() {\n\t\t$result = \"\";\n\t\t\n\t\t$serviceFound = false;\n\t\t\n\t\t// Construct the heading of the RDF/XML document\n\t\tif (!$serviceFound) { \n\t\t\t$result = fillAnnotationHeader(fetchUUID());\n\t\t}\n\t\t\n\t\t$join =\"\";\n\t\t$sqlWhere = \"\";\n\t\t// limit to current collection(s)\n\t\tif(array_key_exists(\"db\",$this->searchTermsArr)){\n\t\t\t$join = \"left join omoccurrences o on e.occid = o.occid \";\n\t\t\tif(strpos($this->searchTermsArr[\"db\"],\"all\") === false){\n\t\t\t\t$dbStr = preg_replace('/;catid:\\d*/','',$this->searchTermsArr[\"db\"]);\n\t\t\t\t$sqlWhere .= \"AND (o.CollID IN(\".str_replace(\";\",\",\",trim($dbStr,';')).\")) \";\n\t\t\t}\n\t\t\telseif(preg_match('/;catid:(\\d+)/',$this->searchTermsArr[\"db\"],$matches)){\n\t\t\t\t$catId = $matches[1];\n\t\t\t\tif($catId) $sqlWhere .= \"AND (o.CollID IN(SELECT collid FROM omcollcatlink WHERE (ccpk = \".$catId.\"))) \";\n\t\t\t}\n\t\t}\t\t\n\t\t\n // variables used in constructing an annotation.\n\t\t$uuid = \"\";\n\t\t$timestamp = \"\";\n\t\t$annotator = \"\";\n\t\t$emailsha1hash = \"\";\n\t\t$institutioncode = \"\";\n\t\t$collectioncode = \"\";\n\t\t$catalognumber = \"\";\n\t\t$occurrenceid = \"\";\n\t\t$kvpList = array(); // Note: array implementation allows for one value for each key - keys can't repeat within an annotation.\n\t\t\n\t\t// find sets of edits to create as annotations. Get timestamp as metadata\n\t\t$sql = \"select count(*), e.uid, e.initialtimestamp, e.occid \" . \n\t\t \" from omoccuredits e $join $sqlWhere \". \n\t\t \" group by e.uid, e.initialtimestamp, e.occid, \" . \n\t\t \" order by e.uid, e.occid, e.initialtimestamp \";\n\t\tif ($statement = $connection->prepare($preparesql)) {\n\t\t\t$statement->execute();\n\t\t\t$statement->bind_result($uid, $timestamp, $occid);\n\t\t\twhile ($statement->fetch()) { \n\n\t\t\t\t\n\t\t\t\t// fetch the annotator's name and md5 hash of email for the annotation metadata\n\t\t\t\t$sql = \"select concat(firstname, ' ', lastname), sha1(email) from users where uid = ?\";\n\t\t\t\tif ($statement_a = $connection->prepare($preparesql)) {\n\t\t\t\t\t$statement_a->bind_param(\"i\", $uid);\n\t\t\t\t\t$statement_a->execute();\n\t\t\t\t\t$statement_a->bind_result($annotator, $emailsha1hash);\n\t\t\t\t\t$statement_a->fetch();\n\t\t\t\t\t$statement_a->close();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// fetch the information to build a query selector\n\t\t\t\t$sql = \"select c.institutioncode, c.collectioncode, o.catalognumber \" .\n\t\t\t\t\t\t \" from omoccurrences o left join omcollections c on o.collid = c.collid \" . \n\t\t\t\t\t\t \" where occid = ? \";\n\t\t\t\tif ($statement_a = $connection->prepare($preparesql)) {\n\t\t\t\t\t$statement_a->bind_param(\"i\", $occid);\n\t\t\t\t\t$statement_a->execute();\n\t\t\t\t\t$statement_a->bind_result($institutioncode, $collectioncode, $catalognumber);\n\t\t\t\t\t$statement_a->fetch();\n\t\t\t\t\t$statement_a->close();\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// fetch body of the annotation\n\t\t\t\t$sql = \"select fieldname, fieldvaluenew \" .\n\t\t\t\t\t\t \" from omoccuredits \" . \n\t\t\t\t\t\t \" where uid = ? and occid = ? and initialtimestamp = ? \";\n\t\t\t\tif ($statement_a = $connection->prepare($preparesql)) {\n\t\t\t\t\t$statement_a->bind_param(\"iis\", $uid, $occid, $timestamp);\n\t\t\t\t\t$statement_a->execute();\n\t\t\t\t\t$statement_a->bind_result($key, $value);\n\t\t\t\t\twhile ($statement_a->fetch()) { \n\t\t\t\t\t\t$kvpList[$key]=$value;\n\t\t\t\t\t}\n\t\t\t\t\t$statement_a->close();\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// is service to build the annotation available?\n\t\t\t\tif ($serviceFound) {\n\t\t\t\t\t// build annotation with service.\n\t\t\t\t} else {\n\t\t\t\t\t// if not, fill in a template\n\t\t\t\t\t$result .= fillAnnotationTemplate(fetchUUID(), $timestamp, $annotator, $emailsha1hash, $institutioncode, $collectioncode, $catalognumber, $occurrenceid, $kvpList);\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\t// reset the array of key value pairs\n\t\t\t\t$kvpList = array(); \n\t\t\t\t\n\t\t\t}\n\t\t\t$statement->close();\n\t\t}\n\n\t\t// Finish up the RDF/XML document.\n\t\tif (!$serviceFound) { \n\t\t\t$result .= \"</rdf:RDF>\";\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function addReply(\\SetaPDF_Core_Document_Page_Annotation_Markup $annotation) {}", "public function extract();", "public function extract();", "public function annotation(string $annotation)\n {\n return $this->annotated_method ? $this->annotated_method->annotation($annotation) : null ;\n }", "public function read($argument)\n {\n // Get Reflection.\n $reflection = $this->getReflectionFrom($argument);\n\n // We have some specific annotations to be read.\n if ($this->wantsSpecificAnnotation()) {\n return $this->readSpecificAnnotationFor($reflection);\n }\n\n // We require to read all annotations.\n return $this->readAllAnnotationsFor($reflection);\n }", "public function getRawAnnotations()\n {\n $this->parseDocBlock();\n return $this->otherAnnotations;\n }", "function ucsc_downloadAnnotations($organism_version,$gene_prediction,&$annotation_list,$type){\n global $dir;global $annot_loadscript; $file=\"ucsc_$organism_version-$gene_prediction-transcripts.txt\"; \n if($type==\"feature\")$file=\"ucsc_$organism_version-$gene_prediction.txt\";\n $annot_file=\"/tmp/webservices_uploads/$file\";$zipfile=\"$annot_file.gz\";global $service_url;\n if(!file_exists(\"$zipfile\")){ \n exec(\"$perl $annot_loadscript -f $annot_file -v $organism_version -a $gene_prediction -d ucsc\",$output);\n }\n $Diff = (time() - filectime(\"$zipfile\"))/60/60/24;//also check the last mod date < 21 days\n if ($Diff > 21) exec(\"$perl $annot_loadscript -f $annot_file -v $organism_version -a $gene_prediction -d ucsc\",$output);\n $annotation_list[]=array('annotfile'=>array('name'=>\"$service_url/$file.gz\"));\n}", "public static function readAnnotationValue(string $doc, string $tag){\n preg_match_all(\"#@$tag(.*?)\\n#s\", $doc, $annotations);\n return (isset($annotations[1][0]))? trim($annotations[1][0]) : false;\n }", "public function parseAnnotations($docblock) {\r\n\t\t$annotations = array();\r\n\t\tpreg_match_all(static::ANNOTATION, $docblock, $matches, PREG_SET_ORDER);\r\n\t\tforeach ($matches as $match) {\r\n\t\t\t$annotations[$match[1]] = isset($match[2]) ? $match[2] : null;\r\n\t\t}\r\n\t\treturn $annotations;\r\n\t}", "public function setInReplyTo(\\SetaPDF_Core_Document_Page_Annotation_Markup $annotation) {}", "public function getAnnotation(): ?string;", "public function getAnnotation(): ?string;", "function annotateTerms($abstract) {\n $emails = explode(',', BECAS_EMAIL);\n $tools = explode(',', BECAS_TOOL); \n $pos = mt_rand(0,count($emails)-1);\n $annotated_sentences = array();\n $parameters = array('email' => $emails[$pos], 'tool' => $tools[$pos]);\n try { \n $resp_becas = Request::post(BECAS_URL . '?' . http_build_query($parameters), '{\"groups\": {\"DISO\": true}, \"format\": \"json\", \"text\": \"'.$abstract.'\"}')\n ->addHeaders(array('Content-Type' => 'application/json'))\n ->send();\n if ($resp_becas->hasBody()) {\n if (!empty($resp_becas->body->entities)) {\n $annotated_sentences = $resp_becas->body->entities; // We now get the first one.\n }\n else {\n $annotated_sentences = $resp_becas->body; \n } \n }\n }\n catch (Httpful\\Exception\\ConnectionErrorException $e) {\n printf(\"The connection to the BECAS annotation API failed with code: %s.\\n\", $e->getCode()); \n } \n return $annotated_sentences;\n}", "public function onProcess(){\n $id = $this->event->getData();\n \n // retrieve data from database\n $tweet = $this->appmanager->getInfosById($id); \n \n $this->event->setResponse($tweet); \n \n }", "public static function parseComments($texts, $tokenId, $tokenName) {\n\t\t\tif ( !is_array($texts) ) $texts = array($texts);\n\n\t\t\t$annotations = array();\n\t\t\tforeach ( $texts as $text ) {\n\t\t\t\t//print \"Parsing \\\"\".$text.\"\\\"\".LF;\n\t\t\t\t\n\t\t\t\tif ( preg_match(\"/^\\/\\/(.+)$/\", $text, $m) ) {\n\t\t\t\t\t// 1\n\t\t\t\t\t//print \"Annotation type 1: \".$m[1].LF;\n\t\t\t\t}\n\t\t\t\telse if ( preg_match(\"/\\/\\*(.+)\\*\\//s\", $text, $m) ) {\n\t\t\t\t\t// 2\n\t\t\t\t\t//print \"Annotation type 2: \".$m[1].LF;\n\t\t\t\t}\n\t\t\t\telse if ( false && preg_match(\"/\\/\\*\\*(.+)\\*\\//s\", $text, $m) ) {\n\t\t\t\t\t// 3\n\t\t\t\t\t//print \"Annotation type 3: \".$m[1].LF;\n\t\t\t\t}\n\t\t\t\telse return array();\t// nothing\n\n\t\t\t\t$text = $m[1];\n\t\t\t\tpreg_match(\"/^\\@([A-Z][^\\(]+)(\\(.+\\))?/\", trim($text), $m);\n\n\t\t\t\t//print \"Annotation: \".$m[1].LF;\n\t\t\t\t$class = self::$_registeredClasses[$m[1]];\n\t\t\t\tif ( !$class ) $class = \"Annotation\";\n\n\t\t\t\t//print \"Annotation class: \".$class.LF;\n\n\t\t\t\teval(\"\\$a = new \".$class.\"();\");\n\t\t\t\t$a->name = $m[1];\n\t\t\t\t// TODO: limited to a sinlge param as string param may have comma inside.\n\t\t\t\t//$args = t(explode(\",\", substr($m[2], 1, -1)));\n\t\t\t\t$args = t(array(substr($m[2], 1, -1)));\n\t\t\t\t// remove quotes:\n\t\t\t\tforeach ( $args as $i => $arg ) {\n\t\t\t\t\t$args[$i] = preg_replace(\"/^[\\\"\\'](.+)[\\\"\\']$/\", \"$1\", $arg);\n\t\t\t\t}\n\t\t\t\t$a->args = $args;\n\t\t\t\t$a->tokenId = $tokenId;\n\t\t\t\t$a->tokenName = $tokenName;\n\n\t\t\t\t$annotations[] = $a;\n\t\t\t}\n\t\t\treturn $annotations;\n\t\t}", "public static function fillAnnotationTemplate($uuid, $timestamp, $annotator, $emailsha1hash, $institutioncode, $collectioncode, $catalognumber, $occurrenceid, $kvpList) { \n\t\t$id = \"\\$Id: OccurrenceAnnotationManager.php 1578 2014-02-19 19:32:22Z egbot $\"; // obtain svn:keyword properties? \n\t\t$rev = \"\\$Rev: 1578 $\";\n$result = \" <oa:Annotation rdf:about=\\\"urn:uuid:$uuid#Annotation\\\">\n\t\t <oa:motivatedBy rdf:resource=\\\"http://www.w3.org/ns/oa#editing\\\"/>\n\t\t <oa:annotatedAt>$timestamp</oa:annotatedAt>\n\t\t <oa:serializedBy rdf:resource=\\\"urn:uuid:$uuid#Serializer_0\\\"/>\n\t\t <oa:annotatedBy>\n\t\t <foaf:Agent rdf:about=\\\"urn:uuid:$uuid#Annotator_0\\\">\n\t\t <foaf:name>$annotator</foaf:name>\n\t\t <foaf:mbox_sha1sum>$emailsha1hash</foaf:mbox_sha1sum>\n\t\t </foaf:Agent>\n\t\t </oa:annotatedBy>\n\t\t <oad:hasExpectation>\n\t\t <oad:Expectation_Update />\n\t\t </oad:hasExpectation>\n\t\t <oa:hasTarget>\n\t\t <oa:SpecificResource rdf:about=\\\"urn:uuid:$uuid#Target_0\\\">\n\t\t <oa:hasSelector/>\n\t\t <oad:KVPairQuerySelector rdf:about=\\\"urn:uuid:$uuid#Selector_0\\>\n\t\t <dwc:instututionCode>$institutioncode</dwc:institutionCode>\n\t\t <dwc:collectionCode>$collectioncode</dwc:collectionCode>\n\t\t <dwc:catalogNumber>$catalognumber</dwc:catalogNumber>\n\t\t <dwcFP:hasOccurrenceID>$occurrenceid</dwcFP:hasOccurrenceID>\n\t\t <rdf:type rdf:resource=\\\"http://filteredpush.org/ontologies/oa/dwcFP.owl#Occurrence\\\"/>\n\t\t </oad:KVPairQuerySelector>\n\t\t <oa:hasSource rdf:resource=\\\"dwcFP:AnySuchResource\\\"/>\n\t\t </oa:SpecificResource>\n\t\t </oa:hasTarget>\n\t\t <oad:hasEvidence>\n\t\t <oad:Evidence rdf:about=\\\"urn:uuid:$uuid#Evidence_0\\\">\n\t\t <cnt:chars xml:lang=\\\"en\\\">Approved Edit in Symbiota.</cnt:chars>\n\t\t <rdf:type rdf:resource=\\\"http://www.w3.org/2011/content#ContentAsText\\\"/>\n\t\t </oad:Evidence>\n\t\t </oad:hasEvidence>\n\t\t <oa:serializedBy> \n <foaf:Agent rdf:about=\\\"http://sourceforge.net/p/symbiota/svn/$rev/tree/trunk/classes/OccurrenceAnnotationManager\\\">\n <foaf:name>$id</foaf:name>\n </foaf:Agent>\n\t\t </oa:serialziedBy>\n <oa:hasBody>\n <oa:Body rdf:about=\\\"urn:uuid:$uuid#Body_0\\\">\\n\";\n\t\tforeach ($kvpList as $key => $value) { \n\t\t $result .= \" \t\t <dwc:$key>$value</dwc:$key>\\n\";\n\t\t} \n\t\t$result .= \" </oa:Body>\\n\";\n\t\t$result .= \" </oa:hasBody>\\n\";\n\t\t$result .= \" </oa:Annotation>\";\n\n\t\treturn $result;\n\t}", "private function aim_parse_im($data)\r\n\t{\r\n\t\tif (!empty($data) && is_array($data)) {\r\n\t\t\t@list($alert, $text) = explode(' ', $data['message'], 2);\r\n\t\t\tunset($data['message']);\r\n\t\t\t$alert = trim($alert);\r\n\t\t\t$text = trim($text);\r\n\t\t\tif (@$alert{0} == '!') {\r\n\t\t\t\t$alert = substr($alert, 1);\r\n\t\t\t\t$data['message_alert'] = $alert;\r\n\t\t\t\t$data['message_text'] = (!empty($text)) ? $text : null;\r\n\t\t\t\tif ($this->core->user['debug'] === true) print_r($data);\r\n\t\t\t\tif (array_key_exists(strtolower($alert), $this->core->handlers)) {\r\n\t\t\t\t\t$this->core->callbacks->{$this->core->handlers[strtolower($alert)]['callback']}($data);\r\n }\r\n\t\t\t} \r\n\t\t} else {\r\n\t\t\tthrow new TACException('Data stream to ' . __CLASS__ . '::' . __FUNCTION__ . ' is invalid');\r\n\t\t}\r\n\t}", "public function getAnnotations()\n {\n return $this->_annotations;\n }", "protected function readSpecificAnnotationFor($reflection)\n {\n // Construct Method to be used for reading.\n $methodName = $this->constructReadMethod();\n\n // Read, Collect and return annotations.\n return collect($this->reader->{$methodName}($reflection, $this->annotationName));\n }", "function annotateText($text)\n {\n $this->trace(__METHOD__.\" \".$text);\n \n //gestion du cache\n $uMd5 = md5(__METHOD__.$text);\n $infos = $this->cache->load($uMd5);\n if(!$infos){\n \n // Call the classifyText function\n $response = $this->language->annotateText($text);\n $infos = $response->info();\n if($this->bTrace){\n // Print out information about each category\n foreach ($infos as $k => $v) {\n $this->trace($k, $v);\n }\n }\n $this->cache->save($infos, $uMd5);\n }\n $this->trace(\"reponse de google = \",$infos);\n return $infos;\n \n }", "public function parseEntityAnnotations()\n {\n $enhancements = array();\n\n /*\n * Gets the entity annotations\n */\n $entityAnnotations = $this->model->resourcesMatching(RDF::TYPE, array('type' => 'uri', 'value' => FISE::ENTITY_ANNOTATION));\n foreach ($entityAnnotations as $eaResource) {\n\n $entityAnnotation = new EntityAnnotation($eaResource->getUri());\n $this->setEntityAnnotationData($entityAnnotation);\n\n $enhancements[$entityAnnotation->getUri()] = $entityAnnotation;\n }\n\n return $enhancements;\n }", "protected function parseAnnotations($str)\n {\n $annotations = [];\n preg_match_all($this->dataPattern, $str, $found);\n foreach ($found[2] as $key => $value) {\n $annotations[ $this->sanitizeKey($found[1][$key]) ][] = $this->parseValue(trim($value), $found[1][$key]);\n }\n\n return $annotations;\n }", "function getClassAnnotation(\\ReflectionClass $class, $annotationName);", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotations()\n {\n return $this->annotations;\n }", "public function getAnnotation($name)\n\t{\n\t\t$res = ComponentReflection::parseAnnotation($this, $name);\n\t\treturn $res ? end($res) : null;\n\t}", "private function getAnnotationArrayFromDocComment($docComment) {\r\n $annotationsArray = [];\r\n preg_match_all('# @(.*?)\\n#s', $docComment, $annotations);\r\n foreach ($annotations[1] as $annotation) {\r\n $explodedAnnotation = explode(' ', $annotation, 2);\r\n if (isset($explodedAnnotation[1])) $annotationsArray[trim($explodedAnnotation[0])] = trim($explodedAnnotation[1]);\r\n else $annotationsArray[trim($explodedAnnotation[0])] = '';\r\n }\r\n return $annotationsArray;\r\n }", "function ucsc_getListGenePrediction($orgv,&$predictions){\n checkConfig(); global $annot_file;\n $lines=file($annot_file);\n foreach($lines as $line){\n list($orgg,$org,$version,$data)=explode(\",\",$line);\n if(strtoupper($orgv)==strtoupper($version)){\n $annots=split(\":\",$data);\n foreach($annots as $annot)\n $predictions[]=array('prediction'=>array('name'=>$annot,'id'=>$annot));\n break;\n }\n }\n}", "function extract()\n {\n }", "public function addAnnotation()\n {\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $this->checkTokenInUrl();\n\n // the date used is for the annotation manager HTML that gets echo'd. we\n // use this date for the new annotation, unless it is a date range, in\n // which case we use the first date of the range.\n $date = Common::getRequestVar('date');\n if (strpos($date, ',') !== false) {\n $date = reset(explode(',', $date));\n }\n\n // add the annotation. NOTE: permissions checked in API method\n Request::processRequest(\"Annotations.add\", array('date' => $date));\n\n $managerDate = Common::getRequestVar('managerDate', false);\n $managerPeriod = Common::getRequestVar('managerPeriod', false);\n return $this->getAnnotationManager($fetch = true, $managerDate, $managerPeriod);\n }\n }", "protected function parseDoctrineAnnotation($content)\n {\n $content = sprintf('{%s}',preg_replace('/\\s*(\\w+)=/', '\"$1\":', $content));\n $data = $this->parseJsonContent($content, __METHOD__);\n\n if (!is_array($data)) {\n throw new DomainException(sprintf(\n '%s expects the annotation to define a JSON object or array; received \"%s\"',\n __METHOD__,\n gettype($data)\n ));\n }\n\n return $data;\n }", "private function _annotate()\n\t{\n\t\t$this->bg->annotateImage( $this->text, 373, 19, 0, 'TOTAL KILLS');\n\t\t$this->bg->annotateImage( $this->text, 471, 19, 0, $this->totalKills);\n\t\t$this->bg->annotateImage( $this->text, 373, 33, 0, 'TOTAL DEATHS');\n\t\t$this->bg->annotateImage( $this->text, 471, 33, 0, $this->totalDeaths);\n\t\t$this->bg->annotateImage( $this->text, 374, 47, 0, 'KD RATIO');\n\t\t$this->bg->annotateImage( $this->text, 471, 47, 0, $this->killDeathRatio);\n\t\t$this->bg->annotateImage( $this->text, 374, 73, 0, 'WEAPON OF CHOICE');\n\n\t\t//this sets the weapon text to the very right so we can prevent overflow\n\t\t$this->bg->annotateImage( $this->bigText, (500 - $this->metrics['favoriteWeapon']['textWidth']) - 10, 95, 0, $this->favoriteWeapon);\n\t\t//put the spartans name in the middle of the image (horizontally)\n\t\t$this->bg->annotateImage( $this->bigText, (250 - ($this->metrics['spartan']['textWidth'] / 2)), 35, 0, rawurldecode($this->spartan));\n\t}", "protected function parse() {}", "function annotation_user_complete($course, $user, $mod, $annotation) {\n}", "public function saveAnnotation()\n {\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $this->checkTokenInUrl();\n\n $view = new View('@Annotations/saveAnnotation');\n\n // NOTE: permissions checked in API method\n // save the annotation\n $view->annotation = Request::processRequest(\"Annotations.save\");\n\n return $view->render();\n }\n }", "public function testMultipleAnnotationsMultipleParams() {\n $comment = <<<'EOT'\n/**\n * This is a comment that contains multiple annotations with multiple parameters\n *\n * @Hotdog(brand = Maple Leaf, bun = true, cooking_method = BBQ)\n * @Hamburger(brand = Home Made, bun = true, cooking_method = BBQ)\n * @KraftDinner(brand = Kraft, bun = false, cooking_method = stove)\n */\nEOT;\n\n $annotations = new Annotations($comment);\n $msg = print_r($annotations, true);\n\n $this->assertTrue(isset($annotations['hotdog']), $msg);\n $this->assertTrue(isset($annotations['hamburger']), $msg);\n $this->assertTrue(isset($annotations['kraftdinner']), $msg);\n\n $annoVal = $annotations['hotdog'];\n $this->assertInternalType('array', $annoVal, $msg);\n $this->assertArrayHasKey('brand', $annoVal, $msg);\n $this->assertArrayHasKey('bun', $annoVal, $msg);\n $this->assertArrayHasKey('cooking_method', $annoVal, $msg);\n $this->assertEquals('Maple Leaf', $annoVal['brand'], $msg);\n $this->assertTrue($annoVal['bun'], $msg);\n $this->assertEquals('BBQ', $annoVal['cooking_method'], $msg);\n\n $annoVal = $annotations['hamburger'];\n $this->assertInternalType('array', $annoVal, $msg);\n $this->assertArrayHasKey('brand', $annoVal, $msg);\n $this->assertArrayHasKey('bun', $annoVal, $msg);\n $this->assertArrayHasKey('cooking_method', $annoVal, $msg);\n $this->assertEquals('Home Made', $annoVal['brand'], $msg);\n $this->assertTrue($annoVal['bun'], $msg);\n $this->assertEquals('BBQ', $annoVal['cooking_method'], $msg);\n\n $annoVal = $annotations['kraftdinner'];\n $this->assertInternalType('array', $annoVal, $msg);\n $this->assertArrayHasKey('brand', $annoVal, $msg);\n $this->assertArrayHasKey('bun', $annoVal, $msg);\n $this->assertArrayHasKey('cooking_method', $annoVal, $msg);\n $this->assertEquals('Kraft', $annoVal['brand'], $msg);\n $this->assertFalse($annoVal['bun'], $msg);\n $this->assertEquals('stove', $annoVal['cooking_method'], $msg);\n }", "public function extract()\n {\n }", "public function getAnnotation($name)\n {\n // hasAnnotation parses the docblock\n if (!$this->hasAnnotation($name)) {\n return null;\n }\n return $this->otherAnnotations->get($name);\n }", "public static function allAnnotations(Has_Doc_Comment $reflection_object)\n\t{\n\t\t$doc_comment = $reflection_object->getDocComment([T_EXTENDS, T_IMPLEMENTS, T_USE]);\n\t\t$annotations = [];\n\t\t$i = 0;\n\t\twhile (($i = strpos($doc_comment, '* @', $i)) !== false) {\n\t\t\t$i += 2;\n\t\t\t$j = strlen($doc_comment);\n\t\t\tif (($k = strpos($doc_comment, LF, $i)) < $j) $j = $k;\n\t\t\tif (($k = strpos($doc_comment, SP, $i)) < $j) $j = $k;\n\t\t\t$annotation_name = substr($doc_comment, $i + 1, $j - $i - 1);\n\t\t\t$annotation_class = static::getAnnotationClassName(get_class($reflection_object), $annotation_name);\n\t\t\t$multiple = is_a($annotation_class, Multiple_Annotation::class, true);\n\t\t\tif ($multiple || !isset($annotations[$annotation_name])) {\n\t\t\t\tif ($reflection_object->isAnnotationCached($annotation_name, $multiple)) {\n\t\t\t\t\t$annotations[$annotation_name] = $multiple\n\t\t\t\t\t\t? $reflection_object->getAnnotations($annotation_name)\n\t\t\t\t\t\t: $reflection_object->getAnnotation($annotation_name);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$annotation = self::parseAnnotationValue(\n\t\t\t\t\t\t$doc_comment, $annotation_name, $i, $annotation_class, $reflection_object\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (isset($annotation)) {\n\t\t\t\t\tif ($multiple) {\n\t\t\t\t\t\t$annotations[$annotation_name][] = $annotation;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$annotations[$annotation_name] = $annotation;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($reflection_object->getCachedAnnotations() as $annotation_name => $cached_annotation) {\n\t\t\t$annotation = $cached_annotation[0];\n\t\t\t$annotations[$annotation_name] = $annotation;\n\t\t}\n\t\treturn $annotations;\n\t}", "protected function parse()\n {\n\t$event_lines = explode(HCAL_LINE_SPLITER, $this->_Content);\n\n\tforeach ($event_lines as $line)\n\t{\n\t $result = $this->parseProperty($line);\n\t $this->_Properties[$result['name']] = $result['value'];\n\t}\n }", "public function getAnnotations($name = '') {\n if ($name == '') {\n return $this->docParser->getAnnotations();\n }\n else {\n return $this->docParser->getAnnotationsByName($name);\n }\n }", "function tag_cmdfunc($parts){\n\t// create a new post, and annotate it with acivity strea.ms\n\t// do feed discovery on tagged person's homepage url\n\tif (isset($parts[1])){\n\n\n if (strpos($parts[1], '.') !== false)\n $object = array('url'=>'http://'.$parts[1],'screen_name'=>$parts[2]);\n else\n\t $object = discover_twitter_person( $parts[1] );\n\t\n global $db,$request;\n\n $request->set_param( array( 'post', 'title' ), 'tagged '. $parts[1] . ' in a photo' );\n\n\t $Annotation =& $db->model('Annotation');\n\t if (!$db->table_exists('annotations'))\n\t $Annotation->save();\n\t\n\t $post = get_my_latest_object();\n\t\n\t\t$arr = add_thumbs_if_blob($post->url);\n\n\t\tif ($arr[0]){\n\t\t\t$preview = $arr[0];\n\t\t}\n\n\t\tif ($arr[5]){\n\t\t\t$preview = $arr[5];\n\t\t}\n\n\t $tagverb = 'http://activitystrea.ms/schema/1.0/tag';\n\t\n\t\t$ann = '[\n\t\t {\n\t\t \"annotations\": {\n\t\t \"activity\": {\n\t\t \"verb\": \"'.$tagverb.'\",\n\t\t\t \"target\": \"'.$post->url.'\",\n\t\t \"target-type\": \"photo\",\n\t\t \"target-link-preview\": \"'.$preview.'\",\n\t\t \"target-title\": \"'.$post->title.'\",\n\t\t \"target-id\": \"'.$post->url.'\",\n\t\t\t \"object\": \"'.$object['url'].'\",\n\t\t \"object-type\": \"person\",\n\t\t \"object-title\": \"'.$object['screen_name'].'\",\n\t\t \"object-id\": \"'.$object['url'].'\"\n\t\t } \n\t\t } \n\t\t }\n\t\t]';\n\n \t //object: person\n //target: photo\n preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\", $ann);\n\n\t\tif (!function_exists('json_encode'))\n\t\t lib_include('json');\n\t $j = new Services_JSON();\t\n\n\t $a = $Annotation->base();\n\t $a->set_value('json',$ann);\n\t $a->save();\n\t\n\t // feed discovery to notify the tagged person\n $feeds = discover_feeds( $object['url'] );\n\n foreach($feeds as $f){\n\n\t $input = discover_textInput($f);\n\n\t if (is_array($input)) {\n\n\t\t if (isset($input['link'])){\n\t\t\t $reply_to = $input['link'];\n\t\t\t $parts = split('mailto:',$reply_to);\n\t\t\t $recipient = $parts[1];\n\n\t\t\t\t global $request;\n\n\t\t\t\t $subject = 'You were tagged in a photo on '.$request->base;\n\n\t\t\t\t $email = \"Hi, you were tagged in this photo:\\n\\n\".$post->url.\"\\n\\n\";\n\n\t\t\t\t $html = false;\n\n\t\t\t\t send_email( $recipient, $subject, $email, environment('email_from'), environment('email_name'), $html );\n\n\t\t }\n\t }\n }\n\t\n if ($a->id > 0)\n\t\t\treturn $a;\n\t\n\t}\n\treturn false;\n}", "abstract protected function _readBody(\\SetaPDF_Core_Image_Gif_Reader_Sequence $reader);", "function tideways_span_annotate($span, $annotations)\n{\n}", "static function scanAnnotation(string $scanPath, string $namespace, callable $callback): void\n {\n // todo scanAnnotation\n }", "public function extract(): void\n {\n try {\n\n $reflectionClass = new \\ReflectionClass($this->class);\n $method = $reflectionClass->getMethod(\"extractData\");\n $extraData = $method->invokeArgs(null, []);\n if($extraData instanceof \\stdClass)\n {\n $this->extraData = $extraData;\n\n // Saves the generator name to the info.\n if(isset($this->extraData->generatorName))\n {\n $this->generatorName = $this->extraData->generatorName;\n }\n }\n\n } catch (\\Exception $e) {\n // TODO: Print stack.\n return;\n }\n }", "function getClassAnnotations(\\ReflectionClass $class);", "public function testOneAnnotationTwoParams() {\n $comment = <<<'EOT'\n/**\n * This is a comment that contains a single annotation with two parameters.\n *\n * @Entity(name = table, desc = Entity that represents a table)\n */\nEOT;\n\n $annotations = new Annotations($comment);\n $msg = print_r($annotations, true);\n\n $this->assertTrue(isset($annotations['entity']), $msg);\n\n $annoVal = $annotations['entity'];\n $this->assertInternalType('array', $annoVal, $msg);\n $this->assertArrayHasKey('name', $annoVal, $msg);\n $this->assertEquals('table', $annoVal['name'], $msg);\n $this->assertArrayHasKey('desc', $annoVal, $msg);\n $this->assertEquals('Entity that represents a table', $annoVal['desc'],\n $msg);\n }", "public function getParsedInput();", "public function testOneAnnotationMultipleParams() {\n $comment = <<<'EOT'\n/**\n * This is a comment that contains a single annotations with multiple parameters\n *\n * @Entity(name = table, desc = Entity that represents a table, parent = database)\n */\nEOT;\n\n $annotations = new Annotations($comment);\n $msg = print_r($annotations, true);\n\n $this->assertTrue(isset($annotations['entity']), $msg);\n\n $annoVal = $annotations['entity'];\n $this->assertInternalType('array', $annoVal, $msg);\n $this->assertArrayHasKey('name', $annoVal, $msg);\n $this->assertEquals('table', $annoVal['name'], $msg);\n $this->assertArrayHasKey('desc', $annoVal, $msg);\n $this->assertEquals('Entity that represents a table', $annoVal['desc'],\n $msg);\n $this->assertArrayHasKey('parent', $annoVal, $msg);\n $this->assertEquals('database', $annoVal['parent'], $msg);\n }", "abstract public function createAnnotation(array $parameters);", "private function parseAnnotations($docblock)\n {\n $annotations = array();\n // Strip away the docblock header and footer to ease parsing of one line annotations\n $docblock = substr($docblock, 3, -2);\n\n if (preg_match_all('/@(?P<name>[A-Za-z_-]+)(?:[ \\t]+(?P<value>.*?))?[ \\t]*\\r?$/m', $docblock, $matches)) {\n $numMatches = count($matches[0]);\n\n for ($i = 0; $i < $numMatches; ++$i) {\n $annotations[$matches['name'][$i]][] = $matches['value'][$i];\n }\n }\n\n return $annotations;\n }", "function getIsoformAnnotation($org_vid,$tx_list,$pred_id){\n $annotation=array();$region_start=0;$region_end=0; $txmap=array();$genes=array();$tx=\"\";\n while(list($index,$row)=each($tx_list)){\n $tx_id=$row[\"id\"];$name=$row[\"name\"];$prediction_id=$row[\"prediction_id\"];\n if(($prediction_id<3))continue;\n if(($pred_id<=0)&&($prediction_id==5))continue;//skip xenoref by default\n if(($pred_id<=0)&&($prediction_id>24&&$prediction_id<=40))continue;//skip cc founders by default\n $row[\"tx_start\"]+=1; if($pred_id>0){if($pred_id!=$prediction_id)continue;}\n $pred_name=getPredictionName($prediction_id);$tx_coord=getOverLapTranscripts($org_vid,$tx_id);\n $tx_coord[0][\"tStart\"]+=1;$gene_names=\"\"; $ex_starts=\"\"; $ex_ends=\"\";$ex_frames=\"\";\n $strand= $tx_coord[0][\"strand\"];$cds=getCDS($name,$tx_id,$org_vid,$prediction_id);\n $qh_getTxGene=getTxGene($tx_id,$prediction_id);\n while(list($index2,$gene)=each($qh_getTxGene)){ $gene_symbol=$gene[\"gene\"];\n if($gene_names == \"\"){$gene_names.=\"$gene_symbol\";}\n else{$gene_names.=\",$gene_symbol\";}\n }$ex_start=0;$ex_end=0;$qh_getTxExon=getTxExons($tx_id,$name,$prediction_id,$org_vid);\n while(list($index3,$value)=each($qh_getTxExon)){\n $ex_start=$value[\"ex_start\"]+1;$ex_end=$value[\"ex_end\"];$ex_frame=$value[\"ex_frame\"];\n if($ex_starts ==\"\"){$ex_starts=\"$ex_start\";$ex_ends=\"$ex_end\";$ex_frames=\"$ex_frame\";}\n else{$ex_starts.=\",$ex_start\";$ex_ends.=\",$ex_end\";$ex_frames.=\",$ex_frame\";}\n }\n if($pred_id>24&&$pred_id<=40)$ex_frames=\"\";\n $annotation[]=array(\"annotation\"=>array(\"source\"=>$pred_name,\"chrom\"=>$tx_coord[0][\"chrom\"],\n \"txStart\"=>$tx_coord[0][\"tStart\"],\"txEnd\"=>$tx_coord[0][\"tEnd\"],\n \"strand\"=>$strand,\"Name\"=>$name, \"Name2\"=>$gene_names,\n \"cdsStart\"=>$cds[\"start\"],\"cdsEnd\"=>$cds[\"end\"],\n \"exonStarts\"=>$ex_starts,\"exonEnds\"=>$ex_ends,\"exonFrames\"=>$ex_frames));\n }\n return $annotation;\n}", "public function getAnnotation($key)\n {\n return $this->annotations[$key];\n }", "public function addAnnotation($x, $y, $text, $toX = 0, $toY = 0) {\n\t\t$this->Annotations[] = array('x' => $x, 'y' => $y, 'text' => $text, 'toX' => $toX, 'toY' => $toY);\n\t}", "public function getAnnotationsByName($name) {\n if (isset($this->annotations[$name])) {\n return $this->annotations[$name];\n }\n else {\n return array();\n }\n }", "public function testMultipleAnnotationsNoParams() {\n $comment = <<<'EOT'\n/**\n * This is a comment that contains multiple annotations with no parameters.\n *\n * @Hotdog\n * @Hamburger\n * @KraftDinner\n */\nEOT;\n\n $annotations = new Annotations($comment);\n $msg = print_r($annotations, true);\n\n $this->assertTrue(isset($annotations['hotdog']), $msg);\n $this->assertTrue(isset($annotations['hamburger']), $msg);\n $this->assertTrue(isset($annotations['kraftdinner']), $msg);\n }", "function get_document_bounds($annotation, $feature) {\r\n $bound = [];\r\n foreach ($annotation->getPages() as $page) {\r\n if ($feature == FEATURE_PAGE){\r\n $coord=$this->bound_to_coord($page->getBoundingBox());\r\n $this->add_block($coord['x1'],$coord['y1'],$coord['x2'],$coord['y2'],$coord['x3'],$coord['y3'],$coord['x4'],$coord['y4'],true);\r\n }\r\n foreach ($page->getBlocks() as $block) {\r\n if ($feature == FEATURE_BLOCK) {\r\n $coord=$this->bound_to_coord($block->getBoundingBox());\r\n $this->add_block($coord['x1'],$coord['y1'],$coord['x2'],$coord['y2'],$coord['x3'],$coord['y3'],$coord['x4'],$coord['y4'],true);\r\n }\r\n foreach ($block->getParagraphs() as $paragraph) {\r\n if ($feature == FEATURE_PARA){\r\n $coord=$this->bound_to_coord($paragraph->getBoundingBox());\r\n $this->add_block($coord['x1'],$coord['y1'],$coord['x2'],$coord['y2'],$coord['x3'],$coord['y3'],$coord['x4'],$coord['y4'],true);\r\n }\r\n foreach ($paragraph->getWords() as $word) {\r\n if ($feature == FEATURE_WORD){\r\n $coord=$this->bound_to_coord($word->getBoundingBox());\r\n $this->add_block($coord['x1'],$coord['y1'],$coord['x2'],$coord['y2'],$coord['x3'],$coord['y3'],$coord['x4'],$coord['y4'],true);\r\n }\r\n foreach ($word->getSymbols() as $symbol) {\r\n if ($feature == FEATURE_SYMBOL){\r\n $coord=$this->bound_to_coord($symbol->getBoundingBox());\r\n $this->add_block($coord['x1'],$coord['y1'],$coord['x2'],$coord['y2'],$coord['x3'],$coord['y3'],$coord['x4'],$coord['y4'],true);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "public function testReadUploadableAnnotation()\n {\n $uploadable = $this->getMockBuilder('Vich\\UploaderBundle\\Mapping\\Annotation\\Uploadable')\n ->disableOriginalConstructor()\n ->getMock();\n\n $reader = $this->getMock('Doctrine\\Common\\Annotations\\Reader');\n $reader\n ->expects($this->once())\n ->method('getClassAnnotation')\n ->will($this->returnValue($uploadable));\n\n $entity = new DummyEntity();\n $driver = new AnnotationDriver($reader);\n $annot = $driver->readUploadable(new \\ReflectionClass($entity));\n\n $this->assertEquals($uploadable, $annot);\n }", "protected static function _createAnnotationDictionary($rect, $subtype) {}", "protected static function _createAnnotationDictionary($rect, $subtype) {}", "public function extract($content);", "static function runCreateWithAnnotation(string $scanPath, string $namespace, ...$params)\n {\n // todo scanAnnotation\n }", "public function testOneAnnotationNoParams() {\n $comment = <<<'EOT'\n/**\n * This is a comment that contains a single annotation with no parameters.\n *\n * @Entity\n */\nEOT;\n \n $annotations = new Annotations($comment);\n $msg = print_r($annotations, true);\n\n $this->assertTrue(isset($annotations['entity']), $msg);\n $this->assertInternalType('boolean', $annotations['entity'], $msg);\n $this->assertEquals(true, $annotations['entity'], $msg);\n }", "private function readArticle() {\n switch( $this->status->code ) {\n case 220:\n case 221:\n case 222:\n $this->readLines();\n break;\n case 223:\n default:\n }\n }", "public function aim_recv()\r\n\t{\r\n\t\t$header = fread($this->resource, 6);\r\n if ($this->user['debug']) $this->aim_debug($header, AIM_RAW);\r\n\r\n\t\t// Need error checking here to prevent bad data\r\n\t\ttry {\r\n\t\t\tif (!$data = @unpack(\"aone/Ctwo/nthree/nfour\", $header)) {\r\n\t\t\t\t// This normally happens if you sign on elsewhere with the same name,\r\n // or, if the TOC server resets (AOL likes to do this alot).\r\n\t\t\t\tthrow new TACException('Connection to TOC server interrupted.');\r\n\t\t\t} \r\n\t\t} catch(TACException $ex) {\r\n\t\t\t$ex->display();\r\n\t\t}\r\n\r\n if ($this->user['debug']) print_r($data);\r\n\t\t$msg = fread($this->resource, $data['four']);\r\n\t\t$msg = implode('', unpack(\"a*done\", $msg));\r\n if ($this->user['debug']) var_dump($msg);\r\n\r\n // match incoming commands\r\n preg_match(\"/^([A-Z0-9_]{4,19})\\:(.*)/s\", $msg, $matches);\r\n @list($orig, $cmd, $args) = $matches;\r\n // send the command and arguments to our parser\r\n $this->parser->aim_parse_command($cmd, $args);\r\n // regain some memory\r\n unset($header, $orig, $data, $matches);\r\n\t}", "function extract_from_markers($filename, $marker)\n {\n }", "public function __construct() {\n $this->annotations = array();\n }", "public function autoParse()\n {\n $type = $this->getMimeType();\n $contents = '';\n\n if ($type == 'application/json' || $type == 'text/json') {\n $contents = $this->parseJson();\n } elseif ($type == 'application/xml' || $type == 'text/xml') {\n $contents = $this->parseXml();\n } elseif ($type == 'application/x-yaml' || $type == 'text/yaml') {\n $contents = $this->parseYaml();\n } else {\n $contents = $this->getContents();\n }\n\n return $contents;\n }", "public function add(\\SetaPDF_Core_Document_Page_Annotation $annotation) {}", "public function addAnnotation($name, $content)\n {\n // Convert to an array and merge if there are multiple\n // instances of the same annotation defined.\n if (isset($this->otherAnnotations[$name])) {\n $content = array_merge((array) $this->otherAnnotations[$name], (array)$content);\n }\n $this->otherAnnotations[$name] = $content;\n }", "function getMethodAnnotation(\\ReflectionMethod $method, $annotationName);", "public function getAnnotation($name)\n\t{\n\t\treturn null;\n\t}", "public function remove(\\SetaPDF_Core_Document_Page_Annotation $annotation) {}", "function AddAnnotation($str) {\r\n $this->RenderAnnotation($str);\r\n $this->Ln(7); // a little padding between lines\r\n }" ]
[ "0.60306334", "0.5898158", "0.5859481", "0.5824147", "0.5678775", "0.5561853", "0.54022205", "0.52998465", "0.5277175", "0.5251466", "0.5230088", "0.51718646", "0.5168481", "0.51498723", "0.5136478", "0.512975", "0.50766766", "0.503749", "0.49889198", "0.49399802", "0.4914696", "0.4897814", "0.4897814", "0.48944244", "0.4870879", "0.48609072", "0.48551282", "0.48532808", "0.48521328", "0.48486564", "0.48321295", "0.48321295", "0.4829439", "0.48264393", "0.48098123", "0.4809183", "0.479993", "0.4789612", "0.47826627", "0.4778671", "0.4766522", "0.47662058", "0.47655475", "0.4758223", "0.4758223", "0.4758223", "0.4758223", "0.4758223", "0.4758223", "0.4758223", "0.4758223", "0.47379917", "0.46948385", "0.46816188", "0.4679676", "0.4671658", "0.46592268", "0.46520293", "0.4649232", "0.46277714", "0.46245423", "0.46174204", "0.46114504", "0.4603086", "0.4598839", "0.45845574", "0.45814076", "0.45607528", "0.45517567", "0.4545926", "0.4524608", "0.45214608", "0.45157126", "0.45056024", "0.45029697", "0.44920874", "0.4482017", "0.4479104", "0.4473928", "0.44689107", "0.4465987", "0.44592184", "0.44571877", "0.4456772", "0.4455653", "0.44553116", "0.4453665", "0.44529557", "0.44508573", "0.44478717", "0.44375947", "0.44266522", "0.44259775", "0.44190574", "0.4409907", "0.4405269", "0.4399417", "0.4397295", "0.43971866", "0.43911403", "0.43818924" ]
0.0
-1
Retrieve the parameter name.
public function getParam() { return $this->param; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParameterName(): string\n {\n return \\str_replace('-', '_', $this->parameter->parameter->__toString());\n }", "public function getParameterName()\n {\n return $this->parameterName;\n }", "public function getParameterName();", "private function getNamedParam()\n {\n return self::BINDING_PREFIX . $this->getLetterBinding();\n }", "public function getName()\n {\n return $this->getParameter('name');\n }", "protected function getName()\n {\n return $this->arguments['name'];\n }", "public function getPathParamName()\n {\n return $this->path_param_name;\n }", "function get_parameter($name)\r\n {\r\n if (array_key_exists($name, $this->parameters))\r\n return $this->parameters[$name];\r\n }", "public function getParam($name);", "protected function get_parameter( $name ) {\n\t\treturn $this->has_parameter( $name ) ? $this->parameters[ $name ] : null;\n\t}", "private function getPageParamName()\n {\n if ($this->pageParam) {\n return $this->pageParam;\n }\n\n return 'page';\n }", "public function getParam($name) {\n if (isset($this->parameter[$name])) {\n return $this->parameter[$name];\n }\n }", "public function getParameter()\n\t{\n\t\treturn $this->parameter;\n\t}", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public function getParam($name) {\n return $this->params[$name];\n }", "public function getParameter($name);", "public function getParameter($name);", "public function getParameter($name);", "public function getParam($name)\n {\n return Tools::getValue($name);\n }", "private function generateParameterName(\\ReflectionParameter $parameter)\n {\n $name = $parameter->getName();\n if ($name === '...' && version_compare(PHP_VERSION, '5.6', 'lt')) {\n $name = 'x' . dechex(crc32($name));\n }\n\n return '$' . $name . $parameter->getPosition();\n }", "protected function getReflectionParameterName(\\ReflectionParameter $parameter)\n {\n // parameter is a class\n if ($class = $parameter->getClass()) {\n return $class->getName() . ' \\$' . $parameter->getName();\n }\n\n return $parameter->getName();\n }", "public function getParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n return $this->parameters[$name];\n }\n return null;\n }", "public function getName()\n {\n return $this->propertyName;\n }", "public function getParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n return $this->parameters[$name];\n }\n\n return null;\n }", "public function getParam($name){\n\t\treturn array_key_exists($name, $this->params) ? $this->params[$name] : NULL;\n\t}", "public function getName () {\n\treturn $this->get('name');\n }", "public function getName() {\n return $this->get(\"name\");\n }", "protected function getName()\n {\n return $this->getRequest()->args('name') ?: $this->profile->code . '_' . $this->tpl['name'];\n }", "public function getParameter($name)\n {\n return $this->parameters[$name] ?? null;\n }", "protected function getInputName(){\n if($this->_name===null)\n $this->defineNameId();\n return $this->_name;\n }", "public function getNamedParameter($name)\n {\n $name = strtolower($name);\n return isset($this->namedParameters[$name]) ? $this->namedParameters[$name] : null;\n }", "public function getName()\n {\n return $this->getProperty('name');\n }", "public function getName() {\n return ($this->isInit()) ? $this->name : null;\n }", "public function getBindingMemberName();", "public function getName()\n {\n return $this->getValue('name');\n }", "public function getParam(string $key): string\n {\n return isset($this->params[$key])\n ? $this->params[$key]\n : '';\n }", "public function param ($pname)\n {\n return Yii::app()->request->getParam($pname);\n }", "function getParam($name) {\n\t\treturn isset($this->params[$name]) ? $this->params[$name] : null;\n\t}", "function getParam($name) {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n }\n return null;\n }", "public function getParam($name) {\n return $this->app->getParam($name);\n }", "public function getParamNames();", "public function getParam($name)\n {\n // TODO: Implement getParam() method.\n }", "public function get_name() {\r\n\t\treturn $this->options['name'];\r\n\t}", "protected function GetName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n if (array_key_exists(\"name\", $this->_propDict)) {\n return $this->_propDict[\"name\"];\n } else {\n return null;\n }\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n\t{\n\t\t$search = $this->getAttribute('search', FALSE);\n\n\t\tif(empty($search))\n\t\t{\n\t\t\treturn $this->getTitle();\n\t\t}\n\t\t$variables = $this->fetchVariables($search);\n\t\treturn reset($variables);\n\t}", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getParam($name)\n {\n return $this->getResponseParam($name);\n }", "public function getName()\n {\n return $this->get('name');\n }", "public function GetName () {\n\t\treturn $this->name;\n\t}", "public function getTranslationParam(string $name);", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function getParameter($name){\n\t\tif(!isset($this->inputParameters[$name])){\n\t\t\tthrow new ValidationException(\"Could not find parameter: {$name}\");\n\t\t}\n\t\treturn $this->inputParameters[$name];\n\t}", "function getVarName()\n {\n return $this->varName;\n }", "public function getParam($key): string\n {\n $parameters = $this->parameters;\n if (!array_key_exists($key, $parameters)) {\n throw new InvalidArgumentException('Parameter ' . $key . ' does not exist.');\n }\n\n return $parameters[$key];\n }", "public function offsetGet($name)\n {\n if (is_int($name)) {\n return parent::offsetGet($name);\n }\n $name = strtoupper($name);\n\n if (!isset($this->parameters[$name])) {\n return;\n }\n\n return $this->parameters[$name];\n }", "public function getName(): string\n {\n return $this->requireString('name');\n }", "public function getName()\n\t{\n\t\treturn $this->get('Name');\n\t}", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getLearningRateParameterName()\n {\n return $this->learning_rate_parameter_name;\n }", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function getName()\n {\n return $this->__get(self::FIELD_NAME);\n }", "function get_name () {\n return $this -> name;\n }", "function getPropertyName() ;", "protected function getParameter($name)\n {\n return $this->container->getParameter($name);\n }", "function getName () {return $this->getFieldValue ('name');}", "public function GetName () \r\n\t{\r\n\t\treturn ($Name);\r\n\t}", "protected static function name(): mixed\n\t{\n\t\treturn self::$query->name;\n\t}", "function get_name()\n {\n return $this->get_default_property(self :: PROPERTY_NAME);\n }" ]
[ "0.8529051", "0.8436751", "0.83102685", "0.79593366", "0.7821001", "0.751129", "0.7495868", "0.74808973", "0.71601844", "0.7118954", "0.70829666", "0.7047581", "0.70213246", "0.70080173", "0.69898957", "0.6898659", "0.6898659", "0.6898659", "0.68597496", "0.6817973", "0.68163997", "0.68006444", "0.67854375", "0.6761121", "0.6753123", "0.6738625", "0.6730327", "0.67081237", "0.6698012", "0.66953295", "0.6692548", "0.6689802", "0.6684264", "0.66696507", "0.6665668", "0.6657429", "0.6655357", "0.66339093", "0.66310084", "0.6629646", "0.6623109", "0.6620701", "0.6613955", "0.66042286", "0.66028875", "0.65966606", "0.6595338", "0.6595338", "0.6595338", "0.6595338", "0.6595338", "0.6595338", "0.6595338", "0.6595338", "0.659128", "0.659128", "0.659128", "0.659128", "0.659128", "0.659128", "0.659128", "0.65911204", "0.6578823", "0.6578823", "0.6578823", "0.656686", "0.6564252", "0.6564252", "0.6564252", "0.6564022", "0.6562647", "0.65564036", "0.6553025", "0.6551179", "0.6551179", "0.6551179", "0.65500057", "0.65475535", "0.6542896", "0.65328753", "0.6531574", "0.652979", "0.6527668", "0.6527668", "0.6520203", "0.65113693", "0.65113693", "0.65113693", "0.65113693", "0.64989203", "0.64931357", "0.6492114", "0.64920264", "0.64907485", "0.6490246", "0.64824873", "0.6476052", "0.6475587", "0.6471153" ]
0.6780371
24
Store a newly created resource in storage.
public function store() { $service = new Service; $service->name = Input::get('name'); $service->icon = Input::get('icon'); $service->description = Input::get('description'); $service->long_desc = Input::get('long_desc'); $service->img_detail = Input::get('img_detail'); $service->save(); return Redirect::to('/admin/services'); }
{ "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
Remove the specified resource from storage.
public function destroy($id) { $service = Service::find($id); $service->delete(); return Redirect::to('/admin/services'); }
{ "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
echo $d = \Helpers::encrypt(4);
public function index() { // echo \Helpers::decrypt($d); try{ $data['title'] = 'Dashboard'; $data['js_array'] = array('morris.min.js','raphael.min.js','dashboard.js'); // $contactCount = Contact::count(); // $data['contact_count'] = $contactCount; // $clienteleCount = Clientele::count(); // $data['clientele_count'] = $clienteleCount; // $testimonialCount = Testimonial::count(); // $data['testimonial_count'] = $testimonialCount; // $jobPostingCount = JobPosting::count(); // $data['job_posting_count'] = $jobPostingCount; $data = Business::where('id','!=','')->get(); $data['business_count']=COUNT($data); $dataFeatured = Business::where('featured','1')->get(); $data['featuredbusiness_count'] = COUNT($dataFeatured); $Customer = User::where('id','!=','1')->where('user_type','CU')->get(); $data['customers']=COUNT($Customer); //$data['contact_count'] = 0; $data['clientele_count'] = 0; $data['testimonial_count'] = 0; $data['job_posting_count'] = 0; $data['city'] = City::where('id','!=','')->orderby('city_name', 'ASC')->get(); $data['customerCount']=DB::table('users')->select(DB::raw('COUNT(*) as total,date(created_at) as pp')) ->whereRaw('created_at > now() - INTERVAL 7 day') ->where('user_type','CU') ->groupby ('pp') ->get(); $start=0; $limit=20; $data['topClickedBusinesses'] = Business::where('approved_by_admin','1')->where('status','Active')->orderby('top_clicked', 'DESC')->limit($limit)->offset($start)->get(); return view('admin.adminuser.dashboard', $data); }catch(Exception $e){ throw new \App\Exceptions\AdminException($e->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encrypt($str) {\n return Crypt::encrypt($str);\n}", "public function encrypt();", "function encrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Encrypt($string,$key);\r\n\treturn $result;\r\n}", "public function encryptPass()\n {\n return \"RASAHolaRSSA\";\n }", "function doXEncrypt($password){\r\n\t$password = md5($password);\r\n\treturn $password;\r\n}", "function encript($password){\n\t$password_md5 = md5($password);\n\t$enc_password = crypt($password,$password_md5);\n\treturn $enc_password;\n}", "function acf_encrypt($data = '')\n{\n}", "function encrypt_data($str){\n\treturn md5($str);\n}", "public function encrypt() \r\n {\r\n //TODO: Implement encrypt method\r\n }", "static public function encrypting($value)\n {\n return Crypt::encryptString($value);\n }", "public function encrypt() {\n $str = Input::get ( 'value' );\n $task = new My_task;\n $result = $task->encrypt($str);\n return $result;\n }", "private function encrypt($data) {\n\t\treturn Authenticator_Crypto::encrypt($data);\n\t}", "function encryptIt( $q ) {\n\t$code = str_replace( \"@\", \"!!!\", $q );\n\t$code = str_replace( \".\", \"=\", $code );\n\t$code = str_rot13( $code );\n\treturn ( $code );\n}", "abstract public function encrypt($data);", "function twe_encrypt_password($plain) {\n\n $password=md5($plain);\n\n return $password;\n\n }", "public function get_encrypt() {\r\n\t\treturn ($this->encrypt);\r\n\t}", "function decrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Decrypt($string,$key);\r\n\treturn $result;\r\n}", "function returnD($data)\n{\n return cryptoJsAesDecrypt(\"23dejulio08F!\", $data);\n}", "abstract protected function getCrypt();", "public function encender();", "function crypter($data){\n\t$a = base64_encode($data);\n\treturn $a;\n}", "function encrypt(string $string): string\n{\n $blowfishSalt = bin2hex(openssl_random_pseudo_bytes(22));\n $hash = crypt($string, \"$2y$12$\" . $blowfishSalt);\n\n return $hash;\n}", "function md5plus($string)\n{\n $CI = & get_instance();\n return '_' . md5($CI->session->encryption_key . $string);\n}", "function encrypt($value) {\n\treturn hash('sha512', $value.C_SALT);\n}", "function lock($id){\n $CI =& get_instance();\n $CI->load->library('encrypt'); \n $encrypt= $CI->encrypt->encode($id ); \n return $encrypt;\n }", "function encrypt($string)\n{\n\t$hash = md5($string);\n\t$blok1 = substr($hash, 0,8);\n\t$blok2 = substr($hash, 8,8);\n\t$blok3 = substr($hash, 16,4);\n\t$blok4 = substr($hash, 20,4);\n\t$blok5 = substr($hash, 24,8);\n\n\treturn $blok2.'-'.$blok4.'-'.$blok5.'-'.$blok3.'-'.$blok1;\n}", "function encrypt($string, $key=KEY) {\n return base64_encode(encrypt_string($string, $key));\n }", "function simple_encrypt($text){\n \treturn base64_encode(openssl_encrypt($text, \"AES-256-CTR\", \"GhratnaXbS\", 0, \"0123456789abcdef\"));\n }", "function Encrypt($str)\n {\n //$blowfish = new Crypt_Blowfish($this->config->encr_key);\n $retdata = sfm_crypt_encrypt($str,$this->config->encr_key);\n /*$blowfish =& Crypt_Blowfish::factory('ecb');\n $blowfish->setKey($this->config->encr_key);\n\n $encr = $blowfish->encrypt($str);\n $retdata = bin2hex($encr);*/\n return $retdata;\n }", "public function encrypt($data)\n {\n return Crypto::encrypt($data, $this->key);\n }", "public function encrypt($data) {\n\t\treturn md5(md5($data));\n\t}", "private static function Crypto() {\n if (self::$cripto == null) {\n self::$cripto = new \\PlayPHP\\Classes\\Security\\Crypto();\n }\n return self::$cripto;\n }", "protected function encryptValue($value){ \n $cipher = $this->handler->encrypt($value);\n return base64_encode($cipher);\n }", "protected function _decrypt() {}", "protected function _decrypt() {}", "function cryptPasswordCrypt( $password, $key )\r\n{\r\n\treturn base64_encode( $password );\r\n}", "public function key()\n {\n }", "public function key()\n {\n }", "public function key()\n {\n }", "public function key()\n {\n }", "public function encryption($encryption);", "protected function encrypt($str)\n { \n \n return md5($str);\n }", "static function crypter($word) {\r\n $return = md5($word);\r\n $return1 = md5($return);\r\n $result = md5($return1);\r\n return $result;\r\n }", "function encryptData($value){\n\t\t\tglobal $key;\n $cipher = new Crypt_Rijndael(CRYPT_RIJNDAEL_MODE_ECB);\n\t\t\t$cipher->setKey($key);\n\t\t\treturn $cipher->encrypt($value);\n\t\t}", "public function testdecrypt(){\n\n// <<< this returns an object type not a string >>>\n $surname17=DB::table('employees')\n ->where('id','=',1011)\n ->select('lastname')\n ->get();\n\n// $decrypted=Crypt::decryptString($surname17);\n// $decrypted=Crypt::decryptString('eyJpdiI6Ik5SZ3RhaVB3aGYxZHNvSE1JUHhJaEE9PSIsInZhbHVlIjoiVG8rWXpLazM3Njh3WVU1d20yQ3U3dz09IiwibWFjIjoiODA1MmU4NjI3ZWY1NmNlNWRmYmQxMDk4MGIyMDlhNDE1M2NjMWFlMzdhZWFiMWYyNjRkNzNhYzRiYTFkNDNkYSJ9');\n $decrypted=Crypt::decryptString($surname17['0']->lastname);\n\n return $decrypted;\n\n\n }", "public static function encrypt($value) {\n $self = self::getInstance();\n $encripted = base64_encode(Security::cipher($value, $self->key));\n return \"U3BhZ2hldHRp.{$encripted}\";\n }", "function string2(){\n\n $string2 = \"Hola mundo\";\n $md5 = md5($string2);\n\n echo $md5;\n\n}", "function acf_decrypt($data = '')\n{\n}", "public function generate()\n{\n\n//generate a unique id//\n\n$unique=uniqid();\n\n$mesadig=crypt($unique,rand());\n//encrypt with the salt//\n\n//FILETER FOR THE /\n\n$mesadig=str_replace('/', 'ssd', $mesadig);\n\nreturn $mesadig;\n\n}", "function random() {\n echo StringHelper::random(48);\n echo \"<br />\";\n echo StringHelper::random(16);\n echo \"<br />\";\n echo CryptHelper::generateKey(24);\n echo \"<br />\";\n echo CryptHelper::generateKey(8);\n }", "function Encrypt($string, $key='')\t{\r\n\t\tglobal $global_config;\r\n\t\t\r\n\t\tif($key == '')\r\n\t\t\t$key = $global_config[\"en_decrypt_keys\"];\r\n\t\t$result = '';\r\n\t\tfor($i=1; $i<=strlen($string); $i++){\r\n\t\t\t$char = substr($string, $i-1, 1);\r\n\t\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\r\n\t\t\t$char = chr(ord($char)+ord($keychar));\r\n\t\t\t$result.=$char;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function getBoxSecretKey() : string;", "public function getEncryptionKey() {}", "protected static function encryption($string){\n $output=FALSE;\n $key=hash('sha256', SECRET_KEY);\n $iv=substr(hash('sha256', SECRET_IV), 0, 16);\n $output=openssl_encrypt($string, METHOD, $key, 0, $iv);\n $output=base64_encode($output);\n return $output;\n }", "public function decrypt();", "public static function encryptString($data)\n {\n $encrypted = Crypt::encryptString($data);\n return $encrypted;\n }", "function key_gen($str=''){\n\treturn str_replace('=','',base64_encode(md5($str)));\n}", "public function getEncryptionKey();", "public function getEncrypt()\n {\n return $this->Encrypt;\n }", "function encrypt(string $value, bool $serialize = true)\n {\n return app()->services()->crypter()->encrypt($value, $serialize);\n }", "protected function encriptar($string){\n //La función md5() permite encriptar el string\n return md5($string);\n }", "function encryptPassword($password) {\n $CI =& get_instance();\n $password_encrypted = \"\";\n $encryption_string = sha1($CI->config->config['encryption_key']);\n if ($encryption_string % 2 == 1) { // we need even number of characters\n $encryption_string .= $encryption_string{0};\n }\n for ($i=0; $i < strlen($password); $i++) { // encrypts one character - two bytes at once\n $password_encrypted .= sprintf(\"%02X\", hexdec(substr($encryption_string, 2*$i % strlen($encryption_string), 2)) ^ ord($password{$i}));\n }\n return $password_encrypted;\n }", "public function getSecret(): string;", "function encrypt($decrepted_string, $encrytion_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $encryption_iv = '1234567891011121';\r\n $string = openssl_encrypt($decrepted_string, $ciphering, $encrytion_key, $options, $encryption_iv);\r\n return $string;\r\n}", "function vcrypt($clear)\n{\n //$salt = join '', ('.','/', 0..9,'A'..'Z', 'a'..'z')[rand 64, rand 64];\n //$vcrypt = crypt($clear, $salt).\"\\n\";\n //We need a Standard DES-Hash so we need to set a 2-Char salt\n $salt = \"he\";\n $vcrypt = crypt($clear, $salt);\n return $vcrypt;\n}", "public static function crypt( $value ){\n\t\treturn md5($value) ;\n\t}", "function Crypter($clave){\n $this->key = $clave;\n }", "public function getCipher();", "public function getPassword(): string\n {\n }", "function my_simple_crypt( $string, $action = 'd') {\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n \n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash( 'sha256', $secret_key );\n $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );\n \n if( $action == 'e' ) {\n $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );\n }\n else if( $action == 'd' ){\n $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );\n }\n \n return $output;\n }", "function encryptCC($db, $ccNum, $ccv, $actioner_id) {\n //generate the key\n $key = $ccv . PAINFULLY_SECRET . $actioner_id;\n return \" AES_ENCRYPT('\" . $ccNum . \"', '\" . $db->escape($key) . \"') \";\n}", "function getEncryption() \n {//--------------->> getEncryption()\n return $this->_encryption;\n }", "private function encrypt($value)\n {\n r(password_hash($value, PASSWORD_BCRYPT));\n }", "function rc4($key, $data)\n {\n // $key = \"this is a secret key\";\n $input = $data;\n\n $encrypted_data = mcrypt_ecb (MCRYPT_3DES, $key, $input, MCRYPT_ENCRYPT);\n\n return $encrypted_data;\n }", "function encrypt($string, $password) {\n $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($password), $string, MCRYPT_MODE_CBC, md5(md5($password))));\n return $encrypted;\n}", "function render_v_code($email=\"\"){\n $CI = & get_instance();\n $data = array();\n $CI->load->library('encryption');\n $code = bin2hex($CI->encryption->create_key(16));\n $data['v_code'] = array('code'=>$code,'email'=> $email);\n return $data;\n}", "private function encryptPassword($password) {\r\n \r\n \r\n return $password;\r\n }", "public function enc($data)\n {\n return $this->_simplify('encrypt', $data);\n }", "function enc($data)\n {\n return base64_encode($data);\n }", "function rsa_encrypt($string, $public_key)\n{\n return $string;\n //Create an instance of the RSA cypher and load the key into it\n $cipher = new Crypt_RSA();\n $cipher->loadKey($public_key);\n //Set the encryption mode\n $cipher->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1);\n //Return the encrypted version\n return $cipher->encrypt($string);\n}", "public function testEncryptB() {\n // Initialize variables\n $string = 'Hello World!';\n\n // Encrypt string in two different ways\n $encrypted_string = security::encrypt( $string, 'random-hash' );\n $base64_encoded_encrypted_string = security::encrypt( $string, 'random-hash', true );\n\n $this->assertEquals( base64_encode( $encrypted_string ), $base64_encoded_encrypted_string );\n }", "public function key()\n {\n }", "function encrypt($_input, $_key='your salt', $_type='mcrypt')\n{\n if (function_exists('mcrypt') && $_type=='mcrypt') {\n\n $td = mcrypt_module_open(MCRYPT_TWOFISH256, '', 'ofb', '');\n $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_BLOWFISH);\n\n mcrypt_generic_init($td, $_key, $iv);\n $encryptedData = mcrypt_generic($td, $_input);\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n\n //else use md5\n } else {\n\n if(version_compare(PHP_VERSION, '5.0.0', '>='))\n $bool = true;\n else $bool = false;\n\n $encryptedKey = md5($_key, $bool) . md5($_input, $bool);\n $encryptedData = md5($encryptedKey, $bool);\n\n }\n\n // return generated password\n // enjoy\n return utf8_encode($encryptedData);\n\n}", "function encrypt_password(&$data) {\n $data['password'] = md5($data['password']);\n}", "function encrypt($rawInput,$salt)\n{\n\techo $rawInput . \"\\n\";\n\techo $salt . \"\\n\";\n\t$saltyInput = $rawInput . $salt;\n\techo $saltyInput . \"\\n\";\n\t$encrypted = hash(\"sha256\",$saltyInput,false);\n\t\n\treturn $encrypted;\n\n\n}", "public function generate(): string;", "public function generate(): string;", "public function encryptString($value)\n {\n return $this->encrypt($value, false);\n }", "function temp_pass(){\n\treturn 'password199';\n}", "function crypt_password($password)\n {\n return util::cryptPassword($password);\n }", "private function encryptedField()\n {\n return 'Password is encrypted. <a href=\"\" class=\"btn btn-xs btn-primary\">Change</a>';\n }", "function customEncrypt($text, $key)\n {\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, padEncryptionSalt($key), $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "protected function _getKey() {\n\n $key = md5($this->_password, true);\n\n return $key;\n\n }", "public function encryption($store = null);", "function acoc_encode( $value ) {\n\n $func = 'base64' . '_encode';\n return $func( $value );\n \n}", "function char_vigen_encode($a, $b)\r\n{\r\n\treturn char_rot(ord($b) - 65, $a);\r\n}", "public function testEncrypt(): void\n {\n // Plain test data to encode.\n $testData = \"Abhijeet.Kalsi\";\n\n // Have the factory create the Encryption object\n $CipherObj = EncryptFact::create($testData);\n \n echo 'Original Plain Text 1: ' . $testData;\n // Calls to Encrypt Methods.\n $encryptedData = $CipherObj->encrypt();\n // Calls to Encrypt Methods.\n $newData = $CipherObj->decrypt();\n \n // Assertion Test to match word.\n $this->assertSame($testData, $newData);\n\n /**\n * Test 2\n */\n $testData = \"SRIJAN\";\n // Have the factory create the Encryption object\n $CipherObj = EncryptFact::create($testData);\n \n echo '\\nOriginal Plain Text 2: ' . $testData;\n \n // Calls to Encrypt Methods.\n $encryptedData = $CipherObj->encrypt();\n // Calls to Encrypt Methods.\n $newData = $CipherObj->decrypt();\n \n // Assertion Test to match word.\n $this->assertSame($testData, $newData);\n }", "public static function encriptar( $plainString ){\n return $plainString;\n }", "protected function encrypt($password)\n {\n \t# this is currently VERY bad encryption. Later on, I'll change it to work with bcrypt, which is way better.\n \treturn md5(sha1($password) . md5($password));\n }", "public function key() {}", "public function key() {}" ]
[ "0.7397771", "0.7049035", "0.70283306", "0.6908627", "0.66777456", "0.6553728", "0.6415885", "0.6407693", "0.63882494", "0.63412756", "0.63311416", "0.62252945", "0.6217367", "0.6192916", "0.61740404", "0.61563826", "0.6153071", "0.6133801", "0.61155415", "0.60402226", "0.60330033", "0.5980773", "0.5951061", "0.59473205", "0.594141", "0.59322417", "0.5917994", "0.5881305", "0.58510387", "0.5843763", "0.5843306", "0.5842674", "0.58299786", "0.5819698", "0.5819698", "0.57850194", "0.5779472", "0.5779472", "0.5779472", "0.5779472", "0.5759547", "0.57538074", "0.5725816", "0.57124364", "0.57048845", "0.5696428", "0.5675637", "0.56748605", "0.5673196", "0.5670893", "0.5668452", "0.5658555", "0.5646016", "0.56374323", "0.562767", "0.56085366", "0.55931234", "0.5584649", "0.5584363", "0.5583278", "0.55804306", "0.5579926", "0.55642617", "0.556254", "0.55564404", "0.5542262", "0.55357957", "0.5531006", "0.551745", "0.5499747", "0.54886526", "0.54758525", "0.5473676", "0.54727787", "0.547021", "0.54586875", "0.54564524", "0.5447934", "0.5446443", "0.5444532", "0.5443115", "0.54351753", "0.542618", "0.54217356", "0.5419943", "0.5412611", "0.5412611", "0.5404551", "0.5402938", "0.53978455", "0.5396872", "0.539486", "0.53858083", "0.5384139", "0.53829765", "0.53813314", "0.53805214", "0.5378583", "0.53708583", "0.53672075", "0.53672075" ]
0.0
-1
Fetch Business by City id
public function getCityWiseBusiness() { $start=0; $limit=20; $city_id=$_REQUEST['city_id']; $fromdate=$_REQUEST['fromdate']; $todate=$_REQUEST['todate']; $topClickedBusinesses = Business::where('approved_by_admin','1')->where('status','Active'); if(!empty($city_id)) { $topClickedBusinesses = $topClickedBusinesses->where('city',$city_id); } if(!empty($fromdate)) { $topClickedBusinesses = $topClickedBusinesses->where('created_at','>=',$fromdate.' 00:00:00'); } if(!empty($todate)) { $topClickedBusinesses = $topClickedBusinesses->where('created_at','<=',$todate.' 23:59:59'); } $topClickedBusinesses = $topClickedBusinesses->orderby('top_clicked', 'DESC')->limit($limit)->offset($start)->get(); $jsonDAta = []; $colorCode=['#b87333','#8000ff','#ffff00','#e5e4e2','#ff8000','#ff00ff','#b87333','silver','#bf00ff','#40ff00','#b87333','#ff4000','#ffbf00','#00bfff','#ff00bf','#4000ff','#e5e4e2','#ff00ff','#8000ff','#e5e4e2']; $jsonDAtaBusiness=[]; $i=0; foreach($topClickedBusinesses as $value) { $businessName=$value['business_name']; if(empty($value['top_clicked'])) { $noOfClick=0; } else { $noOfClick=$value['top_clicked']; } $jsonDAtaBusiness[]=[$businessName,$noOfClick,$colorCode[$i]]; $i++; } $response['rec'] = $jsonDAtaBusiness; echo json_encode($response); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($id_city){\n\n //-- return all query and use the object result in update-profile\n return $search = mysql_query(\"SELECT id_city, states.id_state, states.state, city FROM cities INNER JOIN states ON(cities.id_state = states.id_state ) WHERE id_city='\".$id_city.\"' LIMIT 1\"); \n \n }", "function getCitiesBehalfState($stateId) {\n $myModel = new My_Model();\n $whereArray = [\n \"state_id\" => $stateId\n ];\n $result = $myModel->select('cities', \"*\", $whereArray);\n if (count($result) > 1) {\n return $result = [\n \"message\" => \"cities list\",\n \"data\" => $result\n ];\n } else {\n return $resp = [\n \"message\" => \"no city available\",\n \"data\" => \"null\"\n ];\n }\n }", "function particularcity($id)\n\t{\n\t\t$getParcity=\"SELECT * from cities where id = $id\";\n\t\t$getParcitydata = $this->get_results( $getParcity );\n\t\treturn $getParcitydata;\n\t}", "function get_city_details_by_id( $city_id ) {\r\n\r\n \t$result = array();\r\n\r\n\t$ci = & get_instance();\r\n\r\n \t$ci->db->select( '*' );\r\n\r\n \t$ci->db->from( 'tbl_city' );\r\n\r\n\t$ci->db->where( 'city_id', $city_id) ;\r\n\r\n\t$query = $ci->db->get();\r\n\r\n \t$result = $query->result_array();\r\n\r\n \treturn $result;\r\n\r\n }", "function getcity_get(){\n\n $stateID = $this->uri->segment(4);\n\n $stateID = isset($stateID) ? $stateID : \"\";\n\n if ($stateID == FALSE) {\n $responsedata = array(\n 'status' => FALSE,\n 'message' => 'State id should not be empty.'\n );\n $this->response($responsedata, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n \n $from = 'cities';\n $where = array('state_id' => $stateID);\n $select = '*';\n $records = 2;\n\n $cities = $this->base_model->getCommon($from, $where, $select, $records);\n\n if ($cities) {\n $responsedata = array(\n 'status' => TRUE,\n 'message' => 'Cities found successfully.',\n 'result' => $cities\n );\n $this->set_response($responsedata, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code \n }else{\n $responsedata = array(\n 'status' => FALSE,\n 'message' => 'State not found.'\n );\n $this->response($responsedata, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n }", "function getCity($state_id=null){\r\n\t\tif($state_id==null)return false;\r\n\t\t$this->db->select('id');\r\n\t\t$this->db->where(array('mst_states_id'=>$state_id));\r\n\t\t$this->db->where(array(TBL_MST_CITIES.'.added_by'=>ADMIN_NAME));\r\n\t\t$recordSet = $this->db->get(TBL_MST_CITIES);\r\n\t\t$data=$recordSet->result() ;\r\n\t\treturn $data;\r\n\t}", "public function getCitiesByStateId($id){\n\n $cities = $this->cityRepo->get($id);\n $cities_array = array();\n if($cities){\n foreach($cities as $key=>$city)\n {\n $cities_array[$key]['id'] = $city->getId();\n $cities_array[$key]['name'] = $city->getName();\n\n }\n }\n return json_encode($cities_array);\n }", "public function findCityById($id)\n\t{\n\t\t$qb = $this->createQueryBuilder('c');\n\t\t$qb->where(\n\t\t\t$qb->expr()->eq('c.id',':id')\n\t\t\t);\n\t\t$qb->setParameter('id',$id);\n\t\t\n\t\treturn $qb->getQuery()->getOneOrNullResult();\n\n\t}", "function select_business_data($bus_id)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"SELECT * FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE id = '$bus_id' \";\n\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Select Model', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "public function getSpecificCityData($id)\n {\n $this->db->where('cities.cityId', $id);\n $query1 = $this->db->from('job_ads')\n ->join('cities', 'cities.cityId=job_ads.cityId')\n ->join('paper', 'paper.paperId=job_ads.paperId')\n ->join('departments', 'departments.depttId=job_ads.depttId')\n ->join('categories', 'categories.catId=job_ads.catId')\n ->get();\n\n\n return $query1->result();\n }", "public function getById($id)\n {\n return City::findOrFail($id);\n }", "public function getCities($id)\n {\n return $cities = DB::select('select id,name from cities where state_id = :state_id', ['state_id' => $id]);\n }", "function get_internships_by_company($id) {\n return get_view_data_where('internships', $id);\n}", "function get_areas_by_city_id( $city_id ) {\r\n\r\n \t$result = array();\r\n\r\n\t$ci = & get_instance();\r\n\r\n \t$ci->db->select( '*' );\r\n\r\n \t$ci->db->from( 'tbl_area' );\r\n\r\n\t$ci->db->where( 'city_id', $city_id) ;\r\n\r\n\t$query = $ci->db->get();\r\n\r\n \t$result = $query->result_array();\r\n\r\n \treturn $result; \r\n\r\n }", "public function get_all_city()\n\t {\n\t \t $data=(array)json_decode(file_get_contents(\"php://input\"));\n\t \t$id=$data['state_id'];\n\t \t$query=$this->ApiModel->get_all_city($id);\n\t \techo json_encode($query);\n\t }", "function getCityByID($id)\r\n {\r\n $sql=\"SELECT city_id, city_name\r\n\t\t\t FROM \r\n\t\t\t edms_city \r\n\t\t\t WHERE city_id=$id\";\r\n $result=dbQuery($sql);\r\n $resultArray=dbResultToArray($result);\r\n \r\n if(dbNumRows($result)>0)\r\n {\r\n return $resultArray[0];\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n\r\n }", "function particularcompany($id)\n\t{\n\t\t$getParcmpy=\"SELECT * from company where id = $id\";\n\t\t$getParcmpydata = $this->get_results( $getParcmpy );\n\t\treturn $getParcmpydata;\n\t}", "function get_company_detail($id) {\n return get_view_data_where('org_detail', $id);\n}", "function getCityCircuit()\r\n{\r\n\tglobal $db;\r\n\t$city = intval(GET_INC('city'));\r\n\t$db->connDB();\r\n\t$db->query(\"SELECT id,name FROM bus_circuit WHERE city={$city};\");\r\n\t$fw = true;\r\n\twhile ( $res = $db->fetch_array() )\r\n\t{\r\n\t\tif ( $fw )\r\n\t\t{\r\n\t\t\t$fw = false;\r\n\t\t}else{\r\n\t\t\techo '&';\r\n\t\t}\r\n\t\techo $res['id'];\r\n\t\techo ',';\r\n\t\techo $res['name'];\r\n\t}\r\n\t$db->closeDB();\r\n}", "function get_business($business_id) {\r\n $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id);\r\n \r\n return request($GLOBALS['API_HOST'], $business_path);\r\n }", "public function getCitiesByStateAction() {\n\n // Verifica a chave de comunicacao da API\n if(!parent::checkApi()) {\n // Retorna erro 400 na requisição se a chave não estiver correta\n return http_response_code(400);\n } else {\n // Descriptografa os dados vindos por POST\n $this->post = parent::checkApi();\n }\n\n // \n if(!isset($this->post->stateId)) {\n $this->response->errorCode = 1;\n $this->response->errorMessage = 'Falta o ID do estado';\n return $this->return();\n }\n\n try {\n \n // Busca o estado \n $cities = GeoCity::find([ \n 'CityUF = :stateId:',\n 'bind' => [\n 'stateId' => parent::sanitize($this->post->stateId, 'int')\n ]\n ]);\n\n if(!count($cities) > 0) {\n\n throw new Exception(\"Nenhum registro encontrado\");\n } else {\n\n $this->response->data = $cities;\n return $this->return();\n }\n\n } catch (Exception $e) {\n \n // Resposta da API\n $this->response->errorCode = 1;\n $this->response->errorMessage = $e->getMessage();\n return $this->return();\n }\n }", "public function show($id) {\n $city = City::find($id);\n $city->buildings;\n $city->resource;\n $city->position;\n $city->income;\n return $city; //\n }", "public function show($id)\r\n {\r\n return City::find($id);\r\n }", "public function actionGetcity($id){\n\t\t$rows = \\app\\models\\City::find()->where(['state_id' => $id,'is_status'=>0])->all();\t \n\t\techo \"<option value=''>\".Yii::t('app', '--- Select City ---').\"</option>\";\t \n\t\tif(count($rows)>0){\n\t\t foreach($rows as $row){\n\t\t echo \"<option value='$row->city_id'>$row->city_name</option>\";\n\t\t }\n\t\t}\n\t\telse{\n\t\t echo \"\";\n\t\t}\n \n \t}", "public function getBeaufortWestCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '101'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getAllCitiesByStateId($state) {\n $stateName = '';\n $stateId = '';\n $states = explode(\"/\", $state);\n $stateName = $states[0]; // piece1\n $stateId = $states[1]; // piece2\n\n $sql = \"SELECT * FROM cities WHERE state_id = '$stateId'\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return $result->result_array();\n }\n }", "public function loadResultByTownIdDb($townId);", "public function getMosselBayCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '103'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function get_chamber_business(){\r\n $sql = $this->db->prepare(\"SELECT businessID, businessname FROM BUSINESS WHERE chamberID = :chamberid;\");\r\n\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber'],\r\n ));\r\n\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "public function actionGetorgcity($id)\n\t{\n\t\t$rows = \\app\\models\\City::find()->where(['state_id' => $id,'is_status'=>0])->ALL();\t \n\t\techo Html::tag('option', Html::encode(Yii::t('app', '--- Select City ---')), ['value'=>'']); \t \n\t\t foreach($rows as $row)\n\t\t\techo Html::tag('option', Html::encode($row->city_name), ['value'=>$row->city_id]); \n \n \t}", "static function getCompanyById($id){\n try{\n include('loginBDD.php');\n $sql = \"SELECT * FROM company WHERE id = :id\";\n $prepared = $bdd->prepare($sql);\n\n if(!$prepared->execute([\n ':id' => $id\n ])){\n print_r($bdd->errorInfo());\n }\n\n $result = $prepared->fetch();\n return $result;\n\n }\n catch(\\Exception $e)\n {\n die('Erreur : '.$e->getMessage());\n }\n catch(\\PDOException $e)\n {\n die('Erreur : '.$e->getMessage());\n }\n }", "public function getBitouCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '107'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function getStateFromCity($ids){\r\n\r\n\t$ci \t= & get_instance();\r\n\r\n \t$ci->db->select('state_id');\r\n\r\n\t$ci->db->where_in('city_id',$ids);\r\n\r\n\t$query = $ci->db->get('tbl_city');\r\n\r\n \t$res = $query->result_array();\r\n\r\n \t//echo $ci->db->last_query();exit;\r\n\r\n \treturn $res; \r\n\r\n }", "static function fetch($cid) {\n $c = new static($cid);\n $c->Address_Mother = ClientAddress::asJoinMother();\n $c->Address_Father = ClientAddress::asJoinFather();\n $c->Address_Home = ClientAddress::asJoinHome();\n return static::fetchOneBy($c);\n }", "public function show(City $city, $id)\n {\n \n }", "public function fetchBusStopCity($conditions =''){\n\t\t$query=\"SELECT busStopCityId,cityName FROM `bus_stop_city` $conditions ORDER BY cityName\";\n\t\treturn SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n\t}", "public function get_business_data($add_id=null){\n\t\t$this->db->select('categories.name as category_name,cities.name as city_name,areas.name as area_name');\n\t\t$this->db->join('categories','categories.id=category_listing.category_id');\t\n\t\t$this->db->join('advertisements','advertisements.id=category_listing.listing_id');\n\t\t$this->db->join('areas','areas.id=category_listing.area_id');\n\t\t$this->db->join('cities','cities.id=category_listing.city_id');\n\t $this->db->where('category_listing.listing_id',$add_id);\n\t\t$this->db->where('categories.is_active', true);\n\t\t$this->db->from('category_listing');\n\t $query = $this->db->get();\t\n\t\t$results=$query->result_array();\n\t\treturn $results;\n\t}", "public function getCity();", "function get_contacts_by_company($id) {\n return get_view_data_where('org_contact_list', $id);\n}", "public function getnationalityByid ($id){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM nationalities \";\n $sqlQuery .= \" WHERE id=’ $id ’ \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }", "function cities($state_id)\n\t{\n //echo json_encode(array('' => 'Ciudad') + ORM::factory('city')->where('state_id', $state_id)->orderby('city')->select_list('CONCAT(city_lon,\",\",city_lat)','city'));\n $cities = array();\n $_rs = ORM::factory('city')->select('city_lon AS lon, city_lat AS lat, city AS n, id')->where('state_id', $state_id)->orderby('city')->find_all();\n foreach($_rs as $_r) {\n $c['n'] = $_r->n;\n $c['id'] = $_r->id;\n $c['lonlat'] = $_r->lon.','.$_r->lat;\n\n $cities[] = $c;\n }\n header('Content-type: application/json; charset=utf-8');\n echo json_encode($cities);\n }", "public function stateAndCity()\n {\n $state = DB::table('states')\n // ->where('country_id', 231)\n // ->where('country_id','232')\n // ->where('country_id','38')\n ->get();\n // $city = DB::table('cities')->get();\n return response()->json([\n 'message' => 'found!',\n 'state' => $state,\n // 'city' => $city,\n 'success' => true,\n ], 200);\n }", "function getCityFromArea($ids){\r\n\r\n\t$ci \t= & get_instance();\r\n\r\n \t$ci->db->select('city_id');\r\n\r\n\t$ci->db->where_in('area_id',$ids);\r\n\r\n\t$query = $ci->db->get('tbl_area');\r\n\r\n \t$res = $query->result_array();\r\n\r\n \t//echo $ci->db->last_query();exit;\r\n\r\n \treturn $res; \r\n\r\n }", "public function getSaldanhaBayCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '119'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function fetch_city($state_id){\n \n\t if(!empty($state_id)){\n\t\t $state_ids=explode(',',$state_id);\n\t }\n $this->db->where_in('state_id', $state_ids);\n\t\t$this->db->where('status','1');\n $this->db->order_by('city_name', 'ASC');\n $query = $this->db->get('cities');\n\t\t//echo $this->db->last_query();die;\n if($query->num_rows()>0){\n $output = '';\n\t\t$output .= '<option value=\"\">Select</option>';\n foreach($query->result() as $row){\n //pr($row);die;\n\t\t\t\n $output .= '<option value=\"'.$row->id.'\">'.$row->city_name.'</option>';\n }\n }else{\n\t\t\t$output .= '<option value=\"\">No city found</option>';\n\t\t}\n return $output;\n }", "function getAllCities($country_id,$state_id){\n $sql = \"SELECT * FROM `cities` WHERE state_id = :state_id \";\n\n\n\n try {\n $db = getDB();\n\n //get all service providers of the id\n $stmt = $db->prepare($sql);\n\n $stmt->bindParam(\"state_id\", $state_id);\n\n $stmt->execute();\n $cities = $stmt->fetchAll(PDO::FETCH_OBJ);\n\n\n $db = null;\n echo '{\"cities\": ' . json_encode($cities) . '}';\n\n } catch (PDOException $e) {\n //error_log($e->getMessage(), 3, '/var/tmp/php.log');\n echo '{\"error\":{\"text\":' . $e->getMessage() . '}}';\n }\n\n}", "function loadCityAddress($id=null, $id2=null, $id3=null) {\n $this->layout = false;\n $this->City->recursive = -1;\n $cities = $this->City->find('list', array('conditions' => array(\"City.state_id\" => $id), 'fields' => array('City.name'), 'order' => array('City.name ASC')));\n if (empty($id3))\n $this->set(compact('cities', 'id2'));\n else\n $this->set(compact('cities', 'id2', 'id3'));\n }", "public function codeByCityId() {\n return $this->belongsTo('App\\Code', 'city_id', 'id')->select('id', 'txt');\n }", "public function fetchSelectedEmergencyContact(){\n $tableType = $this->_request['tableType'];\n $sql = \"select * from $tableType join city c on $tableType.cityId = c.CityID\";\n $rows = $this->executeGenericDQLQuery($sql);\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $parkingDetails[$i]['id'] = $rows[$i]['id'];\n $parkingDetails[$i]['name'] = $rows[$i]['name'];\n $parkingDetails[$i]['address'] = $rows[$i]['address'];\n $parkingDetails[$i]['contact'] = $rows[$i]['contact'];\n //$parkingDetails[$i]['authority'] = $rows[$i]['authority'];\n $parkingDetails[$i]['CityName'] = $rows[$i]['CityName'];\n // $parkingDetails[$i]['icon_image'] = $rows[$i]['icon_image'];\n\n }\n $this->response($this->json($parkingDetails), 200);\n\n }", "public function getcity_area($id)\n {\n $data = $this->addcity->with(['Area'])->find($id);\n //dd($data);\n return $data;\n }", "public static function __getCities($state_id = \"23\", $active = \"1\", DbConnection $DbConnection = null) \r\n\t{\r\n\t\t$DbConnection = ($DbConnection == null) ? DbConnection::getInstance(\"_world\") : $DbConnection ;\r\n\t \t$sql = \"SELECT city_id, city FROM city WHERE state_id = '{$state_id}' AND active = '{$active}' \";\r\n\t \t\r\n\t \treturn $DbConnection->getPair($sql);\r\n\t}", "public function getCities($id)\n {\n if(LaravelLocalization::getCurrentLocale() == 'ar'){\n $name = 'name_ar';\n }else{\n $name = 'name_en';\n }\n $cities = City::select('id', \"$name as name\")->where('country_id', $id)->get();\n return response($cities);\n }", "public function getCity() {}", "public function fetchById($id, $addressType=null){\n $where = $this->quoteInto('agency_id = ?', $id);\n\t\tif(!is_null($addressType)){\n\t\t\t$where .= $this->quoteInto(' AND address_type = ?', $addressType);\n\t\t}\n \t$select = $this->select()\n\t\t\t->from($this->_name)\n ->where($where);\n \n\t\t$rows = $this->fetchAll($select);\n\t\treturn $rows->toArray(); \n }", "function getCpny($vcpny_id) {\n $cpny = $this->db->selectObj('SELECT company_id, cnpj, ie, shortname, longname, '\n . 'bussiness_phone, mobil_phone, nextel_phone, nextelid, email, status, note, date_create, date_change '\n . 'FROM company '\n . 'WHERE company_id = :company_id', array(':company_id' => $vcpny_id), \"Company\");\n //\n $addrcpny = $this->db->selectObj('SELECT company_id, zipcode, zipid, address, addr_number, district, city, state, reference '\n . 'FROM companyaddr '\n . 'WHERE company_id = :company_id', array(':company_id' => $vcpny_id), \"CompanyAddr\");\n\n //print \"<pre>\";\n //print_r($obj);\n //print \"</pre>\";\n //exit();\n //\n $cpny->setAddr($addrcpny);\n //\n return $cpny;\n }", "public function getBergrivierCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '116'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function get_city(){\n \n $this->db->order_by('city', 'asc'); \n $result = $this->db->get('shiprate')->result();\n \n foreach($result as $res){\n $output[] = array (\"city_id\" => $res->cityid, \"city\" => $res->city);\n }\n $response['content'] = $output;\n $this->output\n ->set_status_header(200)\n ->set_content_type('application/json', 'utf-8')\n ->set_output(json_encode($response,128))\n ->_display();\n exit; \n }", "public function getCities($id_country){\n $stmt = $this->databaseConnection->prepare(\"SELECT id_city, city_name FROM cities WHERE id_country = :countryName\");\n\n $stmt->bindParam(':countryName', $id_country);\n $stmt->execute();\n return $stmt->fetchAll();\n }", "public function show($id) {\n return CompanyData::find($id);\n }", "public function byCompanyId($companyId);", "function getBuildingInfo() {\n return getOne(\"SELECT * FROM building WHERE id = ?\",[getLogin()['bid']]);\n}", "function get_city_name($id)\n{\n $con = mysqli_connect('localhost','root','','bloodbank');\n mysqli_query($con,'SET CHARACTER SET utf8');\n mysqli_query($con,' DEFAULT COLLATE utf8_general_ci');\n $select_govern_name_with_id = mysqli_fetch_all(mysqli_query($con, \"Select * from city where id=\".$id.\" \"), MYSQLI_ASSOC);\n\n return $select_govern_name_with_id[0]['name'];\n}", "public function getStellenboschCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '99'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function get_city($province_id)\n {\n $data = MasterCity::where('province_code',$province_id)->groupby('city')->get();\n return json_encode($data);\n }", "function getCity($city_id) {\n\t\treturn !empty($this->city_data[$city_id]) ? array($this->city_data[$city_id]) : $this->getCityList(array('city_id' => $city_id));\n\t}", "function get_country_circuit_db($idCircuit)\n{\n require('./model/connect_db.php');\n $sql = \"select c.place from circuit c where c.idCircuit = '%d'\";\n $request = sprintf($sql,$idCircuit);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n\n $country = mysqli_fetch_assoc($result);\n return $country;\n}", "public function getSwartlandCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '120'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function indexCity($city)\n {\n $city = City::where('name', $city)->first();\n $locations = $city->locations;\n $housesIndex = [];\n foreach ($locations as $location) {\n $houses = $location->houses->where('status', 1);\n if (count($houses) > 0) {\n foreach ($houses as $house) {\n if ($house->coordinates()->first()) {\n $coordinates = $house->coordinates()->first();\n $minPrice = $house->minPrice();\n $maxPrice = $house->maxPrice();\n\n array_push(\n $housesIndex,\n array(\n 'minPrice' =>$minPrice,\n 'maxPrice'=>$maxPrice,\n 'house'=>$house,\n 'coordinates'=>$coordinates\n )\n );\n }\n }\n }\n }\n // $houses = House::whereHas('neighborhood.location.zone.city',function($query) use ($city){\n // $query->where('id',$city->id);\n // })->where('status',1)->get();\n\n return response()->json($housesIndex, 200);\n }", "public function get_city(){\n $statid = $this->input->post('sid');\n $this->depmodel->get_citylist($statid);\n }", "public function getLaingsburgCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '105'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function actionGet($id) {\n $lang = Yii::app()->language;\n $field = 'title_' . $lang;\n $model = AddressCity::model()->findByPk($id);\n $result = ['id' => $model->id, 'title' => $model->$field];\n $this->renderPartial('//ajax/json', ['body' => json_encode($result, JSON_FORCE_OBJECT)]);\n }", "public function show($id)\n {\n $validator = \\Validator::make(\n ['id' => $id],\n array(\n 'id' => 'required|exists:cities,id|integer',\n ),\n [\n 'id' => __(\"validation.required\"),\n ]\n );\n if($validator->fails()) {\n return response()->json($validator)->setStatusCode(400);\n }else {\n\n return new CityApi($this->city->findOrFail($id));\n }\n\n }", "function areazonelist($id)\n\t{\n\t\t$areazonelist=\"SELECT * from zone where city_id = $id\";\n\t\t$areazonelistdata = $this->get_results( $areazonelist );\n\t\treturn $areazonelistdata;\n\t}", "public function CityList($id=null)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('city');\n\t\tif ($id!=null) \n\t\t{\n\t\t\t$this->db->where('city_id',$id);\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function getcity(Request $request){\n\t\t$stateid = $request->input('stateid');\n\t\t$arrCitydata = City::where('state_id','=',$stateid)->get();\n\t\t$citydata = array();\n\t\t$i = 0;\n\t\tforeach($arrCitydata as $city)\n\t\t{\n\t\t\t$citydata[$i]['id'] = $city['city_id']; \n\t\t\t$citydata[$i]['name'] = $city['city_name'];\n\t\t\t$i++;\n\t\t}\n\t\treturn response()->json($citydata);\n\t\texit();\n }", "public function getCity()\n {\n // return $sql;\n }", "function get_user_state_cities($state_id){\n\t\t$this->db->select('name,id');\n\t $this->db->where('state_id',$state_id);\n\t $result = $this->db->get('cities');\n\t \n\t\tif ($result->num_rows()>0) {\n\t return $result->result_array();\n\t } else {\n\t return false;\n\t } \n\t}", "function _getCompanyDataByContestId($contest_id){\n $this->auth(COMP_ADM_LEVEL);\n $data['company'] = $this->m_company->getCompanyByContestId($contest_id);\n $data['contest'] = $this->m_contest->getContestById($contest_id);\n $data['contest_dates'] = $this->m_contest_dates->getDatesByContestId($contest_id);\n return $data;\n }", "public function getservice($id)\n {\n return Service::where('country_id',$id)->get();\n }", "public function show($id)\n {\n return County::with('hascities')->where('id', $id)->get();\n }", "public function getWitzenbergCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '100'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function showCitiesAndBarangays($city)\n\t{\n\t\t$city = DB::table('cities')\n\t\t\t\t->select('id', 'name')\n\t\t\t\t->where('name', urldecode($city))\n\t\t\t\t->get();\n\n\t\tif(count($city) == 0) {\n\t\t\treturn Response::json(array('status' => 'error', 'message' => 'Province and City combination mismatch or No result found.'));\n\t\t}\n\n\t\t$barangays = DB::table('barangay')\n\t\t\t\t\t->select('id', 'name')\n\t\t\t\t\t->where('id_city', $city[0]->id)\n\t\t\t\t\t->get();\n\n\t\tif(count($barangays) > 0) {\n\t\t\t//Get all provinces\n\t\t\treturn Response::json($barangays);\n\t\t}\n\n\t\treturn Response::json(array('status' => 'error', 'message' => 'Province and City combination mismatch or No result found.'));\n\t}", "public function getClinicById($id, $db) {\n //Initialise SQL\n $sql = 'SELECT * FROM clinic WHERE Id =' . $id;\n //Query the DB using the above SQL\n $result = $this->query($sql)->fetch();\n //if clinic not found return null\n if ($result === FALSE) {\n return null;\n } \n //If the clinic is found, map the returned array to an instance of a clinic object\n else {\n $clinic = new Clinic;\n ClinicMapper::map($clinic, $result);\n return $clinic;\n } \n }", "function particularbranch($id)\n\t{\n\t\t$getParsubbrand=\"SELECT * from brand where brand_id = $id\";\n\t\t$subbrand_data=$this->get_results( $getParsubbrand );\n\t\treturn $subbrand_data;\n\t}", "public function findAllActiveCity()\n\t{\n\t\t$sql=$this->db->query(\"SELECT * FROM `city` WHERE `status`='1' \");\n\t\treturn $sql->fetchAll();\n\t}", "public function fetchCity(int $cityID){\n $sqlFetchCity = '\n select\n *\n from\n city_link\n left join\n city_translation\n on\n city_link.city_link_ID = city_translation.city_link_ID\n where\n city_link.city_link_ID = \"'.$cityID.'\"\n ';\n $queryResult = $this->db->query($sqlFetchCity);\n while($r=$queryResult->fetch_assoc()){\n switch($r['langCode']){\n case $this->langList['portuguese']: $output[$this->langList['portuguese']] = $r;\n break;\n case $this->langList['english']: $output[$this->langList['english']] = $r;\n break;\n }\n }\n return $output;\n }", "public function __construct($id) {\n $statement = Configuration::openConnection()->prepare(\"SELECT * FROM businesses AS b JOIN states AS s ON b.state=s.stateId WHERE b.id=:id\");\n \n $statement->bindParam(\":id\", $id);\n\n $statement->execute();\n\n $results = $statement->fetch(PDO::FETCH_ASSOC);\n\n $this->setBusinessId($results['id']);\n $this->setName($results['name']);\n $this->setStation($results['station']);\n $this->setStreetAddress($results['streetAddress']);\n $this->setCity($results['city']);\n $this->setState(array('id' =>$results['stateId'], 'abbreviation' => $results['stateAbbreviation'], 'name' => $results['stateName']));\n $this->setZipcode($results['zipcode']);\n $this->setPhone($results['phone']);\n $this->setUrl($results['url']);\n $this->setServices($results['services']);\n //$this->setType(array('id' => $results['typeId'], 'type' => $results['typeName']));\n\n Configuration::closeConnection();\n }", "public function getCitiesInState($state) {\n return $this->createQuery()\n ->select(\"DISTINCT c.city AS city\")\n ->from(\"Companies_Model_Company c\")\n ->where(\"c.state = ? AND c.local_business\", mb_strtoupper($state, \"UTF-8\"))\n ->andWhereIn(\"c.status\", Companies_Model_Company::getActiveStatuses())\n ->orderBy(\"city ASC\")\n ->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n }", "function getBusinessServiceDetail($id){\n $serviceDate = DB::table('servicing')\n ->where('showroomID', $id)\n ->get();\n return $serviceDate;\n }", "public function getUsersByCity()\n {\n $conn = Connection::getInstance();\n\n $sql = \"select s.id as state_id, s.name as state_name, s.initials,\n c.id as city_id, c.name as city_name,\n count(u.id) as qtd\n FROM state s inner join city c on (c.state_id = s.id)\n inner join address a on (a.city_id = c.id)\n inner join user u on (u.address_id = a.id) \" .\n ($this->id > 0 ? \" where c.id = :id \" : \"\") .\n \" GROUP BY s.id, s.name, s.initials, c.id, c.name \" .\n \" ORDER BY s.id, c.id \";\n\n $rs = $conn->prepare($sql);\n\n if ($this->id > 0) {\n $rs->bindValue(':id', $this->id, PDO::PARAM_INT);\n }\n\n $rs->execute();\n\n $arrayCity = array();\n\n while ($row = $rs->fetch(PDO::FETCH_OBJ)) {\n\n if ($this->id > 0) {\n\n $this->name = $row->city_name;\n $this->countUsers = $row->qtd;\n $this->setState(new State($row->state_id, $row->state_name, $row->initials));\n\n return;\n }\n\n $newCity = new CityReport($row->city_id, $row->city_name, $row->qtd);\n $newCity->setState(new State($row->state_id, $row->state_name, $row->initials));\n\n array_push($arrayCity, $newCity->returnArray());\n\n }\n\n // se chegar ate aqui, quer dizer que nao localizou a cidade\n if ($this->id > 0) {\n throw new Exception('Cidade não localizada!');\n }\n\n return $arrayCity;\n }", "public function viewByBusinessIdForSelect($id = null) {\n\t\t$contacts = $this->Contact->findByBusinessId('list', $id);\n\t\t$this->set(compact('contacts'));\n\t}", "public function loadResultByTownApi($town);", "public function getSwellendamCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '114'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getCity()\n {\n return $this->hasOne(City::class, ['id' => 'city_id']);\n }", "public function getOudtshoornCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '102'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function GetProjectCityDetail($cityID=false,$languageID=false)\n\t{\n\t\t$qry=$this->db->query(\"select rp_city_details.cityName from rp_cities,rp_city_details where rp_cities.cityID='$cityID' and rp_cities.cityStatus='Active' and rp_city_details.cityID='$cityID' and rp_city_details.languageID='$languageID'\");\n\t\treturn $qry->result();\n\t}", "public function getCity()\n {\n return $this->hasOne(City::className(), ['id' => 'city_id']);\n }", "public function getCity()\n {\n return $this->hasOne(City::className(), ['id' => 'city_id']);\n }", "public function getCity()\n {\n return $this->hasOne(City::className(), ['id' => 'city_id']);\n }", "public function getCity()\n {\n return $this->hasOne(City::className(), ['id' => 'city_id']);\n }" ]
[ "0.6639894", "0.6566907", "0.6478065", "0.6268527", "0.6225092", "0.6204726", "0.62000656", "0.6171063", "0.6161848", "0.61611676", "0.616001", "0.6108149", "0.60548276", "0.60414016", "0.5997809", "0.59919524", "0.59669214", "0.59598655", "0.5919749", "0.59109735", "0.58667135", "0.58564246", "0.5845839", "0.58326817", "0.5793839", "0.5791129", "0.5775577", "0.5753417", "0.57449615", "0.57397324", "0.5725882", "0.57245076", "0.5715757", "0.5714807", "0.5693894", "0.56922656", "0.56903714", "0.5681524", "0.56785905", "0.5673335", "0.566243", "0.56600994", "0.56578153", "0.56563246", "0.56549776", "0.5631824", "0.563136", "0.56243366", "0.5613216", "0.5612841", "0.56067675", "0.55961764", "0.5590646", "0.55725425", "0.55553263", "0.5554284", "0.55530393", "0.55470383", "0.5542735", "0.5535006", "0.5521142", "0.5519503", "0.55130106", "0.5510315", "0.5508682", "0.550863", "0.5498858", "0.5497253", "0.5496656", "0.54937863", "0.54861844", "0.54695016", "0.5453147", "0.5451475", "0.54477835", "0.5447089", "0.5442521", "0.5440379", "0.54331404", "0.54325944", "0.54307586", "0.54244643", "0.5423789", "0.54175687", "0.540294", "0.5393875", "0.53880006", "0.53859955", "0.5381109", "0.5378282", "0.53739", "0.5367466", "0.53656006", "0.53640425", "0.53605944", "0.5354947", "0.5350885", "0.5350885", "0.5350885", "0.5350885" ]
0.57340926
30
Function Name : getCityWiseCustomers Purpose : This function is use for on change get city realated Customers Count. Author : Created Date : 14012021 Modified date : Input Params : \Illuminate\Http\Request $request Return Value : void
public function getCityWiseCustomers($id) { // Fetch Customers by City id $customerCount=DB::table('users')->select(DB::raw('COUNT(*) as total,date(created_at) as pp')) ->whereRaw('created_at > now() - INTERVAL 7 day') ->where('user_type','CU') ->where('city_id',$id) ->groupby ('pp') ->orderby('created_at', 'DESC')->get(); $colorCode=['#00ffff','#8000ff','#ffff00','#e5e4e2','#ff8000','#ff00ff','#b87333','silver','#bf00ff','#40ff00']; //$jsonDAta=''; $totalCustomer=0; $jsonDAta = []; $noOfCustomers=''; $currentDate=DATE('Y-m-d'); for($i=1;$i<=7; $i++) { $prevDate=date('Y-m-d', strtotime('-1 day', strtotime($currentDate))); if(COUNT($customerCount)>0){ foreach($customerCount as $value) { $noOfCustomers=0; if($value->pp == $currentDate) { $noOfCustomers=$value->total; break; } } } else { $noOfCustomers=0; } $totalCustomer=$totalCustomer+$noOfCustomers; $jsonDAta[] = [date('d/m/Y',strtotime($currentDate)),$noOfCustomers,$colorCode[$i-1]]; //$jsonDAta.='["'.date('d/m/Y',strtotime($currentDate)).'",'.$noOfCustomers.',"'.$colorCode[$i-1].'"]'; $currentDate=$prevDate; } $response['rec'] = $jsonDAta; $response['totalCustomer'] = $totalCustomer; echo json_encode($response); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cities_get()\n {\n $em = $this->doctrine->em;\n $citiesRepo = $em->getRepository('Entities\\City');\n $cities = $citiesRepo->findAll();\n foreach ($cities as $city) {\n $city->servicesCount = $city->getServices()->count();\n }\n $response[\"data\"] = $cities;\n $response[\"count\"] = count($cities);\n $this->set_response($response, REST_Controller::HTTP_OK);\n\n }", "public function getCityData(Request $request)\n {\n if($request->ajax())\n {\n $country_id = $request->input('cid');\n $city_data = getCityList($country_id);\n return response()->json([\n 'data' => $city_data\n ]);\n }\n }", "public function getCustomersTotal(Request $request) {\n\n $customers = $this->customer->getCustomersTotal();\n $customersList = array();\n $totalCustomers = 0;\n\n foreach ($customers as $customer) {\n\n $totalCustomers += $customer->customerTotal;\n\n // Returns the name of the capital\n $capital = CountryCapital::getCountryCapital(trim($customer->country));\n\n $customersList['countrys'][] = array('countryName' => $customer->country,\n 'totalCustomersCountry' => $customer->customerTotal,\n 'capitalName' => $capital[0]['capital']);\n }\n\n $customersList['totalCustomers'] = $totalCustomers;\n\n return response()->json($customersList);\n\n }", "public function customers(Request $request)\n {\n $user = $request->user();\n $currentCompany = $user->currentCompany();\n\n $search = $request->search;\n\n if($search == ''){\n $customers = Customer::findByCompany($currentCompany->id)->limit(5)->get();\n }else{\n $customers = Customer::findByCompany($currentCompany->id)->where('display_name', 'like', '%' .$search . '%')->limit(5)->get();\n }\n\n $response = collect();\n foreach($customers as $customer){\n $response->push([\n \"id\" => $customer->id,\n \"text\" => $customer->display_name,\n \"currency\" => $customer->currency,\n \"billing_address\" => $customer->displayLongAddress('billing'),\n \"shipping_address\" => $customer->displayLongAddress('shipping'),\n ]);\n }\n\n return response()->json($response);\n }", "public function getCustomerCountryList()\n {\n $customerCountryList = DB::table('country')\n ->join('city', 'country.country_id', '=', 'city.country_id')\n ->join('address', 'city.city_id', '=', 'address.city_id')\n ->join('customer', 'customer.address_id', '=', 'address.address_id')\n ->select(DB::raw('country.country, COUNT(customer.*)'))\n ->groupBy('country.country')\n ->orderBy('country')\n ->get();\n\n return response()->json([\n 'success' => true,\n 'message' => 'Customers country list',\n 'data' => $customerCountryList\n ]);\n }", "public function cities(Request $request)\n {\n // get the cities with id\n\n if ($request->has('id'))\n {\n $cities_with_id = City::where('id' , $request->id)->get();\n return $this->responsejson(true , 'success' , $cities_with_id);\n }\n elseif ($request->has('governorate_id'))\n {\n // get the all cities with governorate id\n $cities_with_governorate_id = Governorate::find($request->governorate_id)->cities()->get();\n return $this->responsejson(true , 'success' , $cities_with_governorate_id);\n }\n\n else\n {\n // get the all cities\n $cities = City::all();\n return $this->responsejson(true , 'success' , $cities);\n }\n\n }", "public function getCustomerInfoCount()\n {\n return $this->count(self::customer_info);\n }", "public function getCities(Request $request) {\n\n $cities = CityModel::where('state_id', $request->state_id)->get();\n\n return response()->json($cities);\n }", "public function getCitiesByCountryId(Request $request){\n if($request->countryId){\n $data['getAllCities']=City::where('country_id',$request->countryId)->get();\n $data['mode'] = 'getCitiesByCountryId';\n $allCities = view('ajax')->with($data);\n return $allCities; \n }\n }", "public function getCompaniesByCity(Request $request)\n {\n $city_id = $request->input('city_id');\n print_r($city_id);\n }", "public function getCustomerData(Request $request){\n try{\n if($request->customer_id){\n $data['customer'] = $customer = Customer::where('customer_id',$request->customer_id)->first();\n //$allCustomers = Agent::find($user)->agentsCustomers;\n $data['customerVhicles'] = Vehicle::where('customer_id',$customer->id)->get();\n $data['customerCobrwrGrntr'] = Coborrower_and_guarantor::where('customer_id',$customer->id)->get();\n $data['customerReferences'] = References::where('customer_id',$customer->id)->get();\n \n //$data['allData'] = Vehicle::find($customer->id)->customerVehicle->get();\n if(!empty($data) && isset($data)){\n return response()->json([\n 'customers'=>$data,\n 'status' =>'success',\n 'code' =>200,\n ]);\n }else{\n response()->json([\n 'message'=>'Customers not found',\n 'status' =>'error',\n ]);\n }\n }else{\n response()->json([\n 'message'=>'Please login your account',\n 'status' =>'error',\n ]);\n }\n }catch(\\Exception $e){\n return response()->json([\n 'message'=>\"something went wrong.Please contact administrator.\".$e->getMessage(),\n 'error' =>true,\n ]);\n }\n }", "public function zipCitiesAction(Request $request){\n if ($this->get('cairn_user.api')->isRemoteCall()){\n $em = $this->getDoctrine()->getManager();\n $zcRepo = $em->getRepository(ZipCity::class);\n\n if($search = $request->query->get('search')){\n $zb = $zcRepo->createQueryBuilder('z');\n\n $zb->andWhere(\n $zb->expr()->orX(\n \"z.zipCode LIKE '%\".$search.\"%'\"\n ,\n \"z.city LIKE '%\".$search.\"%'\"\n )\n )\n ->orderBy('z.zipCode');\n $zipCities = $zb->getQuery()->getResult();\n }else{\n $zipCities = $zcRepo->findAll();\n }\n $returnArray = array();\n foreach ($zipCities as $zipCity){\n $returnArray[] = $zipCity->getName();\n }\n return $this->getRenderResponse(\n '',\n [],\n $returnArray,\n Response::HTTP_OK\n );\n }\n return new Response(\"JSON only\",400);\n }", "public function getCategoryVouchers(Request $request){\n $language = ($request->header(\"X-Language\")) ?? 'en';\n\n $category = Category::find($request->category_id);\n if( !$category ){\n return $this->errorResponse(trans('messages.category.notfound'),null,404);\n }\n \n $city = City::find($request->city_id);\n\n if( !$city ){\n return $this->errorResponse(trans('messages.city.notfound'),null,404);\n }\n // it is a client ask to search with city only or city and region\n if( !$request->region_id ){\n $city = City::where('id',$request->city_id)->first();\n $stores = $city->stores()->where('category_id',$request->category_id)\n ->where('discount', '=' , '0')\n ->get();\n $stores = $this->toLang( $language, $stores, false);\n $stores = $stores->map(function ($item) use($language) {\n $vouchers = $item->vouchers;\n $vouchers = $this->toLang( $language, $vouchers, false);\n return $item;\n\n });\n return $this->dataResponse($stores,null,200);\n\n }\n\n $region = Region::where('id',$request->region_id)->where('city_id',$request->city_id)->first();\n if( !$region ){\n return $this->errorResponse(trans('messages.region.notfound'),null,404);\n }\n $branches = Branch::where('region_id',$request->region_id)->get();\n\n $storeResult = [];\n foreach( $branches as $key => $branch ){\n $stores = $branch->store()->where('category_id',$request->category_id)\n ->where('discount', '=' , '0')\n ->get();\n $stores = $this->toLang($language,$stores,false);\n foreach ($stores as $singleStore) {\n\n $vouchers = $singleStore->vouchers;\n $vouchers = $this->toLang($language,$vouchers,false);\n $storeResult[$key] = $singleStore;\n\n }\n }\n // To ensure that no repeated stores and return these only values in array\n $uiquedStores = array_values(array_unique($storeResult));\n \n return $this->dataResponse($uiquedStores,null,200);\n }", "public function cities(Request $request): CityCollection\n {\n return CityCollection::make(City::query()->with('translates')->filter($request->only('region_id'))->paginate($request->get('perPage') ?? 50));\n }", "public function getUserByCity(Request $request){\n $status = 0;\n $message = \"\";\n try{\n if(!$this->verifyChecksum($request)){\n return response()->json([\"status\"=>0,\n \"message\"=>'checksum not verified',\n \"data\"=>json_decode('{}')]);\n }\n //$cond = ($request->role_id && $request->role_id >1 ) ? ['role_id',$request->role_id] : ['role_id','<>',1];\n //$users = User::where([['status', '1'],$cond])->paginate(Config::get('app.record_per_page'));\n $users = User::with(['country','state','city'])->where([['status', '1'],['role_id','<>',1]])->groupBy('city_id')->get();\n $cityArr = [];\n if($users->count()>0){\n foreach($users as $k=>$v){\n $cityArr[$k]['city_id'] = $v->city->id;\n $cityArr[$k]['city_name'] = $v->city->name;\n $cityArr[$k]['state_id'] = $v->state->id;\n $cityArr[$k]['state_name'] = $v->state->name;\n $cityArr[$k]['country_id'] = $v->country->id;\n $cityArr[$k]['country_name'] = $v->country->name;\n }\n }\n //echo '<pre>'; print_r($users[0]->city->name); die;\n return response()->json(['status'=>1,\n 'message'=>$message,\n 'data'=>$cityArr\n ]);\n }catch(Exception $e){\n $message = \"Technical error\";\n return response()->json(['status'=>$status,'message'=>$message,'data'=>json_decode(\"{}\")]);\n }\n }", "public function testCustomersAndTheirOrderCounts() {\n // filter criteria\n $filter = array(\"page\" => 1, \"limit\" => 15);\n // get the customer order data\n $customerArray = $this->customerOrderService->getCustomersAndTheirOrderCounts($filter);\n // assert that 15 customers are returned based on the limit specified in filter.\n $this->assertTrue(sizeof($customerArray) == $filter['limit']);\n }", "public function getFilterRequestsCount($request)\n {\n $service_requestsQuery = ServiceRequest::select('customers.firstname','service_centers.name as sname','products.name as pname','service_requests.amount','service_requests.service_type','service_requests.status','companies.name as cname','service_requests.id','service_requests.created_by')\n ->leftjoin('companies','service_requests.company_id','=','companies.id')\n ->leftjoin('roles','service_requests.technician_id','=','roles.id')\n ->leftjoin('customers','service_requests.customer_id','=','customers.id')\n ->leftjoin('products','service_requests.product_id','=','products.id')\n ->leftjoin('service_centers','service_requests.service_center_id','=','service_centers.id');\n\n if(!empty($request['startdate']) && isset($request['startdate'])){\n $service_requestsQuery->whereRaw(\"DATE_FORMAT(service_requests.created_at, '%Y-%m-%d') BETWEEN '\".$request['startdate'].\"' AND '\".$request['enddate'].\"'\");\n }\n\n $service_requestsQuery->Where('companies.status','Active')\n ->Where('customers.status','Active')\n ->Where('products.status','Active')\n ->whereNull('companies.deleted_at')\n ->whereNull('customers.deleted_at')\n ->whereNull('products.deleted_at')\n // ->Where('service_centers.status','Active')\n ;\n \n if(auth()->user()->role_id == config('constants.SERVICE_ADMIN_ROLE_ID'))\n {\n $service_requestsQuery->Where('service_requests.service_center_id', auth()->user()->service_center_id);\n }\n else if(auth()->user()->role_id == config('constants.TECHNICIAN_ROLE_ID'))\n {\n $service_requestsQuery->Where('service_requests.technician_id', auth()->user()->id);\n }\n else if(auth()->user()->role_id == config('constants.COMPANY_ADMIN_ROLE_ID') || auth()->user()->role_id == config('constants.COMPANY_USER_ROLE_ID'))\n {\n $service_requestsQuery->Where('service_requests.company_id', auth()->user()->company_id);\n }\n\n // filter data from table\n if(!empty($request['company']))\n { \n $service_requestsQuery->Where('service_requests.company_id', $request['company']);\n }\n if(!empty($request['customer']))\n { \n $service_requestsQuery->Where('service_requests.customer_id', $request['customer']);\n }\n if(!empty($request['product']))\n { \n $service_requestsQuery->Where('service_requests.product_id', $request['product']);\n }\n if(!empty($request['serviceCenter']))\n { \n $service_requestsQuery->Where('service_requests.service_center_id', $request['serviceCenter']);\n }\n if(!empty($request['technician']))\n { \n $service_requestsQuery->Where('service_requests.technician_id', $request['technician']);\n }\n if(!empty($request['status']))\n { \n if($request['status'] == \"Re Opened\"){\n $service_requestsQuery->Where('service_requests.is_reopen', 1);\n }else{\n $service_requestsQuery->Where('service_requests.status', $request['status']);\n }\n \n }\n if(!empty($request['type']))\n { \n $service_requestsQuery->Where('service_requests.service_type', $request['type']);\n }\n\n //Search from table\n if(!empty($request['search']['value']))\n { \n $searchVal = $request['search']['value'];\n $service_requestsQuery->where(function ($query) use ($searchVal) {\n\n $RequestedId = trim($searchVal,'JW');\n $clearRequestId = ltrim($RequestedId, '0');\n\n // if(auth()->user()->role_id == config('constants.COMPANY_ADMIN_ROLE_ID') || auth()->user()->role_id == config('constants.COMPANY_USER_ROLE_ID'))\n // {\n // $query->orWhere('companies.name', 'like', '%' . $searchVal . '%');\n\n // }else if(auth()->user()->role_id == config('constants.SERVICE_ADMIN_ROLE_ID') || auth()->user()->role_id == config('constants.TECHNICIAN_ROLE_ID')){\n\n // $query->orWhere('service_centers.name', 'like', '%' . $searchVal . '%');\n\n // }\n if(auth()->user()->role_id == config('constants.SUPER_ADMIN_ROLE_ID') || auth()->user()->role_id == config('constants.ADMIN_ROLE_ID'))\n {\n\n $query->orWhere('companies.name', 'like', '%' . $searchVal . '%');\n $query->orWhere('service_centers.name', 'like', '%' . $searchVal . '%');\n }\n\n if(auth()->user()->role_id != config('constants.COMPANY_ADMIN_ROLE_ID') && auth()->user()->role_id != config('constants.COMPANY_USER_ROLE_ID')){\n $query->orWhere('service_requests.amount', 'like', '%' . $searchVal . '%');\n }\n\n $query->orWhere('customers.firstname', 'like', '%' . $searchVal . '%');\n $query->orWhere('customers.phone', 'like', '%' . $searchVal . '%');\n $query->orWhere('products.name', 'like', '%' . $searchVal . '%');\n // $query->orWhere('service_requests.amount', 'like', '%' . $searchVal . '%');\n $query->orWhere('service_requests.service_type', 'like', '%' . $searchVal . '%');\n $query->orWhere('service_requests.id', 'like', '%' . $clearRequestId . '%');\n $query->orWhere('service_requests.status', 'like', '%' . $searchVal . '%');\n\n });\n }\n\n return $service_requestsQuery->count('service_requests.id');\n }", "public function getCities(Request $request)\n {\n $response = array('valid' => 0, 'string' => 0);\n $id = $request->get('id');\n $cityId = $request->get('city')?$request->get('city'):null;\n if(!empty($id) && (int) $id > 0) {\n $cities = $this->service->getCitiesByState($id,$cityId);\n if($cities) {\n $optionString = '<option value=\"0\">Select City</option>';\n foreach($cities as $city) {\n if($city->id == $cityId) {\n $optionString .= '<option selected=\"selected\" value=\"'.$city->id.'\">'.ucfirst($city->name).'</option>';\n } else {\n $optionString .= '<option value=\"'.$city->id.'\">'.ucfirst($city->name).'</option>';\n }\n\n }\n\n $response['valid'] = 1;\n $response['string'] = $optionString;\n }\n }\n\n return Response::json($response);\n }", "public function dataCitiesAjax(Request $request)\n {\n\n $data = $data = DB::table('cities_dd')\n ->orderBy('cities_dd.id')\n ->select('cities_dd.id', 'cities_dd.name');\n // ->join('regions', 'cities_dd.region_id', '=', 'regions.id');\n if ($request->has('q')) {\n $search = $request->q;\n # Query City Name\n $data->where('cities_dd.name', 'LIKE', \"%$search%\")\n ->orderBy('cities_dd.name');\n }\n\n $data = $data->take(env('cities_dd_limit')) # Limit Search Record\n ->get()\n ->toArray();\n\n return response()->json($data);\n }", "public function getCustomerAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware_Components_CustomerInformationHandler $customerInformationHandler */\n $customerInformationHandler = Shopware()->CustomerInformationHandler();\n\n //Checks if the user used the live search or selected a customer from the drop down list\n if (isset($data['filter'][0]['value'])) {\n $result = $customerInformationHandler->getCustomerList($data['filter'][0]['value']);\n } else {\n $search = $this->Request()->get('searchParam');\n $result = $customerInformationHandler->getCustomer($search);\n }\n\n foreach ($result as $i => $customer) {\n $result[$i] = $this->extractCustomerData($customer);\n }\n\n $total = count($result);\n\n $this->view->assign(\n [\n 'data' => $result,\n 'total' => $total,\n 'success' => true\n ]\n );\n }", "public function index()\n {\n // only test\n //$country = Countries::all()->pluck('name.common','cca2');\n //$country = Countries::where('cca2',\"IT\")->pluck('name.common','cca2');\n \n /*$user = User::find(1);\n $user->city; \n\n return response()->json([\n 'userCIty' => $country\n ]); */\n }", "public function indexDataCust(){\n // $customer = DB::table('customer')->paginate(10);\n $customer = customer::paginate(10);\n $ec_subdistricts = ec_subdistricts::all();\n $ec_districts = ec_districts::all();\n $ec_cities = ec_cities::all();\n $ec_provinces = ec_provinces::all();\n //mengirim data ke view table\n return view('dataCustomer',\n compact('customer'),\n compact('ec_subdistricts'),\n compact('ec_districts'),\n compact('ec_cities'),\n compact('ec_provinces'));\n }", "public function getFilteredContactsCount(Request $request)\n {\n $user = $request->user();\n $tag = $request->input('tag');\n $conditions = $request->input('conditions');\n\n $contacts = $this->contactRepo->getContactCountsByCondition($user, $tag, $conditions);\n\n return response()->json($contacts);\n }", "public function showCities(Request $request)\n {\n $cities = City::where('department', $request->id)->get();\n return json_encode($cities);\n }", "public function getCustomers()\n {\n return \"hi\";\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 }", "public function getCompanyCount($filter){\n $regulatorToCompanyModel = new Model_Jiafuyun_RegulatorToCustomer();\n $count = $regulatorToCompanyModel->getCount($filter);\n return $count;\n }", "function getcarcounts(Request $request) {\n $this->validate($request, [\n 'car_array' => 'required',\n ]);\n\n $counts_array = [];\n\n foreach ($request->car_array as $car) {\n $trade_count = 0;\n if ($car['trade_type'] == 'carsale') {\n $trade_count = Carsaleoffer::where('carsale_id', $car['trade_id'])->count();\n } else if ($car['trade_type'] == 'carrent') {\n $trade_count = Carrentoffer::where('carrent_id', $car['trade_id'])->count();\n } else if ($car['trade_type'] == 'cartender') {\n $trade_count = Cartendertender::where('cartender_id', $car['trade_id'])->count();\n } else if ($car['trade_type'] == 'carauction') {\n $trade_count = Carauctionbid::where('carauction_id', $car['trade_id'])->count();\n }\n\n $comment_count = 0;\n $tail_count = 0;\n $comment_count = Carcomment::where('car_id', $car['car_id'])->count();\n $tail_count = Cartail::where('car_id', $car['car_id'])->count();\n\n $counts_array[] = array('comment_count'=>$comment_count, 'tail_count'=>$tail_count, 'trade_count'=>$trade_count);\n }\n\n return response()->json(['success'=>true, 'counts'=>$counts_array]);\n }", "public function index(Request $request)\n {\n $search = $request->search;\n $dataSorting = $request->sorting == 'false'?10:$request->sorting;\n \n $data =$search == 'false'?Customer::where('created_by_type',3)->paginate($dataSorting):Customer::where(function($query) use($search){\n $query->orWhere('name', 'LIKE', \"%{$search}%\");\n })->where('created_by_type',3)->paginate($dataSorting);\n\n $divisions = Division::all();\n $districts = District::all();\n $zones = Zone::where('status',1)->get();\n\n \n\n return CustomerResource::collection($data)->additional([\n 'divisions' => $divisions,\n 'districts' => $districts,\n 'zones' => $zones\n ]);\n\n }", "public function listsCountiesget()\r\n {\r\n $response = County::all();\r\n return response()->json($response, 200);\r\n }", "public function ajaxDailyCustomer(Request $request)\n {\n \t$id = $request->id;\n \t$customer = $this->FacturasQueries->getClientesID($id);\n \tforeach ($customer as $row) {\n \t\t$array = array('dui' => $row->DUI, 'nit' => $row->NIT, 'tel' => $row->Telefono);\n \t}\n if (empty($array)) \n {\n $array = array('vacio' => \"true\");\n return response()->json($array);\n }\n else{\n return response()->json($array);\n } \n }", "public function getTotalCustomers()\n {\n $AdminDashboardModel = $this->model('AdminDashboardModel');\n $this->totalCustomers = $AdminDashboardModel->getTotalCustomers();\n }", "public function index()\n { \n $cities = City::get();\n $items= array();\n foreach($cities as $city){\n \n $order = DB::table('districts')\n ->where('city_id',$city->id)\n ->join('orders', 'districts.id', '=', 'orders.district_id')\n ->count();\n // echo $city->id;\n $city['order']=$order;\n $city=json_decode($city);\n array_push($items, $city);\n }\n $items = array_filter($items);\n \n return view('pages/requestedCities',['items'=>$items]);\n }", "public function actionCustomer()\n {\n $searchModel = new ClinicSearch();\n $dataProvider = $searchModel->searchCustomerAffiliate(Yii::$app->request->queryParams);\n\n $page = isset($param['page']) ? $param['page'] : 0;\n $per_page = isset($param['per-page']) ? $param['per-page'] : 0;\n $totalCount = $dataProvider->getTotalCount();\n if ($page * $per_page > $totalCount) {\n return [];\n }\n $pageSize = $dataProvider->pagination->pageSize;\n $totalCount = $dataProvider->totalCount;\n $totalPage = (($totalCount + $pageSize - 1) / $pageSize);\n\n $aData = $dataProvider->getModels();\n $result = [];\n foreach ($aData as $model) {\n $result[] = $this->getCustomerDetail($model);\n }\n return [\n 'data' => $result,\n 'totalPage' => $totalPage,\n 'totalCount' => $totalCount,\n ];\n }", "public function index(Request $request)\n {\n\n\n $busType = $request->validate([\n 'type'=>\"required\"\n ]);\n $cities = [];\n\n\n $travelFrom = [];\n $vehicles = BusType::where('vehicle_type',$busType)->get();\n\n foreach ($vehicles as $vehicle)\n {\n $travel = Travel::where('busType_id',$vehicle->id)\n ->pluck('startCityId');\n\n\n\n array_push($travelFrom,$travel);\n\n\n }\n\n foreach ($travelFrom as $travel)\n {\n if($this->dataExists($cities ,City::find($travel))){\n\n }\n else{\n array_push($cities,City::find($travel));\n }\n\n //array_push($cities,City::find($travel));\n }\n\n return $cities;\n\n\n }", "public function getAllCustomer(){\n $customers = Customer::where('deleted',0)->get();\n $result = [\n \"status\" =>\n [\n \"code\" => 200,\n \"status\" => \"success\",\n \"message\" => \"getAllCustomer suceed\"\n ],\n \"result\" =>\n [\n \"data\" => $customers\n ]\n ];\n return response($result, 200);\n }", "public function getCategoryStores(Request $request){\n $language = ($request->header(\"X-Language\")) ?? 'en';\n\n $category = Category::find($request->category_id);\n if( !$category ){\n return $this->errorResponse(trans('messages.category.notfound'),null,404);\n }\n \n $city = City::find($request->city_id);\n\n if( !$city ){\n return $this->errorResponse('This City Not Found!',null,404);\n }\n // it is a client ask to search with city only or city and region\n if( !$request->region_id ){\n $city = City::with('stores')->where('id',$request->city_id)->first();\n $stores = $city->stores()->where('category_id',$request->category_id)\n ->where('discount', '!=' , '0')\n ->get();\n $stores = $this->toLang($language,$stores,false); \n return $this->dataResponse($stores,null,200);\n\n }\n\n $region = Region::where('id',$request->region_id)->where('city_id',$request->city_id)->first();\n if( !$region ){\n return $this->errorResponse(trans('messages.region.notfound'),null,404);\n }\n $branches = Branch::where('region_id',$request->region_id)->get();\n\n $storeResult = [];\n foreach( $branches as $key => $branch ){\n $stores = $branch->store()->where('category_id',$request->category_id)\n ->where('discount', '!=' , '0')\n ->get();\n $stores = $this->toLang($language,$stores,false);\n foreach ($stores as $singleStore) {\n $storeResult[$key] = $singleStore;\n\n }\n }\n // To ensure that no repeated stores and return these only values in array\n $uiquedStores = array_values(array_unique($storeResult));\n \n return $this->dataResponse($uiquedStores,null,200);\n }", "public function listAllCustomers();", "public function getUserList(Request $request){\n $status = 0;\n $message = \"\";\n try{\n\n if(!$this->verifyChecksum($request)){\n return response()->json([\"status\"=>0,\n \"message\"=>'checksum not verified',\n \"data\"=>json_decode('{}')]);\n }\n\n\n $cond[] = ['status','1'];\n if($request->role_id > 1){\n $cond[] = ['role_id',$request->role_id];\n }\n\n $cityObj = new City();\n $returnData = $cityObj->getCountryStateCityByName($request);\n if($returnData['error']==0 && $returnData['success']==1){\n $country_id = $returnData['data']['country_id'];\n $state_id = $returnData['data']['state_id'];\n $city_id = $returnData['data']['city_id'];\n }else{\n return response()->json(['status'=>$status,'message'=>$returnData['message'],'data'=>[]]);\n }\n\n if($request->city != \"\"){\n $cond[] = ['city_id',$city_id];\n }\n if($request->state !=\"\"){\n $cond[] = ['state_id',$state_id];\n }\n if($request->country !=\"\"){\n $cond[] = ['country_id',$country_id];\n }\n // print_r($cond); die;\n //$cond = ($request->role_id > 1 ) ? ['role_id',$request->role_id] : ['role_id','<>',1];\n //$users = User::where($cond)->paginate(Config::get('app.record_per_page'));\n\n $users = User::where($cond)->orderBy('name','asc')->paginate(Config::get('app.record_per_page'));\n if($users->count()==0){\n $users = User::where('role_id',$request->role_id)->count();\n return response()->json(['status'=>1,\n 'message'=>'No record found',\n 'data'=>[],\n 'count'=>$users\n ]);\n }else{\n foreach($users as $k=>$v){\n $users[$k]['country_name'] = $v->Country->name;\n $users[$k]['state_name'] = $v->State->name;\n $users[$k]['city_name'] = $v->City->name;\n unset($v->City);\n unset($v->Country);\n unset($v->State);\n //echo $v->Country->name; die;\n }\n }\n\n //print_r($users); die;\n //$users->total() //$users->lastPage() //perPage() //currentPage() //\n //echo '<pre>';print_r($users->items()); die;\n return response()->json(['status'=>1,\n 'message'=>$message,\n 'total_record'=>$users->total(),\n 'last_page'=>$users->lastPage(),\n 'current_page'=>$users->currentPage(),\n 'data'=>$users->items()\n ]);\n }catch(Exception $e){\n $message = \"Technical error\";\n return response()->json(['status'=>$status,'message'=>$message,'data'=>json_decode(\"{}\")]);\n }\n\n }", "public function getcity(Request $request){\n\t\t$stateid = $request->input('stateid');\n\t\t$arrCitydata = City::where('state_id','=',$stateid)->get();\n\t\t$citydata = array();\n\t\t$i = 0;\n\t\tforeach($arrCitydata as $city)\n\t\t{\n\t\t\t$citydata[$i]['id'] = $city['city_id']; \n\t\t\t$citydata[$i]['name'] = $city['city_name'];\n\t\t\t$i++;\n\t\t}\n\t\treturn response()->json($citydata);\n\t\texit();\n }", "public function getBuyerCity($query) \n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']); \n\n DB::enableQueryLog();\n // execute\n $city = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orders','orderlines.order_id','orders.id')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('orders.buyer_city as name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy('orders.buyer_city')\n ->orderByRaw('count desc')\n ->limit(5)\n ->get();\n\n $data = array();\n $data['city'] = $city;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function index()\n { $arr=array();\n $point=customer_point::where('id_business',Auth::user()->id_business)->get();\n foreach($point as $k=>$v)\n {\n $arr[]=[\"point\"=>(int)$v->customer_point,\n \"id\"=>$v->id,\n \"customer_level\"=>$v->customer_level,\n \"total_customer\"=>0,\n \"customer_discount\"=>$v->customer_discount,\n \"customer_description\"=>$v->customer_description\n ];\n }\n sort($arr);\n $cus=customer_customer::where('id_business',Auth::user()->id_business)->get();\n foreach($cus as $k=>$v)\n {\n $i=0;\n foreach($arr as $j=>$p)\n {\n if($v->customer_point>$p['point'])\n $i=$i+1;\n\n }\n if($i!=0)\n {\n $arr[$i-1]['total_customer']+=1;\n }\n }\n\n return response()->json($arr);\n }", "public function getCity() {}", "public function awsCustomerCSV(Request $request)\n { \n return response()->json( ApiController::readcsv($request, new AwsCustomerList(), 'aws_customer') );\n\n }", "public function getCity()\n {\n $cities = City::where('province_id', request()->province_id)->get();\n //KEMBALIKAN DATANYA DALAM BENTUK JSON\n return response()->json(['status' => 'success', 'data' => $cities]);\n }", "public function citywithstatecountry(Request $request) \n {\n $input = $request->all();\n //define for get only this countries city 101 = india\n $country_ids= ['230','105','101'];\n $cities = City::with('state.country')\n ->where('name','Like','%'.$input['term']['term'].'%')\n ->whereHas('state.country', function($query) use ($country_ids){\n $query->whereIn('id',$country_ids);\n })\n ->get()->toArray();\n return \\Response::json($cities);\n\n }", "public function countWorkdays(Request $request)\n { \n /*\n * put weil Daten übertragen werden\n * In http/Middelware/VerifyCsrfToken.php ist Tokenprüfung für\n * diese Fruppe ausgeschaltet\n * \n */ \n $dt = new DateTools;\n $count = $dt->WorkDays($request->from, $request->to);\n //$count = $dt->WorkDays($from, $to);\n $arr = array('workdays' => $count, 'user' => 'tra');\n return json_encode($arr);\n }", "public function getCityWiseBusiness()\n\t{\n\t\t$start=0;\n\t\t$limit=20;\n\t\t\n\t\t$city_id=$_REQUEST['city_id'];\n\t\t$fromdate=$_REQUEST['fromdate'];\n\t\t$todate=$_REQUEST['todate'];\n\t\t\t\n\t\t$topClickedBusinesses = Business::where('approved_by_admin','1')->where('status','Active');\n\t\t\n\t\tif(!empty($city_id))\n\t\t{\n\t\t\t$topClickedBusinesses = $topClickedBusinesses->where('city',$city_id);\n\t\t}\n\t\tif(!empty($fromdate))\n\t\t{\n\t\t\t$topClickedBusinesses = $topClickedBusinesses->where('created_at','>=',$fromdate.' 00:00:00');\n\t\t}\n\t\tif(!empty($todate))\n\t\t{\n\t\t\t$topClickedBusinesses = $topClickedBusinesses->where('created_at','<=',$todate.' 23:59:59');\n\t\t}\n\t\t$topClickedBusinesses = $topClickedBusinesses->orderby('top_clicked', 'DESC')->limit($limit)->offset($start)->get();\n\t\t\n\t\t$jsonDAta = [];\n\t\t$colorCode=['#b87333','#8000ff','#ffff00','#e5e4e2','#ff8000','#ff00ff','#b87333','silver','#bf00ff','#40ff00','#b87333','#ff4000','#ffbf00','#00bfff','#ff00bf','#4000ff','#e5e4e2','#ff00ff','#8000ff','#e5e4e2'];\n\t\t$jsonDAtaBusiness=[];\n\t\t$i=0;\n\t\tforeach($topClickedBusinesses as $value)\n\t\t{\n\t\t\t\n\t\t\t$businessName=$value['business_name'];\n\t\t\tif(empty($value['top_clicked']))\n\t\t\t{\n\t\t\t\t$noOfClick=0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$noOfClick=$value['top_clicked'];\n\t\t\t}\n\t\t\t$jsonDAtaBusiness[]=[$businessName,$noOfClick,$colorCode[$i]];\n\t\t\t$i++;\n\t\t}\n\t\t$response['rec'] = $jsonDAtaBusiness;\n\t\techo json_encode($response);\n\t\texit;\n\t}", "function vcn_get_career_count() {\t\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry(), 'ignoreworktype' => 'Y'), 'json');\r\n\treturn count($data);\r\n}", "public function getCustomerData(){\n\n\t\t$customerDataSQL = \"select * FROM\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tSELECT *,\n\t\t\t\t\t\t\t(SELECT COUNT(gds_order_id) FROM gds_orders AS gord WHERE gord.cust_le_id=l.legal_entity_id) AS 'TotalOrder'\n\t\t\t\t\t\t\tFROM legal_entities AS l\n\t\t\t\t\t\t\tWHERE legal_entity_type_id LIKE '30%' AND is_posted=0\n\t\t\t\t\t\t) AS innertbl WHERE TotalOrder>0\";\n\n\t\t$customerData = DB::select(DB::raw($customerDataSQL));\n\n\t\t/*$customerData = DB::table('legal_entities_live')\n\t\t\t\t\t->where(\"legal_entity_type_id\",\"like\",\"30%\")\n\t\t\t\t\t->where('is_posted', '=', '0')\n\t\t\t\t\t->get();*/\n\t\t\t\t\t\n\t\treturn $customerData;\n\n\t}", "public function getCity();", "public function get_merchant_shop_count($name = \"\", $city = \"\", $uid=\"\")\n {\n\n $contitions = \"merchant_id = $uid\";\n if($_GET){\n if($city){\n\t\t\t\t\t\t\t\n\t\t\t\t$contitions .= ' and city_id = '.$city;\n }\n\n if($name){\n\t\t\t\t$contitions .= ' and store_name like \"%'.mysql_real_escape_string($name).'%\"';\n }\n $result = $this->db->query(\"select stores.store_id from stores where $contitions ORDER BY stores.store_id\");\n count($result);\n }\n else{\n $result = $this->db->select(\"stores.store_id\")->from(\"stores\")\n ->where(array(\"merchant_id\" => $uid))\n ->orderby(\"stores.store_id\", \"ASC\")\n //->limit($record, $offset)\n ->get();\n }\n \n return count($result);\n }", "public function getCustomerTest(){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Exactonline_model');\n $this->load->model('Projects_model');\n $this->load->model('Shopify_exact_model');\n $this->load->library('Shopify_restapi');\n \n $projectId = 38;\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n\n $offset = $this->Projects_model->getValue('exactonline_customers_offset', $projectId) ? $this->Projects_model->getValue('exactonline_customers_offset', $projectId) : NULL;\n $amount = $this->Projects_model->getValue('customers_amount', $projectId) ? $this->Projects_model->getValue('customers_amount', $projectId) : 1000;\n $customerId = isset($_GET['customerId'])?$_GET['customerId']:'';\n\n $connection = $this->Exactonline_model->makeConnection($projectId);\n /*echo \"<pre>\";\n print_r($connection);\n exit();*/\n if ($connection) {\n $customers = $this->Shopify_exact_model->getExactCustomersTest($connection, $customerId, NULL, $amount);\n echo \"<pre>\";\n print_r($customers);\n exit();\n }\n }", "public function listallAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n\t\n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n $entities = $em->getRepository('NvCargaBundle:Customer')->findBy(['maincompany'=>$maincompany,'active'=>true]);\n \n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n foreach ($entity->getBaddress() as $dir ) {\n $city = $dir->getCity();\n if ($city) { \n $result[$counter]['name'] = $dir->getName();\n $result[$counter]['lastname'] = $dir->getLastname();\n if ($dir->getCustomer()->getPobox()) {\n $result[$counter]['pobox'] = $dir->getCustomer()->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $dir->getCustomer()->getEmail();\n\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n }\n// foreach ($entities as $entity) {\n// $result[$counter]['customerid'] = $entity->getId();\n// $result[$counter]['name'] = $entity->getName();\n// $result[$counter]['lastname'] = $entity->getLastname();\n// if ($entity->getPobox()) {\n// $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n// } else {\n// $result[$counter]['pobox'] = '';\n// }\n// $result[$counter]['email'] = $entity->getEmail();\n// \n// $result[$counter]['docid'] = $entity->getAdrdefault()->getDocid();\n// $result[$counter]['address'] = $entity->getAdrdefault()->getAddress();\n// $city = $entity->getAdrdefault()->getCity();\n// $result[$counter]['cityid'] = $city->getId();\n// $result[$counter]['cityname'] = $city->getName();\n// $result[$counter]['state'] = $city->getState()->getName();\n// $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n// $result[$counter]['phone'] = $entity->getAdrdefault()->getPhone();\n// $result[$counter]['mobile'] = $entity->getAdrdefault()->getMobile();\n// \n// $result[$counter]['barrio'] = $entity->getAdrdefault()->getBarrio();\n// $result[$counter]['zip'] = $entity->getAdrdefault()->getZip();\n// $result[$counter]['type'] = $entity->getType()->getName();\n// $counter++;\n// }\n return new JsonResponse($result); \n }", "public function index()\n {\n $customerName = Input::get('customerName'); // Input or \\Request\n $category = \\Request::get('category');\n $id = \\Request::get('id');\n $customerAddress = \\Request::get('customerAddress');\n $updated_at = \\Request::get('updated_at');\n $loan = \\Request::get('loan');\n $q = Input::get('q');\n if ($customerName) {\n $customers = Customer::where('customer_name', $customerName)->orWhere('customer_name', 'like', '%' . $customerName . '%')->orderBy('id', 'desc')->paginate(10);\n $pagination = $customers->appends(['customerName' => $customerName]);\n } elseif ($category) {\n $customers = Customer::where('category', 'like', '%' . $category . '%')->orderBy('id', 'desc')->paginate(10);\n $pagination = $customers->appends(['category' => $category]);\n } elseif ($id) {\n $customers = Customer::where('id', $id)->paginate(10);\n } elseif ($customerAddress) {\n $customers = Customer::where('customer_address', 'like', '%' . $customerAddress . '%')->orderBy('id', 'desc')->paginate(10);\n $pagination = $customers->appends(['customerAddress' => $customerAddress]);\n } elseif ($updated_at) {\n $customers = Customer::where('updated_at', 'like', '%' . $updated_at . '%')->orderBy('id', 'desc')->paginate(10);\n $pagination = $customers->appends(['updated_at' => $updated_at]);\n } elseif ($loan) {\n $customers = Customer::where('loan', 'like', '%' . $loan . '%')->orderBy('id', 'desc')->paginate(10);\n $pagination = $customers->appends(['loan' => $loan]);\n } elseif ($q) {\n $customers = Customer::where('category', 'like', '%' . $q . '%')\n ->orWhere('customer_name', 'like', '%' . $q . '%')\n ->orderBy('id', 'desc')->paginate(10);\n $pagination = $customers->appends(['q' => $q]);\n } else {\n $customers = Customer::orderBy('id', 'desc')->paginate(10);\n }\n\n return view('admin.customer.list', compact('customers'));\n }", "private function getShopifyCustomers()\n {\n $endpoint = 'customers.json';\n $shop_url = env('SHOP_URL');\n $headers = [\n 'Content-Type' => 'application/json',\n ];\n\n $client = new Client(['headers' => $headers]);\n\n try {\n $api_response = $client->request('GET', $shop_url . $endpoint);\n } catch (GuzzleException $e) {\n throw new \\Exception($e->getMessage());\n }\n\n return json_decode($api_response->getBody()->getContents(), true)['customers'];\n }", "public function getOrdersByCustomer(Request $request) {\n\n // Data Validation\n $rules = ['customerNumber' => 'required|integer|gte:0'];\n\n $validator = Validator::make($request->all(),$rules);\n\n if($validator->fails()) {\n\n return response()->json([\n 'message' => $validator->messages()\n ]);\n }\n\n if(count($this->orders->getOrdersByCustomer($request->customerNumber)) == 0) {\n\n return response()->json([\n 'message' => 'No orders found for this customer'\n ]);\n }\n\n // Groups the customers of an order\n $ordersGrouped = $this->groupedOrdersCustomer($this->orders->getOrdersByCustomer($request->customerNumber));\n $orders = array();\n\n foreach ($ordersGrouped as $customer => $detailOrder) {\n\n $ordersCustomer = array();\n\n foreach ($detailOrder as $orderNumber => $items) {\n $itemsOrder = array();\n\n foreach ($items as $index => $data) {\n $itemsOrder[] = $data;\n }\n\n $ordersCustomer[] = array('orderNumber' => $orderNumber,\n 'items' => $itemsOrder);\n }\n\n $orders[] = array('customerName' => $customer,\n 'orders' => $ordersCustomer);\n }\n\n return response()->json($orders);\n\n }", "public function customerBranches(Request $request)\n {\n $debtor_no = $request['debtor_no'];\n $data['status_no'] = 0;\n $branchs = '';\n $result = DB::table('cust_branch')->select('customer_id', 'id', 'br_name')->where('customer_id', $debtor_no)->orderBy('br_name', 'ASC')->get();\n if (!empty($result)) {\n $data['status_no'] = 1;\n foreach ($result as $key => $value) {\n $branchs .= \"<option value='\" . $value->id . \"'>\" . $value->br_name . \"</option>\";\n }\n $data['branchs'] = $branchs;\n }\n return json_encode($data);\n }", "protected function totalCustomers() {\n return $this->customer->count();\n }", "public function customers()\n {\n $data['ratings']=Rating::where('review_type', 10)->where('customer_id', Auth::user()->id)->get();\n return view('review.customers',$data);\n }", "public function index(Request $request)\n {\n $children = arrIntersect($this->geographicChildren, $request->get('include'));\n $data = City::with($children)->paginate($request->get('per_page'));\n\n return ResourcesCity::collection($data);\n }", "public function getCustomersProperty()\n {\n return Customer::search($this->search)->paginate(50);\n }", "public function counties()\n {\n $name = County::get();\n return view('counties')->with('counties', $name);\n }", "public function visits()\n\t{\n\n\t\t$validator = Validator::make(\t\t\t\n\t\t array(\n\t\t \t'user_id' => Input::get('user_id'),\n\t\t ),\n\t\t array(\t\n\t\t \t'user_id' => 'integer'\n\t\t )\n\t\t);\n\n\t try{\n\n\t \t// setting the default response and status code\n\t $response = [\n\t 'cities' => []\n\t ];\n\t $statusCode = 200;\n\n\t // handling invalid input values\n\t \tif ($validator->fails())\n\t\t\t{\n\t\t\t\t$e = $validator->messages();\n\t\t\t\tthrow new Exception($e);\n\t\t\t}\n\n\t\t\t// get the input values\n\t \t\t$user_id = Input::get('user_id');\n\n\t \t\t// used in auth.basic filter. grants access only to the authorized users\n\t\t\tif( !Auth::user() )\n\t\t\t{\t\t\n\t\t\t\t$e = 'User not authorized';\n\t\t\t\t//throw new Exception($e);\n\t\t\t}\n\t \n\t if ( !empty($user_id) )\n\t {\n\t\t \n\t\t // if no city name and radius are given, search by state\n\t\t $cities = UserCity::where('user_id', $user_id)->get();\n\n\t\t\t\t// -- if cities matching the request found --\n\t\t \tif($cities) {\t \n\t\t \tforeach ($cities as $key => $city) \n\t\t \t{\n\t\t \t\t// -- get city object in expected format --\n\t \t \t\t$response['cities'][] = $city->getCityForAPI();\n\t \t \t} \t\n\t\t\t $response['message'] = \"All OK\";\n\t\t }\n\t\t }\n\n\n\t \n\t } catch (Exception $e) {\n\t $statusCode = 404;\n\t } finally {\n\t // return Response::json($response, $statusCode);\n\t \treturn Response::json($response, $statusCode, array(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n\t }\n\t \n\t}", "public function citysearch(Request $request)\n {\n $data = Cities::where(\"name\",\"LIKE\",\"%{$request->input('query')}%\")->get();\n return response()->json($data);\n }", "public function get_city(){\n \n $this->db->order_by('city', 'asc'); \n $result = $this->db->get('shiprate')->result();\n \n foreach($result as $res){\n $output[] = array (\"city_id\" => $res->cityid, \"city\" => $res->city);\n }\n $response['content'] = $output;\n $this->output\n ->set_status_header(200)\n ->set_content_type('application/json', 'utf-8')\n ->set_output(json_encode($response,128))\n ->_display();\n exit; \n }", "public function index()\n {\n return CityApi::collection($this->city->paginate());\n }", "public function index(Request $request)\n {\n $cities = $this->cityRepository->all(\n $request->except(['skip', 'limit']),\n $request->get('skip'),\n $request->get('limit')\n );\n\n return $this->sendResponse($cities->toArray(), 'Cities retrieved successfully');\n }", "public function getCityAction(Request $request)\n {\n\n if($request->get('zipcode')!==null && $request->get('zipcode')!=='' && Tools::zipValidation($request->get('zipcode'),\"DE\")===false) return new View(\"zipcode: \".$request->get('zipcode').\" it's not a German valid zipcode\" , Response::HTTP_NOT_ACCEPTABLE);\n\n $em = $this->getDoctrine()->getManager();\n\n $qb = $em->createQueryBuilder();\n\n $qb->select('c')->from('MyHammerJobsBundle:City', 'c')\n ->leftJoin('c.country', 'ct')\n ->where('ct.isocode = :isocode')\n ->setParameter('isocode', $this->getParameter('isocode'));\n\n\n if($request->get('zipcode')!==null && $request->get('zipcode')!=='') $qb->andWhere('c.zipcode = :zipcode')->setParameter('zipcode', $request->get('zipcode'));\n\n $result = $qb->getQuery()->getResult();\n\n if ($result === null) return new View(\"No city are registrered\", Response::HTTP_NOT_FOUND);\n\n return $result;\n }", "public function getCustomerReviews(Request $request)\n {\n return view('front.customer_reviews');\n }", "public function all_customers() {\n\t\tif($this->input->is_ajax_request()) {\n\t\t\techo json_encode($this->customers->get_all());\n\t\t} else {\n\t\t\tredirect('cms/customers', 'refresh');\n\t\t}\n\t}", "public function me()\n {\n $id = auth()->id();\n $shop=Shop::with(['city','province'])->find($id);\n $club_count = SubCode::where('shop_id',$id)->where('customer_id','!=',null )->distinct('customer_id')->count();\n return response()->json($shop);\n }", "public function listcustomerAction(Request $request)\n {\n /*\n if (!$request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n */\n \n $pattern = $request->query->get('pattern');\n $pattern = preg_replace('/\\s+/', ' ', $pattern);\n $pos = strpos($pattern, ' ');\n if ($pos === false) {\n $pattern2 = null;\n $pattern1 = $pattern;\n } else {\n $pattern1 = substr($pattern, 0, $pos-1); \n $pattern2 = substr($pattern, $pos+1); \n }\n \n $typecus = $request->query->get('typecus');\n \n $em = $this->getDoctrine()->getManager();\n $maincompany = $this->getUser()->getMaincompany();\n $shareagencies = $em->getRepository('NvCargaBundle:Agency')->findBy(['maincompany'=>$maincompany, 'sharecustomer'=>true]);\n $shareagencies[] = $this->getUser()->getAgency();\n \n if ($this->getUser()->getAgency()->getType() != 'MASTER') {\n $agencies = $shareagencies;\n } else {\n $agencies = $em->getRepository('NvCargaBundle:Agency')->findByMaincompany($maincompany);\n }\n $result=array();\n $counter = 0;\n if (!$pattern2) {\n $statuspobox = $em->getRepository('NvCargaBundle:Poboxstatus')->findOneByName('ACTIVO');\n $poboxs = $em->getRepository('NvCargaBundle:Pobox')->createQueryBuilder('p')\n ->where('p.number LIKE :number' )\n ->andWhere('p.maincompany = :maincompany')\n ->andWhere('p.status = :status')\n ->setParameters(['number'=>'%'. $pattern. '%','maincompany'=>$maincompany, 'status'=>$statuspobox])\n ->getQuery()\n ->getResult();\n switch ($typecus) {\n case 1:\n $entities = $em->getRepository('NvCargaBundle:Customer')->createQueryBuilder('o')\n ->where('o.name LIKE :name OR o.lastname LIKE :lastname OR o.pobox IN (:poboxs)' )\n //->setParameter('name', '%'.$name.'%')\n ->andWhere('o.agency IN (:agencies)')\n ->andWhere('o.active = :active')\n ->setParameters(['name'=>$pattern.'%','lastname'=>$pattern.'%', 'poboxs'=>$poboxs, 'agencies'=>$agencies, 'active'=>true])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n \n foreach ($entities as $entity) {\n if ($entity->getAdrdefault()) {\n $dir = $entity->getAdrdefault();\n $city = $dir->getCity();\n if ($city) {\n $result[$counter]['name'] = $entity->getName();\n $result[$counter]['lastname'] = $entity->getLastname();\n if ($entity->getPobox()) {\n $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $entity->getEmail();\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n } else {\n $result[$counter]['name'] = $entity->getName();\n $result[$counter]['lastname'] = $entity->getLastname();\n if ($entity->getPobox()) {\n $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $entity->getEmail();\n $result[$counter]['docid'] = '';\n $result[$counter]['address'] = '';\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = 0;\n $result[$counter]['cityname'] = '';\n $result[$counter]['state'] = '';\n $result[$counter]['country'] = ''; \n $result[$counter]['phone'] = '';\n $result[$counter]['mobile'] = '';\n \n $result[$counter]['barrio'] = '';\n $result[$counter]['zip'] = '';\n if ($entity->getType()) {\n $result[$counter]['type'] = $entity->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n break;\n case 2: \n if ($poboxs) {\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($poboxs));\n $customers = $em->getRepository('NvCargaBundle:Customer')->createQueryBuilder('o')\n ->where('o.pobox IN (:poboxs)' )\n //->setParameter('name', '%'.$name.'%')\n ->andWhere('o.agency IN (:agencies)')\n ->andWhere('o.active = :active')\n ->setParameters(['poboxs'=>$poboxs, 'agencies'=>$agencies,'active'=>true])\n ->getQuery()\n ->getResult();\n \n $entities = $em->getRepository('NvCargaBundle:Baddress')->createQueryBuilder('o')\n ->where('o.name LIKE :name OR o.lastname LIKE :lastname OR o.customer IN (:customers)' )\n ->setParameters(['name'=>$pattern.'%','lastname'=>$pattern.'%', 'customers'=>$customers])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n } else {\n //$customers = $em->getRepository('NvCargaBundle:Customer')->findBy(['agency'=>$agencies]);\n $customers = $em->getRepository('NvCargaBundle:Customer')->createQueryBuilder('o')\n ->where('o.agency IN (:agencies)')\n ->andWhere('o.active = :active')\n ->setParameters(['agencies'=>$agencies,'active'=>true])\n ->getQuery()\n ->getResult();\n \n $entities = $em->getRepository('NvCargaBundle:Baddress')->createQueryBuilder('o')\n ->where('o.name LIKE :name OR o.lastname LIKE :lastname' )\n ->andWhere('o.customer IN (:customers)')\n ->setParameters(['name'=>$pattern.'%','lastname'=>$pattern.'%', 'customers'=>$customers])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n }\n $diradd = array();\n \n foreach ($entities as $dir) {\n $city = $dir->getCity();\n if ($city) { \n $result[$counter]['name'] = $dir->getName();\n $result[$counter]['lastname'] = $dir->getLastname();\n $thisdir= $dir->getName() . $dir->getLastname();\n if ($dir->getCustomer()->getPobox()) {\n $result[$counter]['pobox'] = $dir->getCustomer()->getPobox()->getNumber();\n $thisdir = $thisdir . $dir->getCustomer()->getPobox()->getNumber();\n \n } else {\n $result[$counter]['pobox'] = '';\n }\n $diradd[] = $thisdir;\n $result[$counter]['email'] = $dir->getCustomer()->getEmail();\n\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $dir->getId();\n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++; \n }\n }\n $customers = $em->getRepository('NvCargaBundle:Customer')->createQueryBuilder('o')\n ->where('o.name LIKE :name OR o.lastname LIKE :lastname OR o.pobox IN (:poboxs)' )\n ->andWhere('o.agency IN (:agencies)')\n ->andWhere('o.active = :active')\n ->setParameters(['name'=>$pattern.'%','lastname'=>$pattern.'%', 'poboxs'=>$poboxs, 'agencies'=>$agencies, 'active'=>true])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n \n foreach ($customers as $entity) {\n if ($entity->getPobox()) {\n $thisdir = $entity->getName() . $entity->getLastname() . $entity->getPobox()->getNumber();\n if (!in_array($thisdir,$diradd)) {\n $result[$counter]['name'] = $entity->getName();\n $result[$counter]['lastname'] = $entity->getLastname();\n $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n $result[$counter]['email'] = $entity->getEmail();\n $result[$counter]['docid'] = '';\n $result[$counter]['address'] = '';\n $result[$counter]['customerid'] = 0;\n \n $result[$counter]['cityid'] = 0;\n $result[$counter]['cityname'] = '';\n $result[$counter]['state'] = '';\n $result[$counter]['country'] = ''; \n $result[$counter]['phone'] = '';\n $result[$counter]['mobile'] = '';\n \n $result[$counter]['barrio'] = $entity->getId();\n $result[$counter]['zip'] = '';\n if ($entity->getType()) {\n $result[$counter]['type'] = $entity->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n }\n break;\n case 3:\n $customer = $em->getRepository('NvCargaBundle:Customer')->find($pattern);\n if ($customer) {\n foreach ($customer->getBaddress() as $dir) {\n $city = $dir->getCity();\n if ($city) { \n $result[$counter]['name'] = $dir->getName();\n $result[$counter]['lastname'] = $dir->getLastname();\n if ($dir->getCustomer()->getPobox()) {\n $result[$counter]['pobox'] = $dir->getCustomer()->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $dir->getCustomer()->getEmail();\n\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $dir->getId();\n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n }\n break;\n }\n } else {\n switch ($typecus) {\n case 1:\n $entities = $em->getRepository('NvCargaBundle:Customer')->createQueryBuilder('o')\n ->where('o.name LIKE :name' )\n ->andWhere('o.lastname LIKE :lastname')\n ->andWhere('o.agency IN (:agencies)')\n ->andWhere('o.active = :active')\n ->setParameters(['name'=>$pattern1.'%','lastname'=>$pattern2.'%', 'agencies'=>$agencies, 'active'=>true])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n foreach ($entities as $entity) {\n if ($entity->getAdrdefault()) {\n $dir = $entity->getAdrdefault();\n $city = $dir->getCity();\n if ($city) {\n $result[$counter]['name'] = $entity->getName();\n $result[$counter]['lastname'] = $entity->getLastname();\n if ($entity->getPobox()) {\n $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $entity->getEmail();\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n } else {\n $result[$counter]['name'] = $entity->getName();\n $result[$counter]['lastname'] = $entity->getLastname();\n if ($entity->getPobox()) {\n $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n } else {\n $result[$counter]['pobox'] = '';\n }\n $result[$counter]['email'] = $entity->getEmail();\n $result[$counter]['docid'] = '';\n $result[$counter]['address'] = '';\n $result[$counter]['customerid'] = $entity->getId();\n \n $result[$counter]['cityid'] = 0;\n $result[$counter]['cityname'] = '';\n $result[$counter]['state'] = '';\n $result[$counter]['country'] = ''; \n $result[$counter]['phone'] = '';\n $result[$counter]['mobile'] = '';\n \n $result[$counter]['barrio'] = '';\n $result[$counter]['zip'] = '';\n if ($entity->getType()) {\n $result[$counter]['type'] = $entity->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n break;\n case 2: \n $customers = $em->getRepository('NvCargaBundle:Customer')->createQueryBuilder('o')\n ->where('o.agency IN (:agencies)')\n ->andWhere('o.active = :active')\n ->setParameters(['agencies'=>$agencies,'active'=>true])\n ->getQuery()\n ->getResult();\n \n $entities = $em->getRepository('NvCargaBundle:Baddress')->createQueryBuilder('o')\n ->where('o.name LIKE :name')\n ->andWhere('o.lastname LIKE :lastname' )\n ->andWhere('o.customer IN (:customers)')\n ->setParameters(['name'=>$pattern1.'%','lastname'=>$pattern2.'%', 'customers'=>$customers])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n \n $diradd = array();\n \n foreach ($entities as $dir) {\n $city = $dir->getCity();\n if ($city) { \n $result[$counter]['name'] = $dir->getName();\n $result[$counter]['lastname'] = $dir->getLastname();\n $thisdir= $dir->getName() . $dir->getLastname();\n if ($dir->getCustomer()->getPobox()) {\n $result[$counter]['pobox'] = $dir->getCustomer()->getPobox()->getNumber();\n $thisdir = $thisdir . $dir->getCustomer()->getPobox()->getNumber();\n \n } else {\n $result[$counter]['pobox'] = '';\n }\n $diradd[] = $thisdir;\n $result[$counter]['email'] = $dir->getCustomer()->getEmail();\n\n $result[$counter]['docid'] = $dir->getDocid();\n $result[$counter]['address'] = $dir->getAddress();\n $result[$counter]['customerid'] = $dir->getId();\n $result[$counter]['cityid'] = $city->getId();\n $result[$counter]['cityname'] = $city->getName();\n $result[$counter]['state'] = $city->getState()->getName();\n $result[$counter]['country'] = $city->getState()->getCountry()->getName();\n $result[$counter]['phone'] = $dir->getPhone();\n $result[$counter]['mobile'] = $dir->getMobile();\n \n $result[$counter]['barrio'] = $dir->getBarrio();\n $result[$counter]['zip'] = $dir->getZip();\n if ($dir->getCustomer()->getType()) {\n $result[$counter]['type'] = $dir->getCustomer()->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++; \n }\n }\n $customers = $em->getRepository('NvCargaBundle:Customer')->createQueryBuilder('o')\n ->where('o.name LIKE :name')\n ->andWhere('o.lastname LIKE :lastname')\n ->andWhere('o.agency IN (:agencies)')\n ->andWhere('o.active = :active')\n ->setParameters(['name'=>$pattern1.'%','lastname'=>$pattern2.'%', 'agencies'=>$agencies, 'active'=>true])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n \n foreach ($customers as $entity) {\n if ($entity->getPobox()) {\n $thisdir = $entity->getName() . $entity->getLastname() . $entity->getPobox()->getNumber();\n if (!in_array($thisdir,$diradd)) {\n $result[$counter]['name'] = $entity->getName();\n $result[$counter]['lastname'] = $entity->getLastname();\n $result[$counter]['pobox'] = $entity->getPobox()->getNumber();\n $result[$counter]['email'] = $entity->getEmail();\n $result[$counter]['docid'] = '';\n $result[$counter]['address'] = '';\n $result[$counter]['customerid'] = 0;\n \n $result[$counter]['cityid'] = 0;\n $result[$counter]['cityname'] = '';\n $result[$counter]['state'] = '';\n $result[$counter]['country'] = ''; \n $result[$counter]['phone'] = '';\n $result[$counter]['mobile'] = '';\n \n $result[$counter]['barrio'] = $entity->getId();\n $result[$counter]['zip'] = '';\n if ($entity->getType()) {\n $result[$counter]['type'] = $entity->getType()->getName();\n } else {\n $result[$counter]['type'] = 'Persona';\n }\n $counter++;\n }\n }\n }\n break;\n }\n }\n return new JsonResponse($result); \n }", "public function index(Request $request)\n {\n $items = Customer::latest()->paginate(5);\n\n foreach ($items as $key => $value) {\n $customer_data[$key] = $value;\n $customer_data[$key]['vendor_name'] = getVendorName($this->vendor_name,$value->vendor_id);\n //$items->vendor_name = 'aasa';\n }\n $response = [\n 'pagination' => [\n 'total' => $items->total(),\n 'per_page' => $items->perPage(),\n 'current_page' => $items->currentPage(),\n 'last_page' => $items->lastPage(),\n 'from' => $items->firstItem(),\n 'to' => $items->lastItem()\n ],\n 'data' => $customer_data\n ];\n\n return response()->json($response);\n }", "public function GetCustomers() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM customers\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function ajaxCustomerSearch(Request $request)\n {\n// $term = $request->has('term') ? $request->input('term') : null ;\n// $query = $request->has('query') ? $request->input('query') : $term;\n\n// if ( $query )\n\n if ($request->has('customer_id'))\n {\n $search = $request->customer_id;\n\n $customers = Customer::\n // select('id', 'name_fiscal', 'name_commercial', 'identification', 'sales_equalization', 'payment_method_id', 'currency_id', 'invoicing_address_id', 'shipping_address_id', 'shipping_method_id', 'sales_rep_id', 'invoice_sequence_id')\n with('currency')\n ->with('addresses')\n ->find( $search );\n\n $customers->invoice_sequence_id = $customers->getInvoiceSequenceId();\n $customers->shipping_method_id = $customers->getShippingMethodId();\n\n// return $customers;\n// return Product::searchByNameAutocomplete($query, $onhand_only);\n// return Product::searchByNameAutocomplete($request->input('query'), $onhand_only);\n// response( $customers );\n// return json_encode( $customers );\n return response()->json( $customers );\n }\n\n if ($request->has('term'))\n {\n $search = $request->term;\n\n $customers = Customer::select('id', 'name_fiscal', 'name_commercial', 'identification', 'reference_external', 'sales_equalization', 'payment_method_id', 'currency_id', 'invoicing_address_id', 'shipping_address_id', 'shipping_method_id', 'sales_rep_id')\n ->where( 'name_fiscal', 'LIKE', '%'.$search.'%' )\n ->orWhere( 'name_commercial', 'LIKE', '%'.$search.'%' )\n ->orWhere( 'identification', 'LIKE', '%'.$search.'%' )\n ->isNotBlocked()\n ->with('currency')\n ->with('addresses')\n ->take( intval(Configuration::get('DEF_ITEMS_PERAJAX')) )\n ->get();\n\n// return $customers;\n// return Product::searchByNameAutocomplete($query, $onhand_only);\n// return Product::searchByNameAutocomplete($request->input('query'), $onhand_only);\n// response( $customers );\n// return json_encode( $customers );\n return response()->json( $customers );\n }\n\n // Otherwise, die silently\n return json_encode( [ 'query' => '', 'suggestions' => [] ] );\n \n }", "public function index(Request $request)\n {\n \n // code for searching in table\n $search = $request->search;\n $AllCustomers=Customer::when($search, function ($q)use ($search) {\n $q->where('customer_fname', 'like', \"%{$search}%\")\n ->orwhere('customer_lname', 'like', \"%{$search}%\")\n ->orwhere('address', 'like', \"%{$search}%\")\n ->orwhere('contact_no', 'like', \"%{$search}%\")\n ->orwhere('email_add', 'like', \"%{$search}%\");\n })->orderBy('customer_fname','asc')->paginate(10);;\n // arrange data alphabetically\n \n return view('clerkcustomers.index',[\n 'customers'=>$AllCustomers\n\n ]);\n }", "public function getCities()\n {\n \treturn $this->citiesRepository->getCities();\n }", "public function index(Request $request)\n {\n\n $search = $request->get('search');\n \n //\n $customers = Customer::SearchByKeyword($search)\n ->paginate(10); \n\n \n return view('customer.index')->with('customers', $customers);\n }", "public function getCustomers()\n {\n return Controllers\\CustomersController::getInstance();\n }", "public function getCustomers()\n {\n $role = Role::where('name', 'customer')->first();\n return $role->users;\n }", "public function getCustomers()\n {\n\t\t$customers = $this->ShopifyClient->call('GET','/admin/customers.json',$this->config);\t\t\n\t\t$arra = array();\n\t\tif(!empty($customers['customers']))\n\t\t{\n\t\t\t$keyArr = array('id','email','accepts_marketing','first_name','last_name','orders_count','state','total_spent','last_order_id','note',\n\t\t\t\t\t\t\t'verified_email','multipass_identifier','tax_exempt','tags','last_order_name','addresses');\n\t\t\t$shopifyKeyArr = array('id','email','accepts_marketing','first_name','last_name','orders_count','state','total_spent','last_order_id','note',\n\t\t\t\t\t\t\t'verified_email','multipass_identifier','tax_exempt','tags','last_order_name','addresses');\n\t\t\t\n\t\t\tforeach($customers as $key=>$var) {\n\t\t\t\tforeach($var as $k=>$val) {\n\t\t\t\t\tif(!empty($val['default_address'])){\n\t\t\t\t\t\tarray_push($keyArr, 'default_address');\n\t\t\t\t\t\tarray_push($shopifyKeyArr, 'default_address');\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t$arra['data'][] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$status_code = 200;\n\t\t\t$message = 'success';\t\n\t}else\n\t{\n\t\t$status_code = 404;\n\t\t$message = 'Customers not found';\n\t\t$arra['data'] = array();\n\t\t$arra['data_count'] = 0;\n\t}\t\n\t\t$customers = $this->getJsonDataFormat($arra,$status_code,$message);\t\n\t\treturn $customers;\n }", "function get_wine_count_by_country(){\n \n $obj = new wine();\n $columns = \" tblCountry.country, count(tblWine.wine_id) as qty \";\n $group = \" tblCountry.country \";\n $where = null;\n $sort = \" qty DESC \";\n $limit = '10';\n $rst = $obj ->get_extended($where,$columns,$group,$sort,$limit);\n \n if(!$rst){\n $var_result['success']=false;\n return $var_result; \n }\n \n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result; \n \n}", "public function getCustomers()\n {\n $responseString = $this->apiCall('GET', 'customers');\n try\n {\n $responseObject = $this->parseResponse($responseString);\n return $responseObject->Customers;\n }\n catch(Exception $e)\n {\n echo 'Can`t parse API response: '.$e->getMessage;\n return false;\n }\n }", "public function citiesAction(Request $request)\n {\n $province_id = $request->request->get('province_id');\n\n $em = $this->getDoctrine()->getManager();\n $cities = $em->getRepository('AppBundle:Localidad')\n ->findBy(array('provincia' => $province_id));\n \n //return new Response(json_encode($cities));\n \n $serializer = $this->container->get('serializer'); \n $citiesSerializer = $serializer->serialize($cities, 'json');\n return new Response($citiesSerializer);\n //return new JsonResponse($cities);\n }", "public function getCustomerRecord(Request $request) {\n\n // Data Validation\n $rules = ['customerNumber' => 'required|integer|gte:0'];\n\n $validator = Validator::make($request->all(),$rules);\n\n if($validator->fails()) {\n\n return response()->json([\n 'message' => $validator->messages()\n ]);\n }\n\n if(count($this->customer->getCustomerRecord($request->customerNumber)) == 0) {\n\n return response()->json([\n 'message' => 'No Customer found for this customer number'\n ]);\n }\n\n return response()->json($this->customer->getCustomerRecord($request->customerNumber));\n }", "function getCustomerData()\n {\n if(isset($_SESSION['user_login']) && $_SESSION['user_login']['roll_id']==6)\n {\n /* @changes: all customer display if all_region=1\n * @author: Sagar Jogi dt: 09/08/2017\n */\n $check=DB::query(\"SELECT all_region FROM \" . CFG::$tblPrefix . \"user WHERE id=%d\",$_SESSION['user_login']['id']);\n if($check[0]['all_region']=='1') {\n return DB::query(\"SELECT id,name FROM \" . CFG::$tblPrefix . \"user where roll_id='7' and active='1' order by id desc\");\n } else {\n $customer_array=array();\n //$query=\"SELECT GROUP_CONCAT(DISTINCT(ID)) as id FROM \" . CFG::$tblPrefix . \"region WHERE find_in_set('\".$_SESSION['user_login']['id'].\"',engineer) <> 0\";\n $query=\"SELECT region as id FROM \" . CFG::$tblPrefix . \"user WHERE id=\".$_SESSION['user_login']['id'];\n \n $result=DB::query($query);\n \n if(count($result) > 0)\n {\n foreach($result as $key=>$value)\n {\n $region=explode(\",\",$value[\"id\"]);\n for($i=0;$i<count($region);$i++)\n {\n $customer_query=\"SELECT u.id, u.name\n FROM \" . CFG::$tblPrefix . \"user AS u\n WHERE active='1' and FIND_IN_SET( u.id, (\n\n SELECT GROUP_CONCAT( DISTINCT (\n ID\n ) ) AS id\n FROM \" . CFG::$tblPrefix . \"user\n WHERE find_in_set( '\".$region[$i].\"', region ) <>0 )\n ) and roll_id=7 \";\n \n $customer_result=DB::query($customer_query);\n if(count($customer_result) > 0)\n {\n foreach($customer_result as $ckey=>$cvalue)\n {\n \n array_push($customer_array,$cvalue);\n }\n } \n }\n }\n $customer_unique_array = array_map(\"unserialize\", array_unique(array_map(\"serialize\", $customer_array)));\n \n return $customer_unique_array;\n }\n }\n \n }\n else \n return DB::query(\"SELECT id,name FROM \" . CFG::$tblPrefix . \"user where roll_id='7' and active='1' order by id desc\");\n }", "public function getAllLoansDetails(Request $request){\n try{\n if($user = $request->agent_id){\n if($user){ \n //$allCustomers = Agent::find($user)->agentsCustomers;\n $data['allCustomers'] = Agent::find($request->agent_id)->agentsCustomers->get();\n if(!empty($data) && isset($data)){\n return response()->json([\n 'customers'=>$data,\n 'status' =>'success',\n 'code' =>200,\n ]);\n }else{\n response()->json([\n 'message'=>'Customers not found',\n 'status' =>'error',\n ]);\n }\n }else{\n response()->json([\n 'message'=>'User doest not axist.',\n 'status' =>'error',\n ]);\n }\n }else{\n response()->json([\n 'message'=>'Please login your account',\n 'status' =>'error',\n ]);\n }\n }catch(\\Exception $e){\n return response()->json([\n 'message'=>\"something went wrong.Please contact administrator.\".$e->getMessage(),\n 'error' =>true,\n ]);\n }\n }", "public function testgetCustomersAndTheirOrders() {\n\n // customer 'Juanita' has id = 10.\n $customerId = 10;\n $lifeTimeValue = 0;\n\n $customerOrderArray = $this->customerOrderService->getCustomersAndTheirOrders($customerId, $lifeTimeValue);\n\n // Verify that the customer 'Juanita' [id = 10] has three orders.\n $this->assertTrue(sizeof($customerOrderArray) == 3);\n // Verify the returned $lifeTimeValue is same as the sum of the each customer order field 'total_inc_tax'.\n $this->assertTrue(collect($customerOrderArray)->sum('total_inc_tax') == $lifeTimeValue);\n }", "public static function loadAllCustomerBySearch() {\n\t}", "public function get_customers () {\n \t$customers = $this->service->get_customers();\n \treturn view('admin.customers', ['customers' => $customers]);\n }", "public function getCityList()\n {\n return $this -> generate_city_list();\n }", "public function getCityMoney()\n {\n }", "public function actionApiCities(){\n\t\tYii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n\t\theader('Access-Control-Allow-Origin: *');\n\t\theader('Access-Control-Allow-Methods: GET, POST');\n\n\t\treturn array_keys(\\backend\\models\\Event::getCities());\n\t}", "public function getCustomer();", "public function ajaxCreditCustomer(Request $request)\n {\n $id = $request->id;\n $credit = $this->FacturasQueries->getClientesCreditos($id);\n foreach ($credit as $row) {\n $meses = $row->Dias_Credito * 0.0328549112;\n $subtot = $row->CuotaMensual * $meses;\n $iva = $subtot * 0.13;\n $total = $subtot + $iva; \n $saldo = $row->Saldo_Actual - $total;\n $array = array('saldo' => $row->Saldo_Actual, 'cuota' => $row->CuotaMensual, 'dias' => $row->Dias_Credito, 'disponible' => round($saldo, 2));\n }\n if (empty($array)) \n {\n $array = array('vacio' => \"true\");\n return response()->json($array);\n }\n else{\n return response()->json($array);\n } \n }", "public function actionCountries()\n {\n $salys = Yii::$app->db_prod->createCommand(\"SELECT * FROM salys\")->queryAll();\n foreach ($salys as $salis) {\n $city = new City([\n 'name' => $salis['pavadinimas_lt'],\n 'ansi_name' => $salis['pavadinimas_lt'],\n 'alt_name' => $this->formatCountryAltName($salis),\n 'latitude' => $salis['latitude'],\n 'longitude' => $salis['longitude'],\n 'country_code' => strtoupper($salis['kodas']),\n 'population' => null,\n 'elevation' => null,\n 'timezone' => null,\n 'modification_date' => null,\n ]);\n $city->save();\n }\n\n Cities::addCountries();\n }", "public function index(Request $request)\n {\n $where = [];\n if ($request->customer_id) {\n $where['customer_id'] = $request->customer_id;\n }\n if ($request->user_id) {\n $where['user_id'] = $request->user_id;\n }\n if (sizeof($where) > 0) {\n $orders = Order::orderBy('id', 'DESC')->where($where)->with(['customer.country', 'user'])->withCount(['orderdetails'])->paginate(10);\n\n } else {\n $orders = Order::orderBy('id', 'DESC')->with(['customer.country', 'user'])->withCount(['orderdetails'])->paginate(10);\n }\n return response()->json([\n 'status' => 200,\n 'message' => 'Order get successfully!',\n 'data' => $orders,\n ], 200);\n }", "public function getCustomerList()\n {\n $customerList = $this->customerInterface->getCustomerList();\n return response()->json($customerList);\n }", "public function getCustomers()\n {\n if (array_key_exists(\"customers\", $this->_propDict)) {\n return $this->_propDict[\"customers\"];\n } else {\n return null;\n }\n }" ]
[ "0.65063965", "0.6504285", "0.64686984", "0.6360002", "0.63480943", "0.63078284", "0.6265198", "0.61875325", "0.61639804", "0.6136134", "0.6091443", "0.60901475", "0.60092384", "0.5995947", "0.5934302", "0.58667684", "0.58196485", "0.5798688", "0.57982856", "0.57390857", "0.5735734", "0.5717434", "0.5707753", "0.5705506", "0.56931674", "0.56682634", "0.5666729", "0.56409156", "0.56356776", "0.5630975", "0.5626558", "0.5609434", "0.56040025", "0.5600723", "0.5597504", "0.55970687", "0.55927455", "0.55826217", "0.5579476", "0.5562859", "0.55536324", "0.554139", "0.5539456", "0.55338126", "0.55252206", "0.55251044", "0.5521653", "0.5517258", "0.5511182", "0.54967475", "0.5484933", "0.5473303", "0.5462753", "0.5452656", "0.54523766", "0.5450678", "0.5442793", "0.5441187", "0.54360145", "0.54327524", "0.54320836", "0.5431422", "0.54222685", "0.5410796", "0.5409358", "0.53999466", "0.53957444", "0.53956705", "0.5390955", "0.5389334", "0.53876686", "0.5382052", "0.53712934", "0.5360035", "0.53593403", "0.5358292", "0.53562087", "0.53512055", "0.5347789", "0.5345154", "0.5339769", "0.533056", "0.53302217", "0.532574", "0.5325672", "0.53240603", "0.5320923", "0.5311148", "0.529616", "0.5294592", "0.5290653", "0.52905226", "0.528643", "0.52824426", "0.5281367", "0.52682924", "0.52662355", "0.52648675", "0.52635306", "0.52566844" ]
0.67667896
0
Function Name : change_password Purpose : This function is use for change password of a user. Author : Created Date : 18032019 Modified date : Input Params : \Illuminate\Http\Request $request Return Value : void
public function change_password(Request $request) { try{ $data['title'] = 'Change Password'; if ($request->isMethod('post')) { $Validator = Validator::make($request->all(), [ 'old_password' => 'required', 'new_password' => 'required|min:6', 'confirm_password' => 'required|same:new_password' ]); if ($Validator->fails()) { return \Redirect::route('admin_change_password')->withErrors($Validator); } else { $user = User::find(auth()->guard('admin')->user()->id); if ((Hash::check($request->input('old_password'), $user->password))) { if (!(Hash::check($request->input('new_password'), $user->password))) { $user->password = $request->input('new_password'); $user->save(); $request->session()->flash('success', 'Your password has been changed successfully.'); return \Redirect::Route('admin_change_password'); }else{ $request->session()->flash('error', 'Current password should not be same with the old password.'); return \Redirect::Route('admin_change_password'); } } else { $request->session()->flash('error', 'Current password is not matched with record.'); return \Redirect::Route('admin_change_password'); } } } return view('admin/adminuser.change_password', $data); }catch(Exception $e){ throw new \App\Exceptions\AdminException($e->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changePassword(Request $request){\n DB::table('users')\n ->where('id', 1)\n ->update(['password' => $request->get('password')]);\n return view('updatePassword') ; \n }", "public function changeUserPassword($request)\r\n {\r\n $user = $this->userRepo->where('id', '=', $request->get('user_id'))->first();\r\n if (!is_null($user)) {\r\n $current_password = $request->get('current_password');\r\n if (Hash::check($current_password, $user->password)) {\r\n try {\r\n if ($user->update(['password' => bcrypt($request->get('new_password'))])) {\r\n return $this->sendResponseMessage(200, \"Password Changed Successfully\");\r\n }\r\n } catch (\\Exception $e) {\r\n Log::error(\" Something went wrong while updating password\" . $e->getMessage());\r\n return $this->sendResponseMessage(500, \"Something went wrong. Please try again\");\r\n }\r\n }\r\n return $this->sendResponseMessage(406, \"User current password not match\");\r\n }\r\n return $this->sendResponseMessage(404, \"No User Found with such id\");\r\n }", "public function changePassword(Request $request)\n {\n $inputes = $request->input();\n\n $userData = UserData::find(Session::get('id'));\n\n if($inputes['oldPassword'] != $userData->password)\n {\n return redirect('/changepassword')->with('alert', 'Old Password incorrect!!!');\n \n }\n else{\n $userData->password = $inputes['newPassword'];\n $userData->save();\n return redirect(\"/myProfile\");\n }\n\n }", "public function changePassword(ChangePasswordRequest $request)\n {\n \t$input = $request->all();\n\n \t$user = JWTAuth::authenticate(JWTAuth::getToken());\n\n \tif(!Hash::check($input['current_password'], $user->password)) {\n\n \t\treturn response()->json(['message' => 'current password is not match']);\n\n \t} else {\n\n \t\t$user->update([\n\n \t\t'password' => Hash::make($request->password)\n\n \t]);\n\n\t\treturn response()->json(['message' => 'Password successfully updated']);\n\n \t}\n }", "public function changeUserPassword(Request $request) {\n if (config('app.is_demo')) {\n throw new NoPermissionException('demo_mode');\n }\n\n $this->requirePermission('auth.change-password');\n\n $this->validate($request, [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string'\n ]);\n\n $success = $this->controller->changeUserPassword(\n $request->input('oldPassword'),\n $request->input('newPassword')\n );\n\n return $this->response(compact('success'));\n }", "public function changePassword(Request $request){\n \n $validator = Validator::make($request->all(), [\n 'password' => 'required|min:6|max:10|string',\n ]);\n\n if($validator->fails()){\n return response()->json(['status' => 422, 'message' => $validator->errors()]); \n }\n\n $user = User::find($request->id);\n if($user->is_admin == 1){\n $user->password = Hash::make($request->password);\n $user->update();\n }\n\n return response()->json(['status' => 200, 'message' => \"Password change for $user->name is complete\"]);\n\n }", "public function changePassword(UserChangePasswordRequest $request)\n {\n $requested_data = $request->all();\n $old_password = $requested_data['old_password'];\n $hashedPassword = Auth::user()->password;\n\n if (Hash::check($old_password, $hashedPassword)) {\n $updated = User::find($requested_data['data'][\"id\"])->update(['password' => Hash::make($requested_data['password'])]);\n if ($updated) {\n return Response::json(\\Config::get('admin_success.update_password'));\n } else {\n return Response::json(\\Config::get('admin_error.password_update_error'));\n }\n } else {\n return Response::json(\\Config::get('admin_error.invalid_old_password'));\n }\n }", "public function changePassword(Request $request) \n { \n $validator = Validator::make($request->all(), [ \n 'email' => 'required|email', \n 'password' => 'required', \n 'new_password' => 'required',\n ]);\n if ($validator->fails()) {\n $errors = $validator->errors();\n foreach ($errors->all() as $message) {\n return response()->json([\n 'status'=>0,\n 'base_url' => $this->base_url,\n 'message'=>$message\n ], $this->errorCode);\n }\n }\n if (Auth::attempt(array('email' => $request->email, 'password' => $request->password))){\n $new_password = Hash::make($request->new_password);\n $updated = Users::where('email', $request->email)->update(['password' => $new_password]);\n if($updated) {\n return response()->json([\n 'status'=>1,\n 'base_url' => $this->base_url,\n 'message'=>'Password updated successfully.'\n ], $this->successCode); \n } else {\n return response()->json([\n 'status'=>0,\n 'base_url' => $this->base_url,\n 'message'=>'Wrong credentials.'\n ], $this->errorCode);\n }\n } else {\n return response()->json([\n 'status'=>0,\n 'base_url' => $this->base_url,\n 'message'=>'Wrong credentials.'\n ], $this->errorCode);\n }\n }", "public function postChangePassword(ChangePasswordRequest $request) {\n\n $response = UserServiceProvider::changePassword($request->all());\n if ($response['success'] == true) {\n return redirect('admin/user');\n } else {\n return redirect()->back()->with('error_msg', $response['message']);\n }\n }", "public function changePassword(Request $request)\n {\n $user_det = User::find(Auth::user()->_id);\n $check_password = $this->passwordCorrect($request->input('old_password'));\n if ($check_password) {\n $user_det->password = bcrypt($request->input('new_password1'));\n $user_det->save();\n return response()->json([\n 'success' => true,\n 'message' => 'Password updated successfully'\n ]);\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'Incorrect old password'\n ]);\n }\n }", "public function changePassword(Request $request,$userId){\n\n\t\t/*$ttoken = $this->cnuser->retrieveTokenFromHeader($this->request->header('Authorization'));\n\n\t\t$id = $this->cnuser->getUserIdFromToken($ttoken);*/\n\n\t\t$oldpassword = $request->get('oldPassword');\n\n\t\t$user = User::find($userId);\n\t\tif(!is_null($user)) {\n\t\t\tif (Hash::check($oldpassword, $user->password)) {\n\n\t\t\t\t$newpassword = $request->get('newPassword');\n\n\t\t\t\t$user->password = Hash::make($newpassword);\n\n\t\t\t\t$user->save();\n\n\t\t\t\treturn $this->responseConstructor\n\t\t\t\t\t->setResultCode(200)\n\t\t\t\t\t->setResultTitle(\"Password changed\")\n\t\t\t\t\t->successResponse(\"password changed\");\n\t\t\t}else {\n\n\t\t\t\treturn $this->responseConstructor\n\t\t\t\t\t->setResultCode(404)\n\t\t\t\t\t->setResultTitle(\"Old Password did not match\")\n\t\t\t\t\t->respondWithError(\"Password did not match\");\n\t\t\t}\n\t\t}else{\n\n\t\t\treturn $this->responseConstructor\n\t\t\t\t->setResultCode(404)\n\t\t\t\t->setResultTitle(\"User does not exist\")\n\t\t\t\t->respondWithError(\"User does not exist\");\n\t\t}\n\t}", "public function changePasswordAction(Request $request){\n\n $params['title'] = _(\"CHANGE PASSWORD\");\n\n //handle forgot 1 form\n if (!empty($_POST)){\n\n $error = true;\n $password = $_POST['password'];\n $password_bis = $_POST['password_bis'];\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validatePassword($password);\n $validator->validatePasswordBis($password_bis, $password);\n\n //if valid\n if ($validator->isValid()){\n $securityHelper = new SH();\n\n //find user from db\n $user = $securityHelper->getUser($request);\n\n //if user found\n if($user){\n\n $hashedPassword = $securityHelper->hashPassword( $password, $user->getSalt() );\n $user->setPassword( $hashedPassword );\n\n $userManager = new UserManager();\n $userManager->update($user);\n\n $params[\"message\"] = _(\"Password updated!\");\n $view = new View(\"success.php\", $params);\n $view->setLayout(\"../View/layouts/modal.php\");\n $view->send(true);\n }\n }\n \n $params['errors'] = $validator->getErrors();\n }\n\n\n $view = new View(\"change_password.php\", $params);\n $view->setLayout(\"../View/layouts/modal.php\");\n $view->send(true);\n }", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "public function changePassword(){\n $user=User::find(auth()->id());\n $user->password=bcrypt(request('new_password'));\n $user->save();\n return response()->json('Password Updated Successfully');\n }", "protected function changePassword(Request $request) {\n\n $request = $request->all();\n \n //Validator verify the pattern of email is a viacesi or cesi\n $validator = \\Validator::make($request, [\n 'email' => ['required', 'string', 'email', 'max:255', 'regex:/^[a-zA-Z0-9._-]+@(cesi|viacesi)\\.fr$/'],\n 'actual_password' => ['required', 'string', 'min:8'],\n 'new_password' => ['required', 'string', 'min:8', 'confirmed', 'regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\\$%\\^&\\*]{0,})(?=.{8,})/'],\n ]);\n\n //if validation fails we return to reset\n if ($validator->fails()) {\n return redirect()->to('change')->withErrors($validator);\n }\n\n //if validation success we prepare to check if the user as a record in db and if he is activate\n else {\n\n $user = User::where('email','=',$request['email'])->first();\n \n //if a record for that email is found\n if (!is_null($user)){\n \n //if the email as been activated and password match then\n if($user->email_verified == 1 && app('hash')->check($request['actual_password'], $user->password)){\n \n //if the actual and new passord are different update psw in db \n if($request['new_password'] != $request['actual_password']){\n DB::transaction(function () use ($request, $user){\n $user->update(['password'=> \\Hash::make($request['new_password'])]);\n });\n return redirect()->route('login')->withErrors(['Votre mot de passe a bien été modifié']);\n }\n else {\n return redirect()->route('changePSW')->withErrors(['Votre nouveau mot de passe ne peut être identique à l\\'ancien']);\n }\n\n \n }\n else{\n return redirect()->route('changePSW')->withErrors(['Impossible de changer le mot de passe, le compte associé n\\'est pas activé ou le mot de passe actuel que vous avez entré ne correspond pas']);\n }\n\n }\n else {\n return redirect()->route('changePSW')->withErrors(['Aucun compte n\\'est associé à cet email']);\n }\n\n }\n }", "protected function changePassword() {}", "public function changePassword(Request $request)\n\t {\n $validatedData = $request->validate([\n 'password' => 'min:8|required',\n 'new_password' => 'min:8|required'\n ]);\n\n $user = User::where('email', $request->user()->email )->first();\n\n if (!$user || !Hash::check($request->password, $user->password)) {\n return response([\n 'message' => ['These credentials do not match our records.']\n ], 404);\n }\n\n $user->password = $request->new_password;\n $user->save();\n return new UserResource($user);\n }", "public function processChangePassword(Request $request)\n {\n $user = $this->getUser($request->input('token'));\n $user->password = bcrypt($request->input('new_password') );\n if ($user->save()) {\n $this->response = MessageUtility::getResponse(\n trans('api.CODE_INPUT_SUCCESS'),\n trans('api.DESCRIPTION_CHANGE_PASS_SUCCESS'),\n trans('api.DESCRIPTION_CHANGE_PASS_SUCCESS')\n );\n } else {\n $this->dbError();\n }\n }", "public function change(Request $request)\r\n {\r\n $this->validate($request, [\r\n 'password' => 'required|confirmed|min:6',\r\n 'password_again' => 'sometimes|required_with:password',\r\n ]);\r\n\r\n $user = User::find(\\Auth::id());\r\n $user->password = bcrypt($request->password);\r\n $user->save();\r\n Auth::logout();\r\n\r\n return redirect('/');\r\n }", "public function changePassword() {\n $validator = \\Validator::make(\n \\Input::only([\"password\", \"id\", \"reset_code\"]),\n [\n \"id\" => \"required\",//|exists:users,id\",\n \"reset_code\" => \"required\",//|exists:users,reset_code\",\n \"password\" => \"required\"\n ]\n );\n\n if($validator->fails()) {\n $user = User::whereId(intval(\\Input::get(\"id\")))->whereResetCode(\\Input::get(\"reset_code\"))->first();\n if(!$user) {\n return \\View::make(\"admin.nice-error\", [\n \"title\" => \"Password change failed\",\n \"message\" => $validator->messages()->first()\n ]);\n } else {\n return \\View::make(\"admin.forgot\")->with(\"user\", $user)->withErrors($validator->errors());\n }\n } else {\n $user = User::findOrFail(intval(\\Input::get(\"id\")));\n $user->password = \\Hash::make(\\Input::get(\"password\"));\n $user->reset_code = \"\";\n $user->save();\n return \\Redirect::route(\"dashboard.login\")->with(\"relogin\", true);\n }\n }", "public function change_password() {\n header('Content-Type: application/json');\n $this->autoRender = false;\n $this->User->recursive = -1;\n if ($this->request->is('post')) {\n $user = $this->User->findByEmail($this->request->data['User']['email'], array('User.id', 'User.email', 'User.password'));\n if (!empty($user)) {\n $oldPassword = AuthComponent::password($this->request->data['User']['old_password']);\n if ($user['User']['password'] == $oldPassword) {\n $newPassword = $this->request->data['User']['new_password'];\n $data = array(\n 'id' => $user['User']['id'],\n 'password' => AuthComponent::password($newPassword)\n );\n $this->User->save($data);\n die(json_encode(array('success' => true, 'msg' => 'Succeed to change password')));\n \n } else \n die(json_encode(array('success' => false, 'msg' => 'Wrong old password')));\n \n } else\n die(json_encode(array('success' => false, 'msg' => 'Email address not found.')));\n }\n }", "public function update_password(Request $request)\n {\n // dd($request);\n $user = auth()->user();\n // return view('dash.change-password' , compact('user'));\n\n $request->validate([\n 'old_password' => ['required', 'string', 'password', 'min:8'],\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n ]);\n \n\n $userpassword = Auth::user()->password;\n\n if (!(Hash::check($request->get('old_password'), $userpassword))) {\n\n Session::flash('error', 'Your current password does not match');\n return redirect('/profile')->with('error', 'Your current password does not match');\n\n\n }\n if (Strcmp($request->get('old_password'), $request->get('password')) == 0) {\n\n Session::flash('error', 'New password cannot be the with old password');\n return redirect('/profile')->with('error', 'New password cannot be the with old password');\n }\n if (!(Strcmp($request->get('password'), $request->get('password_confirmation')) == 0)) {\n\n Session::flash('error', 'Password Confirmation do not Match');\n return redirect('/profile')->with('error', 'Password Confirmation do not Match');\n }\n\n\n\n if (Hash::check($request->get('old_password'), $userpassword) && !(Strcmp($request->get('old_password'), $request->get('password')) == 0) && Strcmp($request->get('password'), $request->get('password_confirmation')) == 0) {\n \n $user->password = Hash::make($request->password);\n $user->save();\n\n\n\n Session::flash('message', 'Password changed Successfully!');\n\n $user->notify(new UpdatedUserNotification($user));\n return redirect('/profile');\n\n }\n }", "public function changePassword(AuthChangePasswordRequest $request)\n {\n $requests = $request->only('old_password', 'password', 'password_confirmation');\n $user = auth()->user();\n \n if(Hash::check($requests['old_password'], $user->password)) {\n $requests['password'] = Hash::make($requests['password']);\n $user = Auth::guard()->user();\n $user->update($requests);\n }else{\n return response()->json([\n 'success' => false,\n 'message' => 'Current password is incorrect.',\n ], 200);\n }\n }", "public function change(Request $request)\n {\n $validator = Validator::make(\n $request->all(), \n [\n 'current_password' => ['required', new MatchOldPassword],\n 'new_password' => ['required'],\n 'new_confirm_password' => ['same:new_password']\n ],\n );\n\n if ($validator->fails()) {\n return response()->json([\n 'success' => false,\n 'errors' => $validator->getMessageBag()->toArray(),\n ], 400);\n }\n \n $user = User::findorFail(Auth::id());\n $user->password = Hash::make($request->new_password);\n $user->save();\n\n Auth::logout();\n \n return response()->json([\n 'success' => true,\n 'message' => 'Password berhasil diperbarui',\n 'redirect' => route('login')\n ]);\n }", "public function changePassword(Request $request)\n {\n $this->validate($request, [\n 'old_password' => 'required',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6'\n ]);\n\n if (Auth::attempt(['email' => $this->user->email,\n 'password' => $request->old_password]))\n {\n $this->user->password = bcrypt($request->password);\n $this->user->save();\n\n return redirect('/profile')->with('status', 'Password has been updated!');\n } else {\n return redirect('/profile')->with('error', 'Current Password is incorrect.');\n }\n }", "public function changePassword(Request $request)\n {\n if (!(Hash::check($request->get('current_Password'), Auth::user()->password))) {\n return back()->with('error', 'Your current password does not much with what you provided');\n }\n if (strcmp($request->get('current_Password'), $request->get('new_Password')) == 0) {\n return back()->with('error', 'Your current password cannot be the same as new password');\n }\n $request->validate([\n 'current_Password' => 'required',\n 'new_Password' => 'required|confirmed|string|min:6'\n ]);\n\n $user = Auth::user();\n $user->password = bcrypt($request->get('new_Password'));\n $user->save();\n return back()->with('message', 'Password changed successfully');\n }", "public function saveChangePassword(Request $request)\n {\n $user = Auth::user();\n $password = $request->get('password');\n\n if (Hash::check($password, $user->password)) {\n if ($request->get('password_new') == $request->get('password_confirm')) {\n if (strlen($request->get('password_new')) > 5) {\n Session::flash('message', 'Password Changed!');\n Session::flash('alert-class', 'alert-info');\n $cUser = User::findorFail($user->id);\n $cUser->password = Hash::make($request->get('password_new'));\n $cUser->save();\n\n return redirect('/home');\n\n } else {\n Session::flash('message', 'Password has to be at least 6 characters long!');\n Session::flash('alert-class', 'alert-danger');\n\n return redirect()->back();\n }\n } else {\n Session::flash('message', 'Passwords do not match!');\n Session::flash('alert-class', 'alert-danger');\n\n return redirect()->back();\n }\n } else {\n Session::flash('message', 'Please check your old password!');\n Session::flash('alert-class', 'alert-danger');\n\n return redirect()->back();\n }\n }", "public function postUserChangePassword(Request $request) { \n $data = request()->validate([\n 'current_password' => 'required',\n 'new_password' => 'required|min:8',\n 'confirm_new_password' => 'required|min:8',\n ]);\n\n if (!(Hash::check($data['current_password'], Auth::user()->password))) {\n return back()->with('error', 'Your current password is incorrect.');\n }else if($data['new_password'] != $data['confirm_new_password']){\n return back()->with('error', 'Passwords do not match');\n }else{\n User::where('id', Auth::user()->id)->update([\n 'password' => bcrypt($data['new_password']),\n 'change_password' => 1\n ]);\n return back()->with('status', 'Password was successfully updated.');\n }\n }", "public function updatePassword(passRequest $request){\n \n \n \t$user = Auth::user();\n \t$oldPassword = $request['passwordold'];\n $newPassword = $request['password'];\n\n if (Hash::check($oldPassword, $user->password)) {\n $request->user()->fill(['password'=>Hash::make($newPassword)])->save();\n return redirect()->action('ItemsController@index');\n }\n else\n {\n \treturn redirect()->back()->with('alert','Thay đổi không thành công');\n }\n }", "public function changePassword(ChangePasswordRequest $request) {\n // Extract the request data.\n $password = $request->currentPassword;\n $newPassword = $request->newPassword;\n $confirmPassword = $request->confirmPassword;\n\n // Get the current password\n $currentPassword = auth('admin')->user()->password;\n // Check if current password matches the sent password.\n if (!Hash::check($password, $currentPassword)) {\n return redirect()->back()->with('error', 'The entered password does not match our records.');\n }\n // Check if new password matches current password.\n if (strcmp($newPassword, $password) === 0) {\n return redirect()->back()->with('error', 'New password cannot be same as your current password.');\n }\n // Check if the new password matches the confirmation password.\n if (strcmp($newPassword, $confirmPassword) !== 0) {\n return redirect()->back()->with('error', 'The confirmation password does not match.');\n }\n\n // Get the current auth user and update their password.\n $user = auth('admin')->user();\n $user->password = bcrypt($newPassword);\n $user->update();\n\n Mv::createSystemNotification(auth('admin')->id(), null, 'Password', 'You have successfully changed your password.');\n\n return redirect()->back()->with('success', 'You have successfully changed your password.');\n }", "public function changePassword(Request $request)\n {\n $user = User::find($request->session()->get('id'));\n // dd($request->session()->get('id'));\n return view('seller.changePassword',compact('user'));\n\n }", "public function updatePassword(Request $request)\n {\n $password = $request->input('password');\n $newPassword = $request->input('new-password');\n $newPasswordRetype = $request->input('new-password-retype');\n\n $user = Auth::user();\n\n if(!Hash::check($password, $user->password)){\n return redirect()->back()\n ->with('errors', ['Mật khẩu không đúng.'])\n ->with('flag', 'password');\n }\n\n if($newPassword != $newPasswordRetype) {\n return redirect()->back()\n ->with('errors', ['Nhập lại mật khẩu không đúng.'])\n ->with('flag', 'password');\n }\n\n $user->password = Hash::make($newPassword);\n\n $user->save();\n\n return redirect()->back()->with('success', ['Đổi mật khẩu thành công.']);\n }", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function changePassword($username, $password);", "public function changePassword(User $user, string $newPassword): void;", "public function password(UserRequest $request)\n {\n\t\t// Validate the request\n \t$request->validated();\n\n\n \t// Change the password\n\t\ttry {\n\n\t \t$request->user()->fill([\n\t 'password' => Hash::make($request->password)\n\t ])->save();\n\n\n // Send notification\n $request->user()->notify( new PasswordChangeConfirmation() );\n\n return response(['message' => 'Your account password has been successfully changed.'], 200);\n \n } catch (Exception $e) {\n return response(['message' => $e->getMessage()], 500);\n }\n }", "public function updatePassword(UpdatePasswordRequest $request){\n $request->validate();\n $this->userRepository->updatePassword($request);\n return back();\n }", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function changePassword()\n {\n // validate the info, create rules for the inputs\n $rules = array(\n 'current_password' => 'required|check_password:'.Input::get('current_password'),\n 'password' => 'required|min:4|confirmed',\n 'password_confirmation' => 'required|min:4'\n );\n\n // run the validation rules on the inputs from the form\n $validator = Validator::make(Input::all(), $rules);\n\n // if the validator fails, redirect back to the form\n if ($validator->fails()) {\n // redirect to list page\n Session::flash('danger', UNABLE_TO_SAVE);\n return Redirect::back()\n ->withErrors($validator)\n ->withInput();\n\n } else {\n if (Hash::check(Input::get('current_password'), Auth::user()->password)) {\n $user = User::find(Auth::user()->id);\n \n $user->password = Hash::make(Input::get('password'));\n $user->save();\n }\n \n #echo\"<pre>\";print_r(Input::all());echo Auth::user()->password;echo\"</pre>\";exit;\n \n \n }\n\n // redirect to list page\n Session::flash('success', SUCCESS_UPDATE);\n return Redirect::to('my_account/password');\n }", "public function changeUserPassword($uid,$newPassword);", "public function changePassword()\n {\n //\n $id = Auth()->user()->id;\n $user = User::find($id);\n return view('customers.change-password',compact('user'));\n\n }", "public function password_update(Request $request)\n {\n if(Setting::get('demo_mode', 0) == 1) {\n return back()->with('flash_error','Disabled for demo purposes! Please contact us at info@appoets.com');\n }\n\n $this->validate($request,[\n 'old_password' => 'required',\n 'password' => 'required|min:6|confirmed',\n ]);\n\n try {\n\n $Account = Account::find(Auth::guard('account')->user()->id);\n\n if(password_verify($request->old_password, $Account->password))\n {\n $Account->password = bcrypt($request->password);\n $Account->save();\n\n return redirect()->back()->with('flash_success','Password Updated');\n }\n } catch (Exception $e) {\n return back()->with('flash_error','Something Went Wrong!');\n }\n }", "public function changePassword(Request $request)\n\t{ \n\t\t$returnArr=config('constants.return_array');\n\t\t//$input=$request->all();\n\t\t$input=array_map('trim', $request->all());\n\t\ttry{\n\t\t\tDB::beginTransaction();\n\t\t\t$guard=CustomHelper::getGuard();\n\t\t\t$currentUser = \\Auth::guard($guard)->user();\n \t\t$logedInUser=isset($currentUser->id) ? $currentUser->id : NULL;\n\n\t\t\t$validationRules=[\n\t 'current_password' => 'required',\n \t'password' => 'required|confirmed|min:6'\n\t ];\n\t $validator= \\Validator::make($input, $validationRules);\n\t if($validator->fails()){\n\t $returnArr['status']=3;\n\t $returnArr['content']=$validator->errors();\n\t $returnArr['message']=\"Validation failed\";\n\t return $returnArr;\n\t }\n\n\t if (!Hash::check($input['current_password'], $currentUser->password)){\n\t $createMessage['current_password']=\"The current password does not match.\";\n\t $returnArr['status']=3;\n\t $returnArr['content']=$createMessage;\n\t $returnArr['message']=\"Validation failed.\";\n\t }else{\n\t \t$updateData['password']=Hash::make($input['password']);\n\t \t$updateData['ip_address']=$request->ip();\n\t \t$updateData['updated_at']=\\Carbon\\Carbon::now()->toDateTimeString();\n\t \tif(CustomHelper::isAdminId($logedInUser) === true)\n \t\t$updateRes=$this->admin->where('id', $logedInUser)->update($updateData);\n \telse\n \t\t$updateRes=$this->user->where('id', $logedInUser)->update($updateData);\n\n \tif($updateRes==true){\n \t\t$mailData['user_full_name']=$currentUser->full_name;\n \t\t$mailData['password']=$input['password'];\n \t\tMail::send('emails.password-change-mail', $mailData, function($message) use($currentUser) {\n\t\t \t$receiverEmail=trim($currentUser->email);\n\t\t\t\t\t $message->to($receiverEmail, $currentUser->full_name)\n\t\t\t\t\t ->subject('Symcom password changed');\n\t\t\t\t\t $message->from('symcom@noreply.com','Symcom');\n\t\t\t\t\t});\n\n \t\t$returnArr['status']=2;\n\t $returnArr['content']=\"\";\n\t $returnArr['message']=\"Password is updated successfully\";\n \t}else{\n \t\t$returnArr['status']=5;\n\t $returnArr['content']=\"\";\n\t $returnArr['message']=\"Operation failed, could not update the password\";\n \t}\n\t }\n\n\t DB::commit();\n\t }\n catch(\\Exception $e){\n \tDB::rollback();\n \t$returnArr['status']=6;\n\t $returnArr['content']=$e;\n\t $returnArr['message']=\"Something went wrong\";\n }\n\n return $returnArr; \n\t}", "public function changePassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('password', 'Altes Passwort', 'required');\n $this->form_validation->set_rules('new_password', 'Neues Passwort', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n\t\tif (!password_verify(\n\t\t\t$this->input->post('password'),\n\t\t\t$this->user_model->getValue('hashed_password'))) \n\t\t{\n\t\t\t$this->error(404, 'Verification error');\n\t\t}\n\t\t\n\t\t/*\n \tif ($this->user_model->getValue('confirmed') == 0) {\n \t\t$this->error(402, 'Account not confirmed');\n \t}\n \t*/\n \t\n \t$this->user_model->setValue(\n \t\t'hashed_password',\n \t\tpassword_hash($this->input->post('new_password'), PASSWORD_DEFAULT));\n \t\t\n \tif (! $this->user_model->updatePassword()) {\n \t\t$this->error(400, 'Password could not be updated');\n \t}\n \t\n $data['new password'] = 'set';\n $this->response($data);\n }", "public function changePassword(Request $request, User $user)\n {\n $this->validate($request, [\n \"password\" => \"required|string|min:8|max:25|confirmed\",\n ]);\n $data = [\n \"password\" => bcrypt($request->password),\n ];\n\n if ($user->update($data)) {\n Toastr::success('Successfully Password Changed', \"Success\");\n } else {\n Toastr::error('Something Went Wrong!', \"Error\");\n }\n return redirect()->back();\n }", "public function changePassword(Request $request)\n {\n if ($this->validator($request->all())->fails()) {\n return $this->validator($request->all())->errors();\n }\n\n $user = $this->update($request->all());\n return \"You've successfully change your password.\";\n }", "public function changePassword(Request $request, $id)\n {\n\n $user = User::where('delete_flag', 0)->findOrFail($id);\n if((!Auth::user()->roleAdmin()) || (Auth::user()->id == $id)) {\n $this->validate($request, [\n\n 'oldpassword' => 'required|min:3|max:50',\n 'password' => 'required|min:3|max:50',\n 'repassword' => 'required|same:password',\n\n ], [\n 'oldpassword.required' => 'Vui lòng nhập mật khẩu cũ',\n 'oldpassword.min' => 'Nhập sai mật khẩu cũ',\n 'oldpassword.max' => 'Nhập sai mật khẩu cũ',\n 'password.required' => 'Vui lòng nhập mật khẩu',\n 'password.min' => 'Mật khẩu mới phải có ít nhất 3 kí tự',\n 'password.max' => 'Mật khẩu mới quá dài',\n 'repassword.required' => 'Vui lòng xác nhật mật khẩu',\n 'repassword.same' => 'Xác nhận mật khẩu không đúng',\n ]);\n }\n else{\n $this->validate($request, [\n\n 'password' => 'required|min:3|max:50',\n 'repassword' => 'required|same:password',\n\n ], [\n 'password.required' => 'Vui lòng nhập mật khẩu',\n 'password.min' => 'Mật khẩu mới phải có ít nhất 3 kí tự',\n 'password.max' => 'Mật khẩu mới quá dài',\n 'repassword.required' => 'Vui lòng xác nhật mật khẩu',\n 'repassword.same' => 'Xác nhận mật khẩu không đúng',\n ]);\n }\n if (!\\Hash::check($request->oldpassword, $user->password)) {\n session()->flash('message', 'Mật khẩu cũ không chính xác!');\n return redirect()->route('tutor.edit', $id);\n }\n $user->password = bcrypt($request->password);\n if ($user->save()) {\n session()->flash('message', 'Đổi mật khẩu thành công!');\n return redirect('tutor');\n } else {\n session()->flash('message', 'Đổi mật khẩu thất bại!');\n return redirect('tutor.edit');\n }\n }", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "public function postChangePassword(Request $req){\n $this->validate($req,\n [\n 'password'=>'required|min:6',\n 're_password'=>'required|same:password',\n 'old_password'=>'required',\n ],\n [\n 're_password.required'=>'Chưa nhập mật khẩu',\n 'password.required'=>'Bạn chưa nhập mật khẩu mới',\n 'password.min'=>'Mật khẩu mới ít nhất 6 ký tự',\n 're_password.required'=>'Chưa nhập lại mật khẩu',\n 're_password.same'=>'Mật khẩu không giống nhau',\n ]\n );\n\n if(!Auth::attempt(['email'=> Auth::user()->email, 'password'=>$req->old_password]))\n return redirect('change_password')->with('loi','Mật khẩu không đúng.');\n\n Auth::user()->password = bcrypt($req->password);\n Auth::user()->save();\n\n return redirect()->back()->with('success', 'Đổi mật khẩu thành công!');\n }", "public function organizationUpdatePasswordInfo(Request $request)\n\t{\n\t\t$this->validate($request,[\n 'old_password' => 'required',\n 'new_password' => 'required',\n 'confirm_password' => 'required'\n ]);\n\n $old_password = trim($request->old_password);\n $new_password = trim($request->new_password);\n $confirm_password = trim($request->confirm_password);\n\n $salt = 'a123A321';\n $oldPassword = sha1($old_password.$salt);\n $newPassword = sha1($new_password.$salt);\n\n $profile_info = DB::table('admin')\n ->where('id',$this->loged_id)\n ->first();\n\n if ($profile_info->password != $oldPassword) {\n Session()->put('failed', 'Sorry ! Old Password Not Match.Try Again');\n return Redirect::to('organizationChangePassword');\n }\n\n if ($new_password != $confirm_password) {\n Session()->put('failed', 'Sorry ! New Password And Confrim Password Not Match.Try Again');\n return Redirect::to('organizationChangePassword');\n }\n\n $data = array() ;\n $data['password'] = $newPassword ;\n $data['updated_at'] = $this->rcdate ;\n\n DB::table('admin')->where('id',$this->loged_id)->update($data);\n\n Session()->put('success', 'Thanks ! Password Change Successfully Completed.');\n return Redirect::to('organizationChangePassword');\n\t}", "public function putChangePassword(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'old_password' => 'required|min:6|max:20|passcheck:password',\n 'new_password' => 'required|min:6|max:20|confirmed',\n 'new_password_confirmation' => 'required|min:6|max:20',\n ]);\n // Validation fails\n if ($validator->fails()) {\n $this->validationFails($validator);\n } else {\n // Change password success\n $this->processChangePassword($request);\n }\n return response()->json($this->response);\n }", "public function updatepassword() {\n $request = Request::all();\n $rules = ['old_password' => 'required', 'password' => 'required|confirmed|min:6'];\n $v = Validator::make($request, $rules);\n if ($v->fails()) {\n return redirect()->back()->withErrors($v->errors());\n }\n $user = User::find(Auth::user()->id);\n if (!Hash::check($request['old_password'], $user->password)) {\n return redirect()->back()->withErrors([\"old_password\" => [0 => \"The old password does not match.\"]]);\n }\n\n $user->password = bcrypt($request['password']);\n $user->save();\n return redirect()->back()->with('status', 'Your password changed succesfully');\n }", "public function changePassword(Request $request)\n {\n try {\n $validator = Validator::make($request->all(), [\n 'old_password' => 'required',\n 'password' => ['required', 'min:6'],\n ]);\n if ($validator->fails()) {\n return response()->jsend_error(new \\Exception($validator->errors()->first()), $message = null);\n }\n $user = $this->userService->user->find($request->user()->id);\n if (!Hash::check($request->old_password, $user->password)) {\n return response()->jsend_error(new \\Exception(\"Old password does not match\"), $message = null, $code = 422);\n }\n $user->password = Hash::make($request->password);\n if ($user->save())\n return response()->jsend($data = $user, $presenter = null, $status = \"success\", $message = null, $code = 200);\n\n } catch (\\Exception $exception) {\n $error['statusCode'] = $exception->getCode();\n $error['message'] = $exception->getMessage();\n Log::error('Password change error: ', $error);\n return response()->jsend_error(new \\Exception($exception->getMessage()), $message = null, $code = $error['statusCode'] ?? 200);\n }\n\n }", "public function user_password_update(Request $request) {\n if ($request->password != $request->password_confirm) {\n return redirect()->back()->with('fail', 'Password does not match');\n }\n\n $user = User::where('id', $request->id)->first();\n $user->password = Hash::make($request->password);\n $user->save();\n return redirect()->route('user.dashboard')->with('success', 'Password Updated successfully');\n }", "public function postChangePassword($request, $response){\n\n \tv::with('App\\\\Validation\\\\Rules\\\\');\n \tif (!empty($request->getParam('user_email'))) {\n \t\t$validation = $this->validator->validate($request, [\n \t\t\t\t'user_email' => v::noWhitespace()->notEmpty()->email()->emailExist(),\n \t\t]);\n \t}\n \telse{\n\t $validation = $this->validator->validate($request, [\n 'user_password' => v::noWhitespace()->notEmpty()->passwordAcceptance(),\n 'user_password_confirm' => v::noWhitespace()->notEmpty()->matchesPassword($_POST['user_password']),\n\t ]);\n \t}\n\n\n if ($validation->failed()) {\n return $response->withRedirect($this->router->pathFor('auth.password.change'));\n }\n $auth = $this->auth->attempt(\n $this->auth->user()->user_name,\n $request->getParam('user_password_old')\n );\n if (!empty($request->getParam('user_email'))) {\n\n \t$chaine='azertyuiopqsdfghjklmwxcvbn123456789';\n \t$nb_lettres = strlen($chaine) - 1;\n \t$generation = '';\n \tfor($i=0; $i < 12; $i++){\n \t\t$pos = mt_rand(0, $nb_lettres);\n \t\t$car = $chaine[$pos];\n \t\t$generation .= $car;\n \t}\n \t$user=User::where(\"user_email\",$request->getParam('user_email'))->first();\n \t$user->user_password_hash= password_hash($generation, PASSWORD_DEFAULT);\n \t\t$this->flash->addMessage('info', \"Le mot de passe temporaire est envoyé sur l'adresse mail utilisateur:\".$generation);\n }\n \telse {\n \t\t$user=$this->auth->user();\n \t$user->user_password_hash= password_hash($request->getParam('user_password'), PASSWORD_DEFAULT);\n \t$this->flash->addMessage('info', 'Your password was changed!');\n \t}\n\n\n \t$user->save();\n return $response->withRedirect($this->router->pathFor('home'));\n\n }", "public function changePassword(ChangePasswordRequest $request, User $user) // Secured Endpoint\n {\n Gate::authorize('changePassword',$user);\n \n $request = $request->validated();\n\n if (!Hash::check($request['old_password'], $user->password)) \n {\n return response()->json([\n 'message' => \"The given data was invalid.\",\n \"errors\" => [ \"old_password\" => \"The old password is not correct.\" ]\n ],422);\n }\n\n $request['password'] = Hash::make($request['password']);\n \n $user = $user->update( $request );\n\n return response()->json([\n 'success' => true,\n ]);\n }", "public function updatepwd(Request $request, $id)\n { $canedit = ((Auth::user()->is_admin != 0) or (Auth::user()->id == $id));\n \n $user = User::find($id);\n\n if ($user == null) {\n //else they shouldn't be here so redirect\n return redirect('/')->with('huh', 'user can not edit this user');\n }\n\n //if user is NOT admin\n if (Auth::user()->is_admin == 0) {\n //validate the input\n $updateData = $request->validate([\n 'password' => 'required|max:255',\n 'newpassword' => 'required|max:255',\n 'password_confirmation' => 'required|max:255|same:newpassword',\n \n ]);\n\n $passwordentered = $updateData[\"password\"];\n\n\n if (!Hash::check($passwordentered, $user->password)) {\n return Redirect::back()->withErrors(['password', 'The password you entered was incorrect']);\n }\n\n\n } else {\n //validate the input\n $updateData = $request->validate([\n 'newpassword' => 'required|max:255',\n 'password_confirmation' => 'required|max:255|same:newpassword',\n \n ]);\n }\n\n $newpassword = $updateData[\"newpassword\"];\n\n $user->password = bcrypt($newpassword);\n $user->save();\n \n\n return redirect('/home')->with('password updated', 'you successfully updated your password');\n\n\n }", "public function changePass(Request $request, $id)\n {\n //\n $data = customer::where('Customer_ID', $id)->get();\n $validatedPass = $request->Customer_Passwordo;\n $length = strlen($request->Customer_Password);\n foreach($data as $data1){\n $data2 = $data1->Customer_Password;\n }\n //Verify the password\n $verify = password_verify($validatedPass,$data2);\n if ( $verify) {\n if($length>=8){\n //Encrypt the password\n $validatedData = Hash::make($request->Customer_Password);\n \n DB::select(\"UPDATE customers set Customer_Password = '$validatedData' where Customer_ID = ?\",[$id]);\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Password is successful updated.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.CustomerProfileInterface', compact(\"data\"));\n }\n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Minimum password length of eight (8) is required. \";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.ChangePasswordInterface', compact(\"data\"));\n }\n \n } \n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Old password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.ChangePasswordInterface', compact(\"data\"));\n }\n }", "public function changePassword($userId, Request $request) {\n dsadsa();\n $this->validateChangePasswordData($request);\n\n // Make sure user don't change password of current account\n if (Auth::user()->id == $userId) {\n return response()->json([\n 'title' => 'Ooops.',\n 'message' => 'Nu poți schimba parola acestui cont. Folosește secțiunea dedicată.'\n ], 422);\n }\n\n User::where('id', $userId)->update([\n 'password' => bcrypt($request->get('new_password'))\n ]);\n\n return response()->json([\n 'title' => 'Succes!',\n 'message' => 'Parola contului a fost schimbată.'\n ]);\n }", "public function postChangePasswordByDasboard(ChangePasswordRequest $request) {\n\n $response = UserServiceProvider::changePassword($request->all());\n if ($response['success'] == true) {\n\n return redirect()->back()->with('success_msg', $response['message']);\n } else {\n return redirect()->back()->with('error_msg', $response['message']);\n }\n }", "function WP_update_user_password(WP_REST_Request $request){\n\n if ( !is_user_logged_in() )\n return new WP_Error( 'Not_Authorized', 'Invalid Token', array( 'status' => 404 ) );\n\n $oldPassword = $request['old_password'];\n $newPassword = $request['new_password'];\n $user = get_user_by( 'id', intval($request['user_id']) );\n\n if ( wp_check_password( $oldPassword, $user->user_pass, $request['id'] ) ) {\n wp_set_password( $newPassword, $request['id'] );\n return new WP_REST_Response([\n \"success\" => true,\n \"message\" => \"Password updated successfully.\"\n ]);\n }\n else\n return new WP_Error( \"wrong_old_password\", \"Old password doesn't match\", array( 'status' => 404 ) );\n\n }", "public function change_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->change_password($this->input->post());\n\n if ($res['success'] && !isset($res['invalid_fields'])) {\n $this->_flash_message('パスワードを変更しました');\n redirect('setting');\n return;\n }\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n $view_data['post'] = $this->input->post();\n }\n\n $this->_render($view_data);\n }", "public function update_password(Request $request)\n {\n $this->validate($request, [\n 'oldpassword' => 'required',\n 'password' => 'required|string|min:6|confirmed',\n ]);\n\n $user = User::find(Auth::User()->id);\n if(Hash::check($request->oldpassword, $user->password)){\n $user->password = Hash::make($request->password);\n $user->save();\n }else{\n return back()->with('error', _lang('Old Password not match'));\n }\n return back()->with('success', _lang('Password has been changed'));\n }", "public function changePassword(User $user){\n //username+emp-id+current-year\n $password = $user->username.$user->profile->emp_id.\\Carbon\\Carbon::now()->year;\n $user->update(['password' => $password]);\n return redirect()\n ->back()\n ->with('status','Password reseted');\n }", "public function updatePassword(Request $request)\n {\n \t$user = Auth::user();\n \t$this->validate($request,[\n \t\t'password' => 'required|passcheck:'.$user->password,//membuat custom validasi passcheck\n \t\t'new_password' => 'required|confirmed|min:6',\n \t],\n \t[\n \t\t'password.passcheck' => 'Password lama tidak sesuai',//menyesuaikan pesan error passcheck\n \t]);\n\n \t$user->password = bcrypt($request->get('new_password'));\n \t$user->save();\n\n \tSession::flash('flash_message','Password berhasil diubah.');\n \treturn redirect('setting/password');\n }", "public function post_change_password() {\n $fields = array(\n 'current_password' => Input::get('current_password'), \n 'password' => Input::get('new_password'),\n 'password_confirmation' => Input::get('confirm_new_password'),\n );\n\n $rules = array(\n 'current_password' => 'required',\n 'password' => 'required|confirmed|min:4',\n );\n \n $validation = Validator::make($fields, $rules);\n \n if( $validation->fails() ) {\n Input::flash();\n return Redirect::to_action('login@change_password')->with_errors($validation);\n //return $this->get_forgot_password()->with('errors', $validation);\n } else {\n $user = Auth::user();\n \n if ( ! is_null($user) and Hash::check(Input::get('current_password'), $user->password)) {\n $user->password = Input::get('new_password');\n $user->change_password_request = 'N';\n $user->save();\n $this->successes[] = \"Your current password has been changed successfully.\";\n //print_r($user); die();\n return Redirect::to('dashboard')->with('successes', serialize($this->successes));\n } else if(is_null($user)) {\n $this->warnings[] = \"You have to be logged in in order to change your current password.\";\n return Redirect::to('login')->with('warnings', serialize($this->warnings));\n } else {\n $validation->errors->add('current_password', 'The selected <b>current password</b> is invalid.');\n return Redirect::to_action('login@change_password')->with_errors($validation);\n }\n\n return $this->get_change_password();\n\n }\n \n }", "public function changePasswordAction(Request $request) {\n $user = $this->getUser();\n\n $dispatcher = $this->get('event_dispatcher');\n\n $event = new GetResponseUserEvent($user, $request);\n $dispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_INITIALIZE, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n\n $form = $this->get('form.factory')->create(new ChangePasswordType());\n $form->setData($user);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $userManager = $this->get('core_user.user_manager');\n\n $event = new FormEvent($form, $request);\n $dispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_SUCCESS, $event);\n\n $userManager->updateUser($user);\n\n $dispatcher->dispatch(FOSUserEvents::CHANGE_PASSWORD_COMPLETED, new FilterUserResponseEvent($user, $request, new Response('OK')));\n\n $view = $this->view(array('response' => 'OK'), Response::HTTP_OK);\n } else {\n $view = $this->view($form->getErrors(), Response::HTTP_BAD_REQUEST);\n }\n\n return $this->handleView($view);\n }", "public function changePassword() {\n if ($this->passwordChangeValidator()->fails()) {\n $errors[\"status\"] = false;\n $errors[\"message\"] = $this->passwordChangeValidator()->errors()->all();\n return $errors;\n }\n //$responseMessage = array();\n $userId = $this->request->session()->get('user_id');\n $where = [[\"users.user_id\", \"=\", $userId]];\n $this->usersModel->setWhere($where);\n $user = $this->usersModel->getUsers();\n\n if ($user == null) {\n return false;\n }\n\n $oldPassword = $this->request->input(\"old_password\");\n $oldHashedPassword = $user[0]->password;\n $status = Hash::check($oldPassword, $oldHashedPassword);\n if ($status) {\n //change to new password\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $userId]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n } else {\n $errors[\"status\"] = false;\n $errors[\"message\"] = [\"Invalid Password\"];\n return $errors;\n }\n return true;\n }", "public function change_password(Request $request) {\n\n try { \n\n DB::beginTransaction();\n\n $validator = Validator::make($request->all(), [\n 'password' => 'required|confirmed',\n 'old_password' => 'required',\n ]);\n\n if($validator->fails()) {\n \n $error_messages = implode(',',$validator->messages()->all());\n\n throw new Exception($error_messages, 101);\n \n } else {\n\n $user = User::find($request->id);\n\n if(Hash::check($request->old_password,$user->password)) {\n\n $user->password = \\Hash::make($request->password);\n \n if($user->save()) {\n\n $response_array = Helper::null_safe([\n 'success' => true , \n 'message' => Helper::get_message(102), \n 'data'=>['id'=>$user->id, 'token'=>$user->token]]);\n\n // Once password changed, logout will execute\n\n $this->logout($request);\n\n } else {\n\n throw new Exception(tr('user_details_not_saved'));\n\n }\n\n } else {\n\n throw new Exception(Helper::error_message(131), 131);\n }\n\n }\n\n DB::commit();\n\n $response = response()->json($response_array,200);\n\n return $response;\n\n } catch (Exception $e) {\n\n DB::rollback();\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return response()->json($response_array);\n\n }\n\n }", "public function put_updatepassword(){\n\t\t$customer_id = Input::get('customer_id');\n\n\t\t$customer = Customer::find($customer_id);\n\n\t\t$validation = Customer::validate_changepassword();\n\n\t\tif($validation->fails()) {\n\t \t\treturn Redirect::back()\n\t \t\t\t->withErrors($validation);\n\t\t}\n\n\t\telse {\n\n\t\t\tif (Hash::check(Input::get('customer_old_password'), $customer->customer_password)) {\n\t\t\t\n\t\t \t\tCustomer::find($customer_id)->update(array(\n\t\t\t\t\t'customer_password'=>Hash::make(Input::get('customer_new_password')),\n\t\t\t\t));\n\n\t\t\t\treturn Redirect::route('customer_profile')\n\t\t\t\t\t->with('message', 'The password was updated successfully!');\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\treturn Redirect::route('change_customer_profile_password')\n\t\t \t\t\t->with('error-message', 'The old password inputted is not correct!');\n\t\t\t}\n\t\t}\n\t}", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "public function updatePassword(Request $request)\n {\n // Get user\n $user = Auth::user();\n\n // Validation\n $validator = Validator::make($request->all(), [\n 'password' => 'required|confirmed|min:6',\n ]);\n\n // If validation fail\n if ($validator->fails()) {\n flash(\"Une erreur s'est produite...\")->error();\n\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n\n // Update password\n $user->password = bcrypt($request->password);\n $user->save();\n\n // Return with success message\n flash('Votre mot de passe à bien été mis à jour !')->success();\n\n return redirect()->back();\n }", "public function change(string $password): void;", "public function changePassword()\n {\n $user = Auth::user();\n return view('member.change_password');\n }", "public function changePasswordAction()\n {\n $errors = [];\n if(!empty($_POST)){\n $user = Auth::getUser();\n\n $userValidation = new UserValidation($_POST, ['password']);\n $errors = $userValidation->getNamedErrors();\n\n if(empty($errors)){\n if(password_verify($_POST['oldpass'], $user->password)){\n $user->changePassword($_POST['password']);\n Extra::setMessageCookie(\"Password changed successfully.\");\n $this->redirect(\"/manage-account/\");\n }\n $errors['oldpass'] = \"Password you entered is incorrect.\";\n }\n }\n View::renderTemplate(\"LoggedUser/change-password.html\", [\n 'errors' => $errors\n ]);\n }", "public function putChangePasswordAction(Request $request): JsonResponse;", "public function passwordUpdate(Request $request) {\n\n $this->validate($request, [\n 'oldPassword' => 'required',\n 'password' => 'required|confirmed',\n 'password_confirmation' => 'required',\n ],[\n \"oldPassword.required\" => \"Old password is required\",\n \"password.required\" => \"Password is required\",\n \"password_confirmation.required\" => \"Confirm password required\",\n \"password_confirmation.confirmed\" => \"New and confirm password not match\",\n ]);\n \n try {\n\n $user = User::where(\"id\",Auth::guard(\"web\")->user()->id)->first();\n\n if(Hash::check(trim(strip_tags($request->oldPassword)), $user->password)) {\n $user->password = bcrypt($request->password);\n $user->update();\n return redirect()->back()->with(\"success\",\"Password changed Successfully\");\n }else{\n return redirect()->back()->with('warning', \"Sorry! Your old password not match!\");\n }\n }catch(Exception $e){\n return redirect()->back()->with(\"error\",\"Something want wrong!\");\n }\n }", "public function updatepassword(Request $request)\n {\n $user_id = Auth::user()->id;\n $teacher_user_id = Teacher::with('user')->where('user_id',$user_id)->first();\n $teacher_id = $teacher_user_id->id;\n\n $teacher = Teacher::find($teacher_id);\n $teacher_user_id = $teacher->user_id;\n\n $user = User::find($teacher_user_id);\n\n $user->password = bcrypt($request->input('password'));\n $user->save();\n Session::flash('flash_message','Maklumat katalaluan berjaya dikemaskini.');\n return Redirect::back();\n }", "public function updatePassword(Request $request) {\n\n if (!(Hash::check($request->get('password'), \\Auth::user()->password))) {\n // The passwords matches\n return redirect()->back()->with(\"error\", \"La contrasena actual no es correcta. Favor de volver a intentar.\");\n }\n\n if (strcmp($request->get('password'), $request->get('newPassword')) == 0) {\n //Current password and new password are same\n return redirect()->back()->with(\"error\", \"Nueva y vieja contrasenas no puede ser iguales.\");\n }\n\n $validate = $this->validate($request, [\n 'password' => 'required',\n 'newPassword' => 'required|string|min:6|confirmed',\n ]);\n\n\n\n $user = \\Auth::user();\n $user->password = bcrypt($request->get('newPassword'));\n $user->update();\n\n return redirect()->back()\n ->with(\"success\", \"Contrasena cambiada correctamente !\");\n }", "public function update_pwd(Request $request) {\n \n $return_with_errors = false;\n $errors = [];\n //first check if old pwd was correct\n if(!(Hash::check($request->old_pwd, Auth::user()->password))) {\n $return_with_errors = true;\n $errors['old_pwd'] = \"Oude wachtwoord is incorrect.\";\n }\n //check if new password is valid\n if(strlen($request->new_pwd) < 6) {\n $return_with_errors = true;\n $errors['new_pwd_length'] = \"Het nieuwe wachtwoord moet minstens uit 6 karakters bestaan\";\n }\n if($request->new_pwd != $request->new_pwd_check) {\n $return_with_errors = true;\n $errors['new_pwd'] = \"Het nieuwe wachtwoord moet tweemaal hetzelfde ingegeven worden.\";\n }\n if($return_with_errors) {\n return redirect('/')->with('error_msg', $errors);\n }\n else {\n Auth::user()->password = Hash::make($request->new_pwd);\n Auth::user()->tmp_password = null;\n Auth::user()->save();\n return redirect('/')->with('success_msg', 'Je hebt je wachtwoord succesvol geüpdatet.');\n }\n }", "function change_password()\n {\n if ($user = $this->authorized(USER))\n {\n $descriptive_names = array(\n 'current_password' => 'Current Password',\n 'new_password' => 'New Password',\n 'new_password_confirm' => 'Confirm Password'\n );\n\n $rules = array(\n 'current_password' => ($user['group_id']==0)?'clean':'required|clean',\n 'new_password' => 'required|clean',\n 'new_password_confirm' => 'required|clean'\n );\n\n $this->loadLibrary('form.class');\n $form = new Form();\n\n $form->dependencies['title'] = \"Change Password\";\n $form->dependencies['form'] = 'application/views/change-password.php';\n $form->dependencies['admin_reset'] = false;\n $form->dependencies['client_id'] = $user['id'];\n $form->form_fields = $_POST;\n $form->descriptive_names = $descriptive_names;\n $form->view_to_load = 'form';\n $form->rules = $rules;\n\n if ($fields = $form->process_form())\n {\n\n $this->loadModel('UserAuthentication');\n\n\n if ($this->UserAuthentication->change_password($user['id'], $fields['current_password'], $fields['new_password'], $fields['new_password_confirm']))\n {\n $this->alert(\"Password Updated\", \"success\");\n $this->redirect(\"portal/home\");\n }\n else\n {\n $this->alert(\"Error: Password Not Updated\", \"error\");\n $this->redirect(\"portal/home\");\n }\n }\n }\n }", "public function changepassword() {\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->phone_no) && !empty($request_data->user_token) && !empty($request_data->old_password) && !empty($request_data->new_password) && !empty($request_data->confirm_password):\n\n // Check if phone no exists\n $data = $this->User->findUser($request_data->phone_no);\n\n // Check if record exists\n if (count($data) != 0) {\n // Check uuid entered is valid\n if ($data[0]['User']['verified'] === false) {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User not verified';\n } elseif ($request_data->user_token != $data[0]['User']['user_token']) { // User Token is not valid\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User Token is invalid';\n } elseif (md5($request_data->old_password) != $data[0]['User']['password']) { // User password is matching or not.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Password did not match';\n } elseif (trim($request_data->new_password) == trim($request_data->old_password)) { // New password is not equal to old password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to old password.';\n } elseif (trim($request_data->new_password) != trim($request_data->confirm_password)) { // New password is not equal to confirm password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to confirm password.';\n } else {\n\n $dataArray = array();\n $dataArray['User']['_id'] = $data[0]['User']['_id'];\n $dataArray['User']['password'] = md5(trim($request_data->new_password));\n\n if ($this->User->save($dataArray)) {\n $success = true;\n $status = SUCCESS;\n $message = 'Settings has been changed.';\n } else {\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Phone no. not registered.';\n }\n break;\n // User Token blank in request\n case!empty($request_data) && empty($request_data->user_token):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Token cannot be blank.';\n break;\n // Phone no. blank in request\n case!empty($request_data) && empty($request_data->phone_no):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Phone no. cannot be blank.';\n break;\n // Old Password blank in request\n case!empty($request_data) && empty($request_data->old_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Old password cannot be blank.';\n break;\n // New Password blank in request\n case!empty($request_data) && empty($request_data->new_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'New password cannot be blank.';\n break;\n // Confirm Password blank in request\n case!empty($request_data) && empty($request_data->confirm_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Confirm password cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }", "public function changePassword( $id, Request $request){\n\t\t$rules = [\n\t\t\t\t'old_password' => 'required',\n\t\t\t\t'password' => 'required|min:6|strong_password',\n\t\t];\n\t\t$this->validate($request, $rules);\n\t\t\n\t\t$user = User::findOrFail($id);\n\t\tif(!Hash::check($request->old_password, $user->password)){\n\t\t\treturn $this->errorResponse(['old_password' => [ __('validation.old_password_not_match')]], 422);\n\t\t}\n\t\t\n\t\t$user->password = bcrypt($request->password);\n\t\ttry{\n\t\t\t$user->save();\n\t\t\treturn $this->showOne($user);\n\t\t}catch(Exception $e){\n\t\t\treturn $this->errorResponse($e->getMessage(), 500);\n\t\t}\n\t}", "public function updatePassword(Request $request)\n {\n if(Hash::check($request->input('current_password'), Auth()->user()->password)) {\n Auth()->user()->password = bcrypt($request->input('new_password'));\n Auth()->user()->save();\n }\n\n // TODO: Mostrar error si la clave antigua no coincide\n return redirect()->route('home');\n }", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "function password_update_post(Request $request){\n $request->validate([\n 'password' => 'confirmed'\n ]);\n\n if(Hash::check($request->old_password, Auth::user()->password)){\n\n if ($request->old_password == $request->password) {\n return back()->with('error_reenter_old', 'You entered your old password. Please try a new password');\n }\n\n else {\n User::find(Auth::id())->update([\n 'password' => Hash::make($request->password),\n 'updated_at' => now(),\n ]);\n\n //Sending password changing notification email start \n Mail::to(Auth::user()->email)->send(new PasswordChanged);\n return back()->with('password_change_success', 'Your password changed successfully');\n }\n }\n\n else{\n return back()->with('error_password_hash_unmatched', 'Your old password does not matched. Please try again..');\n }\n }", "function user_changed_password($user_id, $new_password) {\n \n }", "public function cambia_password(Request $request)\n {\n $input = $request->all();\n $user = User::where('email', '=', $request->email)->first();\n if ($user != null) {\n if (Hash::check('UserPass', $user->password)) {\n $validator = Validator::make($input, [\n 'email' => 'required',\n 'password' => 'required',\n 'password_di_controllo' => 'required|same:password',\n ]);\n if ($validator->fails()) {\n return redirect('change')\n ->withErrors($validator)\n ->withInput();\n }\n\n $user->update(['password' => bcrypt($request->password)]);\n return redirect('login');\n }else{ \n return back()->withErrors([\"Hai già cambiato la password. Utilizza Ho dimenticato la password\"])->withInput();\n }\n\n \n } else {\n return back()->withErrors([\"L'indirizzo email inserito è errato\"])->withInput();\n }\n }", "public function updatePassword(Request $request)\n {\n // Validation.\n $this->validate($request, [\n 'password' => 'required',\n ]);\n\n // Obtain the authenticated user's id.\n $id = Auth::id();\n\n // Find the user and update the password from the request.\n $user = User::find($id);\n $user->password = bcrypt(request('password'));\n\n // Save the changes.\n $user->save();\n\n // Notify the user with a success email.\n $user->notify(new PasswordResetSuccess());\n\n // Return true upon success.\n return response()->json([], Response::HTTP_OK);\n }", "public function password_change() {\n if (!empty($this->session->userdata('user_session'))) {\n $user_id = $this->User_Model->get_loggedin_user_id();\n $user = $this->User_Model->get_user($user_id);\n if (!empty($user)) {\n $this->data['title'] = \"Update User Password\";\n $this->data['user_type_list'] = $this->get_user_types();\n $this->data['user'] = $user;\n $employee_information = $this->Employee_Model->get_employee($user->employee_id);\n $this->data['employee_information'] = $employee_information;\n $this->load->view('header');\n $this->load->view('navigation');\n $this->load->view('user/update_my_password', $this->data);\n } else {\n redirect(base_url('user'));\n }\n } else {\n redirect(base_url('user_login'));\n }\n }", "public function selfChangePassword()\n\t{\n\t\tif (!$this->userService->changePassword(Input::all()))\n\t\t{\n\t\t\treturn Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('Your password has been successfully changed.')->flash();\n\n\t\treturn Redirect::route('user-profile', array('tab' => 'account'));\n\t}", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function change_password()\n {\n //check login\n if(!$this->session->userdata('logged_in'))\n {\n redirect('users/login');\n }\n $data['user']= $this->user_model->get_user();\n $data['title'] = 'Change password';\n $data['pinn'] = $this->note_model->get_pin();\n $this->load->view('includes/header', $data);\n $this->load->view('users/change_password', $data);\n $this->load->view('includes/footer');\n }", "public function changePassword($request, $id) {\n $response = $this->client->put('user/' . $id, [\n 'body' => $request,\n 'form_params' => [\n 'password' => md5($request->input('password'))\n ]\n ]);\n \n return $response;\n }", "public function postChangepassword() {\n if ($this->_adminUserRepository->updatePassword ()) {\n return redirect ( 'users/changepassword' )->withSuccess ( trans ( 'user::adminuser.changepassword.success' ) );\n } else {\n return redirect ( 'users/changepassword' )->withErrors ( trans ( 'user::adminuser.changepassword.incorrect' ) );\n }\n }", "public function profile_pass_reset(Request $request)\n {\n $request->validate([\n 'old_password' => ['required', new MatchOldPassword],\n 'password' => ['required'],\n 'confirm' => ['same:password'],\n ]);\n \n User::find(auth()->user()->id)->update(['password'=> Hash::make($request->password)]);\n\n return response()->json([\n 'message' => 'Password Successfuly Changed',\n ]);\n }", "public function changePassword($request, $response){\n\t $isError = false;\n\t $id = $request->getParam('id');\n\t $current_pass = $request->getParam('current_pass');\n\t $new_pass = $request->getParam('new_pass');\n\t $new_pass_confirm = $request->getParam('new_pass_confirm');\n\t if(empty($current_pass)){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please enter your current password.'));\n\t\t exit();\n\t }elseif(empty($new_pass)){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please enter your new password.'));\n\t\t exit();\n\t }else if( empty($new_pass_confirm) ){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please confirm your new password.'));\n\t\t exit();\n\t }else if($new_pass <> $new_pass_confirm){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'New and confirm password must be same.'));\n\t\t exit();\t \n\t }else{\n\t\t $AuthObj = new Auth();\n\t\t $auth = $AuthObj->checkOperatorPassword($id,$current_pass);\n\t\t if($auth == true ) {\n\t\t\t // update to operatos table\n\t\t\t $new_password = $AuthObj->changePassword($new_pass_confirm);\n\t\t\t $data = array('password' => $new_password);\t \n\t\t\t $opUser = Models\\Operators::where('op_id', '=', $id)->update($data);\n\t\t\t return $response\n\t\t\t\t\t->withHeader('Content-type','application/json')\n\t\t\t\t\t->write(json_encode(array('status' => TRUE)));\n\t\t }else{\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Current password did not found in the system.'));\n\t\t exit();\t \n\t\t }\n\t }\n\t \n\t}", "public function updatePassword(Request $request)\n {\n $user = Auth::user();\n $data = $request->all();\n $validation = Validator::make($data, [\n 'password' => 'required',\n 'new_password' => 'required|different:password'\n ]);\n\n if ($validation->fails()) {\n $data1['statues'] = \"302 Ok\";\n $data1['error'] = \"couldn't update password\";\n $data1['data'] = $validation->errors();\n return response()->json($data1, 302);\n }\n\n $user->password = Hash::make($data['new_password']);\n $user->save();\n $data1['statues'] = \"200 Ok\";\n $data1['error'] = null;\n $data1['data'] = null;\n return response()->json($data1, 200);\n }", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "public function update_password(Request $request, $id){\n $this->validate($request, [\n 'password' => 'required|confirmed'\n ], $this->custom_messages);\n\n\n $user = User::find($id);\n $log = new Log;\n $log->name = Auth::user()->name;\n $log->action = 'EDIT';\n $log->module = 'USER-PASSWORD';\n $log->description = 'Updated password of user: ' . $user->name;\n $log->save();\n\n\n User::where('id',$id)->update(array(\n 'password' => Hash::make($request->password)\n ));\n return redirect('/sysmg/accounts/'.$id);\n \n \n }" ]
[ "0.8424435", "0.82620424", "0.820156", "0.81923896", "0.8136362", "0.81112427", "0.8102437", "0.8043626", "0.8034415", "0.8019988", "0.79944927", "0.7984865", "0.7976581", "0.79620016", "0.7918457", "0.78915465", "0.78853357", "0.78698653", "0.7862728", "0.78496385", "0.78362066", "0.7821305", "0.7817255", "0.78010267", "0.78010035", "0.7786146", "0.77221036", "0.7720227", "0.7717751", "0.77070016", "0.77003807", "0.76794153", "0.7679035", "0.76709485", "0.76657933", "0.7655575", "0.7637044", "0.7633763", "0.76122046", "0.76014787", "0.75968295", "0.7594897", "0.75817657", "0.758016", "0.7567735", "0.75610876", "0.75610185", "0.755564", "0.75545514", "0.75497776", "0.7549599", "0.7548683", "0.75436294", "0.75369096", "0.75256145", "0.7524211", "0.7515617", "0.7515302", "0.7506085", "0.7505396", "0.74994254", "0.74761564", "0.7468743", "0.745642", "0.7456406", "0.74409366", "0.7431862", "0.743092", "0.7430723", "0.74247044", "0.74241126", "0.74233097", "0.7411582", "0.73996013", "0.7396503", "0.7389299", "0.73866606", "0.73857206", "0.73817974", "0.73669773", "0.73651624", "0.73639184", "0.7352575", "0.73505884", "0.73503804", "0.73415023", "0.73201555", "0.7307423", "0.72993183", "0.7297591", "0.7289793", "0.7285798", "0.72825056", "0.7280357", "0.7276031", "0.7265961", "0.7264543", "0.72615", "0.72612095", "0.7251679" ]
0.82353103
2
Complex test with exception
public function testAssertInvalidDataShouldRaiseException() { $this->expectException(ValidatorException::class); Validator::alphaNumeric('_')->length(1, 15)->noWhitespace()->assert('invalid username'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testinternalRateOfReturnException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::internalRateOfReturn(array(70000, 12000, 15000, 18000, 21000));\n\t}", "public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}", "function testmodifiedInternalRateOfReturnException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::modifiedInternalRateOfReturn(-70000, 12000, 15000, 18000, 21000, 0.10, 0.12);\n\t}", "function testmodifiedInternalRateOfReturnException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::modifiedInternalRateOfReturn(array(70000, 12000, 15000, 18000, 21000), 0.10, 0.12);\n\t}", "function testrateException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::rate(20, -36.157534, 255, 0, 3);\n\t}", "function testinternalRateOfReturnException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::internalRateOfReturn(-70000, 12000, 15000, 18000, 21000);\n\t}", "function testpaymentException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::payment(0.29, -7, 435);\n\t}", "public function testComputeNegative()\n {\n $this->expectException('');\n $this->calc->init(42)->compute('command not exist', 42);\n }", "function testpaymentException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::payment(0.29, 7, 435, 0, 3);\n\t}", "public function testException() {\n\t\ttry {\n\t\t\t$array = array( 'ABC' );\n\t\t\t$percentages = new Percentages( $array );\n\t\t} catch ( \\RuntimeException $expected ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->fail( 'An expected exception has not been raised.' );\n\t}", "public function testRetrieveUnsuccessfulReason()\n {\n }", "public function testExecuteWithException()\n {\n $this->prepareRequestMock();\n $this->customerRestrictionMock->expects($this->once())->method('isOwner')->willReturn(false);\n $this->customerRestrictionMock->expects($this->once())->method('isSubUserContent')->willReturn(false);\n $this->resultJson->expects($this->once())->method('setJsonData')->willReturnSelf();\n $this->quoteRepositoryMock->expects($this->once())->method('get')->willReturn($this->quote);\n $this->resultFactory->expects($this->once())->method('create')\n ->with(\\Magento\\Framework\\Controller\\ResultFactory::TYPE_JSON)->willReturn($this->resultJson);\n $this->messageManager->expects($this->once())->method('addError')->willReturnSelf();\n $this->assertEquals($this->resultJson, $this->recalculate->execute());\n }", "public function testIsInvalid()\n {\n $this->todo('stub');\n }", "function testinterestPaymentException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::interestPayment(0.1/12, 3, 3*12, 8000, 0, 2);\n\t}", "public function testErrors()\n {\n $database = Database::create(['driver' => 'sqlite', 'dsn' => 'sqlite::memory:']);\n $query = new Query($database);\n $superQuery = new QueryProxy($query);\n\n $this->assertException(InvalidArgumentException::class, function () use ($superQuery) {\n $superQuery->where(new \\stdClass);\n }, function (InvalidArgumentException $exception) {\n $this->assertInstanceOf(QueryScribeInvalidArgumentException::class, $exception->getPrevious());\n });\n\n $this->assertException(InvalidReturnValueException::class, function () use ($superQuery) {\n $superQuery->apply(function () {\n return 'hello';\n });\n }, function (InvalidReturnValueException $exception) {\n $this->assertInstanceOf(QueryScribeInvalidReturnValueException::class, $exception->getPrevious());\n });\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "public function testShouldThrowWhenNotEven()\n {\n $this->setExpectedException(\"InvalidArgumentException\");\n $data = \"ICI\";\n $decoded = (new Trytes)->decode($data);\n }", "public function fails();", "public function fails();", "public function testException() {\n $lockedOperation = new LockedOperation(new ExceptionLockHandler());\n $lockable = new MyLockable();\n $op = function() {\n return TRUE;\n };\n\n $result = FALSE;\n\n try {\n $result = $lockedOperation->execute($op, $lockable);\n }\n catch(\\LockMan\\Exception\\LockReleaseException $e) {\n $result = $e->getResult();\n }\n\n $this->assertTrue($result);\n }", "public function testWebSearchExceptionAdultOkInvalid()\n {\n try {\n $this->_yahoo->webSearch('php', ['adult_ok' => 'oops']);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('error occurred sending request', $e->getMessage());\n }\n }", "public function testImageSearchExceptionAdultOkInvalid()\n {\n try {\n $this->_yahoo->imageSearch('php', ['adult_ok' => -1]);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('error occurred sending request', $e->getMessage());\n }\n }", "function testprincipalPaymentException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::principalPayment(0.1/12, 3, 3*12, 8000, 0, 2);\n\t}", "function testeffectiveRateException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::effectiveRate(0.40, -13);\n\t}", "public function testWebSearchExceptionSimilarOkInvalid()\n {\n try {\n $this->_yahoo->webSearch('php', ['similar_ok' => 'oops']);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('error occurred sending request', $e->getMessage());\n }\n }", "public function testFaultyProperties()\n {\n $international = new International();\n\n try {\n $international->setProduct(str_repeat('a', 10));\n $this->fail('BpostInvalidValueException not launched');\n } catch (BpostInvalidValueException $e) {\n // Nothing, the exception is good\n } catch (Exception $e) {\n $this->fail('BpostInvalidValueException not caught');\n }\n\n // Exceptions were caught,\n $this->assertTrue(true);\n }", "public function testTotalException()\n {\n $input = [0,2,5,8];\n $coupon = 1.20;\n\n // Make the test expect a certain type of exception\n $this->expectException('BadMethodCallException');\n $this->Receipt->total($input, $coupon);\n }", "public function testExceptions()\n {\n $Location = new Location(self::$databaseName, self::$collection);\n $output = json_decode($Location->getAllCities('_id'));\n $this->assertEquals($output->error, \"true\");\n\n $output = json_decode($Location->getAllCities('india', true));\n $this->assertEquals($output->error, \"true\");\n\n $output = json_decode($Location->getAllCountries(true));\n $this->assertEquals($output->error, \"true\");\n }", "public function testValidationCaseForInvalidPrimeNumberForKeyExchangeGeneration()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->generateExchangeResponseInformation(['wrong'], bin2hex(decbin(2)));\n } else {\n $hasThrown = null;\n\n try {\n $protocol->generateExchangeResponseInformation(['wrong'], bin2hex(decbin(2)));\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "function testnominalRateException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::nominalRate(0.2930, -5);\n\t}", "public function testIsValidException()\n\t{\n\t\t$data = $this->getMock('Blackbox_Data', array());\n\t\t$data->expects($this->never())->method('__set');\n\t\t$data->expects($this->never())->method('__unset');\n\n\t\t$this->target->isValid($data, $this->state_data);\n\t}", "public function testFinderRangeLifeErrors() {\n $this->setExpectedException('BadFunctionCallException');\n $this->Links->find('rangeLife');\n }", "public function testTask1Exception(){\n\n }", "public function testException()\n {\n throw new Exception('This is not expected.');\n }", "public function testInvalidData()\n {\n $startLongitude = '100ab';//'1000'\n $startLatitude = 1000.484;\n $tripDistance = -2000;\n $this->validateCoordinatesServiceMock->shouldReceive('isLatitudeValid')->andReturn(false);\n $this->validateCoordinatesServiceMock->shouldReceive('isLongitudeValid')->andReturn(false);\n try {\n $result = $this->tripMakingService->calculateWholeTrip($startLongitude, $startLatitude, $tripDistance);\n } catch (NoBreweriesFoundException $ex) {\n $this->assertNotNull($ex);\n }\n }", "public function testErrorMessage()\n {\n $this->throwErrorException();\n\n // test if code actually gets here\n $this->assertTrue(true);\n }", "public function testBasicPostcondition()\n {\n $e = null;\n try {\n $this->typeSafetyTestClass->iReturnAString(12);\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertInstanceOf('\\AppserverIo\\Psr\\MetaobjectProtocol\\Dbc\\BrokenPostconditionException', $e);\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iReturnAnArray('testinger');\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertInstanceOf('\\AppserverIo\\Psr\\MetaobjectProtocol\\Dbc\\BrokenPostconditionException', $e);\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iReturnAnInt(array());\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertInstanceOf('\\AppserverIo\\Psr\\MetaobjectProtocol\\Dbc\\BrokenPostconditionException', $e);\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iReturnAnArray();\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertNull($e);\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iReturnAnInt();\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertNull($e);\n\n $e = null;\n try {\n $this->typeSafetyTestClass->iReturnAString();\n\n } catch (\\Exception $e) {\n }\n\n // Did we get the right $e?\n $this->assertNull($e);\n }", "public function testErrornousMultipleResultSqlQuery() {\r\n $this->setExpectedException('Exception', 'Error in query: errornous sql query');\r\n $this->getPersistenceAdapter()->executeMultipleResultQuery('errornous sql query');\r\n }", "public function testValidationCaseForNonStringInputDataPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testAddNegativeException(): void\n {\n $stringCalculator = new StringCalc();\n\n // Tell phpunit to expect an exception to be thrown when our method is called.\n $this->expectException(Exception::class);\n // The actual result of the method.\n $stringCalculator->Add(\"//|\\n-1|2|-5\");\n }", "public function testCreateUnsuccessfulReason()\n {\n }", "public function testErrornousSingleResultSqlQuery() {\r\n $this->setExpectedException('Exception', 'Error in query: errornous sql query');\r\n $this->getPersistenceAdapter()->executeSingleResultQuery('errornous sql query');\r\n }", "public function testLayer0WhenValueIs0ExceptionLayer0()\n {\n $this->setExpectedException('exceptions\\layer0\\exceptionLayer0\\ExceptionLayer0');\n $return=$this->oLayer0->layer0(0);\n\n }", "public function testProcessException1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'field3',\n ]);\n $unit1->setReversedConnection([\n 'id' => 'field4',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1']\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $action = $this->getAction([$unit1]);\n $action->process($this->getResultMock());\n }", "public function test_IndexError(){\n\t\t$this->validateTestException(\n\t\t\t$this->fullURL,\n\t\t\t'GET',\n\t\t\t$this->data,\n\t\t\t'NotImplementedException',\n\t\t\t'index'\n\t\t);\n\t}", "public function testToFail()\n {\n $this->assertTrue(false, 'He sido creada para fallar');\n }", "public function testThrowException()\n {\n throw new ImageNotReadableException();\n }", "function testTBillEquivalentYieldException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::TBillEquivalentYield(mktime(0, 0, 0, 6, 1, 2008), mktime(0, 0, 0, 3, 31, 2010), 0.09);\n\t}", "public function testisEvenNumberFail()\n {\n $result = $this->calculator->isEvenNumber(3);\n $this->assertFalse($result);\n }", "public function testOtherError()\n {\n $expectedBody = $this->getExpectedBody(\n [\n ['SKU' => 'test123']\n ],\n []\n );\n\n $this->mockEndpoint();\n $this->mockCurl($expectedBody, 200, 'An error response', 'An error');\n\n $error = '';\n try {\n $this->subject->addData(['SKU' => 'test123']);\n $response = $this->subject->send();\n\n $this->assertEquals(\n 'An error response',\n $response[0]['body']\n );\n } catch (Exception $e) {\n $error = $e->getMessage();\n }\n\n $this->assertEquals(\n 'Error: An error',\n $error\n );\n }", "function testfutureValueException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::futureValue(0.29, 7, 100, 0, 3);\n\t}", "public function testValidationCaseForInvalidGeneratorNumberForKeyExchangeGeneration()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->generateExchangeResponseInformation(bin2hex(decbin(17)), ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n $protocol->generateExchangeResponseInformation(bin2hex(decbin(17)), ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "function testTBillEquivalentYieldException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::TBillEquivalentYield(mktime(0, 0, 0, 6, 1, 2008), mktime(0, 0, 0, 3, 31, 2008), 0.09);\n\t}", "public function testExceptionWithMessage()\n {\n throw new ThumbNotFoundException('Thumb not found!');\n }", "function testpresentValueException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::presentValue(0.29, 7, 100, 0, 3);\n\t}", "public function testIterationException(): void\n {\n $this->variant->setException(new \\Exception('foo'));\n $this->logger->variantEnd($this->variant);\n $this->assertStringContainsString('ERROR', $this->output->fetch());\n }", "function testfutureValueException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::futureValue(0.29, -7, 100);\n\t}", "public function testGetImageInfoFromBlobException()\n {\n $rwongBlob = file_get_contents(__FILE__);\n $this->setExpectedException('Exception');\n Tinebase_ImageHelper::getImageInfoFromBlob($rwongBlob);\n }", "function testpresentValueException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::presentValue(0.29, -7, 100);\n\t}", "function test_4() {\n\ttry {\n\t\t$res = gather(function() {\n\t\t\ttake(1);\n\t\t\tthrow new Exception('meh');\n\t\t});\n\t}\n\tcatch (Exception $e) {\n\t\treturn true;\n\t}\n\treturn 'non-last()-generated exceptions are left alone';\n}", "function testTBillYieldException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::TBillYield(mktime(0, 0, 0, 6, 1, 2008), mktime(0, 0, 0, 3, 31, 2010), 98.45);\n\t}", "protected function validateOrThrow() {}", "public function testAddExeptionForIncorrectTag1()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::table();\n $td = $table->td();\n }", "public function testThrowSomeThrows()\n {\n $game = $this->getGameSubject();\n $game->addThrow(5);\n }", "public function testGetMultiFail() : void\n {\n $fetch = new MockFetch();\n $this->expectException(\\Exception::class);\n\n $fetch->getMulti([\n \"url\" => \"\",\n ]);\n }", "public function testValidationCaseForNonStringSecretKeyPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testThrowWithoutOffset() {\n\t\ttry {\n\t\t\tthrow new \\YapepBase\\Exception\\IndexOutOfBoundsException();\n\t\t\t$this->fail('Exception not thrown!');\n\t\t} catch (\\YapepBase\\Exception\\IndexOutOfBoundsException $e) {\n\t\t\t$this->assertNotEquals('', $e->getMessage(), 'Message is empty!');\n\t\t}\n\t}", "function testTBillYieldException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::TBillYield(mktime(0, 0, 0, 6, 1, 2008), mktime(0, 0, 0, 3, 31, 2008), 98.45);\n\t}", "public function testFault()\n {\n \t$client = new RPC_Client_Exec('/bin/' . md5(microtime()));\n \t$rpc = $client->getInterface();\n \t\n \t$this->setExpectedException('Q\\RPC_Fault', \"Execution of command failed\");\n \t$result = $rpc->test();\n\t}", "public function testGetNonExistingWeightedValue()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->generator->getWeightedValue(new \\stdClass());\n }", "public function testErrornousNoResultSqlQuery() {\r\n $this->setExpectedException('Exception', 'Error in query: errornous sql query');\r\n $this->getPersistenceAdapter()->executeNoResultQuery('errornous sql query');\r\n }", "public function testExecuteWithException()\n {\n $this->cart->expects($this->once())\n ->method('removeFailedSku')\n ->willThrowException(new \\Exception());\n $this->logger->expects($this->once())->method('critical');\n $this->messageManager->expects($this->once())->method('addError');\n $this->createInstance();\n $result = $this->controller->execute();\n\n $this->assertSame($result, $this->resultRaw);\n }", "public function testExcepcionSiSeCreaEmpleadoConDniQueContengaLetras(){\n\t\t\t$this->expectException(\\Exception::class);\n\t\t\t$emp= $this-> crear(null, null, \"4kh123l\");\n\t\t}", "public function testX(): void\n\t{\n\t\t$this->expectException(\\InvalidArgumentException::class);\n\t\tnew Ex\\InvalidTypeException('foo', Type::STRING, []);\n\t}", "public function testGetMultipleInvalidTypeInteger(): void\n {\n $keyValuePairs = 978;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testCompareIfXIsNotNumber()\n {\n $this->setExpectedException('InvalidArgumentException');\n \n (new Interval())->compare('foo');\n \n return;\n }", "public function __test()\n {\n throw new \\Exception('Oops! It is a dead end!', 400);\n }", "public function testGetMultipleInvalidTypeBoolean(): void\n {\n $keyValuePairs = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testMagicCallUnknown()\n {\n $this->expectException(Error::class);\n\n $this->uut->foo();\n }", "public function testCase1()\n {\n $fa = $this->getFa();\n // Test error\n $ret = $fa->run('110', 'S0');\n $this->assertEquals($ret['status'], 'success');\n }", "public function testDeleteUnsuccessfulReason()\n {\n }", "public function testException() {\n\t\ttry {\n\t\t\t$this->user->getUser('');\n\t\t\t$this->fail(\"Username Required\");\n\t\t} catch (\\Throwable $ex) {\n\t\t\t$this->assertEquals($ex->getMessage(), \"Username Required\");\n\t\t}\n\n\t}", "public function testGetFail() : void\n {\n $fetch = new MockFetch();\n $this->expectException(\\Exception::class);\n\n $fetch->get(\"\");\n }", "public function testValidationCaseForNonStringInputDataPassedForDecryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::decryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::decryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testValidateFormFailure()\n {\n $formData = 10;\n $validation = GRUB\\Validator\\Validator::validateIngredient($formData);\n $expected = 10;\n $this->assertEquals($validation, $expected);\n }", "public function testExcepcionSiSeCreaEmpleadoConDniVacio(){\n\t\t\t$this->expectException(\\Exception::class);\n\t\t\t$emp= $this-> crear(null, null,$dni=\"\");\n\t\t}", "public function testExceptExceptionWithEmptyDatabse()\n {\n $this->expectException(\"ArgumentCountError\");\n $database = new \\Database();\n }", "public function testModerationByCompanyException(): void\n {\n static::expectException(UnauthorizedModerationAction::class);\n $this->moderationService->moderateByCompany(1, 'wrong');\n }", "public function testIsEvenPassNegativeODD()\n {\n \t$this->assertFalse(isEven(-5));\n }", "public function test_getContentException() : void\n {\n $this->expectExceptionCode(PreParser::ERROR_CONTENT_ID_NOT_FOUND);\n\n PreParser::getContent(999);\n }", "public function beginsWithReturnsInvalidArgumentDataProvider() {}", "public function testGetInvalidAdultUsername() : void {\n// grab an email that does not exist\n$profile = Adult::getAdultByAdultUsername($this->getPDO(), \"yourmom\");\n$this->assertNull($profile);\n}", "public function testValidationCaseForNonPositiveOutputLength()\n {\n $generator = $this->getTokenGeneratorForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\LengthException::class);\n\n $generator->getTokenString(0);\n } else {\n $hasThrown = null;\n\n try {\n $generator->getTokenString(0);\n } catch (\\LengthException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function endsWithReturnsThrowsExceptionWithInvalidArgumentsDataProvider() {}", "public function testGetMultipleInvalidTypeString(): void\n {\n $keyValuePairs = \"I like to party sometimes until four\";\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testValidateFormMalformed()\n {\n $formData = ['jelly'];\n $this->expectException(TypeError::class);\n $case = GRUB\\Validator\\Validator::validateIngredient($formData);\n }", "public function testCannotBeCreatedFromInvalidEmailAddress()\n {\n\n }", "public function testGetInvalidAdultActivationToken() : void {\n// grab an activation token that does not exist\n$profile = Adult::getAdultByAdultActivationToken($this->getPDO(), \"6675636b646f6e616c646472756d7066\");\n$this->assertNull($profile);\n}", "public function testExecuteWithException()\n {\n $exception = new \\Exception('test message');\n $this->createQuote();\n $this->negotiableQuoteManagement->expects($this->once())\n ->method('decline')->willThrowException($exception);\n $this->logger->expects($this->once())\n ->method('critical')\n ->with($exception);\n $this->messageManager->expects($this->any())->method('addError');\n $this->getRedirect();\n\n $this->assertInstanceOf(\\Magento\\Framework\\Controller\\ResultInterface::class, $this->decline->execute());\n }", "function testTBillPriceException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::TBillPrice(mktime(0, 0, 0, 6, 1, 2008), mktime(0, 0, 0, 3, 31, 2010), 0.09);\n\t}" ]
[ "0.6820131", "0.67768663", "0.6766147", "0.67593277", "0.6757242", "0.67557573", "0.6585012", "0.65822196", "0.657971", "0.64814454", "0.64608073", "0.6443251", "0.6433486", "0.64041495", "0.6399382", "0.63974535", "0.63873833", "0.63611245", "0.63611245", "0.6341694", "0.6338228", "0.63217777", "0.6321579", "0.6321322", "0.63194543", "0.6302475", "0.62876123", "0.6283446", "0.6279879", "0.6274382", "0.62709033", "0.6270888", "0.6249956", "0.62404406", "0.62308955", "0.62237656", "0.621748", "0.6214538", "0.6204925", "0.6200458", "0.61966866", "0.6192626", "0.6182543", "0.61755776", "0.61723346", "0.61649066", "0.61629945", "0.6160455", "0.6154186", "0.6149863", "0.61386156", "0.61353016", "0.6133735", "0.6132952", "0.6132487", "0.61318564", "0.61249834", "0.6107776", "0.61031264", "0.6092869", "0.6090141", "0.6087868", "0.60666585", "0.6059947", "0.6052214", "0.60503817", "0.60471207", "0.6045599", "0.60374975", "0.60197264", "0.60116905", "0.601068", "0.6005704", "0.60048866", "0.60025996", "0.6001767", "0.5981537", "0.598042", "0.5970461", "0.596323", "0.5962241", "0.59496915", "0.59490174", "0.5946216", "0.59440374", "0.59430695", "0.5941887", "0.59341156", "0.59308517", "0.5929482", "0.59248066", "0.59200215", "0.59195256", "0.5914912", "0.59102964", "0.59042186", "0.5903772", "0.5902334", "0.59021616", "0.5900385", "0.58980477" ]
0.0
-1
Display a listing of the resource.
public function getIndex() { //获取所有的数据 // $res =DB::table('user')->get(); //获取单条数据 // $res =DB::table('user')->where('uid','=','2')->first(); //插入数据 // $res =DB::table('user')->insert([ // 'username'=>'lijian' // ]); //更新数据 // $res =DB::table('user') // ->where('uid', 1) // ->update(['username' => 'liniuniu']); //删除数据 // $res =DB::table('user')->where('uid','=','3')->delete(); //查询单条结果的某个字段 // $res =DB::table('user')->where('uid','=','2')->value('username'); //查询指定结果集中的某一列 // $res =DB::table('user')->lists('uid'); // 连贯操作 // $res =DB::table('user')->select('username')->get(); $res =DB::table('user')->where('uid',2)->orWhere('uid',1)->get(); dd($res); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { $nombre = $request->user()->name; $coordi = DB::table('coordinador')->where('nombre',$nombre)->first(); $carreras = DB::table('carreras')->where('state','1')->get(); return view('admin/agregar_carrera_admin', compact('carreras','coordi')); }
{ "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) { $carrera = new Carreras(); $carrera->id = $request->input('clave'); $carrera->nombre = $request->input('nombre'); $carrera->save(); return redirect(action('CarrerasController@index'))->with('success','Carrea creada exitosamente'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "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(Request $request) { $id = $request->input('clave'); $carrera = Carreras::whereId($id)->firstOrFail(); $carrera->id = $request->input('clave'); $carrera->nombre = $request->input('nombre'); $carrera->save(); return redirect(action('CarrerasController@index'))->with('success','Carrea editada exitosamente'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Insertar los videos ya vostos
public function insertReproduccion(){ $query = "INSERT INTO reproduccion (videoVisto, Usuario_codUsuario, Video_codVideo) VALUES (true, ".parent::string($this->getUsuario_codUsuario()).", ".parent::string($this->getVideo_codVideo()).");"; $result = mysqli_query(parent::conexion(), $query); if($result){ $fila = mysqli_fetch_array($result); parent::desconectar(); return $fila; } else{ echo parent::conexion()->error; parent::desconectar(); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 1\",\n 'url' => \"http://localhost/geometryapi/public/files/Credenciales Digitales Geometry Global Colombia.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 2\",\n 'url' => \"http://localhost/geometryapi/public/files/Credenciales Geometry Global Colombia 2017.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 3\",\n 'url' => \"http://localhost/geometryapi/public/files/Credenciales Geometry Global Colombia.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 4\",\n 'url' => \"http://localhost/geometryapi/public/files/Presidente de Geometry Global destaca perfil de los publicistas internacionales de La Sergio.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 5\",\n 'url' => \"http://localhost/geometryapi/public/files/SEX GUARDIÁN realizado por Geometry Global.mp4\",\n ));\n }", "public function run()\n {\n DB::table('modification_videos')->insert([\n [\n 'id' => 1,\n 'title' => 'Inauguracja roku akademickiego na Politechnice Białostockiej',\n 'modification_id' => 2,\n 'url' => 'https://www.youtube.com/watch?v=JsaSUiswXCw',\n 'availability' => 1,\n 'uploader_id' => 1,\n 'created_at' => now(),\n ],\n [\n 'id' => 2,\n 'title' => 'Politechnika Białostocka - Oficjalny spot promocyjny (2014)',\n 'modification_id' => 2,\n 'url' => 'https://www.youtube.com/watch?v=iHikK_mU20c',\n 'availability' => 1,\n 'uploader_id' => 1,\n 'created_at' => now(),\n ],\n [\n 'id' => 3,\n 'title' => 'Politechnika Białostocka - Bialystok University of Technology (BUT)',\n 'modification_id' => 3,\n 'url' => 'https://www.youtube.com/watch?v=ypSodkZALoA',\n 'availability' => 1,\n 'uploader_id' => 1,\n 'created_at' => now(),\n ],\n ]);\n }", "function videoPlayed($IDcurso, $IDtema, $IDvideo, $IDusuario, $duracion, $segundo) {\n\tglobal $dbAn;\n\n\t//$dbAn->exec('INSERT INTO analytics (IDcurso, IDtema, IDvideo, IDusuario) VALUES ('.decrypt($IDcurso).','.decrypt($IDtema).','.decrypt($IDvideo).','.$IDusuario.')');\n\t$visto = 0;\n\tif ($duracion == $segundo) {\n\t\t$visto = 1;\n\t}\n\n\t$dbAn->exec('INSERT INTO analytics (IDcurso, IDtema, IDvideo, IDusuario, duracion, segundo, visto) VALUES ('.decrypt($IDcurso).','.decrypt($IDtema).','.decrypt($IDvideo).','.$IDusuario.', '.$duracion.', '.$segundo.', '.$visto.')');\n}", "public function run()\n {\n $video = [\n [\n 'id' => 1,\n 'source' => 'youtube',\n 'code' => 'zvziUZQCd-I',\n 'title' => 'iPhone 12中國銷量佳!華為出新機迎戰 躲禁令傳囤大量台積電晶片|非凡財經新聞|20201023',\n ],\n [\n 'id' => 2,\n 'source' => 'youtube',\n 'code' => 'A70caQprTO4',\n 'title' => '顧客轉買低價NB 英特爾Q3營收年減4% 盤後股價大跌近1成|非凡財經新聞|20201023',\n ],\n ];\n\n Video::insert($video);\n }", "public function run()\n {\n Video::create([\n 'id'=>1,\n 'titulo'=>'Pasaje, Cantón de tesoros escondidos',\n 'descripcion'=>'¿Nunca has sentido que te falta algo?. Todos llegamos a ese punto en el que necesitamos algo que nos haga conectar con una parte nueva de nosotros, que aún no conocíamos. Y Pasaje, es el lugar para encontrarlo.',\n 'url'=>'https://www.youtube.com/watch?v=unCVTkXNYUU&t',\n \n\n ]);\n\n \n }", "public function mostrarVideoController($datos)\n {\n $aleatorio = mt_rand(100, 999);\n $ruta = '../../views/videos/video' . $aleatorio . '.mp4';\n\n //permite subir cualquier tipo de archivo\n\n\n if (move_uploaded_file($datos, $ruta)) {\n //haciendo el insert desde el modelo de la ruta\n $respuesta = @GestorVideosModel::subirVideoModel($ruta, 'videos');\n if ($respuesta == 'ok') {\n //query que me devuelve con el url del video subido al server e insertado en la BD\n $respuesta2 = @GestorVideosModel::mostrarVideoModel($ruta, 'videos');\n $enviarDatos = $respuesta2['ruta'];\n echo $enviarDatos;\n } else {\n echo 'error';\n }\n } else {\n echo 'error';\n }\n }", "public function cargarVideosYaVistos(){\n $query = \"SELECT Video_codVideo FROM reproduccion WHERE Usuario_codUsuario = \".parent::string($this->getUsuario_codUsuario()).\" ORDER BY Video_codVideo ASC;\";\n $result = mysqli_query(parent::conexion(), $query);\n $arreglo = null;\n\n if(!$result){\n die(\"Error\");\n } else{\n while($data = mysqli_fetch_assoc($result)){\n $arreglo[] = $data;\n }\n }\n\n parent::desconectar();\n return json_encode($arreglo);\n }", "public function run()\n {\n DB::table('media')->insert([\n \t[\n 'id'=>'208',\n \t\t'type'=>'1', //1 ảnh; 2 video\n \t\t'url'=>'1607063792980user.jpg',\n \t\t'user_id'=> 2,\n \t],\n \t[\n 'id'=>'207',\n \t\t'type'=>'1', //1 ảnh; 2 video\n \t\t'url'=>'1607063792980user.jpg',\n \t\t'user_id'=> 4,\n \t],\n \t[\n 'id'=>'206',\n \t\t'type'=>'2', //1 ảnh; 2 video\n \t\t'url'=>'1607063792980user.jpg',\n \t\t'user_id'=> 3,\n \t],\n \t[\n 'id'=>'205',\n \t\t'type'=>'2', //1 ảnh; 2 video\n \t\t'url'=>'1607063792980user.jpg',\n \t\t'user_id'=> 2,\n \t],\n ]);\n }", "public function lecteurVideoAction($ListeDesVideos){\n\t\n\t\t$html ='<script>\n\t\t\t\t var tab = [];\n\t\t </script>';\n\t\t$i = 0;\n\t\tforeach ($ListeDesVideos as $Liste) {\n\t\t\t\t\n\t\t\tif($Liste['format'] == \"video/mp4\" || $Liste['format'] == \"video/m4v\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .' <span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"m4v\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t\telse\n\t\t\tif($Liste['format'] == \"video/webm\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .'<span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"webmv\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\t \n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t}\n\t\n\t\t$html .='<script>\n\t\t\t\t $(document).ready(function(){\n\t\n\t new jPlayerPlaylist({\n\t\t jPlayer: \"#jquery_jplayer_1\",\n\t\t cssSelectorAncestor: \"#jp_container_1\"\n\t },\n\t\t\t\t tab\n\t\t\t\t ,{\n\t\t swfPath: \"../../dist/jplayer\",\n\t\t supplied: \"webmv, ogv, m4v\",\n\t\t useStateClassSkin: true,\n\t\t autoBlur: false,\n\t\t smoothPlayBar: true,\n\t\t keyEnabled: true\n\t });\n\t\n });\n\t\n\t\t\t\tscriptAjoutVideo();\n\t\t </script>';\n\t\t\t\n\t\t$html .='\n\t\n\t\t<form id=\"my_form_video\" method=\"post\" action=\"/simens/public/consultation/ajouter-video\" enctype=\"multipart/form-data\">\n\t\t<div id=\"jp_container_1\" class=\"jp-video jp-video-270p\" role=\"application\" aria-label=\"media player\" style=\"margin: auto;\">\n\t <div class=\"jp-type-playlist\">\n\t\t<div id=\"jquery_jplayer_1\" class=\"jp-jplayer\"></div>\n\t\t<div class=\"jp-gui\">\n\t\t\t<div class=\"jp-video-play\">\n\t\t\t\t<button class=\"jp-video-play-icon\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t</div>\n\t\t\t<div class=\"jp-interface\">\n\t\t\t\t<div class=\"jp-progress\">\n\t\t\t\t\t<div class=\"jp-seek-bar\">\n\t\t\t\t\t\t<div class=\"jp-play-bar\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-current-time\" role=\"timer\" aria-label=\"time\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-duration\" role=\"timer\" aria-label=\"duration\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-controls-holder\">\n\t\t\t\t\t<div class=\"jp-controls\">\n\t\t\t\t\t\t<button class=\"jp-previous\" role=\"button\" tabindex=\"0\">previous</button>\n\t\t\t\t\t\t<button class=\"jp-play\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t\t\t\t<button class=\"jp-next\" role=\"button\" tabindex=\"0\">next</button>\n\t\t\t\t\t\t<button class=\"jp-stop\" role=\"button\" tabindex=\"0\">stop</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-volume-controls\">\n\t\t\t\t\t\t<button class=\"jp-mute\" role=\"button\" tabindex=\"0\">mute</button>\n\t\t\t\t\t\t<button class=\"jp-volume-max\" role=\"button\" tabindex=\"0\">max volume</button>\n\t\t\t\t\t\t<div class=\"jp-volume-bar\">\n\t\t\t\t\t\t\t<div class=\"jp-volume-bar-value\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-toggles\">\n\t\t\t\t\t\t<button class=\"jp-full-screen\" role=\"button\" tabindex=\"0\">full screen</button>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t <div class=\"jp-toggles2\" id=\"jp-toggles-video\" >\n\t\t\t\t <div class=\"jp-ajouter-video\">\n\t\t\t\t <input type=\"file\" name=\"fichier-video\" id=\"fichier-video\">\n\t\t\t\t </div>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-details\">\n\t\t\t\t\t<div class=\"jp-title\" aria-label=\"title\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jp-playlist\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;</li>\n\t\t\t</ul>\n\t\t</div>\n\t </div>\n </div>\n\t\t</form>';\n\t\treturn $html;\n\t}", "public function run()\n {\n DB::unprepared(file_get_contents(__DIR__ . './../dumps/videos.sql'));\n // $data = [];\n\n // for ($i = 0; $i < 200; $i++) {\n // array_push($data, [\n // 'check_id' => rand(1, 4),\n // 'cam_numeric_id' => rand(1, 50),\n // 'uik_id' => rand(1, 50),\n // 'start_local_datetime' => RandomDateHelper(),\n // 'end_local_datetime' => RandomDateHelper(),\n // ]);\n // }\n\n // Video::insert($data);\n // Video::insert([\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 1,\n // 'uik_id' => 1,\n // 'start_epoch' => 1536498200,\n // 'end_epoch' => 1536498900,\n // 'length' => 700,\n // 'start_local_datetime' => '2021-05-11 00:27:31',\n // 'end_local_datetime' => '2021-05-12 15:27:31',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => true,\n // 'processed_by_api_counting' => false,\n // ],\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 1,\n // 'uik_id' => 1,\n // 'start_epoch' => 1536498900,\n // 'end_epoch' => 1536499650,\n // 'length' => 750,\n // 'start_local_datetime' => '2021-05-11 00:27:31',\n // 'end_local_datetime' => '2021-05-11 00:27:31',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => false,\n // 'processed_by_api_counting' => false,\n // ],\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 1,\n // 'uik_id' => 1,\n // 'start_epoch' => 1536499650,\n // 'end_epoch' => 1536500450,\n // 'length' => 800,\n // 'start_local_datetime' => '2021-05-11 00:27:31',\n // 'end_local_datetime' => '2021-05-11 00:27:31',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => false,\n // 'processed_by_api_counting' => false,\n // ],\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 1,\n // 'uik_id' => 1,\n // 'start_epoch' => 1536500450,\n // 'end_epoch' => 1536501250,\n // 'length' => 800,\n // 'start_local_datetime' => '2021-05-11 00:27:31',\n // 'end_local_datetime' => '2018-09-09 13:54:10',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => false,\n // 'processed_by_api_counting' => false,\n // ],\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 1,\n // 'uik_id' => 1,\n // 'start_epoch' => 1536501250,\n // 'end_epoch' => 1536502150,\n // 'length' => 900,\n // 'start_local_datetime' => '2018-09-09 13:54:10',\n // 'end_local_datetime' => '2018-09-09 14:09:10',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => false,\n // 'processed_by_api_counting' => false,\n // ],\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 3,\n // 'uik_id' => 2,\n // 'start_epoch' => 1536498900,\n // 'end_epoch' => 1536499650,\n // 'length' => 750,\n // 'start_local_datetime' => '2018-09-09 13:15:00',\n // 'end_local_datetime' => '2021-05-11 00:27:31',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => false,\n // 'processed_by_api_counting' => false,\n // ],\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 4,\n // 'uik_id' => 2,\n // 'start_epoch' => 1536499650,\n // 'end_epoch' => 1536500450,\n // 'length' => 800,\n // 'start_local_datetime' => '2021-05-11 00:27:31',\n // 'end_local_datetime' => '2021-05-11 00:27:31',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => false,\n // 'processed_by_api_counting' => false,\n // ],\n // [\n // 'check_id' => 1,\n // 'direct_link' => 'carta.proverim.webcam/2020-09/B59K3265A0001H02/12242008-2403-01aa-aaaa-d8af81404fec-main_1599984817.92_1599985792.92.ts',\n // 'cam_numeric_id' => 4,\n // 'uik_id' => 2,\n // 'start_epoch' => 1536500450,\n // 'end_epoch' => 1536501250,\n // 'length' => 800,\n // 'start_local_datetime' => '2021-05-11 00:27:31',\n // 'end_local_datetime' => '2018-09-09 13:54:10',\n // 'storage_server_id' => 1,\n // 'processed_by_api_boxes' => false,\n // 'processed_by_api_counting' => false,\n // ],\n // ]);\n }", "function insertVideo() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $auth = $this->getAuthorization();\n $video = json_decode($_POST['json'], true);\n\t $userId = $video['user_id'];\n\n if (!$this->validateAuthorization($userId, $auth)) {\n $this->response('', 406);\n }\n\n if (!isset($_FILES['upfile']['error']) || is_array($_FILES['upfile']['error'])) {\n $this->response(json_encode(array(\"Error\" => 'Invalid parameters')), 400);\n }\n\n // You should also check filesize here. \n if ($_FILES['upfile']['size'] > 100000000000) {\n $this->response(json_encode(array(\"Error\" => 'Exceeded filesize limit.')), 400);\n }\n \n $videoFileType = pathinfo($_FILES['upfile']['name'],PATHINFO_EXTENSION);\n \n if (!in_array($videoFileType, array(\"mp4\", \"wmv\"))) {\n $this->response(json_encode(array(\"Error\" => \"Invalid file format.\")), 400);\n }\n\n $filePath = '../video/' . $_FILES['upfile']['name'];\n\n if ($_FILES['upfile']['name'] == \"\" or file_exists($filePath) ) {\n $this->response(json_encode(array(\"Error\" => $_FILES['upfile']['name'])), 400);\n }\n \n if (!move_uploaded_file($_FILES['upfile']['tmp_name'], $filePath)) {\n $this->response(json_encode(array(\"Error\" => \"Failed to move uploaded file.\")), 400);\n }\n\n $video['path_of_video'] = $filePath;\n $columns = 'user_id, title, description, path_of_video';\n $values = $userId . ',\\'' . $video['title'] . '\\',\\'' . $video['description'] . '\\',\\'' . $video['path_of_video'] . \"'\";\n $query = \"insert into videos(\". $columns . \") VALUES(\". $values . \");\";\n\t error_log($query);\n \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Video Posted.\", \"data\" => $video);\n $this->response(json_encode($success),200);\n }", "static function getArregloVideos($text) {\n $videoArray = explode('http://www.youtube.com/watch?v=', $text);\n\n //Se realiza este proceso para descartar posiciones del arreglo sin contenido\n foreach ($videoArray as $video) {\n if ($video) {\n $video = explode('&', $video); //Elimina cualquier parametro adicional en la URL\n $videos[] = '<iframe width=\"560\" height=\"349\" src=\"http://www.youtube.com/embed/' . $video[0] . '?rel=0\" frameborder=\"0\" allowfullscreen></iframe>';\n }\n }\n return $videos;\n }", "public function run()\n {\n \n\n \\DB::table('contents')->delete();\n \n \\DB::table('contents')->insert(array (\n 0 => \n array (\n 'id' => 3,\n 'title' => 'TT1',\n 'path' => 'uploads/services/videos/5a421695a6010.mp4',\n 'type_id' => 1,\n 'user_id' => 1,\n 'created_at' => '2017-12-25 13:39:50',\n 'updated_at' => '2017-12-26 09:30:18',\n 'prev_img' => 'uploads/services/images/5a4216aa9633f.jpg',\n 'content_type' => 1,\n ),\n 1 => \n array (\n 'id' => 5,\n 'title' => 'TT3see',\n 'path' => 'https://www.youtube.com/embed/LQxt8HD7ziA',\n 'type_id' => 1,\n 'user_id' => 1,\n 'created_at' => '2017-12-26 07:32:18',\n 'updated_at' => '2017-12-26 09:27:29',\n 'prev_img' => 'http://qnimate.com/wp-content/uploads/2014/03/images2.jpg',\n 'content_type' => 2,\n ),\n 2 => \n array (\n 'id' => 6,\n 'title' => 'TT4',\n 'path' => 'uploads/services/videos/5a421695a6010.mp4',\n 'type_id' => 1,\n 'user_id' => 1,\n 'created_at' => '2017-12-26 07:33:47',\n 'updated_at' => '2017-12-26 09:34:05',\n 'prev_img' => 'uploads/services/images/5a4216aa9633f.jpg',\n 'content_type' => 1,\n ),\n 3 => \n array (\n 'id' => 10,\n 'title' => 'TT9',\n 'path' => 'uploads/services/images/5a421c0e9b25a.JPG',\n 'type_id' => 3,\n 'user_id' => 1,\n 'created_at' => '2017-12-26 07:40:28',\n 'updated_at' => '2017-12-26 09:53:18',\n 'prev_img' => 'NULL',\n 'content_type' => 1,\n ),\n 4 => \n array (\n 'id' => 11,\n 'title' => 'Greetings',\n 'path' => 'https://www.w3schools.com/w3css/img_forest.jpg',\n 'type_id' => 3,\n 'user_id' => 1,\n 'created_at' => '2017-12-26 07:40:47',\n 'updated_at' => '2017-12-26 09:55:59',\n 'prev_img' => 'NULL',\n 'content_type' => 2,\n ),\n 5 => \n array (\n 'id' => 13,\n 'title' => 'Egypt',\n 'path' => 'http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3',\n 'type_id' => 2,\n 'user_id' => 1,\n 'created_at' => '2017-12-26 09:36:23',\n 'updated_at' => '2017-12-26 09:40:58',\n 'prev_img' => 'NULL',\n 'content_type' => 2,\n ),\n 6 => \n array (\n 'id' => 14,\n 'title' => 'ElGYYPT',\n 'path' => 'http://www.samisite.com/sound/cropShadesofGrayMonkees.mp3',\n 'type_id' => 2,\n 'user_id' => 1,\n 'created_at' => '2017-12-26 09:45:44',\n 'updated_at' => '2017-12-26 09:48:37',\n 'prev_img' => 'NULL',\n 'content_type' => 2,\n ),\n 7 => \n array (\n 'id' => 15,\n 'title' => 'test audio',\n 'path' => 'uploads/services/audios/5a49efa59e0d7.wav',\n 'type_id' => 2,\n 'user_id' => 1,\n 'created_at' => '2018-01-01 08:21:57',\n 'updated_at' => '2018-01-01 08:21:57',\n 'prev_img' => 'NULL',\n 'content_type' => 1,\n ),\n ));\n \n \n }", "public function insert_video($arr_data){\n\n\t\treturn $this->db->insert($this->_table,$arr_data);\n\n\t}", "public function mostrarVideoVistaController()\n {\n //llamando al modelo\n $respuesta = @GestorVideosModel::mostrarVideoVistaModel(\"videos\");\n\n foreach ($respuesta as $dato) {\n echo '<li id=\"' . $dato['id'] . '\" ruta=\"' . $dato['ruta'] . '\" class=\"bloqueVideo\">\n <span class=\"fa fa-times eliminarVideo\"></span>\n <video controls class=\"handleVideo\">\n <source src=\"' . substr($dato['ruta'], 6) . '\" type=\"video/mp4\">\n </video>\n </li>';\n }\n\n }", "public function videoconferenciaBajarVolumen( ) {\n $this->bajarVolumen();\n //$this->setComando(\"BAJAR_VOLUMEN\");\n }", "public function createVideo();", "public function insertVideoContainers( $data,$contentId ){\n\t\tSWPLogManager::log(\"Insert video container\",array(\"data\"=>$data, \"Content id\"=>$contentId),TLogger::INFO,$this,\"insertVideoContainers\",\"SWP\");\n\t\t$conn = $this->getDbConnection();\n\t\t$conn->setActive(true);\n\t\t\n\t\t$cmd = $conn->createCommand(\"SELECT `container_id`\n\t\t\t FROM `videos_containers`\n\t\t\t WHERE `video_id` = \".$data['content_id'].\"\");\n\n\t\t$dataReader=$cmd->query(); \n\t\t$rows=$dataReader->readAll();\n\n\n\t\tfor( $i=0;$i<count($rows);$i++ ){\n\t\t\t\n\t\t\t$cmd = $conn->createCommand(\"SET FOREIGN_KEY_CHECKS = 0;\");\n\n\t\t\t$cmd->execute();\n\n\t\t\t$cmd = $conn->createCommand(\"INSERT INTO `videos_containers` (`video_id`,`container_id`) VALUES ('\".$contentId.\"','\".$rows[$i]['container_id'].\"')\");\n\n\t\t\t$cmd->execute();\t\n\t\t}\n\t}", "public function addVideo($title, $vID, $sID=\"vimSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $type=\"Generic\", $thumb=\"tn\", $frame=\"fr-img\", $ro_dir=\"Director\", $ro_dp=\"DP\", $ro_cam=\"Camera\", $ro_ed=\"Editor\", $desc=\"Long description\"){\n $this->videoList[] = new cShowcaseVideo($title, $vID, $sID, $hdID, $sdID, $mobileID, $type, $thumb, $frame, $ro_dir, $ro_dp, $ro_cam, $ro_ed, $desc);\n }", "public function run()\n {\n $variabel = json_decode(file_get_contents(public_path() .'/video.json'));\n \n foreach ($variabel as $item) {\n $response = TransformerVideo::makeSeed($item->judul, $item->link);\n Video::create($response);\n }\n \n }", "function linkVideo(){\n \n $vid = uniqid();\n $ar = array('id' => $vid, 'web_id' => WEB_ID, 'video_url' => $_POST['vurl'], 'video_name' => $_POST['name'], 'video_disc' => $_POST['disc'], 'type' => 'YouTube', 'category'=>$_POST['cats']);\n \n $this->db->insert('video_library', $ar);\n \n \n }", "function videosLoad(){\n\n if ($handle = opendir('videos')) {\nglobal $dom, $id, $n;\n /* This is the correct way to loop over the directory. */\n while (false !== ($entry = readdir($handle))) {\n /*Video tag*/\n$video = $dom->createElement('video');\n$vattr = $dom->createAttribute('id');\n$vattr->value = $entry.$n;\n$video->appendChild($vattr);\n$vattr= $dom->createAttribute('class');\n$vattr->value = 'video-js vjs-default-skin';\n$video->appendChild($vattr);\n$vattr = $dom->createAttribute('controls');\n$video->appendChild($vattr);\n$vattr = $dom->createAttribute('preload');\n$vattr->value = 'auto';\n$video->appendChild($vattr);\n$vattr = $dom->createAttribute('width');\n$vattr->value='640';\n$video->appendChild($vattr);\n$vattr = $dom->createAttribute('height');\n$vattr->value='264';\n$video->appendChild($vattr);\n$vattr = $dom->createAttribute('data-setup');\n$vattr->value = \"{ 'controls': true, 'autoplay':false, 'prelaod': 'auto'}\";\n$video->appendChild($vattr);\n/*source tags*/\n$source = $dom->createElement('source');\n$sattr = $dom->createAttribute('src');\n$sattr->value= $entry;\n$source->appendChild($sattr);\n$sattr = $dom->createAttribute('type');\n$sattr->value= 'video/mp4';\n$source->appendChild($sattr);\n/*script tags:: May not need it\n$script = $dom->createElement('script');\n$script->createAtrribute('type');\n$script->value = \"text/javascript\";\n$script->appendChild(\"var vObj =\ndocument.getElementById(\"example_video_\"'.$n');\ndocument.getElementById(\"vidoes\").appenedChild(vObj);\");\n*/\n$video->appendChild($source);\n$id->appendChild($video);\n$dom->saveHTML();\n//echo '<script> document.appendChild($id);</script>';\n\n\n\n \n\n /* echo $entry;*/\n/*echo '<video id=\"example_video_\" class=\"video-js vjs-default-skin\" controls preload=\"auto\" width=\"640\" height=\"264\" data-setup=\"{}\"> <source src=\"$entry\" type=\"video/mp4\"/> </video>';\n <script type=\"text/javascript\">\n var vObj = document.getElementById(\"example_video_\".$n);\n document.getElementById(\"vidoes\").appenedChild(vObj);\n </script>';\n */\n }\n\n /* This is the WRONG way to loop over the directory.\n while ($entry = readdir($handle)) {\n echo \"$entry\\n\";\n }\n */\n closedir($handle);\n }\n}", "public function get_content_file_video(){\r\n\t\t$path = storage_path().'/data_video/';\r\n\t\t$dir = scandir($path);\r\n\t\tforeach ($dir as $key => $value) {\r\n\t\t\tif(preg_match(\"/\\.json$/\",$value)){\r\n\t\t\t\t$data = (json_decode(file_get_contents($path.$value)));\r\n\t\t\t\tforeach ($data as $key2 => $value2) {\r\n\t\t\t\t\tforeach ($value2->items as $key3 => $value3) {\r\n\t\t\t\t\t\t$params[$key3][\"videoId\"] = $value3->snippet->resourceId->videoId;\r\n\t\t\t\t\t\t$params[$key3][\"title\"] = $value3->snippet->title;\r\n\t\t\t\t\t\t$params[$key3][\"description\"] = $value3->snippet->description;\r\n\t\t\t\t\t\t$params[\"keywords\"] = str_replace(\".json\", \"\", $value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->save_video_by_array($params);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function media_upload_video()\n {\n }", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function PaginacionVideos()\n\t{\n\t\t$items_per_page = Input::get('can');\n\t\t$ordenar_items = Input::get('orde');\n\t\t$forma_orden = Input::get('por');\n\t\t$campos = array('id', 'title', 'videourl','rate','times_viewed','thumburl');\n $config = ConfigApp::First()->get();\n \n $items = Video::where('published', '=', 1)->where('memberid', '=', $config[0][\"UserJoomla\"])->where('filepath', '!=', 'File')->orderBy($ordenar_items, $forma_orden)->select($campos)->paginate($items_per_page);\n if ($items->isEmpty()) {\n\t\t echo '<div class=\"box-content\"><legend id=\"uniq\" class=\"alert alert-info\">No hay videos para visualizar</legend></div>';\n\t\t exit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$view = View::make('pages.video.items')->with('items', $items);\n\t\t echo $view;\n\t\t exit;\n\t\t}\n\t}", "function videos() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n if ($id > 0) {\n $query = \"select * from videos where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n\n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }", "function savevideos($task)\n\t{\n\t\tglobal $option,$mainframe;\n\t\t$db = JFactory::getDBO();\n\t\t$userTypeRedirect = (JRequest::getVar('user', '', 'get') == 'admin') ? \"&user=\" . JRequest::getVar('user', '', 'get') : \"\";\n\t\t## To get an instance of the adminvideos table object\n\t\t$rs_saveupload = JTable::getInstance('adminvideos', 'Table');\n\t\t$arrCatId = JRequest::getVar('cid', array(0), '', 'array');\n\t\t$strCatId = $arrCatId[0];\n\t\t$rs_saveupload->load($strCatId);\n $createddate = date(\"Y-m-d h:m:s\");\n\n\t\t## variable initialization\n\t\t$arrFormData = JRequest::get('post');\n $embedcode = JRequest::getVar('embedcode', '', 'post', 'string', JREQUEST_ALLOWRAW);\n\t\t$arrFormData['embedcode']=$embedcode;\n\t\t$fileoption = $arrFormData['fileoption'];\n\t\t$seoTitle = trim($arrFormData['title']);\n $titlequery = \"SELECT count(id) FROM #__hdflv_upload where title='$seoTitle'\";\n $db->setQuery($titlequery);\n $total_title = $db->loadResult();\n if(!empty($total_title) || $total_title>0){\n $seoTitle = $seoTitle.rand();\n }\n $seoTitle = str_replace(\"+\",\"\",$seoTitle);\n $seoTitle = stripslashes($seoTitle);\n $seoTitle = strtolower($seoTitle);\n\t\t$seoTitle = preg_replace('/[&:\\s]+/i', '-', $seoTitle);\n\t\t$arrFormData['seotitle'] = preg_replace('/[#!@$%^.,:;\\/&*(){}\\\"\\'\\[\\]<>|?]+/i', '', $seoTitle);\n\t\t$arrFormData['seotitle'] = preg_replace('/---|--+/i', '-', $arrFormData['seotitle']);\n\t\t$description = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);\n\t\t$arrFormData['description'] = $description;\n\n\t\t## object to bind to the instance\n\t\tif (!$rs_saveupload->bind($arrFormData))\n\t\t{\n\t\t\tJError::raiseWarning( 500, $rs_saveupload->getError() );\n\t\t}\n\n\t\t## get and assign video url\n\t\tif (isset($rs_saveupload->videourl))\n\t\t{\n\t\t\tif ($rs_saveupload->videourl != \"\")\n\t\t\t{\n\t\t\t\t$rs_saveupload->videourl = trim($rs_saveupload->videourl);\n\t\t\t}\n\t\t}\n\n\t\t## Inserts a new row if id is zero or updates an existing row in the hdflv_upload table\n\t\tif (!$rs_saveupload->store())\n\t\t{\n\t\t\tJError::raiseWarning( 500, $rs_saveupload->getError() );\n\t\t}\n\n\t\t## check in the item\n\t\t$rs_saveupload->checkin();\n\t\t$idval = $rs_saveupload->id;\n\n\t\t## uploading videos type : URL\n\t\tif ($fileoption == 'Url'){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadurl.php');\n\t\t\tuploadUrlHelper::uploadUrl($arrFormData,$idval);\n\t\t}\n\n\t\t## uploading videos type : YOUTUBE\n\t\tif ($fileoption == \"Youtube\"){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadyoutube.php');\n\t\t\tuploadYouTubeHelper::uploadYouTube($arrFormData,$idval);\n\t\t}\n\t\t## uploading videos type : Embed\n\t\tif ($fileoption == \"Embed\"){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadembed.php');\n\t\t\tuploadEmbedHelper::uploadEmbed($arrFormData,$idval);\n\t\t}\n\n\t\t/**\n\t\t * uploading videos\n\t\t * type : FILE\n\t\t */\n\n\t\tif ($arrFormData['fileoption'] == \"File\"){\n\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadfile.php');\n\t\tuploadFileHelper::uploadFile($arrFormData,$idval);\n\t\t}\n\n\t\t## uploading videos type : FFMPEG\n\t\tif ($fileoption == \"FFmpeg\"){\n\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadffmpeg.php');\n\t\tuploadFfmpegHelper::uploadFfmpeg($arrFormData,$idval);\n\t\t}\n\t\t$catid = JRequest::getVar('playlistid');\n ## query to update created date\n $query = \"UPDATE #__hdflv_upload SET created_date='$createddate' where id=$idval\";\n $db->setQuery($query);\n $db->query();\n ## query to find the existing of category for video\n $query = \"SELECT count(vid) FROM #__hdflv_video_category where vid=$idval\";\n $db->setQuery($query);\n $total = $db->loadResult();\n if ($total != 0) {\n $query = \"UPDATE #__hdflv_video_category SET catid= '$catid' WHERE vid=$idval\";\n } else {\n $query = \"INSERT INTO #__hdflv_video_category values ('$idval','$catid')\";\n }\n\n $db->setQuery($query);\n $db->query();\n switch ($task) {\n case 'applyvideos':\n $link = 'index.php?option=' . $option . '&layout=adminvideos&task=editvideos' . $userTypeRedirect . '&cid[]=' . $rs_saveupload->id;\n break;\n case 'savevideoupload':\n default:\n $link = 'index.php?option=' . $option . '&layout=adminvideos' . $userTypeRedirect;\n break;\n }\n $msg = 'Saved Successfully';\n ## set to redirect\n $mainframe->redirect($link, $msg);\n\t}", "function add_videos_meta_box() {\n \tadd_meta_box(\n \t\t'y_link', // $id\n \t\t'ID Video', // $title\n \t\t'display_video_fields_meta_box', // $callback\n \t\t'videos', // $screen\n \t\t'normal', // $context\n \t\t'high' // $priority\n \t);\n }", "public function insertarVideojuego($foto)\n {\n if ($foto['name'] != \"\") {\n $ruta = subirFoto($foto, $this->carpeta);\n\n $this->setImagen($ruta);\n }\n DAOVideojuegos::getInstance()->insertarVideojuego($this);\n }", "public function run()\n {\n $faker = Faker::create();\n $url = [\n 'https://www.youtube.com/watch?v=TIhton7vyFc&list=PLYp_Kd32XvcqW5GIocnA-M3DKUK6_7aDa&index=54',\n 'https://www.youtube.com/watch?v=lZ-Bdm4HnvE',\n 'https://www.youtube.com/watch?v=IEIa9U1ecKM',\n 'https://www.youtube.com/watch?v=nNK4es84vxI',\n 'https://www.youtube.com/watch?v=_nkexHzMPGs',\n 'https://www.youtube.com/watch?v=d_7hffmTZoo',\n 'https://www.youtube.com/watch?v=_LymQaT7KFs',\n 'https://www.youtube.com/watch?v=Wak0ZFnZB98',\n ];\n\n $image = [\n '1600862736.jpg',\n '1600862608.jpg',\n '1601174598.jpg',\n ];\n\n $idTags=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19];\n\n for($i =0 ;$i <20 ;$i++)\n {\n $array=[\n 'name'=>$faker->name,\n 'url'=>$url[rand(0,7)],\n 'desc'=>$faker->word,\n 'status'=>rand(0,1),\n 'image'=>$image[rand(0,2)],\n 'muslim_id'=>rand(1,20),\n 'cat_id'=>rand(1,20),\n 'meta_key'=>$faker->word,\n 'meta_desc'=>$faker->word,\n ];\n $video=Video::create($array);\n\n $tags = $video->tags()->sync(array_rand($idTags));\n }\n }", "function visualizzaFotoVideo($dati)\n {\n foreach($dati as $media)\n {\n $contenuto = '<li>';\n\n if ($media->type === 'video')\n {\n $poster = $media->images->low_resolution->url;\n $source = $media->videos->standard_resolution->url;\n $contenuto .= \"<video class='media video-js vjs-default-skin' width='250' height='250' poster='{$poster}' data-setup='{'controls':true, 'preload': 'auto'}'><source src='{$source}' type='video/mp4' /></video>\";\n }\n else\n {\n $image = $media->images->low_resolution->url;\n $contenuto .= \"<img class='media' src='{$image}'/>\";\n }\n\n $avatar = $media->user->profile_picture;\n $username = $media->user->username;\n $commento = $media->caption->text;\n $contenuto .= \"<div class='content'><div class='avatar' style='background-image: url({$avatar})'></div><p>{$username}</p><div class='comment'>{$commento}</div></div>\";\n\n echo $contenuto . '</li>';\n }\n }", "function sp_add_video ($url, $width = 620, $height = 349) {\n\t\n\t$video_url = @parse_url($url);\n\n\tif ( $video_url['host'] == 'www.youtube.com' || $video_url['host'] == 'youtube.com' ) {\n\t\tparse_str( @parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );\n\t\t$video = $my_array_of_vars['v'] ;\n\t\t$output .='<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$video.'?rel=0\" frameborder=\"0\" allowfullscreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.youtu.be' || $video_url['host'] == 'youtu.be' ){\n\t\t$video = substr(@parse_url($url, PHP_URL_PATH), 1);\n\t\t$output .='<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$video.'?rel=0\" frameborder=\"0\" allowfullscreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.vimeo.com' || $video_url['host'] == 'vimeo.com' ){\n\t\t$video = (int) substr(@parse_url($url, PHP_URL_PATH), 1);\n\t\t$output .='<iframe src=\"http://player.vimeo.com/video/'.$video.'\" width=\"'.$width.'\" height=\"'.$height.'\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.dailymotion.com' || $video_url['host'] == 'dailymotion.com' ){\n\t\t$video = substr(@parse_url($url, PHP_URL_PATH), 7);\n\t\t$video_id = strtok($video, '_');\n\t\t$output .='<iframe frameborder=\"0\" width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.dailymotion.com/embed/video/'.$video_id.'\"></iframe>';\n\t}\n\t\n\treturn $output;\n}", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "public function Videos(){\n if(!isset($_SESSION[\"oturum\"])){\n header(\"location: \" . URL . \"login\" );\n }\n\n //Model Connections\n $movies = $this->model('Movie');\n $categories = $this->model('Categories');\n\n //Load data from model to views.\n $getVideos = $movies->getAllVideos();\n $getCategories = $categories->getAllCat();\n\n //Load views\n require VIEW_PATH . \"templates/header-yonetim.php\";\n require VIEW_PATH . \"videos/index.php\";\n require VIEW_PATH . \"templates/footer-yonetim.php\";\n }", "function getVideos($url, $width, $height, $config) {\r\n \t$video = '';\r\n\r\n\t\t$url = trim($url);\r\n\t\t$url = str_replace('http://', '', $url);\r\n\r\n // youtube\r\n if (strpos($url,'outube.com')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.youtube.com/v/'.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // Dailymotion\r\n } elseif (strpos($url,'ailymotion.co')) {\r\n $found = 1;\r\n $video = 'new SWFObject(\"http://'.$url.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // video.google.com/.de\r\n } elseif (strpos($url,'ideo.google.')) {\r\n $found = 1; \r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://video.google.com/googleplayer.swf?docId='.$split[1].'&hl='.$GLOBALS['TSFE']->lang.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // Metacafe\r\n } elseif (strpos($url,'metacafe.')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.metacafe.com/fplayer/'.$split[2].'/.swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // MyVideo.de\r\n } elseif (strpos($url,'yvideo.de')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.myvideo.de/movie/'.$split[2].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // clipfish.de\r\n\t\t} elseif (strpos($url,'lipfish.de')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.clipfish.de/videoplayer.swf?as=0&videoid='.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n\t\t// sevenload\r\n\t\t} elseif (strpos($url,'sevenload.com')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://de.sevenload.com/pl/'.$split[2].'/'.$width.'x'.$height.'/swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n } \r\n\r\n\t\treturn $video;\r\n\t}", "public function addVideo($title,$videoID,$streamID=\"vimeoSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $thumb=\"thumbnail\", $frame=\"image-frame\"){\n $this->videoList[] = new cVideo($title,$videoID,$streamID,$hdID,$sdID,$mobileID,$thumb,$frame);\n }", "public function run()\n {\n \n\n \\DB::table('media')->delete();\n \n \\DB::table('media')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'content' => '/storage/media/QLvvG8306cMFxUQbx5MWVfGpBJRS0SZ55JesxrRa.png',\n 'created_at' => '2018-11-29 09:31:15',\n 'updated_at' => '2018-11-29 09:31:15',\n ),\n 1 => \n array (\n 'id' => 2,\n 'content' => '/storage/media/a8U9pSSEiWD0Y6wmqS8PkHWVBaGqQlH29dkzpogi.jpeg',\n 'created_at' => '2018-11-29 09:55:20',\n 'updated_at' => '2018-11-29 09:55:20',\n ),\n 2 => \n array (\n 'id' => 3,\n 'content' => '/storage/media/G7r7noAfsbBTsA65CWcib70ZGYF15OfO2EwbCRNV.jpeg',\n 'created_at' => '2018-11-29 09:57:09',\n 'updated_at' => '2018-11-29 09:57:09',\n ),\n 3 => \n array (\n 'id' => 4,\n 'content' => '/storage/media/935XYRCohqQfuMZaPlf0Yyjc2T2Ew8LUiLOjWahR.pdf',\n 'created_at' => '2018-11-29 11:18:16',\n 'updated_at' => '2018-11-29 11:18:16',\n ),\n 4 => \n array (\n 'id' => 5,\n 'content' => '/storage/media/zptj2e3q976GUQmUHCEc1RDUocm7DvCPGpzNXzxU.zip',\n 'created_at' => '2018-11-29 12:56:58',\n 'updated_at' => '2018-11-29 12:56:58',\n ),\n 5 => \n array (\n 'id' => 6,\n 'content' => '/storage/media/vdzn5V84Yq77U9crcX7pclKGWtjV7uN9bRx97YHy.zip',\n 'created_at' => '2018-11-29 13:02:34',\n 'updated_at' => '2018-11-29 13:02:34',\n ),\n 6 => \n array (\n 'id' => 7,\n 'content' => '/storage/media/8cVFNoEkMAU9wvYGSI2Hp0gVzcmfFDb8gimhdw1E.pdf',\n 'created_at' => '2018-11-29 13:28:22',\n 'updated_at' => '2018-11-29 13:28:22',\n ),\n 7 => \n array (\n 'id' => 8,\n 'content' => '/storage/media/wBNiknogUrfBgc3cVZc7eJkCNUZZgXa1ylasyJhY.pdf',\n 'created_at' => '2018-11-29 13:36:33',\n 'updated_at' => '2018-11-29 13:36:33',\n ),\n 8 => \n array (\n 'id' => 9,\n 'content' => '/storage/media/eMhuk6sPym9bN4KXk9BuHkTxY5CWrucmaj3s4RXH.pdf',\n 'created_at' => '2018-11-29 13:44:01',\n 'updated_at' => '2018-11-29 13:44:01',\n ),\n 9 => \n array (\n 'id' => 10,\n 'content' => '/storage/media/SsqAov7R4Awb4EJdxESwaZINn015ncjByp63U1iK.pdf',\n 'created_at' => '2018-11-29 13:52:26',\n 'updated_at' => '2018-11-29 13:52:26',\n ),\n 10 => \n array (\n 'id' => 11,\n 'content' => '/storage/media/7k93nKEfKiGsrMgsFJvX87KFPKoGufz9D83ahXPR.pdf',\n 'created_at' => '2018-11-29 13:54:17',\n 'updated_at' => '2018-11-29 13:54:17',\n ),\n 11 => \n array (\n 'id' => 12,\n 'content' => '/storage/media/0B98QQ3LiuTCN2zLZKgRu8iubYO9ILT64FQlC4mf.png',\n 'created_at' => '2018-11-29 14:03:53',\n 'updated_at' => '2018-11-29 14:03:53',\n ),\n 12 => \n array (\n 'id' => 13,\n 'content' => '/storage/media/zMlSkl3KQqadMoO3UWqfjmmWAPDYone2ZqlZGnuc.pdf',\n 'created_at' => '2018-11-29 14:21:55',\n 'updated_at' => '2018-11-29 14:21:55',\n ),\n 13 => \n array (\n 'id' => 14,\n 'content' => '/storage/media/gw30IUp0cbTcVFtze1aEdjDxgtUZaw3LdpiDDIpq.pdf',\n 'created_at' => '2018-11-29 14:21:55',\n 'updated_at' => '2018-11-29 14:21:55',\n ),\n 14 => \n array (\n 'id' => 15,\n 'content' => '/storage/media/qurnlQBxZycZ19FmlBTDa8O2JMe0Z5v0hWNGXIsA.pdf',\n 'created_at' => '2018-11-29 14:26:48',\n 'updated_at' => '2018-11-29 14:26:48',\n ),\n 15 => \n array (\n 'id' => 16,\n 'content' => '/storage/media/2vDYsqiV0Rg0pKGoNKzpHtenBp9GcY5UNfbpTd9Y.pdf',\n 'created_at' => '2018-11-29 14:26:48',\n 'updated_at' => '2018-11-29 14:26:48',\n ),\n 16 => \n array (\n 'id' => 17,\n 'content' => '/storage/media/EGMvwAuVVUXVZnFH5dHNLeEZxM7pdUI4Fj6NEylx.pdf',\n 'created_at' => '2018-11-29 14:31:41',\n 'updated_at' => '2018-11-29 14:31:41',\n ),\n 17 => \n array (\n 'id' => 18,\n 'content' => '/storage/media/H4YQ6Pbk0Fyl5iT6HLPePfBGjTFy1EPo8g1ky4UL.zip',\n 'created_at' => '2018-11-29 14:37:40',\n 'updated_at' => '2018-11-29 14:37:40',\n ),\n 18 => \n array (\n 'id' => 19,\n 'content' => '/storage/media/dnxUafpze34eotsaAPZvYCpQXoYPuVjxGl94Dw4T.zip',\n 'created_at' => '2018-12-03 09:04:48',\n 'updated_at' => '2018-12-03 09:04:48',\n ),\n 19 => \n array (\n 'id' => 20,\n 'content' => '/storage/media/nK8Vgqn00vfnPd1BFSuVrEgPUMmZl4EfugsgGE4R.pdf',\n 'created_at' => '2018-12-03 09:12:27',\n 'updated_at' => '2018-12-03 09:12:27',\n ),\n 20 => \n array (\n 'id' => 21,\n 'content' => '/storage/media/CXbkqy8gGh7Mx9JwnnWnJtfkFL7ENw7UURsrtgmb.pptx',\n 'created_at' => '2018-12-03 09:14:31',\n 'updated_at' => '2018-12-03 09:14:31',\n ),\n 21 => \n array (\n 'id' => 22,\n 'content' => '/storage/media/uQRzJRXGLEPzarBl2t5O6bMrFf72XulHm9jET5lF.pdf',\n 'created_at' => '2018-12-03 09:47:47',\n 'updated_at' => '2018-12-03 09:47:47',\n ),\n 22 => \n array (\n 'id' => 23,\n 'content' => '/storage/media/BYVexQMeBPaVzoFOP0utcfrd2Wsyfc1DLDdCKq1i.pdf',\n 'created_at' => '2018-12-03 09:47:47',\n 'updated_at' => '2018-12-03 09:47:47',\n ),\n ));\n \n \n }", "public function buildVideos($docs = FALSE);", "public function postVideo(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n $video_url=$_POST['video_url'];\r\n $video_img_path=$_POST['video_img_path'];\r\n $title=$_POST['video_title'];\r\n $desc=$_POST['content'];\r\n $embed_value=$_POST['video_embed_value'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addVideo($video_url,$video_img_path,$title,$desc,$tag,$embed_value);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }", "public function add_media() {\n $user_id = $this->session->userdata('user_id');\n $pujat = date(\"Y-m-d H:i:s\");\n $errors = \"\";\n\n $media = array(\n 'media_title' => $this->input->post('media_title'),\n 'media_description' => $this->input->post('media_description'),\n 'media_tags' => $this->input->post('media_tags'),\n 'media_address' => $this->input->post('media_address'),\n 'media_uploaded' => $user_id,\n 'media_date' => $pujat\n );\n $insert_id = $this->media_model->register_media($media);\n\n //Write a image on a file\n if (!empty($_FILES['thumbnail']['tmp_name'])) {\n $config['upload_path'] = 'img';\n $config['allowed_types'] = 'jpg';\n $config['file_name'] = $insert_id;\n $config['overwrite'] = TRUE;\n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n if (!$this->upload->do_upload('thumbnail')) {\n $errors .= \"Errores al subir el archivo - \";\n } else {\n $errors .= \"Archivo subido con éxito - \";\n }\n }\n\n //Write a video on a file\n if (!empty($_FILES['video']['tmp_name'])) {\n $config['upload_path'] = 'videos';\n $config['allowed_types'] = 'mp4';\n $config['file_name'] = $insert_id;\n $config['overwrite'] = TRUE;\n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n if (!$this->upload->do_upload('video')) {\n $errors .= \"Errores al subir el archivo - \";\n } else {\n $errors .= \"Archivo subido con éxito - \";\n }\n }\n\n if ($insert_id > 0) {\n $errors .= \"Registro añadido con éxito\";\n } else {\n $errors .= \"Ningún registro añadido\";\n }\n $valors = array();\n $this->load->view(\"admin.php\", array(\"data\" => $valors, \"error\" => $errors));\n }", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function insert($otros_votos);", "protected function findOrAddVideo($info)\n {\n $mediaId = null;\n $slug = null;\n\n if (!isset($info['title']))\n {\n $info['title'] = 'Imported video';\n }\n $slug = aTools::slugify((!empty($info['title'])) ? $info['title'] : ((!empty($info['service_url'])) ? $info['service_url'] : md5($info['embed'])));\n\n $result = $this->sql->query('SELECT id FROM a_media_item WHERE slug = :slug', array('slug' => $slug));\n if (isset($result[0]['id']))\n {\n $mediaId = $result[0]['id'];\n } else\n {\n $mediaItem = new aMediaItem();\n foreach ($info as $key => $value)\n {\n if ($key !== 'tags')\n {\n $mediaItem[$key] = $value;\n }\n }\n if (empty($mediaItem['title']))\n {\n $mediaItem->setTitle($slug);\n }\n else\n {\n $mediaItem->setTitle($info['title']);\n }\n $mediaItem->setSlug($slug);\n $mediaItem->setType('video');\n $service = null;\n if ($mediaItem->service_url)\n {\n $service = aMediaTools::getEmbedService($mediaItem->service_url);\n }\n if ($service)\n {\n $id = $service->getIdFromUrl($mediaItem->service_url);\n if ($service->supports('thumbnail'))\n {\n $filename = $service->getThumbnail($id);\n if ($filename)\n {\n // saveFile can't handle a nonlocal file directly, so\n // copy to a temporary file first\n $bad = isset($this->failedMedia[$filename]);\n if (!$bad)\n {\n $tmpFile = aFiles::getTemporaryFilename();\n try\n {\n if (!copy($filename, $tmpFile))\n {\n throw new sfException(sprintf('Could not copy file: %s', $src));\n }\n if (!$mediaItem->saveFile($tmpFile))\n {\n throw new sfException(sprintf('Could not save file: %s', $src));\n }\n } catch (Exception $e)\n {\n $this->failedMedia[$filename] = true;\n }\n aFiles::unlink($tmpFile);\n }\n }\n }\n }\n $this->sql->fastSaveMediaItem($mediaItem);\n if (count($info['tags']))\n {\n $this->sql->fastSaveTags('aMediaItem', $mediaItem->id, $info['tags']);\n }\n $mediaId = $mediaItem->id;\n $mediaItem->free(true);\n }\n return $mediaId;\n }", "public function store(Request $request)\n {\n \n \n\n $scort = Scort::find($request->scort_id);\n\n //contamos numero de videos \n $num_videos = Video::where('scort_id',$request->scort_id)->count();\n \n $carga = false;\n\n switch ($scort->package->id) {\n case 1:\n //1 video\n if($num_videos<2){\n $carga = true;\n }\n break;\n case 2:\n //ningun video\n $carga = false;\n \n break;\n \n }\n \n if($carga){\n $file = $request->file('video');\n \n if(!empty($file))\n {\n \n //foreach ($files as $file) {\n \n $video = $file->store('videos');\n \n $result= Video::create([\n 'scort_id' => $request->scort_id,\n 'path' => $video,\n \n ]);\n //}\n \n }\n }else{\n return redirect()->route('mivideo.index')\n ->with('info','No tiene permitido cargar mas videos'); \n }\n return redirect()->route('mivideo.index')\n ->with('info','El video se ha cargado con exito'); \n\n\n }", "public function __construct(){\n $this->db=Conectar::con();\n $this->videos=array();\n \n }", "public function obtenerVideojuegos($busqueda)\n {\n DAOVideojuegos::getInstance()->listarVideojuegos();\n }", "function save() {\n \n\t if ($this->id == NULL) {\n\t \t\n\t\t mysql_query(\"INSERT INTO `videothumbs` ( `videoid`, `url`) VALUES ( '\".$this->videoid.\"', '\".$this->url.\"');\") or die(\"Query failed with error: \".mysql_error());\n\t\t $this->id = mysql_insert_id();\n\t \n\t } else {\n\t\t\t\t\n\t\t mysql_query(\"UPDATE `videothumbs` SET `videoid` = '\".$this->videoid.\"', `url` = '\".$this->url.\"' WHERE `id` = \".$this->id.\";\") or die(\"Query failed with error: \".mysql_error());\n\t }\n\t \n }", "public function addVideo(VideoMedia $video);", "public function run()\n\t{\n\t\tDB::table('media_contents')->delete();\n\n\t\tMediaContent::create(['src' => 'uploads/1234.mp4', 'type' => 'video']);\n\t\tMediaContent::create(['src' => 'uploads/23916.png', 'type' => 'image']);\n\t\tMediaContent::create(['src' => 'uploads/1234.mp4', 'type' => 'video']);\n\t}", "public function run()\n {\n \\App\\Models\\MovieTrailer::create([\n 'id' => 1000,\n 'movie_id' => 1000,\n 'src' => 'https://www.youtube.com/embed/2TAOizOnNPo'\n ]);\n \\App\\Models\\MovieTrailer::create([\n 'id' => 1001,\n 'movie_id' => 1001,\n 'src' => 'https://www.youtube.com/embed/ZZGkV_xWGw4'\n ]);\n \\App\\Models\\MovieTrailer::create([\n 'id' => 1002,\n 'movie_id' => 1002,\n 'src' => 'https://www.youtube.com/embed/_o3DMT3sGJ4'\n ]);\n \\App\\Models\\MovieTrailer::create([\n 'id' => 1003,\n 'movie_id' => 1003,\n 'src' => 'https://www.youtube.com/embed/YXZjANEY6bA'\n ]);\n \\App\\Models\\MovieTrailer::create([\n 'id' => 1004,\n 'movie_id' => 1004,\n 'src' => 'https://www.youtube.com/embed/Zd0mg6YkKVA'\n ]);\n }", "public function run()\n {\n DB::table('imgtrailer')->insert(\n [\n [\n 'MaPhim' => 1,\n 'Anh1'=>'anh1.jpg',\n 'Anh2'=>'anh2.jpg',\n 'Anh3'=>'anh3.jpg',\n 'Anh4'=>'anh4.jpg',\n 'Anh5'=>'anh5.jpg',\n 'Anh6'=>'anh6.jpg',\n 'Anh7'=>'anh7.jpg',\n 'Anh8'=>'anh8.jpg',\n 'Anh9'=>'anh9.jpg',\n 'Anh10'=>'anh10.jpg',\n 'created_at' =>new DateTime()\n ],\n [\n 'MaPhim' => 5,\n 'Anh1'=>'anh1.jpg',\n 'Anh2'=>'anh2.jpg',\n 'Anh3'=>'anh3.jpg',\n 'Anh4'=>'anh4.jpg',\n 'Anh5'=>'anh5.jpg',\n 'Anh6'=>'anh6.jpg',\n 'Anh7'=>'anh7.jpg',\n 'Anh8'=>'anh8.jpg',\n 'Anh9'=>'anh9.jpg',\n 'Anh10'=>'anh10.jpg',\n 'created_at' =>new DateTime()\n ],\n [\n 'MaPhim' => 5,\n 'Anh1'=>'anh1.jpg',\n 'Anh2'=>'anh2.jpg',\n 'Anh3'=>'anh3.jpg',\n 'Anh4'=>'anh4.jpg',\n 'Anh5'=>'anh5.jpg',\n 'Anh6'=>'anh6.jpg',\n 'Anh7'=>'anh7.jpg',\n 'Anh8'=>'anh8.jpg',\n 'Anh9'=>'anh9.jpg',\n 'Anh10'=>'anh10.jpg',\n 'created_at' =>new DateTime()\n ],\n [\n 'MaPhim' => 5,\n 'Anh1'=>'anh1.jpg',\n 'Anh2'=>'anh2.jpg',\n 'Anh3'=>'anh3.jpg',\n 'Anh4'=>'anh4.jpg',\n 'Anh5'=>'anh5.jpg',\n 'Anh6'=>'anh6.jpg',\n 'Anh7'=>'anh7.jpg',\n 'Anh8'=>'anh8.jpg',\n 'Anh9'=>'anh9.jpg',\n 'Anh10'=>'anh10.jpg',\n 'created_at' =>new DateTime()\n ]\n ]\n );\n }", "public function videoMap($rows)\n\t{\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t\t$item = new VideoSimpleSchema();\n\t\t\t\t\t\n\t\t\t\t$item->id = $row->id;\n\t\t\t\t$item->title = $row->title;\n\t\t\t\t$item->description = $row->description;\n\t\t\t\t$item->user_id = $row->user_id;\n\t\t\t\t$item->uid = $row->uid;\n\t\t\t\t$item->type = $row->type;\n\t\t\t\t$item->created = $row->created;\n\t\t\t\t$item->state = $row->state;\n\t\t\t\t$item->featured = $row->featured;\n\t\t\t\t$item->category_id = $row->category_id;\n\t\t\t\t$item->hits = $row->hits;\n\t\t\t\t$item->duration = $row->duration;\n\t\t\t\t$item->size = $row->size;\n\t\t\t\t$item->params = $row->params;\n\t\t\t\t$item->storage = $row->storage;\n\t\t\t\t$item->path = $row->path;\n\t\t\t\t$item->original = $row->original;\n\t\t\t\t$item->file_title = $row->file_title;\n\t\t\t\t$item->source = $row->source;\t\n\t\t\t\t$item->thumbnail = $row->thumbnail;\n\t\t\t\t$item->message = \"Video uploaded successfully\";\t\n\t\t\n\t\t\t\t$result[] = $item;\t\n\t\t\t\treturn $result;\n\t\t}\n\t}", "function cs_pb_video($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$video_element_size = '25';\n\t\t$video_url = '';\n\t\t$video_width = '';\n\t\t$video_height = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$video_element_size = $cs_node->video_element_size;\n\t\t\t$video_url = $cs_node->video_url;\n\t\t\t$video_width = $cs_node->video_width;\n\t\t\t$video_height = $cs_node->video_height;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $video_element_size?>\" item=\"video\" data=\"<?php echo element_size_data_array_index($video_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"video_element_size[]\" class=\"item\" value=\"<?php echo $video_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Video Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Video URL</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"video_url[]\" class=\"txtfield\" value=\"<?php echo $video_url?>\" />\n <p>Enter Video URL (Youtube, Vimeo or any other supported by wordpress)</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Width</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_width[]\" class=\"txtfield\" value=\"<?php echo $video_width?>\" /></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Height</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_height[]\" class=\"txtfield\" value=\"<?php echo $video_height?>\" /></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"video\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function store()\n {\n // Validate input\n $this->validate($this->request, [\n 'title' => 'required',\n 'description' => 'required',\n 'order_number' => 'required|integer|unique:videos',\n 'embed_code' => 'required',\n 'access_name' => 'required',\n ]);\n\n $this->video->create([\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'order_number' => $this->request->input('order_number'),\n 'embed_code' => $this->request->input('embed_code'),\n 'slug' => str_slug($this->request->input('title'), '-'),\n 'access_name' => $this->request->input('access_name')\n ]);\n\n return redirect('videos/all')->withSuccessMessage('Video added');\n }", "public function add_video_glance() {\n\t\t/* How many videos are published. */\n\t\t$video_count = wp_count_posts( 'video' )->publish;\n\t\t\n\t\t/* Get the correct label (video, videos) depending on the count. */\n\t\t$video_type = get_post_type_object( 'video' );\n\t\t$video_text = _n( $video_type->labels->singular_name, $video_type->labels->name, intval( $video_count ), 'makigas-videoman' );\n\t\t\n\t\t/* Render HTML code. */\n\t\techo '<li class=\"page-count video-count\">';\n\t\techo '<a href=\"edit.php?post_type=video\">' . $video_count . ' ' . strtolower( $video_text ) . '</a>';\n\t\techo '</li>';\n\t\t\n\t\t/* TODO: content: \"\\f236\"; in CSS: */\n\t}", "public function run()\n {\n //\n DB::table('galerias')->delete();\n DB::table('galerias')->insert([\n [\n 'idgalerias'=>1,\n 'titulo'=>'Churrasco',\n 'descricao'=>'Churrasco com os Stylosos',\n 'data'=> date(\"Y-m-d H:i:s\"),\n 'ativo'=> true\n ]\n ]);\n \n DB::table('fotos_galerias')->delete();\n DB::table('fotos_galerias')->insert([\n [\n 'titulo' => 'Churrasco',\n 'imagem_url' => 'imagens/midias/1.jpg',\n 'idgaleria' => 1\n ],\n [\n 'titulo' => 'Churrasco',\n 'imagem_url' => 'imagens/midias/2.jpg',\n 'idgaleria' => 1\n ],\n [\n 'titulo' => 'Churrasco',\n 'imagem_url' => 'imagens/midias/3.jpg',\n 'idgaleria' => 1\n ],\n [\n 'titulo' => 'Churrasco',\n 'imagem_url' => 'imagens/midias/4.jpg',\n 'idgaleria' => 1\n ]\n ]);\n \n DB::table('videos_galerias')->delete();\n DB::table('videos_galerias')->insert([\n [\n 'titulo' => 'Apresentação do Casal Campeão na Fase Final do \"Reis da Dança III',\n 'descricao' => '',\n 'youtube_url' => 'XBcsnSA8H7Q',\n 'idgaleria' => 1\n ],\n [\n 'titulo' => 'Improviso no final da aula com Emerson Diniz e Caroline Caetano',\n 'descricao' => '',\n 'youtube_url' => 'DKbKV7B7i74',\n 'idgaleria' => 1\n ]\n ]);\n \n \n }", "function videoCategoryInsert($category, $idVideo, $connection)\n{\n $query_category = \"INSERT INTO video_con_category (id_category, id_video) VALUES\";\n for ($i = 0; $i < count($category); $i++) {\n $query_category .= \" ('$category[$i]', '$idVideo'),\";\n }\n $query_category = rtrim($query_category, ',');\n $result_category = mysqli_query($connection, $query_category);\n}", "public function testInsertPlaylistAndVideo()\n {\n // Insert a playlist into the DB\n $playlist = new playlist($this->user->getId(), \"test-title\",\n \"test-description\", \"test-subject\", \"test-topic\");\n $id = $playlist->insertPlaylist();\n $this->assertNotFalse($id);\n\n // Retrieve the playlist from the DB\n $fetchedPlaylist = Playlist::getPlaylistById($id);\n\n // Verify that we actually got our playlist back\n $this->assertInstanceOf(Playlist::class, $fetchedPlaylist);\n $this->assertEquals($playlist->getUser(), $fetchedPlaylist->getUser());\n\n // Insert a video into the playlist\n $video = $playlist->insertVideo($this->video1id);\n $this->assertNotFalse($video);\n }", "function show_metabox_post_video($post) {\r\n\t\t$id_vimeo = get_post_meta($post->ID, 'id_vimeo', true);\r\n\t\t$id_youtube = get_post_meta($post->ID, 'id_youtube', true);\r\n\t\t$embed_generico = get_post_meta($post->ID, 'embed_generico', true);\r\n\t\twp_nonce_field(__FILE__, '_articulo_videos_nonce');\r\n\t\techo <<< HTML\r\n\r\n\t\t\t<label for=\"id_vimeo\">ID de Vimeo</label>\r\n\t\t\t<input type=\"text\" name=\"id_vimeo\" id=\"id_vimeo\" value=\"$id_vimeo\" class=\"widefat\">\r\n\t\t\t<p class=\"howto\" style=\"font-size:11px; margin: 0.2em 0 1.5em 0;\">https://vimeo.com/<strong>45118430</strong></p>\r\n\r\n\t\t\t<label for=\"id_youtube\">ID de Youtube</label>\r\n\t\t\t<input type=\"text\" name=\"id_youtube\" id=\"id_youtube\" value=\"$id_youtube\" class=\"widefat\">\r\n\t\t\t<p class=\"howto\" style=\"font-size:11px; margin: 0.2em 0 1.5em 0;\">https://www.youtube.com/watch?v=<strong>rT_OmTMwvZI</strong></p>\r\n\r\n\t\t\t<label for='embed_generico'>Embed (otra fuente)</label>\r\n\t\t\t<input type='text' name='embed_generico' id='embed_generico' value='$embed_generico' class='widefat'>\r\n\t\t\t<p class='howto' style='font-size:11px; margin: 0.2em 0 1.5em 0;'>< iframe src='//player...</p>\r\n\r\nHTML;\r\n\t}", "public function addVideo(Request $request)\n {\n try{\n if (!empty($request)) {\n $validateData = Validator::make($request->all(),[\n 'title' => 'required',\n 'asset_type' => 'required',\n 'slug' => 'required',\n 'short_description' => 'required|max:520',\n 'description' => 'required',\n 'content_type' => 'required'\n ]);\n\n if ($validateData->fails()) {\n $messages = $validateData->errors()->all();\n return APIResponse('201', 'Validation errors.', $messages);\n }\n\n $video_data = VideoContent::where('title', '=', $request->get('title'))->first();\n \n if ($video_data) {\n return APIResponse('201', 'Data already present in the database.');\n }\n\n $photoURL = '';\n if ($request->hasFile('thumbnail_image')) {\n $file = $request->file('thumbnail_image');\n $folderpath = 'bcci/videos/';\n $result = uploadFileToS3($file, $folderpath, '');\n $photoURL = $result['ObjectURL'] ?? '';\n }\n \n $videoUrl = '';\n if ($request->hasFile('video_url')) {\n $file = $request->file('video_url');\n $folderpath = 'Input/';\n $result = uploadFileToS3($file, $folderpath, 'video');\n $videoUrl = $result['ObjectURL'] ?? '';\n }\n \n $videoCount = AssetsCount::all();\n if (isset($videoCount)) {\n $videosCount = $videoCount[0]['video_count'] + 1;\n }\n\n $videoContent = new VideoContent();\n $videoContent->ID = $videosCount;\n $videoContent->title = $request->get('title');\n $videoContent->short_description = $request->get('short_description'); \n $videoContent->description = $request->get('description');\n $videoContent->video_duration = $request->get('video_duration'); // duration and video-duration is same \n $videoContent->match_id = $request->get('match_id');\n $videoContent->content_type = $request->get('content_type'); //type and content-type is same\n $videoContent->video_scope = $request->get('video_scope');\n $videoContent->video_url = $videoUrl; \n $videoContent->match_formats = $request->get('match_formats');\n $videoContent->keywords = $request->get('keywords'); \n $videoContent->created_date = $request->get('created_date');\n $videoContent->publish_date = $request->get('publish_date');\n $videoContent->publish_by = $request->get('publish_by'); // publishFrom and publish by is same\n $videoContent->meta_languages = $request->get('meta_languages');\n $videoContent->langauge = $request->get('langauge');\n $videoContent->asset_type = $request->get('asset_type');\n $videoContent->expiry_date = $request->get('expiry_date'); \n $videoContent->total_viewcount = $request->get('total_viewcount'); \n $videoContent->titleslug = $request->get('titleslug');\n $videoContent->varients = $request->get('varients'); \n $videoContent->views_count = $request->get('views_count'); \n $videoContent->comments = $request->get('comments'); //comments and commentson is same\n $videoContent->platform = $request->get('platform'); \n $videoContent->current_status = $request->get('current_status');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->thumbnail_image= $photoURL; // thumbnail image nad thumbnail is same\n $videoContent->video_status = 'pending';\n $videoContent->location = $request->get('location');\n $videoContent->titleUrlSegment = $request->get('titleUrlSegment');\n $videoContent->subtitle = $request->get('subtitle');\n $videoContent->titleTranslations = $request->get('titleTranslations');\n $videoContent->coordinates = $request->get('coordinates');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->publishTo = $request->get('publishTo');\n $videoContent->mediaId = $request->get('mediaId');\n $videoContent->references = $request->get('references');\n $videoContent->closedCaptioned = $request->get('closedCaptioned');\n $videoContent->status = true;\n $videoContent->save();\n\n $totalCount = AssetsCount::where('ID', 1)->update(['video_count' => $videosCount]);\n if ($videoContent) {\n $response = APIResponse('200', 'Data has been added successfully.');\n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.'); \n }\n \n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n } \n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n\n return $response;\n }", "public function actionGenerate()\n {\n $faker = Factory::create();\n\n /**\n * ну да. не быстро. ну да ладно. \n */\n for ($i=0; $i<self::COUNT_ROWS; $i++) {\n\n $content = new VideoContent();\n $content->title = implode('_', $faker->words());\n $content->thumbnail_url = $faker->url;\n $content->duration = $faker->numberBetween(0, 60 * 60 * 3);\n $content->views = $faker->numberBetween(0, 1000);\n $content->added = Carbon::parse($faker->dateTimeBetween('-1 year'))->toDateTimeString();\n $content->save();\n\n }\n\n return ExitCode::OK;\n }", "public function youtube() {\n $DEVELOPER_KEY = $this->youtube_key;\n\n $client = new Google_Client();\n $client->setDeveloperKey($DEVELOPER_KEY);\n\n $youtube = new Google_Service_YouTube($client);\n\n $searchResponse = $youtube->search->listSearch('id,snippet', array(\n 'q' => $this->palavraChave,\n 'maxResults' => $this->qtde,\n 'type' => 'video',\n 'order' => 'date',\n ));\n\n foreach($searchResponse['items'] as $data) {\n $time = strtotime($data['snippet']['publishedAt']);\n\n $dados->name[] = $data['snippet']['channelTitle'];\n $dados->type[] = 'youtube';\n $dados->data[] = 'http://www.youtube.com/embed/'.$data['id']['videoId'];\n $dados->author[] = $data['snippet']['channelTitle'];\n $dados->link[] = 'http://www.youtube.com/'.$data['id']['videoId'];\n $dados->generate[] = date('Y-m-d H:i:s', $time);\n $dados->created[] = date('Y-m-d H:i:s');\n }\n\n $this->insertDB($dados);\n }", "function manageVideoPopPlusFiles() {\r\n\t\t// Get List\r\n\t\tif (isset($_GET['get_list'])) {\r\n\t\t\t$start = 0;\r\n\t\t\tif (isset($_GET['start']) && is_numeric($_GET['start']))\r\n\t\t\t\t$start = $_GET['start'];\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t$out .= $this->_videoLists($_GET['get_list'], $this->vids, $start, ($_GET['get_list']=='1' ? $this->options['manage_list_max'] : $this->options['post_list_max']));\r\n\t\t\techo $out;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check write permissions\r\n\t\tif($this->_checkDir()) {\r\n\r\n\t\t\t// IF Video is uploaded\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif(isset($_POST['lynkvp_upload']) && $this->_valInput()) {\r\n\t\t\t\t\t// defaults\r\n\t\t\t\t\t$vid_url = '';\r\n\t\t\t\t\t$vid_file = '';\r\n\t\t\t\t\t$vid_id = time(); // use timestamp for unique id\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_file = $vid_id.'.'.$_POST['lynkvp_type']; // filename+extension\r\n\t\t\t\t\t\tif(!move_uploaded_file($_FILES['lynkvp_file']['tmp_name'], $this->data_dir . $vid_file))\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$vid_url = ltrim($_POST['lynkvp_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file)) {\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $vid_file;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $vid_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_edit2']) && $this->_valInput2()) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\t\t\t\t\t$vid_id = $_POST['lynkvp_editid'];\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file))\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$vid_image_url = $this->vids[$vid_id]['lynkvp_image'];\r\n\t\t\t\t\t\t$vid_image_file = $this->vids[$vid_id]['lynkvp_image_filename'];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $_POST['lynkvp_filename'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $_POST['lynkvp_url'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_del'])) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_del']);\r\n\r\n\t\t\t\t\t// Remove Video\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']);\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']);\r\n\r\n\t\t\t\t\tforeach($this->vids as $key=>$value) {\r\n\t\t\t\t\t\tif($key != $a_id[__('delete', $this->textdomain_name)])\r\n\t\t\t\t\t\t\t$a_vids2[$key] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids = $a_vids2;\r\n\t\t\t\t\tunset($a_vids2);\r\n\r\n\t\t\t\t\t// Save ser. images\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// IF edit\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif ( isset($_POST['lynkvp_edit']) ) {\r\n\t\t\t\t\t// Video ID\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_edit']);\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Populate POST & strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($this->vids[$a_id[__('edit', $this->textdomain_name)]]);\r\n\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Edit', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_type\\\" value=\\\"\".$_POST['lynkvp_type'].\"\\\" />\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\tif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('URL', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" style=\\\"width:400px;\\\" /></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('Video type', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".$_POST['lynkvp_type'].\"</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= __('Thumbnail', $this->textdomain_name).\":\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_image_file\\\" />&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).' &nbsp;&nbsp;';\r\n\t\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\":&nbsp;&nbsp;\";\r\n\t\t\t\t\t\t$out .= \"http:// <input type=\\\"text\\\" name=\\\"lynkvp_image_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_image'].\"\\\" />\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], '999').\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select>&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".($_POST['lynkvp_size']!=999?'none':'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"&nbsp;x&nbsp;\";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_editid\\\" value=\\\"\".$_POST['lynkvp_id'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_filename\\\" value=\\\"\".$_POST['lynkvp_filename'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_edit2\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($_POST);\r\n\r\n\t\t\t\t\t// BLOCK Upload\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Upload', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Choose video', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_file\\\" />&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).\" &nbsp;&nbsp;\";\r\n\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\":&nbsp;&nbsp;http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" />\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], \"999\").\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select>&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".(!isset($this->videosizes[$_POST['lynkvp_size']]) ? 'none' : 'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"&nbsp;x&nbsp;\";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_upload\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\t\t\t\t\tunset($_POST);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// ---------\r\n\t\t\t// ALWAYS DISPLAYED\r\n\r\n\t\t\t// BLOCK Your Videos\r\n\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;padding-bottom:3em;margin-top:2em;\\\">\\n\";\r\n\t\t\t$out .= \"<h2>\".__('My Videos', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\r\n\t\t\t// If any vids uploaded\r\n\t\t\tif(is_array($this->vids)) {\r\n\t\t\t\t// add JS to manage page;\r\n\t\t\t\t$this->_adminHead();\r\n\t\t\t\t$out .= $this->_videoLists('1', $this->vids, 0, $this->options['manage_list_max']);\r\n\t\t\t}\r\n\r\n\t\t\t$out .= \"</div>\\n\";\r\n\t\t}\r\n\r\n\t\t// Output\r\n\t\techo (!empty($this->note) ? \"<div id=\\\"message\\\" class=\\\"updated fade\\\"><p>{$this->note}</p></div>\\n\" : '' ).\"\\n\";\r\n\t\techo ($this->error > 0 ? '' : $out).\"\\n\";\r\n\t}", "public function video_add($id)\n {\n $data['content'] = Content::findorfail($id);\n\n $data['page_title'] = 'Content Add';\n return view('client.content.video_add', $data);\n }", "function deleteallvideos()\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\t\t\t\n\t\tif(!($stmt = $mysqli->prepare(\"DELETE FROM videoinventory\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\t\t\n\t\tif(!$stmt->execute()){\n\t\t\techo \"Execute failed: \" . $mysqli->connect_errno . \" \" . $mysqli->connect_error;\n\t\t}\t\t\t\t\n\t\t$stmt->fetch();\t\t\n\t}", "public function video()\n {\n /***** Checks Video for UPLOAD *****/\n if(!empty($_FILES['video']['name']))\n {\n $video = array\n (\n 'upload_path' => 'uploads/videos',\n 'allowed_types' => 'mp4|avi|wmv|mov|mpg|mpeg|3gp',\n 'max_size' => '10000',\n 'file_name' => $_FILES['video']['name']\n );\n $this->load->library('upload',$video);\n $this->upload->initialize($video);\n\n if($this->upload->do_upload('video'))\n {\n $uploadData = $this->upload->data();\n $uploaded_video = $uploadData['file_name'];\n }else{\n $Response = array('message' => $this->upload->display_errors(), 'status' => false);\n echo json_encode($Response);\n }\n }else{\n //$uploaded_video = '';\n $Response = array('message' => 'Choose a Video to upload', 'status' => false);\n echo json_encode($Response);\n }\n // prepare video array for insert\n $dataVideo = array\n (\n 'complaint_type_id' => $this->input->post('complaint_type_id'),\n 'signup_id' => $this->input->post('signup_id'),\n 'complaints_status_id'=> 2,\n 'latitude' => $this->input->post('latitude'),\n 'longitude' => $this->input->post('longitude'),\n 'description' => $this->input->post('description'),\n 'video' => $uploaded_video,\n 'dated' => date('Y-m-d')\n );\n if(isset($uploaded_video))\n {\n $insert = $this->Complaintsmodel->InsertDB($dataVideo);\n if($insert)\n {\n $Response = array('message' => 'Complaint is done!', 'status' => true, 'data'=>$insert); \n echo json_encode($Response);\n }\n else\n {\n $Response = array('message' => 'Sorry, Try again!', 'status' => false);\n echo json_encode($Response);\n }\n }\n }", "public function imprimeVideojuego()\n {\n $html = \"\n <div class='card bg-dark text-white border-secondary mx-auto mb-3' style='width:16rem'>\n <div id='\" . $this->id . \"A' class='card-body d-flex flex-column'>\n <img class='card-img-top img-thumbnail bg-secondary mb-4 border-dark d-block mx-auto' src='\" . $this->carpeta . $this->imagen . \"'>\n <h5 class='card-title font-weight-bold border-bottom mr-auto'>\" . $this->nombre . \"</h5>\n <a href='javascript:void();' class='btn btn-secondary align-self-end mt-auto mr-auto' onclick='masInformacion(`\" . $this->id . \"`)'>Más Información</a>\n </div >\n <div id='\" . $this->id . \"B' class='card-body flex-column' style='display:none'>\n <h5 class='card-title font-weight-bold border-bottom mr-auto'>\" . $this->nombre . \"</h5>\n <p class='card-text text-wrap' style='max.height:1rem'>Comentario: \" . $this->comentario . \"</p>\n <p class='card-text'>Genero: \" . $this->genero . \"</p>\n <p class='card-text'>Lanzamiento: \" . $this->fecha . \"</p>\n <p class='card-text'>Plataforma: \" . $this->plataforma . \"</p>\n <p class='card-text font-weight-bold'>Valoracion: \" . $this->valoracion . \"/5</p>\n <div class='btn-toolbar align-self-end mt-auto mr-auto'>\n <a href='javascript:void();' class='btn btn-secondary mx-2 d-inline-block' onclick='cerrarInformacion(`\" . $this->id . \"`)'>Cerrar</a>\n <a href='Insertar.php?id=\" . $this->id . \"' class='btn btn-secondary mx-2 d-inline-block'><img class='pb-1' style='width:1rem' src='img/editar.png'></a>\n <a href='javascript:borrarJuego(`\" . $this->id . \"`)' class='btn btn-secondary mx-2 d-inline-block'><img class='pb-1' style='width:1rem' src='img/eliminar.png'></a>\n </div>\n </div> \n</div >\n\";\n return $html;\n }", "public function import($id, $categories=[]) {\n\n if (count(self::get(['_userId' => $this->user->id(), 'id' => $id])) > 0) {\n $this->error = 'Video already added';\n return false;\n }\n\n $yt = new youtube($this->user->access_token);\n\n if (!$ytv = $yt->video($id)) {\n $this->error = 'Error retrieving video';\n return false;\n }\n\n if ($ytv['status']['privacyStatus'] == 'private') {\n $this->error = 'PRIVATE';\n return false;\n }\n\n $video = new video();\n\n // yt info\n $video->id = $ytv['id'];\n\n // snippet part\n $video->title = $ytv['snippet']['title'];\n $video->description = $ytv['snippet']['description'];\n $video->thumbnails = $ytv['snippet']['thumbnails'];\n $video->tags = $ytv['snippet']['tags'];\n $video->published = $ytv['snippet']['publishedAt'];\n\n // contentDetails part\n $video->duration = $ytv['contentDetails']['duration'];\n // hd or sd, sd videos have smaller thumbnails, hq you can hit maxresdefault.jpg\n $video->quality = $ytv['contentDetails']['definition'];\n\n // statistics part, cast to integer for proper sorting\n $stats = [];\n foreach ($ytv['statistics'] as $key=>$stat) {\n $stats[$key] = (int) $stat;\n } \n $video->stats = $stats;\n\n\n // settings\n $video->approved = false;\n $video->featured = false;\n $video->problem = false;\n $video->solution = false;\n $video->categories = $categories;\n\n // user info\n $video->_userId = $this->user->id();\n\n $video->user = [\n 'name' => $this->user->name,\n 'picture' => $this->user->picture\n ];\n\n $video->save();\n\n return true;\n\n }", "public function index()\n {\n $user = Auth::user();\n $videos_ativos = Videos::where('excluido', 0)->get();\n $videos_excluidos = Videos::where('excluido', 1)->get();\n\n return view('pages.painel.listar.video.index', compact('user', 'videos_ativos', 'videos_excluidos'));\n }", "public function copy_audio_to_video()\n {\n echo 'Migrating Audio to Video, please save the output to a CSV file to validate the results' . PHP_EOL;\n echo 'audio,video,page_using_media' . PHP_EOL;\n $base_url = \\Drupal::request()->getSchemeAndHttpHost();\n\n $entityTypeManager = \\Drupal::entityTypeManager();\n $audios = $entityTypeManager->getStorage('media')->loadByProperties(['bundle' => 'audio']);\n\n foreach ($audios as $audio) {\n $audio_redirects = $audio->field_redirects->getValue();\n if(!empty($audio_redirects)) {\n $audio->field_redirects = [];\n $audio->save();\n }\n\n $new_video = Media::create([\n 'name' => $audio->name->value,\n 'status' => $audio->status->value,\n 'bundle' => 'video',\n 'langcode' => $audio->langcode->value,\n 'uid' => $audio->uid->target_id,\n 'created' => $audio->created->value,\n 'changed' => $audio->changed->value,\n 'moderation_state' => $audio->moderation_state->value,\n 'thumbnail' => $audio->thumbnail->target_id,\n 'field_display_groups' => $audio->field_display_groups->getValue(), // Copy the item list\n 'field_media_in_library' => $audio->field_media_in_library->value,\n 'field_media_video_embed_field' => $audio->field_media_video_embed_field->getValue(),\n 'field_caption' => $audio->field_caption->value,\n 'field_license' => $audio->field_license->getValue(),\n 'field_creator' => $audio->field_creator->value,\n 'field_source' => $audio->field_source->value,\n 'field_title' => $audio->field_title->value,\n 'field_transcript' => $audio->field_transcript->value,\n ]);\n $new_video->save();\n\n // Update media UUID in Body\n $nodes_using_audio = array_keys(\\Drupal::service('entity_usage.usage')->listSources($audio)['node'] ?? []);\n $node_urls = [];\n foreach($nodes_using_audio as $node_using_audio) {\n $node = Node::load($node_using_audio);\n $orig_uuid = $audio->uuid->value;\n $new_uuid = $new_video->uuid->value;\n $node->field_body_content->value = str_replace($orig_uuid, $new_uuid, $node->field_body_content->value);\n $node->save();\n $node_urls []= $base_url . '/node/' . $node->nid->value;\n }\n\n echo $base_url . '/media/'. $audio->mid->value . ',' . $base_url . '/media/'. $new_video->mid->value . ',' . implode(',', $node_urls) . PHP_EOL;\n }\n }", "public function run()\n {\n //\n $videos = Video::all()->all();\n $users = User::all()->all();\n\n $faker = Faker\\Factory::create();\n\n foreach ($videos as $video){\n $loops = rand(1,20);\n for ($i = 0 ; $i < $loops ; $i ++ ){\n try {\n $user = $faker->randomElement($users);\n $user->favorites()->attach($video);\n } catch (PDOException $e)\n {\n #pass\n }\n }\n }\n }", "public function insert(Request $request)\n {\n $video_type = $request->input('video_type');\n $video_url = $request->input('video_url');\n $price = $request->input('price');\n $video = $request->input('video');\n //dd($request->video);\n\n if($request->hasFile('video'))\n {\n //echo \"video\";\n $file = $request->file('video');\n $filename = $file->getClientOriginalName();\n // $path = public_path().'/uploaded_videos/';\n $path = storage_path('uploaded_videos');\n $file->move($path, $filename);\n }\n\n $data = array('video_type'=>$video_type, 'video_url'=>$video_url, 'price'=>$price, 'video'=>$filename,'users_id'=>Session::get('id'));\n DB::table('video_uploaded')->insert($data);\n $value = Session('key', 'You are successfully added all fields');\n return back()->with('success',$value);\n \n }", "function westreamuploadplug() {\r\n ?>\r\n\t<br><br>\r\n <table>\r\n <form action=\"<?php echo $PHP_SELF;?>\" method=\"post\" enctype=\"multipart/form-data\" >\r\n <tr>\r\n <td>\r\n Uploader: <input type=\"text\" name=\"username\" size=\"20\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <label for=\"file\">Filename:</label>\r\n <input type=\"file\" name=\"file\" id=\"file\" size=\"40\" multiple accept='video/*'/><br />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td> \r\n <input type=\"submit\" name=\"submit\" value=\"Submit\" />\r\n </td>\r\n </tr>\r\n </form>\r\n </table>\r\n <?php\r\n global $wpdb;\r\n $sql_create_table = \"CREATE TABLE IF NOT EXISTS `videos` (\r\n `id` int(11) NOT NULL AUTO_INCREMENT,\r\n `title` varchar(20) NOT NULL,\r\n `url` varchar(100) NOT NULL,\r\n `user` varchar(20) NOT NULL,\r\n activity_date datetime NOT NULL default '0000-00-00 00:00:00',\r\n PRIMARY KEY (`id`),\r\n UNIQUE KEY `id` (`id`)\r\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\";\r\nrequire_once(ABSPATH . 'wp-admin/upgrade-functions.php');\r\ndbDelta( $sql_create_table );\r\n\r\nini_set('upload_max_filesize', '500M');\r\nini_set('post_max_size', '500M');\r\nini_set('max_input_time', 500);\r\nini_set('max_execution_time', 500);\r\nini_set('memory_limit', '1024M');\r\nini_set(\"session.gc_maxlifetime\",\"10800\");\r\n\r\n\r\n$upload_dir = wp_upload_dir();\r\n$upload_dir = $upload_dir['basedir'] . \"/westreamvid\";\r\n$upload_dircheck = wp_mkdir_p($upload_dir); \r\n\r\nif(isset($_POST['submit'])){\r\n if (file_exists(\"../wp-content/uploads/uploads/westreamvid/\" . $_FILES[\"file\"][\"name\"]))\r\n {\r\n echo $_FILES[\"file\"][\"name\"] . \" already exists. \";\r\n }\r\n else\r\n {\r\n $title = $_FILES[\"file\"][\"name\"];\r\n $username = $_POST[\"username\"];\r\n $time = date('Y-m-d H:i:s');\r\n move_uploaded_file($_FILES[\"file\"][\"tmp_name\"],\"../wp-content/uploads/westreamvid/\" . $title);\r\n $url = \"../wp-content/uploads/westreamvid/\" . $_FILES[\"file\"][\"name\"];\r\n $wpdb->query(\"INSERT INTO videos VALUE('','$title','$url','$username','$time')\");\r\n echo 'Preview: <br><video width=\"320\" height=\"240\" controls>\r\n <source src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" type=\"video/ogg\">\r\n <source src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" type=\"video/mp4\">\r\n <source src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" type=\"video/webm\">\r\n <object data=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" width=\"320\" height=\"240\">\r\n <embed width=\"320\" height=\"240\" src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\"></object></video>';\r\n \r\n }\r\n}\r\n}", "function aidtransparency_print_vimeo_videos($post = null, $number = 2)\r\n{\r\n global $post;\r\n $vidoesStr = false; //types_render_field(\"home_page_vimeo\", array( 'post_id' => $post->ID, 'raw' => true ) );\r\n $videoIds = array_map( 'trim', explode(',', $vidoesStr) );//Make into array and trim members\r\n if(count($videoIds) > 0) :\r\n $count = 1;\r\n ?>\r\n <div class=\"videos\">\r\n <?php foreach ($videoIds as $videoId) : if( $count > $number ) continue; ?>\r\n <div class=\"video <?php print sweetapple_get_row_class($count, 2);?>\" >\r\n <a href=\"http://vimeo.com/<?php echo $videoId;?>\" class=\"vimeo-video\" data-vimeoid=\"<?php echo $videoId;?>\">View this Vimeo video</a>\r\n </div>\r\n <?php $count++; endforeach;?>\r\n </div><!--.videos -->\r\n <?php endif;\r\n}", "static function countVideos($text) {\n $videoArray = explode('http://www.youtube.com/watch?v=', $text);\n $i = 0;\n\n //Se realiza este proceso para descartar posiciones del arreglo sin contenido\n foreach ($videoArray as $video) {\n if ($video) {\n $i++;\n }\n }\n return $i;\n }", "public function run()\n {\n $faker = Faker::create();\n\n $images = [\n \t\n \t'videos-two-third.jpg',\n \t'1565131936yfVr1nQ304.jpg'\n ];\n\n $youtube = [\n \t'https://www.youtube.com/watch?v=OZK27hsCcDo',\n \t'https://www.youtube.com/watch?v=HucxxbKX7t0',\n \t'https://www.youtube.com/watch?v=TCgV2YzU1GM',\n \t'https://www.youtube.com/watch?v=ZUtgrmDi69M'\n ];\n\n $ids = [1,2,3,4,5,6,7,8,9];\n\n for ($i=0; $i < 10; $i++) { \n \t$array = [\n \t\t'name' => $faker->word,\n \t\t'meta_keywords' => $faker->name,\n \t\t'meta_desc' => $faker->name,\n \t\t'cat_id' => 1,\n \t\t'youtube' => $youtube[rand(0,3)],\n \t\t'published' => rand(0,1),\n \t\t'image' => $images[rand(0,1)],\n \t\t'desc' => '$faker->paragraph',\n \t\t'user_id' => 1,\n ];\n \n $video = Video::create($array);\n $video->skills()->sync(array_rand($ids , 2));\n $video->tags()->sync(array_rand($ids , 3));\n }\n }", "public function run()\n {\n DB::table('media_types')->insert([\n 'nom' => 'jpg',\n 'is_video' => false\n ]);\n }", "public function add_video(){\n\t\t$this->load->view('admin/video_gallery/add_video');\n\t}", "public function addVideo()\n {\n $getAllVideoCategory = VideoCategory::all();\n return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory);\n }", "public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n\n if ($videoFile->move(public_path(\"uploads/videos/\"),$videoName) && $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName)){\n $video = new Video();\n $video->title = ucfirst($request->input('title'));\n $video->subtitle = ucfirst($request->input('subtitle'));\n $video->description = ucfirst($request->input('description'));\n $video->duration = \"1:00\";\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n $video->video = asset(\"uploads/videos/$videoName\");\n $video->user_id = Auth::id();\n $video->save();\n $video->categories()->attach($category->id);\n\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n $video->tags()->attach($tag->id);\n }\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was added successfully !!\");\n }\n return redirect()->back();\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not store the video\");\n\n if($video){\n $video->categories()->detach();\n $video->delete();\n }\n\n Log::warning(\"Can not upload Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function run()\n {\n\n $series = \\CodeFlix\\Models\\Serie::all();\n $categories = \\CodeFlix\\Models\\Category::all();\n $repository = app(VideoRepository::class);\n $collectionThumbs = $this->getThumbs();\n $collectionVideos = $this->getVideos();\n factory(CodeFlix\\Models\\Video::class,5)\n ->create()\n ->each(function ($video) use(\n $series,\n $categories,\n $repository,\n $collectionThumbs,\n $collectionVideos\n ){\n $repository->uploadThumb($video->id, $collectionThumbs->random());\n $repository->uploadFile($video->id, $collectionVideos->random());\n $video->categories()->attach($categories->random(4)->pluck('id'));\n $num = rand(1,3);\n if($num%2==0){\n //serie com video\n $serie = $series->random();\n $video->serie_id = $serie->id;\n $video->serie()->associate($serie);\n $video->save();\n }\n });\n }", "public function videoconferenciaSubirVolumen( ) {\n $this->subirVolumen();\n //$this->setComando(\"SUBIR_VOLUMEN\");\n }", "public function executeEditVideo(sfWebRequest $request)\n {\n // Shut off Chrome's poorly designed XSS filtering that clobbers perfectly legitimate iframe embed submissions\n // http://code.google.com/p/chromium/issues/detail?id=98787\n $this->getResponse()->setHttpHeader('X-XSS-Protection', '0');\n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n if ($item)\n {\n $this->forward404Unless($item->userHasPrivilege('edit'));\n }\n $this->item = $item;\n $embed = false;\n $parameters = $request->getParameter('a_media_item');\n \n if ($parameters)\n {\n $files = $request->getFiles('a_media_item');\n \n $this->form = new aMediaVideoForm($item);\n \n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff the\n // file, title, tags and description widgets\n $result = $this->form->classifyEmbed($parameters['embed']);\n if (isset($result['thumbnail']))\n {\n $thumbnail = $result['thumbnail'];\n if ((!isset($parameters['title'])) && (!isset($parameters['tags'])) && (!isset($parameters['description'])) && (!isset($parameters['credit'])))\n {\n $parameters['title'] = $result['serviceInfo']['title'];\n // We want tags to be lower case, and slashes break routes in most server configs. \n $parameters['tags'] = str_replace('/', '-', aString::strtolower($result['serviceInfo']['tags']));\n $parameters['description'] = aHtml::textToHtml($result['serviceInfo']['description']);\n $parameters['credit'] = $result['serviceInfo']['credit'];\n }\n }\n }\n\n // On the first pass with a youtube video we just make the service's thumbnail the\n // default thumbnail. We don't force them to use it. This allows more code reuse\n // (Moving this after the bind is necessary to keep it from being overwritten) \n if (isset($thumbnail))\n {\n $this->convertServiceThumbnailToFileUpload($thumbnail, $parameters);\n }\n \n $this->form->bind($parameters, $files);\n \n do\n {\n // first_pass forces the user to interact with the form\n // at least once. Used when we're coming from a\n // YouTube search and we already technically have a\n // valid form but want the user to think about whether\n // the title is adequate and perhaps add a description,\n // tags, etc.\n if (($this->hasRequestParameter('first_pass')) ||\n (!$this->form->isValid()))\n {\n break;\n }\n $thumbnail = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($thumbnail)\n {\n $object->preSaveFile($thumbnail->getTempName());\n }\n $this->form->save();\n \n if ($thumbnail)\n {\n $object->saveFile($thumbnail->getTempName());\n }\n \n if (aMediaTools::isSelecting())\n {\n return $this->redirect('aMedia/multipleAdd?id=' . $object->id);\n }\n\n return $this->redirect(\"aMedia/resumeWithPage\");\n } while (false);\n }\n return $this->renderTemplate();\n }", "private function facebookMediaToDatabase($bericht_id, $afbeelding, $video){\n $params = array(':bericht_id' => $bericht_id, ':afbeelding' => $afbeelding, ':video' => $video);\n list($keys, $values) = $this->e->dbObj->buildInsertLine($params);\n $this->e->dbObj->execute(\"SET character set utf8mb4\");\n $this->e->dbObj->execute(\"SET names utf8mb4\");\n $sql = \"INSERT INTO `custom_socialwall_media` (\".$keys.\") VALUES (\".$values.\")\";\n $insert_id = $this->e->dbObj->insertRow($sql, $params);\n }", "function add()\n {\n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n //them moi vao csdl\n if($this->video_model->create($data))\n {\n $this->session->set_flashdata('message', 'Thêm thành công');\n }else{\n $this->session->set_flashdata('message', 'Không thêm được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/add';\n $this->load->view('admin/main', $this->data);\n }", "public function checkVideos() : boolean {\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildPostUrl());\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t\t$fixed = json_decode($result);\n\t\t$videos = $fixed->data;\n\t\techo '<pre>';\n\t\tvar_dump($videos);\n\t\tdie();\n\t\treturn $videos;\n\t}", "function bb_video($arguments = array()) {\n\t\t$content = $this->parseArray(array('[/video]'), array());\n\n\t\t$params['width'] = 570;\n\t\t$params['height'] = 360;\n\t\t$params['iframe'] = true;\n\t\t$previewthumb = '';\n\n\t\t$type = null;\n\t\t$id = null;\n\t\t$matches = array();\n\n\t\t//match type and id\n\t\tif (strstr($content, 'youtube.com') OR strstr($content, 'youtu.be')) {\n\t\t\t$type = 'youtube';\n\t\t\tif (preg_match('#(?:youtube\\.com/watch\\?v=|youtu.be/)([0-9a-zA-Z\\-_]{11})#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['src'] = '//www.youtube.com/embed/' . $id . '?autoplay=1';\n\t\t\t$previewthumb = 'https://img.youtube.com/vi/' . $id . '/0.jpg';\n\t\t} elseif (strstr($content, 'vimeo')) {\n\t\t\t$type = 'vimeo';\n\t\t\tif (preg_match('#vimeo\\.com/(?:clip\\:)?(\\d+)#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['src'] = '//player.vimeo.com/video/' . $id . '?autoplay=1';\n\n\t\t\t$videodataurl = 'http://vimeo.com/api/v2/video/' . $id . '.php';\n\t\t\t$data = '';\n\t\t\t$downloader = new UrlDownloader;\n\t\t\tif ($downloader->isAvailable()) {\n\t\t\t\t$data = $downloader->file_get_contents($videodataurl);\n\t\t\t}\n\t\t\tif ($data) {\n\t\t\t\t$data = unserialize($data);\n\t\t\t\t$previewthumb = $data[0]['thumbnail_medium'];\n\t\t\t}\n\t\t} elseif (strstr($content, 'dailymotion')) {\n\t\t\t$type = 'dailymotion';\n\t\t\tif (preg_match('#dailymotion\\.com/video/([a-z0-9]+)#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['src'] = '//www.dailymotion.com/embed/video/' . $id . '?autoPlay=1';\n\t\t\t$previewthumb = 'http://www.dailymotion.com/thumbnail/video/' . $id;\n\t\t} elseif (strstr($content, 'godtube')) {\n\t\t\t$type = 'godtube';\n\t\t\tif (preg_match('#godtube\\.com/watch/\\?v=([a-zA-Z0-9]+)#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['id'] = $id;\n\t\t\t$params['iframe'] = false;\n\n\t\t\t$previewthumb = 'http://www.godtube.com/resource/mediaplayer/' . $id . '.jpg';\n\t\t}\n\n\t\tif (empty($type) OR empty($id)) {\n\t\t\treturn '[video] Niet-ondersteunde video-website (' . htmlspecialchars($content) . ')';\n\t\t}\n\t\treturn $this->video_preview($params, $previewthumb);\n\t}", "public function run()\n {\n $faker = Faker::create(); //create randome variables lika name,email etc\n $images = [\n '1557522399WcPLaLQWh0.png',\n '1601205391pcXGV34fyU.jpg'\n ];\n $youtube = [\n 'https://www.youtube.com/watch?v=Y49Ba16pK20',\n 'https://www.youtube.com/watch?v=HuEmunei6ZY',\n 'https://www.youtube.com/watch?v=iXKp4Pk3ic0',\n 'https://www.youtube.com/watch?v=DQK-jxjEkEY'\n ];\n $ids = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n for ($i = 0; $i < 10; $i++) {\n $array = [\n 'name' => $faker->word,\n 'meta_keywords' => $faker->name,\n 'meta_des' => $faker->name,\n 'cat_id' => 1,\n 'youtube' => $youtube[rand(0, 3)],\n 'published' => rand(0, 1),\n 'image' => $images[rand(0, 1)],\n 'des' => $faker->paragraph,\n 'user_id' => 1,\n ];\n $video = \\App\\Models\\Video::create($array);\n $video->skills()->sync(array_rand($ids, 2));\n $video->tags()->sync(array_rand($ids, 3));\n }\n }", "private function insertVideoData($uploadData, $filePath){\n //using prepared statements, prepare SQL DB to the videos values and bind them to values recieved from upload\n $query = $this->con->prepare(\"INSERT INTO videos(title, uploadedBy, description, privacy, category, filePath)\n VALUES(:title, :uploadedBy, :description, :privacy, :category, :filePath)\");\n $query->bindParam(\":title\", $uploadData->title); \n $query->bindParam(\":uploadedBy\", $uploadData->uploadedBy);\n $query->bindParam(\":description\", $uploadData->description); \n $query->bindParam(\":privacy\", $uploadData->privacy); \n $query->bindParam(\":category\", $uploadData->category); \n $query->bindParam(\":filePath\", $filePath); \n \n //if it returns successfully it'll return true, otherwise false\n return $query->execute();\n }", "public function agregarVideoLista()\r\n {\r\n $this->load->model('usuarios_model', 'usuarios');\r\n $this->load->model('listas_model', 'lista');\r\n $this->load->model('video_model', 'video');\r\n //tomo el id usuario\r\n $idusuario = $this->session->userdata('id');\r\n //tomo los datos de la sesion del usuario\r\n $datauser = $this->session->userdata();\r\n\r\n //cargo en la variable global asi no se pierden los datos\r\n $this->idvideo_youtube = $this->input->post('iddevideo');\r\n $this->titulo = $this->input->post('tituloingresado');\r\n\r\n //creo dos variables con el mismo nombre de la bd para mandarlos\r\n $idvideo_youtube = $this->idvideo_youtube;\r\n $titulo = $this->titulo;\r\n $fecha = date(\"Y-m-d H:i:s\");\r\n //busco la categoria\r\n if ($this->titulo <> \"\") {\r\n //guardo en la variable global para que no se pierda\r\n $this->idcategoria = $this->lista->getListasUsuarioBD($idusuario, $titulo);\r\n $idcategoria = $this->idcategoria;\r\n if (count($idcategoria)>0) {\r\n $videolista = array(\r\n \"idvideo_youtube\" => $idvideo_youtube,\r\n \"idcategoria\" => $idcategoria[0]->id\r\n );\r\n $resul = $this->video->agregarVideoListaBD($videolista);\r\n \r\n $datauser = $this->session->userdata();\r\n if ($resul == true) {\r\n $data = array(\r\n 'success' => true,\r\n 'message' => 'video agregado a la categoria '\r\n );\r\n echo $data['message'];\r\n $this->load->view('home_page', $datauser);\r\n } else {\r\n $data = array(\r\n 'error' => true,\r\n 'message' => 'Error al intentar registrar el video'\r\n );\r\n echo $data['message'];\r\n $this->load->view('home_page', $datauser);\r\n }\r\n }else{\r\n $this->crearLista();\r\n }\r\n } else {\r\n echo '<script language=\"javascript\">alert(\"Debe ingresar un titulo\");</script>';\r\n $this->load->view('home_page');\r\n }\r\n\r\n /*\r\n if (!$idcategoria) {\r\n $id_usuario = $this->session->userdata('id');\r\n $datauser = $this->session->userdata();\r\n\r\n $categoria = array(\r\n \"titulo\" => $titulo,\r\n \"fecha_creacion\" => $fecha,\r\n \"idusuario\" => $id_usuario\r\n );\r\n if (count($categoria) > 0) {\r\n $idcategoria = $this->lista->crearListaBD($categoria);\r\n }\r\n }\r\n $videolista = array(\r\n \"idvideo_youtube\" => $idvideo_youtube,\r\n \"idcategoria\" => $idcategoria\r\n );\r\n $resul = $this->video->agregarVideoListaBD($videolista);\r\n\r\n $datauser = $this->session->userdata();\r\n if ($resul == true) {\r\n $data = array(\r\n 'success' => true,\r\n 'message' => 'video agregado a la categoria '\r\n );\r\n echo json_encode($data);\r\n } else {\r\n $data = array(\r\n 'error' => true,\r\n 'message' => 'Error al intentar registrar el video'\r\n );\r\n echo json_encode($data);\r\n }\r\n } else {\r\n $data = array(\r\n 'error' => true,\r\n 'message' => 'EL TITULO NO DEBE SER VACIO'\r\n );\r\n echo json_encode($data);\r\n }*/\r\n }", "public function addVideoAction(){\n $data = $this->getRequestData();\n if(isset($data['video']['name']) && isset($data['video']['content'])){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/video/operation/'.$user->getKey().'-video');\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-video\");\n $folder->setParentId(6);\n $folder->save();\n }\n\n $asset = new Asset_Video();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save video!');\n }\n } else {\n $this->setErrorResponse('video is mandatory for this request!');\n }\n\n $this->_helper->json(array('video' => $asset->getId()));\n }", "public function run()\n {\n //tarjeta 1\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_1.1.jpg',\n 'producto_id' => '31',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_1.2.jpg',\n 'producto_id' => '31',\n 'status' => '1',\n ]);\n\n //tarjeta 2\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_2.1.jpg',\n 'producto_id' => '32',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_2.2.jpg',\n 'producto_id' => '32',\n 'status' => '1',\n ]);\n\n //tarjeta 3\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_3.1.jpg',\n 'producto_id' => '33',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_3.2.jpg',\n 'producto_id' => '33',\n 'status' => '1',\n ]);\n\n //tarjeta 4\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_4.1.jpg',\n 'producto_id' => '34',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_4.2.jpg',\n 'producto_id' => '34',\n 'status' => '1',\n ]);\n\n //tarjeta 5\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_5.1.jpg',\n 'producto_id' => '35',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_5.2.jpg',\n 'producto_id' => '35',\n 'status' => '1',\n ]);\n\n //tarjeta 6\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_6.1.jpg',\n 'producto_id' => '36',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_6.2.jpg',\n 'producto_id' => '36',\n 'status' => '1',\n ]);\n\n //tarjeta 7\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_7.1.jpg',\n 'producto_id' => '37',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_7.2.jpg',\n 'producto_id' => '37',\n 'status' => '1',\n ]);\n\n //tarjeta 8\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_8.1.jpg',\n 'producto_id' => '38',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_8.2.jpg',\n 'producto_id' => '38',\n 'status' => '1',\n ]);\n\n //tarjeta 9\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_9.1.jpg',\n 'producto_id' => '39',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_9.2.jpg',\n 'producto_id' => '39',\n 'status' => '1',\n ]);\n\n //tarjeta 10\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_10.1.jpg',\n 'producto_id' => '40',\n 'status' => '1',\n ]);\n\n DB::table('fotos_productos')->insert([ \n 'ruta' => 'video_10.2.jpg',\n 'producto_id' => '40',\n 'status' => '1',\n ]);\n\n }", "function addMovie($title, $cover, $year, $runtime, $storyline, $trailer, $release, $genre){\n\t\tinclude(\"connect.php\"); // Require once will not work since it was already called so you need to re include it (Since it was already trigger and wont work - reminder: close at bottom)\n\t\t//echo \"From addmovie.php\";\n\n\t\t//First thing to check is the file\n\t\t//set the conition() use the super globals\n\t\t// || is OR\n\t\tif($_FILES['cover']['type'] == \"image/jpeg\" || $_FILES['cover']['type'] == \"image/jpg\"){\n\t\t\t//echo \"JPG or JPEG\";\n\t\t}\n\t\t$target = \"../images/{$cover['name']}\"; //later add a mqsqli check for injection?\n\t\tif(move_uploaded_file($_FILES['cover']['tmp_name'], $target)){\n\n\t\t\t\t$orig = \"../images/{$cover['name']}\";\n\t\t\t\t$th_copy = \"../images/TH_{$cover['name']}\";\n\n\t\t\t\tif(!copy($orig, $th_copy)){ //the original, and where the copy is going\n\t\t\t\t\techo \"Failed to copy\";\n\t\t\t\t}\n\n\t\t\t\t$size = getimagesize($orig);\n\t\t\t\t//echo $size[0]; //Width\n\t\t\t\t//echo $size[1]; //Height\n\t\t\t\t//Can check to see if width > height for portriat, and reverse, and if they are equal a sqaure\n\n\t\t\t\t$addstring = \"INSERT INTO tbl_movies VALUES(NULL, '{$cover['name']}', '{$title}', '{$year}', '{$runtime}','{$storyline}', '{$trailer}', '{$release}' ) \";\n\n\t\t\t\t//echo $addstring;\n\n\t\t\t\t$addresult = mysqli_query($link, $addstring);\n\n\t\t\t\tif($addresult){\n\t\t\t\t\t$qstring = \"SELECT * FROM tbl_movies ORDER BY movies_ID DESC LIMIT 1\";\n\t\t\t\t\t$lastmovie = mysqli_query($link, $qstring);\n\t\t\t\t\t$row = mysqli_fetch_array($lastmovie);\n\t\t\t\t\t$lastID = $row['movies_id'];\n\t\t\t\t\t//echo $lastID;\n\n\t\t\t\t\t$genstring = \"INSERT INTO tbl_mov_genre VALUES(NULL, {$lastID}, {$genre})\"; //dealing with an integer so no qoutes around {$lastID} etc\n\t\t\t\t\t$genresult = mysqli_query($link, $genstring);\n\t\t\t\t\tredirect_to(\"admin_index.php\");\n\n\t\t}\n}\n\n\t\t\t\tmysqli_close($link);\n\n\n\t}", "public function run()\n {\n DB::table('content') ->insert([\n [\n 'url' => 'https://www.youtube.com/watch?v=u2l6nk7pMQ0',\n 'type' => 'Youtube',\n 'mediaId' => 'u2l6nk7pMQ0',\n 'userId' => '1',\n 'created_at' => '2015-12-22 16:47:23',\n ],\n [\n 'url' => 'https://vimeo.com/147703699',\n 'type' => 'Vimeo',\n 'mediaId' => '147703699',\n 'userId' => '1',\n 'created_at' => '2015-12-22 16:47:24',\n ],\n [\n 'url' => 'https://soundcloud.com/didi-3-1/chill-mix-by-didi',\n 'type' => 'Soundcloud',\n 'mediaId' => 'null',\n 'userId' => '1',\n 'created_at' => '2015-12-22 16:47:25',\n ],\n ]);\n }", "function getVideo($root_dir)\n{\n $vid_fileName = $_FILES['vid_file']['name']; //name of the file\n $vid_fileTmpName = $_FILES['vid_file']['tmp_name']; //create tmp of the file\n $vid_fileSize = $_FILES['vid_file']['size'];\n $vid_fileError = $_FILES['vid_file']['error'];\n $vid_fileType = $_FILES['vid_file']['type'];\n $fileExt = explode('.', $vid_fileName);\n $vidName = $fileExt[0];\n $fileActualExt = strtolower(end($fileExt)); //make all ext be lowercase\n $allowd = array('mp4');\n if (in_array($fileActualExt, $allowd)) {\n if ($vid_fileError === 0) {\n if ($vid_fileSize < 10000000000) {\n $fileNameNew = $vidName . \".\" . $fileActualExt; //unique name\n $fileNameNew = str_replace(\" \", \"_\", $fileNameNew);\n $fileDestination = $root_dir . 'videos/' . $fileNameNew;\n //Add image\n move_uploaded_file($vid_fileTmpName, $fileDestination);\n return $fileNameNew;\n } else {\n echo \"Your file is too big.\";\n }\n } else {\n echo \"Upload file error! Code: \" . $vid_fileError;\n }\n } else {\n echo \"Video type is invalid.\";\n }\n}", "public function create_video() {\n $args = array (\n 'labels' => array(\n 'name' => __( 'Videos' ),\n 'singular_name' => __( 'Videos' ),\n 'add_new' => __( 'Add Video' ),\n 'add_new_item' => __( 'Add New Video' ),\n 'edit_item' => __( 'Edit Video' ),\n 'new_item' => __( 'Add New Video' ),\n 'view_item' => __( 'View Video' ),\n 'search_items' => __( 'Search Videos' ),\n 'not_found' => __( 'No Videos Found' ),\n 'not_found_in_trash' => __( 'No Videos found in trash. ' )\n\t ),\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-format-video',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => true,\n 'menu_position' => 20,\n 'supports' => array('title', 'thumbnail', 'editor'),\n );\n register_post_type('video', $args);\n }", "public function lectureLive($id)\n {\n $file = Video::all();\n global $group;\n $group = Group::find($id);\n\n // $videoId = DB::table('group_videos')\n // ->join('videos', 'group_videos.video_id', '=', 'videos.id')\n // ->join('groups', 'group_videos.group_id', '=', 'groups.id')\n // ->where('groups.id' , '=' , $id)\n // ->select('videos.id')\n // ->first();\n // dd($videoId);\n // DB::insert('insert into group_videos (group_id, video_id)\n // values (?, ?)', [$id, $videoId]);\n\n\n return view('lecture-live', compact('file'), [\"data\" => $group]);\n }", "public function update(Request $request, $id)\n {\n\n try{\n\n $video = Video::find($id);\n\n $video->title = $request->input('title');\n $video->subtitle = $request->input('subtitle');\n $video->description = $request->input('description');\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n $video->tags()->detach(); //we need time to attach again this is why this line is here and not inmeduatly bedore attach tags\n $video->categories()->detach();\n if($request->hasFile('thumbnail')){\n $thumbnailFile = $request->file('thumbnail');\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName);\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n }\n if($request->hasFile('video')){\n $videoFile = $request->file('video');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $videoFile->move(public_path(\"uploads/videos/\"),$videoName);\n $video->video = asset(\"uploads/videos/$videoName\");\n\n }\n $video->categories()->attach($category->id);\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n\n $video->tags()->attach($tag->id);\n }\n $video->save();\n\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was updated successfully !!\");\n return redirect()->back();\n\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not update the video\");\n Log::warning(\"Can not update Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n\n }", "public function video($lang, $permalink) {\n $videos = Media::where('type', 0)->where('permalink', $permalink)->first();\n\n if ($videos) {\n $videos->month = Carbon::parse($videos->created_at)->format('M');\n $videos->day = Carbon::parse($videos->created_at)->day;\n\n $other_videos = videos::where('id', '!=', $videos->id)->inRandomOrder()->limit(10)->get();\n foreach ($other_videos as $n) {\n $n->ar_title = clean_limit($n->ar_title, 10);\n }\n }\n\n return $videos ? view('web.videos.video', compact('videos', 'other_videos')) : view('web.errors.notfound');\n }" ]
[ "0.6879314", "0.6626046", "0.6540052", "0.6482503", "0.6312326", "0.6234024", "0.6233246", "0.6205327", "0.62025154", "0.6143599", "0.6131805", "0.61113507", "0.610103", "0.6074896", "0.6051232", "0.6024688", "0.60225195", "0.6011578", "0.6010721", "0.59870297", "0.5982311", "0.5941687", "0.5919596", "0.5845999", "0.58103377", "0.57963413", "0.5784716", "0.57841796", "0.5778265", "0.5756083", "0.57535756", "0.57522905", "0.5730114", "0.57295686", "0.5713078", "0.5700279", "0.56966037", "0.56912905", "0.56822336", "0.5665359", "0.56490636", "0.5643269", "0.56418157", "0.56339395", "0.56005037", "0.55936706", "0.55884874", "0.5587842", "0.55763763", "0.5576108", "0.55704194", "0.55665374", "0.55647737", "0.5557866", "0.55510336", "0.5545314", "0.55451685", "0.5539051", "0.55295926", "0.5518591", "0.5513452", "0.5508359", "0.5496529", "0.5492935", "0.54915243", "0.5483384", "0.54819125", "0.54714453", "0.54713", "0.5469572", "0.54692304", "0.5465926", "0.5456135", "0.545609", "0.54505575", "0.5440141", "0.5438039", "0.54375273", "0.54298383", "0.5428508", "0.54231906", "0.5422276", "0.5406686", "0.54018486", "0.5387173", "0.5385762", "0.53847396", "0.5380389", "0.53640914", "0.5363777", "0.53605807", "0.5358364", "0.535569", "0.535205", "0.53495836", "0.5347208", "0.534055", "0.53324115", "0.53263545", "0.53258604", "0.5325682" ]
0.0
-1
Comprobar si ya existe existe la reproduccion de video con usuario
public function comprobarReproduccion(){ $query = "SELECT COUNT(*) AS existe FROM reproduccion WHERE Usuario_codUsuario = ".parent::string($this->getUsuario_codUsuario())." AND Video_codVideo = ".parent::string($this->getVideo_codVideo()).";"; $result = mysqli_query(parent::conexion(), $query); if($result){ $fila = mysqli_fetch_array($result); parent::desconectar(); return $fila; } else{ echo parent::conexion()->error; parent::desconectar(); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasVideo() {}", "function comprobar_si_existe_ya_video_lse_acepcion($id_palabra) {\n\t\t$query = \"SELECT palabra_imagen.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename\n\t\tFROM palabra_imagen, imagenes\n\t\tWHERE palabra_imagen.id_palabra='$id_palabra'\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\tAND imagenes.id_tipo_imagen=11\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$numrows=mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\treturn $numrows;\n\t}", "public function insertReproduccion(){\n $query = \"INSERT INTO reproduccion (videoVisto, Usuario_codUsuario, Video_codVideo) VALUES (true, \".parent::string($this->getUsuario_codUsuario()).\", \".parent::string($this->getVideo_codVideo()).\");\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "protected function uploadVideoFile(): bool\n {\n $oldArchive = $this->getStreamSession()->archive;\n\n $archive = new StreamSessionArchive(['streamSessionId' => $this->streamSession->id]);\n if ($this->isLink()) {\n $archive->setFileFromUrl($this->directUrl);\n } else {\n $archive->setFile($this->videoFile);\n }\n\n $duration = FileHelper::getVideoDuration($archive->getFile()->tempName);\n if (!$duration) {\n return false;\n }\n $archive->duration = (int) $duration;\n\n $rotate = FileHelper::getVideoRotate($archive->getFile()->tempName);\n if ($rotate != $this->getStreamSession()->getAttribute('rotate')) {\n $this->getStreamSession()->setAttribute('rotate', $rotate);\n if (!$this->getStreamSession()->save(true, ['rotate'])) {\n LogHelper::error('Failed to save rotation', StreamSession::LOG_CATEGORY, LogHelper::extraForModelError($this->getStreamSession()));\n return false;\n }\n }\n\n if (!$archive->saveFile() || !$archive->save()) {\n return false;\n }\n\n $this->getStreamSession()->populateRelation(StreamSession::REL_ARCHIVE, $archive);\n\n // delete old archive(if exist)\n if ($oldArchive) {\n $oldArchive->delete();\n }\n\n return true;\n }", "private function doesScreenshotExist()\n {\n try {\n $file = File::get($this->storagePath);\n } catch (\\Illuminate\\Contracts\\Filesystem\\FileNotFoundException $e) {\n App::abort(400, \"Screenshot can't be generated for URL $this->url\");\n }\n\n $this->base64 = base64_encode($file);\n }", "public function verVideoSalaEnPlasma( ) {\n\n $respuesta=self::$plasma->verEntradaPantallaAV2();\n return $this->isError($respuesta,\"ver el video de la sala en\");\n }", "function file_name_exists($name)\r\n{\r\n global $db;\r\n $results = $db->select(tbl(\"video\"),\"videoid,file_name\",\" file_name='$name'\");\r\n\r\n if($db->num_rows >0)\r\n return $results[0]['videoid'];\r\n else\r\n return false;\r\n}", "public function createVideo();", "function has_header_video()\n {\n }", "private function _checkExist()\n {\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $resource = new Resource($this->data);\n\n $sql = \"SELECT COUNT(*) FROM `resource` WHERE `video_link` = :video_link\";\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute(['video_link' => $resource->getVideoLink()]);\n\n return $stmt->fetchColumn() != 0;\n }", "function videoPlayed($IDcurso, $IDtema, $IDvideo, $IDusuario, $duracion, $segundo) {\n\tglobal $dbAn;\n\n\t//$dbAn->exec('INSERT INTO analytics (IDcurso, IDtema, IDvideo, IDusuario) VALUES ('.decrypt($IDcurso).','.decrypt($IDtema).','.decrypt($IDvideo).','.$IDusuario.')');\n\t$visto = 0;\n\tif ($duracion == $segundo) {\n\t\t$visto = 1;\n\t}\n\n\t$dbAn->exec('INSERT INTO analytics (IDcurso, IDtema, IDvideo, IDusuario, duracion, segundo, visto) VALUES ('.decrypt($IDcurso).','.decrypt($IDtema).','.decrypt($IDvideo).','.$IDusuario.', '.$duracion.', '.$segundo.', '.$visto.')');\n}", "public function verVideoconferenciaEnPlasma( ) {\n\n $respuesta=self::$plasma->verEntradaPantallaAV2();\n return $this->isError($respuesta,\"ver la videoconferencia en\");\n }", "public function generateVideos(int $oid): bool;", "public function hasProfilePicture()\n {\n $file = public_path('/images/players/') . $this->id . '.webp';\n return ( file_exists($file) ) ? true : false;\n }", "function video_preferito()\n {\n if (isset($_POST['preferito'])) {\n global $connection;\n $user_id = $_SESSION['users_id'];\n $preferito = $_POST['preferito'];\n\n if ($preferito !=\"\" && $preferito != null) {\n $query=\"SELECT COUNT(*) AS totalcount FROM prefiriti WHERE preferiti_video='$user_id'\";\n \n $result= mysqli_query($connection, $query);\n \n $rowcount=mysqli_fetch_assoc($result);\n \n if ($rowcount['totalcount'] == 0) {\n $query_insert = \"INSERT INTO prefiriti(preferiti_video,preferiti_userid) VALUES ('$preferito','$user_id')\";\n \n \n $result_insert = mysqli_query($connection, $query_insert);\n }\n }\n return header('Location: video_details.php?id='.$preferito);\n }\n }", "function videoScreen($video,$screenshot,$ss=1,$tw=320,$th=180 , $q=0)\n{\n\tshell_exec(\"ffmpeg -i \".escapeshellarg($video).\" -an -ss $ss -q $q -crf $q -vframes 1 -y \".escapeshellarg($screenshot).\" 2>&1\"); \n\n\tif(getimagesize($thumbnail))\n\t{\n\t\treturn true;\n\t}\n\t\telse\n\t{\n\t\treturn false;\n\t}\n}", "public function live_video_snapshot(Request $request) {\n\n // Log::info(\"snapshot\".print_r($request->snapshot , true));\n\n // Log::info(\"device_type \".print_r($request->device_type , true));\n\n try {\n\n $validator = Validator::make(\n $request->all(), array(\n 'video_id'=>'required|exists:live_videos,id',\n 'snapshot' => 'required',\n ));\n\n if ($validator->fails()) {\n\n // Error messages added in response for debugging\n\n $errors = implode(',',$validator->messages()->all());\n\n throw new Exception($errors); \n\n } else {\n\n\n $live_video_details = LiveVideo::find($request->video_id);\n\n if ($live_video_details) {\n\n if(!$live_video_details->is_streaming) {\n\n throw new Exception(tr('stream_stopped'));\n\n } else {\n\n File::isDirectory(public_path().'/uploads/rooms') or File::makeDirectory(public_path().'/uploads/rooms', 0777, true, true);\n\n\n if ($request->snapshot) {\n\n if($request->device_type == DEVICE_WEB) {\n\n $data = explode(',', $request->get('snapshot'));\n\n file_put_contents(join(DIRECTORY_SEPARATOR, [public_path(), 'uploads', 'rooms', $request->video_id . '.png']), base64_decode($data[1]));\n\n $live_video_details->snapshot = Helper::web_url().\"/uploads/rooms/\".$request->video_id . '.png';\n\n } else if ($request->device_type == DEVICE_IOS) {\n\n\n if($request->snapshot) {\n\n $picture = $request->file('snapshot');\n \n $ext = $picture->getClientOriginalExtension();\n\n $picture->move(public_path().\"/uploads/rooms/\", $$request->video_id . \".\" . $ext);\n\n\n }\n \n $live_video_details->snapshot = Helper::web_url().\"/uploads/rooms/\".$request->video_id . '.'.$ext;\n\n }else{\n\n file_put_contents(join(DIRECTORY_SEPARATOR, [public_path(), 'uploads', 'rooms', $request->video_id . '.png']), base64_decode($request->snapshot));\n\n $live_video_details->snapshot = Helper::web_url().\"/uploads/rooms/\".$request->video_id . '.png';\n\n\n }\n\n \n\n $live_video_details->save();\n\n $response_array = ['success' => true];\n\n } else {\n\n throw new Exception(tr('snapshot_empty'));\n\n\n }\n\n } \n\n } else {\n\n throw new Exception(tr('no_live_video_present'));\n \n }\n \n return response()->json($response_array,200);\n\n }\n\n } catch (Exception $e) {\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return $response_array;\n }\n\n }", "public function has_video() {\r\n\t\treturn strlen( $this->video );\r\n\t}", "public function mostrarVideoController($datos)\n {\n $aleatorio = mt_rand(100, 999);\n $ruta = '../../views/videos/video' . $aleatorio . '.mp4';\n\n //permite subir cualquier tipo de archivo\n\n\n if (move_uploaded_file($datos, $ruta)) {\n //haciendo el insert desde el modelo de la ruta\n $respuesta = @GestorVideosModel::subirVideoModel($ruta, 'videos');\n if ($respuesta == 'ok') {\n //query que me devuelve con el url del video subido al server e insertado en la BD\n $respuesta2 = @GestorVideosModel::mostrarVideoModel($ruta, 'videos');\n $enviarDatos = $respuesta2['ruta'];\n echo $enviarDatos;\n } else {\n echo 'error';\n }\n } else {\n echo 'error';\n }\n }", "function has_hq($vdetails,$is_file=false)\r\n{\r\n if(!$is_file)\r\n $file = get_hq_video_file($vdetails);\r\n else\r\n $file = $vdetails;\r\n\r\n if(getext($file)=='mp4')\r\n return $file;\r\n else\r\n return false;\r\n}", "function video_playable($id)\r\n{\r\n global $cbvideo,$userquery;\r\n\r\n if(isset($_POST['watch_protected_video']))\r\n $video_password = mysql_clean(post('video_password'));\r\n else\r\n $video_password = '';\r\n\r\n if(!is_array($id))\r\n $vdo = $cbvideo->get_video($id);\r\n else\r\n $vdo = $id;\r\n $uid = userid();\r\n if(!$vdo)\r\n {\r\n e(lang(\"class_vdo_del_err\"));\r\n return false;\r\n }elseif($vdo['status']!='Successful')\r\n {\r\n e(lang(\"this_vdo_not_working\"));\r\n if(!has_access('admin_access',TRUE))\r\n return false;\r\n else\r\n return true;\r\n }elseif($vdo['broadcast']=='private'\r\n && !$userquery->is_confirmed_friend($vdo['userid'],userid())\r\n && !is_video_user($vdo)\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid){\r\n e(lang('private_video_error'));\r\n return false;\r\n }elseif($vdo['active'] == 'pen'){\r\n e(lang(\"video_in_pending_list\"));\r\n if(has_access('admin_access',TRUE) || $vdo['userid'] == userid())\r\n return true;\r\n else\r\n return false;\r\n }elseif($vdo['broadcast']=='logged'\r\n && !userid()\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid){\r\n e(lang('not_logged_video_error'));\r\n return false;\r\n }elseif($vdo['active']=='no' )\r\n {\r\n e(lang(\"vdo_iac_msg\"));\r\n if(!has_access('admin_access',TRUE))\r\n return false;\r\n else\r\n return true;\r\n }\r\n //No Checking for video password\r\n elseif($vdo['video_password']\r\n && $vdo['broadcast']=='unlisted'\r\n && $vdo['video_password']!=$video_password\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid)\r\n {\r\n if(!$video_password)\r\n e(lang(\"video_pass_protected\"));\r\n else\r\n e(lang(\"invalid_video_password\"));\r\n template_files(\"blocks/watch_video/video_password.html\",false,false);\r\n }\r\n else\r\n {\r\n $funcs = cb_get_functions('watch_video');\r\n\r\n if($funcs)\r\n foreach($funcs as $func)\r\n {\r\n $data = $func['func']($vdo);\r\n if($data)\r\n return $data;\r\n }\r\n return true;\r\n }\r\n}", "function creaFichero($nombre, $ruta, $contenido){\r\n (file_put_contents($nombre, $ruta, $contenido) !== false) ? true : false;\r\n}", "function creaAutore()\n{\n global $connection;\n $_SESSION['authorSuccess'] = false;\n $_SESSION['authorError'] = false;\n $_SESSION['authorExist'] = false;\n $_SESSION['extError'] = false;\n if (isset($_POST['btn_creaAutore'])) {\n $nome = mysqli_real_escape_string($connection, $_POST['nome']);\n $cognome = mysqli_real_escape_string($connection, $_POST['cognome']);\n $citta = mysqli_real_escape_string($connection, $_POST['citta']);\n $descrizione = mysqli_real_escape_string($connection, $_POST['descrizione']);\n $photo = mysqli_real_escape_string($connection, $_FILES['photo']['name']);\n $photoLocationFolder = '../../../image/autoreImg/';\n $facebook = mysqli_real_escape_string($connection, $_POST['facebook']);\n $twitter = mysqli_real_escape_string($connection, $_POST['twitter']);\n $linkedin = mysqli_real_escape_string($connection, $_POST['linkedin']);\n $instagram = mysqli_real_escape_string($connection, $_POST['instagram']);\n\n $photoPath = $photoLocationFolder.$photo;\n $extArrPhoto = ['jpg', 'jpeg', 'png'];\n $extPhoto = pathinfo($photoPath, PATHINFO_EXTENSION);\n $extPhoto = strtolower($extPhoto);\n $photoTimestampTitle = time().'.'.$extPhoto;\n $photoPathNew = $photoLocationFolder.$photoTimestampTitle;\n\n if (in_array($extPhoto, $extArrPhoto)) {\n if (move_uploaded_file($_FILES['photo']['tmp_name'], $photoPathNew)) {\n $select_autore = \"SELECT * FROM autore_video WHERE nome_autore='$nome' AND cognome_autore='$cognome'\";\n $result_autore_exist = mysqli_query($connection, $select_autore);\n\n if (mysqli_num_rows($result_autore_exist) == 0) {\n $insert_autore = \"INSERT INTO autore_video(nome_autore, cognome_autore, citta_autore, desc_autore, img_autore, fb_autore, linkedin_autore, twitter_autore, insta_autore) \n VALUES ('$nome', '$cognome', '$citta', '$descrizione', '$photoTimestampTitle', '$facebook', '$linkedin', '$twitter', '$instagram')\";\n\n $result = mysqli_query($connection, $insert_autore);\n if ($result) {\n $_SESSION['authorSuccess'] = true;\n } else {\n $_SESSION['authorError'] = mysqli_error($connection);\n }\n } else {\n $_SESSION['authorExist'] = true;\n }\n }\n } else {\n $_SESSION['extError'] = true;\n }\n }\n}", "function getVideo($root_dir)\n{\n $vid_fileName = $_FILES['vid_file']['name']; //name of the file\n $vid_fileTmpName = $_FILES['vid_file']['tmp_name']; //create tmp of the file\n $vid_fileSize = $_FILES['vid_file']['size'];\n $vid_fileError = $_FILES['vid_file']['error'];\n $vid_fileType = $_FILES['vid_file']['type'];\n $fileExt = explode('.', $vid_fileName);\n $vidName = $fileExt[0];\n $fileActualExt = strtolower(end($fileExt)); //make all ext be lowercase\n $allowd = array('mp4');\n if (in_array($fileActualExt, $allowd)) {\n if ($vid_fileError === 0) {\n if ($vid_fileSize < 10000000000) {\n $fileNameNew = $vidName . \".\" . $fileActualExt; //unique name\n $fileNameNew = str_replace(\" \", \"_\", $fileNameNew);\n $fileDestination = $root_dir . 'videos/' . $fileNameNew;\n //Add image\n move_uploaded_file($vid_fileTmpName, $fileDestination);\n return $fileNameNew;\n } else {\n echo \"Your file is too big.\";\n }\n } else {\n echo \"Upload file error! Code: \" . $vid_fileError;\n }\n } else {\n echo \"Video type is invalid.\";\n }\n}", "function checkVideo($arrl)\n\t\t{\n\t\t\t//check if the post contain video\n\t\t\tif($arrl['is_video'] == true)\n\t\t\t{\n\t\t\t\treturn $arrl['video_url'];\n\t\t\t}\n\t\t}", "public function onUpload($upload_path, $f_mime, $path_app_html_root, $sub_folder, $f_name, $f_ext, $path_component, $comp_id, $conf) {\n if (!file_exists(\"$path_app_html_root/$sub_folder\")) {\n mkdir(\"$path_app_html_root/$sub_folder\");\n }\n chdir(\"$path_app_html_root/$sub_folder\");\n $thumbnail_filename = \"$path_app_html_root/$sub_folder/$f_name.png\";\n $video_filename = \"$path_app_html_root/$sub_folder/$f_name.mp4\";\n \n//now we search the file system to see if this was already uploaded, we achieve this by naming the files the same as the checksum of the file\n $find_files = array();\n $dir = new \\RecursiveDirectoryIterator($conf[\"paths\"][\"app\"]);\n $iterator = new \\RecursiveIteratorIterator($dir);\n foreach (new \\RegexIterator($iterator, \"/$f_name.mp4/i\", RecursiveRegexIterator::GET_MATCH) as $file) {\n $find_files[] = $iterator->getPathname();\n }\n\n//found a previous upload, just copy file\n if (!empty($find_files)) {\n copy($find_files[0], $video_filename);\n copy(str_replace(\".mp4\", \".png\", $find_files[0]), $thumbnail_filename);\n } else {\n \n//generate thumbnail\n exec(\"ffmpeg -ss 00:00:05.000 -i '$upload_path' -vframes 1 -s 640x480 '$thumbnail_filename'\");\n//if none created skip time parameter and let first frame be thumbnail\n if (!file_exists(\"$thumbnail_filename\")) {\n exec(\"ffmpeg -i '$upload_path' -vframes 1 -s 640x480 '$thumbnail_filename'\");\n }\n\n//convert file if wider than 480 (https://trac.ffmpeg.org/wiki/Scaling%20(resizing)%20with%20ffmpeg), or if different file format than h264/aac: \n exec(\"ffmpeg -i '$upload_path' -vf \\\"scale='min(iw,480)':-2\\\" -vcodec h264 -acodec aac -strict -2 '$f_name.mp4' \");\n }\n// Old: exec(\"ffmpeg -i '$upload_path' -vcodec mpeg4 -acodec libfdk_aac '$file_filename'.mp4\");\n// Web/iOS: exec(\"ffmpeg -i '$upload_path' -vcodec h264 -acodec aac -strict -2 '$file_filename'.mp4 \");\n return \"$sub_folder/$f_name.mp4\";\n }", "public function getVideoSnapshotUrl() {\n if ($this->file_type == self::FILE_TYPE_VIDEO) {\n $file_path = ($this->is_approved == 1) ? $this->file_path : $this->file_path_tmp;\n $snapshot = $file_path . $this->video_snapshot_name . '.jpg';\n\n if (!file_exists(Yii::getAlias('@root') . $snapshot)) {\n if (Yii::$app->ffmpeg) {\n $video_url = Yii::getAlias('@root') . $this->getFileUrl();\n\n if ($this->is_approved == 1)\n $snaphot_path = Yii::getAlias('@root') . $this->file_path;\n else\n $snaphot_path = Yii::getAlias('@root') . $this->file_path_tmp;\n\n $snapshot_name = md5(time() . rand(0, 1000));\n $success = Yii::app()->ffmpeg->getSnapshot($video_url, $snaphot_path, $snapshot_name);\n if ($success) {\n $this->video_snapshot_name = $snapshot_name;\n $this->save(false, ['video_snapshot_name']);\n }\n } else throw new HttpException(500, 'FFMpeg component for video snapshot is not found.');\n }\n\n $snapshot = $file_path . $this->video_snapshot_name . '.jpg';\n if (file_exists(Yii::getAlias('@root') . $snapshot) && !is_dir(Yii::getAlias('@root') . $snapshot))\n return $snapshot;\n }\n\n return null;\n }", "public function isVideo()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return false;\r\n }", "function testPosterFile() {\n $v = $this->loadMovie(\"FakeMovie1/FakeMovie1.mp4\");\n\n //rename the poster file temorarily so we can test that the video knows it doesn't have a poster\n $posterPath = $v->getPosterPath();\n rename($posterPath, \"$posterPath.tmp\");\n //the video shound no longer think it has a poster\n $this->assertFalse($v->posterExists());\n //rename the poster back\n rename(\"$posterPath.tmp\", $posterPath);\n //the video should know it has a poster again\n $this->assertTrue($v->posterExists());\n\n //\n //Test the sd and hd poster presence and creation\n //there should be no sd poster\n $this->assertFalse($v->sdPosterExists());\n //create the sd poster\n $this->assertTrue($v->generateSdPoster());\n //the sd poster should exist now\n $this->assertTrue($v->sdPosterExists());\n //destroy the sd poster\n unlink($v->getSdPosterPath());\n\n //there should be no hd poster\n $this->assertFalse($v->hdPosterExists());\n //create the hd poster\n $this->assertTrue($v->generateHdPoster());\n //the sd poster should exist now\n $this->assertTrue($v->hdPosterExists());\n //destroy the sd poster\n unlink($v->getHdPosterPath());\n }", "public function check_exists(){\n if(!file_exists($this->file['tmp_name']) ){\n $this->file_name = 'sample.jpg';\n }else{\n $this->tmp_file_name = $this->file['tmp_name'];\n $this->file_type = $this->file['type'];\n $this->file_name = time() . '_' . $this->file['name']; //give name a timestamp to ensure no duplicate images made in the future\n }\n }", "public function can_be_uploaded()\n {\n $this->withoutExceptionHandling();\n $video = $this->uploadVideo(UploadedFile::fake()->create('avatar.mp4',11204));\n $video->assertSuccessful();\n }", "public function uploadVideoFromMine(){\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\n header(\"Pragma: no-cache\");\n session_start();\n // Support CORS\n // header(\"Access-Control-Allow-Origin: *\");\n // other CORS headers if any...\n if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {\n exit; // finish preflight CORS requests here\n }\n if ( !empty($_REQUEST[ 'debug' ]) ) {\n $random = rand(0, intval($_REQUEST[ 'debug' ]) );\n if ( $random === 0 ) {\n header(\"HTTP/1.0 500 Internal Server Error\");\n exit;\n }\n }\n // header(\"HTTP/1.0 500 Internal Server Error\");\n // exit;\n // 5 minutes execution time\n @set_time_limit(5 * 60);\n // Uncomment this one to fake upload time\n // usleep(5000);\n // Settings\n // $targetDir = ini_get(\"upload_tmp_dir\") . DIRECTORY_SEPARATOR . \"plupload\";\n $targetDir = ROOT_PATH.'public'.DS.'uploads'.DS.'video'.DS.'tmp';\n $uploadDir = ROOT_PATH.'public'.DS.'uploads'.DS.'video';\n $cleanupTargetDir = true; // Remove old files\n $maxFileAge = 5 * 3600; // Temp file age in seconds\n // Create target dir\n Log::record('Create target temp dir');\n if (!file_exists($targetDir)) {\n @mkdir($targetDir, 0777, true);\n }\n Log::record('Create target upload dir');\n // Create target dir\n if (!file_exists($uploadDir)) {\n @mkdir($uploadDir, 0777, true);\n }\n // 写入分片\n if(!isset($_POST['status'])){\n if(isset($_SESSION['chunkName'])){\n $fileName = $_SESSION['chunkName'];\n } else {\n $fileName = uniqid(\"file_\");\n }\n\n Log::record('Create file name use uniqid '.$fileName);\n $filePath = $targetDir . DS . $fileName;\n $uploadPath = $uploadDir . DS . $fileName;\n // Chunking might be enabled\n// $chunk = isset($_REQUEST[\"chunk\"]) ? intval($_REQUEST[\"chunk\"]) : 0;\n// $chunks = isset($_REQUEST[\"chunks\"]) ? intval($_REQUEST[\"chunks\"]) : 1;\n $chunk = 0;\n $chunks = 1;\n Log::record('check chunk:'.$chunk.' and chunks:'.$chunks);\n // Remove old temp files\n if ($cleanupTargetDir) {\n Log::record('remove old temp files');\n if (!is_dir($targetDir) || !$dir = opendir($targetDir)) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 100, \"message\": \"Failed to open temp directory.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 100, \"message\": \"Failed to open temp directory.\"}, \"id\" : \"id\"}');\n }\n while (($file = readdir($dir)) !== false) {\n $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;\n // If temp file is current file proceed to the next\n if ($tmpfilePath == \"{$filePath}_{$chunk}.part\" || $tmpfilePath == \"{$filePath}_{$chunk}.parttmp\") {\n Log::record('If temp file is current file proceed to the next');\n continue;\n }\n // Remove temp file if it is older than the max age and is not the current file\n if (preg_match('/\\.(part|parttmp)$/', $file) && (@filemtime($tmpfilePath) < time() - $maxFileAge)) {\n Log::record('Remove temp file if it is older than the max age and is not the current file');\n @unlink($tmpfilePath);\n }\n }\n closedir($dir);\n }\n // Open temp file\n if (!$out = @fopen(\"{$filePath}_{$chunk}.parttmp\", \"wb\")) {\n Log::record('open temp file');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\n }\n// $writ_point = 0;\n if (!empty($_FILES)) {\n Log::record('_files is true::'. $_FILES[\"file\"][\"size\"].$_FILES['file']['name']. $_FILES[\"file\"][\"error\"]);\n $_SESSION['file_name'] = $_FILES['file']['name'];\n if ($_FILES[\"file\"][\"error\"] || !is_uploaded_file($_FILES[\"file\"][\"tmp_name\"])) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 103, \"message\": \"Failed to move uploaded file.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 103, \"message\": \"Failed to move uploaded file.\"}, \"id\" : \"id\"}');\n }\n // Read binary input stream and append it to temp file\n Log::record('Read binary input stream and append it to temp file'.$_FILES[\"file\"][\"tmp_name\"]);\n if (!$in = @fopen($_FILES[\"file\"][\"tmp_name\"], \"rb\")) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n }\n } else {\n Log::record('php://input is true');\n if (!$in = @fopen(\"php://input\", \"rb\")) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n }\n// $writ_point = strlen(file_get_contents(\"php://input\")) - $_SESSION['chunk_size'];\n// $writ_point = $writ_point > 0? $writ_point: 0;\n Log::record('file size:'.'ppppppp');\n\n }\n Log::record('write file data '.$_SESSION['chunk_size']);\n// fseek($in, $writ_point);\n Log::record(\"{$filePath}_{$chunk}:\");\n while ($buff = fread($in, 4096)) {\n fwrite($out, $buff);\n }\n @fclose($out);\n @fclose($in);\n Log::record('rename for write file');\n rename(\"{$filePath}_{$chunk}.parttmp\", \"{$filePath}_{$chunk}.part\");\n $index = 0;\n $done = true; //判断上传分片是否成功\n Log::record('判断上传分片是否成功');\n for( $index = 0; $index < $chunks; $index++ ) {\n Log::record('file name::'.\"{$filePath}_{$index}.part\");\n if ( !file_exists(\"{$filePath}_{$index}.part\") ) {\n $done = false;\n Log::record('判断上传分片失败');\n break;\n }\n }\n if ( $done ) {\n Log::record('判断上传分片成功');\n if (!$out = @fopen($uploadPath, \"wb\")) {\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\n }\n if ( flock($out, LOCK_EX) ) {\n Log::record('锁定文件,写入');\n for( $index = 0; $index < $chunks; $index++ ) {\n if (!$in = @fopen(\"{$filePath}_{$index}.part\", \"rb\")) {\n break;\n }\n while ($buff = fread($in, 4096)) {\n fwrite($out, $buff);\n }\n @fclose($in);\n @unlink(\"{$filePath}_{$index}.part\");\n }\n flock($out, LOCK_UN);\n Log::record('解锁');\n }\n @fclose($out);\n }\n // Return Success JSON-RPC response\n Log::record('Return Success JSON-RPC response');\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\"}');\n }\n if ($_POST['status'] == 'md5Check'){ //文件校验,避免重复上传,秒传\n Log::record('post status:: md5Check');\n //todo 查询数据库,获取文件名和md5校验名\n $dataArr = array('b0201e4d41b2eeefc7d3d355a44c6f5a' => 'kazaff2.jpg');\n //todo 对比上传文件是否已经上传过\n if(isset($dataArr[$_POST['md5']])){\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\", \"exist\": 1}');\n// return json(['ifExist'=>1, 'path'=>$dataArr[$_POST['md5']]]);\n } else {\n die('{\"exist\": 0}');\n// return json(['ifExist'=>0]);\n }\n } elseif($_POST['status'] == 'chunkCheck'){ //分片校验,用于断点续传,验证指定分块是否已经存在,避免重复上传\n Log::record('post status:: chunkCheck');\n $target = $uploadDir.DS.$_POST['name'].'_'.$_POST['chunkIndex'];\n $_SESSION['file_length_from_header'] = isset($_SERVER['content-length'])? intval($_SERVER['content-length']):0;\n $_SESSION['chunk_size'] = $_POST['size'];\n Log::record('file length from header:'.$_SESSION['file_length_from_header'].' chunk size:'.$_SESSION['chunk_size']);\n if(file_exists($target) && filesize($target) == $_POST['size']){\n Log::record('chunkCheck:: file is exited, need not upload');\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\", \"exist\": 1}');\n// return json(['ifExist' => 1]);\n } else {\n Log::record('chunkCheck:: file is not exited, this is new chunk and need upload');\n $_SESSION['chunkName'] = $_REQUEST[\"name\"].'_'.$_REQUEST['chunkIndex'];\n die('{\"exist\": 0}');\n// return json(['ifExist' => 0]);\n }\n } elseif ($_POST['status'] == 'chunksMerge'){//合并分片\n Log::record('post status:: chunksMerge');\n //todo 合并分片\n $file_name = $_SESSION['file_name'];\n $file_tmp_name = $_REQUEST['name'];\n $file_md5_name = $_REQUEST['md5'];\n $file_ext = $_REQUEST['ext'];\n $file_chunks = $_REQUEST['chunks'];\n $uploadPath = $uploadDir.DS.$file_md5_name.'.'.$file_ext;\n $uploadedFiles = $uploadDir.DS.$file_tmp_name;\n Log::record('file name:'.$file_name.'::file tmp name:'.$file_tmp_name.'::file md5 name:'.$file_md5_name.'::file ext:'.$file_ext);\n if (!$out = @fopen($uploadPath, \"wb\")) {\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\n }\n if ( flock($out, LOCK_EX) ) {\n Log::record('锁定文件,写入');\n for( $index = 0; $index < $file_chunks; $index++ ) {\n if (!$in = @fopen(\"{$uploadedFiles}_{$index}\", \"rb\")) {\n break;\n }\n while ($buff = fread($in, 4096)) {\n fwrite($out, $buff);\n }\n @fclose($in);\n @unlink(\"{$uploadedFiles}_{$index}\");\n }\n flock($out, LOCK_UN);\n Log::record('解锁');\n\n $vm = new VideoManagement();\n\n if($vm->insertNewVideo('uploads'.DS.'video'.DS.$file_md5_name.'.'.$file_ext, $_POST['detail'], substr($file_name, 0, (strlen($file_name)-strlen($file_ext)-1)))){\n die('{\"flag\":\"S\", \"msg\":\"视频上传成功\"}');\n } else {\n die('{\"flag\": \"F\", \"msg\":\"视频上传失败\"}');\n }\n } else {\n die('{\"flag\": \"F\", \"msg\":\"视频上传失败\"}');\n }\n @fclose($out);\n session_destroy();\n }\n }", "function testDowloadPoster() {\n $v = $this->loadMovie(\"FakeMovie1/FakeMovie1.mp4\");\n $posterPath = $v->getPosterPath();\n rename($posterPath, \"$posterPath.tmp\");\n //download an image from a web server (this web server) and save it as the poster\n $this->assertTrue($v->downloadPoster(getBaseUrl() . \"test/videos/movies/FakeMovie2/folder.jpg\"));\n\n //does the poster exist?\n $this->assertTrue($v->posterExists());\n\n //delete the bogus picture\n unlink($posterPath);\n //move the original picture back \n rename(\"$posterPath.tmp\", $posterPath);\n }", "static public function makeThumbnail(HasMovieFileContract $objectWithMovie)\n {\n\n// Location where video thumbnail to store\n $thumbnail_path = 'your_site_domain/media/images/thumbnail/';\n $second = 1;\n $thumbSize = '200x200';\n\n// Video file name without extension(.mp4 etc)\n $videoname = $objectWithMovie->getMovieFileName();\n $video_file_path = public_path('uploads/' . $objectWithMovie->getMovieFileName());\n $path_to_store_generated_thumbnail = public_path('uploads/' . $videoname . '.jpg');\n\n// FFmpeg Command to generate video thumbnail\n\n $cmd = `ffmpeg -i \"{$video_file_path}\" -deinterlace -an -ss {$second} -t 00:00:01 -s {$thumbSize} -r 1 -y -vcodec mjpeg -f mjpeg \"{$path_to_store_generated_thumbnail}\" 2>&1`;\n $objectWithMovie->thumbnail = $videoname . '.jpg';\n $objectWithMovie->save();\n\n //exec($cmd, $output, $retval);\n\n// if ($retval) {\n// echo 'error in generating video thumbnail';\n// } else {\n// echo 'Thumbnail generated successfully';\n// $objectWithMovie->thumbnail = $thumbnail_path . $videoname . '.jpg';\n// $objectWithMovie->save();\n// }\n }", "private function videoExists($file_name, $extension) {\n\t\t$key = 'videos/' . str_replace($extension, 'mp4', $file_name);\n\t\treturn $this->s3->objectExists($this->s3->request['bucket'], $key);\n\t}", "private function isDuplicate($videoId) {\n// print_r($channelId);\n// print_r($title);\n $count = $this->Vod_Detail->find('count', array(\n 'conditions' => array(\n array('id_videoId' => $videoId),\n // array('published' => '0'),\n )\n ));\n return $count;\n }", "function get_hq_video_file($vdetails,$return_default=true)\r\n{\r\n return get_video_file($vdetails,$return_default,true,false,false,true);\r\n}", "protected function getVideo()\n {\n $names = $this->generateVideoName();\n $command = implode(' ', [\n $this->getVideoServiceConfig('video_app'),\n '-i ' . $this->getVideoServiceConfig('video_source'),\n '-c copy',\n '-f mp4',\n '-t ' . $this->getVideoServiceConfig('video_length'),\n $names['file'],\n '1> ' . $names['log'],\n '2>&1',\n ]);\n\n if (0 === stripos(PHP_OS, 'WIN')) {\n pclose(popen('start /B ' . $command, 'r'));\n } else {\n pclose(popen($command . ' &', 'r'));\n }\n\n $this->createNewRecording($names['file']);\n if ($this->checkLog($names['log'])) {\n $this->getVideo();\n }\n }", "function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM REPORT WHERE titleFileVideo = ? AND idArt = ?\");\n\t\t\t$exist->execute(array($this->titleFileVideo, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}", "public function saveArchive(): bool\n {\n if (!$this->uploadVideoFile()) {\n $attribute = $this->isLink() ? UploadArchiveInterface::FIELD_DIRECT_URL : UploadArchiveInterface::FIELD_VIDEO_FILE;\n $errorsList = Yii::createObject(ErrorListInterface::class);\n $this->addError($attribute, $errorsList->createErrorMessage(ErrorList::FILE_INVALID));\n return false;\n }\n return true;\n }", "private static function _is_make_trick_video(array $videos): bool\n\t{\n\t\treturn count($videos) > 1;\n\t}", "function vkey_exists($key)\r\n{\r\n global $db;\r\n $db->select(tbl(\"video\"),\"videokey\",\" videokey='$key'\");\r\n if($db->num_rows>0)\r\n return true;\r\n else\r\n return false;\r\n}", "function is_video() {\n return is_singular( array( 'video' ) );\n }", "protected function findOrAddVideo($info)\n {\n $mediaId = null;\n $slug = null;\n\n if (!isset($info['title']))\n {\n $info['title'] = 'Imported video';\n }\n $slug = aTools::slugify((!empty($info['title'])) ? $info['title'] : ((!empty($info['service_url'])) ? $info['service_url'] : md5($info['embed'])));\n\n $result = $this->sql->query('SELECT id FROM a_media_item WHERE slug = :slug', array('slug' => $slug));\n if (isset($result[0]['id']))\n {\n $mediaId = $result[0]['id'];\n } else\n {\n $mediaItem = new aMediaItem();\n foreach ($info as $key => $value)\n {\n if ($key !== 'tags')\n {\n $mediaItem[$key] = $value;\n }\n }\n if (empty($mediaItem['title']))\n {\n $mediaItem->setTitle($slug);\n }\n else\n {\n $mediaItem->setTitle($info['title']);\n }\n $mediaItem->setSlug($slug);\n $mediaItem->setType('video');\n $service = null;\n if ($mediaItem->service_url)\n {\n $service = aMediaTools::getEmbedService($mediaItem->service_url);\n }\n if ($service)\n {\n $id = $service->getIdFromUrl($mediaItem->service_url);\n if ($service->supports('thumbnail'))\n {\n $filename = $service->getThumbnail($id);\n if ($filename)\n {\n // saveFile can't handle a nonlocal file directly, so\n // copy to a temporary file first\n $bad = isset($this->failedMedia[$filename]);\n if (!$bad)\n {\n $tmpFile = aFiles::getTemporaryFilename();\n try\n {\n if (!copy($filename, $tmpFile))\n {\n throw new sfException(sprintf('Could not copy file: %s', $src));\n }\n if (!$mediaItem->saveFile($tmpFile))\n {\n throw new sfException(sprintf('Could not save file: %s', $src));\n }\n } catch (Exception $e)\n {\n $this->failedMedia[$filename] = true;\n }\n aFiles::unlink($tmpFile);\n }\n }\n }\n }\n $this->sql->fastSaveMediaItem($mediaItem);\n if (count($info['tags']))\n {\n $this->sql->fastSaveTags('aMediaItem', $mediaItem->id, $info['tags']);\n }\n $mediaId = $mediaItem->id;\n $mediaItem->free(true);\n }\n return $mediaId;\n }", "private function uploadVideo($video)\n {\n $file = request()->file('video_uri');\n\n // Get filename with the extension\n $filenameWithExt = $file->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $file->getClientOriginalExtension();\n\n $fileNameToStore = 'video-' . $video->id . '.' . $extension;\n $path = $file->storeAs('public', $fileNameToStore);\n $file->move(base_path('\\public\\videos'), $fileNameToStore);\n $fileNameToStore = Str::replaceFirst('public/', '', $path);\n\n if(file_exists(public_path().'/videos/'. $fileNameToStore) && Storage::exists('public/' . $fileNameToStore)){\n Storage::delete('public/' . $fileNameToStore);\n return $fileNameToStore;\n }\n \n return null;\n }", "function check_test_camera(){\n\t\tini_set('max_execution_time', 0);\n//\t\tini_set(\"memory_limit\",\"5012M\");\n\t\tini_set(\"memory_limit\",\"-1\");\n\t\t$output['status'] ='ok';\n\t\t//for check camera expire\n\t\t$string = \"select * from camera where is_test =1\";\n\t\t$cameras = $this->comman_model->get_query($string,false);\n\t\tif($cameras){\n\t\t\tforeach($cameras as $set_camera){\n\t\t\t\tif(!empty($set_camera->camera_path)){\n\t\t\t\t\t$path = '/var/www/html/data/'.$set_camera->camera_path.'/camera '.$set_camera->id;\n\t\t\t\t\tif(ENVIRONMENT=='production'){\n\t\t\t\t\t\t$path = 'data/'.$set_camera->camera_path.'/camera '.$set_camera->id;\n\t\t\t\t\t}\n\t\t\t\t\techo '<br>'.$path;\n\t\t\t\t\t$this->deleteDir($path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo json_encode($output);\n\t}", "function existeUsuario($usuario){\n\tif (hasKey(BUCKET_USUARIOS,$usuario))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "static function checkAndPrepare($formname, $key = 'we_document'){\n\t\tif(!(isset($_FILES['we_ui_' . $formname]) && is_array($_FILES['we_ui_' . $formname]) && isset($_FILES['we_ui_' . $formname]['name']) && is_array($_FILES['we_ui_' . $formname]['name']) )){\n\t\t\treturn;\n\t\t}\n\t\t//$webuserId = isset($_SESSION['webuser']['ID']) ? $_SESSION['webuser']['ID'] : 0;\n\n\t\tforeach($_FILES['we_ui_' . $formname]['name'] as $videoName => $filename){\n\n\t\t\t$videoDataId = we_base_request::_(we_base_request::STRING, 'WE_UI_FLASHMOVIE_DATA_ID_' . $videoName);\n\n\t\t\tif($videoDataId !== false && isset($_SESSION[$videoDataId])){\n\n\t\t\t\t$_SESSION[$videoDataId]['doDelete'] = false;\n\n\t\t\t\tif(we_base_request::_(we_base_request::BOOL, 'WE_UI_DEL_CHECKBOX_' . $videoName)){\n\t\t\t\t\t$_SESSION[$videoDataId]['doDelete'] = true;\n\t\t\t\t} elseif($filename){\n\t\t\t\t\t// file is selected, check to see if it is an image\n\t\t\t\t\t$ct = getContentTypeFromFile($filename);\n\t\t\t\t\tif($ct == $this->ContentType){\n\t\t\t\t\t\t$videoid = intval($GLOBALS[$key][$formname]->getElement($videoName));\n\n\t\t\t\t\t\t// move document from upload location to tmp dir\n\t\t\t\t\t\t$_SESSION[$videoDataId]['serverPath'] = TEMP_PATH . we_base_file::getUniqueId();\n\t\t\t\t\t\tmove_uploaded_file($_FILES['we_ui_' . $formname]['tmp_name'][$videoName], $_SESSION[$videoDataId]['serverPath']);\n\n\t\t\t\t\t\t$unique = we_base_file::getUniqueId();\n\t\t\t\t\t\t$tmp_Filename = $videoName . '_' . $unique . '_' . preg_replace('[^A-Za-z0-9._-]', '', $_FILES['we_ui_' . $formname]['name'][$videoName]);\n\n\t\t\t\t\t\tif($videoid){\n\t\t\t\t\t\t\t$_SESSION[$videoDataId]['id'] = $videoid;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$_SESSION[$videoDataId]['fileName'] = preg_replace('#^(.+)\\..+$#', '${1}', $tmp_Filename);\n\t\t\t\t\t\t$_SESSION[$videoDataId]['extension'] = (strpos($tmp_Filename, \".\") > 0) ? preg_replace('#^.+(\\..+)$#', '${1}', $tmp_Filename) : '';\n\t\t\t\t\t\t$_SESSION[$videoDataId]['text'] = $_SESSION[$videoDataId]['fileName'] . $_SESSION[$videoDataId]['extension'];\n\t\t\t\t\t\t$_SESSION[$videoDataId]['unique'] = $unique;\n\n\t\t\t\t\t\t$we_size = getimagesize($_SESSION[$videoDataId]['serverPath']);\n\t\t\t\t\t\t$_SESSION[$videoDataId]['imgwidth'] = $we_size[0];\n\t\t\t\t\t\t$_SESSION[$videoDataId]['imgheight'] = $we_size[1];\n\t\t\t\t\t\t$_SESSION[$videoDataId]['type'] = $_FILES['we_ui_ ' . $formname]['type'][$videoName];\n\t\t\t\t\t\t$_SESSION[$videoDataId]['size'] = $_FILES['we_ui_' . $formname]['size'][$videoName];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function convertVideo($extension, $path, $local_path, $upload_session, $new_file_name, $handbrake_path, $full_video_path, $ffmpeg_path)\n {\n if ($extension != 'mp4') {\n // $log = '2>&1 | tee -a conversion.log 2>/dev/null >/dev/null &';\n\n $converted_video = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'.'.$extension.'.mp4';\n $cmd_convert = \"$handbrake_path -i $full_video_path -o $converted_video -m -e x264 -E copy -O\";\n\n // echo 'cmd is '.$cmd_convert;\n //shell_exec($cmd_convert.' '.$log);\n shell_exec($cmd_convert);\n \\File::delete(public_path('uploads/content/media/'.$upload_session.'/'.$new_file_name.'.'.$extension));\n } elseif ($extension == 'mp4') {\n // add wo, meaning \"with optimization\" for web display\n $converted_video = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'wo.mp4';\n $parameters = '-movflags faststart -acodec copy -vcodec copy';\n $cmd_optimize_mp4 = \"$ffmpeg_path -y -i $full_video_path $parameters $converted_video\";\n\n shell_exec($cmd_optimize_mp4);\n\n // delete original unoptimized mp4\n // then rename the optimized file to the original title\n unlink($full_video_path);\n\n $from = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'wo.mp4';\n $to = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'.mp4';\n\n rename($from, $to);\n } else {\n // any other uncommon video\n $converted_video = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'.'.$extension.'.mp4';\n $parameters = '-m -e x264 -E copy -O';\n $cmd_convert = \"$handbrake_path -i $full_video_path -o $converted_video $parameters\";\n\n shell_exec($cmd_convert.' 2>&1 | tee -a conversion.log 2>/dev/null >/dev/null &');\n }\n }", "public function getVideoId();", "public function alreadyExists()\n\t{\n\t\tif(file_exists($this->getSavePath())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function watchFullVideo($user_id, $user_type, $video) {\n if ($user_type == 1) {\n if ($video->amount == 0) {\n return true;\n }else if($video->amount > 0 && ($video->type_of_user == PAID_USER || $video->type_of_user == BOTH_USERS)) {\n $paymentView = PayPerView::where('user_id', $user_id)->where('video_id', $video->admin_video_id)\n ->orderBy('created_at', 'desc')->first();\n if ($video->type_of_subscription == ONE_TIME_PAYMENT) {\n // Load Payment view\n if ($paymentView) {\n return true;\n }\n } else {\n if ($paymentView) {\n if ($paymentView->status == DEFAULT_FALSE) {\n return true;\n }\n } \n }\n } else if($video->amount > 0 && $video->type_of_user == NORMAL_USER){\n return true;\n }\n } else {\n if($video->amount > 0 && ($video->type_of_user == NORMAL_USER || $video->type_of_user == BOTH_USERS)) {\n $paymentView = PayPerView::where('user_id', $user_id)->where('video_id', $video->admin_video_id)->orderBy('created_at', 'desc')->first();\n if ($video->type_of_subscription == ONE_TIME_PAYMENT) {\n // Load Payment view\n if ($paymentView) {\n return true;\n }\n } else {\n\n if ($paymentView) {\n if ($paymentView->status == DEFAULT_FALSE) {\n return true;\n }\n } \n }\n } \n }\n return false;\n}", "function videoLink($video)\n{\n\t\t\tif ( substr_count ( $video, 'http://youtu.be/' ) \t\t\t\t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'http://youtu.be/') + strlen('http://youtu.be');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed\".$vidID;\n\t\t\t}\n\telse\tif ( substr_count ( $video, 'https://youtu.be/' ) \t\t\t\t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'https://youtu.be/') + strlen('https://youtu.be');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed\".$vidID;\n\t\t\t}\n\telse\tif ( substr_count ( $video,\t'https://www.youtube.com/watch?v=') > 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'https://www.youtube.com/watch?v=') + strlen('https://www.youtube.com/watch?v=');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed/\".$vidID;\n\t\t\t}\t\n\telse\tif ( substr_count ( $video,\t'http://www.youtube.com/watch?v=') \t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'http://www.youtube.com/watch?v=') + strlen('http://www.youtube.com/watch?v=');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed/\".$vidID;\n\t\t\t}\t\t\t\n\telse\tif ( substr_count ( $video, 'http://vimeo.com/')\t\t\t\t\t\t\t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'http://vimeo.com/') + strlen('http://vimeo.com/');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://player.vimeo.com/video/\".$vidID;\n\t\t\t}\n\telse\tif ( substr_count ( $video, 'https://vimeo.com/')\t\t\t\t\t\t\t> 0 )\n\t\t\t{\t\t\t\n\t\t\t\t$vidIDStart \t= strpos($video, 'https://vimeo.com/') + strlen('https://vimeo.com/');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://player.vimeo.com/video/\".$vidID;\n\t\t\t}\n\telse\n\t\t\t{\n\t\t\t\t$video = '';\n\t\t\t\t$vidURL = '';\n\t\t\t}\t\n\t$vid = array($vidURL, $video);\n\treturn $vid;\n}", "function delete_video_acepcion_lse($id_imagen) {\n\t\n\t\t$imagen=$this->datos_imagen($id_imagen);\n\t\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$qDelete = \"DELETE FROM imagenes WHERE id_imagen='$id_imagen'\";\t\n\t\t$result = mysql_query($qDelete); \n\t\t\n\t\t$qDelete1 = \"DELETE FROM palabra_imagen WHERE id_imagen='$id_imagen'\";\t\n\t\t$result1 = mysql_query($qDelete1);\n\t\t\n\t\tunlink('../../repositorio/LSE_acepciones/'.$imagen['imagen']);\n\t\t\n\t\tif (file_exists('../../importar/videos/acepciones/'.$imagen['id_palabra'].'.flv')) { \n\t\t\tunlink('../../importar/videos/acepciones/'.$imagen['id_palabra'].'.flv');\n\t\t}\n\t\tmysql_close($connection);\n\t\treturn mysql_error();\t\t\n\t}", "public function GuardarEnArchivo(): bool\n {\n $retorno = false;\n $archivo = fopen('../archivos/usuarios.json', \"w\");\n echo $archivo;\n\n if (\n $this->nombre != \"\" &&\n $this->correo != \"\" &&\n $this->clave != \"\"\n ) {\n $exito = fwrite($archivo, $this->ToJSON() . \"\\r\\n\");\n if ($exito > 0)\n $retorno = true;\n }\n fclose($archivo);\n return $retorno;\n }", "static public function canDeleteRawVideo($video, $context, $user)\r\n {\r\n if ( $user->getId() === null ) return false;\r\n\r\n self::_checkContext($context);\r\n self::_checkUser($user);\r\n self::_checkGallery($gallery);\r\n\r\n /**\r\n * if context - user profile\r\n */\r\n if ( $context instanceof Warecorp_User ) {\r\n if ($user->getId() == $video->getCreatorId())\r\n return true;\r\n else\r\n return false;\r\n }\r\n /**\r\n * if context - group\r\n */\r\n elseif ( $context instanceof Warecorp_Group_Base ) {\r\n if ($context->getMembers()->isHost($user->getId()) || $context->getMembers()->isCohost($user->getId()))\r\n return true;\r\n else\r\n return false;\r\n }\r\n return false;\r\n }", "public function upload()\n {\n if ($this->img === null) {\n return true;\n }\n $conexion = self::find()->orderBy('created_at DESC')->one();\n $id = $conexion == null ? 1 : $conexion->id + 1;\n $nombre = getenv('Ruta') . 'noticias' . $id . '.' . $this->extension;\n\n $res = $this->img->saveAs($nombre);\n if ($res) {\n Image::thumbnail($nombre, self::TAMANO, null)->save($nombre);\n }\n $client = new \\Spatie\\Dropbox\\Client(getenv('Dropbox'));\n\n try {\n $client->delete($nombre);\n } catch (BadRequest $e) {\n // No se hace nada\n }\n $client->upload($nombre, file_get_contents($nombre, 'overwrite'));\n\n $res = $client->createSharedLinkWithSettings($nombre, [\n 'requested_visibility' => 'public',\n ]);\n $url = $res['url'][mb_strlen($res['url']) - 1] = '1';\n $this->img = $res['url'];\n return $res;\n }", "function is_video_user($vdo,$user=NULL)\r\n{\r\n\r\n if(!$user)\r\n $user = username();\r\n if(is_array($vdo))\r\n $video_users = $vdo['video_users'];\r\n else\r\n $video_users = $vdo;\r\n\r\n\r\n $users_array = explode(',',$video_users);\r\n\r\n if(in_array($user,$users_array))\r\n return true;\r\n else\r\n return false;\r\n}", "function siExiste($texto, $txtmd5){\n\t$encrypt = md5(encrypt($texto,1));\n\t$resultado = ($encrypt == $txtmd5)?true:false;\n\treturn $resultado;\n}", "protected function getVideo($releaseGUID)\n\t{\n\t\t// Return value.\n\t\t$retVal = false;\n\n\t\tif (!$this->processVideo) {\n\t\t\treturn $retVal;\n\t\t}\n\n\t\t// Get all the files in the temp dir.\n\t\t$sampleFiles = glob($this->tmpPath . '*.*');\n\t\tif ($sampleFiles !== false) {\n\n\t\t\t// Create a filename to store the temp file.\n\t\t\t$fileName = 'zzzz' . $releaseGUID . '.ogv';\n\n\t\t\t// Loop all the files in the temp folder.\n\t\t\tforeach ($sampleFiles as $sampleFile) {\n\n\t\t\t\t// Try to find an avi file.\n\t\t\t\tif (preg_match('/\\.avi$/i', $sampleFile) && is_file($sampleFile)) {\n\n\t\t\t\t\t// If wanted sample length is less than 60, try to get sample from the end of the video.\n\t\t\t\t\tif ($this->ffMPEGDuration < 60) {\n\t\t\t\t\t\t// Get the real duration of the file.\n\t\t\t\t\t\t$time = @exec(\n\t\t\t\t\t\t\t'\"' .\n\t\t\t\t\t\t\t$this->site->ffmpegpath .\n\t\t\t\t\t\t\t'\" -i \"' .\n\t\t\t\t\t\t\t$sampleFile .\n\t\t\t\t\t\t\t'\" -vcodec copy -f null /dev/null 2>&1 | cut -f 6 -d \\'=\\' | grep \\'^[0-9].*bitrate\\' | cut -f 1 -d \\' \\''\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// If we don't get the time create the sample the old way (gets the start of the video).\n\t\t\t\t\t\t$numbers = array();\n\t\t\t\t\t\tif (!preg_match('/^\\d{2}:\\d{2}:(\\d{2}).(\\d{2})$/', $time, $numbers)) {\n\t\t\t\t\t\t\tnzedb\\utility\\runCmd(\n\t\t\t\t\t\t\t\t'\"' .\n\t\t\t\t\t\t\t\t$this->site->ffmpegpath .\n\t\t\t\t\t\t\t\t'\" -i \"' .\n\t\t\t\t\t\t\t\t$sampleFile .\n\t\t\t\t\t\t\t\t'\" -vcodec libtheora -filter:v scale=320:-1 -t ' .\n\t\t\t\t\t\t\t\t$this->ffMPEGDuration .\n\t\t\t\t\t\t\t\t' -acodec libvorbis -loglevel quiet -y \"' .\n\t\t\t\t\t\t\t\t$this->tmpPath .\n\t\t\t\t\t\t\t\t$fileName .\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// Get the max seconds from the video clip.\n\t\t\t\t\t\t\t$maxLength = (int)$numbers[1];\n\n\t\t\t\t\t\t\t// If the clip is shorter than the length we want.\n\t\t\t\t\t\t\tif ($maxLength <= $this->ffMPEGDuration) {\n\t\t\t\t\t\t\t\t// The lowest we want is 0.\n\t\t\t\t\t\t\t\t$lowestLength = '00:00:00.00';\n\n\t\t\t\t\t\t\t// If it's longer.\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// The lowest we want is the the difference .\n\t\t\t\t\t\t\t\t$lowestLength = ($maxLength - $this->ffMPEGDuration);\n\n\t\t\t\t\t\t\t\t// Form the time string.\n\t\t\t\t\t\t\t\t$end = '.' . $numbers[2];\n\t\t\t\t\t\t\t\tswitch (strlen($lowestLength)) {\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t$lowestLength = '00:00:0' . (string)$lowestLength . $end;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 2:\n\n\t\t\t\t\t\t\t\t\t\t$lowestLength = '00:00:' . (string)$lowestLength . $end;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t$lowestLength = '00:00:60.00';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Try to get the sample (from the end instead of the start).\n\t\t\t\t\t\t\tnzedb\\utility\\runCmd(\n\t\t\t\t\t\t\t\t'\"' .\n\t\t\t\t\t\t\t\t$this->site->ffmpegpath .\n\t\t\t\t\t\t\t\t'\" -i \"' .\n\t\t\t\t\t\t\t\t$sampleFile .\n\t\t\t\t\t\t\t\t'\" -ss ' . $lowestLength .\n\t\t\t\t\t\t\t\t' -t ' . $this->ffMPEGDuration .\n\t\t\t\t\t\t\t\t' -vcodec libtheora -filter:v scale=320:-1 ' .\n\t\t\t\t\t\t\t\t' -acodec libvorbis -loglevel quiet -y \"' .\n\t\t\t\t\t\t\t\t$this->tmpPath .\n\t\t\t\t\t\t\t\t$fileName .\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// If longer than 60, then run the old way.\n\t\t\t\t\t\tnzedb\\utility\\runCmd(\n\t\t\t\t\t\t\t'\"' .\n\t\t\t\t\t\t\t$this->site->ffmpegpath .\n\t\t\t\t\t\t\t'\" -i \"' .\n\t\t\t\t\t\t\t$sampleFile .\n\t\t\t\t\t\t\t'\" -vcodec libtheora -filter:v scale=320:-1 -t ' .\n\t\t\t\t\t\t\t$this->ffMPEGDuration .\n\t\t\t\t\t\t\t' -acodec libvorbis -loglevel quiet -y \"' .\n\t\t\t\t\t\t\t$this->tmpPath .\n\t\t\t\t\t\t\t$fileName .\n\t\t\t\t\t\t\t'\"'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get all the files in the temp dir.\n\t\t\t\t\t$all_files = @scandir($this->tmpPath, 1);\n\t\t\t\t\tif ($all_files === false ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Loop over them.\n\t\t\t\t\tforeach ($all_files as $file) {\n\n\t\t\t\t\t\t// Until we find the video file.\n\t\t\t\t\t\tif ($file === $fileName) {\n\n\t\t\t\t\t\t\t// Create a path to where the file should be moved.\n\t\t\t\t\t\t\t$newFile = $this->releaseImage->vidSavePath . $releaseGUID . '.ogv';\n\n\t\t\t\t\t\t\t// Try to move the file to the new path.\n\t\t\t\t\t\t\t$renamed = @rename($this->tmpPath . $fileName, $newFile);\n\n\t\t\t\t\t\t\t// If we couldn't rename it, try to copy it.\n\t\t\t\t\t\t\tif (!$renamed) {\n\n\t\t\t\t\t\t\t\t$copied = @copy($this->tmpPath . $fileName, $newFile);\n\n\t\t\t\t\t\t\t\t// Delete the old file.\n\t\t\t\t\t\t\t\t@unlink($this->tmpPath . $fileName);\n\n\t\t\t\t\t\t\t\t// If it didn't copy, continue.\n\t\t\t\t\t\t\t\tif (!$copied) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Change the permissions.\n\t\t\t\t\t\t\t@chmod($newFile, 0764);\n\n\t\t\t\t\t\t\t// Update query to say we got the video.\n\t\t\t\t\t\t\t$this->db->queryExec(sprintf('UPDATE releases SET videostatus = 1 WHERE guid = %s', $this->db->escapeString($releaseGUID)));\n\t\t\t\t\t\t\t$retVal = true;\n\t\t\t\t\t\t\tif ($this->echooutput) {\n\t\t\t\t\t\t\t\techo 'v';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn $retVal;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If an video was made, return true, else return false.\n\t\treturn $retVal;\n\t}", "public function capture($data)\n\t{\n\n\t\t$data_id = $data['data'][0]['id'];\n\t\t$data_title = $data['data'][0]['title'];\n\t\t$data_started = $data['data'][0]['started_at'];\n\t\t$data_game_id = $data['data'][0]['game_id'];\n\t\t$data_username = $data['data'][0]['user_name'];\n\n\t\tif (!$data_id) {\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"No ID supplied for capture\");\n\t\t\t// $this->errors[] = 'ID not supplied for capture';\n\t\t\treturn false;\n\t\t}\n\n\t\t$stream_url = 'twitch.tv/' . $data_username;\n\n\t\t$basename = $this->basename($data);\n\n\t\t$folder_base = TwitchHelper::vodFolder($data_username);\n\n\t\t$capture_filename = $folder_base . DIRECTORY_SEPARATOR . $basename . '.ts';\n\n\t\t$chat_filename = $folder_base . DIRECTORY_SEPARATOR . $basename . '.chatdump';\n\n\t\t// failure\n\t\t$int = 1;\n\t\twhile (file_exists($capture_filename)) {\n\t\t\t// $this->errors[] = 'File exists while capturing, making a new name';\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"File exists while capturing, making a new name for {$basename}, attempt #{$int}\", ['download-capture' => $data_username]);\n\t\t\t$capture_filename = $folder_base . DIRECTORY_SEPARATOR . $basename . '-' . $int . '.ts';\n\t\t\t$int++;\n\t\t}\n\n\t\t$cmd = [];\n\n\t\t// use python pipenv or regular executable\n\t\tif (TwitchConfig::cfg('pipenv_enabled')) {\n\t\t\t$cmd[] = 'pipenv run streamlink';\n\t\t} else {\n\t\t\t$cmd[] = TwitchHelper::path_streamlink();\n\t\t}\n\n\t\t// start recording from start of stream, though twitch doesn't support this\n\t\t$cmd[] = '--hls-live-restart';\n\n\t\t// How many segments from the end to start live HLS streams on.\n\t\t$cmd[] = '--hls-live-edge';\n\t\t$cmd[] = '99999';\n\n\t\t// timeout due to ads\n\t\t$cmd[] = '--hls-timeout';\n\t\t$cmd[] = TwitchConfig::cfg('hls_timeout', 120);\n\n\t\t// timeout due to ads\n\t\t$cmd[] = '--hls-segment-timeout';\n\t\t$cmd[] = TwitchConfig::cfg('hls_timeout', 120);\n\n\t\t// The size of the thread pool used to download HLS segments.\n\t\t$cmd[] = '--hls-segment-threads';\n\t\t$cmd[] = '5';\n\n\t\t// disable channel hosting\n\t\t$cmd[] = '--twitch-disable-hosting';\n\n\t\t// enable low latency mode, probably not a good idea without testing\n\t\tif (TwitchConfig::cfg('low_latency', false)) {\n\t\t\t$cmd[] = '--twitch-low-latency';\n\t\t}\n\n\t\t// Skip embedded advertisement segments at the beginning or during a stream\n\t\tif (TwitchConfig::cfg('disable_ads', false)) {\n\t\t\t$cmd[] = '--twitch-disable-ads';\n\t\t}\n\n\t\t// Retry fetching the list of available streams until streams are found \n\t\t$cmd[] = '--retry-streams';\n\t\t$cmd[] = '10';\n\n\t\t// stop retrying the fetch after COUNT retry attempt(s).\n\t\t$cmd[] = '--retry-max';\n\t\t$cmd[] = '5';\n\n\t\t// logging level\n\t\tif (TwitchConfig::cfg('debug', false)) {\n\t\t\t$cmd[] = '--loglevel';\n\t\t\t$cmd[] = 'debug';\n\t\t} elseif (TwitchConfig::cfg('app_verbose', false)) {\n\t\t\t$cmd[] = '--loglevel';\n\t\t\t$cmd[] = 'info';\n\t\t}\n\n\t\t// output file\n\t\t$cmd[] = '-o';\n\t\t$cmd[] = $capture_filename;\n\n\t\t// twitch url\n\t\t$cmd[] = '--url';\n\t\t$cmd[] = $stream_url;\n\n\t\t// twitch quality\n\t\t$cmd[] = '--default-stream';\n\t\t$cmd[] = implode(\",\", TwitchConfig::getStreamer($data_username)['quality']); // quality\n\n\t\t// $this->info[] = 'Streamlink cmd: ' . implode(\" \", $cmd);\n\n\t\t$this->vod->refreshJSON();\n\t\t$this->vod->dt_capture_started = new \\DateTime();\n\t\t$this->vod->saveJSON('dt_capture_started set');\n\n\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Starting capture with filename \" . basename($capture_filename), ['download-capture' => $data_username, 'cmd' => implode(' ', $cmd)]);\n\n\t\t// start process in async mode\n\t\t$process = new Process($cmd, dirname($capture_filename), null, null, null);\n\t\t$process->start();\n\n\t\t// output command line\n\t\tTwitchHelper::clearLog(\"streamlink_\" . $basename . \"_stdout.\" . $int);\n\t\tTwitchHelper::clearLog(\"streamlink_\" . $basename . \"_stderr.\" . $int);\n\t\tTwitchHelper::appendLog(\"streamlink_\" . $basename . \"_stdout.\" . $int, \"$ \" . implode(\" \", $cmd));\n\t\tTwitchHelper::appendLog(\"streamlink_\" . $basename . \"_stderr.\" . $int, \"$ \" . implode(\" \", $cmd));\n\n\t\t// save pid to file\n\t\t$pidfile = TwitchHelper::$pids_folder . DIRECTORY_SEPARATOR . 'capture_' . $data_username . '.pid';\n\t\tTwitchHelper::log(TwitchHelper::LOG_DEBUG, \"Capture \" . basename($capture_filename) . \" has PID \" . $process->getPid(), ['download-capture' => $data_username]);\n\t\tfile_put_contents($pidfile, $process->getPid());\n\n\t\t// chat capture\n\t\tif (TwitchConfig::cfg('chat_dump')) {\n\n\t\t\t$chat_cmd = [];\n\n\t\t\t// test\n\t\t\t// $chat_cmd[] = 'screen';\n\t\t\t// $chat_cmd[] = '-S';\n\t\t\t// $chat_cmd[] = $basename;\n\n\t\t\t$chat_cmd[] = 'python';\n\t\t\t$chat_cmd[] = __DIR__ . '/Utilities/twitch-chat.py';\n\n\t\t\t$chat_cmd[] = '--channel';\n\t\t\t$chat_cmd[] = $this->vod->streamer_name;\n\n\t\t\t$chat_cmd[] = '--userid';\n\t\t\t$chat_cmd[] = $this->vod->streamer_id;\n\n\t\t\t$chat_cmd[] = '--date';\n\t\t\t$chat_cmd[] = $data_started;\n\n\t\t\t$chat_cmd[] = '--output';\n\t\t\t$chat_cmd[] = $chat_filename;\n\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Starting chat dump with filename \" . basename($chat_filename), ['download-capture' => $data_username, 'cmd' => implode(' ', $chat_cmd)]);\n\n\t\t\t// $chat_process = Process::fromShellCommandline( implode(\" \", $cmd) );\n\t\t\t$chat_process = new Process($chat_cmd, null, null, null, null);\n\t\t\t$chat_process->setTimeout(null);\n\t\t\t$chat_process->setIdleTimeout(null);\n\n\t\t\ttry {\n\t\t\t\t$chat_process->setTty(true);\n\t\t\t} catch (\\Throwable $th) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"TTY not supported\", ['download-capture' => $data_username]);\n\t\t\t}\n\n\t\t\tif ($chat_process->isTty()) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_SUCCESS, \"TTY enabled\", ['download-capture' => $data_username]);\n\t\t\t}\n\n\t\t\tif ($chat_process->isPtySupported()) {\n\t\t\t\t$chat_process->setPty(true);\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_SUCCESS, \"PTY enabled\", ['download-capture' => $data_username]);\n\t\t\t} else {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"PTY not supported\", ['download-capture' => $data_username]);\n\t\t\t}\n\n\t\t\t$chat_process->start();\n\n\t\t\t$chat_pidfile = TwitchHelper::$pids_folder . DIRECTORY_SEPARATOR . 'chatdump_' . $data_username . '.pid';\n\t\t\tfile_put_contents($chat_pidfile, $chat_process->getPid());\n\n\t\t\tTwitchHelper::clearLog(\"chatdump_\" . $basename . \"_stdout.\" . $int);\n\t\t\tTwitchHelper::clearLog(\"chatdump_\" . $basename . \"_stderr.\" . $int);\n\t\t\tTwitchHelper::appendLog(\"chatdump_\" . $basename . \"_stdout.\" . $int, implode(\" \", $chat_cmd));\n\t\t\tTwitchHelper::appendLog(\"chatdump_\" . $basename . \"_stderr.\" . $int, implode(\" \", $chat_cmd));\n\t\t} else {\n\t\t\t$chat_process = null;\n\t\t}\n\n\t\t// $time_start = time();\n\t\t// $current_ad_start = null;\n\t\t// $vod = $this->vod;\n\n\t\t// wait loop until it's done\n\t\t$process->wait(function ($type, $buffer) use ($basename, $int, $data_username, $chat_process) {\n\n\t\t\tif (Process::ERR === $type) {\n\t\t\t\t// echo 'ERR > '.$buffer;\n\t\t\t} else {\n\t\t\t\t// echo 'OUT > '.$buffer;\n\t\t\t}\n\n\t\t\tif (TwitchConfig::cfg('chat_dump') && isset($chat_process)) {\n\t\t\t\tif ($chat_process->isRunning()) {\n\t\t\t\t\t$chat_process->checkTimeout();\n\t\t\t\t\t// if( !$chat_process->getIncrementalOutput() ){\n\t\t\t\t\t// \tTwitchHelper::log( TwitchHelper::LOG_DEBUG, \"No chat output in chat dump\", ['download-capture' => $data_username] );\n\t\t\t\t\t// }\n\t\t\t\t} else {\n\t\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_DEBUG, \"Chat dump enabled but not running\", ['download-capture' => $data_username]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get stream resolution\n\t\t\tpreg_match(\"/stream:\\s([0-9_a-z]+)\\s/\", $buffer, $matches);\n\t\t\tif ($matches) {\n\t\t\t\t$this->stream_resolution = $matches[1];\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Stream resolution for \" . $basename . \": \" . $this->stream_resolution, ['download-capture' => $data_username]);\n\t\t\t}\n\n\t\t\t// stream stop\n\t\t\tif (strpos($buffer, \"404 Client Error\") !== false) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_WARNING, \"Chunk 404'd for \" . $basename . \"!\", ['download-capture' => $data_username]);\n\t\t\t}\n\n\t\t\t// ad removal\n\t\t\tif (strpos($buffer, \"Will skip ad segments\") !== false) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Capturing of \" . $basename . \" will try to remove ads!\", ['download-capture' => $data_username]);\n\t\t\t\t// $current_ad_start = time();\n\t\t\t}\n\n\t\t\tif (strpos($buffer, \"Filtering out segments and pausing stream output\") !== false) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Pausing capture for \" . $basename . \" due to ad segment!\", ['download-capture' => $data_username]);\n\t\t\t\t// $current_ad_start = time();\n\t\t\t}\n\n\t\t\tif (strpos($buffer, \"Resuming stream output\") !== false) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Resuming capture for \" . $basename . \" due to ad segment!\", ['download-capture' => $data_username]);\n\t\t\t\t/*\n\t\t\t\tif( isset($current_ad_start) ){\n\t\t\t\t\t$vod->addAdvertisement([\n\t\t\t\t\t\t'start' => $current_ad_start,\n\t\t\t\t\t\t'end' => $current_ad_start - time()\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\n\t\t\t// log output\n\t\t\tif (Process::ERR === $type) {\n\t\t\t\tTwitchHelper::appendLog(\"streamlink_\" . $basename . \"_stderr.\" . $int, $buffer);\n\t\t\t} else {\n\t\t\t\tTwitchHelper::appendLog(\"streamlink_\" . $basename . \"_stdout.\" . $int, $buffer);\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\twhile (true) {\n\n\t\t\t// check if capture is running, and quit if it isn't\n\t\t\tif (!$process->isRunning()) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Streamlink exited, breaking loop\", ['download-capture' => $data_username]);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// check timeout of capture\n\t\t\ttry {\n\t\t\t\t$process->checkTimeout();\n\t\t\t} catch (\\Throwable $th) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"Process timeout: \" . $th->getMessage(), ['download-capture' => $data_username]);\n\t\t\t}\n\n\t\t\t$process->addOutput(\"pad (\" . date(\"Y-m-d H:i:s\") . \")\");\n\n\t\t\t// check timeout of chat dump\n\t\t\tif (TwitchConfig::cfg('chat_dump') && isset($chat_process)) {\n\n\t\t\t\ttry {\n\t\t\t\t\t$chat_process->checkTimeout();\n\t\t\t\t} catch (\\Throwable $th) {\n\t\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"Process timeout: \" . $th->getMessage(), ['download-capture' => $data_username]);\n\t\t\t\t}\n\n\t\t\t\t$chat_process->addOutput(\"pad (\" . date(\"Y-m-d H:i:s\") . \")\");\n\n\t\t\t\t$cmd_chatdump_stdout_buffer = $chat_process->getIncrementalOutput();\n\t\t\t\t$cmd_chatdump_stderr_buffer = $chat_process->getIncrementalErrorOutput();\n\t\t\t\tif ($cmd_chatdump_stdout_buffer) TwitchHelper::appendLog(\"chatdump_\" . $basename . \"_stdout.\" . $int, $cmd_chatdump_stdout_buffer);\n\t\t\t\tif ($cmd_chatdump_stdout_buffer) TwitchHelper::appendLog(\"chatdump_\" . $basename . \"_stderr.\" . $int, $cmd_chatdump_stderr_buffer);\n\t\t\t}\n\n\t\t\t$cmd_stdout_buffer = $process->getIncrementalOutput();\n\t\t\t$cmd_stderr_buffer = $process->getIncrementalErrorOutput();\n\t\t\tif ($cmd_stdout_buffer) TwitchHelper::appendLog(\"streamlink_\" . $basename . \"_stdout.\" . $int, $cmd_stdout_buffer);\n\t\t\tif ($cmd_stdout_buffer) TwitchHelper::appendLog(\"streamlink_\" . $basename . \"_stderr.\" . $int, $cmd_stderr_buffer);\n\n\t\t\tsleep(10);\n\t\t}\n\t\t*/\n\n\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Finished capture with filename \" . basename($capture_filename), ['download-capture' => $data_username]);\n\n\t\tif (TwitchConfig::cfg('chat_dump')) {\n\t\t\t// gracefully kill chat dump\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Ending chat dump with filename \" . basename($chat_filename), ['download-capture' => $data_username]);\n\n\t\t\t// $chat_process->setTimeout(90);\n\n\t\t\t/*\n\t\t\t$chat_process->signal( defined('SIGTERM') ? SIGTERM : 15 ); // SIGTERM\n\n\t\t\t\n\t\t\tsleep(10);\n\t\t\tif( $chat_process->isRunning() ){\n\t\t\t\t$chat_process->stop(0);\n\t\t\t}\n\t\t\t*/\n\n\t\t\t$chat_process->stop(60);\n\n\t\t\t/*\n\t\t\ttry {\n\t\t\t\t$chat_process->wait();\n\t\t\t} catch (\\Throwable $th) {\n\t\t\t\tTwitchHelper::log( TwitchHelper::LOG_ERROR, \"Chat dump SIGTERM wait error: \" . $th->getMessage(), ['download-capture' => $data_username] );\n\t\t\t}\n\t\t\t*/\n\n\t\t\tif (file_exists($chat_pidfile)) unlink($chat_pidfile);\n\t\t\t// TwitchHelper::appendLog(\"chatdump_\" . $basename . \"_stdout.\" . $int, $chat_process->getOutput() );\n\t\t\t// TwitchHelper::appendLog(\"chatdump_\" . $basename . \"_stderr.\" . $int, $chat_process->getErrorOutput() );\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Ended chat dump with filename \" . basename($chat_filename), ['download-capture' => $data_username]);\n\t\t}\n\n\t\t// download with youtube-dl if streamlink fails, shouldn't be required anymore\n\t\tif (mb_strpos($process->getOutput(), '410 Client Error') !== false) {\n\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"410 error for {$basename}\");\n\n\t\t\t$yt_cmd = [];\n\n\t\t\tif (TwitchConfig::cfg('pipenv_enabled')) {\n\t\t\t\t$yt_cmd[] = 'pipenv';\n\t\t\t\t$yt_cmd[] = 'run';\n\t\t\t\t$yt_cmd[] = 'youtube-dl';\n\t\t\t} else {\n\t\t\t\t$yt_cmd[] = TwitchHelper::path_youtubedl();\n\t\t\t}\n\n\t\t\t// use ts instead of mp4\n\t\t\t$yt_cmd[] = '--hls-use-mpegts';\n\n\t\t\t$yt_cmd[] = '--no-part';\n\n\t\t\t// output file\n\t\t\t$yt_cmd[] = '-o';\n\t\t\t$yt_cmd[] = $capture_filename;\n\n\t\t\t// format, does this work?\n\t\t\t$yt_cmd[] = '-f';\n\t\t\t$yt_cmd[] = implode('/', TwitchConfig::getStreamer($data_username)['quality']);\n\n\t\t\t// verbose\n\t\t\tif (TwitchConfig::cfg('debug', false) || TwitchConfig::cfg('app_verbose', false)) {\n\t\t\t\t$yt_cmd[] = '-v';\n\t\t\t}\n\n\t\t\t// stream url\n\t\t\t$yt_cmd[] = $stream_url;\n\n\t\t\t$yt_process = new Process($yt_cmd, null, null, null, null);\n\t\t\t$yt_process->run();\n\n\t\t\tTwitchHelper::appendLog(\"youtubedl_\" . $basename . \"_\" . time() . \"_stdout\", \"$ \" . implode(\" \", $yt_cmd) . \"\\n\" . $yt_process->getOutput());\n\t\t\tTwitchHelper::appendLog(\"youtubedl_\" . $basename . \"_\" . time() . \"_stderr\", \"$ \" . implode(\" \", $yt_cmd) . \"\\n\" . $yt_process->getErrorOutput());\n\t\t}\n\n\t\tif (mb_strpos($process->getOutput(), 'already exists, use') !== false) {\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_FATAL, \"Unexplainable, \" . basename($capture_filename) . \" could not be captured due to existing file already.\", ['download-capture' => $data_username]);\n\t\t}\n\n\t\t// get stream resolution\n\t\tpreg_match(\"/stream:\\s([0-9_a-z]+)\\s/\", $process->getOutput(), $matches);\n\t\tif ($matches) {\n\t\t\t$this->stream_resolution = $matches[1];\n\t\t}\n\n\t\t// delete pid file\n\t\tif (file_exists($pidfile)) unlink($pidfile);\n\n\t\tif (!file_exists($capture_filename)) {\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"File \" . basename($capture_filename) . \" never got created.\", ['download-capture' => $data_username]);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (filesize($capture_filename) == 0) {\n\t\t\tTwitchHelper::log(TwitchHelper::LOG_ERROR, \"File \" . basename($capture_filename) . \" never got any data.\", ['download-capture' => $data_username]);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $capture_filename;\n\t}", "public function upload_video_background(){\n\tif(Auth::check()){\n\t\tif(Auth::user()->type==\"Admin\"){\n\t\t\treturn redirect('admin_dashboard');\n\t\t}\n\t\telseif (Auth::user()->type==\"User\") {\n\t\t\treturn redirect('profile');\n\t\t}\n\t\telse{\n\t\t\t$artist = Profile::where('EmailId',Auth::user()->email)->first();\n\t\t\treturn view('frontend.artistDashboard.upload_video_background',['artist'=>$artist]);\n\t\t}\n\t}\n\telse{\n\t\treturn redirect('/login');\n\t}\n}", "private function _video($bInstall = false)\n\t{\n\t\t$sFfmpeg = '';\n\t\t$sMencoder = '';\n\t\t$iPass = 0;\n\t\tif (!PHPFOX_SAFE_MODE)\n\t\t{\n\t\t\tif (($aVals = $this->_oReq->getArray('val')))\n\t\t\t{\t\t\t\t\t\t\n\t\t\t\tif (!empty($aVals['ffmpeg']))\n\t\t\t\t{\n\t\t\t\t\texec($aVals['ffmpeg'] . ' 2>&1', $aOutput);\n\t\t\t\t\t\n\t\t\t\t\tif (preg_match(\"/FFmpeg version/\", $aOutput[0]))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($bInstall === true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_db()->update(Phpfox::getT('setting'), array('value_actual' => $aVals['ffmpeg']), 'module_id = \\'video\\' AND var_name = \\'ffmpeg_path\\'');\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$_SESSION[Phpfox::getParam('core.session_prefix')]['installer_ffmpeg'] = $aVals['ffmpeg'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$iPass++;\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tPhpfox_Error::set($aOutput[0]);\n\t\t\t\t\t}\n\t\t\t\t\tunset($aOutput);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!empty($aVals['mencoder']))\n\t\t\t\t{\n\t\t\t\t\texec($aVals['mencoder'] . ' 2>&1', $aOutput);\n\t\t\t\t\t\n\t\t\t\t\tif (preg_match(\"/MPlayer Team/\", $aOutput[0]))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($bInstall === true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->_db()->update(Phpfox::getT('setting'), array('value_actual' => $aVals['mencoder']), 'module_id = \\'video\\' AND var_name = \\'mencoder_path\\'');\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$_SESSION[Phpfox::getParam('core.session_prefix')]['installer_mencoder'] = $aVals['mencoder'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$iPass++;\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tPhpfox_Error::set($aOutput[0]);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\tunset($aOutput);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (PHP_OS == 'Linux')\n\t\t\t{\n\t\t\t\t$sOutput = shell_exec('whereis ffmpeg 2>&1');\t\t\t\n\t\t\t\t$aOutput = explode(\"\\n\", $sOutput);\t\n\t\t\t\tif (isset($aOutput[0]))\n\t\t\t\t{\n\t\t\t\t\t$aParts = explode('ffmpeg:', $aOutput[0]);\n\t\t\t\t\tif (isset($aParts[1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$aSubParts = explode(' ', trim($aParts[1]));\n\t\t\t\t\t\tif (isset($aSubParts[0]) && !empty($aSubParts[0]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (PHPFOX_OPEN_BASE_DIR || (!PHPFOX_OPEN_BASE_DIR && file_exists($aSubParts[0])))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sFfmpeg = $aSubParts[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\tunset($aOutput);\n\t\t\t\t\n\t\t\t\t$sOutput = shell_exec('whereis mencoder 2>&1');\n\t\t\t\t$aOutput = explode(\"\\n\", $sOutput);\n\t\t\t\tif (isset($aOutput[0]))\n\t\t\t\t{\n\t\t\t\t\t$aParts = explode('mencoder:', $aOutput[0]);\n\t\t\t\t\tif (isset($aParts[1]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$aSubParts = explode(' ', trim($aParts[1]));\n\t\t\t\t\t\tif (isset($aSubParts[0]) && !empty($aSubParts[0]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (PHPFOX_OPEN_BASE_DIR || (!PHPFOX_OPEN_BASE_DIR && file_exists($aSubParts[0])))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sMencoder = $aSubParts[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\tunset($aOutput);\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!empty($_SESSION[Phpfox::getParam('core.session_prefix')]['installer_ffmpeg']))\n\t\t{\n\t\t\t$sFfmpeg = $_SESSION[Phpfox::getParam('core.session_prefix')]['installer_ffmpeg'];\t\t\t\n\t\t}\t\t\n\t\t\n\t\tif (!empty($_SESSION[Phpfox::getParam('core.session_prefix')]['installer_mencoder']))\n\t\t{\n\t\t\t$sMencoder = $_SESSION[Phpfox::getParam('core.session_prefix')]['installer_mencoder'];\t\t\t\n\t\t}\t\t\t\n\t\t\n\t\t$aForms = array(\n\t\t\t'ffmpeg' => $sFfmpeg,\n\t\t\t'mencoder' => $sMencoder\n\t\t);\n\t\t\n\t\treturn $aForms;\n\t}", "function getRandomVideoURL(){\n\t$response = getHTTPContent(\"http://youtube.com\", true);\n\t\n\tif(preg_match_all('~href=\"/?watch\\?v=(.+?)\"~', $response, $matches)){\n\t\t$matches_array = $matches[1];\n\n\t\tshuffle($matches_array);\n\n\t\treturn \"http://www.youtube.com/watch?v=\".$matches_array[0];\n\t}\n\n\t_log(\"getRandomVideoURL: no videos found\", true);\n\n\treturn false;\n}", "function is_header_video_active()\n {\n }", "function is_group_video($vid, $gid) {\n global $db;\n $count = $db->count(tbl($this->gp_vdo_tbl), \"group_video_id\", \" videoid='$vid' AND group_id='$gid'\");\n if ($count[0] > 0)\n return true;\n else\n return false;\n }", "public function resume(): bool;", "public function excluirVideoPorId($idVideo){\r\n \r\n $sql = mysql_query(\"DELETE FROM video_galeria WHERE id_video='$idVideo'\") or die(mysql_error());\r\n \r\n if($sql == true){\r\n\t\r\n\treturn true; \r\n\t\r\n }else{\r\n\t\r\n\treturn false; \r\n }\r\n\t\r\n}", "public function cargarVideosYaVistos(){\n $query = \"SELECT Video_codVideo FROM reproduccion WHERE Usuario_codUsuario = \".parent::string($this->getUsuario_codUsuario()).\" ORDER BY Video_codVideo ASC;\";\n $result = mysqli_query(parent::conexion(), $query);\n $arreglo = null;\n\n if(!$result){\n die(\"Error\");\n } else{\n while($data = mysqli_fetch_assoc($result)){\n $arreglo[] = $data;\n }\n }\n\n parent::desconectar();\n return json_encode($arreglo);\n }", "private function _checkExist()\n {\n $ret = ['valid' => true, 'message' => []];\n\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $eitherOptions = ['username', 'email'];\n\n $choseOptions = array_intersect($eitherOptions, array_keys($this->data));\n\n foreach ($choseOptions as $option) {\n if ($option == 'username') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `username` = :username\";\n } elseif ($option == 'email') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `email` = :email\";\n }\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute([$option => $this->data[$option]]);\n\n if ($stmt->fetchColumn() != 0) {\n $ret['valid'] = false;\n $ret['message'][] = $option . '{' . $this->data[$option] . '} has been occupied, please try again.';\n }\n }\n\n\n return $ret;\n }", "public function test_talkpoint_route_has_videos_to_convert_as_owner() {\n global $CFG;\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // copy the .webm file in the upload directory\n check_dir_exists($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1/');\n copy(__DIR__ . '/video/Chrome_ImF.webm', $CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1/foo.webm');\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet([\n 'talkpoint_talkpoint' => [\n ['id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'],\n [1, $talkpoint->id, $user->id, 'Talkpoint 001', 'foo.webm', null, 'file', 0, $now, $now],\n ],\n 'talkpoint_video_conversion' => [\n ['talkpointid', 'src', 'dst', 'is_converting', 'timecreated'],\n [1, 'foo.webm', 'foo.webm.mp4', 0, $now],\n ],\n ]));\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/talkpoint/1');\n\n // check response content contains alert\n $content = $client->getResponse()->getContent();\n $this->assertContains(get_string('videostoconvert1', $this->_app['plugin']), $content);\n $this->assertContains(get_string('videostoconvert2', $this->_app['plugin']), $content);\n }", "function comprobar_si_existe_ya_imagen_lse_acepcion($id_palabra) {\n\t\t$query = \"SELECT palabra_imagen.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename\n\t\tFROM palabra_imagen, imagenes\n\t\tWHERE palabra_imagen.id_palabra='$id_palabra'\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\tAND imagenes.id_tipo_imagen=12\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$numrows=mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\treturn $numrows;\n\t}", "function upload($temporal,$destino)\n{\n if(file_exists($destino) != true)\n {\n echo \"<br>El archivo ya existe\";\n move_uploaded_file($temporal,$destino);\n echo \"<img src='\".$destino.\"' width='200'>\";\n }\n else\n {\n echo \"ya existe el archivo\";\n }\n}", "public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }", "function recibir_fichero(){\r\n\t$usuario = $_SESSION['user'];\r\n\r\n\t$dir_subida = 'usuarios/'.$usuario;\r\n\t$fichero_subido = $dir_subida . '/perfil.png';\r\n\r\n\tif(exif_imagetype($_FILES['imagen_perfil']['tmp_name']) != IMAGETYPE_PNG) {\r\n\t\tshow_msg(\"El archivo no es el adecuado\");\r\n\t}else if (move_uploaded_file($_FILES['imagen_perfil']['tmp_name'], $fichero_subido)){\r\n\t\t//El archivo se ha movido correctame\r\n\t}\r\n}", "public function enviarNoInterrumpir( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\", \"NO_INTERRUMPIR\",\n $this->getNoInterrumpir());\n usleep(1000000);\n $this->enviarPeticion($cmd->getComando());\n\n }", "function xstats_displayMovieGif( $gameId ) {\n//the movie could be generated by calling http://<host>/extend/moviegif/movie.php?fu=1&spiel=<gameId>\n $filename = '../moviegif/files/moviegif_'.$gameId.'.gif';\n if( file_exists( $filename )) {\n echo '<img src=\"'.$filename.'\" class=\"beveled\">';\n }\n}", "public function isVideo(): bool\n {\n $originalUrl = mb_strtolower($this->getOriginalUrl(), 'utf-8');\n\n if (Str::endsWith($originalUrl, ['ogv', 'mp4', 'webm'])) {\n return true;\n }\n\n if (Str::endsWith($originalUrl, 'ogg')) {\n return Str::contains($this->getMime(), 'video');\n }\n\n return false;\n }", "public function checkTitleExists($videoTitle) {\n\t\t$result = mysql_query(\"select id from posts where video_title='$videoTitle'\");\n \tif(mysql_num_rows($result) == 0)\n \t{\n\t\t\treturn false;\n\t \t}else{\n\t \t\treturn true;\n\t\t}\n\t}", "public function testVideo()\n {\n $video =new Video();\n $video->setPath('test');\n $this->assertSame('test', $video->getPath());\n $video->setTrick(new Trick());\n $this->assertNotEmpty($video->getTrick());\n $this->assertEquals(null, $video->getId());\n }", "public function archivo_existente(){\n $respuesta = array();\n //obtiene la informacion del archivo\n $info = new SplFileInfo($this->file[\"name\"]);\n //obtiene la extension\n $extencion = $info->getExtension();\n //concateno el nombre y la extension para saber que archivo y tambien la ruta del archivo\n $nombre_imagen = $this->nombre . \".\" . $extencion;\n $ruta_archivo = $this->ruta . $nombre_imagen;\n //si el archivo existe\n if (file_exists($ruta_archivo)) {\n //doy permisos para eliminar archivos\n chmod($ruta_archivo, 0777);\n //elimino el archivo\n if(unlink($ruta_archivo)){\n $respuesta[\"resultado\"] = true;\n } else {\n $respuesta[\"resultado\"] = false;\n $respuesta[\"mensaje\"] = \"Ocurrió un error al eliminar el archivo\";\n }\n }else{\n $respuesta[\"resultado\"] = true;\n $respuesta[\"mensaje\"] = \"No es posible eliminar el archivo porque no existe.\";\n }\n return $respuesta;\n }", "public function uploadVideos(User $user, Recording $recording)\n {\n return false;\n }", "public function isVideo(){\n if (strpos($this->attributes['mime'], 'video') !== false) {\n return true;\n }\n return false;\n }", "public function takeScreenShot()\n\t{\t\t\n\t\t$data = ['isScreenShotTaken' => true,'progress' => 3];\n\t\t$this->updateLocalFile($data);\n\t\treturn true;\n\t}", "private static function _is_make_multi_camera_video(array $cameras): bool\n\t{\n\t\treturn count($cameras) > 1;\n\t}", "public function is_default_userpic()\n {\n $this->log('Checking for default userpic');\n return (false !== strpos($this->_connection->get(\n self::HOST . self::ACCOUNT_OVERVIEW_URL,\n null,\n self::HOST . self::ACCOUNT_URL\n ), 'no_videos_'));\n }", "public function delete_video($arr_where){\n\n\t\t$str_select=\"video_file,video_img\";\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$video=$query->row_array();\n\n\t\t$this->db->where($arr_where);\n\t\tif($this->db->delete($this->_table)){\n\n\t\t\tif(is_array($video) && (element('video_file',$video,'') != ''))\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_file',$video,''));\n\n\t\t\tif(is_array($video) && (element('video_img',$video,'') != '')){\n\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_img',$video,''));\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.\"_thumbs/\".element('video_img',$video,''));\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "public function get_user_video($user_id){\n\n $user_id = intval($user_id);\n $uid = $this->get_uid($user_id);\n\n $query = \"SELECT `id`, `source`, `uid`, `filename_or_link` FROM `user_video` WHERE `uid`='$uid';\";\n\n $user_videos = [];\n\n if ($res = sql::$con->query($query, MYSQLI_STORE_RESULT)) {\n\n while ($data = $res->fetch_array(MYSQLI_ASSOC)) {\n if($data['source'] == 'local'){\n $file_path = '/file/video/'.$uid.'/'.$data['filename_or_link'];\n $data['filename_or_link'] = $file_path;\n }\n $user_videos[] = $data;\n }\n\n if(is_object($res)){\n $res->close();\n sql::$con->store_result();\n }\n\n }\n /*\n * FOR EXAMPLE FRAMES\n * <iframe style=\"width: 485px; min-height: 411px;\" src=\"<YOUTUBE-LINK>\" frameborder=\"0\" allowfullscreen allow=\"accelerometer; encrypted-media; gyroscope; picture-in-picture\"></iframe>\n * <iframe style=\"width: 485px; min-height: 411px;\" src=\"<VIMEO-LINK>\" frameborder=\"0\" allowfullscreen webkitallowfullscreen mozallowfullscreen ></iframe>\n *\n * */\n\n return $user_videos;\n }", "function subirImagen($id_patalla) {\n // MODIFICAR RUTA AL SUBIR AL HOSTING\n $dir_subida = '/home/c0990002/public_html/TB/imagenes_pantallas/';\n\n if (isset($_FILES['imagen']) && !$_FILES['imagen']['error'] > 0) {\n //GUARDADO DE IMAGEN\n if (move_uploaded_file($_FILES['imagen']['tmp_name'], $dir_subida . 'imagen_pantalla_id_' . $id_patalla)) {\n //return $dir_subida.'imagen_pantalla_id_'.$id_patalla;\n return 'https://www.rockerapp.com/TB/imagenes_pantallas/' . 'imagen_pantalla_id_' . $id_patalla;\n }\n }\n}", "public function savevideoAction()\n {\n $response = $this->getResponse();\n\n $dm = $this->getDocumentService();\n $successModel = new SuccessModel();\n\n $data = $this->params()->fromPost();\n $result = $successModel->saveNewVideo($dm, $data);\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }", "function KeyExist () { // verifie l'existence des cles pour connexions ssh\n\treturn file_exists('/var/remote_adm/.ssh/id_rsa.pub');\n}", "function testPathNotFoundMovie() {\n try {\n $v = $this->loadMovie(\"path_that_doesnt_exist/movie.mp4\");\n //this assert should never be called\n $this->assertTrue(false);\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n }", "public function saveVideo(Request $request) {\n $remote_connection = $this->remote_connection;\n\n $session = $request->input('session');\n $room_type = $request->input('room_type');\n $room_name = $request->input('room_name');\n $stream = $request->input('stream');\n $rec_dir = $request->input('rec_dir');\n\n $video_extension = '.webm';\n $audio_extension = '.ogg';\n\n $video_url = $rec_dir . '/' . $session . '-' . $stream . '-final' . $video_extension;\n $audio_url = $rec_dir . '/' . $session . '-' . $stream . $audio_extension;\n\n $video_room = VideoRoom::where('session_id', $session)->first();\n\n $video_id = $video_room->id;\n\n $video_details = json_encode(array('video_id' => $video_id, 'video' => $video_url, 'audio' => $audio_url), JSON_FORCE_OBJECT);\n\n //For Main video\n //$convert_to_webm_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/' . $session . '-' . $stream . '-video.mjr /var/www/html/recordings/' . $session . '-' . $stream . '-video.webm';\n //$convert_to_ogg_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/' . $session . '-' . $stream . '-audio.mjr /var/www/html/recordings/' . $session . '-' . $stream . '-audio.ogg';\n //$merge_webm_and_ogg_command = 'ffmpeg -i /var/www/html/recordings/' . $stream . '.webm -i /var/www/html/recordings/' . $stream . '.ogg -c:v copy -c:a libvorbis -strict experimental /var/www/html/recordings/' . $stream . '-final.webm';\n //$merge_webm_and_ogg_command = 'ffmpeg -i /var/www/html/recordings/' . $session . '-' . $stream . '-video.webm -i /var/www/html/recordings/' . $session . '-' . $stream . '-audio.ogg -c:v copy -shortest /var/www/html/recordings/' . $session . '-' . $stream . '-final.webm';\n\n //For Screenshare video\n //$convert_screenshare_to_webm_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/screenshare-'. $session .'-'. $stream .'-video.mjr /var/www/html/recordings/screenshare-'. $session . '-' . $stream . '-video.webm';\n //Execute main video scripts\n //$remote_connection->exec($convert_to_webm_command . ';' . $convert_to_ogg_command . ';' . $merge_webm_and_ogg_command);\n //$remote_connection->exec($merge_webm_and_ogg_command);\n //Execute main video scripts\n //$remote_connection->exec($convert_screenshare_to_webm_command);\n //$check_if_screenshare_exists = '[ -f /var/www/html/recordings/' . $session . '-screenshare-' . $stream . '-video.mjr ] && echo \"File exists\" || echo \"File doesn not exist\"';\n //$file_exists = $remote_connection->exec($check_if_screenshare_exists);\n //if ($file_exists === 'File exists') {\n //}\n\n return $video_details;\n }", "function maneja_perfiles_produccion()\n\t{\n\t\treturn $this->get_instalacion()->es_produccion() && $this->instancia->get_proyecto_usar_perfiles_propios($this->identificador);\n\t}", "public function post_user_video(){\n\tif(Auth::check()){\n\t\tif(Auth::user()->type==\"Admin\"){\n\t\t\treturn redirect('admin_dashboard');\n\t\t}\n\t\telseif (Auth::user()->type==\"Artist\") {\n\t\t\treturn redirect('/');\n\t\t}\n\t\telse{\n\t\t\t$profile_id= Auth::user()->profile_id;\n\t\t\t$user_email= Auth::user()->email;\n\t\t\t$my_videos = DB::table('requested_videos')->where('requestBy',$profile_id)\n\t\t\t->where('is_active','=','1')->where('remain_storage_duration','!=','disable')->orderBy('id','desc')\n\t\t\t->get();\n\t\t\t$purge_data = DB::table('setting')->select('status')->where('name','=',\"purge\")->first();\n\t\t\t//dd($purge_data->status);\n\t\t\tif(!is_null($my_videos)){\n\t\t\t\tforeach ($my_videos as $my_video) {\n\t\t\t\t\t$now = new \\DateTime();\n\t\t\t\t\t$date1=date_create($my_video->purchase_date);\n\t\t\t\t\t$diff=date_diff($date1,$now);\n\t\t\t\t\t$diff_date=$diff->format(\"%a\");\n\t\t\t\t\tif($my_video->url!='removed'){\n\t\t\t\t\t\t//if($purge_data!=null){\n\t\t\t\t\t\tif($my_video->remain_storage_duration-$diff_date == 0){\n\t\t\t\t\t\t\t$source = \"requested_video/\";\n\t\t\t\t\t\t\t$destination = \"requested_video/backup_video/\";\n\t\t\t\t\t\t\tDB::table('requested_videos')->where('id',$my_video->id)->update(array('desti_url' => $my_video->url,'url'=>'removed','remain_storage_duration'=>0 ));\n\t\t\t\t\t\t\t$st=substr($my_video->url,44);\n\t\t\t\t\t\t\t$file=$st;\n\t\t\t\t\t\t\tif (copy($source.$file, $destination.$file)) {\n\t\t\t\t\t\t\t\t$delete[] = $source.$file;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach ($delete as $file) {\n\t\t\t\t\t\t\t\tunlink($file);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*}else{\n\t\t\t\t\t\t\tif($diff_date>=$my_video->remain_storage_duration){\n\t\t\t\t\t\t\t\t$source = \"requested_video/\";\n\t\t\t\t\t\t\t\t$destination = \"requested_video/backup_video/\";\n\t\t\t\t\t\t\t\tDB::table('requested_videos')->where('id',$my_video->id)->update(array('desti_url' => $my_video->url,'url'=>'removed','remain_storage_duration'=>0 ));\n\t\t\t\t\t\t\t\t$st=substr($my_video->url,44);\n\t\t\t\t\t\t\t\t$file=$st;\n\t\t\t\t\t\t\t\tif (copy($source.$file, $destination.$file)) {\n\t\t\t\t\t\t\t\t\t$delete[] = $source.$file;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforeach ($delete as $file) {\n\t\t\t\t\t\t\t\t\tunlink($file);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$pageData['my_videos'] = $my_videos;\n\t\t\t$pageData['purge_data'] = $purge_data;\n\t\t\t$pageData['user_email'] = $user_email;\n\n\t\t\treturn view('frontend.UserVideo',$pageData);\n\n\t\t}\n\t}\n\telse{\n\t\treturn redirect('/login');\n\t}\n}", "public function preSaveGaleria()\r\n {\r\n if($this->getTipoArchivo()== RpsStms::TIPO_ARCHIVO_LINK){\r\n $infoVideo= RpsStms::getTitleAndImageVideoYoutube($this->getArchivo());\r\n $this->setThumbnail($infoVideo['thumbnail']);\r\n $this->setArchivo($infoVideo['urlVideo']);\r\n $this->setTitulo($infoVideo['title']);\r\n $this->setDescripcion($infoVideo['description']);\r\n }\r\n }", "public function isExist($id_media)\n {\n \t// print_r($this->_db);\n\t\t$result = $this->_db->simpleSelect(\"media C\", \"C.id\", array(\"id\", \"=\", $id_media));\n\t\treturn $this->_db->haveRows($result);\n\t\t\n }", "public function verCamara1EnPlasma( ) {\n\n $respuesta=self::$plasma->verEntradaPantallaAV2();\n return $this->isError($respuesta,\"ver la camara1 en\");\n }", "protected function _hapusPrevFoto()\r\n {\r\n $this->db->prepare('SELECT avatar_user FROM akun_siswa WHERE nis = :nis');\r\n $this->db->bind('nis',$_SESSION['login']);\r\n $foto = $this->db->queryOne();\r\n if (file_exists('user/profile/img/'.$foto['avatar_user'] || $foto['avatar_user'] !== 'user-def.svg')) {\r\n unlink('user/profile/img/'.$foto['avatar_user']);\r\n return true;\r\n }else{\r\n return true;\r\n }\r\n }", "public function resume(): bool {}" ]
[ "0.6682125", "0.60557985", "0.59236294", "0.58717525", "0.58493084", "0.5775372", "0.5751489", "0.5747257", "0.5722758", "0.5552585", "0.55412745", "0.5498349", "0.5433884", "0.54167235", "0.54151773", "0.53951454", "0.53884536", "0.5380844", "0.5372399", "0.53534067", "0.5349359", "0.5329415", "0.52976584", "0.52839714", "0.52836186", "0.52743495", "0.52718055", "0.527114", "0.5256913", "0.5238321", "0.52283823", "0.52216935", "0.5221262", "0.5186348", "0.518128", "0.51775384", "0.5122232", "0.51215607", "0.51097363", "0.5105208", "0.50837445", "0.5069478", "0.5063224", "0.50601107", "0.50516784", "0.50485647", "0.50485355", "0.501232", "0.5003532", "0.49908778", "0.49878228", "0.49836287", "0.49809527", "0.4978115", "0.49701205", "0.49668145", "0.4962902", "0.4962899", "0.49449474", "0.49210793", "0.49170718", "0.49149263", "0.49012834", "0.48967713", "0.489605", "0.4893392", "0.48916584", "0.4890498", "0.4884756", "0.4884728", "0.4883653", "0.4882162", "0.4881182", "0.487215", "0.48675892", "0.4866307", "0.4862845", "0.48548985", "0.48491967", "0.484268", "0.48402628", "0.48390636", "0.48383573", "0.48276097", "0.4826217", "0.48224086", "0.4818005", "0.48141587", "0.4808327", "0.47987363", "0.47983316", "0.47972843", "0.4794967", "0.47898954", "0.47893846", "0.4788427", "0.47846875", "0.47801024", "0.47768247", "0.47754914" ]
0.6268705
1
Cargas las reproducciones cargadas en base al id del usuario
public function cargarVideosYaVistos(){ $query = "SELECT Video_codVideo FROM reproduccion WHERE Usuario_codUsuario = ".parent::string($this->getUsuario_codUsuario())." ORDER BY Video_codVideo ASC;"; $result = mysqli_query(parent::conexion(), $query); $arreglo = null; if(!$result){ die("Error"); } else{ while($data = mysqli_fetch_assoc($result)){ $arreglo[] = $data; } } parent::desconectar(); return json_encode($arreglo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }", "public function cambiosincoseis($id_usuario){\r\n\t\t$sql = \"UPDATE tbl_usuarios SET valorPre='6' WHERE id_usuario='$id_usuario'\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "public function insertReproduccion(){\n $query = \"INSERT INTO reproduccion (videoVisto, Usuario_codUsuario, Video_codVideo) VALUES (true, \".parent::string($this->getUsuario_codUsuario()).\", \".parent::string($this->getVideo_codVideo()).\");\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "function idperfil($nombre){\n //busca en la tabla usuarios los campos donde el alias sea igual a lo que recibe del controlaor si no encuentra nada devuelve null\n $usuario = R::findOne('usuarios', 'alias=?', [\n $nombre\n ]);\n //guardo en una sesion la variable usuario y se retorna esa variable al controlador Usuarios.php linea 169 dentro de la carpeta usuario\n $_SESSION['idusuario']=$usuario->id;\n return $usuario;\n }", "function __obtenerCorreoReferente($encryptedID = null) {\n\t\t//\n\t\t//$totalUsuarios = $this->User->find('first', array('conditions' => array()));\n\t\t$max_id = $this -> User -> find('first', array('fields' => array('MAX(User.id) as user_id')));\n\t\t$usuario = null;\n\t\tfor ($id = 1; $id <= $max_id; $id++) {\n\t\t\tif ($encryptedID == crypt($id, \"23()23*$%g4F^aN!^^%\")) {\n\t\t\t\t// Las ID son iguales, abonar por recomendacion\n\t\t\t\t//\n\t\t\t\t$usuario = $this -> User -> read(null, $id);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// Seguir buscando\n\t\t\t\t//\n\t\t\t}\n\t\t}\n\t\treturn $usuario['User']['email'];\n\t}", "private function usrsave() {\n $id = 0;\n $resultado = 0;\n $pass = '';\n if ($this->UTILITY->validate_email($this->email)) {\n $arrjson = $this->UTILITY->error_wrong_email();\n } else {\n if ($this->id > 0) {\n //se verifica que el email está disponible\n $q = \"SELECT usr_id FROM ass_usuario WHERE usr_email = '\" . $this->email . \"' AND usr_id != $this->id \";\n $con = mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $resultado = mysql_num_rows($con);\n if ($resultado == 0) {\n //actualiza la informacion\n $q = \"SELECT usr_id FROM ass_usuario WHERE usr_id = \" . $this->id;\n $con = mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n while ($obj = mysql_fetch_object($con)) {\n $id = $obj->usr_id;\n if (strlen($this->pass) > 2) {\n $pass = $this->UTILITY->make_hash_pass($this->email, $this->pass);\n }\n $table = \"ass_usuario\";\n $arrfieldscomma = array(\n 'usr_nombre' => $this->nombre,\n 'usr_apellido' => $this->apellido,\n 'usr_email' => $this->email,\n 'usr_pass' => $pass,\n 'usr_cargo' => $this->cargo,\n 'usr_identificacion' => $this->identificacion,\n 'usr_celular' => $this->celular,\n 'usr_telefono' => $this->telefono,\n 'usr_habilitado' => $this->habilitado,\n 'usr_contacto' => $this->contacto);\n $arrfieldsnocomma = array('mzt_proveedor_pro_id' => $this->idprov, 'mzt_cliente_cli_id' => $this->idcli, 'usr_dtcreate' => $this->UTILITY->date_now_server());\n $q = $this->UTILITY->make_query_update($table, \"usr_id = '$id'\", $arrfieldscomma, $arrfieldsnocomma);\n mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $arrjson = array('output' => array('valid' => true, 'id' => $id));\n }\n } else {\n $arrjson = $this->UTILITY->error_user_already_exist();\n }\n } else {\n //se verifica que el email está disponible\n $q = \"SELECT usr_id FROM ass_usuario WHERE usr_email = '\" . $this->email . \"'\";\n $con = mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $resultado = mysql_num_rows($con);\n if ($resultado == 0) {\n if (strlen($this->pass) > 2) {\n $pass = $this->UTILITY->make_hash_pass($this->email, $this->pass);\n }\n $this->pass = $pass;\n $q = \"INSERT INTO ass_usuario (usr_dtcreate, mzt_cliente_cli_id, mzt_proveedor_pro_id, usr_habilitado, usr_nombre, usr_apellido, usr_cargo, usr_email, usr_pass, usr_identificacion, usr_celular, usr_telefono, usr_contacto) VALUES (\" . $this->UTILITY->date_now_server() . \", $this->idcli, $this->idprov, '$this->habilitado', '$this->nombre', '$this->apellido', '$this->cargo', '$this->email', '$this->pass', '$this->identificacion', '$this->celular', '$this->telefono', '$this->contacto')\";\n mysql_query($q, $this->conexion) or die(mysql_error() . \"***ERROR: \" . $q);\n $id = mysql_insert_id();\n $arrjson = array('output' => array('valid' => true, 'id' => $id));\n } else {\n $arrjson = $this->UTILITY->error_user_already_exist();\n }\n }\n }\n $this->response = ($arrjson);\n }", "public static function copyempresa_borra($user_id)\n {\n DB::table('user_modulo')->where('user_id', '=', $user_id)->where('propietario', '=', 'asesor')->delete();\n DB::table('user_claves')->where('user_id', '=', $user_id)->where('propietario', '=', 'asesor')->delete();\n DB::table('user_parrafos')->where('user_id', '=', $user_id)->where('propietario', '=', 'asesor')->delete();\n DB::table('user_imagenes')->where('user_id', '=', $user_id)->where('propietario', '=', 'asesor')->delete();\n\n /*\n DB::table('proyecto_modulo')\n ->whereIn('proyecto_modulo.proyecto_id', function($query) use($user_id) {\n $query->select('proyectos.id')\n ->from('proyectos')\n ->where('proyectos.user_id', '=', $user_id);\n })\n ->where('proyecto_modulo.propietario', '=', 'asesor')\n ->delete();\n\n DB::table('proyectos_claves')\n ->whereIn('proyectos_claves.proyecto_id', function($query) use($user_id) {\n $query->select('proyectos.id')\n ->from('proyectos')\n ->where('proyectos.user_id', '=', $user_id);\n })\n ->where('proyectos_claves.propietario', '=', 'asesor')\n ->delete();\n\n DB::table('proyectos_parrafos')\n ->whereIn('proyectos_parrafos.proyecto_id', function($query) use($user_id) {\n $query->select('proyectos.id')\n ->from('proyectos')\n ->where('proyectos.user_id', '=', $user_id);\n })\n ->where('proyectos_parrafos.propietario', '=', 'asesor')\n ->delete();\n\n DB::table('proyectos_imagenes')\n ->whereIn('proyectos_imagenes.proyecto_id', function($query) use($user_id) {\n $query->select('proyectos.id')\n ->from('proyectos')\n ->where('proyectos.user_id', '=', $user_id);\n })\n ->where('proyectos_imagenes.propietario', '=', 'asesor')\n ->delete();\n */\n }", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "function restar_reputacion($id_user, $id_pasajero, $id_viaje) {\n $data = array(\n 'id_chofer' => $id_user,\n 'id_viaje' => $id_viaje,\n 'id_pasajero' => $id_pasajero,\n 'calificacion' => -1,\n \n );\n $this->db->insert('calificacion_chofer', $data);\n }", "public function inscribir($id)\n {\n $user= Auth::user()->id;\n $ipr = new ProyectosUsers();\n $ipr->proyectos_id = $id;\n $ipr->users_id = $user;\n $ipr->estadosproyectosusers_id = \"2\";\n $ipr->save();\n return redirect('/home');\n\n }", "function crearUsuario($correo,$nombre,$contrasenya){\n require (\"../configuracion/conexion.php\");\n \n //COMPROBAR SI EL CORREO YA ESTA EN USO\n $comprobarCorreo =\"SELECT correo FROM Usuarios WHERE correo='$correo'\";\n $resultCorreo = mysqli_query($conn, $comprobarCorreo);\n \n $filasCorreo=mysqli_num_rows($resultCorreo);\n if($filasCorreo==0){\n \n //COMPROBAR SI YA EXISTE EL NOMBRE DE USUARIO\n \n $comprobarNombre =\"SELECT nombre_usuario FROM Usuarios WHERE nombre_usuario='$nombre'\";\n $resultNombre = mysqli_query($conn, $comprobarNombre);\n \n $filasNombre=mysqli_num_rows($resultNombre);\n if($filasNombre==0){\n \n //AUTOINCREMENTAR ID\n $cons = \"SELECT ID_usuario FROM Usuarios ORDER BY ID_usuario DESC LIMIT 1;\";\n $result = mysqli_query($conn, $cons);\n \n while($fila = mysqli_fetch_array($result)){\n \n $ID = $fila[0] + 1;\n }\n //METER USUARIO\n $addUsuario = \"INSERT INTO Usuarios VALUES('$ID','$nombre','$contrasenya','$correo');\";\n $result = mysqli_query($conn, $addUsuario);\n \n \n //INICIAR SESION DESPUES DE CREARLO\n \n $cons=\"SELECT * FROM Usuarios WHERE correo='$correo' and password='$contrasenya'\";\n $result = mysqli_query($conn, $cons);\n \n if ($fila = mysqli_fetch_array($result)) {\n \n session_start();\n \t $_SESSION[\"correo\"] = $fila['correo'];\n \t $_SESSION[\"usuario\"] = $fila['nombre_usuario'];\n \t $_SESSION[\"id\"] = $fila['ID_usuario'];\n \t $_SESSION[\"idAlbum\"] = \"\";\n\t $_SESSION[\"nombre_album\"] = \"\";\n }\n \n return 0;\n \n }else{\n return 2;\n }\n }else{\n return 1;\n }\n \n mysqli_free_result($result);\n mysqli_close($conn);\n\n //LISTA DE ERRORES Y CORRECTO:\n //0 Funciona todo bien\n //1 Correo en uso\n //2 Nombre en uso\n }", "public function dupliquer($id = null) {\n if (isAuthorized('utilisateurs', 'duplicate')) :\n $this->Utilisateur->id = $id;\n $record = $this->Utilisateur->read();\n $NOMLONG = $record['Utilisateur']['NOMLONG'];\n unset($record['Utilisateur']['id']);\n unset($record['Utilisateur']['password']); \n unset($record['Utilisateur']['utilisateur_id']); \n unset($record['Utilisateur']['tjmagent_id']); \n unset($record['Utilisateur']['dotation_id']);\n unset($record['Utilisateur']['username']);\n unset($record['Utilisateur']['ACTIF']); \n unset($record['Utilisateur']['DATEDEBUTACTIF']); \n unset($record['Utilisateur']['NAISSANCE']);\n $record['Utilisateur']['NAISSANCE']='00/00/0000';\n unset($record['Utilisateur']['NOM']);\n $record['Utilisateur']['NOM']='Inconnu';\n unset($record['Utilisateur']['PRENOM']);\n $record['Utilisateur']['PRENOM']='Inconnu';\n unset($record['Utilisateur']['MAIL']); \n unset($record['Utilisateur']['TELEPHONE']);\n unset($record['Utilisateur']['CONGE']);\n unset($record['Utilisateur']['RQ']);\n unset($record['Utilisateur']['tjmagent_id']);\n unset($record['Utilisateur']['ACTIF']);\n unset($record['Utilisateur']['VT']); \n unset($record['Utilisateur']['WORKCAPACITY']);\n unset($record['Utilisateur']['HIERARCHIQUE']);\n unset($record['Utilisateur']['GESTIONABSENCES']);\n unset($record['Utilisateur']['WIDEAREA']);\n unset($record['Utilisateur']['COMMENTAIRE']);\n unset($record['Utilisateur']['NOMLONG']);\n $record['Utilisateur']['COMMENTAIRE']='';\n unset($record['Utilisateur']['created']); \n unset($record['Utilisateur']['modified']);\n $record['Utilisateur']['societe_id']= isset($record['Utilisateur']['societe_id']) ? $record['Utilisateur']['societe_id'] : '';\n if(isset($record['Utilisateur']['profil_id'])){\n $record['Utilisateur']['profil_id']=$record['Utilisateur']['profil_id']; \n } else {\n unset($record['Utilisateur']['profil_id']);\n }\n if (isset($record['Utilisateur']['assistance_id'])){\n $record['Utilisateur']['assistance_id']=$record['Utilisateur']['assistance_id'];\n } else {\n unset($record['Utilisateur']['assistance_id']);\n }\n if (isset($record['Utilisateur']['section_id'])) {\n $record['Utilisateur']['section_id']=$record['Utilisateur']['section_id'];\n } else {\n unset($record['Utilisateur']['section_id']);\n }\n if (isset($record['Utilisateur']['site_id'])) {\n $record['Utilisateur']['site_id']=$record['Utilisateur']['site_id'];\n } else {\n unset($record['Utilisateur']['site_id']);\n }\n if (isset($record['Utilisateur']['domaine_id'])) {\n $record['Utilisateur']['domaine_id']=$record['Utilisateur']['domaine_id'];\n } else {\n unset($record['Utilisateur']['domaine_id']);\n } \n if (isset($record['Utilisateur']['FINMISSION'])){\n $record['Utilisateur']['FINMISSION']=$record['Utilisateur']['FINMISSION'];\n } else {\n unset($record['Utilisateur']['FINMISSION']);\n }\n $this->Utilisateur->create();\n if ($this->Utilisateur->save($record)) {\n $lastid = $this->Utilisateur->id;\n $this->addnewaction($lastid);\n $this->save_history($lastid,'Création du compte à partir d\\'une duplication');\n $ObjUtiliseoutils = new UtiliseoutilsController();\n $ObjUtiliseoutils->duplicate_from_user($id,$lastid);\n $this->Session->setFlash(__('Utilisateur dupliqué',true),'flash_success');\n $this->redirect(array('action'=>'edit',$lastid));\n } \n $this->Session->setFlash(__('Utilisateur <b>NON</b> dupliqué',true),'flash_failure');\n $this->History->goBack(1);\n else :\n $this->Session->setFlash(__('Action non autorisée, veuillez contacter l\\'administrateur.',true),'flash_warning');\n throw new UnauthorizedException(\"Vous n'êtes pas autorisé à utiliser cette fonctionnalité de l'outil\");\n endif; \n }", "public function getUsuarioUni($idusuario) {\n }", "public function getIdUserRespuesta()\n {\n return $this->id_user_respuesta;\n }", "public function registroCredito($id_usuario_credi, $id_cliente_credito, $fecha_credito, $nombre_produc, $precios_produc, $cantidades_produc, $total_factura, $total_creditar, $total_adeudado){\n $this->id_usuario_credi = $id_usuario_credi;\n $this->id_cliente_credito = $id_cliente_credito; \n $this->fecha_credito = $fecha_credito;\n $this->nombre_produc = $nombre_produc;\n $this->precios_produc = $precios_produc;\n $this->cantidades_produc = $cantidades_produc;\n $this->total_factura = $total_factura;\n $this->total_creditar = $total_creditar;\n $this->total_adeudado = $total_adeudado;\n $this->estado_factura = \"p\";\n \n return $this->db->insert('factura_credito', $this);\n }", "public function getRUser($post)\n\t{\n\t\ttry {\n\t\t\t$condicion = '';\n\t\t\t$aux_ids = array();\n\t\t\t#Si existe el id del personal, buscar los bienes de la persona\n\t\t\tif ( isset($post['servidor_id']) && !empty($post['servidor_id']) ) \n\t\t\t{\n\t\t\t\t$servidor = $post['servidor_id']; \n\n\t\t\t\t$this->sql = \" SELECT bien_id FROM asignacion WHERE personal_id = ? \";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam( 1,$servidor );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes_ids = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\tforeach ($bienes_ids as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->bien_id);\n\t\t\t\t}\n\t\t\t\t/*Conversion a string*/\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t\n\t\t\t\t/*Buscar en la tabla de bienes , las asignaciones registradas*/\n\t\t\t\t$this->sql = \" SELECT \n\t\t\t\t\tb.id,\n\t\t\t\t\tb.descripcion,\n\t\t\t\t\tb.serie,\n\t\t\t\t\tb.status,\n\t\t\t\t\tb.inventario,\n\t\t\t\t\tb.desc_ub,\n\t\t\t\t\tm.nombre AS marca,\n\t\t\t\t\tg.nombre AS grupo,\n\t\t\t\t\tt.nombre AS tipo,\n\t\t\t\t\tmo.nombre AS modelo,\n\t\t\t\t\tb.fecha_reg AS registro,\n\t\t\t\t\tb.fecha_adq AS adquisicion,\n\t\t\t\t\tUPPER(c.nombre) AS color,\n\t\t\t\t\tma.nombre AS material,\n\t\t\t\t\tp.nombre AS proveedor,\n\t\t\t\t\tCONCAT(\n\t\t\t\t\t pe.nombre,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_pat,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_mat\n\t\t\t\t\t) AS asignadoa\n\t\t\t\t FROM bienes AS b\n\t\t\t\t INNER JOIN marcas AS m\n\t\t\t\t ON\n\t\t\t\t m.id = b.marca_id\n\t\t\t\t INNER JOIN grupos AS g\n\t\t\t\t ON\n\t\t\t\t g.id = b.grupo_id\n\t\t\t\t INNER JOIN t_bienes AS t\n\t\t\t\t ON\n\t\t\t\t t.id = b.tipo_id\n\t\t\t\t INNER JOIN modelos AS mo\n\t\t\t\t ON\n\t\t\t\t mo.id = b.modelo_id\n\t\t\t\t INNER JOIN color AS c\n\t\t\t\t ON\n\t\t\t\t c.id = b.color_id\n\t\t\t\t INNER JOIN materiales AS ma\n\t\t\t\t ON\n\t\t\t\t ma.id = b.material_id\n\t\t\t\t INNER JOIN proveedores AS p\n\t\t\t\t ON\n\t\t\t\t p.id = b.pro_id\n\t\t\t\t INNER JOIN asignacion AS a\n\t\t\t\t ON\n\t\t\t\t a.bien_id = b.id\n\t\t\t\t INNER JOIN personal AS pe\n\t\t\t\t ON\n\t\t\t\t pe.id = a.personal_id WHERE b.id IN ($aux_ids) \";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\t\n\t\t\t\treturn json_encode($bienes) ;\n\t\t\t} \n\t\t\telseif( isset($post['area']) && !empty($post['area']) )\n\t\t\t{\n\t\t\t\t$area = $post['area'];\n\t\t\t\t#Buscar a los usuarios pertenecientes al area\n\t\t\t\t$this->sql = \"SELECT id FROM personal WHERE area_id = ?\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam(1,$area);\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$personas = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\tforeach ($personas as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->id);\n\t\t\t\t}\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t#ubicar los bienes con las personas (En asignaciones)\n\t\t\t\t$this->sql = \"SELECT bien_id FROM asignacion WHERE personal_id IN (?)\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->bindParam(1,$aux_ids);\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$asignaciones = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\t#Limpiar arreglo auxiliar\n\t\t\t\tunset($aux_ids);\n\t\t\t\t$aux_ids = array();\n\t\t\t\tforeach ($asignaciones as $key => $id) {\n\t\t\t\t\tarray_push($aux_ids,$id->bien_id);\n\t\t\t\t}\n\t\t\t\t$aux_ids = implode(',',$aux_ids);\n\t\t\t\t#Buscar los bienes (Bienes)\n\t\t\t\t$this->sql = \"SELECT \n\t\t\t\t\tb.id,\n\t\t\t\t\tb.descripcion,\n\t\t\t\t\tb.serie,\n\t\t\t\t\tb.status,\n\t\t\t\t\tb.inventario,\n\t\t\t\t\tb.desc_ub,\n\t\t\t\t\tm.nombre AS marca,\n\t\t\t\t\tg.nombre AS grupo,\n\t\t\t\t\tt.nombre AS tipo,\n\t\t\t\t\tmo.nombre AS modelo,\n\t\t\t\t\tb.fecha_reg AS registro,\n\t\t\t\t\tb.fecha_adq AS adquisicion,\n\t\t\t\t\tUPPER(c.nombre) AS color,\n\t\t\t\t\tma.nombre AS material,\n\t\t\t\t\tp.nombre AS proveedor,\n\t\t\t\t\tCONCAT(\n\t\t\t\t\t pe.nombre,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_pat,\n\t\t\t\t\t ' ',\n\t\t\t\t\t pe.ap_mat\n\t\t\t\t\t) AS asignadoa\n\t\t\t\t FROM bienes AS b\n\t\t\t\t INNER JOIN marcas AS m\n\t\t\t\t ON\n\t\t\t\t m.id = b.marca_id\n\t\t\t\t INNER JOIN grupos AS g\n\t\t\t\t ON\n\t\t\t\t g.id = b.grupo_id\n\t\t\t\t INNER JOIN t_bienes AS t\n\t\t\t\t ON\n\t\t\t\t t.id = b.tipo_id\n\t\t\t\t INNER JOIN modelos AS mo\n\t\t\t\t ON\n\t\t\t\t mo.id = b.modelo_id\n\t\t\t\t INNER JOIN color AS c\n\t\t\t\t ON\n\t\t\t\t c.id = b.color_id\n\t\t\t\t INNER JOIN materiales AS ma\n\t\t\t\t ON\n\t\t\t\t ma.id = b.material_id\n\t\t\t\t INNER JOIN proveedores AS p\n\t\t\t\t ON\n\t\t\t\t p.id = b.pro_id\n\t\t\t\t INNER JOIN asignacion AS a\n\t\t\t\t ON\n\t\t\t\t a.bien_id = b.id\n\t\t\t\t INNER JOIN personal AS pe\n\t\t\t\t ON\n\t\t\t\t pe.id = a.personal_id\n\t\t\t\t WHERE b.id IN ($aux_ids)\";\n\t\t\t\t$this->stmt = $this->pdo->prepare( $this->sql );\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$bienes = $this->stmt->fetchAll( PDO::FETCH_OBJ );\n\t\t\t\treturn json_encode($bienes);\n\t\t\t}else{\n\t\t\t\treturn json_encode( array('message'=>'No selecciono ningún criterio') );\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$this->result = array('error' => $e->getMessage() );\n\t\t}\t\n\t}", "function set_profile($tipo, $idusuario)\n {\n $query = '';\n if($tipo == 'B')\n {\n $query = 'INSERT INTO permisos_usr (idpermiso, idusuario, cpermis) VALUES\n (1, '.$idusuario.', 1),\n (2, '.$idusuario.', 1),\n (3, '.$idusuario.', 1),\n (4, '.$idusuario.', 1),\n (5, '.$idusuario.', 1),\n (6, '.$idusuario.', 1),\n (7, '.$idusuario.', 0),\n (8, '.$idusuario.', 0),\n (9, '.$idusuario.', 1),\n (10, '.$idusuario.', 0),\n (11, '.$idusuario.', 0),\n (12, '.$idusuario.', 0),\n (13, '.$idusuario.', 1),\n (14, '.$idusuario.', 1),\n (15, '.$idusuario.', 0),\n (16, '.$idusuario.', 1),\n (17, '.$idusuario.', 0),\n (18, '.$idusuario.', 0),\n (19, '.$idusuario.', 0),\n (20, '.$idusuario.', 0),\n (21, '.$idusuario.', 0),\n (22, '.$idusuario.', 0),\n (23, '.$idusuario.', 0),\n (24, '.$idusuario.', 1),\n (25, '.$idusuario.', 0),\n (26, '.$idusuario.', 0),\n (27, '.$idusuario.', 0);';\n }\n\n if($tipo == 'C')\n {\n $query = 'INSERT INTO permisos_usr (idpermiso, idusuario, cpermis) VALUES\n (1, '.$idusuario.', 1),\n (2, '.$idusuario.', 1),\n (3, '.$idusuario.', 1),\n (4, '.$idusuario.', 1),\n (5, '.$idusuario.', 1),\n (6, '.$idusuario.', 0),\n (7, '.$idusuario.', 1),\n (8, '.$idusuario.', 1),\n (9, '.$idusuario.', 1),\n (10, '.$idusuario.', 1),\n (11, '.$idusuario.', 0),\n (12, '.$idusuario.', 1),\n (13, '.$idusuario.', 0),\n (14, '.$idusuario.', 0),\n (15, '.$idusuario.', 1),\n (16, '.$idusuario.', 1),\n (17, '.$idusuario.', 1),\n (18, '.$idusuario.', 1),\n (19, '.$idusuario.', 0),\n (20, '.$idusuario.', 0),\n (21, '.$idusuario.', 0),\n (22, '.$idusuario.', 0),\n (23, '.$idusuario.', 0),\n (24, '.$idusuario.', 0),\n (25, '.$idusuario.', 1),\n (26, '.$idusuario.', 0),\n (27, '.$idusuario.', 0);';\n }\n\n if($tipo == 'E')\n {\n $query = 'INSERT INTO permisos_usr (idpermiso, idusuario, cpermis) VALUES\n (1, '.$idusuario.', 1),\n (2, '.$idusuario.', 1),\n (3, '.$idusuario.', 1),\n (4, '.$idusuario.', 1),\n (5, '.$idusuario.', 1),\n (6, '.$idusuario.', 1),\n (7, '.$idusuario.', 1),\n (8, '.$idusuario.', 0),\n (9, '.$idusuario.', 1),\n (10, '.$idusuario.', 1),\n (11, '.$idusuario.', 1),\n (12, '.$idusuario.', 1),\n (13, '.$idusuario.', 0),\n (14, '.$idusuario.', 0),\n (15, '.$idusuario.', 0),\n (16, '.$idusuario.', 1),\n (17, '.$idusuario.', 1),\n (18, '.$idusuario.', 1),\n (19, '.$idusuario.', 1),\n (20, '.$idusuario.', 1),\n (21, '.$idusuario.', 1),\n (22, '.$idusuario.', 1),\n (23, '.$idusuario.', 1),\n (24, '.$idusuario.', 0),\n (25, '.$idusuario.', 0),\n (26, '.$idusuario.', 0),\n (27, '.$idusuario.', 0);';\n }\n\n return $query;\n }", "public function datos_usuario(){\n\t\t$data = json_decode(json_encode($_SESSION['USER']),true);\n\n\t\t$result = $this->_db->query(\"\n\t\tSELECT a.roleid FROM \".DB_PRE.\"role_assignments a, \".DB_PRE.\"context b \n\t\tWHERE a.userid = '$data[id]' AND a.contextid = b.id AND b.instanceid =\".ID_CURSO\n\t\t);\n\n\t\t$rol = 0;\n\t\tif (!$result) {\n\t\t\tprintf(\"Errormessage datos_usuario: %s\\n\", $this->_db->error);\n\t\t}else{\n\t $rol_user = $result->fetch_all(MYSQLI_ASSOC);\n\t if(count($rol_user) > 0){\n\t \t$rol = $rol_user['0']['roleid'];\n\t }\n \t}\n\n\t\t$usuario = array(\n\t\t\t\"id\" => $data['id'],\n\t\t\t\"nombre\" => $data['firstname'],\n\t\t\t\"apellido\" => $data['lastname'],\n\t\t\t\"codigo_estudiante\" => $data['idnumber'],\n\t\t\t\"rol\" => $rol\n\t\t);\n\n\t\t$datos_add = $this->_db->query(\"\n\t\t\tSELECT e.per_aca, b.id_facultad, a.id_programa, e.idnumber as codigo_curso, a.id_genero, a.idnumber\n\t\t\tFROM am_usuario a, am_programa b, \".DB_PRE.\"course e\n\t\t\tWHERE a.id_programa = b.id_programa\n\t\t\tAND e.id = \".ID_CURSO.\"\n\t\t\tAND id_moodle = \".$data['id']\n\t\t\t);\n\n\t\tif (!$datos_add) {\n\t\t\tprintf(\"Errormessage datos_add: %s\\n\", $this->_db->error);\n\t\t}else{\n\t\t\t$row = $datos_add->fetch_all(MYSQLI_ASSOC);\n\t\t\tforeach ($row as $key) {\n\t\t\t\tforeach ($key as $data => $value) {\n\t\t\t\t\t$usuario[$data] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $usuario;\n\t}", "public function unidadReceptoraReal($correspondencia_id) {\n \n // BUSCAR UNIDADES DE RECEPTORES ESTABLECIDOS\n $unidades_receptoras = array();\n $unidad_recibe_id = '';\n $receptores_establecidos = Doctrine::getTable('Correspondencia_Receptor')->findByCorrespondenciaIdAndEstablecido($correspondencia_id, 'S');\n foreach ($receptores_establecidos as $receptor_establecido) {\n $unidades_receptoras[] = $receptor_establecido->getUnidadId();\n if($receptor_establecido->getFuncionarioId() == $this->getUser()->getAttribute('funcionario_id')){\n // SI EL FUNCIONARIO LOGUEADO ES ESTABLECIDO COMO RECEPTOR SE SELECCIONA LA UNIDAD POR LA CUAL RECIBE\n $unidad_recibe_id = $receptor_establecido->getUnidadId();\n }\n }\n \n if($unidad_recibe_id==''){\n // EN CASO DE NO ENCONTRAR LA UNIDAD, BUSCAR SI LE FUE ASIGANADA LA CORRESPONDENCIA COMO UNA TAREA\n $receptor_asignado = Doctrine::getTable('Correspondencia_Receptor')->findOneByCorrespondenciaIdAndFuncionarioIdAndEstablecido($correspondencia_id, $this->getUser()->getAttribute('funcionario_id'), 'A');\n\n if($receptor_asignado){\n $unidad_recibe_id = $receptor_asignado->getUnidadId();\n }\n }\n \n if($unidad_recibe_id==''){\n // BUSCAR LAS UNIDADES A LA QUE PERTENECE EL FUNCIONARIO CON PERMISO DE LEER\n $unidades_receptoras = array_unique($unidades_receptoras);\n \n $funcionario_unidades_leer = Doctrine::getTable('Correspondencia_FuncionarioUnidad')->funcionarioAutorizado($this->getUser()->getAttribute('funcionario_id'),'leer');\n\n foreach($funcionario_unidades_leer as $unidad_leer) {\n if(array_search($unidad_leer->getAutorizadaUnidadId(), $unidades_receptoras)>=0){\n $unidad_recibe_id = $unidad_leer->getAutorizadaUnidadId();\n }\n }\n }\n \n return $unidad_recibe_id;\n }", "private function consultar_usuario_por_correo() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.correo ='{$this->referencia_a_buscar}'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function getUsuarioCadeco($id_usuario);", "protected function ReproducidasPorUsuario ($userID)\n {\n $listas = new Model_Listas();\n $listas->titulo ='reproducidas';\n $listas->id_usuario = $userID;\n $listas->editable=0;\n $listas->save();\n }", "public function traer_registro($id)\n {\n $this->db->where('id_usuario', $id)->from('usuarios'); \n\n $query = $this->db->get(); \n\n $usuario = $query->result(); \n\n if ($usuario){\n return $usuario[0];\n }\n else {\n return null;\n }\n }", "public function rpToClient($id)\n {\n $PublicRespel = Respel::where('RespelSlug', $id)->first();\n\n $PublicRespel->load('requerimientos');\n\n if (in_array(Auth::user()->UsRol, Permisos::CLIENTE)) {\n $UserSedeID = DB::table('personals')\n ->join('cargos', 'cargos.ID_Carg', 'personals.FK_PersCargo')\n ->join('areas', 'areas.ID_Area', 'cargos.CargArea')\n ->join('sedes', 'sedes.ID_Sede', 'areas.FK_AreaSede')\n ->where('personals.ID_Pers', Auth::user()->FK_UserPers)\n ->value('sedes.ID_Sede');\n }else{\n $UserSedeID = 1;\n }\n\n if (in_array(Auth::user()->UsRol, Permisos::CLIENTE)) {\n\n $Cotizacion = new Cotizacion();\n $Cotizacion->CotiNumero = 7;\n $Cotizacion->CotiFechaSolicitud = now();\n $Cotizacion->CotiDelete = 0;\n $Cotizacion->CotiStatus = \"Aprobada\";\n $Cotizacion->FK_CotiSede = $UserSedeID;\n $Cotizacion->save();\n }else{\n $Cotizacion->ID_Coti = 1;\n }\n\n $newRespel = $PublicRespel->replicate();\n $newRespel->RespelSlug = hash('sha256', rand().time().$PublicRespel->RespelName);\n $newRespel->RespelPublic = 0;\n $newRespel->RespelStatus = 'Evaluado';\n $newRespel->FK_RespelCoti = $Cotizacion->ID_Coti;\n $newRespel->save();\n\n foreach($PublicRespel->requerimientos as $requerimiento)\n {\n if ($requerimiento->forevaluation == 1) {\n $requerimiento->load('pretratamientosSelected');\n $newrequerimiento = $requerimiento->replicate();\n $newrequerimiento->ReqSlug = hash('md5', rand().time().$newRespel->ID_Respel);\n $newrequerimiento->FK_ReqRespel = $newRespel->ID_Respel;\n $newrequerimiento->ofertado = 0;\n $newrequerimiento->save();\n\n foreach($requerimiento->pretratamientosSelected as $pretratamientoSelected)\n {\n $newrequerimiento->pretratamientosSelected()->attach($pretratamientoSelected->ID_PreTrat);\n }\n /*se copian las tarifas y requerimientos*/\n $tarifaparacopiar = Tarifa::with(['rangos'])\n ->where('FK_TarifaReq', $requerimiento->ID_Req)->first();\n $nuevatarifa = $tarifaparacopiar->replicate();\n $nuevatarifa->FK_TarifaReq=$newrequerimiento->ID_Req;\n $nuevatarifa->save();\n\n foreach ($tarifaparacopiar->rangos as $rango) {\n $rangoparacopiar = Rango::find($rango->ID_Rango);\n $nuevarango = $rangoparacopiar->replicate();\n $nuevarango->FK_RangoTarifa = $nuevatarifa->ID_Tarifa;\n $nuevarango->save();\n }\n }\n \n }\n\n $log = new audit();\n $log->AuditTabla=\"respel\";\n $log->AuditType=\"Copiado\";\n $log->AuditRegistro=$newRespel->ID_Respel;\n $log->AuditUser=Auth::user()->email;\n $log->Auditlog=json_encode($newRespel->RespelName);\n $log->save();\n // return $newRespel;\n\n return redirect()->route('respels.index');\n }", "public function getIdUsuario(){\n return $this->idUsuario;\n }", "public function asignaEquipo($id)\n {\n $empresa_id = $id; \n\n if($empresa_id !='crea') {\n $supervisores = User::join('cat_usuarioempresa', 'cat_usuarioempresa.USER_ID', '=', 'users.id')\n ->join('cat_empresa', 'cat_empresa.ID', '=', 'cat_usuarioempresa.EMPRESA_ID')\n ->join('users_roles', 'users_roles.user_id', '=', 'users.id')\n ->where('cat_empresa.ID', '=', $empresa_id)\n ->where('users_roles.role_id', '=', 5)\n ->lists('users.nombre', 'users.id')\n ->toArray();\n\n $asignados = User::join('cat_supervisor_vendedor', 'cat_supervisor_vendedor.VENDEDOR_ID_USUARIO', '=', 'users.id')\n ->join('cat_usuarioempresa', 'cat_usuarioempresa.USER_ID', '=', 'users.id')\n ->join('cat_empresa', 'cat_empresa.ID', '=', 'cat_usuarioempresa.EMPRESA_ID')\n ->join('users_roles', 'users_roles.user_id', '=', 'users.id')\n //->where('users.id', '=', $usuario_id)\n ->where('cat_empresa.ID', '=', $empresa_id)\n ->where('users_roles.role_id', '=', 7)\n ->where('users.anulado', '=', 0)\n ->where('cat_supervisor_vendedor.ANULADO', '=', 0)\n ->lists('users.id')\n ->toArray();\n\n $vendedores = User::join('cat_usuarioempresa', 'cat_usuarioempresa.USER_ID', '=', 'users.id')\n ->join('cat_empresa', 'cat_empresa.ID', '=', 'cat_usuarioempresa.EMPRESA_ID')\n ->join('users_roles', 'users_roles.user_id', '=', 'users.id')\n ->where('cat_empresa.ID', '=', $empresa_id)\n ->where('users_roles.role_id', '=', 7)\n ->where('users.anulado', '=', 0)\n ->where('cat_usuarioempresa.ANULADO', '=', 0)\n ->whereNotIn('users.id', $asignados)\n ->lists('users.nombre', 'users.id')\n ->toArray();\n\n return view('equipos.asignacion', compact('empresa_id', 'supervisores', 'vendedores'));\n } else {\n return redirect::to('empresas');\n }\n\n\n \n }", "public function getID()\n {\n return $this->idUsuario;\n }", "function getIdusuario(){\n\t\treturn $this->idusuario;\n\t}", "public function getUserIdCriado() {\n return $this->userIdCriado;\n }", "function permisos_usuario($id_usuario) {\n\t\t$query = \"SELECT colaboradores.*, colaboradores_permisos.* \n\t\tFROM colaboradores, colaboradores_permisos\n\t\tWHERE colaboradores.id_colaborador='$id_usuario' \n\t\tAND colaboradores.id_colaborador=colaboradores_permisos.id_colaborador\n\t\tAND colaboradores.estado=1\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\treturn $row;\n\t}", "function reprocesos($anho, $mes, $razon_reproceso)\r\n\t{\r\n\t\t$dia = date('d');\r\n\t\t$total_t = 0;\r\n\t\t$total_tr = 0;\r\n\t\t$total_tt = 0;\r\n\t\t$pedidos = array();\r\n\t\tif($mes == 'anual')\r\n\t\t{\r\n\t\t\t$fecha1 = $anho.'-01-01';\r\n\t\t\t$fecha2 = $anho.'-12-01';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$fecha1 = $anho.'-'.$mes.'-01';\r\n\t\t\t$fecha2 = $anho.'-'.$mes.'-31';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$SQL = '';\r\n\t\t$tabla = '';\r\n\t\t\r\n\t\tif(strtotime('2013-06-20') < strtotime($anho.'-'.$mes.'-'.$dia))\r\n\t\t{\r\n\t\t\tif('todos' != $razon_reproceso)\r\n\t\t\t{\r\n\t\t\t\t$tabla = ' ,reproceso_detalle reproc ';\r\n\t\t\t\t$SQL .= 'and ped.id_repro_deta = reproc.id_repro_deta';\r\n\t\t\t\t$SQL .= ' and reproc.id_repro_deta = \"'.$razon_reproceso.'\"';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Buscar clientes que poseen reprocesos\r\n\t\t$Consulta = '\r\n\t\t\t\t\t\t\tselect distinct proc.id_cliente, codigo_cliente\r\n\t\t\t\t\t\t\tfrom procesos proc, pedido ped, cliente cli '.$tabla.'\r\n\t\t\t\t\t\t\twhere proc.id_proceso = ped.id_proceso\r\n\t\t\t\t\t\t\t\tand cli.id_cliente = proc.id_cliente\r\n\t\t\t\t\t\t\t\tand ped.fecha_entrega >= \"'.$fecha1.'\"\r\n\t\t\t\t\t\t\t\tand ped.fecha_entrega <= \"'.$fecha2.'\"\r\n\t\t\t\t\t\t\t\tand ped.id_tipo_trabajo = \"4\"\r\n\t\t\t\t\t\t\t\t'.$SQL.'\r\n\t\t\t\t\t\t\t\tand cli.id_grupo = \"'.$this->session->userdata('id_grupo').'\"\r\n\t\t\t\t\t\t\torder by id_cliente\r\n\t\t\t\t\t\t\t';\r\n\t\t\r\n\t\t$Resultado= $this->db->query($Consulta);\r\n\t\t$Info = $Resultado->result_array();\r\n\t\t\r\n\t\tforeach($Info as $Datos)\r\n\t\t{\r\n\t\t\t$pedidos[$Datos['id_cliente']]['id_cliente'] = $Datos['id_cliente'];\r\n\t\t\t$pedidos[$Datos['id_cliente']]['codigo_cliente'] = $Datos['codigo_cliente'];\r\n\r\n\t\t\t//Buscar reprocesos por cliente\r\n\t\t\t$Consulta2 = '\r\n\t\t\t\t\t\t\t\t\tselect count(id_cliente) as total\r\n\t\t\t\t\t\t\t\t\tfrom procesos proc, pedido ped '.$tabla.'\r\n\t\t\t\t\t\t\t\t\twhere proc.id_proceso = ped.id_proceso\r\n\t\t\t\t\t\t\t\t\tand ped.fecha_entrega >= \"'.$fecha1.'\"\r\n\t\t\t\t\t\t\t\t\tand ped.fecha_entrega <= \"'.$fecha2.'\"\r\n\t\t\t\t\t\t\t\t\tand ped.id_tipo_trabajo = \"4\"\r\n\t\t\t\t\t\t\t\t\t'.$SQL.'\r\n\t\t\t\t\t\t\t\t\tand id_cliente = \"'.$Datos['id_cliente'].'\"\r\n\t\t\t\t\t\t\t\t\torder by id_cliente';\r\n\t\t\t\r\n\t\t\t$Resultado2 = $this->db->query($Consulta2);\r\n\t\t\t$Info2 = $Resultado2->result_array();\r\n\t\t\tforeach($Info2 as $Datos2)\r\n\t\t\t{\r\n\t\t\t\t$total_r = $Datos2[\"total\"];\r\n\t\t\t\t$total_tt += $total_r;\r\n\t\t\t\t$pedidos[$Datos['id_cliente']]['total_reprocesos'] = $total_r;\r\n\t\t\t\t$pedidos[$Datos['id_cliente']]['num_reprocesos'] = $total_tt;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Total pedidos del cliente en el rango de fecha\r\n\t\t\t$Consulta3 = 'select count(id_cliente) as total_a\r\n\t\t\t\t\t\t\t\t\tfrom procesos proc, pedido ped\r\n\t\t\t\t\t\t\t\t\twhere proc.id_proceso = ped.id_proceso\r\n\t\t\t\t\t\t\t\t\tand ped.fecha_entrega >= \"'.$fecha1.'\"\r\n\t\t\t\t\t\t\t\t\tand ped.fecha_entrega <= \"'.$fecha2.'\"\r\n\t\t\t\t\t\t\t\t\tand id_cliente = \"'.$Datos['id_cliente'].'\"\r\n\t\t\t\t\t\t\t\t\torder by id_cliente';\r\n\t\t\t\r\n\t\t\t$Resultado3 = $this->db->query($Consulta3);\r\n\t\t\t$Info3 = $Resultado3->result_array();\r\n\t\t\tforeach($Info3 as $Datos3)\r\n\t\t\t{\r\n\t\t\t\t$total_t = $Datos3[\"total_a\"];\r\n\t\t\t\t$total_tr = $total_tr + $total_t;\r\n\t\t\t\t$porc = ($total_r * 100) / $total_t;\r\n\t\t\t\t$porc = round($porc * 100) / 100;\r\n\t\t\t\t$pedidos[$Datos['id_cliente']]['total_pedidos'] = $total_t;\r\n\t\t\t\t$pedidos[$Datos['id_cliente']]['porcentaje'] = $porc;\r\n\t\t\t\t$pedidos[$Datos['id_cliente']]['total_trabajos'] = $total_tr;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $pedidos;\r\n\t}", "public function reclamo_pendientes($id_usuario)\n\t\t\t{\n\t\t\t}", "public function clientToRp(Request $request, $id)\n {\n $PublicRespel = Respel::where('RespelSlug', $id)->first();\n\n $PublicRespel->load('requerimientos');\n // return $PublicRespel;\n $newRespel = $PublicRespel->replicate();\n $newRespel->RespelSlug = hash('sha256', rand().time().$PublicRespel->RespelName);\n $newRespel->RespelPublic = 1;\n $newRespel->FK_SubCategoryRP = 1;\n $newRespel->RespelStatus = 'Evaluado';\n $newRespel->FK_RespelCoti = 1;\n $newRespel->save();\n\n foreach($PublicRespel->requerimientos as $requerimiento)\n {\n if ($requerimiento->forevaluation == 1) {\n $requerimiento->load('pretratamientosSelected');\n $newrequerimiento = $requerimiento->replicate();\n $newrequerimiento->ReqSlug = hash('md5', rand().time().$newRespel->ID_Respel);\n $newrequerimiento->FK_ReqRespel = $newRespel->ID_Respel;\n $newrequerimiento->ofertado = 0;\n $newrequerimiento->save();\n\n foreach($requerimiento->pretratamientosSelected as $pretratamientoSelected)\n {\n $newrequerimiento->pretratamientosSelected()->attach($pretratamientoSelected->ID_PreTrat);\n }\n /*se copian las tarifas y los rangos relacionados*/\n $tarifaparacopiar = Tarifa::with(['rangos'])\n ->where('FK_TarifaReq', $requerimiento->ID_Req)->first();\n $nuevatarifa = $tarifaparacopiar->replicate();\n $nuevatarifa->FK_TarifaReq=$newrequerimiento->ID_Req;\n $nuevatarifa->save();\n\n foreach ($tarifaparacopiar->rangos as $rango) {\n $rangoparacopiar = Rango::find($rango->ID_Rango);\n $nuevarango = $rangoparacopiar->replicate();\n $nuevarango->FK_RangoTarifa = $nuevatarifa->ID_Tarifa;\n $nuevarango->save();\n }\n }\n \n }\n\n $log = new audit();\n $log->AuditTabla=\"respelpublic\";\n $log->AuditType=\"Copiado\";\n $log->AuditRegistro=$newRespel->ID_Respel;\n $log->AuditUser=Auth::user()->email;\n $log->Auditlog=json_encode($newRespel->RespelName);\n $log->save();\n // return $newRespel;\n\n return redirect()->route('respelspublic.edit', [$newRespel->RespelSlug]);\n }", "public function ctrRegistroUsuario(){\n\n\t\tif(isset($_POST[\"numero_id\"])){\n\t\t\n\t\t\t$ruta = RouteController::ctrRoute();\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"numero_id\"]) /*preg_match('/^[a-zA-ZñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"numero_id\"]) &&\n\t\t\t preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"registroEmail\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"registroPassword\"])*/){\n\n\t\t\t\t//$encriptar = crypt($_POST[\"password1\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t\t$encriptar = crypt($_POST[\"password1\"], '$2a$07$asxx54ahjppf17sd87a5a4dDDGsystemdevmybebe$');\n\n\t\t\t\t$encriptarEmail = md5($_POST[\"email\"]);\n\n\t\t\t\t$tabla = \"genusuario\";\n\t\t\t\t$datos = array(\"genrol\" => \"1\",\n\t\t\t\t\t\t\t \"usunombre\" => $_POST[\"numero_id\"],\n\t\t\t\t\t\t\t \"usudescrip\" => $_POST[\"nombre\"],\n\t\t\t\t\t\t\t \"usuclave\" => $encriptar,\n\t\t\t\t\t\t\t \"usuemail\" => $_POST[\"email\"],\n\t\t\t\t\t\t\t \"usuemailen\" => $encriptarEmail,\n\t\t\t\t\t\t\t \"usuverific\" => 0); \n\n\t\t\t\t\n\t\t\t\t$respuesta = UserModel::mdlRegistroUsuario($tabla, $datos);\t\t\t\t\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tVerificación Correo Electrónico\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tdate_default_timezone_set(\"America/Bogota\");\n\n\t\t\t\t\t$mail = new PHPMailer(true);\n\t\t\t\n\n\t\t\t\t\t$mail->Charset = \"UTF-8\";\n\n\t\t\t\t\t$mail->isMail();\n\n\t\t\t\t\t$mail->setFrom(\"sdhsoluciones.sas@gmail.com\", \"SDH Soluciones \",0);\n\n\t\t\t\t\t$mail->addReplyTo(\"sdhsoluciones.sas@gmail.com\", \"Informacion SDH Soluciones\");\n\n\t\t\t\t\t$mail->Subject = \"Por favor verifique su direcci&oacute;n de correo electr&oacute;nico\";\n\n\t\t\t\t\t$mail->addAddress($_POST[\"email\"]);\n\n\t\t\t\t\t$mail->msgHTML('<div style=\"width:100%; background:#eee; position:relative; font-family:sans-serif; padding-bottom:40px\">\n\t\n\t\t\t\t\t<center>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<img style=\"padding:20px; width:10%\" src=\"http://reservi.tech/views/img/logo.png\">\n\n\t\t\t\t\t</center>\n\n\t\t\t\t\t<div style=\"position:relative; margin:auto; width:600px; background:white; padding:20px\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<center>\n\n\t\t\t\t\t\t\t<img style=\"padding:20px; width:15%\" src=\"http://reservi.tech/views/img/logo.png\">\n\n\t\t\t\t\t\t\t<h3 style=\"font-weight:100; color:#999\">VERIFIQUE SU DIRECCI&Oacute;N DE CORREO ELECTR&Oacute;NICO</h3>\n\n\t\t\t\t\t\t\t<hr style=\"border:1px solid #ccc; width:80%\">\n\n\t\t\t\t\t\t\t<h4 style=\"font-weight:100; color:#999; padding:0 20px\">Para comenzar a usar su cuenta, debe confirmar su direcci&oacute;n de correo electr&oacute;nico</h4>\n\n\t\t\t\t\t\t\t<a href=\"'.$ruta.$encriptarEmail.'\" target=\"_blank\" style=\"text-decoration:none\">\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<div style=\"line-height:60px; background:#0aa; width:60%; color:white\">Verifique su direcci&oacute;n de correo electr&oacute;nico</div>\n\n\t\t\t\t\t\t\t</a>\n\n\t\t\t\t\t\t\t<br>\n\n\t\t\t\t\t\t\t<hr style=\"border:1px solid #ccc; width:80%\">\n\n\t\t\t\t\t\t\t<h5 style=\"font-weight:100; color:#999\">Si no se inscribi&oacute; en esta cuenta, puede ignorar este correo electr&oacute;nico y eliminarlo.</h5>\n\n\t\t\t\t\t\t</center>\t\n\n\t\t\t\t\t</div>\n\n\t\t\t\t</div>');\n\t\t\t\t\t\t\t\n\t\t\t\t\t$envio = $mail->Send();\n\n\t\t\t\t\tif(!$envio){\n\n\t\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\ttext: \"¡¡Ha ocurrido un problema enviando verificación de correo electrónico a '.$_POST[\"email\"].' '.$mail->ErrorInfo.', por favor inténtelo nuevamente\",\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t</script>';\n\n\n\t\t\t\t\t}else{\n\n\n\t\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\t\ttitle: \"¡SU CUENTA HA SIDO CREADA CORRECTAMENTE!\",\n\t\t\t\t\t\t\t\ttext: \"¡Por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico para verificar la cuenta!\",\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\t\t\twindow.location = \"'.$ruta.'ingreso\";\n\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t</script>';\n\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\ttext: \"¡No se permiten caracteres especiales en ninguno de los campos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t});\t\n\n\t\t\t\t</script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"user01\"])){\n\n\t\t//\t if(preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingresoEmail\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t \t//$encriptar = crypt($_POST[\"ingresoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t\t$encriptar = crypt($_POST[\"passwords01\"], '$2a$07$asxx54ahjppf17sd87a5a4dDDGsystemdevmybebe$');\n\n\t\t\t \t$tabla = \"genusuario\";\n\t\t\t \t$item = \"usunombre\";\n\t\t\t \t$valor = $_POST[\"user01\"];\n\n\t\t\t \t$respuesta = UserModel::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t//echo \"<pre>\".print_r($respuesta).\"</pre>\";\n\n\t\t\t \tif($respuesta[\"usunombre\"] == $_POST[\"user01\"] && $respuesta[\"usuclave\"] == $encriptar){\n\n\t\t\t \t\tif($respuesta[\"usuverific\"] == 0){\n\n\t\t\t \t\t\techo'<script>\n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t \ttext: \"¡El correo electrónico aún no ha sido verificado, por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico para verificar la cuenta, o contáctese con nuestro soporte a info@valientesdigitales.com.co!\",\n\t\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t\t\treturn;\n\n\t\t\t \t\t}else{\n\n\t\t\t \t\t\t$_SESSION[\"validarSesion\"] = \"ok\";\n\t\t\t \t\t\t$_SESSION[\"id\"] = $respuesta[\"oid\"];\n\n\t\t\t \t\t\t$ruta = RouteController::ctrRoute();\n\n\t\t\t \t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"'.$ruta.'backoffice\";\t\t\t\t\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t \t\t}\n\n\t\t\t \t}else{\n\n\t\t\t \t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t \ttext: \"¡El email o contraseña no coinciden!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t \t}\n\n\n\t\t/*\t }else{\n\n\t\t\t \techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\ttext: \"¡No se permiten caracteres especiales en ninguno de los campos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\t\n\n\t\t\t\t</script>';\n\n\t\t\t }*/\n\n\t\t}\n\n\t}", "function identificar($usuario,$clave)\n\t\t{\n\t\t\t$clave = md5($clave); // Encriptar la variable para consultar en la base de datos.\n\t\t\t$model = new Crud;\n\t\t\t// Se realizan las consultas Multiples JOIN.\n\t\t\t$model->select = \"nombre,usuario,clave,privilegio\";\n\t\t\t$model->from = 't_permisos';\n\t\t\t$model->condition = \"usuario='$usuario' AND clave='$clave'\";\n\t\t\t$model->orderby = '';\n\t\t\t$model->Read();\n\t\t\t$filas = $model->rows;\n\t\t\t$total = count($filas);\n\t\t\t\n\t\t\tif ($total > 0)\n\t\t\t{\n\t\t\t\tforeach ($filas as $fila)\n\t\t\t\t{\n\t\t\t\t\t$r = array(\n\t\t\t\t\t\t0 =>$fila['nombre'],\n\t\t\t\t\t\t1 =>$fila['usuario'],\n\t\t\t\t\t\t2 =>$fila['clave'],\n\t\t\t\t\t\t3 =>$fila['privilegio'],\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r[0] = 0;\n\t\t\t}\n\t\t\treturn $r;\n\n\t\t}", "public function recepcionUsuario($nombre , $password){\n\t\t\t$result_child = $this->_db->query(\"SELECT * FROM usuario WHERE login_usu = '\".$nombre.\"'\");\n\t\t\t$retorna_child = $result_child->fetch_all(MYSQL_ASSOC);\n\n\t\t\t//mensaje por defecto indicando que no se registro\n\t\t\t//genera mensaje para el sistema\n\t\t\t$outp = array('activo'=> \"0\");\n\n\t\t\t//verifica que exista el usuario\n\t\t\tif (!$result_child) {\n \t\t\treturn \"Falló SELECT usuario: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t}else{\n\n\t\t\t\tif (count($retorna_child) > 0) {\n\t\t\t\t\t//print_r(count($retorna_child));\n\t\t\t\t\t//busca su grupo de usuario para asignar un rol \n\t\t\t\t\t$result_master = $this->_db->query(\"SELECT * FROM grupousu WHERE idGrupoUsu = '\".$retorna_child[0]['GrupoUsu_idGrupoUsu'].\"'\");\n\t\t\t\t\t$retorna_master = $result_master->fetch_all(MYSQL_ASSOC);\n\n\t\t\t\t\t//verifique que tenga un grupo de usuario\n\t\t\t\t\tif (!$result_child) {\n\t \t\t\t\treturn \"Falló SELECT grupousu: (\" . $this->_db->errno . \") \" . $this->_db->error;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//verifica la contrasena\n\t\t\t\t\t\tif (md5($retorna_child[0]['pass_usu']) == $password) {\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('idUsuario'=> \"\".$retorna_child[0]['idUsuario'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'nombres_usu'=> \"\".$retorna_child[0]['nombres_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'apellidos_usu'=> \"\".$retorna_child[0]['apellidos_usu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'GrupoUsu_idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'idGrupoUsu'=> \"\".$retorna_master[0]['idGrupoUsu'].\"\",\n\t\t\t\t\t\t\t\t\t\t\t'activo'=> \"1\",\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn $outp;\n\t\t\t\t\t\t\t$result_child->close();\n\t\t\t\t\t\t\t$result_master->close();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t\t\t$outp[] = array('activo'=> \"0\"\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t//genera mensaje para el sistema\n\t\t\t\t\t$outp[] = array('activo'=> \"0\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $outp;\n\t\t\t\n\t\t}", "public function cambioseisSite($id_usuario){\r\n\t\t$sql = \"UPDATE tbl_usuarios SET valorPre='7' WHERE id_usuario='$id_usuario'\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "public function getEncuestaRecepcionid()\r\n {\r\n return $this->encuesta_recepcionId;\r\n }", "public function limpiaIntentosById($id)\r\n {\r\n $q = $this\r\n ->createQueryBuilder('u')\r\n ->update() \r\n ->set('u.tiempoBloqueo',':reset') /* Desbloquea el Usuario */\r\n ->set('u.intentos',':reset') /* Reinicia el Contador */\r\n ->where('u.id= :iduser') \r\n ->setParameter('reset', 0)\r\n ->setParameter('iduser', $id)\r\n ->getQuery(); \r\n $q->execute(); \r\n return true;\r\n }", "function obtenerCampartidos($id) {\n $this->db->select('compartido');\n $this->db->from($this->nombre2);\n $this->db->where('id_user', $id);\n $consulta = $this->db->get();\n return current($consulta->result());\n }", "public function recoverProfile($id)\n {\n $user = User::with('role', 'profile')->onlyTrashed()->findOrFail($id);\n if($user->restore()){\n return Redirect::to('admin/profile')\n ->with('success','Profile Successfully Restored!');\n }else{\n return back()->with('fail','Error Restoring Customer');\n } \n }", "public function buscar_Usuario2($id){\n\t\t$sql = \"select Documento, Nombres, Apellidos, Usuario, Password, Pregunta, Respuesta,\n\t\t\tTipo_Documento,Ciudad, Direccion, Edad,Foto,Telefono,Correo_Electronico,\n\t\t\tGenero,perfiles_Nombre \n\t\t\tfrom usuarios where Documento='$id'\";\n\t\t$registros = $this->bd->consultar($sql);\n\t\tif($reg=mysql_fetch_array($registros)){\n\t\t\t$this->usuario->set_Nid($reg['Documento']);\n\t\t\t$this->usuario->set_Usuario($reg['Usuario']);\n\t\t\t$this->usuario->set_Password($reg['Password']);\n\t\t\t$this->usuario->set_Nombres($reg['Nombres']);\n\t\t\t$this->usuario->set_Apellidos($reg['Apellidos']);\n\t\t\t$this->usuario->set_TipoId($reg['Tipo_Documento']);\n\t\t\t$this->usuario->set_Ciudad($reg['Ciudad']);\n\t\t\t$this->usuario->set_Direccion($reg['Direccion']);\n\t\t\t$this->usuario->set_Email($reg['Correo_Electronico']);\n\t\t\t$this->usuario->set_Pregunta($reg['Pregunta']);\n\t\t\t$this->usuario->set_Respuesta($reg['Respuesta']);\n\t\t\t$this->usuario->set_Celular($reg['Telefono']);\n\t\t\t$this->usuario->set_Edad($reg['Edad']);\n\t\t\t$this->usuario->set_Foto($reg['Foto']);\n\t\t\t$this->usuario->set_Genero($reg['Genero']);\n\t\t\t$this->usuario->set_Perfil($reg['perfiles_Nombre']);\n\n\t\t}\n\t}", "public function search_id_restore($user)\n {\n $result = $this->db->select('id_client')->where('email', $user)->get('ec_client')->result_array();\n return $result[0]['id_client'];\n }", "public function obtenerId() {}", "public function cambiorecoger($id) {\n $servicio = Servicio::find($id);\n $m = new Servicio($servicio->attributesToArray());\n $nombre = $servicio->direccion;\n $servicio->estado = 'RECOGER';\n $result = $servicio->save();\n if ($result) {\n $u = Auth::user();\n $aud = new Auditoriaservicio();\n $aud->usuario = \"ID: \" . $u->identificacion . \", USUARIO: \" . $u->nombres . \" \" . $u->apellidos;\n $aud->operacion = \"PERMISO RECOGER\";\n $str = \"PERMISO PARA RECOGER SERVICIO ANTES DE LA FECHA FIN. DATOS NUEVOS: \";\n $str2 = \" DATOS ANTIGUOS: \";\n foreach ($m->attributesToArray() as $key => $value) {\n $str2 = $str2 . \", \" . $key . \": \" . $value;\n }\n foreach ($servicio->attributesToArray() as $key => $value) {\n $str = $str . \", \" . $key . \": \" . $value;\n }\n $aud->detalles = $str . \" - \" . $str2;\n $aud->save();\n return response()->json([\n 'status' => 'ok',\n 'message' => \"El permiso para el servicio \" . $nombre . \" fue realizado de forma exitosa!\"\n ]);\n } else {\n return response()->json([\n 'status' => 'error',\n 'message' => \"El permiso para el servicio\" . $nombre . \" no pudo ser realizado. Error:\"\n ]);\n }\n }", "public function run()\n {\n\n $user0 = new User();\n $user0->Nombre = 'Cesar';\n $user0->email = 'admin@admin.com';\n $user0->Nombre_de_Usuario=\"Cesar_G\";\n $user0->password = bcrypt('password');\n $user0->save();\n\n $user0 = new User();\n $user0->Nombre = 'Eduardo Gabriel';\n $user0->Apellido='Guzman Lopez';\n $user0->email = 'admin2@admin.com';\n $user0->password = bcrypt('password');\n $user0->save();\n\n $user0 = new User();\n $user0->Nombre = 'Miguel';\n $user0->email = 'admin3@admin.com';\n $user0->password = bcrypt('password');\n $user0->save();\n $user0 = new User();\n $user0->Nombre = 'Antonio';\n $user0->email = 'admin4@admin.com';\n $user0->password = bcrypt('password');\n $user0->save();\n\n\n $Tipos = new ReactivosGruposTipo();\n $Tipos->Nombre = \"Opciones multiples\";\n $Tipos->Descripcion=\"Preguntas que pueden tener única opción u opciones múltiples\";\n $Tipos->save();\n $Tipo = new ReactivosTipo();\n $Tipo->Nombre_Tipo= \"Opcion unica\";\n $Tipo->Activo = true;\n $Tipo->Datos=json_encode(\" \");\n $Tipo->ID_Grupo = $Tipos->id;\n $Tipo->save();\n $Tipo = new ReactivosTipo();\n $Tipo->Nombre_Tipo= \"Opciones Multiple\";\n $Tipo->Activo = true;\n $Tipo->Datos=json_encode(\" \");\n $Tipo->ID_Grupo = $Tipos->id;\n $Tipo->save();\n\n $Tipos = new ReactivosGruposTipo();\n $Tipos->Nombre = \"Reactivos Multivariable\";\n $Tipos->Descripcion=\"Reactivos que tienen una o muchas variables generadas por un sistema computacional\";\n $Tipos->save();\n\n $Tipo = new ReactivosTipo();\n $Tipo->Nombre_Tipo= \"Multivariable\";\n $Tipo->Activo = true;\n $Tipo->Datos=json_encode(\" \");\n $Tipo->ID_Grupo = $Tipos->id;\n $Tipo->save();\n\n\n\n\n }", "public function iniciar() {\r\n session_regenerate_id();\r\n }", "Public Function RestoreUser($ID)\n\t{\n\t\t$Data = array('deleted'=>0);\n\t\t$this->_db->update('bevomedia_user', $Data, 'id = ' . $ID);\n\t\t$this->_db->update('bevomedia_user_info', $Data, 'id = ' . $ID);\n\t}", "function rechazado($idUsuario,$idPropuesta)\n {\n $this->db->select(\"idPostulacion\");\n $this->db->from(\"postulaciones\");\n $this->db->where(\"idUsuario\",$idUsuario);\n $this->db->where(\"idPropuesta\",$idPropuesta);\n $data[\"idPostulacion\"]=$this->db->get()->result()[0];\n\n $this->db->where(\"idUsuario\",$idUsuario);\n $this->db->where(\"idPropuesta\",$idPropuesta);\n $this->db->update(\"postulaciones\",array('estado'=>6));\n \n $data=array('idpostulacion'=>$data[\"idPostulacion\"]->idPostulacion,'texto'=>'Trabajo realizado','fecha'=>date('Y-m-d h:i:s'));\n $this->db->insert(\"postulacioneventos\",$data);\n\n redirect('/CEmpresa/perfilPostulante/'.$idUsuario.'/'.$idPropuesta,'refresh');\n }", "public function comprobarReproduccion(){\n $query = \"SELECT COUNT(*) AS existe FROM reproduccion WHERE Usuario_codUsuario = \".parent::string($this->getUsuario_codUsuario()).\" AND Video_codVideo = \".parent::string($this->getVideo_codVideo()).\";\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "public function restore($id, Request $request) {\n\n \\Policy::check('manage_users')->handle();\n\n if ($id == \"1\")\n return redirect('/admin/users')->with('errors', ['Sorry , but this user is untouchable :D']);\n\n $response = \\API::post('users/restore/' . $id, ['Authorization' => $request->session()->get('user_data')['auth']], [ 'ID' => $request->session()->get('user_id')]);\n\n if ($response[\"code\"] == \"200\") {\n\n return redirect('admin/users')->with('success', 'User ' . $response['data']->username . ' has been restored ');\n } else {\n\n return redirect()->back()->with('errors', $response['data']->messages);\n }\n }", "function getUsuarioEmpresaById($id)\n{\n global $conn, $hashids;\n\n $id = $hashids->decrypt($id);\n $id = isset($id[0]) ? $id[0] : null;\n\n if (empty($id))\n return 'ID inválido';\n\n $sql = \"SELECT usr_nome, usr_nome_fantasia\n FROM `\".TP.\"_usuario`\n LEFT JOIN `\".TP.\"_usuario_produto`\n ON upr_usr_id=usr_id\n AND upr_status=1\n WHERE usr_status=1\n AND usr_id=?\n GROUP BY usr_id\";\n if (!$res = $conn->prepare($sql))\n echo __FUNCTION__.$conn->error;\n else {\n\n $res->bind_param('i', $id);\n $res->bind_result($nome, $nomeFantasia);\n $res->execute();\n $res->fetch();\n $res->close();\n\n return (empty($nomeFantasia) ? $nome : $nomeFantasia);\n }\n}", "function buscar_id($id_usuario){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\tusuario\n\t\t\t\tWHERE id_usuario='$id_usuario'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('usuarioClass.php');\n\t\t\t$usuario = new Usuario($resultado[0]['id_usuario'], $resultado[0]['nombre_usuario'], $resultado[0]['nick_usuario'], $resultado[0]['clave'], $resultado[0]['apellido_usuario'], $resultado[0]['direccion_usuario'], $resultado[0]['telefono_usuario'], $resultado[0]['email_usuario'], $resultado[0]['genero_usuario'], $resultado[0]['id_rol']);\n\t\t\t//Regreso los productos\n\t\t\treturn $usuario;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "public function recusarConvite($id, $hash, $emailUsuario)\n\t{\n\t\t$this->mudaStatus($id, $hash, \"Recusado\");\n\n\t\t// Pega o id do Projeto\n\t\t$convite = $this->getConvite($hash, $id, \"Recusado\");\n\t\t$idProjeto = $convite['fkProjeto'];\n\t\t$idDestinatario = $convite['fkRemetente'];\n\t\t$tipo = $convite['tipo'];\n\n\t\t// Envia Notificação de convite recusado\n\t\t$notificacao = new Notificacao(\"recusado\");\n\t\t$notificacao->notificacaoConvite($id, $tipo, $idDestinatario, $emailUsuario, $idProjeto);\n\n\t\t// Excluir o convite recusado\n\t\t$this->excluiConvite($id, $hash, \"Recusado\");\n\t}", "function guardar_receta($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_recetas\n\t\t\t\t\t\t(id, nombre, precio, ganancia, ids_insumos, ids_insumos_preparados, preparacion)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_receta'].\", '\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t\".$datos['margen_ganancia'].\",\n\t\t\t\t\t\t'\".$datos['ids'].\"','\".$datos['ids_preparados'].\"','\".$datos['preparacion'].\"'\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda la actividad\n\t\t$fecha=date('Y-m-d H:i:s');\n\n\t\t$texto = ($datos['tipo']==1) ? 'receta' : 'insumo preparado' ;\n\t// Valida que exista el empleado si no agrega un cero como id\n\t\t$usuario = (!empty($_SESSION['accelog_idempleado'])) ?$_SESSION['accelog_idempleado'] : 0 ;\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_actividades\n\t\t\t\t\t\t(id, empleado, accion, fecha)\n\t\t\t\tVALUES\n\t\t\t\t\t('',\".$usuario.\",'Agrega \".$texto.\"', '\".$fecha.\"')\";\n\t\t$actividad=$this->query($sql);\n\n\t\treturn $result;\n\t}", "public function getFkDividaRelatorioRemissaoCredito()\n {\n return $this->fkDividaRelatorioRemissaoCredito;\n }", "public function detailParticipant(Request $request, $id)\n {\n ini_set('max_execution_time', 300);\n\n // Check Access\n has_access(generate_method(__METHOD__), Auth::user()->role);\n\n if(Auth::user()->is_admin == 1){\n // Data Member\n $member = PelatihanMember::join('users','pelatihan_member.id_user','=','users.id_user')->where('status_pelatihan','!=',0)->findOrFail($id);\n\t\t}\n\t\telseif(Auth::user()->is_admin == 0){\n\t\t\t// Data Member\n\t\t\t$member = PelatihanMember::join('users','pelatihan_member.id_user','=','users.id_user')->where('pelatihan_member.id_user','=',Auth::user()->id_user)->where('status_pelatihan','!=',0)->findOrFail($id);\n\t\t}\n\t\t\n\t\t$qrcode = base64_encode(QrCode::format('png')->size(200)->backgroundColor(0,0,0,0)->errorCorrection('H')->generate(url()->to('/check-certificate/'.$member->id_pm)));\n\n\t\t// Data pelatihan\n\t\t$pelatihan = Pelatihan::join('users','pelatihan.trainer','=','users.id_user')->join('kategori_pelatihan','pelatihan.kategori_pelatihan','=','kategori_pelatihan.id_kp')->find($member->id_pelatihan);\n\t\t$pelatihan->materi_pelatihan = json_decode($pelatihan->materi_pelatihan, true);\n\t\t\n\t\t// Direktur\n\t\t$direktur = User::where('role','=',role('manager'))->first();\n\t\t\n\t\t// Dosen\n\t\t$dosen = User::where('role','=',role('mentor'))->first();\n\t\t\n\t\t// Data signature direktur\n\t\t$signature_direktur = Signature::join('users','signature.id_user','=','users.id_user')->where('users.role','=',role('manager'))->first();\n\t\t\n\t\t// Data signature dosen\n\t\t$signature_dosen = Signature::join('users','signature.id_user','=','users.id_user')->where('users.role','=',role('mentor'))->first();\n\t\t\n\t\t// Data signature trainer\n\t\t$signature_trainer = Signature::where('id_user','=',$pelatihan->trainer)->first();\n\n\t\t// View PDF\n\t\t$pdf = PDF::loadview('pdf.'.setting('site.view.sertifikat_peserta'), [\n\t\t\t'member' => $member,\n\t\t\t'direktur' => $direktur,\n\t\t\t'dosen' => $dosen,\n\t\t\t'pelatihan' => $pelatihan,\n\t\t\t'signature_direktur' => $signature_direktur,\n\t\t\t'signature_dosen' => $signature_dosen,\n\t\t\t'signature_trainer' => $signature_trainer,\n\t\t\t'qrcode' => $qrcode,\n\t\t]);\n\t\t$pdf->setPaper('A4', 'landscape');\n\t\t\n return $pdf->stream(\"Sertifikat Peserta Pelatihan.pdf\");\n }", "public function getIdusuario()\n {\n return $this->idusuario;\n }", "private function retornaRolUser($tabla) {\n $IdsRol = 6; //ROL DE USER NORMAL POR DEFECTO\n switch ($tabla) {\n Case \"MG0031\":\n $IdsRol = 4; //CLIENTE\n break;\n Case \"MG0032\":\n $IdsRol = 5; //PROVEEDOR\n break;\n default:\n $IdsRol = 6; //USUARIO NORMAL\n }\n return $IdsRol;\n }", "function obtenerUsuario_EspecialistaID($id){\n\t\n\t//$query = $this->db->from('sesion')->where('id',$id)->get();\n\t\n\t\t$user = 'user';\n\t $query = $this->db->from('usuario')->where('perfil',$user)->get();\n\t if($query-> num_rows() > 0){\n\t \t\n\t \t$row = $query->row($id);\n\t \t\n\t if (isset($row))\n\t\t\t{\n\t\t\t\t//echo ('ESTE ES EL ID'.' '.$row->id.'- ');\n \treturn $row->id; }\n\t\t}\n\t else return false ;\n\t \n\t}", "function CantidadCarrito($idusuario){\n try{\n\n $comando = $this->pdo->prepare(\"call sp_usuarios_carrito(?)\");\n $comando->execute(\n array(\n $idusuario\n )\n );\n\n return $comando->fetch(PDO::FETCH_OBJ);\n\n }catch(Exception $e){\n die($e->getMessage());\n }\n }", "function obtenerCampartidos($id) {\n\t\t$this->db->select('compartidos');\n\t\t$this->db->from($this->nombre2);\n\t\t$this->db->where('id_user', $id);\n\t\t$consulta = $this->db->get();\n\t\treturn current($consulta->result());\n\t}", "private function getRecepcion(){\n\t\t\t$idRecepcion = $this->validateNumber(isset($_REQUEST['idRecepcion'])?$_REQUEST['idRecepcion']:NULL);\n\t\t\tif($idRecepcion!==''){\n\t\t\t\tif(($result = $this->model->lists(-1,$idRecepcion))){\n\t\t\t\t\tif(is_numeric($result)){\n\t\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\t\techo $this->json_encode(array('error'=>VACIO,'data'=>NULL,'mensaje'=>'No se encontro Registro alguno'));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template = $this->twig->loadTemplate('vacio.html'); echo $template->render(array('session'=>$this->session,'data'=>NULL));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif($this->api){\n\t\t\t\t\t\t\techo $this->json_encode(array('error'=>OK,'data'=>$result,'mensaje'=>'Correcto'),JSON_UNESCAPED_UNICODE);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template = $this->twig->loadTemplate('recepcionList.html');\n\t\t\t\t\t\t\techo $template->render(array('session'=>$this->session,'data'=>$result));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif($this->api){\n\t\t\t\t\t\techo $this->json_encode(array('error'=>ERROR_DB,'data'=>NULL,'mensaje'=>'Error al Realizar la Consulta'));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//CARGAR VISTA ERROR DB\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif($this->api){\n\t\t\t\t\techo $this->json_encode(array('error'=>FORMATO_INCORRECTO,'data'=>NULL,'mensaje'=>'Formato Incorrecto'));\n\t\t\t\t}else{\n\t\t\t\t\t//CARGAR VISTA FORMATO INCORRECTO\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function recibirdatos() {\n\t\t$passSha1 = sha1($this->input->post('password'));\n\t\t$datos = array(\n\t\t\t'usuario' => $this->input->post('usuario'),\n\t\t\t'password' => $passSha1\n\t\t\t);\n\t\t//Llamamos al modelo, Si la autentificacion es correcta damos paso a la aplicacion y sino devolvemos al login\n\t\tif($this->login_model->obtenerPass($datos) == true){\n\t\t\t//Cargamos la pagina principal\n\t\t\t$this->session->set_userdata('usuario', $datos['usuario']);\n\t\t\t//Llamamos a la clase que realiza los test de caja blanca\n\t\t\t$this->testCajaBlanca($datos);\n\t\t\t$this->mostrarDatosUser();\n\t\t\t$this->session->set_userdata('Token', true);\n\t\t}else{\n\t\t\t$this->load->view('login');\n\t\t}\n\t}", "public function show($id_punto)\n {\n $table = DB::table('credito')\n ->where('id_punto_agua','=',$id_punto)\n ->select('*')->get();\n dd();\n\n $id_credito = $table[0]->id;\n\n $credito = Credito::find($id_credito);\n $credito->estado = 2;\n $credito->save();\n \n return redirect()->back();\n }", "public function getRecurso_id()\n {\n return $this->recurso_id;\n }", "public function nueva_correspondencia(Request $request){\r\n $id_usuario_destino = $request->id_usuario_destino;\r\n $id_instruccion = $request->id_instruccion;\r\n $referencia = $request->referencia;\r\n $contenido = $request->contenido;\r\n //$id_documento = $request->id_documento;\r\n $id_documento = 0;\r\n $nro_paginas_agregadas = $request->nro_paginas_agregadas;\r\n $prioridad = $request->prioridad;\r\n $switch_copia = $request->switch_copia; //Si esta en \"on\" es seleccionado\r\n $id_usuarios_copia = $request->id_usuario_copia;\r\n\r\n //Establecemos el campo plazo segun corresponda\r\n if ($request->plazo > 0) {$plazo = $request->plazo;}\r\n else {$plazo = 0;}\r\n\r\n //Tomamos otros campos necesarios para el registro de la derivacion\r\n //Tomamos los datos de la persona logueada\r\n $usuario_logueado = $this->datos_persona_logueada();\r\n foreach ($usuario_logueado as $usuario) {\r\n $id_persona_origen = $usuario->id_persona;\r\n $id_cargo_origen = $usuario->id_cargo;\r\n $id_area_origen = $usuario->id_area;\r\n }\r\n\r\n //Tomamos los datos del destinatario\r\n $id_persona_destino = \\DB::table('users')\r\n ->where('users.id', $id_usuario_destino)\r\n ->where('users.activo', 1)\r\n ->value('users.id_persona');\r\n\r\n $id_cargo_destino = \\DB::table('users')\r\n ->join('servidores_publicos', 'servidores_publicos.id_servidor_publico', '=', 'users.id_servidor_publico')\r\n ->where('users.id', $id_usuario_destino)\r\n ->where('users.activo', 1)\r\n ->value('servidores_publicos.id_cargo');\r\n\r\n //Tomamos la fecha y horactual actual y gestion\r\n $date = new Carbon();\r\n $hoy = Carbon::now();\r\n $fecha_creacion = $hoy->format('Y-m-d H');\r\n $gestion = $hoy->format('Y');\r\n\r\n //Dado que dos personas pudieron haber obtenido el mismo cite por demorar, obtenemos el cite disponible en este momento\r\n $cite = $this->get_cite_comunicacion_interna();\r\n\r\n //Lo utlizamos e incrementamos en 1 el valor del correlativo para comunicaciones internas\r\n //Tomamos el valor actual del correlativo\r\n $correlativo_cite = \\DB::table('chasqui_correlativos')\r\n ->where('id_area', $id_area_origen)\r\n ->where('id_tipo_documento', 1)\r\n ->where('gestion', $gestion)\r\n ->value('correlativo');\r\n\r\n $nuevo_correlativo_disponible = $correlativo_cite+1;\r\n //fabri\r\n \\DB::table('chasqui_correlativos')\r\n ->where('id_area', $id_area_origen)\r\n ->where('id_tipo_documento', 1)\r\n ->where('gestion', $gestion)\r\n ->update(['correlativo' => $nuevo_correlativo_disponible]);\r\n\r\n //Realizamos el registro de la derivacion\r\n \\DB::table('chasqui_derivaciones')->insert([\r\n ['cite' => $cite,\r\n 'id_cargo_origen' => $id_cargo_origen,\r\n 'id_persona_origen' => $id_persona_origen,\r\n 'id_cargo_destino' => $id_cargo_destino,\r\n 'id_persona_destino' => $id_persona_destino,\r\n 'id_instruccion' => $id_instruccion,\r\n 'referencia' => $referencia,\r\n 'contenido' => $contenido,\r\n 'id_documento' => $id_documento,\r\n 'nro_paginas_agregadas' => $nro_paginas_agregadas,\r\n 'prioridad' => $prioridad,\r\n 'plazo' => $plazo,\r\n 'tipo' => 'Original',\r\n 'recibido' => 0,\r\n 'fecha_recibido' => 'NULL',\r\n 'derivado' => 0,\r\n 'fecha_derivado' => 'NULL',\r\n 'gestion' => $gestion,\r\n 'anulado' => 0]\r\n ]);\r\n\r\n //Verficamos si se debe enviar el documento como copia\r\n if ($switch_copia == \"on\") {\r\n\r\n //Agregamos la palabra COPIA a la referencia\r\n $referencia_copia = $referencia.\" - COPIA\";\r\n\r\n //Para cada usuario como copia\r\n for ($i=0;$i<count($id_usuarios_copia);$i++)\r\n {\r\n //Tomamos los datos de las personas a enviar como copia\r\n $id_persona_destino_copia = \\DB::table('users')\r\n ->where('users.id', $id_usuarios_copia[$i])\r\n ->where('users.activo', 1)\r\n ->value('users.id_persona');\r\n\r\n $id_cargo_destino_copia = \\DB::table('users')\r\n ->join('servidores_publicos', 'servidores_publicos.id_servidor_publico', '=', 'users.id_servidor_publico')\r\n ->where('users.id', $id_usuarios_copia[$i])\r\n ->where('users.activo', 1)\r\n ->value('servidores_publicos.id_cargo');\r\n\r\n //Realizamos el registro de las copias, solo si es diferente al destinatario original\r\n if ($id_cargo_destino_copia != $id_usuario_destino && $id_persona_destino_copia != $id_persona_destino) {\r\n \\DB::table('chasqui_derivaciones')->insert([\r\n ['cite' => $cite,\r\n 'id_cargo_origen' => $id_cargo_origen,\r\n 'id_persona_origen' => $id_persona_origen,\r\n 'id_cargo_destino' => $id_cargo_destino_copia,\r\n 'id_persona_destino' => $id_persona_destino_copia,\r\n 'id_instruccion' => $id_instruccion,\r\n 'referencia' => $referencia_copia,\r\n 'contenido' => $contenido,\r\n 'id_documento' => $id_documento,\r\n 'nro_paginas_agregadas' => $nro_paginas_agregadas,\r\n 'prioridad' => $prioridad,\r\n 'plazo' => $plazo,\r\n 'tipo' => 'Copia',\r\n 'recibido' => 0,\r\n 'fecha_recibido' => 'NULL',\r\n 'derivado' => 0,\r\n 'fecha_derivado' => 'NULL',\r\n 'gestion' => $gestion,\r\n 'anulado' => 0]\r\n ]);\r\n }\r\n }\r\n }\r\n\r\n\r\n echo \"<script>window.open('http://www.yahoo.com');</script>\";\r\n\r\n //Tomamos todos los campos para enviar a la vista bandeja de entrada\r\n //Enviamos la variable folder para marcar en azul el folder en el que se encuentra\r\n $folder = \"bandeja_de_entrada\";\r\n //Tomamos la cantidad de correspondencia nueva (sin recepcionar)\r\n $bandeja_nuevos_cantidad = $this->bandeja_nuevos_cantidad();\r\n //Tomamos las derivaciones a mostrar\r\n $derivaciones = $this->derivaciones_recibidas();\r\n //Tomamos el plazo que se tiene para responder cada derivacion\r\n $array_plazo = $this->plazo_restante_derivaciones();\r\n //Establecemos el mensaje de exito a mostrar\r\n $mensaje_exito = \"La correspondencia fue derivada correctamente.\";\r\n\r\n //unset($request);\r\n //$_POST = NULL;\r\n //unset($_POST);\r\n //Devolvemos la vista con los parametros necesarios\r\n\r\n //Establecemos el valor de la variable accion_exitosa, la cual definira el mensaje de exito a mostrar en la funcion msj_exitoso\r\n $accion_exitosa = \"cie\";\r\n //return $this->vista_exitoso();\r\n return redirect('msj_exitoso/'.$accion_exitosa);\r\n\r\n /*return view(\"chasqui.bandeja_de_entrada\")\r\n ->with(\"folder\", $folder)\r\n ->with(\"bandeja_nuevos_cantidad\", $bandeja_nuevos_cantidad)\r\n ->with(\"derivaciones\", $derivaciones)\r\n ->with(\"array_plazo\", $array_plazo)\r\n ->with(\"mensaje_exito\", $mensaje_exito);*/\r\n\r\n\r\n //Si todo salio bien, devolvemos 'ok' (cuando usabamos ajax)\r\n //return 'ok';\r\n }", "static public function rechazarUsuario($id)\n {\n $respuesta = ModeloLogistica::mdlRechazarUsuario($id);\n echo json_encode($respuesta);\n }", "public function actualizarperfil($id,$nombre,$primer_apellido,$segundo_apellido,$ano,$email,$telefono,$alias,$foto)\n {\n \n //busca en la tabla usuarios los campos donde el id sea el que le ha pasado el controlador\n $usuarios = R::load('usuarios',$id);\n \n //sobreescribe los campos\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios-> fecha_nacimiento=$ano;\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->alias=$alias;\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n $existefichero = is_file( $directorio );\n \n \n \n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n // almacena los datos en la tabla usuarios de la base de datos\n R::store($usuarios);\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/perfil_usuario\");\n \n \n }", "public function comprasrealizadas($id){\n\n $users = Usuario::find($id);\n if (is_null($users)) {\n return $this->sendError('Usuario no encontrado');\n }\n\n\n $compras = Usuario::with('devolucions')\n ->with('boleta_reservas')\n ->with('palco_reservas')\n ->where('usuario.email',$id)->get(); \n $compras_p = compact('compras'); \n\n return $this->sendResponse($compras_p, 'Compras realizadas devueltas con éxito');\n\n }", "public function get_usuario_por_id($id_usuario){\r\n $conectar=parent::conexion();// hacemos nuestra conexion\r\n parent::set_names(); // este es para no tener probllemas con las tilde \r\n $sql=\"select * from usuario where id =?\";\r\n $sql=$conectar->prepare($sql); //HACE UNA CONSULTA EN TODOS LOS CAMPOS\r\n $sql->bindValue(1,$id_usuario);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function editar($id){\r\n $usuario = User::find($id);\r\n if(count($usuario)){\r\n if($_SESSION[\"inicio\"] == true){\r\n return Vista::crear('admin.usuario.crear',array(\r\n \"usuario\"=>$usuario,\r\n ));\r\n }\r\n }\r\n return redirecciona()->to(\"usuario\");\r\n }", "function get_id($user_id){\n\t\t$this->id = $user_id;\n\t}", "public function getId_usuario()\n {\n return $this->id_usuario;\n }", "public static function getPreinscripciones($id){ \r\n $conexion = Database::get(); \r\n \r\n $consulta = \"SELECT c.* FROM cursos c, preinscripciones p, usuarios u WHERE u.id = $id \r\n \t\t\tAND p.id_curso = c.id AND u.id= p.id_usuario AND c.activo = 1 ORDER BY p.timestamp ASC;\";\r\n \r\n $resultados = $conexion->query($consulta); \r\n $cursos = array();\r\n while ($curso = $resultados->fetch_object('CursoModel'))\r\n \t$cursos[] = $curso;\r\n \r\n $resultados->free();\r\n\t\t\t\r\n return $cursos;\r\n //return $portadas;\r\n }", "public function getIdUsuario()\n {\n return $this->id_usuario;\n }", "public function getIdUsuario()\n {\n return $this->id_usuario;\n }", "public function Ricetta($id){\n $pm = FPersistentManager::getInstance();\n $ricetta = $pm->loadById(\"ricetta\",$id);\n $session = Sessione::getInstance();\n //se l'utente è loggato si verifica se preferisce questa ricetta (cuore pieno o vuoto a seconda dei casi)\n //se non è loggato sicuramente il cuore è vuoto\n if($session->isLoggedUtente()){\n $preferita = $pm->UtentePrefRic($id,$session->getUtente()->getId());\n } else {\n $preferita = false;\n }\n $commenti = $ricetta->getCommenti();\n $arrcommenti = array();\n //costruisco un array in cui ogni elemento è un array associativo con chiavi 'utente', 'commento' e 'img' profilo utente\n foreach ($commenti as $commento){\n $id = $commento->getIdUtente();\n $utente = $pm->loadById(\"utente\",$id);\n $img = $utente->getImmagine();\n $img->setData(base64_encode($img->getData()));\n $tmp = array(\n 'utente'=>$utente->getUsername(),\n 'img'=>$img,\n 'commento'=>$commento\n );\n $arrcommenti[]=$tmp;\n\n }\n\n $errore=\"\";\n if($arrcommenti==null){\n $errore=\"Non ci sono commenti per questa ricetta\";\n }\n else{\n $errore=\"\";\n }\n $view = new VDettaglio();\n $view->mostraRicetta($ricetta, $preferita, $arrcommenti, $errore);\n }", "public function profil()\n {\n // J'appelle toutes les variables dont j'ai besoin par défaut dans la buildview\n $login = $this->request->getSession()->getAttribut(\"login\"); // recupere le login\n $id = $this->request->getSession()->getAttribut(\"idUser\"); // récupère l'id\n $newpassword = $this->request->getParameterByDefault('newpassword');\n $newpasswordverif = $this->request->getParameterByDefault('newpasswordverif');\n $msgs = [];\n\n\n // j'arrive en post car des données sont saisies dans le formulaire\n if($newpassword && $newpasswordverif)\n {\n\n if($newpassword != $newpasswordverif)\n {\n $msgs[] = \"Les mots de passe ne correspondent pas.\";\n }\n\n else\n {\n $this->user->newPassword($newpassword, $id);\n $msgs[] = \"Le mot de passe a bien été mis à jour.\";\n }\n }\n\n // j'arrive sur la vue en POST mais le champs newpassword ou le champs newpasswordverif n'est pas saisi\n // j'affiche des erreurs insérées dans un tableau.\n else if($_SERVER['REQUEST_METHOD'] === 'POST')\n {\n if(!$newpassword)\n {\n $msgs[] = \"Le nouveau mot de passe n'a pas été saisi correctement.\";\n }\n\n if(!$newpasswordverif)\n {\n $msgs[] = \"La confirmation du nouveau mot de passe n'a pas été saisi correctement.\";\n }\n }\n\n // j'arrive sur la vue en Get\n $this->buildView(array('id' => $id, 'login' => $login, 'msgs' => $msgs));\n\n }", "function identificar_pago_cli_mercantil($acceso,$id_cuba,$abrev_cuba){\n\t$acceso2=conexion();\n\t\n\t\tsession_start();\n\t\t$ini_u = $_SESSION[\"ini_u\"]; \n\t\tif($ini_u==''){\n\t\t\t$ini_u =\"AA\";\n\t\t}\n\t$acceso->objeto->ejecutarSql(\"select *from pagodeposito where (id_pd ILIKE '$ini_u%') ORDER BY id_pd desc\"); \n\t$id_pd = $ini_u.verCoo($acceso,\"id_pd\");\n\t$login = $_SESSION[\"login\"]; \n\t$fecha= date(\"Y-m-d\");\n\t$hora= date(\"H:i:s\");\n\t\n\t$palabra_clave='DEPOSITO EN EFECTIVO';\n\t$palabra_clave1='DEPO-FACIL ELECTRONICO';\n\t//ECHO \" select * from vista_tablabancos where id_cuba='$id_cuba' and descrip_tb ilike 'REC. INT. CARGO CUENTA%'\";\n\t$acceso2->objeto->ejecutarSql(\" select * from vista_tablabancos where id_cuba='$id_cuba' and (descrip_tb ilike '$palabra_clave%' or descrip_tb ilike '$palabra_clave1%' )AND (Status_tb='REGISTRADO' or status_tb='NO RELACIONADO')order by id_tb \");\n\t\twhile($row=row($acceso2)){\n\t\t\t$abrev_cuba=trim($row[\"abrev_cuba\"]);\n\t\t\t$id_tb=trim($row[\"id_tb\"]);\n\t\t\t//echo \"<br>$abrev_cuba:\";\n\t\t\t$fecha_tb=trim($row[\"fecha_tb\"]);\n\t\t\t$referencia_tb=trim($row[\"referencia_tb\"]);\n\t\t\t$monto_tb=trim($row[\"monto_tb\"]);\n\t\t\t$descrip_tb=trim($row[\"descrip_tb\"]);\n\t\t\t$valor=explode($palabra_clave,$descrip_tb);\n\t\t\t$ini=substr($referencia_tb, 0, 3);\n\t\t\t$nro_contrato='00000000000000000000000000';\n\t\t\t//echo \"<br>:$referencia_tb:\";\n\t\t\t//if($ini=='000'){\n\t\t\t\t//$nro_contrato=\t$ano=substr($referencia_tb, 3, 8);\n\t\t\t\t$nro_contrato=\t$referencia_tb;\n\t\t\t\tif(strlen($nro_contrato)!=8 && strlen($nro_contrato)!=7){\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//\techo \"<br>nro_contrato:$nro_contrato:\";\n\t\t\t//}\n\t\t\t//echo \"<br>$referencia_tb: select * from contrato where nro_contrato ilike '%$nro_contrato%' \";\n\t\t\t$acceso->objeto->ejecutarSql(\" select * from contrato where nro_contrato ilike '%$nro_contrato%' \");\n\t\t\tif($row=row($acceso)){\n\t\t\t\t$id_contrato=trim($row[\"id_contrato\"]);\n\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pagodeposito(id_pd,id_contrato,fecha_reg,hora_reg,login_reg,fecha_dep,banco,numero_ref,status_pd,tipo_dt,monto_dep,obser_p,id_tb,fecha_conf,hora_conf,login_conf) values \n\t\t\t\t('$id_pd','$id_contrato','$fecha','$hora','$login','$fecha_tb','$id_cuba','$referencia_tb','CONFIRMADO','DEPOSITO','$monto_tb','$descrip_tb','$id_tb','$fecha','$hora','$login')\");\t\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='CONCILIADO' , tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t\t$id_pd=$ini_u.verCoo_inc($acceso,$id_pd);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='NO RELACIONADO', tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t}\n\t\t}\n\treturn $cad;\t\n}", "public function get_reclamo_usuario($dato)\n {\n\t// c.detallecategoria,(zon.numero * 100000000 + man.numeromanzano * 10000 + z.vivienda)::text AS codigousuario\n // from reclamo r\n // join persona p on p.id_persona = r.id_persona\n // join abonado a on a.id_abonado = r.id_abonado\n // join categoria c on c.id_categoria = a.id_categoria\n // JOIN medidor m ON m.id_medidor = a.id_medidor\n // JOIN zonificacion z ON z.id_medidor = m.id_medidor\n // JOIN zona zon ON zon.id_zona = z.id_zona\n // JOIN manzano man ON man.id_manzano = z.id_manzano\n // order by r.id_reclamo\n\n // \t$this->db->select('p.nombres, p.apellidos, r.estadoreclamo, p.direccion, p.telefono, p.ci, p.nit, r.motivo, r.numero, r.fechareclamo, r.fecharespuesta,a.id_persona,\n\t// c.detallecategoria,(zon.numero * 100000000 + man.numeromanzano * 10000 + z.vivienda)::text as codigousuario');\n // \t$this->db->from('reclamo r');\n // \t$this->db->join('persona p', 'p.id_persona = r.id_persona');\n // \t$this->db->join('abonado a', 'a.id_abonado = r.id_abonado');\n // \t$this->db->join('categoria c', 'c.id_categoria = a.id_categoria');\n // \t$this->db->join('medidor m', 'm.id_medidor = a.id_medidor');\n // \t$this->db->join('zonificacion z', 'z.id_medidor = m.id_medidor');\n // \t$this->db->join('zona zon', 'zon.id_zona = z.id_zona');\n // \t$this->db->join('manzano man', 'man.id_manzano = z.id_manzano');\n // \t$this->db->where('codigousuario', $dato);\n \t// $this->db->order_by('r.id_reclamo')\n \t$this->db->select('estadoreclamo');\n \t$this->db->from('col_reclamo');\n \t$this->db->where('codigousuario', $dato);\n \t$cons = $this->db->get();\n \t// if($consulta->num_rows()>0){\n\t\t\treturn $cons->row();\n\t\t// } else{ echo 'No existen reclamos';}\n }", "public function run()\n {\n // obtenemos los roles...\n $role_administrador = Role::where('nombre', 'Administrador')->first();\n $role_recepcionista = Role::where('nombre','Recepcionista')->first();\n $role_medico = Role::where('nombre', 'Médico')->first();\n\n /*\n // creamos 10 recepcionistas\n \tfactory(User::class, 10)\n ->create()\n ->each(function ($u) use ($role_recepcionista) {\n $u->role()->associate($role_recepcionista);\n $u->save();\n });\n */\n\n // me creo como administrador\n User::create([\n 'nombre' => 'Mariano César',\n 'apellido' => \"D'Angelo\",\n 'email' => 'marianod93@gmail.com',\n 'telefono' => '2901-606964',\n 'role_id' => $role_administrador->id,\n 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm' //secret\n ]);\n\n // por si acaso...\n User::create([\n 'nombre' => 'Mariano César',\n 'apellido' => \"D'Angelo\",\n 'email' => 'marcesdan@gmail.com',\n 'telefono' => '2901-606964',\n 'role_id' => $role_administrador->id,\n 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm' //secret\n ]);\n\n // y como recepcionista\n User::create([\n 'nombre' => 'Mariano César',\n 'apellido' => \"D'Angelo\",\n 'email' => 'marianodeush@hotmail.com',\n 'telefono' => '2901-606964',\n 'role_id' => $role_recepcionista->id,\n 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm' //secret\n ]);\n }", "public function use_obtener_sucursal_actual(){\n $sucursal_actual = $this->ci->session->userdata('sucursal');//sucursal_id sid\n $usuario = $this->ci->arixkernel->select_one_content('numero, nombre','config.sucursales', array('sucursal_id' => $sucursal_actual));\n return $usuario;\n }", "public function get_usuario_por_id_compras($id_usuario)\n {\n\n\n $conectar = parent::conexion();\n parent::set_names();\n\n\n $sql = \"select u.id_usuario,c.id_usuario\n \n from usuarios u \n \n INNER JOIN compras c ON u.id_usuario=c.id_usuario\n\n\n where u.id_usuario=?\n\n \";\n\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $id_usuario);\n $sql->execute();\n\n return $resultado = $sql->fetchAll(PDO::FETCH_ASSOC);\n }", "public function test($id)\n {\n $user = User::findOrfail($id)->products;\n\n // Con esta linea agregas la relaciones hay 4 tipos\n // 1: sync\n // 2: attach\n // 3: dettach\n // 4: syncwithoutdetaching\n $user_parte_dos = User::findOrfail($id)->products()->sync([258, 259, 260]);\n\n\n // SON 10 DOLARES PERRO :v\n\n return($user);\n }", "public function passRecovery($email=''){\n \n $ret = '';//var para retorno\n \n if($email!=''){//se email informado\n \n $sql = new Sql();\n //consulta email informado na tabela de usuários\n $res = $sql->select('SELECT * FROM usuarios WHERE email_usuario = :email_usuario',array(':email_usuario'=>$email)); \n \n //caso nada encontrado retorna ZERO\n if(is_array($res) && count($res)==0){\n \n $ret = 0;//email nao encontrado\n \n }\n elseif(count($res)==1)//caso encontrado então gera o link para recuperacao com base no ID e EMAIL do usuario\n {\n $_userData = array();\n $dataUser = $res[0];\n $_linkTtime = date('Y-m-d H:i:s');\n $_userData['userdata'] = $dataUser;\n $_userData['hash'] = md5( base64_encode($dataUser['id_usuario']) );\n $_userData['hrlimit'] = date(\"d/m/Y H:i:s\", strtotime(\"+1 hours\"));\n \n \n $paramsRecovery = array(\n ':id_usuario'=>$res[0]['id_usuario'],\n ':hash_recovery'=>md5( base64_encode($dataUser['id_usuario']) ),\n ':dt_register'=>$_linkTtime\n );\n \n \n //gera cadastro na tabela de recuperacao de senha\n $res = $sql->query('INSERT INTO pwd_recovery (\n id_usuario,\n hash_recovery,\n dt_register\n ) VALUES ( \n :id_usuario, \n :hash_recovery, \n :dt_register )',$paramsRecovery);\n \n \n if($res>1){//se hash anotado corretamente retorna a url para redirect\n \n $user_key = md5(base64_encode($dataUser['id_usuario']));\n $user_uid = $dataUser['id_usuario'];\n $_url = \"$user_key\";//hash (IDusuario)/(HASH)\n $ret = $_url;\n \n \n $_userData['userdata'] = $_userData;\n $_userData['urlHash'] = $ret;\n //$hashRecovery = $ret;\n \n //retorna a URL com o hash para o reset da senha do usuário\n return $_userData;\n \n }else{//caso contrario retorna falso\n \n \n $ret = false;\n return $ret;\n }\n }\n \n }else{\n $ret = 0;//email nao informado retorna 0\n return $ret;\n }\n \n }", "public function reprova($id){\n \n $cliente = Cliente::find($id);\n //echo $cliente->status;\n $cliente->status = 'reprovado';\n $cliente->dataStatus = date_create()->format('Y-m-d H:i:s');\n $cliente->save();\n return redirect()->route('cliente.index');\n }", "public function gestionarRolProyecto($usuario){\n \n $em=$this->em;\n\n //detecto si tiene el tipo de rol en otro proyecto y espacio para borrar el de progis symfony\n $dql = \" select x from ProyectoBundle:Miembroproyecto x \n join x.rolproyecto rp \n join x.miembroespacio me\n\n where \n\n x.id!=:idmiembroProyecto and me.usuario= :usuario\";\n\n $query = $em->createQuery($dql);\n $query->setParameter('usuario',$usuario);\n $rolProyecto = $query->getResult();\n \n /*\n //definicion\n $miembroProyecto= $em->getRepository('ProyectoBundle:Miembroproyecto')->find($idMiembroProyecto);\n $rolProgis = $em->getRepository('UsuarioBundle:Rol')->findByRol('ROLE_PROGIS');\n \n $rolProyecto=$miembroProyecto->getRolproyecto();\n $usuario=$miembroProyecto->getMiembroEspacio()->getUsuario();\n //fin definiciones\n \n //detecto si tiene el tipo de rol en otro proyecto\n $dql = \"select x from ProyectoBundle:Miembroproyecto x join x.rolproyecto rp join x.miembroespacio me where me.usuario= :usuario and rp.rol like '%ROLE_%'\";\n $query = $em->createQuery($dql);\n $query->setParameter('usuario',$usuario);\n $rolesAsignados = $query->getResult();\n\n \n //si no tenia asignados y se le esta asignando le tildo el rol por defecto en symfony\n if(!empty($rolesAsignados)):\n $usuario->getUser()->removeRol($rolProgis[0]);\n $usuario->getUser()->addRol($rolProgis[0]);\n elseif(empty($rolesAsignados)):\n $usuario->getUser()->removeRol($rolProgis[0]);\n endif;\n \n $em->flush();*/\n }", "function obtenerId($correo){\n $sql = \"SELECT id_usuario from GestionHongos.dbo.Usuarios where correo = '{$correo}'\";\n $qry = sqlsrv_query($this->conn, $sql);\n if ($qry === false) {\n echo \"Error (sqlsrv_query): \" . print_r(sqlsrv_errors(), true);\n }\n $data = '';\n while ($row = sqlsrv_fetch_array($qry, SQLSRV_FETCH_ASSOC)) {\n $data .= $row['id_usuario'];\n }\n return $data;\n }", "public function UsuariosPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios where codigo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codigo\"])) );\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 static function ObtenerProyectosUsuerId($idusuario) {\n $conexion = new ConexionAnaliizoPostgres();\n $conexion->exec(\"set names utf8\");\n $consulta = $conexion->prepare('select * from analiizo_salud.spSelectedProyectosUsuerId(?);');\n $consulta->bindParam(1, $idusuario, PDO::PARAM_STR);\n $consulta->execute();\n $registros = $consulta->fetchAll();\n $conexion = null;\n return $registros;\n }", "public function crearusuarios($nombre,$primer_apellido,$segundo_apellido,$fechanacimento,$email,$telefono,$password,$comprobacion,$alias,$foto)\n { //busca en la tabla usuarios los campos donde el alias sea igual a admin si no encuentra nada devuelve null\n $usuarios = R::findOne('usuarios', 'alias=?', [\n $alias\n ]);\n \n \n // ok es igual a true siempre y cuando usuarios sea distinto de null\n $ok = ($usuarios == null );\n if ($ok) {\n // crea la tabla usuarios\n $usuarios = R::dispense('usuarios');\n //crea los campos de la tabla usuarios\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios->fecha_nacimiento=$fechanacimento;\n $usuarios->fecha_de_registro=date('Y-m-d');\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->contrasena=password_hash($password, PASSWORD_DEFAULT);\n $usuarios->confirmar_contrasena=password_hash($comprobacion, PASSWORD_DEFAULT);\n $usuarios->alias=$alias;\n //verifico si las fotos exiten en el directorio assets/fotosperfil\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n \n $existefichero = is_file( $directorio );\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n //almacena los datos en la tabla usuarios\n R::store($usuarios);\n \n \n //rdirege al controlador principal\n redirect(base_url());\n \n \n }\n \n }", "public function baru(){\n $six_digit_random_number = mt_rand(000001, 999999);\n $s=new userId;\n $userid = $s->create($six_digit_random_number);\n return $six_digit_random_number.$userid;\n }", "protected function getUserId() {}", "protected function getUserId() {}", "public function restore(User $user, Paciente $paciente)\n {\n //\n }", "function invia_email_richiesta_accettata($id_richiesta) {\n $query = \"SELECT U.email as email_fornitore, UU.nome, UU.cognome, UU.telefono, UU.indirizzo, UU.email as email_utente, UU.dati_contatto\n FROM Richieste as R JOIN Users as U ON R.id_fornitore=U.id JOIN Users as UU ON R.id_utente=UU.id\n WHERE R.id=\".$id_richiesta;\n $result = mysql_query($query) or die(mysql_error());\n\n\tif($result){\n $row = mysql_fetch_assoc($result);\n\t} else {\n\t return false;\n\t}\n\n\tif($row['dati_contatto'][0] == 1) {\n\t $indirizzo = $row['indirizzo'];\n\t} else {\n\t $indirizzo = '<i>non visibile</i>';\n\t}\n\tif($row['dati_contatto'][1] == 1) {\n\t $telefono = $row['telefono'];\n\t} else {\n\t $telefono = '<i>non visibile</i>';\n\t}\n\tif($row['dati_contatto'][2] == 1) {\n\t $email = $row['email_utente'];\n\t} else {\n\t $email = '<i>non visibile</i>';\n\t}\n\n $to = $row['email_fornitore'];\n $subject = \"Richiesta Accettata\";\n $message = \"<html><head>\n <title>Hai accettato una richiesta</title>\n </head><body>\n <p>Riepilogo dati utente:</p>\n <p>Nome: \".$row['nome'].\" \".$row['cognome'].\"<br>\n Telefono: \".$telefono.\"<br>\n Email: \".$email.\"<br>\n Indirizzo: \".$indirizzo.\"</p>\n <p>Ricordiamo che per ogni richiesta accettata saranno aggiunti 2€ sul conto aziendale.</p>\n </body></html>\";\n\n $res = sendEmail($to, $subject, $message);\n\n}" ]
[ "0.5825038", "0.57198113", "0.5691479", "0.56822336", "0.5675066", "0.55764306", "0.5572753", "0.55459803", "0.5541851", "0.55253863", "0.55000377", "0.54976654", "0.5490647", "0.546465", "0.5454428", "0.54462576", "0.5430842", "0.5428828", "0.54269904", "0.5416816", "0.5415367", "0.54124373", "0.54032767", "0.53987086", "0.5398388", "0.53628534", "0.5362623", "0.5345642", "0.53291196", "0.5322175", "0.53197867", "0.53182095", "0.531664", "0.53130305", "0.5311461", "0.5308738", "0.53005207", "0.5285099", "0.52812576", "0.52799094", "0.52736753", "0.52676004", "0.5248132", "0.5242339", "0.5217884", "0.5211734", "0.52113855", "0.521109", "0.5207607", "0.5202689", "0.5202147", "0.5201689", "0.52012956", "0.5197727", "0.5197681", "0.51947236", "0.5189679", "0.5189507", "0.5186962", "0.51826644", "0.51752037", "0.51736534", "0.51687515", "0.51681095", "0.5159428", "0.5158217", "0.51576483", "0.5154877", "0.51544327", "0.5152714", "0.5147755", "0.5147334", "0.51439303", "0.51397926", "0.51345813", "0.5131467", "0.513044", "0.5124036", "0.5112121", "0.51116025", "0.51116025", "0.51103604", "0.51047283", "0.51045066", "0.51003915", "0.50978357", "0.50970477", "0.5096044", "0.5094565", "0.509287", "0.50924075", "0.50901324", "0.50837785", "0.50761026", "0.50731236", "0.5068019", "0.5065776", "0.50648695", "0.50648695", "0.5063606", "0.5061145" ]
0.0
-1
Run the migrations. s
public function up() { Schema::create('projects', function (Blueprint $table) { $table->increments('id')->unsigned(); $table->integer('created_by')->unsigned(); $table->string('code'); $table->string('name'); $table->integer('status')->unsigned(); $table->integer('acct_manager')->unsigned(); $table->integer('dev_manager')->unsigned(); $table->integer('project_manager')->unsigned(); $table->string('trend')->nullable(); $table->integer('req_status')->unsigned()->nullable(); $table->dateTime('req_eta')->nullable(); $table->integer('dev_status')->unsigned()->nullable(); $table->dateTime('dev_eta')->nullable(); $table->integer('qa_status')->unsigned()->nullable(); $table->dateTime('qa_eta')->nullable(); $table->integer('uat_status')->unsigned()->nullable(); $table->dateTime('uat_eta')->nullable(); $table->integer('prod_status')->unsigned()->nullable(); $table->dateTime('prod_eta')->nullable(); $table->timestamps(); $table->softDeletes(); }); Schema::table('projects', function (Blueprint $table) { $table->foreign('created_by')->references('id')->on('users'); $table->foreign('status')->references('id')->on('project_status'); $table->foreign('acct_manager')->references('id')->on('users'); $table->foreign('dev_manager')->references('id')->on('users'); $table->foreign('project_manager')->references('id')->on('users'); $table->foreign('req_status')->references('id')->on('environment_status'); $table->foreign('dev_status')->references('id')->on('environment_status'); $table->foreign('qa_status')->references('id')->on('environment_status'); $table->foreign('uat_status')->references('id')->on('environment_status'); $table->foreign('prod_status')->references('id')->on('environment_status'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function migrate()\n {\n\n // If there is not a declaration that migrations have been run'd\n if( ! isset($GLOBALS['migrated_test_database']))\n {\n // Run migrations\n require path('sys').'cli/dependencies'.EXT;\n\n $which_db = \\Config::get('database.default');\n $database = \\Config::get('database.connections.'.$which_db);\n\n $migration_table = null;\n if($which_db == 'mysql')\n {\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = ? AND table_name = ?\";\n $migration_table = \\DB::query($query, array($database['database'], $database['prefix'].'laravel_migrations'));\n }\n\n // if($which_db == 'sqlite')\n // {\n // //$migration = \"SELECT * FROM {$database['database']}.sqlite_master WHERE type='table'\";\n // //sqlite3_exec(budb, \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\"\n // \\sqlite_open(\":memory:\", $database['database']);\n // $migration = \\sqlite_exec($database['database'], \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\");\n // }\n\n if(isset($migration_table['0']->count) and $migration_table['0']->count == '0')\n {\n Command::run(array('migrate:install'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n else\n {\n Command::run(array('migrate:reset'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n\n\n //Insert basic data\n\n // Declare that migrations have been run'd\n $GLOBALS['migrated_test_database'] = true;\n }\n }", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "public function migrate() {}", "public function run(){\n \n //product\n if (!Schema::hasColumn('products', 'plus_option')) {\n Schema::table('products', function (Blueprint $table) {\n $table->boolean('plus_option')->default(true)->after('is_active');\n });\n }\n\n //coupons\n if (!Schema::hasColumn('coupons', 'times')) {\n Schema::table('coupons', function (Blueprint $table) {\n $table->integer('times')->default(0)->after('is_active');\n });\n }\n\n //option groups\n if (!Schema::hasColumn('option_groups', 'required')) {\n Schema::table('option_groups', function (Blueprint $table) {\n $table->boolean('required')->default(false)->after('multiple');\n });\n }\n\n //force migration for new tables\n if (!Schema::hasTable('coupon_user')) {\n Artisan::call('migrate --path=database/migrations/2021_08_07_124104_create_coupon_user_pivot_table.php --force');\n }\n\n //vendor min/max orders\n if (!Schema::hasColumn('vendor_types', 'color')) {\n Schema::table('vendor_types', function (Blueprint $table) {\n $table->string('color')->default(\"#000\")->after('name');\n });\n }\n\n //users\n if (!Schema::hasColumn('users', 'country_code')) {\n Schema::table('users', function (Blueprint $table) {\n $table->string('country_code')->nullable()->after('phone');\n });\n }\n\n }", "public function run()\n {\n Schema::create('fileuploads', function (Blueprint $table) {\n $table->increments('id');\n $table->string('filename');\n $table->timestamps();\n });\n }", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n \t\n \tUser::truncate();\n \n Schema::enableForeignKeyConstraints();\n\n $usersToMigrate = Migrate::all();\n\n collect($usersToMigrate)->each(function($user) {\n \t$this->create($user);\n });\n\n $this->admin();\n }", "public function run()\n {\n //\n Schema::disableForeignKeyConstraints();\n User::truncate();\n\n $admin = User::create([\n 'name' => 'Admin User',\n 'email' => 'admin@admin.com',\n 'password' => Hash::make('password'),\n \n ]);\n $admin->assignRole('admin');\n\n $tutor = User::create([\n 'name' => 'Tutor User',\n 'email' => 'tutor@tutor.com',\n 'password' => Hash::make('password'),\n \n ]);\n $tutor->assignRole('tutor');\n\n $student = User::create([\n 'name' => 'Student User',\n 'email' => 'student@student.com',\n 'password' => Hash::make('password'),\n 'course_id' => '1',\n 'tutor_id' => $tutor->id\n ]);\n $student->assignRole('student');\n \n Digitutor::create([\n 'user_id' => $student->id,\n ]);\n\n Schema::enableForeignKeyConstraints();\n\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(ConditionsTableSeeder::class);\n $this->call(DeliveriesTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(AdvertsTableSeeder::class);\n // plaats postcode import in eigen / aparte seeder class ==>> Made migration (else DB:rename doesn't work inside seeder, makes copy)\n }", "public function up()\n\t{\n\t\tSchema::create('step9', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('estudio_id');\n\t\t\t$table->string('presupuesto');\n\t\t\t$table->string('tiene_deudas');\n\t\t\t$table->string('transporte_escuela');\n\t\t\t$table->string('costo_transporte_papa');\n\t\t\t$table->string('costo_transporte_mama');\n\t\t\t$table->string('costo_transporte_hijos');\n\t\t\t$table->string('servicios_luz');\n\t\t\t$table->string('servicios_agua');\n\t\t\t$table->string('servicios_gas');\n\t\t\t$table->string('servicios_telefono');\n\t\t\t$table->string('servicios_internet');\n\t\t\t$table->string('servicios_cable');\n\t\t\t$table->string('hijos_egresados');\n\t\t\t$table->string('hijos_cuantos');\n\t\t\t$table->string('proyecto_familiar');\n\t\t\t$table->string('familia');\n\t\t\t$table->string('anio_reingreso');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_deudas', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('donde');\n\t\t\t$table->string('que');\n\t\t\t$table->string('cuanto');\n\t\t\t$table->string('tiempo');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_hijos', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('egreso');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_semanales', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('consumo');\n\t\t\t$table->string('gasto');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_mensuales', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('gasto');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_gastos', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('gasto');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\tSchema::create('step9_otros_salud', function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('step9_id');\n\t\t\t$table->string('nombre');\n\t\t\t$table->string('parentesco');\n\t\t\t$table->string('tipo_enfermedad');\n\t\t\t$table->string('tiempo_padecer');\n\t\t\t$table->string('costo_mensual');\n\t\t\t$table->string('observaciones');\n\t\t\t$table->timestamps();\n\t\t});\n\t}", "public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }", "public function migrate()\n {\n Artisan::call('migrate', [\n '--seed' => true\n ]);\n }", "public function run()\n {\n \t$this->cleanDatabase();\n\n $this->call(LessonsTableSeeder::class);\n $this->call(TagsTableSeeder::class);\n $this->call(LessonTagTableSeeder::class);\n }", "public function run(){\n return Artisan::call('migrate');\n }", "public function runMigrations()\n {\n if (file_exists($this->baseSqlite())) {\n return;\n }\n\n config(['database.connections.sqlite.database' => $this->copySqlite()]);\n if (method_exists($this, 'withoutMockingConsoleOutput')) {\n $this->withoutMockingConsoleOutput()->artisan('migrate');\n } else {\n Artisan::call('migrate');\n }\n\n // Run Seeders\n copy($this->copySqlite(), $this->baseSqlite());\n return;\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('labor_unions')->truncate();\n\n LaborUnion::create([\n 'id' => 1,\n 'name' => 'Sindicato de Trabajadores San Bernardo Asociados',\n ]);\n\n LaborUnion::create([\n 'id' => 2,\n 'name' => 'Sindicato 1 Los Andes',\n ]);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->truncate();\n\n $email = 'fairscribe@scio.systems';\n $password = 'scio';\n\n // Create the main user.\n User::create([\n 'firstname' => 'Scio',\n 'lastname' => 'Systems',\n 'email' => $email,\n 'password' => bcrypt($password),\n 'identity_provider' => IdentityProvider::SCRIBE\n ]);\n\n Schema::enableForeignKeyConstraints();\n }", "public function run()\n {\n /*app('db')\n ->table('users')\n ->insert([\n 'first_name' => 'test_first1',\n 'last_name' => 'test_last1',\n 'email' => 'testuser1@gmail.com',\n 'password' => 'test123'\n ]);*/ \n \n app('db')\n ->table('users')\n ->insert([\n 'first_name' => 'test_first2',\n 'last_name' => 'test_last2',\n 'email' => 'testuser2@gmail.com',\n 'password' => 'test12345'\n ]);\n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n User::create([\n 'name' => 'EBM',\n 'email' => 'EBM@EBM.ebm',\n 'password' => bcrypt('hamzaoutai'),\n ]);\n Schema::enableForeignKeyConstraints();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n Artisan::call('migrate:refresh');\n $this->populateUsers();\n $this->populatePosts();\n $this->populateComments();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n DB::table('loaitaikhoan')->truncate();\n\n $data = [\n \t['ten' => 'Người tìm việc'],\n \t['ten' => 'Nhà tuyển dụng']\n ];\n\n foreach ($data as $v) {\n \tDB::table('loaitaikhoan')->insert(\n \t\t[\n \t\t\t'ten' => $v['ten'],\n \t\t\t'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n \t\t\t'updated_at' => Carbon\\Carbon::now()->toDateTimeString()\n \t\t]\n \t);\n } \n\n Schema::enableForeignKeyConstraints();\n }", "public function run()\n {\n DB::table('SET FOREIGN_KEY_CHECKS=0');\n //DB::table('users')->truncate();\n\n DB::table('users')->insert([\n [\n 'name'=>'john doe',\n 'email'=>'john@mail.com',\n 'password'=>bcrypt('secret')\n ],\n [\n 'name'=>'janedoe',\n 'email'=>'jane@mail.com',\n 'password'=>bcrypt('secret')\n ],\n [\n 'name'=>'andihoerudin',\n 'email'=>'andi@mail.com',\n 'password'=>bcrypt('secret')\n ]\n ]);\n\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n\n $this->call(UsersTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(TagsTableSeeder::class);\n $this->call(PassportClientSeeder::class);\n $this->call(PlaylistsTableSeeder::class);\n\n\n Schema::enableForeignKeyConstraints();\n }", "public function migrate()\n\t{\n\t}", "public function run()\n {\n DB::table('finances')->insert([\n\n 'name' => 'Budžets',\n 'description' => 'Test1',\n 'sum' => ('300.40'),\n ]);\n DB::table('folders')->insert([\n 'name' => 'Finanses',\n 'description' => 'Test1',\n ]);\n DB::table('uploads')->insert([\n 'name' => 'budžets2018',\n 'folder_id'=>'1',\n 'description' => 'Test1',\n ]);\n DB::table('storages')->insert([\n 'name' => 'MT',\n ]);\n }", "public function run()\n {\n App\\Country::create([\n 'name' => 'Srbija'\n ]);\n \n App\\Country::create([\n 'name' => 'Banglades'\n ]);\n \n // $this->call(UsersTableSeeder::class);\n App\\User::create([\n 'name' => 'm',\n 'email' => 'marko1@vivifyideas.com',\n 'company' => 'vivify',\n 'country_id' => 1,\n 'password' => \\Hash::make('password')\n ]);\n\n App\\Todo::create([\n 'title' => 'Learn Vue.js',\n 'done' => false\n ]);\n \n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n App\\Role::truncate();\n\n $admin = new App\\Role;\n $admin->id = 1;\n $admin->name = 'Admin';\n $admin->machine_name = 'admin';\n $admin->save();\n\n $seller = new App\\Role;\n $seller->id = 2;\n $seller->name = 'Seller';\n $seller->machine_name = 'seller';\n $seller->save();\n\n $customer = new App\\Role;\n $customer->id = 3;\n $customer->name = 'Customer';\n $customer->machine_name = 'customer';\n $customer->save();\n\n Schema::enableForeignKeyConstraints();\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 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\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('UserTableSeeder');\n\n\t\t$this->call('StaticDepartmentTableSeeder');\n $this->command->info('static_departments table seeded!');\n\n\t\t$this->call('StaticHostelTableSeeder');\n $this->command->info('static_hostels table seeded!');\n\n\t\t$this->call('StaticMinorTableSeeder');\n $this->command->info('static_minors table seeded!');\n\t}", "public function run()\n {\n $this->call(UserTableSeeder::class); //muốn chạy bảng nào trước thì đặt lên đầu\n $this->call(CatsTableSeeder::class); //muốn chạy bảng nào trước thì đặt lên đầu\n $this->call(BreedsTableSeeder::class); //muốn chạy bảng nào trước thì đặt lên đầu\n }", "public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "private function runTestMigrations()\n {\n $schema = $this->app['db']->connection()->getSchemaBuilder();\n\n if (! $schema->hasTable('users')) {\n $schema->create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('name')->nullable();\n $table->string('role_label')->nullable();\n $table->timestamps();\n });\n }\n }", "public function up()\n\t{\n\t\t//\n Schema::create('schedules', function ($table) {\n $table->increments('id');\n $table->string('satellite_id',100);\n $table->string('target')->nullable();\n $table->string('target_name')->nullable();\n $table->string('observation_id')->nullable();\n $table->string('revolution')->nullable();\n $table->string('ra')->nullable();\n $table->string('dec')->nullable();\n $table->string('start_time')->nullable();\n $table->string('end_time')->nullable();\n $table->timestamps();\n });\n\t}", "public function runDatabaseMigrations()\n {\n if (!$this->runMigrations) {\n return;\n }\n\n $this->artisan('migrate:fresh');\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $user = App\\User::create([\n 'name' => 'Jeffrei Hernandez',\n 'email' => 'hjefrei@gmail.com',\n 'password' => bcrypt('16052010')\n ]);\n\n $role = App\\Role::create([\n 'name'=> 'Administrador',\n 'description' => 'Administra toda la pagina'\n ]);\n\n $user->roles()->sync($role);\n\n $permiso = App\\Permiso::create([\n 'name' => 'Acceso Full',\n 'description' => 'Puede hacer de todo'\n ]);\n $role->permisos()->sync($permiso);\n\n App\\Permiso::create([\n 'name' => 'Crear tarea',\n 'description' => 'Puede crear tarea a un projecto y asignar empleados'\n ]);\n\n App\\Permiso::create([\n 'name' => 'Acceso Manager',\n 'description' => 'Solo puede ver projectos y estar al tanto de sus tareas asignadas'\n ]);\n\n App\\Permiso::create([\n 'name' => 'Acceso Empleado',\n 'description' => 'Solo puede ver projectos y tareas asignadas'\n ]);\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n // $this->cleanDatabase();\n //DB::statement('SET FOREIGN_KEY_CHECKS = \"0\"');\n $this->call([\n HotelListsTableSeeder::class,\n UsersTableSeeder::class,\n RoomListsTableSeeder::class,\n BookingListsTableSeeder::class,\n QuestListsTableSeeder::class,\n\n ]);\n // DB::statement('SET FOREIGN_KEY_CHECKS = \"1\"');\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n \t'name' => 'Gerardo Steven',\n 'email' => 'gerardo@typhoon.com',\n 'password' => Hash::make('root'),\n 'rol' => 0,\n ]);\n DB::table('users')->insert([\n \t'name' => 'Gerardo User',\n 'email' => 'gerardo_user@typhoon.com',\n 'password' => Hash::make('root'),\n 'rol' => 1,\n ]);\n }", "public function run()\n {\n $news = \\App\\News::all();\n foreach ($news as $new) {\n \\App\\NewsTranslation::create([\n 'news_id' => $new->id,\n 'lang' => 'pl',\n 'title' => $new->title,\n 'text' => $new->text,\n 'slug' => $new->slug,\n 'pretext' => $new->pretext\n ]);\n }\n\n // alter news table drop column\n\n \\Illuminate\\Support\\Facades\\Schema::table('news', function (\\Illuminate\\Database\\Schema\\Blueprint $table) {\n $table->dropColumn([\n 'title',\n 'text',\n 'slug',\n 'pretext'\n ]);\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 run()\n {\n DB::table('users')->insert([\n 'name' => 'Super Admin',\n 'email' => 'tour@innoflame.net.sa',\n 'phone' => '201002211824',\n 'password' => bcrypt('INNO_tour@2015'),\n 'confirmed'=>'1',\n 'active'=>'1'\n ]);\n\n DB::table('users_roles')->insert([\n 'role_id' => '3',\n 'user_id'=>'1'\n ]);\n }", "public function run()\n {\n // Eloquent::unguard();\n // $path = 'resources/developer_docs/users.sql';\n // DB::unprepared(file_get_contents($path));\n // $this->command->info('users data seeded!');\n \n DB::table('users')->insert([\n [\n 'id' => 1,\n 'name' => 'yoshihara',\n 'email' => 'yoshihara@gmail.com',\n 'password' => bcrypt('yoshihara'),\n ],\n [\n 'id' => 2,\n 'name' => 'kazuki',\n 'email' => 'kazuki@gmail.com',\n 'password' => bcrypt('kazuki'),\n ],\n [\n 'id' => 3,\n 'name' => 'sei',\n 'email' => 'sei@gmail.com',\n 'password' => bcrypt('sei@gmail.com'),\n ]\n ]);\n }", "public function up()\n\t{\n\t\tSchema::table('splinter_splits', function($table)\n\t\t{\n\t\t\t$table->connection = SPLINTER_DB;\n\t\t\t$table->create();\n\n\t\t\t$table->increments('id');\n\t\t\t$table->timestamps();\n\t\t\t$table->string('name');\n\t\t});\n\n\t\tSchema::table('splinter_variations', function($table)\n\t\t{\n\t\t\t$table->connection = SPLINTER_DB;\n\t\t\t$table->create();\n\n\t\t\t$table->increments('id');\n\t\t\t$table->timestamps();\n\t\t\t$table->integer('split_id')->references('id')->on('splinter_splits');\n\t\t\t$table->string('name');\n\t\t});\n\n\t\tSchema::table('splinter_clients', function($table)\n\t\t{\n\t\t\t$table->connection = SPLINTER_DB;\n\t\t\t$table->create();\n\n\t\t\t$table->increments('id');\n\t\t\t$table->timestamps();\n\t\t\t$table->string('ip_address');\n\t\t\t$table->string('user_agent');\n\t\t\t$table->integer('split_id')->references('id')->on('splinter_splits');\n\t\t\t$table->integer('variation_id')->references('id')->on('splinter_variations');\n\t\t});\n\n\t\tSchema::table('splinter_goals', function($table)\n\t\t{\n\t\t\t$table->connection = SPLINTER_DB;\n\t\t\t$table->create();\n\n\t\t\t$table->increments('id');\n\t\t\t$table->timestamps();\n\t\t\t$table->integer('split_id')->references('id')->on('splinter_splits');\n\t\t\t$table->string('name');\n\t\t\t$table->string('slug');\n\t\t});\n\n\t\tSchema::table('splinter_hits', function($table)\n\t\t{\n\t\t\t$table->connection = SPLINTER_DB;\n\t\t\t$table->create();\n\n\t\t\t$table->increments('id');\n\t\t\t$table->timestamps();\n\t\t\t$table->integer('split_id')->references('id')->on('splinter_splits');\n\t\t\t$table->integer('variation_id')->references('id')->on('splinter_variations');\n\t\t\t$table->integer('client_id')->references('id')->on('splinter_clients');\n\t\t});\n\n\t\tSchema::table('splinter_conversions', function($table)\n\t\t{\n\t\t\t$table->connection = SPLINTER_DB;\n\t\t\t$table->create();\n\n\t\t\t$table->increments('id');\n\t\t\t$table->timestamps();\n\t\t\t$table->string('client_id')->references('id')->on('splinter_clients')->nullable();\n\t\t\t$table->integer('goal_id')->references('id')->on('splinter_goals');\n\t\t\t$table->integer('split_id')->references('id')->on('splinter_splits');\n\t\t\t$table->integer('variation_id')->references('id')->on('splinter_variations');\n\t\t});\n\n\t\tSchema::table('splinter_errors', function($table)\n\t\t{\n\t\t\t$table->connection = SPLINTER_DB;\n\t\t\t$table->create();\n\n\t\t\t$table->increments('id');\n\t\t\t$table->timestamps();\n\t\t\t$table->string('message');\n\t\t\t$table->integer('split_id')->references('id')->on('splinter_splits')->nullable();\n\t\t});\n\t}", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n DB::beginTransaction();\n try {\n $this->call([\n UsersTableSeeder::class,\n DominiosTableSeeder::class,\n TiposCobrancasTableseeder::class,\n CotacoesTablesSeeder::class\n ]);\n DB::commit();\n } catch(\\Exception $e){\n DB::rollback();\n dd($e->getMessage());\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => 'peterwong.brisbane@gmail.com',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function up() { return $this->run('up'); }", "public function run()\n {\n $faker = Faker::create();\n $date = Carbon::now();\n DB::table('users')->insert([\n 'name' => $faker->firstName,\n 'password'=> Hash::make('password@1'),\n 'email' => 'dev@vadsoft.com',\n 'phone' => '09011111111',\n 'email_verified_at'=> $date,\n 'clientid'=>1,\n 'roleid'=>1,\n 'organid'=>1,\n 'isdev'=>true,\n 'created_at' => $date,\n 'updated_at' => $date\n ]);\n\n DB::table('userprofiles')->insert([\n 'userid' => 1,\n 'staffno'=>10000,\n 'fname' => 'Scarlett',\n 'lname' => $faker->lastname,\n 'jobtitle'=>'Manager',\n 'jobdesc'=>'Managing things',\n 'gender'=>'Male',\n 'gradelevel'=>'5 level 6',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public static function dbMigrate(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Migrate the database\n\t\t\tArtisan::call('migrate');\n\t\t}\n\t}", "public function run()\n {\n if(config('database.default') !== 'sqlite'){\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n }\n\n \\App\\TradeType::truncate();\n $this->call(TradeTypesTableSeeder::class);\n\n \\App\\Kind::truncate();\n $this->call(KindsTableSeeder::class);\n\n \\App\\ItemType::truncate();\n $this->call(ItemTypesTableSeeder::class);\n\n \\App\\EtfType::truncate();\n $this->call(EtfTypesTableSeeder::class);\n\n\n\n if(config('database.default') !== 'sqlite'){\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }\n\n }", "public function run()\n {\n\n\n //force migration for new tables\n if (!Schema::hasTable('sms_gateways')) {\n Artisan::call('migrate --path=database/migrations/2021_08_18_133903_create_sms_gateways_table.php --force');\n Artisan::call('db:seed --class=SmsGatewaysTableSeeder --force');\n }\n if (!Schema::hasTable('auto_assignments')) {\n Artisan::call('migrate --path=database/migrations/2021_08_20_214110_create_auto_assignments_table.php --force');\n }\n if (!Schema::hasTable('otps')) {\n Artisan::call('migrate --path=database/migrations/2021_08_22_143802_create_otps_table.php --force');\n }\n //twilio sms gateway\n $smsGateway = SmsGateway::where('slug', \"twilio\")->first();\n if (empty($smsGateway)) {\n \\DB::table('sms_gateways')->insert(array(\n 0 =>\n array(\n 'name' => 'Twilio',\n 'slug' => 'twilio',\n 'is_active' => 0,\n 'created_at' => now(),\n 'updated_at' => now(),\n ),\n ));\n }\n\n\n //vendors auto accept order\n if (!Schema::hasColumn('vendors', 'auto_accept')) {\n Schema::table('vendors', function (Blueprint $table) {\n $table->boolean('auto_accept')->default(false)->after('auto_assignment');\n });\n }\n //\n if (!Schema::hasColumn('package_type_pricings', 'multiple_stop_fee')) {\n Schema::table('package_type_pricings', function (Blueprint $table) {\n $table->double('multiple_stop_fee', 8, 2)->default(0.00)->after('base_price');\n });\n }\n \n //aading status to auto assignments\n if (!Schema::hasColumn('auto_assignments', 'status')) {\n Schema::table('auto_assignments', function (Blueprint $table) {\n $table->enum('status', ['pending', 'rejected'])->default('pending')->after('driver_id');\n });\n }\n \n \n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function run()\n {\n \t// Ask for db migration refresh, default is no\n if ($this->command->confirm('Do you wish to refresh migration before seeding, it will clear all old data ?')) {\n // Call the php artisan migrate:refresh\n $this->command->call('migrate:refresh');\n $this->command->warn(\"Data cleared, starting from blank database.\");\n }\n \n // $this->call(UsersTableSeeder::class);\n $this->call(PermissionSeed::class);\n $this->call(RoleSeed::class);\n $this->call(UserSeed::class);\n\n // Ask for adding test data, default is no\n if ($this->command->confirm('Do you wish to add test data ?')) {\n // test data seeder\n $this->call(SampleDataSeeder::class);\n }\n }", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('users', function($table) {\n\t\t $table->increments('id');\n\t\t $table->string('uid', 16);\n\t\t $table->string('provider', 32);\n\t\t $table->string('name', 128);\n\t\t $table->string('nickname', 32)->nullable();\n\t\t\t$table->string('email', 64);\t\t\t\n\t\t $table->string('password', 128);\n\t\t\t$table->string('social_url', 255)->nullable();\n\t\t\t$table->string('video_url', 255)->nullable();\n\t\t\t$table->string('bio', 255)->nullable();\n\t\t $table->string('image', 255)->nullable();\n\t\t\t$table->integer('points')->nullable();\n\t\t $table->timestamps();\n\t\t $table->boolean('male')->default(true);\n\t\t $table->boolean('active')->default(true);\n\t\t\t$table->integer('order')->nullable();\n\t\t $table->boolean('admin')->nullable();\n\t\t});\n\t\t\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n\n $this->call(users::class);\n $this->call(affiliates::class);\n $this->call(productInfo::class);\n\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function migrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Database/Migrations');\n\n $this->publishes([\n __DIR__.'/Database/Migrations/' => database_path('migrations')\n ], $this->packageName.'-migrations');\n }", "public function run()\n {\n //$this->call(UserSeeder::class);\n\n //$this->call(UsersTableSeeder::class); //2021-02-24 add, for sanctum\n //mark it, use command=> php artisan db:seed --class=UsersTableSeeder\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users_type')->truncate();\n\n $data = [\n \t['userstype_name' => 'Quản trị viên'],\n \t['userstype_name' => 'Khách hàng']\n ];\n\n foreach ($data as $v) {\n \tDB::table('users_type')->insert(\n \t\t[\n \t\t\t'userstype_name' => $v['userstype_name'], \t\t\t\n \t\t\t'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n \t\t\t'updated_at' => Carbon\\Carbon::now()->toDateTimeString()\n \t\t]\n \t);\n } \n\n Schema::enableForeignKeyConstraints();\n }", "public function run()\n {\n if ($this->command->confirm('Do you want to fresh the database?',true)) {\n $this->command->call('migrate:fresh');\n $this->command->info('Database was freshed');\n }\n $this->call([\n UsersTableSeeder::class\n ]);\n }", "public function callMigration()\n {\n Artisan::call('lucy:migration', $this->builder->getAttribute('migration'));\n\n Artisan::call('migrate');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n $this->call(LaRbacDatabaseSeeder::class);\n // User::truncate();\n // User::create([\n // 'name' => '',\n // 'email' => 'mikehambra@gmail.com',\n // 'password' => Hash::make('mypassword'),\n // ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('users')->insert([\n [\n 'id' => 1,\n 'name' => 'admin',\n 'email' => 'admin@filebank.com', \n 'password' => Hash::make('filebankadmin'), \n 'admin' => config('env.user.admin'), \n 'created_at' => Carbon::now()->toDateTimeString(), \n 'updated_at' => Carbon::now()->toDateTimeString(), \n ],\n ]);\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n DB::table('siswas')->insert([\n 'name' => 'Nama Siswa',\n 'username' => 'siswa',\n 'password' => bcrypt(121212)\n ]);\n DB::table('gurus')->insert([\n 'name' => 'Nama Guru',\n 'username' => 'guru',\n 'password' => bcrypt(121212)\n ]);\n }", "public function run()\n {\n $this->call(RolesAndPermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ReadersTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(KeywordsTableSeeder::class);\n $this->call(ArticlesTableSeeder::class);\n $this->call(CommentsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n if (env('APP_ENV') == 'local') {\n $this->command->info('All table seeded successfully!');\n $this->command->info('username: owner@gmail.com | password: owner');\n }\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }", "public function run()\n {\n \\Illuminate\\Support\\Facades\\DB::table('users')->insert([\n 'name' => 'tim',\n 'email' => 'admin@test.fr',\n 'password' => \\Illuminate\\Support\\Facades\\Hash::make('test'),\n 'created_at' => \\Carbon\\Carbon::now(),\n 'role' => 'admin',\n 'email_verified_at' => \\Carbon\\Carbon::now(),\n ]);\n\n\n User::create([\n 'name' =>'Flo',\n 'email' => 'contact@florent.com',\n 'password' => Hash::make('toor'),\n 'role' => 'user'\n ]);\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Eric Kaburu',\n 'email' => 'kaburu@test.com',\n 'password' => Hash::make('admin')\n ]);\n User::create([\n 'name' => 'Ernest ',\n 'email' => 'ernest@test.com',\n 'password' => Hash::make('secret')\n ]);\n }", "public function run(): void \n {\n // Ask for DB migration refresh, default is no \n if ($this->command->confirm('Do you wish to refresh migrations before seeding, it will clear all old data?')) {\n $this->command->call('migrate:refresh');\n $this->command->warn('Data cleared, starting from blank database.');\n }\n\n // Run other seeders in the system. \n $this->call(AclTableSeeder::class);\n $this->call(CityTableSeeder::class);\n $this->call(PageFragmentsSeeder::class);\n }", "public function run()\n {\n /* $this->truncateTables([\n 'tipoPerfil',\n 'users'\n\n ]);*/\n\n $this->call([TipoPerfilSeeder::class]);\n $this->call([UsersTableSeeder::class]);\n $this->call([AreaConocimientoSeeder::class]);\n $this->call([EstudiantesTableSeeder::class]);\n $this->call([NivelSeeder::class]);\n $this->call([CapitulosSeeder::class]);\n $this->call([ProfesoresSeeder::class]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n Role::truncate();\n\n $this->call(UsersTableSeeder::class);\n $this->command->info('The admin data has been seeded!');\n Role::create(['name'=>'seeker']); //Job Seeker\n Role::create(['name'=>'employer']); //Hiring employer \n Role::create(['name'=>'volunteer']); //Volunteer\n \n\n $this->command->info('All other roles have been seeded!');\n\n Schema::enableForeignKeyConstraints();\n \n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '80976512@qq.com',\n 'password' => bcrypt('admin'),\n 'locked' => 1,\n 'control' => config('soj.admin.all')|1,\n ]);\n DB::table('user_infos')->insert([\n 'id' => '1',\n ]);\n DB::table('admins')->insert([\n 'id' => 1,\n 'password' => bcrypt('admin'),\n ]);\n DB::table('soj')->insert([\n 'name' => 'label',\n 'content' => '[{\"name\": \"全部问题\", \"id\": 0}]']);\n }", "public function up()\n {\n $this->table('articles')\n ->addColumn('title', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('details', 'text', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('categories', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('football_ragistrations', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('student_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created_to', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('friends', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('amount', 'float', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('city', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('menus')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('status', 'tinyinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('picnic_ragistrations', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('student_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('amount', 'decimal', [\n 'default' => null,\n 'null' => false,\n 'precision' => 10,\n 'scale' => 2,\n ])\n ->addColumn('created_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('products', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('category_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('profiles')\n ->addColumn('user_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('mobile', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('skills')\n ->addColumn('user_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 30,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('spouses', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('friend_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('students')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('age', 'decimal', [\n 'default' => null,\n 'null' => false,\n 'precision' => 10,\n 'scale' => 3,\n ])\n ->addColumn('country', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('created_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('submenus')\n ->addColumn('menu_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('status', 'boolean', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('users')\n ->addColumn('username', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('email', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('amount', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('password', 'string', [\n 'default' => null,\n 'limit' => 100,\n 'null' => false,\n ])\n ->addColumn('image', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('status', 'tinyinteger', [\n 'default' => '1',\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n \\App\\Genres::truncate();\n Schema::enableForeignKeyConstraints();\n $genres = [\n 'Action',\n 'Adventure',\n 'Animation',\n 'Biography',\n 'Comedy',\n 'Crime',\n 'Documentary',\n 'Drama',\n 'Family',\n 'Fantasy',\n 'Film',\n 'Noir',\n 'History',\n 'Horror',\n 'Music',\n 'Musical',\n 'Mystery',\n 'Romance',\n 'Sci-Fi',\n 'Short',\n 'Sport',\n 'Superhero',\n 'Thriller',\n 'War',\n 'Western'\n ];\n foreach($genres as $genre){\n $g = new \\App\\Genres();\n $g->name = $genre;\n $g->save();\n }\n\n echo 'Genres Seeded';\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('thanhvien')->insert([\n 'hoten' => 'Thuy Pham',\n 'ngaysinh' => '1998-01-17',\n 'gioitinh' => 'Female',\n 'sdt' => '0123456789',\n 'diachi' => 'Đà Nẵng',\n 'email' => 'thuypham@gmail.com',\n 'tendangnhap' => 'Thuy Pham',\n 'matkhau' => bcrypt('123456'),\n 'avatar' => 'default.png',\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n $this->eliminarTablas([\n 'carreras',\n 'rfits',\n 'usuarios',\n ]);\n\n $this->call(carrerasSeeder::class);\n $this->call(r_fitsSeeder::class);\n $this->call(usuariosSeeder::class);\n }", "public function run()\n {\n $faker=Faker::create();\n\n User::create([\n 'firstname' => 'admin',\n 'lastname' => 'ochola',\n 'admin' => '1',\n 'email' => 'admin@gmail.com',\n 'gender' => 'male',\n 'city' => 'nairobi',\n 'country' => 'kenya',\n 'password' => bcrypt('password'),\n ]);\n User::create([\n 'firstname' => 'kevin',\n 'lastname' => 'odhiambo',\n 'admin' => '0',\n 'email' => 'kevin@gmail.com',\n 'gender' => 'male',\n 'city' => 'nairobi',\n 'country' => 'kenya',\n 'password' => bcrypt('password'),\n ]);\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run() {\n Eloquent::unguard();\n\n $this->call('AccountsTableSeeder');\n $this->command->info('accounts table seeded!');\n \n $this->call('KeyringsTableSeeder');\n $this->command->info('keyrings table seeded!');\n }", "public function run()\n {\n\n\n\n\n $this->call(RoleTableSeeder::class);\n\n $this->command->info('Roles sample created successfully');\n\n\n $this->call(PermissionTableSeeder::class);\n\n $this->command->info('Permissions sample created successfully');\n\n $this->call(UserTableSeeder::class);\n\n $this->command->info('Users sample created successfully');\n\n\n $this->call(ProjectTableSeeder::class);\n\n $this->command->info('Projects sample created successfully');\n\n\n $this->call(TaskTableSeeder::class);\n\n $this->command->info('Tasks sample created successfully');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n $this->call([\n CgySeeder::class,\n //ProductSeeder::class,\n PaymentSeeder::class,\n ShippingSeeder::class,\n ]);\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('threads', function($table)\n\t\t{\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('board_id')->unsigned();\n\t\t\t$table->integer('post_id')->unsigned();\n\t\t\t$table->integer('user_id')->unsigned();\n\t\t\t$table->integer('latest_user_id')->unsigned();\n\t\t\t$table->integer('latest_post_id')->unsigned();\n\t\t\t$table->integer('post_count')->unsigned();\n\t\t\t$table->string('title'); \n\t\t\t\n\t\t\t$table->timestamps();\n\t\t\t$table->date('latest_post_at');\n\n\t\t\t$table->boolean('locked')->default(0);\n\t\t\t$table->boolean('stickied')->default(0);\n\t\t});\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n //delete users table records\n DB::table('users')->delete();\n //insert some dummy records\n DB::table('users')->insert(array(\n array('name'=>'Mario','email'=>'mario@mario.com','password'=>Hash::make('123456'),'rol'=>'alumne'),\n array('name'=>'Admin','email'=>'admin@admin.com','password'=>Hash::make('123456'),'rol'=>'professor'),\n ));\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->command->info('User table seeded!');\n\t\t$this->call('PertaniansTableSeeder');\n\t\t$this->command->info('Pertanian table seeded!');\n\t\t$this->call('PeternakansTableSeeder');\n\t\t$this->command->info('Peternakan table seeded!');\n\t\t$this->call('TicsTableSeeder');\n\t\t$this->command->info('TIC table seeded!');\n\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n $this->call([\n UserSeeder::class,\n ProfileSeeder::class,\n AdminSeeder::class\n ]);\n\n DB::statement(\"ALTER SEQUENCE users_id_seq RESTART WITH 1001\");\n DB::statement(\"ALTER SEQUENCE profiles_id_seq RESTART WITH 1001\");\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create(['username' => 'penjaminan', 'email' => 'admin@admin.com', 'password' => Hash::make('pdfvgf')]);\n $this->call(TahapanProyekDropdownSeeder::class);\n $this->call(JenisInfrastrukturSeeder::class);\n $this->call(DropdownSeeder::class);\n $this->call(ChecklistSeeder::class);\n }", "public function run()\n {\n $this->call(PermissionsTable::class);\n $this->call(MarcaTableSeeder::class);\n $this->call(TipoDuenoTableSeeder::class);\n //$this->call(DuenoTableSeeder::class);\n //$this->call(VehiculosTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n //$this->call(RegistroTableSeeder::class);\n\n }" ]
[ "0.69315296", "0.69084895", "0.6746124", "0.673231", "0.67109936", "0.66935515", "0.6673207", "0.66370326", "0.6618804", "0.661742", "0.6605316", "0.65605783", "0.65578973", "0.65321714", "0.6513112", "0.6507098", "0.6482512", "0.6465836", "0.6436942", "0.6404248", "0.6400211", "0.6394528", "0.6390676", "0.63810635", "0.63771975", "0.637143", "0.63469154", "0.63465613", "0.63459074", "0.633441", "0.6327269", "0.6325289", "0.6324858", "0.631999", "0.6318929", "0.63143927", "0.6313428", "0.63098943", "0.6308423", "0.62913245", "0.62903416", "0.6288855", "0.62887573", "0.6285719", "0.628348", "0.62820655", "0.6281101", "0.6277813", "0.62772363", "0.62768966", "0.62709093", "0.6266334", "0.62651175", "0.6263274", "0.62605846", "0.62554127", "0.6255114", "0.6254971", "0.6245414", "0.6243422", "0.62408197", "0.6238711", "0.6237833", "0.62371725", "0.62348545", "0.62302476", "0.6228228", "0.6227648", "0.62265277", "0.622648", "0.6225544", "0.6225169", "0.6225169", "0.6223877", "0.62228584", "0.6219205", "0.6210072", "0.62097466", "0.6209301", "0.62090576", "0.6206162", "0.6198718", "0.6197625", "0.61951256", "0.6194468", "0.6193884", "0.619275", "0.619185", "0.61917233", "0.6188176", "0.61878", "0.61877966", "0.61861503", "0.61842144", "0.6183226", "0.61830074", "0.6180959", "0.61781174", "0.6176729", "0.61764383", "0.61734825" ]
0.0
-1
/ this is to be retrieved by implementation (hosting customer) when SaaS public $menu = array( array('label'=>'Home', 'url'=>array('supplier/routes')), ); Used to retrieve the users with granted access to this controller's actions.
public function getValidUsers() { $result = array(); $logins = Login::model()->findAll("LoginRoleId=:role OR LoginRoleId=:admin OR LoginRoleId=:sadmin", array(":role"=>LoginRole::SUPPLIER, ':admin' => LoginRole::ADMINISTRATOR, ":sadmin" => LoginRole::SUPER_ADMIN)); foreach ($logins as $login) { $result[] = $login->UserName; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMenuItems() {\n\n $url = $this->urlHelper;\n $items = [];\n\n //Links Visible always to everyone logged in or not.\n //default Home page - no login required. \n\n /* $items[] = [\n 'id' => 'home',\n 'label' => 'Home',\n 'link' => $url('home')\n ]; */\n\n //add links here for pages that will be visible for all users logged-in or not.\n //you must adjust User\\Module.php (~line 85) onDispatch method to ignore calls for \n //the associated Controller and action or you will end up with an infinite loop.\n /*\n $items[] = [\n 'id' => 'about',\n 'label' => 'About',\n 'link' => $url('about')\n ];\n */\n\n $user = $this->authManager->getLoggedInUser();\n\n //BEGIN Authentication/Rendering Logic\n // Display \"Login\" menu item for not authorized user only. On the other hand,\n // display \"Admin\" and \"Logout\" menu items only for authorized users and any other links \n // that should be visible by logged-in users.\n if (!$user) {\n\n $items[] = [\n 'id' => 'login',\n 'label' => 'Sign in',\n 'link' => $url('login'),\n 'float' => 'right'\n ];\n } else {\n\n //render Customers link for all users with sales_attr_id value in users table\n if (!empty($user->getSales_attr_id())) {\n $items[] = [\n 'id' => 'customers',\n 'label' => 'Customers',\n 'data-ffm-salesperson' => $user->getFullName(),\n 'float' => 'static',\n 'link' => $url('customer', ['action' => 'view', 'id' => $user->getSales_attr_id()])\n ];\n }\n //only display admin drop down for admin users.\n $isAdmin = $this->authManager->isAdmin();\n if ($isAdmin) {\n $items[] = [\n 'id' => 'admin',\n 'label' => '<i class=\"ion-gear-a\"></i>',\n 'float' => 'right',\n 'dropdown' => [\n [\n 'id' => 'users',\n 'label' => 'Manage Users',\n 'link' => $url('users')\n ]\n ]\n ];\n }\n\n $settingsDropDownManageAccount = [\n 'id' => 'manage_account',\n 'label' => 'Manage Account',\n 'link' => $url('users', ['action' => 'edit', 'id' => $user->getId()])\n ];\n\n $settingsDropDownViewAccount = [\n 'id' => 'view_account',\n 'label' => 'View Account',\n 'link' => $url('application', ['action' => 'settings'])\n ];\n\n $settingsDropDownLogout = [\n 'id' => 'logout',\n 'label' => 'Logout',\n 'link' => $url('logout')\n ];\n\n $settingsDropDown = [];\n\n //only add the Manage Account link for Admins.\n if ($isAdmin) {\n $settingsDropDown[] = $settingsDropDownManageAccount;\n }\n\n $settingsDropDown[] = $settingsDropDownViewAccount;\n\n $settingsDropDown[] = $settingsDropDownLogout;\n\n $items[] = [\n 'id' => 'settings',\n 'label' => '<i class=\"ion-person\"></i>' . $user->getUsername(),\n 'float' => 'right',\n 'dropdown' => $settingsDropDown\n ];\n\n $loggedInItems = $this->getLoggedInItems();\n\n if ($loggedInItems)\n array_merge($items, $loggedInItems);\n\n // add items to right of settings in top right corner only for logged-in users here\n //Show Salespeople link only to Admin users\n if ($isAdmin) {\n\n $items[] = [\n 'id' => 'salespeople',\n 'label' => 'Salespeople',\n 'float' => 'static',\n 'link' => $url('salespeople', ['action' => 'index']),\n ];\n }\n }\n\n return $items;\n }", "function mainMenu() \r\n\t\t{\r\n\t\t\tif($this->RequestAction('/external_functions/verifiedAccess/'.$this->Auth->user('id').\"/1/mainMenu\") == true)\r\n\t\t\t{\r\n\t\t\t\t$this->set('title_for_layout', 'Fondos por rendir :: Menu Principal');\r\n\t\t\t\t$this->set('userAdmin', $this->Auth->user('admin'));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->Session->setFlash('No tienes permisos para ver esta pagina, consulta con el administrador del sistema.', 'flash_alert');\r\n\t\t\t\t$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));\r\n\t\t\t}\r\n\t\t}", "public function index()\n {\n $data = $this->user->getUserData();\n $data['title'] = 'Menu Management';\n $data['menu'] = $this->menu->getMenuByUser($data['role_id']);\n $data['submenu'] = $this->menu->getAllSubmenu();\n $this->template->load('menu/menuManagement', $data, 'menu/JS_menu');\n }", "public static function defaultList() {\n\t\t// Super User\n\t\t$super_user = false;\n\n\t\tif( auth()->check() )\n\t\t\t$super_user = auth()->user()->username == \\Constant::SUPER_USER || auth()->user()->username == 'aldrin';\n\t\t\t#$super_user = true;\n\n\t\t// Menu Container\n\t\t$menu = [];\n\n\t\t// Dashboard\n\t\t$menu['dashboard'] = [\n\t\t\t'url' \t=> URL::to('/'),\n\t\t\t'title'\t=> 'Dashboard',\n\t\t\t'icon'\t=>'fa fa-dashboard fa-lg',\n\t\t];\n\n\t\t// Consulting\n\t\t$menu['consulting'] = [\n\t\t\t'url'\t\t=> '',\n\t\t\t'title'\t\t=> 'Consulting',\n\t\t\t'icon'\t\t=>'fa fa-coffee fa-lg',\n\t\t\t'sub_menu'\t=> []\n\t\t];\n\n\t\t// Main Category Group\n\t\t/*$menu['consulting']['sub_menu']['main_category_group'] = array(\n\t\t\t\t'url' \t=> URL::to('main_category_group'),\n\t\t\t\t'title' => 'Category Groups',\n\t\t);*/\n\n\t\t// Company Group\n\t\t$menu['consulting']['sub_menu']['company_group'] = [\n\t\t\t'url' \t=> URL::to('company_group'),\n\t\t\t'title'\t=> 'Company Groups',\n\t\t];\n\n\t\t// Company\n\t\t$menu['consulting']['sub_menu']['company'] = [\n\t\t\t'url' \t=> URL::to('company'),\n\t\t\t'title'\t=> 'Companies',\n\t\t];\n\n\t\t// Company Branches\n\t\t$menu['consulting']['sub_menu']['company_branch'] = [\n\t\t\t\t'url' \t=> URL::to('company_branch'),\n\t\t\t\t'title'\t=> 'Company Branches',\n\t\t];\n\n\t\t// Announcement\n\t\t/*$menu['consulting']['sub_menu']['announcement'] = array(\n\t\t\t\t'url' => URL::to('announcement'),\n\t\t\t\t'title' => 'Announcement',\n\t\t);*/\n\n\t\t#################### CATEGORY ####################\n\t\t$menu['category'] = [\n\t\t\t'url'\t\t=> '',\n\t\t\t'title'\t\t=> 'Category',\n\t\t\t'icon'\t\t=>'fa fa-bars fa-lg',\n\t\t\t'sub_menu'\t=> []\n\t\t];\n\n\t\t// Main Category\n\t\t$menu['category']['sub_menu']['main_category'] = [\n\t\t\t'url' \t=> URL::to('main_category'),\n\t\t\t'title'\t=> 'Categories',\n\t\t];\n\n\t\t// Sub Category\n\t\t$menu['category']['sub_menu']['category'] = [\n\t\t\t'url' \t=> URL::to('category'),\n\t\t\t'title'\t=> 'Sub Categories',\n\t\t];\n\n\t\t// Manufacturer\n\t\t$menu['category']['sub_menu']['manufacturer'] = [\n\t\t\t'url' \t=> URL::to('manufacturer'),\n\t\t\t'title'\t=> 'Brands',\n\t\t];\n\n\t\t// Merchants\n\t\t$menu['category']['sub_menu']['vendor'] = [\n\t\t\t'url' \t=> URL::to('vendor'),\n\t\t\t'title'\t=> 'Merchants',\n\t\t];\n\n\t\t// Payment\n\t\t/*$menu['category']['sub_menu']['payment'] = array(\n\t\t\t\t'url' \t=> URL::to('payment'),\n\t\t\t\t'title' => 'Payments',\n\t\t);*/\n\t\t\n\t\t// Merchant Branch\n\t\t/*$menu['category']['sub_menu']['vendor_branch'] = array(\n\t\t\t\t'url' \t=> URL::to('vendor_branch'),\n\t\t\t\t'title' => 'Merchant Branches',\n\t\t);*/\n\t\t\n\t\t// Merchant Product\n\t\t/*$menu['category']['sub_menu']['merchant_product'] = array(\n\t\t\t\t'url' \t=> URL::to('merchant_product'),\n\t\t\t\t'title' => 'Merchant Product Inventory',\n\t\t);*/\t\n\n\t\t// Product\n\t\t$menu['category']['sub_menu']['product'] = [\n\t\t\t'url' \t=> URL::to('product'),\n\t\t\t'title'\t=> 'Products',\n\t\t];\n\n\t\t// Group\n\t\t$menu['category']['sub_menu']['group'] = [\n\t\t\t'url' \t=> URL::to('group'),\n\t\t\t'title'\t=> 'Product Groups',\n\t\t];\n\n\t\t// Upload\n\t\t$menu['category']['sub_menu']['upload'] = [\n\t\t\t'url' \t=> URL::to('upload'),\n\t\t\t'title'\t=> 'Data Uploads',\n\t\t];\n\n\t\t// Upload\n\t\t$menu['category']['sub_menu']['upload/images/s3'] = [\n\t\t\t'url' \t=> URL::to('upload/images/s3'),\n\t\t\t'title'\t=> 'Images Uploads',\n\t\t];\n\n\t\t// Featured Category\n\t\t$menu['category']['sub_menu']['featured_category'] = [\n\t\t\t'url' \t=> URL::to('featured_category'),\n\t\t\t'title'\t=> 'Featured Categories',\n\t\t];\n\n\t\t// Company Featured Category\n\t\t$menu['category']['sub_menu']['company_featured_category'] = [\n\t\t\t'url' \t=> URL::to('company_featured_category'),\n\t\t\t'title'\t=> 'Company Featured Categories',\n\t\t];\n\n\t\t// Export\n\t\t$menu['category']['sub_menu']['export'] = [\n\t\t\t'url' \t=> URL::to('export'),\n\t\t\t'title'\t=> 'Export',\n\t\t];\n\n\t\t// Company Featured Category\n\t\t/*$menu['category']['sub_menu']['vendor_list'] = array(\n\t\t\t\t'url' \t=> URL::to('vendor_list'),\n\t\t\t\t'title' => 'Merchant List',\n\t\t);*/\n\n\t\t// Supply Chain\n\t\t$menu['supply_chain'] = [\n\t\t\t'url' \t\t=> '',\n\t\t\t'title'\t\t=> 'Supply Chain',\n\t\t\t'icon'\t\t=>'fa fa-chain fa-lg',\n\t\t\t'sub_menu'\t=> []\n\t\t];\n\n\t\t// Size\n\t\t$menu['supply_chain']['sub_menu']['size'] = [\n\t\t\t'url' \t=> URL::to('size'),\n\t\t\t'title'\t=> 'Product Classifications',\n\t\t];\n\n\t\t// Size Delivery\n\t\t$menu['supply_chain']['sub_menu']['size_delivery'] = [\n\t\t\t'url' \t=> URL::to('size_delivery'),\n\t\t\t'title'\t=> 'Product Deliveries',\n\t\t];\n\n\t\t// Volume Matrix\n\t\t$menu['supply_chain']['sub_menu']['volume_matrix'] = [\n\t\t\t'url' \t=> URL::to('volume_matrix'),\n\t\t\t'title'\t=> 'Volume Matrix',\n\t\t];\n\n\t\t// Cities\n\t\t$menu['supply_chain']['sub_menu']['regions'] = [\n\t\t\t'url' \t=> URL::to('regions'),\n\t\t\t'title'\t=> 'Regions',\n\t\t];\n\n\t\t$menu['supply_chain']['sub_menu']['cities'] = [\n\t\t\t'url' \t=> URL::to('cities'),\n\t\t\t'title'\t=> 'Cities',\n\t\t];\n\t\t// Blog\n\t\t/*$menu['blog'] = array(\n\t\t\t\t'url' \t=> '',\n\t\t\t\t'title' => 'Blog',\n\t\t\t\t'icon'\t=>'fa fa-inbox fa-lg',\n\t\t\t\t'sub_menu' => []\n\t\t);\n\t\t\n\t\t// Post\n\t\t$menu['blog']['sub_menu']['blog_post'] = array(\n\t\t\t\t'url' => URL::to('blog_post'),\n\t\t\t\t'title' => 'Posts',\n\t\t);\n\t\t// comment\n\t\t$menu['blog']['sub_menu']['blog_comment'] = array(\n\t\t\t\t'url' => URL::to('blog_comment'),\n\t\t\t\t'title' => 'Comments',\n\t\t);\n\t\t// Category\n\t\t$menu['blog']['sub_menu']['blog_category'] = array(\n\t\t\t\t'url' => URL::to('blog_category'),\n\t\t\t\t'title' => 'Categories',\n\t\t);*/\n\t\t\n\t\t\n\t\t#################### Merchant Approvals - Bebe ####################\n\t\t/*$menu['approvals'] = array(\n\t\t\t\t'url' \t=> '',\n\t\t\t\t'title' => 'Approvals',\n\t\t\t\t'icon'\t=>'fa fa-gavel fa-lg',\n\t\t\t\t'sub_menu' => []\n\t\t);\n\n\t\t$menu['approvals']['sub_menu']['merchant_product_new'] = array(\n\t\t\t\t'url' \t=> URL::to('merchant_product_new'),\n\t\t\t\t'title' => 'New Product Proposals',\n\t\t);\n\n\t\t$menu['approvals']['sub_menu']['product_quantity'] = array(\n\t\t\t\t'url' \t=> URL::to('product_quantity'),\n\t\t\t\t'title' => 'Product Inventory Updates',\n\t\t);\n\n\t\t$menu['approvals']['sub_menu']['merchant_product_price_history'] = array(\n\t\t\t\t'url' \t=> URL::to('merchant_product_price_history'),\n\t\t\t\t'title' => 'Product Prices Updates',\n\t\t);\n\t\t\n\t\t$menu['approvals']['sub_menu']['changes_batch'] = array(\n\t\t\t\t'url' \t=> URL::to('changes_batch'),\n\t\t\t\t'title' => 'Changes Log',\n\t\t);\n\n\t\t\n\t\t// System\n\t\t$menu['system'] = array(\n\t\t\t\t'url' \t=> '',\n\t\t\t\t'title' => 'System',\n\t\t\t\t'icon'\t=>'fa fa-gear fa-lg',\n\t\t\t\t'sub_menu' => []\n\t\t);\n\t\t\n\t\t// User\n\t\t$menu['system']['sub_menu']['user'] = array(\n\t\t\t\t'url' \t=> URL::to('user'),\n\t\t\t\t'title' => 'System User',\n\t\t);\n\t\t\n\t\tif( $super_user ) {\n\t\t\t// User Group\n\t\t\t$menu['system']['sub_menu']['user_group'] = array(\n\t\t\t\t\t'url' \t=> URL::to('user_group'),\n\t\t\t\t\t'title' => 'System User Group',\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Currency system\n\t\t$menu['system']['sub_menu']['currency'] = array(\n\t\t\t\t'url' \t=> URL::to('currency'),\n\t\t\t\t'title' => 'Currency',\n\t\t);\n\t\t\n\t\t// Payment system\n\t\t$menu['system']['sub_menu']['payment'] = array(\n\t\t\t\t'url' \t=> URL::to('payment'),\n\t\t\t\t'title' => 'Payment',\n\t\t);\n\t\t\n\t\t\n\t\t// Company\n\t\t$menu['system']['sub_menu']['company'] = array(\n\t\t\t\t'url' \t=> URL::to('company'),\n\t\t\t\t'title' => 'Companies',\n\t\t);\n\t\t\n\t\t// City\n\t\t$menu['system']['sub_menu']['city'] = array(\n\t\t\t\t'url' \t=> URL::to('city'),\n\t\t\t\t'title' => 'Cities',\n\t\t);\t\t\n\t\t\n\t\t// Wallet\n\t\t$menu['system']['sub_menu']['wallet'] = array(\n\t\t\t\t'url' \t=> URL::to('wallet'),\n\t\t\t\t'title' => 'Wallets',\n\t\t);*/\n\t\t\t\t\n\t\t\n\t\t// Manage Permissions\n\t\t#dd(\\Permission::getAll(auth()->user()->INTERNAL_GROUP_id));\n\t\t/*foreach( $menu as $key1=>$row) {\n\t\t\t$ctr = 0;\n\t\t\tif( !empty($row['sub_menu']) ) {\n\t\t\t\tforeach( $row['sub_menu'] as $key2=>$sm ){\n\n\t\t\t\t\tif( ! \\Permission::check( $key2, 'read' ) && !$super_user) {\n\t\t\t\t\t\tunset( $menu[$key1]['sub_menu'][$key2]);\n\t\t\t\t\t\t$ctr++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $ctr == count($row['sub_menu']) )\n\t\t\t\t\tunset($menu[$key1]);\n\t\t\t}\n\t\t}*/\n\n\t\t// Return Menus\n\t\treturn $menu;\n\t}", "public static function core_menu(){\r\n\t\t$menu = array();\r\n\t\t$url = core\\general::create_url(['service','1','plugin','administrator','action','main','p','administrator','a','dashboard']);\r\n\t\tarray_push($menu,[$url, _('Dashboard')]);\r\n\t\t$url = core\\general::create_url(['service','1','plugin','administrator','action','main','p','administrator','a','plugins']);\r\n\t\tarray_push($menu,[$url, _('Plugins')]);\r\n\t\t$url = core\\general::create_url(['service','1','plugin','administrator','action','main','p','administrator','a','regandlang']);\r\n\t\tarray_push($menu,[$url, _('Regional and Languages')]);\r\n\t\t$url = core\\general::create_url(['service','1','plugin','administrator','action','main','p','administrator','a','basic_settings']);\r\n\t\tarray_push($menu,[$url, _('Basic Settings')]);\r\n\t\t$url = core\\general::create_url(['service','1','plugin','administrator','action','main','p','administrator','a','themes']);\r\n\t\tarray_push($menu,[$url, _('Apperance')]);\r\n\t\t$url = core\\general::create_url(['service','1','plugin','administrator','action','main','p','administrator','a','blocks']);\r\n\t\tarray_push($menu,[$url, _('Blocks')]);\r\n\t\t$ret = array();\r\n\t\tarray_push($ret, ['<span class=\"glyphicon glyphicon-tasks\" aria-hidden=\"true\"></span>' , _('Administrator')]);\r\n\t\tarray_push($ret,$menu);\r\n\t\treturn $ret;\r\n\t}", "public function getMenu();", "public function actionIndex()\n {\n $service = new MenuService();\n $menus = $service->getAuthorizedBackendMenusByUserId(Yii::$app->getUser()->getId());\n return $this->renderPartial('index', [\n \"menus\" => $menus,\n 'identity' => Yii::$app->getUser()->getIdentity(),\n ]);\n }", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "public function index() {\n\t\t//\n\t\t$user = Auth::user ();\n\t\t$amService = new AuthMenuService ();\n\t\t$menus = $amService->getAllMenus ( $user );\n\t\treturn view ( \"systemsettings.menu\" )->withMenus ( $menus );\n\t}", "public function menuConfig() {}", "public function menuConfig() {}", "function getMenuItems()\n {\n $this->menuitem(\"xp\", \"\", \"main\", array(\"xp.story\", \"admin\"));\n $this->menuitem(\"stories\", dispatch_url(\"xp.story\", \"admin\"), \"xp\", array(\"xp.story\", \"admin\"));\n }", "public static function menu()\n {\n if (Auth::check()) {\n if (Auth::user()->admin) {\n return [\n 'dashboard' => [\n 'icon' => 'home',\n 'route_name' => 'admin',\n 'params' => [\n 'layout' => 'side-menu'\n ],\n 'title' => 'Dashboard'\n ],\n 'teams' => [\n 'icon' => 'star',\n 'route_name' => 'admin.teams',\n 'params' => [\n 'layout' => 'side-menu'\n ],\n 'title' => 'Teams'\n ],\n 'article' => [\n 'icon' => 'airplay',\n 'route_name' => 'admin.article',\n 'params' => [\n 'layout' => 'side-menu'\n ],\n 'title' => 'Artikel',\n 'extends' => [\n 'admin.article.create',\n 'admin.article.edit',\n 'admin.article.detail',\n ]\n ],\n\n 'devider',\n 'soal' => [\n 'icon' => 'book-open',\n 'route_name' => 'admin.question.category',\n 'params' => null,\n 'title' => 'Soal',\n 'extends' => [\n 'admin.question.category.create',\n 'admin.question.category.edit',\n 'admin.question',\n 'admin.question.create',\n 'admin.question.edit',\n 'admin.question.answer',\n 'admin.question.edit',\n 'admin.question.result',\n ]\n ],\n\n 'devider',\n 'users' => [\n 'icon' => 'users',\n 'title' => 'Users',\n 'route_name' => 'admin.user',\n 'params' => null,\n 'extends' => [\n 'admin.user.show',\n 'admin.user.create',\n 'admin.user.edit',\n ],\n ],\n 'kontak' => [\n 'icon' => 'phone',\n 'route_name' => 'admin.contact',\n 'params' => [\n 'layout' => 'side-menu'\n ],\n 'title' => 'Kontak'\n ],\n ];\n } else {\n return [\n 'dashboard' => [\n 'icon' => 'home',\n 'route_name' => 'member',\n 'params' => null,\n 'title' => 'Dashboard'\n ],\n 'test' => [\n 'icon' => 'file-text',\n 'title' => 'Test',\n 'params' => null,\n 'route_name' => 'member.test',\n 'extends' => [\n 'member.test.start',\n ],\n ],\n 'devider',\n 'riwayat' => [\n 'icon' => 'file',\n 'route_name' => 'member.history',\n 'params' => null,\n 'title' => 'Riwayat',\n 'extends' => [\n 'member.history.test',\n ],\n\n ],\n ];\n }\n }\n return [];\n }", "public function getManageMenu(){\n $menu_content = array();\n $index_admin = $this->createUrl('admin/index');\n $list_admin = $this->createUrl('admin/list');\n $create_admin = $this->createUrl('admin/create');\n $manage_admin = $this->createUrl('admin/admin');\n $backup_info = $this->createUrl('backup/BackupToExel');\n $update_sites = $this->createUrl('site/update');\n $view_sites = $this->createUrl('site/view');\n\n if (Admin::model()->isSuperAdmin()) {\n $menu_content = array( \n array('label'=>Yii::t('common','List Students'), 'url'=>array('index')),\n array('label'=>Yii::t('common','Create Student'), 'url'=>array('create')),\n// array('label'=>Yii::t('common','Update Student'), 'url'=>array('Update')),\n// array('label'=>Yii::t('common','Delete Student'), 'url'=>array('Delete')),\n// array('label'=>Yii::t('common','Manage Students'), 'url'=>array('admin')),\n array('label'=>Yii::t('common','Backup StudentInfo'), 'url'=>$backup_info),\n array('label'=>'------------------------------'),\n\n array('label'=>Yii::t('common','Admins Home'), 'url'=>$index_admin),\n array('label'=>Yii::t('common','List Admins'), 'url'=>$list_admin),\n array('label'=>Yii::t('common','Create Admin'), 'url'=>$create_admin),\n array('label'=>Yii::t('common','Manage Admins'), 'url'=>$manage_admin),\n array('label'=>'------------------------------'),\n \n array('label'=>Yii::t('common','Update Site Desc'), 'url'=>$update_sites),\n array('label'=>Yii::t('common','View Site Desc'), 'url'=>$view_sites),\n ); \n }elseif (Admin::model()->isWAdmin()) {\n $menu_content = array(\n array('label'=>Yii::t('common','List Students'), 'url'=>array('index')),\n array('label'=>Yii::t('common','Create Student'), 'url'=>array('create')),\n// array('label'=>Yii::t('common','Manage Students'), 'url'=>array('admin')),\n );\n } else {\n $menu_content = array(\n array('label'=>Yii::t('common','List Students'), 'url'=>array('index')),\n ); \n }\n\n return $menu_content;\n }", "public function index()\n {\n $providers = TableRegistry::get('Providers')->find('ownedBy', ['user_id' => $this->Auth->user('id')]);\n $this->set(compact('providers'));\n $this->set('_serialize', ['providers']);\n\n // Should display all providers and provider offices for a given user\n $providerOffices = TableRegistry::get('ProviderOffices')->find('ownedBy', ['user_id' => $this->Auth->user('id')])->contain(['Countries']);\n $this->set(compact('providerOffices'));\n $this->set('_serialize', ['providerOffices']);\n\n\n $ProviderMenu = $this->MenuBuilder->BuildProviderUserMenu('provider_authorizations', $this->Auth->user('id'));\n $this->set('MenuItems', $ProviderMenu);\n //$this->render('index');\n }", "public function index()\n {\n\n// $is = $this->isRolePermission(\"all\");\n// if (!$is) {\n// return redirect(url('admin/Error/NotPermission'));\n// }\n\n $menuList = $this->menuSetting->getOneMenu();\n// dd($menuList);\n return view('Admin.Menu.menuSetting')->with('menuList',$menuList);\n }", "public static function get()\n {\n if(Session::get('sivoz_auth') !== false){\n return Menu::all();\n }else{\n return Menu::login();\n } \n }", "public function actionIndex() {\n $model = new Menu();\n \n $authItemModel = new AuthItemModel();\n $authItemModel->type = Item::TYPE_PERMISSION;\n $availableRoutes = $authItemModel->getItems()['available'];\n $routeOptions = [];\n foreach ($availableRoutes as $key => $val) {\n $routeOptions[$key] = $key;\n }\n \n if (\\Yii::$app->request->get(\"id\")) {\n $model = $this->findModel(\\Yii::$app->request->get(\"id\"));\n }\n \n if ($model->load(\\Yii::$app->request->post())) {\n $model->beforeSave($model->isNewRecord);\n if ($model->save()) {\n \\Yii::$app->session->setFlash('msg_success', \\Yii::t('akhdanihr', 'Data berhasil disimpan!'));\n \n return $this->redirect(['.']);\n } else {\n \\Yii::error($model->getErrors());\n \\Yii::$app->session->setFlash('msg_error', \\Yii::t('akhdanihr', 'Terjadi kesalahan saat menyimpan data!'));\n }\n }\n \n $parent = Menu::find()->parent()->all();\n \n return $this->render('index', [\n 'menu' => $model->allTree(),\n 'model' => $model,\n 'routeOptionsData' => $routeOptions,\n 'parentOptionsData' => ArrayHelper::map($parent, 'id', 'label'),\n ]);\n }", "public function menuItems()\n\t{\n\t\treturn array(\n array('label'=>$this->labelMenu!==null?$this->labelMenu:Yii::t('app','Generator'), 'icon'=>'fa fa-code', 'url'=>'#','items'=>$this->getMyselfMenu(),'visible'=>Yii::app()->getModule('users')->check('root')),\n );\n\t}", "public function set_menu_list()\r\n {\r\n $controllerData = $this->setUrlController;\r\n $controllerData = urldecode($controllerData);\r\n $getUrlSegment = explode('/', $controllerData);\r\n $controllerSet = isset($_GET['page']) && trim($_GET['page']) !== '' ?\r\n $_GET['page'] : $this->config['controller_default'];\r\n\r\n $methodSet = isset($_GET['method']) && trim($_GET['method']) !== '' ?\r\n $_GET['method'] : $this->config['method_default'];\r\n\r\n $realControllerName = ucfirst($controllerSet);\r\n $realControllerName = str_replace('-', '_', $realControllerName);\r\n\r\n include $this->bootstrap->base_config_dir . 'Routes.php';\r\n\r\n //add menu by foreach all menu list item array\r\n // list main menu plugin\r\n $xCounterMenu = 0;\r\n foreach ($menu_list as $keyItem => $valueItem) {\r\n if ($valueItem['menu_item']['page_slug'] !== $controllerSet) {\r\n add_menu_page(\r\n $valueItem['menu_item']['page_title'], // Title of the page\r\n $valueItem['menu_item']['page_menu_text'], // Text to show on the menu link\r\n $valueItem['menu_item']['page_capability'], // Capability requirement to see the link\r\n $valueItem['menu_item']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $valueItem['menu_item']['page_render'],\r\n $valueItem['menu_item']['page_menu_icon'], // icon plugin\r\n $valueItem['menu_item']['page_menu_position'] // item position\r\n );\r\n }\r\n $xCounterMenu++;\r\n }\r\n\r\n // list sub main menu plugin\r\n $yCounterMenu = 0;\r\n foreach ($menu_list_sub as $keyItem => $valueItem) {\r\n\r\n if ($valueItem['menu_item']['page_slug'] !== $controllerSet) {\r\n add_submenu_page(\r\n $valueItem['menu_item']['page_slug_current'], // slug current menu\r\n $valueItem['menu_item']['page_title'], // Title of the page\r\n $valueItem['menu_item']['page_menu_text'], // Text to show on the menu link\r\n $valueItem['menu_item']['page_capability'], // Capability requirement to see the link\r\n $valueItem['menu_item']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $valueItem['menu_item']['page_render'],\r\n $valueItem['menu_item']['page_menu_position'] // item position\r\n );\r\n }else{\r\n add_submenu_page(\r\n $_SESSION['controller_data_sub']['page_slug_current'], // slug current menu\r\n $_SESSION['controller_data_sub']['page_title'], // Title of the page\r\n $_SESSION['controller_data_sub']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_sub']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_sub']['page_slug'], // The 'slug' - file to display when clicking the link,\r\n $_SESSION['controller_data_sub']['page_render'], // render\r\n $_SESSION['controller_data_sub']['page_menu_position'] // item position\r\n );\r\n }\r\n \r\n $yCounterMenu++;\r\n }\r\n }", "function statsMenu() \r\n\t\t{\r\n\t\t\tif($this->RequestAction('/external_functions/verifiedAccess/'.$this->Auth->user('id').\"/1/statsMenu\") == true)\r\n\t\t\t{\r\n\t\t\t\t$this->set('title_for_layout', 'Fondos por rendir :: Informes y estadisticas');\r\n\t\t\t\t$this->set('userAdmin', $this->Auth->user('admin'));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->Session->setFlash('No tienes permisos para ver esta pagina, consulta con el administrador del sistema.', 'flash_alert');\r\n\t\t\t\t$this->redirect(array('controller' => 'dashboard', 'action' => 'index'));\r\n\t\t\t}\t\r\n\t\t}", "protected function menus()\n {\n\n }", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "public function index()\n {\n return $this->menu->all();\n }", "public function getIndexMenu(){\n $menu_content = array();\n $index_admin = $this->createUrl('admin/index');\n $list_admin = $this->createUrl('admin/list');\n $create_admin = $this->createUrl('admin/create');\n $manage_admin = $this->createUrl('admin/admin');\n $backup_info = $this->createUrl('backup/BackupToExel');\n $update_sites = $this->createUrl('site/update');\n $view_sites = $this->createUrl('site/view');\n\n if (Admin::model()->isSuperAdmin()) {\n $menu_content = array( \n// array('label'=>Yii::t('common','List Students'), 'url'=>array('index')),\n array('label'=>Yii::t('common','Create Student'), 'url'=>array('create')),\n array('label'=>Yii::t('common','Backup StudentInfo'), 'url'=>$backup_info),\n// array('label'=>'Update Admin', 'url'=>array('Update')),\n// array('label'=>'Delete Admin', 'url'=>array('Delete')),\n array('label'=>Yii::t('common','Manage Students'), 'url'=>array('admin')),\n array('label'=>'------------------------------'),\n\n array('label'=>Yii::t('common','Admins Home'), 'url'=>$index_admin),\n array('label'=>Yii::t('common','List Admins'), 'url'=>$list_admin),\n array('label'=>Yii::t('common','Create Admin'), 'url'=>$create_admin),\n array('label'=>Yii::t('common','Manage Admins'), 'url'=>$manage_admin),\n array('label'=>'------------------------------'),\n \n array('label'=>Yii::t('common','Update Site Desc'), 'url'=>$update_sites),\n array('label'=>Yii::t('common','View Site Desc'), 'url'=>$view_sites),\n ); \n }elseif (Admin::model()->isWAdmin()) {\n $menu_content = array(\n// array('label'=>Yii::t('common','List Students'), 'url'=>array('index')),\n array('label'=>Yii::t('common','Create Student'), 'url'=>array('create')),\n// array('label'=>Yii::t('common','Update Student'), 'url'=>array('admin')),\n// array('label'=>Yii::t('common','Delete Student'), 'url'=>array('Delete')),\n array('label'=>Yii::t('common','Manage Students'), 'url'=>array('admin')),\n );\n } else {\n $menu_content = array(\n array('label'=>Yii::t('common','Manage Students'), 'url'=>array('admin')),\n ); \n }\n\n return $menu_content;\n }", "protected function makeActionMenu() {}", "public function getMenu ()\n {\n # Monto a opção de escolha dos sistemas do Usuario\n try {\n $sess = Session::getLiveSession('sisicmbio','USER');\n SIALException::ThrowsExceptionIfParamIsNull($sess, 'Não foi encontrada a sessão para o objeto informado');\n } catch (SIALException $excp) {\n # Não foi encontrada a Sessão para Este Sistema\n header(\"Location: \" . $this->bootstrap()->config()->get('app')->get('authSystem'));\n }\n\n\n $count = 0;\n foreach ($sess->sistemas as $sistema) {\n $arrSistema[$count]['href'] = $sistema['sqSistema'];\n $arrSistema[$count]['text'] = $sistema['sgSistema'];\n $count++;\n }\n\n $Menuoptions = array('__DIVIDER_VERTICAL__',\n 'Início' => array(),\n '__DIVIDER_VERTICAL__' ,\n 'Sistemas' => $arrSistema,\n '__DIVIDER_VERTICAL__');\n\n $menuParam = new \\stdClass;\n $menuParam->options = $Menuoptions;\n $menuParam->type = 'h';\n\n $this->_SIALApplication->set('menuH',$this->getSAF()->create('menu', $menuParam));\n\n $this->_SIALApplication->set('param',array('nome' => $sess->noPessoa,\n 'perfil' => $sess->noPerfil,\n 'uorg' => $sess->noUnidadeOrg,\n 'help' => 'HTML',\n 'sysId' => $sess->sqSistema,\n 'sysAlias' => isset($sess->sistemas[$sess->sqSistema]['sgSistema']) ? $sess->sistemas[$sess->sqSistema]['sgSistema'] : '',\n 'multiProfile' => count($sess->allProfile) > 1 ? TRUE : FALSE,\n 'inPerfilExterno' => $sess->inPerfilExterno,\n )\n );\n\n # Monto os Menus\n $menu = $sess->MenuExterno;\n\n $count = 0;\n $countSon = 0;\n $arrMenu = array();\n foreach ($menu as $menuCadastro) {\n $arrMenu[$count]['text'] = $menuCadastro['MenuPai']['noMenu'];\n $arrMenu[$count]['href'] = $menuCadastro['Acao'];\n\n if (isset($menuCadastro['MenuFilho'])) {\n $arrTmpFilho = current($menuCadastro['MenuFilho']);\n if (empty($arrTmpFilho['MenuFilho']['noMenu'])) {\n // continue;\n }\n\n foreach ($menuCadastro['MenuFilho'] as $menuFilho) {\n\n if (!isset($arrMenu[$count])) {\n continue;\n }\n\n if (isset($menuFilho['Acao']) && NULL !== $menuFilho['Acao']) {\n $arrMenu[$count][$countSon]['href'] = $menuFilho['Acao'];\n }\n\n if (!empty($menuFilho['MenuFilho']['noMenu'])) {\n $arrMenu[$count][$countSon]['text'] = $menuFilho['MenuFilho']['noMenu'];\n }\n\n $countSon++;\n }\n }\n $count++;\n }\n\n $menuParam = new \\stdClass;\n $menuParam->title = 'Menu';\n $menuParam->options = $arrMenu;\n $menuParam->type = 'v';\n\n $this->_SIALApplication->set('menuV',$this->getSAF()->create('menu', $menuParam));\n }", "function viewcMenu() {\n $user = Auth::customer()->user();\n if ($user) {\n if ($user->type == 1) {\n $controladoresTwo = array( \n array('name' => 'Pelfil ADmin', 'controller' => 'admclient\\ProfileAdminController@getIndex'),\n array('name' => 'Clientes', 'controller' => 'admclient\\UserController@getIndex'));\n } else {\n $controladoresTwo = array(\n array('name' => 'Mi Perfil', 'controller' => 'admclient/perfil'),\n array('name' => 'Mis Campañas', 'controller' => 'admclient/campanias'),\n array('name' => 'MIs Equipos', 'controller' => 'admclient/equipment'));\n }\n foreach ($controladoresTwo as $key => $value) {\n $valor[] = array('name' => $value['name'], 'controller' => $value['controller']);\n }\n }\n return $valor;\n }", "private function menu()\n {\n $data['links'] = ['create', 'read', 'update', 'delete'];\n\n return $this->view->render($data, 'home/menu');\n }", "protected function _menu()\n\t{\n\t\tif (ee()->view->disabled('ee_menu'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tee()->view->cp_main_menu = ee()->menu->generate_menu();\n\t}", "function index(){\n set_theme();\n A(\"Taskadmin/Fun\")->islogin();//检测是否登录\n $access = I('get.access','000000');\n A(\"Api/Fun\")->isAccess($access);//判断菜单权限\n $this->display();\n }", "public function mainAction() {\n return array(\n 'admins' => $this->get('snowcap_admin')->getAdmins(),\n );\n }", "public function index()\n {\n $data = $this->user->getUserData();\n $data['title'] = 'Submenu Management';\n $data['allMenu'] = $this->db->select('id', 'menu')->get('user_menu')->result_array();\n $data['menu'] = $this->menu->getMenuByUser($data['role_id']);\n $data['submenu'] = $this->menu->getAllSubmenu();\n $this->template->load('menu/submenuManagement', $data, 'menu/JS_submenu');\n }", "public function url()\n {\n return admin_base_path('auth/menu');\n }", "public function admin_menu(&$menu)\n {\n\n\t}", "public function index()\n {\n $data['MainMenus'] = MenuSystem::where('menu_system_part', 'AdminUser')->with('MainMenu')->first();\n $data['Menus'] = MenuSystem::ActiveMenu()->get();\n $data['PermisstionMenus'] = MenuSystem::whereNull('menu_system_main_menu')->with('SubMenu')->orderBy('menu_system_z_index')->get();\n $data['NamePrefixs'] = NamePrefix::where('name_prefix_status', 1)->get();\n $data['AdminUserGroups'] = AdminUserGroup::where('admin_user_group_status', 1)->get();\n $data['Genders'] = Gender::where('gender_status', 1)->get();\n if (Helper::CheckPermissionMenu('AdminUser', '1')) {\n return view('admin.AdminUser.admin_user', $data);\n } else {\n return redirect('admin/');\n }\n }", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function getMenuItems()\n {\n return $this->getService('config')->get()['menu']['admin'];\n }", "public function getMenu(){\n\t\t$maConfig= new Config();\n\t\t$data['style']=$maConfig->getCouleur();\n\t\t\n\t\t$monControle= new ControlleurAccess();\n\t\tif(isset($_SESSION['nom'])){\n\t\t\tif($monControle->estConnu($_SESSION['nom'])){\n\t\t\t\t//echo\"<PRE> COntroller : réservé \";print_r($data);echo\"</PRE>\";\n\t\t\t\t$data['nom']=$_SESSION['nom'];\n\t\t\t\t$menuPrivate= new _MenuPrivateView();\n\t\t\t\treturn $menuPrivate->show($data);\n\t\t\t}else{\n\t\t\t\t//echo\"<PRE> COntroller : libre \";print_r($data);echo\"</PRE>\";\n\t\t\t\t$menuFree= new\t_MenuFreeView();\n\t\t\t\treturn $menuFree->show($data);\n\t\t\t}\n\t\t}else{\n\t\t\t//echo\"<PRE> COntroller : libre \";print_r($data);echo\"</PRE>\";\n\t\t\t$menuFree= new\t_MenuFreeView();\n\t\t\treturn $menuFree->show($data);\n\t\t}\n\t}", "protected function registerMenu()\n {\n }", "public function run()\n {\n $menus = [\n\n /*\n * Admin\n */\n [\n 'name' => 'Заявки и запросы',\n 'link' => '/admin/',\n 'icon' => 'fa fa-lg fa-fw fa-check-square-o',\n 'cabinet_id' => 1,\n 'children' => [\n [\n 'name' => 'Заявки OSS',\n 'link' => '/admin/requisitions',\n 'icon' => 'fa fa-lg fa-fw fa-check-square-o',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Запросы SIB',\n 'link' => '/admin/be-partner-requests',\n 'icon' => 'fa fa-lg fa-fw fa-check-square-o',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n ],\n ],\n [\n 'name' => 'Пользователи',\n 'link' => '/admin/users',\n 'icon' => 'fa fa-lg fa-fw fa-users',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Online Smart System',\n 'link' => '/admin/oss',\n 'icon' => 'fa fa-lg fa-fw fa-database',\n 'cabinet_id' => 1,\n 'children' => [\n [\n 'name' => 'Абонементы',\n 'link' => '/admin/oss/subscriptions',\n 'icon' => 'fa fa-fw fa-ticket',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Смена куратора',\n 'link' => '/admin/oss/change-curator',\n 'icon' => 'fa fa-lg fa-fw fa-refresh',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Новости',\n 'link' => '/admin/oss/news',\n 'icon' => 'fa fa-lg fa-fw fa-newspaper-o',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Обучение',\n 'link' => '/admin/oss/attestation',\n 'icon' => 'fa fa-lg fa-fw fa-mortar-board',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'WakeUpERA',\n 'link' => '/admin/oss/wake-up-era',\n 'icon' => 'fa fa-lg fa-fw fa-sun-o',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n ],\n ],\n [\n 'name' => 'SIB',\n 'link' => '/admin/sib',\n 'icon' => 'fa fa-lg fa-fw fa-briefcase',\n 'cabinet_id' => 1,\n 'children' => [\n [\n 'name' => 'Новости компании',\n 'link' => '/admin/sib/news',\n 'icon' => 'fa fa-lg fa-fw fa-newspaper-o',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Линейка событий',\n 'link' => '/admin/sib/events',\n 'icon' => 'fa fa-lg fa-fw fa-calendar',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Промо и акции',\n 'link' => '/admin/sib/promos',\n 'icon' => 'fa fa-lg fa-fw fa-gift',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Документация',\n 'link' => '/admin/sib/documents',\n 'icon' => 'fa fa-lg fa-fw fa-file-pdf-o',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n ],\n ],\n [\n 'name' => 'Отчеты',\n 'link' => '/admin/reports',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [\n [\n 'name' => 'Финансовая аналитика',\n 'link' => '/admin/reports/financial-analytics',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Рейтинг чеков',\n 'link' => '/admin/reports/check-ratings',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'ФЦ за период',\n 'link' => '/admin/reports/fc-per-period',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'ФЦ по фин. периодам',\n 'link' => '/admin/reports/fc-per-fp',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'История ББС',\n 'link' => '/admin/reports/bbs-history',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'История выплат',\n 'link' => '/admin/reports/payment-history',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Баллы по бинару',\n 'link' => '/admin/reports/binary-points',\n 'icon' => 'fa fa-lg fa-fw fa-line-chart',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n ],\n ],\n [\n 'name' => 'Настройки',\n 'link' => '/admin/settings',\n 'icon' => 'fa fa-lg fa-fw fa-cog',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Журнал',\n 'link' => '/admin/journal',\n 'icon' => 'fa fa-lg fa-fw fa-newspaper-o',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n [\n 'name' => 'Тестирование',\n 'link' => '/admin/test',\n 'icon' => 'fa fa-lg fa-fw fa-cogs',\n 'cabinet_id' => 1,\n 'children' => [],\n ],\n\n\n /*\n * SIB\n */\n [\n 'name' => 'Финансы',\n 'link' => '/finance',\n 'icon' => 'fa fa-lg fa-fw fa-money',\n 'cabinet_id' => 2,\n 'children' => [\n [\n 'name' => 'Активность',\n 'link' => '/finance/activity',\n 'icon' => 'fa fa-lg fa-fw fa-clock-o',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Кошелёк',\n 'link' => '/finance/wallet',\n 'icon' => 'fa fa-lg fa-fw fa-credit-card',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Платежный календарь',\n 'link' => '/finance/payment-calendar',\n 'icon' => 'fa fa-lg fa-fw fa-calendar',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n ],\n ],\n [\n 'name' => 'Лично приглашенные',\n 'link' => '/personal-invited',\n 'icon' => 'fa fa-lg fa-fw fa-share-alt fa-rotate-90',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Классическая схема',\n 'link' => '/classic',\n 'icon' => 'fa fa-lg fa-fw fa-chain',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Я и моя команда',\n 'link' => '/me-and-my-team',\n 'icon' => 'fa fa-lg fa-fw fa-users',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Online Smart System',\n 'link' => '/oss',\n 'icon' => 'fa fa-lg fa-fw fa-database',\n 'cabinet_id' => 2,\n 'children' => [\n [\n 'name' => 'Новости OSS',\n 'link' => '/oss/info/news',\n 'icon' => 'fa fa-lg fa-fw fa-newspaper-o',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Обучение OSS',\n 'link' => '/oss/attestation',\n 'icon' => 'fa fa-lg fa-fw fa-mortar-board',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Абонементы OSS',\n 'link' => '/oss/products',\n 'icon' => 'fa fa-lg fa-fw fa-ticket',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'WakeUpERA',\n 'link' => '/oss/wake-up-era',\n 'icon' => 'fa fa-lg fa-fw fa-sun-o',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Соревнования OSS',\n 'link' => '/oss/competitions',\n 'icon' => 'fa fa-lg fa-fw fa-trophy',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Заявки OSS',\n 'link' => '/oss/requisitions',\n 'icon' => 'fa fa-lg fa-fw fa-check-square-o',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Команда OSS',\n 'link' => '/oss/teams',\n 'icon' => 'fa fa-lg fa-fw fa-users',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Кошелёк OSS',\n 'link' => '/oss/wallet',\n 'icon' => 'fa fa-lg fa-fw fa-credit-card',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n ],\n ],\n [\n 'name' => 'Образование',\n 'link' => '/education',\n 'icon' => 'fa fa-lg fa-fw fa-book',\n 'cabinet_id' => 2,\n 'children' => [\n [\n 'name' => 'Партнёрское',\n 'link' => '/education/partners',\n 'icon' => 'fa fa-lg fa-fw fa-briefcase',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Школа ERA',\n 'link' => '/education/school-era',\n 'icon' => 'fa fa-lg fa-fw fa-heart-o',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n ],\n ],\n [\n 'name' => 'Информация',\n 'link' => '/info',\n 'icon' => 'fa fa-lg fa-fw fa-info-circle',\n 'cabinet_id' => 2,\n 'children' => [\n [\n 'name' => 'Новости компании',\n 'link' => '/info/news',\n 'icon' => 'fa fa-lg fa-fw fa-newspaper-o',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Линейка событий',\n 'link' => '/info/events',\n 'icon' => 'fa fa-lg fa-fw fa-calendar',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Промо и акции',\n 'link' => '/info/promos',\n 'icon' => 'fa fa-lg fa-fw fa-gift',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n [\n 'name' => 'Документы (файлы)',\n 'link' => '/info/documents',\n 'icon' => 'fa fa-lg fa-fw fa-file-pdf-o',\n 'cabinet_id' => 2,\n 'children' => [],\n ],\n ],\n ],\n\n\n /*\n * OSS\n */\n [\n 'name' => 'Новости',\n 'link' => '/oss/info/news',\n 'icon' => 'fa fa-lg fa-fw fa-newspaper-o',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Обучение',\n 'link' => '/oss/attestation',\n 'icon' => 'fa fa-lg fa-fw fa-mortar-board',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Абонементы',\n 'link' => '/oss/products',\n 'icon' => 'fa fa-lg fa-fw fa-ticket',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'WakeUpEra',\n 'link' => '/oss/wake-up-era',\n 'icon' => 'fa fa-lg fa-fw fa-sun-o',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Соревнования',\n 'link' => '/oss/competitions',\n 'icon' => 'fa fa-lg fa-fw fa-trophy',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Заявки',\n 'link' => '/oss/requisitions',\n 'icon' => 'fa fa-lg fa-fw fa-check-square-o',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Команда',\n 'link' => '/oss/teams',\n 'icon' => 'fa fa-lg fa-fw fa-users',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Кошелёк',\n 'link' => '/oss/wallet',\n 'icon' => 'fa fa-lg fa-fw fa-credit-card',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n [\n 'name' => 'Информация',\n 'link' => '/oss/info',\n 'icon' => 'fa fa-lg fa-fw fa-info-circle',\n 'cabinet_id' => 3,\n 'children' => [\n// [\n// 'name' => 'Документация',\n// 'link' => '/oss/info/documents',\n// 'icon' => 'fa fa-lg fa-fw fa-file-pdf-o',\n// 'cabinet_id' => 3,\n// 'children' => [],\n// ],\n [\n 'name' => 'Контакты',\n 'link' => '/oss/info/contacts',\n 'icon' => 'fa fa-lg fa-fw fa-phone',\n 'cabinet_id' => 3,\n 'children' => [],\n ],\n ],\n ],\n\n /*\n * Common\n */\n [\n 'name' => 'Мой профиль',\n 'link' => '/profile',\n 'icon' => 'fa fa-lg fa-fw fa-cog',\n 'cabinet_id' => null,\n 'children' => [],\n ],\n ];\n\n foreach ($menus as $menu) {\n $this->menuCreate($menu);\n }\n }", "private function _showPublic(){\n $omenu = D('Menu');\n $amodules = $omenu->getModules();\n $this->assign('modules',$amodules);\n $amenu = $omenu->getMenuByModelName(MODULE_NAME);\n $asubNav = array();\n $amenus = array();\n $asubmenus = array();\n $temp = array();\n foreach($amenu as $v){\n if(!$this->_auth($v['name'])) continue;\n switch(count(explode(',',$v['level']))){\n case 2:\n $amenus[$v['id']] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'icon' => $v['icon']\n );\n if(MODULE_NAME == $v['name']){\n $anav[] = array(\n 'title' => $amodules[$v['pId']]['title'],\n 'URL' => $amodules[$v['pId']]['URL'],\n 'icon' => $amodules[$v['pId']]['icon']\n );\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n $amenus[$v['id']]['active'] = true;\n $icon = $v['icon'];\n }else{\n $amenus[$v['id']]['active'] = false;\n }\n break;\n case 3:\n $amenus[$v['pId']]['submenu'][$v['id']] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n if($foundSubNav){\n $stop = true;\n break;\n }else{\n $asubNav = array();\n }\n\n if($v['name'] == MODULE_NAME.'_'.ACTION_NAME){\n $bnatchNav || $bmatchNav = true;\n $foundSubNav = true;\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'class' => 'current'\n );\n $tcontentTitle = $v['title'];\n }else{\n $temp = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n );\n $bmatchNav && $bmatchNav = false;\n }\n break;\n case 4:\n if($foundSubNav && $stop) break;\n if($bmatchNav){\n $asubNav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n $tsubContentTitle = $tcontentTitle;\n }else{\n $asubNav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n //$tsubContentTitle = $temp['name'];\n if(MODULE_NAME.'_'.ACTION_NAME == $v['name']){\n $foundSubNav = true;\n $tsubContentTitle = $v['title'];\n $tcontentTitle = $temp['title'];\n $anav[] = array(\n 'title' => $temp['title'],\n 'URL' => $temp['URL']\n );\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'class' => 'current'\n );\n $asubNav[count($asubNav)-1]['active'] = true;\n }\n }\n break;\n }\n }\n $this->assign('menu',$amenus);\n $this->assign('nav',$anav);\n $this->assign('contentTitle',$tcontentTitle);\n $this->assign('subnav',$asubNav);\n $this->assign('subContentTitle',$tsubContentTitle);\n $this->assign('icon',$icon);\n }", "public function accesspermissionAction()\r\n {\r\n \r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $this->view->keyy=$key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n $this->view->menu_table=$temp_menu_arr;\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }", "public function getMenus() {}", "public function accesspermission1Action()\r\n {\r\n Zend_Loader::loadClass('Permission');\r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n //print \"<pre>\"; print_r($this->view->user_permission_table); print \"</pre>\";\r\n //print \"<pre>\"; print_r($temp_menu_arr); print \"</pre>\";\r\n $this->view->menu_table=$temp_menu_arr;\r\n\r\n //exit;\r\n /*$this->view->user_detail=$ob_User->getUserDetails($user_id);\r\n $ob_Credit\t= new Credit();\r\n $user_current_balance=$ob_Credit->get_current_balance($user_id);\r\n $this->view->user_expiary_date=$user_current_balance[$user_id]['expiary_date'];\r\n\r\n $subusers=$ob_User->get_sub_user_ids($user_id,0,0);\r\n $this->view->subusers_count=($subusers)?count(explode(',',$subusers)):0;*/\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n\r\n\r\n /*\r\n $ob_User\t= new User();\r\n $this->view->user_rows=$ob_User->get_user_list_rows(0,$quick_search,$arr_limit,$arr_order);\r\n $row_count=$ob_User->get_user_list_rows_count(0,$quick_search);\r\n $arr_rows=array('user_id','account_name','phone','email','nric');\r\n $this->view->page_sorting_images=$this->sessionAuth->get_sorting_html($arr_rows,$arr_order);\r\n\r\n $this->view->page_peginetion=$this->sessionAuth->get_peginetion($row_count,$page,$num_row);*/\r\n//print \"<pre>\"; print_r($aaaaaaa); print \"</pre>\"; exit;\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }", "private function menu() {\n // Array Map: Key(Menu Elements) => Array(Bold, Not Dynamic tag)\n if(isset($_SESSION['isAdmin'])) {\n $data['menu'] = [\n 'dashboard' => [false, false],\n 'general' => [false, false],\n 'weather' => [false, false],\n 'themes' => [false, false],\n 'languages' => [false, false],\n 'info_pages' => [false, false],\n 'ads' => [false, false],\n 'password' => [false, false],\n 'logout' => [false, true]\n ];\n } else {\n $data['menu'] = [\n 'login' => [false, false],\n ];\n }\n\n // If on the current route, enable the Bold flag\n $data['menu'][$this->url[1]][0] = true;\n\n return $this->view->render($data, 'admin/menu');\n }", "function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> ucfirst($_GET[\"object\"]).\" main\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"Create common poll\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"].\"&action=create_poll\",\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}", "public function menu()\n {\n return $this->menu;\n }", "public function menu()\n {\n return $this->menu;\n }", "public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }", "static function menu()\n {\n $id = Auth::id();\n\n $User = User::findOrFail($id);\n\n $ress['id'] = $id;\n\n $ress['User'] = $User;\n\n $ress['modules'] = DB::table('Modules')->get();\n \n $ress['UserPermission'] = DB::table('profiles_permissions')\n ->join('profiles','profiles_permissions.profile_id','=','profiles.id')\n ->join('permissions','profiles_permissions.permission_id','=','permissions.id')\n ->join('sections','permissions.section_id','=','sections.id')\n ->join('modules', function($join){\n $join->on('sections.module_id','=','modules.id')\n ->where('modules.bActive','=',1);\n })\n ->select('profiles.id as profile_id','sections.id as section_id','permissions.id as permission_id','modules.id as module_id','profiles.name as profile','permissions.name as permission','permissions.route','sections.name as section','sections.short_name as section_short_name','modules.name as module','modules.menu_name as module_menu_name','modules.icon','modules.bActive') \n ->where('profiles_permissions.profile_id',$User->profile_id)\n ->get();\n\n return $ress;\n }", "public function getMenus(){\n\n }", "public function indexAction()\n {\n $this->_helper->layout->setLayout('pbo/pbo');\n \n $chapId = Zend_Auth::getInstance()->getIdentity()->id; \n \n $menuModel = new Pbo_Model_WlMenuItems();\n $menu = 0;\n //assign query results to $menu variable\n $menuItems = $menuModel->getAllMenus($chapId);\n \n //pass heading to the view\n $this->view->title = \"Pages : Manage Menus\";\n \n //set pagination \n $pagination = Zend_Paginator::factory($menuItems);\n \n if(count($pagination)) \n { \n $pagination->setCurrentPageNumber($this->_request->getParam('page', 1));\n $pagination->setItemCountPerPage(20);\n \n $this->view->menus = $pagination;\n unset($pagination);\n }\n\n $this->view->menuMessages = $this->_helper->flashMessenger->getMessages();\n }", "protected function _menu() {\n\t\t// Get count of ham comments\n\t\t$ham = Sprig::factory('blog_comment', array('state'=>'ham'))->load(NULL, FALSE)->count();\n\t\t$ham = ($ham > 0) ? ' ['.$ham.']' : '';\n\n\t\t// Get count of queued comments\n\t\t$queued = Sprig::factory('blog_comment', array('state'=>'queued'))->load(NULL,FALSE)->count();\n\t\t$queued = ($queued > 0) ? ' ['.$queued.']' : '';\n\n\t\t// Get count of spam comments\n\t\t$spam = Sprig::factory('blog_comment', array('state'=>'spam'))->load(NULL,FALSE)->count();\n\t\t$spam = ($spam > 0) ? ' ['.$spam.']' : '';\n\n\t\treturn View::factory('blog/admin/menu')\n\t\t\t->set('links', array(\n\t\t\t\t'Approved Comments'.$ham => $this->request->uri(array('action' => 'approved')),\n\t\t\t\t'Moderation Queue'.$queued => $this->request->uri(array('action' => 'queue')),\n\t\t\t\t'Spam Comments'.$spam => $this->request->uri(array('action' => 'spam')),\n\t\t\t));\n\t}", "function cp_menu_array($menu)\n\t{\n\t\tif (ee()->extensions->last_call !== FALSE)\n\t\t{\n\t\t\t$menu = ee()->extensions->last_call;\n\t\t}\n\n\t\t// If this isn't a Super Admin, let's check to see if they can modify\n\t\t// the RTE module\n\t\tif (ee()->session->userdata('group_id') != 1)\n\t\t{\n\t\t\t$access = (bool) ee()->db->select('COUNT(m.module_id) AS count')\n\t\t\t\t->from('modules m')\n\t\t\t\t->join('module_member_groups mmg', 'm.module_id = mmg.module_id')\n\t\t\t\t->where(array(\n\t\t\t\t\t'mmg.group_id' \t=> ee()->session->userdata('group_id'),\n\t\t\t\t\t'm.module_name' => ucfirst($this->module)\n\t\t\t\t))\n\t\t\t\t->get()\n\t\t\t\t->row('count');\n\n\t\t\t$has_access = $access AND ee()->cp->allowed_group('can_access_addons');\n\t\t}\n\n\t\tif (ee()->session->userdata('group_id') == 1 OR $has_access)\n\t\t{\n\t\t\tee()->lang->loadfile($this->module);\n\t\t\t$menu['admin']['admin_content']['rte_settings'] = BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module='.$this->module;\n\t\t}\n\n\t\treturn $menu;\n\t}", "public function setLoadControllerMenu()\r\n {\r\n add_menu_page(\r\n $_SESSION['controller_data_current']['page_title'], // Title of the page\r\n $_SESSION['controller_data_current']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_current']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_current']['page_slug'],\r\n $_SESSION['controller_data_current']['page_render'],\r\n $_SESSION['controller_data_current']['page_menu_icon'],\r\n $_SESSION['controller_data_current']['page_menu_position']\r\n );\r\n }", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "private function initUserRoutes(): void\n {\n if ($this->getSessionInstance()->isRegistered()) {\n\n $user = $this->getSessionInstance()->getUser();\n\n /**\n * @see templates/Controllers/coreui/generic.nav.macro.lib.twig::macro top_right\n */\n $this->routes[self::RESTRICTED_NAV][\"user_account\"][\"avatar\"] = $user->getAvatar();\n }\n\n $this->routes[self::ANY_NAV][\"crump_bar\"] = [\n [\n \"options\" => [\n \"text\" => sprintf(\"%s\", ServerHelper::getVersion()),\n \"title\" => \"OS\",\n \"href\" => \"javascript:void(0)\",\n \"icon\" => \"cil-3d\"\n ]\n ],\n [\n \"options\" => [\n \"text\" => sprintf(\"PHP %s\", phpversion()),\n \"href\" => \"javascript:void(0)\",\n \"icon\" => \"cil-code\"\n ]\n ],\n [\n \"options\" => [\n \"text\" => date(\"d.m.Y\"),\n \"href\" => \"javascript:void(0)\",\n \"icon\" => \"cil-calendar\"\n ]\n ]\n ];\n }", "public function admin_menu() {\n\t\t// Load abstract page class.\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-page.php';\n\t\t// Load page classes.\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-general.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-accounts.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-messages.php';\n\t\trequire_once SF_ABSPATH . '/includes/settings/class-socialflow-admin-settings-categories.php';\n\n\t\t// Init menu classes.\n\t\tnew SocialFlow_Admin_Settings_General();\n\t\tnew SocialFlow_Admin_Settings_Accounts();\n\t\t// new SocialFlow_Admin_Settings_Categories.\n\t\t// new SocialFlow_Admin_Settings_Messages.\n\t}", "public function cseMenuLinks() {\n\n\t\tif(Session::getSess('logged') == false) {\n\t\t\t$this->cseMenuLinks .= '\n\t\t\t\t<li><a href=\"'. $this->dataInfo['BASE_URL'] .'user/regUser\"><span>Регистрация</span></a></li>\n\t\t\t\t<li><a href=\"'. $this->dataInfo['BASE_URL'] .'user/logIn\"><span>Вход</span></a></li>\n\t\t\t';\n\t\t} else {\n\t\t\t$username = $this->setUrl('userNameDisplay');\n\t\t\t$this->cseMenuLinks .= '\n\t\t\t\t<li><a href=\"'. $this->dataInfo['BASE_URL'] .'user/userProfile/'. $username .'\"><span>Настройки</span></a></li>\n\t\t\t\t<li><a href=\"'. $this->dataInfo['BASE_URL'] .'user/logOut\"><span>Изход</span></a></li>\n\t\t\t';\n\t\t}\n\t}", "public function getMenu()\n{\n $lang=$this->translation;\n foreach($this->_headerMenu as $hmenukey => $hmenu){\n foreach($hmenu as $hkey=>$hval){\n $this->_headerMenu[$hmenukey][$hkey]['caption']=$lang->_($hkey);\n }\n }\n $auth = $this->session->get('auth');\n if ($auth) {\n $this->_headerMenu['navbar-right']['oturum'] = array(\n 'caption' => $lang->_('logout'),\n 'action' => 'bitir'\n );\n\n } else {\n unset($this->_headerMenu['navbar-left']['islemler']);\n unset($this->_headerMenu['navbar-left']['r4t']);\n unset($this->_headerMenu['navbar-left']['hesap']);\n }\n\n $controllerName = $this->view->getControllerName();\n foreach ($this->_headerMenu as $position => $menu) {\n echo '<div class=\"nav-collapse\">';\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\n foreach ($menu as $controller => $option) {\n if ($controllerName == $controller) {\n echo '<li class=\"active\">';\n } else {\n echo '<li>';\n }\n if ($controller=='admin'){\n if(($auth) and ($auth['auth']==0)){\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }}else{\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\n }\n echo '</li>';\n }\n\n echo '</ul>';\n echo '</div>';\n }\n\n }", "function _quick_menu () {\n\t\t$menu = array(\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> ucfirst($_GET[\"object\"]).\" main\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t\"name\"\t=> \"\",\n\t\t\t\t\"url\"\t=> \"./?object=\".$_GET[\"object\"],\n\t\t\t),\n\t\t);\n\t\treturn $menu;\t\n\t}", "public function menuAction()\n {\n $site = $this->getSessionVar('site');\n /* @var $repo \\Allegro\\SitesBundle\\Repository\\SiteRepository */\n $repo = $this->getRepo('Site');\n\n /* @var $siteEntity Allegro\\SitesBundle\\Entity\\Site */\n $siteEntity = $repo->getSiteBySlug($site);\n return $this->render($this->getTemplate('menu.html'), array(\n 'site' => $siteEntity,\n '_locale' => $this->getSessionVar('_locale')\n ));\n }", "public function getMenu(){\n\n\t\treturn $this->get();\n\t}", "function usermin_createmenuitems()\n{\n $menubar['user'] = array(\"href\" => \"?user\", \"label\" => \"My Details\");\n $menubar['history'] = array(\"href\" => \"?history\", \"label\" => \"My History\");\n $menubar['logout'] = array(\"href\" => \"?logoff\", \"label\" => \"Logoff\");\n return $menubar;\n}", "public static function menu(){\n return new sai_module_menu( 1,\n sai_module_menu::POISITION_RIGHT,\n sai_module_menu::DIVIDER_NONE,\n \\SYSTEM\\PAGE\\replace::replaceFile((new \\SYSTEM\\PSAI('modules/saimod_sys_git/tpl/menu.tpl'))->SERVERPATH()));}", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "public function actionIndex()\n {\n\n $searchModel = new AuthItemSearch(['type' => $this->type]);\n $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());\n $menus = [];\n $i=0;\n foreach ($dataProvider->getModels() as $k => $v) {\n $menus[$i]['description'] = $v->description;\n $menus[$i]['name'] = $k;\n $menus[$i]['rule_name'] = $v->ruleName;\n $menus[$i]['data'] = $v->data;\n // $menus[$i]['routes'] = MenuHelper::getAssignedMenuByRole($k, null, function ($menu)\n // {\n // $data = json_decode($menu['data'],true);\n // $children = array_filter($menu['children']);\n // if ($children) $item['children'] = $children;\n\n // $item['path'] = $menu['route'] ?? '';\n // if (!empty($data['component'])) $item['component'] = $data['component'];\n\n // if (!empty($data['hidden'])) $item['hidden'] = $data['hidden'];\n // if (!empty($data['alwaysShow'])) $item['alwaysShow'] = $data['alwaysShow'];\n // if (!empty($data['redirect'])) $item['redirect'] = $data['redirect'];\n // if (!empty($data['meta'])) $item['meta'] = $data['meta'];\n // return $item;\n // });\n $i++;\n }\n return $this->success($menus);\n }", "public function menu(){\n $data=[];\n $data['title']=\"Menu || Admin Panel\";\n $data['menuList'] = $this->header->selectMenuheader();\n $data['userlistAll'] = $this->header->userlistAll();\n $this->load->view(\"header\", $data); //100% need\n\n $selectMenu['selectMenu'] = $this->header->selectMenu();\n $this->load->view('menu', $selectMenu); //important\n\n $this->load->view(\"footer\");\n }", "public function adminMenu()\n\t{\n\t\t$this->app['events']->listen('routes.finish', function()\n\t\t{\n\t\t\tif (! $user = $this->app['auth']->user() ) return;\n\n\t\t\t$menu = $this->app['menu']->menu('admin-header-nav');\n\t\t\t\t$menu->setAttributes(array('class' => 'eight columns'));\n\n\t\t\t$usersMenu = $menu->item('users', 'Users');\n\t\t\t\t$usersMenu->item('manage-users', 'Manage users', route('admin.user.index'));\n\n\t\t\t$profileMenu = $menu->item('user', $user->name, route('admin.profile'));\n\t\t\t\t$profileMenu->item('logout', 'Log Out', route('logout'));\n\t\t});\n\t}", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "public function supplier($menuid)\r\n\t\t\t\t{\r\n\t\t\t\t $user_id = $this->session->userdata('UserID');\r\n\t\t\t\t $check=$this->master_model->auth_read($user_id, $menuid);\r\n\r\n\t\t\t\t if($check==false)\r\n\t\t\t\t {\r\n\t\t\t\t redirect('admin/admin_login/redirectNoAuthUser');\r\n\t\t\t\t }else\r\n\t\t\t\t {\r\n\t\t\t\t $data['data_supplier']=$this->master_model->mst_datas('supplier');\r\n\t\t\t\t $this->load->view('admin/supplier/main', $data);\r\n\t\t\t\t }\r\n\t\t\t\t}", "public function getCreateMenu(){\n $menu_content = array();\n $index_admin = $this->createUrl('admin/index');\n $list_admin = $this->createUrl('admin/list');\n $create_admin = $this->createUrl('admin/create');\n $manage_admin = $this->createUrl('admin/admin');\n $backup_info = $this->createUrl('backup/BackupToExel');\n $update_sites = $this->createUrl('site/update');\n $view_sites = $this->createUrl('site/view');\n\n if (Admin::model()->isSuperAdmin()) {\n $menu_content = array( \n array('label'=>Yii::t('common','List Students'), 'url'=>array('index')),\n// array('label'=>Yii::t('common','Create Student'), 'url'=>array('create')),\n// array('label'=>Yii::t('common','Update Student'), 'url'=>array('Update')),\n// array('label'=>Yii::t('common','Delete Student'), 'url'=>array('Delete')),\n array('label'=>Yii::t('common','Manage Students'), 'url'=>array('admin')),\n array('label'=>Yii::t('common','Backup StudentInfo'), 'url'=>$backup_info),\n array('label'=>'------------------------------'),\n\n array('label'=>Yii::t('common','Admins Home'), 'url'=>$index_admin),\n array('label'=>Yii::t('common','List Admins'), 'url'=>$list_admin),\n array('label'=>Yii::t('common','Create Admin'), 'url'=>$create_admin),\n array('label'=>Yii::t('common','Manage Admins'), 'url'=>$manage_admin),\n array('label'=>'------------------------------'),\n \n array('label'=>Yii::t('common','Update Site Desc'), 'url'=>$update_sites),\n array('label'=>Yii::t('common','View Site Desc'), 'url'=>$view_sites),\n ); \n }else{\n $menu_content = array(\n array('label'=>Yii::t('common','List Students'), 'url'=>array('index')),\n// array('label'=>Yii::t('common','Create Student'), 'url'=>array('create')),\n array('label'=>Yii::t('common','Manage Students'), 'url'=>array('admin')),\n );\n }\n\n return $menu_content;\n }", "function index() {\n \t\t $this->config->load('menu_permisos', TRUE);\n\t\t\t\t\t\t \n\t\t\t\t\t\t $data['permisos'] = $this->roles_frr->permisos_role_controladora($this->uri->segment(1));\n\t\t\t\t\t\t \n\t\t\t\t\t\t //Obtenemos la info necesaria para construir el menu de cada uno de los permisos\n\t\t\t\t\t\t //Los datos estan de la forma $data['data_menu']['nombre_permiso']\n\t\t\t\t\t\t if(count($data['permisos']) > 0) {\n\t\t\t\t\t\t \tforeach ($data['permisos'] as $key => $row) {\n\t\t\t\t\t\t\t $data['data_menu'][$row['permiso']] = $this->config->item($row['permiso'], 'menu_permisos');\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t \t$data['error_sin_permiso'] = $this->config->item('error_sin_permiso', 'menu_permisos');\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 \n if ($message = $this->session->flashdata('message')) {\n\t\t\t\t\t\t \t\t$data['message'] = $message;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t $this->template->set_content('ewarrants/main_ewarrants',$data);\n $this->template->build();\n }", "public function get_menu()\r\n {\r\n return '';\r\n }", "public function prefsMenu()\n {\n return Beatnik::getMenu();\n }", "public function get_menu()\n\t{\n\t\treturn $this->get_session('admin_menu_html');\n\t}", "static function getUserMenu()\r\n {\r\n if(isset($_SESSION[Session::MENU]))\r\n return $_SESSION[Session::MENU];\r\n else return null;\r\n }", "function contact_form_admin_menu($menu)\n{\n $menu[] = array(\n 'URL' => CONTACT_FORM_ADMIN,\n 'NAME' => 'Contact Form',\n );\n return $menu;\n}", "public function configureMenuItems(): iterable\n {\n yield MenuItem::section('My informations', 'fa fa-info');\n yield MenuItem::linkToCrud('Profile', 'fas fa-user', User::class)->setAction(Action::DETAIL)->setEntityId($this->getUser()->getId());\n yield MenuItem::linkToCrud('Your Restaurants', 'fas fa-utensils', Restaurant::class);\n yield MenuItem::section('');\n yield MenuItem::linkToRoute('Back to site', 'fas fa-undo', 'homepage');\n }", "public function MenuConfig(){\n\t\t\tparent::view('Home/Menu4');\n\t\t}", "public function get_list_menu()\n {\n if ($this->request->isAJAX())\n {\n $param['MenuModel'] = $this->MenuModel->get();\n echo view(\"backend/option/menu/page-list\", $param);\n } \n else\n {\n echo \"No access permits\";\n }\n }", "public function index()\n {\n $menu_type=Menu_type::with('user')->get();\n return view('admin.menu.menu_type',compact('menu_type'));\n }", "public function index()\n {\n if (Gate::denies('manage', new Menu)) {\n return response('Insufficient permissions', 401);\n }\n $menus = Menu::all();\n return view('Provider.menu.menu_index', ['menus' => $menus]);\n }", "public function menu()\n {\n $this->load->view('admin/header');\n $data['all_module'] = $this->common_model->getAll('sett_modules','status',1);\n $data['menu_all_module'] = $this->common_model->getAll('sett_menu');\n $data['all_main_menu'] = $this->common_model->getAll('sett_menu','type',0);\n $this->load->view('admin/menu',$data);\n $this->load->view('admin/footer');\n }", "public function index() {\n \t$data = ['menu_users' => true]; \n return view('manage.users', $data);\n }", "function index(){\n $this->APICONTROLLERID = 8;\n $this->accessNumberID = 8;\n echo \"Asd\";\n $this->checkACL();\n }", "function controller()\n\t\t{\t\n\t\t\t$this->admin_page_header();\n\t\t\t$this->admin_menu();\n\t\t}", "public function index()\n {\n $roles = Role::all()->pluck('name', 'name');\n $type = env('APP_TYPE');\n $menu = Menu::query();\n if ($type=='ALL') {\n $menu->where('type','=','SMSFW')->orWhere('type','=','VOICEFW');\n }else{\n $menu->where('type','=',$type);\n }\n\n $menu = $menu->where('url','<>',null)->get()->pluck('title','id');\n\n return view('Administration::users.index',compact('roles','menu'));\n }", "function index() {\n\t\tif($this->Session->check('Auth.Adminuser')){\n\t\t\t$this->redirect(array('controller'=>'roles','action' => \"home\"));\n\t\t}\n\t\telse {\n\t\t\t$this->Session->setFlash(__d('adminuser','You are not authorized to access this location.',true));\n\t\t\t$this->redirect(array('controller'=>'roles','action' => \"login\"));\n\t\t}\n\t}", "public function menu_get_router()\n {\n return menu_get_router();\n }" ]
[ "0.69153506", "0.6757936", "0.6752253", "0.6637171", "0.6478192", "0.6414114", "0.63979673", "0.6364151", "0.6362905", "0.6362905", "0.6362905", "0.63623935", "0.63623136", "0.63623136", "0.63518006", "0.6347403", "0.6346227", "0.6340928", "0.6335682", "0.6316333", "0.6307121", "0.6293265", "0.6287933", "0.62790257", "0.6278614", "0.6267999", "0.6267999", "0.6265767", "0.6244413", "0.62387156", "0.62124956", "0.62098366", "0.6208305", "0.62017226", "0.619911", "0.6195065", "0.61657244", "0.61556584", "0.611412", "0.61061865", "0.61005116", "0.6099141", "0.6099141", "0.6099141", "0.6099141", "0.6099141", "0.6099141", "0.6097836", "0.6085188", "0.60666066", "0.6060721", "0.60585266", "0.60570496", "0.6055253", "0.6053239", "0.60530627", "0.6049772", "0.6049708", "0.6049708", "0.60487676", "0.60447425", "0.6035699", "0.60170937", "0.60165274", "0.60108316", "0.6007353", "0.6004894", "0.6001364", "0.59887487", "0.59826386", "0.5981733", "0.59722835", "0.59655195", "0.59646744", "0.59622556", "0.5958436", "0.59554225", "0.59521663", "0.59431785", "0.5938788", "0.5934787", "0.59332734", "0.59223825", "0.59212714", "0.59199375", "0.5919848", "0.5910538", "0.5906119", "0.5902001", "0.5900822", "0.58947617", "0.58922315", "0.58808786", "0.5877909", "0.587672", "0.5875769", "0.5873429", "0.5870203", "0.58671623", "0.5862901", "0.5853052" ]
0.0
-1
Fill Backup Option in delete
public function fillForm(array $data, SimpleElement $element = null) { $mapping = $this->dataMapping($data); $this->_fill($mapping, $element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_backup(){\n\t\t$file = $this->pfh->FolderPath('backup', 'eqdkp').$this->in->get('backups');\n\t\t$metafile = $this->pfh->FolderPath('backup/meta/', 'eqdkp').str_replace(substr($this->in->get('backups'), strpos($this->in->get('backups'), '.')), \"\", $this->in->get('backups')).'.meta.php';\n\t\tif (file_exists($file)) {\n\t\t\t$this->pfh->Delete($file);\n\t\t\t$this->core->message($this->user->lang('backup_delete_success'),$this->user->lang('backup'),'green');\n\t\t};\n\t\tif (file_exists($metafile)){\n\t\t\t$this->pfh->Delete($metafile);\n\t\t}\n\t\t$this->display('1');\n\n\t}", "function delete_backup()\n {\n $this->backup->delete_backup($this->uri->segment(4));\n redirectPrev('', 'backup');\n }", "public function delete_data_to_tombstone(){\n }", "public function deleteBackup($id);", "public function deleteBackupConfirm()\n {\n $delete_backups = $this->getPost('backups');\n $type = $this->getPost('type');\n $backups = $this->validateBackups($delete_backups, $type);\n $variables = array(\n 'settings' => $this->settings,\n 'backups' => $backups,\n 'backup_type' => $type,\n 'method' => $this->getPost('method'),\n 'errors' => $this->errors,\n 'view_helper' => $this->view_helper,\n 'url_base' => $this->url_base,\n 'menu_data' => $this->backup_lib->getDashboardViewMenu(),\n 'section' => 'db_backups',\n 'theme_folder_url' => plugin_dir_url(self::name)\n );\n \n //$template = 'backuppro/delete_confirm';\n \n //ee()->view->cp_page_title = $this->services['lang']->__('dashboard');\n $template = 'admin/views/delete_confirm';\n $this->renderTemplate($template, $variables);\n }", "function delete_backup_files()\r\n{\r\n\tglobal $db_url;\r\n\tis_admin();\r\n\t$url = parse_url($db_url);\r\n\t$url['path'] = urldecode($url['path']);\r\n\t$dbname=substr($url['path'], 1);\r\n\t$dir=APPROOT.'/data/'.$dbname;\r\n\t$d=dir($dir);\r\n\twhile(false!==($entry=$d->read()))\r\n\t{\r\n\t\tif (strlen($entry)==19)\r\n\t\t{\r\n\t\t\t$d_file=$dir.'/'.$entry;\r\n\t\t\tunlink($d_file);\r\n\t\t}\r\n\t}\r\n\t$d->close();\r\n}", "protected function removeBackupFolder() {}", "private function delete_backups()\n {\n $max_storage_time = now()->subDay(config('dbackup.storage_days'))->timestamp;\n\n $backup_files = Storage::disk('backup')->files();\n\n if($backup_files)\n {\n foreach ($backup_files as $backup_file)\n {\n $last_modified = Storage::disk('backup')->lastModified($backup_file);\n\n if($last_modified < $max_storage_time)\n {\n Storage::disk('backup')->delete($backup_file);\n }\n\n }\n }\n }", "function _delete_option_fresh_site()\n {\n }", "public function delete_set($opts) {\n\t\t\n\t\tglobal $updraftplus;\n\t\t\n\t\t$backups = UpdraftPlus_Backup_History::get_history();\n\t\t$timestamps = (string) $opts['backup_timestamp'];\n\n\t\t$remote_delete_limit = (isset($opts['remote_delete_limit']) && $opts['remote_delete_limit'] > 0) ? (int) $opts['remote_delete_limit'] : PHP_INT_MAX;\n\t\t\n\t\t$timestamps = explode(',', $timestamps);\n\t\t$deleted_timestamps = '';\n\t\t$delete_remote = empty($opts['delete_remote']) ? false : true;\n\n\t\t// You need a nonce before you can set job data. And we certainly don't yet have one.\n\t\t$updraftplus->backup_time_nonce();\n\t\t// Set the job type before logging, as there can be different logging destinations\n\t\t$updraftplus->jobdata_set('job_type', 'delete');\n\t\t$updraftplus->jobdata_set('job_time_ms', $updraftplus->job_time_ms);\n\n\t\tif (UpdraftPlus_Options::get_updraft_option('updraft_debug_mode')) {\n\t\t\t$updraftplus->logfile_open($updraftplus->nonce);\n\t\t\tset_error_handler(array($updraftplus, 'php_error'), E_ALL & ~E_STRICT);\n\t\t}\n\n\t\t$updraft_dir = $updraftplus->backups_dir_location();\n\t\t$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);\n\n\t\t$local_deleted = 0;\n\t\t$remote_deleted = 0;\n\t\t$sets_removed = 0;\n\t\t\n\t\t$deletion_errors = array();\n\n\t\tforeach ($timestamps as $i => $timestamp) {\n\n\t\t\tif (!isset($backups[$timestamp])) {\n\t\t\t\treturn array('result' => 'error', 'message' => __('Backup set not found', 'updraftplus'));\n\t\t\t}\n\n\t\t\t$nonce = isset($backups[$timestamp]['nonce']) ? $backups[$timestamp]['nonce'] : '';\n\n\t\t\t$delete_from_service = array();\n\n\t\t\tif ($delete_remote) {\n\t\t\t\t// Locate backup set\n\t\t\t\tif (isset($backups[$timestamp]['service'])) {\n\t\t\t\t\t// Convert to an array so that there is no uncertainty about how to process it\n\t\t\t\t\t$services = is_string($backups[$timestamp]['service']) ? array($backups[$timestamp]['service']) : $backups[$timestamp]['service'];\n\t\t\t\t\tif (is_array($services)) {\n\t\t\t\t\t\tforeach ($services as $service) {\n\t\t\t\t\t\t\tif ($service && 'none' != $service && 'email' != $service) $delete_from_service[] = $service;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$files_to_delete = array();\n\t\t\tforeach ($backupable_entities as $key => $ent) {\n\t\t\t\tif (isset($backups[$timestamp][$key])) {\n\t\t\t\t\t$files_to_delete[$key] = $backups[$timestamp][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Delete DB\n\t\t\tforeach ($backups[$timestamp] as $key => $value) {\n\t\t\t\tif ('db' == strtolower(substr($key, 0, 2)) && '-size' != substr($key, -5, 5)) {\n\t\t\t\t\t$files_to_delete[$key] = $backups[$timestamp][$key];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Also delete the log\n\t\t\tif ($nonce && !UpdraftPlus_Options::get_updraft_option('updraft_debug_mode')) {\n\t\t\t\t$files_to_delete['log'] = \"log.$nonce.txt\";\n\t\t\t}\n\t\t\t\n\t\t\t$updraftplus->register_wp_http_option_hooks();\n\n\t\t\tforeach ($files_to_delete as $key => $files) {\n\n\t\t\t\tif (is_string($files)) {\n\t\t\t\t\t$was_string = true;\n\t\t\t\t\t$files = array($files);\n\t\t\t\t} else {\n\t\t\t\t\t$was_string = false;\n\t\t\t\t}\n\n\t\t\t\tforeach ($files as $file) {\n\t\t\t\t\tif (is_file($updraft_dir.'/'.$file) && @unlink($updraft_dir.'/'.$file)) $local_deleted++;// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t}\n\n\t\t\t\tif ('log' != $key && count($delete_from_service) > 0) {\n\n\t\t\t\t\t$storage_objects_and_ids = UpdraftPlus_Storage_Methods_Interface::get_storage_objects_and_ids($delete_from_service);\n\n\t\t\t\t\tforeach ($delete_from_service as $service) {\n\t\t\t\t\t\n\t\t\t\t\t\tif ('email' == $service || 'none' == $service || !$service) continue;\n\n\t\t\t\t\t\t$deleted = -1;\n\n\t\t\t\t\t\t$remote_obj = $storage_objects_and_ids[$service]['object'];\n\n\t\t\t\t\t\t$instance_settings = $storage_objects_and_ids[$service]['instance_settings'];\n\t\t\t\t\t\t$this->backups_instance_ids = empty($backups[$timestamp]['service_instance_ids'][$service]) ? array() : $backups[$timestamp]['service_instance_ids'][$service];\n\n\t\t\t\t\t\tif (empty($instance_settings)) continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tuksort($instance_settings, array($this, 'instance_ids_sort'));\n\n\t\t\t\t\t\tforeach ($instance_settings as $instance_id => $options) {\n\n\t\t\t\t\t\t\t$remote_obj->set_options($options, false, $instance_id);\n\n\t\t\t\t\t\t\tif ($remote_obj->supports_feature('multi_delete')) {\n\t\t\t\t\t\t\t\tif ($remote_deleted == $remote_delete_limit) {\n\t\t\t\t\t\t\t\t\t$timestamps_list = implode(',', $timestamps);\n\n\t\t\t\t\t\t\t\t\treturn $this->remove_backup_set_cleanup(false, $backups, $local_deleted, $remote_deleted, $sets_removed, $timestamps_list, $deleted_timestamps, $deletion_errors);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$deleted = $remote_obj->delete($files);\n\n\t\t\t\t\t\t\t\tif (true === $deleted) {\n\t\t\t\t\t\t\t\t\t$remote_deleted = $remote_deleted + count($files);\n\n\t\t\t\t\t\t\t\t\tunset($backups[$timestamp][$key]);\n\n\t\t\t\t\t\t\t\t\t// If we don't save the array back, then the above section will fire again for the same files - and the remote storage will be requested to delete already-deleted files, which then means no time is actually saved by the browser-backend loop method.\n\t\t\t\t\t\t\t\t\tUpdraftPlus_Backup_History::save_history($backups);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Handle abstracted error codes/return fail status. Including handle array/objects returned\n\t\t\t\t\t\t\t\t\tif (is_object($deleted) || is_array($deleted)) $deleted = false;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (!array_key_exists($instance_id, $deletion_errors)) {\n\t\t\t\t\t\t\t\t\t\t$deletion_errors[$instance_id] = array('error_code' => $deleted, 'service' => $service);\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\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach ($files as $index => $file) {\n\t\t\t\t\t\t\t\tif ($remote_deleted == $remote_delete_limit) {\n\t\t\t\t\t\t\t\t\t$timestamps_list = implode(',', $timestamps);\n\n\t\t\t\t\t\t\t\t\treturn $this->remove_backup_set_cleanup(false, $backups, $local_deleted, $remote_deleted, $sets_removed, $timestamps_list, $deleted_timestamps, $deletion_errors);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$deleted = $remote_obj->delete($file);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (true === $deleted) {\n\t\t\t\t\t\t\t\t\t$remote_deleted++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Handle abstracted error codes/return fail status. Including handle array/objects returned\n\t\t\t\t\t\t\t\t\tif (is_object($deleted) || is_array($deleted)) $deleted = false;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (!array_key_exists($instance_id, $deletion_errors)) {\n\t\t\t\t\t\t\t\t\t\t$deletion_errors[$instance_id] = array('error_code' => $deleted, 'service' => $service);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$itext = $index ? (string) $index : '';\n\t\t\t\t\t\t\t\tif ($was_string) {\n\t\t\t\t\t\t\t\t\tunset($backups[$timestamp][$key]);\n\t\t\t\t\t\t\t\t\tif ('db' == strtolower(substr($key, 0, 2))) unset($backups[$timestamp][$key][$index.'-size']);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tunset($backups[$timestamp][$key][$index]);\n\t\t\t\t\t\t\t\t\tunset($backups[$timestamp][$key.$itext.'-size']);\n\t\t\t\t\t\t\t\t\tif (empty($backups[$timestamp][$key])) unset($backups[$timestamp][$key]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (isset($backups[$timestamp]['checksums']) && is_array($backups[$timestamp]['checksums'])) {\n\t\t\t\t\t\t\t\t\tforeach (array_keys($backups[$timestamp]['checksums']) as $algo) {\n\t\t\t\t\t\t\t\t\t\tunset($backups[$timestamp]['checksums'][$algo][$key.$index]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// If we don't save the array back, then the above section will fire again for the same files - and the remote storage will be requested to delete already-deleted files, which then means no time is actually saved by the browser-backend loop method.\n\t\t\t\t\t\t\t\tUpdraftPlus_Backup_History::save_history($backups);\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\n\t\t\tunset($backups[$timestamp]);\n\t\t\tunset($timestamps[$i]);\n\t\t\tif ('' != $deleted_timestamps) $deleted_timestamps .= ',';\n\t\t\t$deleted_timestamps .= $timestamp;\n\t\t\tUpdraftPlus_Backup_History::save_history($backups);\n\t\t\t$sets_removed++;\n\t\t}\n\n\t\t$timestamps_list = implode(',', $timestamps);\n\n\t\treturn $this->remove_backup_set_cleanup(true, $backups, $local_deleted, $remote_deleted, $sets_removed, $timestamps_list, $deleted_timestamps, $deletion_errors);\n\n\t}", "public function reset()\n {\n delete_option($this->dbVersionKey);\n }", "public function delete()\n {\n return delete_option($this->hash);\n }", "public function forceDelete();", "public function testCompanyManagementBackupsIdDelete()\n {\n\n }", "function restore_backup()\n {\n move_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads/backup.sql');\n $this->load->dbutil();\n\n\n $prefs = array(\n 'filepath' => 'uploads/backup.sql',\n 'delete_after_upload' => TRUE,\n 'delimiter' => ';'\n );\n $restore = & $this->dbutil->restore($prefs);\n unlink($prefs['filepath']);\n }", "function detail_ambil_paket_isi_perawatan_purge(){\r\n\t\t$master_id = (integer) (isset($_POST['master_id']) ? $_POST['master_id'] : $_GET['master_id']);\r\n\t\t$result=$this->m_master_ambil_paket->detail_ambil_paket_isi_perawatan_purge($master_id);\r\n\t}", "public function delete()\n {\n delete_option($this->optionName);\n }", "public function backupData()\n {\n $this->load->dbutil();\n\n // Backup database dan dijadikan variable\n $backup = $this->dbutil->backup();\n\n // Load file helper dan menulis ke server untuk keperluan restore\n $this->load->helper('file');\n write_file('/backup/database/mybackup.zip', $backup);\n\n // Load the download helper dan melalukan download ke komputer\n $this->load->helper('download');\n force_download('mybackup.zip', $backup);\n }", "function wp_delete_all_temp_backups()\n {\n }", "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 enableBackup();", "function DNUI_cleanup_backup() {\r\n $basePlugin = plugin_dir_path(__FILE__) . '../backup/';\r\n\r\n $backups = DNUI_scan_dir($basePlugin);\r\n $transform = array();\r\n foreach ($backups as $id) {\r\n array_push($transform, array(\"backup\" => $id));\r\n }\r\n DNUI_delete_backup($transform);\r\n\r\n return;\r\n}", "public function forceDelete()\n {\n //\n }", "function DNUI_delete_backups($ids) {\r\n $basePlugin = plugin_dir_path(__FILE__) . '../backup/';\r\n foreach ($ids as $id) {\r\n DNUI_delete_backup($id,$basePlugin);\r\n \r\n }\r\n return;\r\n}", "protected function setDeleteData()\n\t{\n\n\t}", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function deleteBackupShippingMethod()\n {\n return true;\n }", "protected function _preDelete() {}", "public function savebackup(){\n\n if($this->IS_DEMO){\n $this->session->set_flashdata('error', $this->config->item('app_demo_edit_err'));\n redirect($this->LIB_CONT_ROOT.'settings', 'refresh'); \n }\n set_time_limit(3600);\n $filename='dbbackup_'.date('dmy').'.gz';\n // Load the download helper and send the file to your desktop\n $this->load->helper('file');\n $this->load->helper('download');\n //create and download backup\n $this->load->dbutil();\n $backup = $this->dbutil->backup();\n force_download($filename, $backup);\n \n \n echo \"Backup downloading successful\";\n \n }", "public function handler_ava_reset_db_options()\n\t\t{\n\t\t\tupdate_option( $this->opt_key_attachment_urls, array() );\n\t\t}", "public function delete_backup()\n\t{\n\t\tif($this->isLoggedIn())\n\t\t{\n\t\t\t$bkid = $this->input->post('id');\n\t\t\tunlink(\"backups/$bkid\");\n\t\t\techo json_encode(array('msg_type'=>'success','message'=>'Backup Deleted Successfully..!'));\n\t\t}\n\t\telse {\n\t\t\tredirect(base_url());\n\t\t}\n\t}", "function delete_option($option)\n {\n }", "protected function _predelete() {\n }", "public function deleteSelect()\n {\n $selected=$this->getSelectedFiles();\n if ($selected[0]['type']=='folder')\n {\n $texttoshow=\"LA CARPETA\";\n }\n else\n {\n $texttoshow=\"EL ARCHIVO\";\n }\n $this->showConfirm(\"error\",\"¿SEGURO QUE DESEA ELIMINAR \".$texttoshow.\" \".$selected[0]['filename'].($selected[0]['type']=='folder'?\"\":\".\".$selected[0]['extension']).\"?\",\"BORRAR \".$texttoshow,\"deleteselectaction\",\"close\", null);\n }", "function backup ($datos){\n //verificamos si la asignacion ya existe\n //if(!$this->existe($datos)){\n //persistir en asignacion, asignacion_definitiva y asignacion_periodo\n //hay que inferir a que cuatrimestre pertenece la asignacion\n \n \n $datos['nro_doc']=$this->s__nro_doc;\n $datos['tipo_doc']=$this->s__tipo_doc; \n $this->dep('datos')->tabla('asignacion')->nueva_fila($datos);\n $this->dep('datos')->tabla('asignacion')->sincronizar();\n $this->dep('datos')->tabla('asignacion')->resetear();\n $cuatrimestre=$this->obtener_cuatrimestre();\n $fecha= getdate();\n $dato=array(\n \n 'cuatrimestre' => $cuatrimestre,\n 'anio' => $fecha['year'],\n \n );\n $secuencia=recuperar_secuencia('asignacion_id_asignacion_seq');\n if(strcmp($this->s__tipo, 'Definitiva')==0){\n $dato['id_asignacion']=$secuencia;\n $dato['nombre'] = $this->s__dia;\n $this->dep('datos')->tabla('asignacion_definitiva')->nueva_fila($dato);\n $this->dep('datos')->tabla('asignacion_definitiva')->sincronizar();\n $this->dep('datos')->tabla('asignacion_definitiva')->resetear();\n }\n else{ \n $periodo=array(\n 'id_asignacion' => $secuencia,\n 'fecha_inicio' => $datos['fecha_inicio'],\n 'fecha_fin' => $datos['fecha_fin']\n );\n $this->dep('datos')->tabla('asignacion_periodo')->nueva_fila($periodo);\n $this->dep('datos')->tabla('asignacion_periodo')->sincronizar();\n $this->dep('datos')->tabla('asignacion_periodo')->resetear();\n //en esta seccion se guarda informacion en la relacion esta_formada\n $dias=$datos['dias'];\n foreach ($dias as $dia){\n $dato['nombre']=$dia;\n $dato['id_asignacion']=$secuencia;\n $this->dep('datos')->tabla('esta_formada')->nueva_fila($dato);\n $this->dep('datos')->tabla('esta_formada')->sincronizar();\n $this->dep('datos')->tabla('esta_formada')->resetear();\n }\n }\n// }\n// else{\n// toba::notificacion()->agregar(\"No es posible registrar la asignación porque ya existe\", 'error');\n// }\n }", "function restore_backup()\n\t{\n\t\tmove_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads/backup.sql');\n\t\t$this->load->dbutil();\n\t\t\n\t\t\n\t\t$prefs = array(\n 'filepath'\t\t\t\t\t\t=> 'uploads/backup.sql',\n\t\t\t'delete_after_upload'\t\t\t=> TRUE,\n\t\t\t'delimiter'\t\t\t\t\t\t=> ';'\n );\n\t\t$restore =& $this->dbutil->restore($prefs); \n\t\tunlink($prefs['filepath']);\n\t}", "function restore_backup()\n\t{\n\t\tmove_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads/backup.sql');\n\t\t$this->load->dbutil();\n\t\t\n\t\t\n\t\t$prefs = array(\n 'filepath'\t\t\t\t\t\t=> 'uploads/backup.sql',\n\t\t\t'delete_after_upload'\t\t\t=> TRUE,\n\t\t\t'delimiter'\t\t\t\t\t\t=> ';'\n );\n\t\t$restore =& $this->dbutil->restore($prefs); \n\t\tunlink($prefs['filepath']);\n\t}", "private function deleteSettings()\n\t{\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}", "function delete_db_file($file_id) {\n$this->session->keep_flashdata($this->back_url_key);\nif (strlen(trim($this->back_url)) <= 0 || $this->back_url == NULL) {\n$this->back_url = $this->home_url;\n}\n$file_data = $this->backup->delete_db_file($file_id);\nif ($file_data !== NULL) {\n$file = $file_data->backup_location . $file_data->backup_name;\nif (file_exists($file)) {\nunlink($file);\n}\n}\nredirect($this->back_url);\n}", "public function preDelete() { }", "protected function schedule_temp_backup_cleanup()\n {\n }", "public function delete( $option );", "public function delete( $args, $assoc_args ) {\n\n\t\t$site_id = $assoc_args['site-id'];\n\t\t$backup_id = $args[0];\n\n\t\t$this->set_account();\n\n\t\t$args = array(\n\t\t\t'endpoint' => '/site/' . $site_id . '/backup/' . $backup_id,\n\t\t\t'method' => 'DELETE',\n\t\t\t);\n\n\t\t$response = $this->api_request( $args );\n\n\t\tif ( is_wp_error( $response ) )\n\t\t\tWP_CLI::error( $response->get_error_message() );\n\n\t\tWP_CLI::success( 'Deleted backup ' . $backup_id );\n\t}", "public function forceDeleted(AnswerOption $answerOption)\n {\n// Answer\n }", "public function delete()\n {\n $this->deleteOnExit = true;\n }", "function after_delete() {}", "private function deleteFlag()\n {\n // remove the flag\n \\Storage::delete($this->getFlagPath());\n }", "public function deleteDatabaseStructure( );", "protected function afterDelete()\r\n {\r\n }", "function deleteRegion($regid)\n{\n\tglobal $dbbms;\n\n //added by lavesh\n $sql=\"INSERT IGNORE INTO bms2.DELETED_REGION (SELECT * FROM bms2.REGION where RegId='$regid')\";\n $res=mysql_query($sql,$dbbms) or logErrorBms(\"bms_zone.php: deleteZone:1: Could not create backup for delete region <!--$sql<br>\". mysql_error().\"-->: \". mysql_errno(), $sql, \"ShowErrTemplate\");\n //Ends Here\n\n\t$sql=\"delete from bms2.REGION where RegId='$regid'\";\n\t$res=mysql_query($sql,$dbbms) or logErrorBms(\"bms_region.php: deleteRegion :1: Could not delete region <br>\t<!--$sql<br>\". mysql_error().\"-->: \". mysql_errno(), $sql, \"ShowErrTemplate\");\n\n\t//added by lavesh\n\t$sql=\"SELECT ZoneId FROM bms2.ZONE where RegId='$regid'\";\n\t$res=mysql_query($sql,$dbbms) or logErrorBms(\"bms_region.php: Could not select data from bms2.ZONE <br> <!--$sql<br>\". mysql_error().\"-->: \". mysql_errno(), $sql, \"ShowErrTemplate\");\n\twhile($row=mysql_fetch_array($res))\n\t{\n\t\t$zoneid=$row[\"ZoneId\"];\n\n\t\t$sql_1=\"INSERT IGNORE INTO bms2.DELETED_ZONE (SELECT * FROM bms2.ZONE where ZoneId='$zoneid')\"; \n\t\t$res_1=mysql_query($sql_1,$dbbms) or logErrorBms(\"bms_zone.php: deleteZone:1(1): Could not delete zone <br> <!--$sql_1<br>\". mysql_error().\"-->: \". mysql_errno(), $sql_1, \"ShowErrTemplate\");\n\n\t\t$sql_1=\"delete from bms2.ZONE where ZoneId='$zoneid'\";\n\t\t$res_1=mysql_query($sql_1,$dbbms) or logErrorBms(\"bms_zone.php: deleteZone:1(1): Could not delete zone <br> <!--$sql_1<br>\". mysql_error().\"-->: \". mysql_errno(), $sql_1, \"ShowErrTemplate\");\n\n\t}\n\t//Ends Here.\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 reset()\n {\n $this->getDb()->exec('delete from media');\n //pictures and vignettes deletion\n $this->deleteMedias();\n //backup deletion\n $this->deleteBackup();\n }", "public function tree_backup_delete($id) {\n global $user, $db;\n if ($id > 0) {\n if ($db->querynow(\"DELETE FROM `\".$this->table.\"_restore` WHERE ID_BACKUP=\".(int)$id.\n \" AND (CREATED_BY='\".mysql_escape_string($user[\"NAME\"]).\"' OR CREATED_BY='Automatic')\"))\n return true;\n }\n return false;\n }", "public function restore() {\n if ( ! $this->can_restore() ) {\n return;\n }\n check_admin_referer( self::RESTORE_NONCE );\n $location = add_query_arg( 'tab', 'export', admin_url( 'options-general.php?page=wpsupercache' ) );\n if ( $this->backupFileExists() && file_exists( self::$cache_config_file ) )\n $renamed = @rename( self::$cache_config_file_backup, self::$cache_config_file );\n if ( ! $renamed ) {\n wp_safe_redirect( add_query_arg( 'message', 4, $location ) );\n exit;\n }\n foreach ( get_option( '_wp_super_cache_backup_options', array() ) as $key => $value ) {\n update_option( $key, $value );\n }\n delete_option( '_wp_super_cache_backup_options' );\n // Reset the garbage collection to the new values\n if ( function_exists( 'schedule_wp_gc' ) )\n schedule_wp_gc( $forced = 1 );\n wp_safe_redirect( add_query_arg( 'message', 5, $location ) );\n exit;\n }", "protected function doPurgeDatabase()\n {\n }", "function updateRestore_confirm_confirm($param)\n\t{\n\n\t\tdprintr($param);\n\n\t\t$this->updateBackupRestore($param, \"restore\");\n\n\t//\tif (csa($file, \"__lx_temperoryftp_file\")) { unlink($file); }\n\t}", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "function delete() {\t\t$nop = str_repeat(\" \", $this -> size);\n\t\t//10 caratteri per diecimila\n\t\tshmop_write($this -> id, $nop, 0);\n\n\t}", "protected function backupExistsProperty()\n {\n $this->backup_exists = $this->exists;\n }", "function v1_delete($undo_file_pointer, $delete_table, $select_field_name, $where_field_name, $where_field_value, $logical, $upload_to_db, &$error) {\n\t\n\t// DB functions\n\trequire_once \"php/funcs/db_funcs.php\";\n\t\n\t// Store old values in \"undowovoml\" before deleting them (if not a simulation)\n\tif ($upload_to_db) {\n\t\t// Send \"SELECT\" query to database\n\t\t$select_field_value=array();\n\t\t$local_error=\"\";\n\t\tif (!db_select($delete_table, $select_field_name, $where_field_name, $where_field_value, $select_field_value, $local_error)) {\n\t\t\tswitch ($local_error) {\n\t\t\t\tcase \"Error in the parameters given\":\n\t\t\t\t\t$error=array();\n\t\t\t\t\t$error['code']=1024;\n\t\t\t\t\t$error['message']=$local_error.\" to db_select()\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$error=array();\n\t\t\t\t\t$error['code']=4009;\n\t\t\t\t\t$error['message']=$local_error;\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}\n\t\t$l_field_value=count($select_field_value);\n\t\t// Store records which are going to be deleted\n\t\t$undo_instruction=\"\";\n\t\tfor ($i=0; $i<$l_field_value; $i++) {\n\t\t\t$undo_instruction.=\n\t\t\t\"\\n\\t<insert>\".\n\t\t\t\"\\n\\t\\t<table>\".$delete_table.\"</table>\";\n\t\t\t// Fields\n\t\t\tfor ($j=0; $j<$l_parameters-2; $j++) {\n\t\t\t\t$undo_instruction.=\n\t\t\t\t\"\\n\\t\\t<field>\".$select_field_name[$j].\"</field>\".\n\t\t\t\t\"\\n\\t\\t<value>\".$select_field_value[$i][$j].\"</value>\";\n\t\t\t}\n\t\t\t$undo_instruction.=\n\t\t\t\"\\n\\t</insert>\";\n\t\t}\n\t\tif (fwrite($undo_file_pointer, $undo_instruction)===FALSE) {\n\t\t\t// Error\n\t\t\t$error=array();\n\t\t\t$error['code']=2024;\n\t\t\t$error['message']=\"An error occurred when trying to write undo file\";\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t\n\t// Send query to database\n\t$local_error=\"\";\n\tif (!db_delete($delete_table, $where_field_name, $where_field_value, $logical, !$upload_to_db, $local_error)) {\n\t\tswitch ($local_error) {\n\t\t\tcase \"Error in the parameters given\":\n\t\t\t\t$error=array();\n\t\t\t\t$error['code']=1028;\n\t\t\t\t$error['message']=$local_error.\" to db_delete()\";\n\t\t\t\tbreak;\n\t\t\tcase \"Error in logical operators given\":\n\t\t\t\t$error=array();\n\t\t\t\t$error['code']=1029;\n\t\t\t\t$error['message']=$local_error.\" to db_delete()\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$error=array();\n\t\t\t\t$error['code']=4010;\n\t\t\t\t$error['message']=$local_error;\n\t\t}\n\t\treturn FALSE;\n\t}\n\t\n\treturn TRUE;\n}", "protected function afterDelete()\n {\n }", "function delete_site_option($option)\n {\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM conta_a_pagar';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function after_delete() {}", "public static function Delete()\r\n {\r\n return delete_option(self::OPT_SETTINGS);\r\n }", "public function setDeleted() {}", "protected function delete() {\n\t}", "function cs_theme_option_backup() {\n\tupdate_option( \"cs_theme_option_backup\", get_option('cs_theme_option') );\n\tupdate_option( \"cs_theme_option_backup_time\", gmdate(\"Y-m-d H:i:s\") );\n\techo \"Current Backup Taken @ \" . gmdate(\"Y-m-d H:i:s\");\n\tdie();\n}", "function cs_theme_option_backup_restore() {\n\tupdate_option( \"cs_theme_option\", get_option('cs_theme_option_backup') );\n\techo \"Backup Restored\";\n\tdie();\n}", "protected function confirmDelete() {\n\t}", "public function afterDeleteCommit(): void\n {\n }", "function del($ar) {\n if(parent::del($ar)) {\n $p = new XParam($ar, array());\n $oid = $p->get('oid');\n // suppression des abonnements\n updateQuery(\"delete from OPTS where user like '$oid'\");\n // suppression des regles de secuite inutiles\n updateQuery(\"delete from ACL4 where AGRP like '$oid'\");\n // suppression des enregistrements dans les logs\n XArchives::appendOid($oid, 'LOGS.user', true);\n XArchives::appendOid($oid, 'LOGS.object', true);\n if(!empty($GLOBALS['XLOCK'])) {\n\t$GLOBALS['XLOCK']->cleanLocksForUser($oid);\n }\n }\n }", "private function deleteDailyBackups()\n {\n try {\n $date = strtotime('-2 months');\n\n // leave first day of the month\n if ((int) date('j', $date) !== 1) {\n $this->filesystem->deleteDir(date(\"Y/m/d\", $date));\n }\n } catch (\\Exception $e) {\n $this->event->fire('MonasheeBackupError', 'Error trying to delete directory on AWS S3');\n }\n }", "public function 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 }", "function delete() ;", "function delete() ;", "public function vymaz(){\r\n $db = napoj_db();\r\n $sql =<<<EOF\r\n DELETE FROM Diskusie WHERE id = \"$this->ID\";\r\nEOF;\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n }\r\n $db->close();\r\n }", "public function backup(){\n\t\t$this->verify();\n\t\t$this->load->dbutil();\n\t\t$this->load->helper('file');\n\t\t$this->load->helper('download');\n\t\t$this->load->library('zip');\n\t\t$database_tables=['admin','behaviour','class','comments','parentlogin','resources','resources_cat','scores','studentlogin','students','subject','teachers'];\n\t\tforeach ($database_tables as $tables) {\n\t\t\t$query = $this->db->query(\"SELECT * FROM \".$tables);\n\t\t\t$data=$this->dbutil->csv_from_result($query);\n\t\t\twrite_file('../backup/'.$tables.'-'.date(\"F-d-Y\").'.csv', $data);\n\t\t\t\n\t\t}\n\t\t$this->zip->read_dir('../backup', TRUE);\n\t\t$this->zip->read_dir('../assets/myResources');\n\t\t//$this->zip->read_dir('assets/documents', FALSE);\n\t\t//$this->zip->download('officers_credential.zip');\n\t\tdelete_files('../backup/');\n\t\t$this->zip->download('backup'.date(\"F-d-Y\").'.zip');\n\t}", "public function trash() {\n $now = date('Y-m-d H:i:s');\n $this->cancellato = true;\n $this->data_cancellazione = $now;\n $this->save();\n }", "function backup()\n {\n if($this->input->post('backup'))\n {\n $this->load->dbutil();\n \n if($this->input->post('format') == 'txt')\n {\n $extencion = 'sql'; \n }else{\n $extencion = $this->input->post('format'); \n }\n \n $prefs = array(\n 'tables' => $this->input->post('tablas'), // Array of tables to backup.\n 'ignore' => array(), // List of tables to omit from the backup\n 'format' => $this->input->post('format'), // gzip, zip, txt\n 'filename' => $this->input->post('name').'.'.$extencion, // File name - NEEDED ONLY WITH ZIP FILES\n 'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file\n 'add_insert' => TRUE, // Whether to add INSERT data to backup file\n 'newline' => \"\\n\" // Newline character used in backup file\n );\n\n // Backup your entire database and assign it to a variable\n $backup = $this->dbutil->backup($prefs);\n \n if($this->input->post('truncate'))\n {\n if(in_array('logs_usuarios', $prefs['tables']))\n {\n $this->model->truncate();\n } \n } \n \n // Load the file helper and write the file to your server\n $this->load->helper('file');\n write_file('/path/to/'.$prefs['filename'], $backup);\n \n // Load the download helper and send the file to your desktop\n $this->load->helper('download');\n force_download($prefs['filename'], $backup); \n }\n\n $db['tables'] = $this->db->list_tables();\n \n $this->armarVista('backup', $db);\n }", "public function deleteSelf() {\n trace('[METHOD] '.__METHOD__);\n if ($this->get_uid()) {\n $this->set_deleted(true);\n $dataArray = $this->getDataArray();\n $this->set_uid(tx_ptgsaaccounting_orderCreditBalanceAccessor::getInstance()->storeOrderCreditBalanceData($dataArray));\n }\n \n\n }", "function virustotalscan_deactivate()\r\n{\r\n global $db;\r\n // se sterg setarile din baza de date\r\n $db->query(\"DELETE FROM \".TABLE_PREFIX.\"settinggroups WHERE name = 'virustotalscan_group'\");\r\n \t$db->query(\"DELETE FROM \".TABLE_PREFIX.\"settings WHERE name LIKE 'virustotalscan_setting_%'\");\r\n // se actualizeaza toate setarile\r\n\trebuild_settings();\r\n // daca tabela \"virustotalscan_log\" exista in baza de date atunci se sterge!\r\n\tif ($db->table_exists('virustotalscan_log'))\r\n $db->drop_table('virustotalscan_log');\r\n // se sterge din baza de date stil-urile adaugate\r\n $db->delete_query('templates', 'title = \"virustotalscan_url_css\"'); \r\n}", "function delete() {\n db_begin_work();\n $delete = parent::delete();\n if($delete && !is_error($delete)) {\n unlink($this->getAvatarPath());\n \tunlink($this->getAvatarPath(true));\n\n ProjectUsers::deleteByUser($this);\n Assignments::deleteByUser($this);\n Subscriptions::deleteByUser($this);\n StarredObjects::deleteByUser($this);\n PinnedProjects::deleteByUser($this);\n UserConfigOptions::deleteByUser($this);\n Reminders::deleteByUser($this);\n\n search_index_remove($this->getId(), 'User');\n\n $cleanup = array();\n event_trigger('on_user_cleanup', array(&$cleanup));\n\n if(is_foreachable($cleanup)) {\n foreach($cleanup as $table_name => $fields) {\n foreach($fields as $field) {\n $condition = '';\n if(is_array($field)) {\n $id_field = array_var($field, 'id');\n $name_field = array_var($field, 'name');\n $email_field = array_var($field, 'email');\n $condition = array_var($field, 'condition');\n } else {\n $id_field = $field . '_id';\n $name_field = $field . '_name';\n $email_field = $field . '_email';\n } // if\n\n if($condition) {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ? AND $condition\", $this->getName(), $this->getEmail(), $this->getId());\n } else {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ?\", $this->getName(), $this->getEmail(), $this->getId());\n } // if\n } // foreach\n } // foreach\n } // if\n\n db_commit();\n return true;\n } else {\n db_rollback();\n return $delete;\n } // if\n }", "public function confirmingDeletion()\n {\n $this->confirmingExpenseDeletion = true;\n }", "public function deleteFinish()\n {\n\n $response = [\n 'delete' => 'finished',\n ];\n\n $existingClones = get_option(\"wpstg_existing_clones_beta\", []);\n\n // Check if clone exist and then remove it from options\n $this->log(\"Verifying existing clones...\");\n foreach ($existingClones as $name => $clone) {\n if ($clone[\"path\"] == $this->clone->path) {\n unset($existingClones[$name]);\n }\n }\n\n if (update_option(\"wpstg_existing_clones_beta\", $existingClones) === false) {\n $this->log(\"Delete: Nothing to save.'\");\n }\n\n // Delete cached file\n $this->cache->delete(\"delete_job_{$this->clone->name}\");\n $this->cache->delete(\"delete_directories_{$this->clone->name}\");\n $this->cache->delete(\"clone_options\");\n\n wp_die(json_encode($response));\n }", "public function cleanRepair() {}", "public function beforeDelete()\n {\n // Delete all databases of this app\n $this->databases()->delete();\n\n // Delete the app in serverpilot\n ServerPilot::apps($this->api_id)->delete();\n }", "function save_backup($option)\r\n\t{\r\n\t\tif(!$this->is_option_registered($option))\r\n\t\t\treturn;\r\n\t\t$option_data = $this->get_options($option);\r\n\t\t$backup_data = $this->get_options($this->backup_option);\r\n\t\t$backup_data[$option] = $option_data;\r\n\t\t$this->set_options($this->backup_option,$backup_data);\r\n\t}", "function preDelete()\n {\n }", "function default_delete(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod,$log;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$classTable = \"Setting_Lipe\";\n\t$pkeyTable = \"id\";\n\t//################### CAN NOT MODIFY BELOW CODE ###################\n\t$clsTable = new $classTable();\n\t$pval = isset($_REQUEST[$pkeyTable])? $_REQUEST[$pkeyTable] : \"\";\n\t$c_id = isset($_REQUEST[\"c_id\"])? $_REQUEST[\"c_id\"] : \"\";\n\tif ($pval!=\"\"){\n\t\t$clsTable->deleteOne($pval);\n $log->logThis('DELETE Settting Lipe '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\t$checkList = isset($_REQUEST[\"checkList\"])? $_REQUEST[\"checkList\"] : \"\";\n\tif (is_array($checkList)){\n\t\tforeach ($checkList as $key => $val){\n\t\t\t$clsTable->deleteOne($val);\n\t\t}\n\t\t $username=$_COOKIE['username'];\n\t\t\t\t$actionlog=new ActionLog();\n\t\t\t\t$actionlog->insertValue($username,'Setting Lipe / Delete a lipe ','Course id: '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\tunset($clsTable);\n}", "private function clearOldFiles()\r\n {\r\n // Buscando itens na pasta\r\n $files = new \\DirectoryIterator( $this->backupFolder );\r\n\r\n // Passando pelos itens\r\n $sortedFiles = array();\r\n foreach ($files as $file) {\r\n // Se for um arquivo\r\n if ($file->isFile()) {\r\n // Adicionando em um vetor, sendo o índice a data de modificação\r\n // do arquivo, para assim ordenarmos posteriormente\r\n $sortedFiles[$file->getMTime()] = $file->getPathName();\r\n }\r\n }\r\n\r\n // Ordena o vetor em ordem decrescente\r\n arsort( $sortedFiles );\r\n\r\n // Passando pelos arquivos\r\n $numberFiles = 0;\r\n foreach ($sortedFiles as $file) {\r\n $numberFiles++;\r\n // Se a quantidade de arquivo for maior que a quantidade\r\n // máxima definida\r\n if ($numberFiles > $this->maxNumberFiles) {\r\n // Removemos o arquivo da pasta\r\n unlink( $file );\r\n echo \"Apagado backup '{$file}'\" . PHP_EOL;\r\n }\r\n }\r\n\r\n }", "protected function _delete()\n\t{\n\t}", "public function semiEmpty()\n\t{\n//\t\t$dfp\t= $this->_prename. \"/\".$this->_name.\".db\";\n//\t\t$ret\t= copy($dfp, $this->_prename. \"/bc/\".$this->_name.\".db\".'.bc');\n//\t\tif(!ret) return false;\n//\t\t$this->_dbh($this->_name);\n//\t\t$this->delete('');\n//\t\treturn true;\n\t}", "function small_groups_clean_database( ) {\n\t\t\n\t\tdelete_option( 'small_groups_plugin_version' );\n\t\tdelete_option( 'small_groups_install_date' );\n\n\t\t// plugin specific database entries\n\t\tdelete_option( 'SMALL_GROUPS_posts_to_posts_plugin' );\n\t\t\n\t\tdelete_option( 'SMALL_GROUPS_deactivate_posts_to_posts' );\n\t\t\n\t\t// user specific database entries\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_prompt_timeout', $meta_value );\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_start_date', $meta_value );\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_hide_notice', $meta_value );\n\n}", "public static function delete() {\n\n\n\t\t}", "public function create_export( $action ) {\n\t\t\t$wpda_db_options_activated = get_option( 'wpda_db_options_activated' );\n\t\t\tif ( ! is_array( $wpda_db_options_activated ) || 0 === count( $wpda_db_options_activated ) ) {\n\t\t\t\techo '<br/>';\n\t\t\t\techo __( 'You need to define and activate at least one storage device in Data Backup Settings to use this feature.', 'wp-data-access' );\n\t\t\t\techo '<br/>';\n\t\t\t\techo '<a href=\"?page=wpda_settings&tab=databackup\">&raquo; ';\n\t\t\t\techo __( 'Define and/or activate a storage device', 'wp-data-access' );\n\t\t\t\techo '</a>';\n\t\t\t\twp_die();\n\t\t\t}\n\n\t\t\tif ( isset( $_REQUEST['schema_name'] ) ) {\n\t\t\t\t$schema_name = sanitize_text_field( wp_unslash( $_REQUEST['schema_name'] ) ); // input var okay.\n\t\t\t} else {\n\t\t\t\t$schema_name = '';\n\t\t\t}\n\n\t\t\t$device_arg = '';\n\t\t\tif ( 'update' === $action ) {\n\t\t\t\tif ( isset( $_REQUEST['schedule'] ) ) {\n\t\t\t\t\t$schedule = sanitize_text_field( wp_unslash( $_REQUEST['schedule'] ) ); // input var okay.\n\t\t\t\t\tif ( 'wpda_data_backup' !== $schedule ) {\n\t\t\t\t\t\twp_die( __( 'ERROR: Wrong arguments', 'wp-data-access' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twp_die( __( 'ERROR: Wrong arguments', 'wp-data-access' ) );\n\t\t\t\t}\n\t\t\t\tif ( isset( $_REQUEST['schedule_args'] ) ) {\n\t\t\t\t\t$backupid = sanitize_text_field( wp_unslash( $_REQUEST['schedule_args'] ) ); // input var okay.\n\t\t\t\t} else {\n\t\t\t\t\twp_die( __( 'ERROR: Wrong arguments', 'wp-data-access' ) );\n\t\t\t\t}\n\t\t\t\t$data_backups = get_option( 'wpda_data_backup_option' );\n\t\t\t\t$data_backup_found = false;\n\t\t\t\tforeach ( $data_backups as $data_backup ) {\n\t\t\t\t\tif ( $data_backup['id'] === $backupid ) {\n\t\t\t\t\t\t$data_backup_tables = $data_backup['tables'];\n\t\t\t\t\t\t$keep = $data_backup['keep'];\n\t\t\t\t\t\t$schema_name = isset( $data_backup['schema_name'] ) ? $data_backup['schema_name'] : '';\n\t\t\t\t\t\t$data_backup_found = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( ! $data_backup_found ) {\n\t\t\t\t\twp_die( __( 'ERROR: Wrong arguments', 'wp-data-access' ) );\n\t\t\t\t}\n\t\t\t\tif ( isset( $_REQUEST['interval'] ) ) {\n\t\t\t\t\t$interval = sanitize_text_field( wp_unslash( $_REQUEST['interval'] ) ); // input var okay.\n\t\t\t\t}\n\t\t\t\tif ( isset( $_REQUEST['device'] ) ) {\n\t\t\t\t\t$device_arg = sanitize_text_field( wp_unslash( $_REQUEST['device'] ) ); // input var okay.\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$backupid = '';\n\t\t\t}\n\n\t\t\t$table_list = WPDA_Dictionary_Lists::get_tables( false, $schema_name );\n\t\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<h1 class=\"wp-heading-inline\">\n\t\t\t\t\t<span><?php echo __( 'Data Backup' ); ?></span>\n\t\t\t\t\t<a href=\"https://wpdataaccess.com/docs/documentation/data-explorer/data-backup/\" target=\"_blank\" title=\"Plugin Help - open a new tab or window\">\n\t\t\t\t\t\t<span class=\"dashicons dashicons-editor-help\"\n\t\t\t\t\t\t\t style=\"text-decoration:none;vertical-align:top;font-size:30px;\">\n\t\t\t\t\t\t</span></a>\n\t\t\t\t</h1>\n\t\t\t\t<div id=\"wpda_export_import\">\n\t\t\t\t\t<div class=\"wpda_export_import\">\n\t\t\t\t\t\t<form id=\"wpda_export_import_form\"\n\t\t\t\t\t\t\t action=\"?page=wpda&page_action=wpda_backup&schema_name=<?php echo esc_attr( $schema_name ); ?>\"\n\t\t\t\t\t\t\t method=\"post\"\n\t\t\t\t\t\t\t onsubmit=\"return pre_submit()\">\n\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td style=\"font-weight:bold;padding-left:10px;\"><?php echo __( 'Database Tables' ); ?></td>\n\t\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t\t<td style=\"font-weight:bold;padding-left:10px\"><?php echo __( 'Tables To Be Exported' ); ?></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<select id=\"wpda_table_name_db\" name=\"wpda_table_name_db\" multiple size=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"width:300px;\">\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $table_list as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"' . esc_attr( $value['table_name'] ) . '\">' . esc_attr( $value['table_name'] ) . '</option>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:void(0)\" class=\"button\" onclick=\"move_all_to_export()\">\n\t\t\t\t\t\t\t\t\t\t\t>>> </a>\n\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t<a href=\"javascript:void(0)\" class=\"button\" onclick=\"move_all_to_db()\"> <<< </a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<select id=\"wpda_table_name_export\" name=\"wpda_table_name_export[]\" multiple\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"20\" style=\"width:300px;\">\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td colspan=\"3\" style=\"text-align:center;\">\n\t\t\t\t\t\t\t\t\t\t<table align=\"center\">\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:right;\"><?php echo __( 'Backup Id' ); ?></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:left;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid=\"backupid\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname=\"backupid\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue=\"<?php echo $backupid; ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmaxlength=\"50\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( 'update' === $action ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo 'readonly';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:right;\"><?php echo __( 'Backup Interval' ); ?></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:left;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<select id=\"interval\" name=\"interval\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( 'add' === $action ) { ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"runonce\"><?php echo __( 'Run once (no interval)' ); ?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $this->schedules as $key => $schedule ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"<option value='$key'>\" . $schedule['display'] . ' (' . $schedule['interval'] . ' sec)</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:right;\"><?php echo __( 'Backup Location' ); ?></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:left;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<select id=\"device\" name=\"device\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $wpda_db_options_activated as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$device = $key;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( 'local_path' === $key ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$device = 'local > ' . WPDA::get_option( WPDA::OPTION_DB_LOCAL_PATH );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} elseif ( 'dropbox' === $key ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$device = 'dropbox > ' . WPDA::get_option( WPDA::OPTION_DB_DROPBOX_PATH );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"<option value='$key'\" . ( $key === $device_arg ? 'selected' : '' ) . \">$device</option>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:right;\"><?php echo __( 'Backup Files Kept' ); ?></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:left;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<select id=\"keep\" name=\"keep\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"1\">1</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"2\">2</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"3\">3</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"4\">4</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"5\">5</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"6\">6</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"7\">7</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"8\">8</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"9\">9</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"10\">10</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"ALL\">ALL</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td style=\"text-align:left;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t class=\"button button-primary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t value=\"<?php echo __( 'Start' ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t class=\"button button-secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t value=\"<?php echo __( 'Cancel' ); ?>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t onclick=\"window.location.href=window.location.href\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\"/>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tvar tables_selected = [];\n\t\t\t\t<?php\n\t\t\t\tif ( 'update' === $action ) {\n\t\t\t\tforeach ( $data_backup_tables as $data_backup_table ) {\n\t\t\t\t?>\n\t\t\t\ttables_selected.push('<?php echo $data_backup_table; ?>');\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\tjQuery(\"#keep option[value='<?php echo esc_attr( $keep ); ?>']\").prop('selected', true);\n\t\t\t\t\tjQuery(\"#interval option[value='<?php echo esc_attr( $interval ); ?>']\").prop('selected', true);\n\t\t\t\t\tfor (var i = 0; i < tables_selected.length; i++) {\n\t\t\t\t\t\tjQuery(\"#wpda_table_name_db option[value='\" + tables_selected[i] + \"']\").remove();\n\t\t\t\t\t\tjQuery('#wpda_table_name_export').append(jQuery('<option>', {\n\t\t\t\t\t\t\tvalue: tables_selected[i],\n\t\t\t\t\t\t\ttext: tables_selected[i]\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t<?php\n\t\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\tjQuery(\"#keep option[value='3']\").prop('selected', true);\n\t\t\t\t});\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\tfunction pre_submit() {\n\t\t\t\t\tif (0 === jQuery(\"#wpda_table_name_export > option\").size()) {\n\t\t\t\t\t\talert('<?php echo __( 'No tables to be exported' ); ?>');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif ('' === jQuery(\"#backupid\").val().trim()) {\n\t\t\t\t\t\talert('<?php echo __( 'You must specify a backupid' ); ?>');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tjQuery(\"#wpda_table_name_export > option\").each(function () {\n\t\t\t\t\t\tjQuery(this).attr(\"selected\", \"true\");\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tfunction move_all_to_export() {\n\t\t\t\t\tjQuery(\"#wpda_table_name_db > option\").each(function () {\n\t\t\t\t\t\tjQuery('#wpda_table_name_export').append(jQuery('<option>', {\n\t\t\t\t\t\t\tvalue: this.text,\n\t\t\t\t\t\t\ttext: this.text\n\t\t\t\t\t\t}));\n\t\t\t\t\t});\n\t\t\t\t\tjQuery('#wpda_table_name_db > option').remove();\n\t\t\t\t}\n\n\t\t\t\tfunction move_all_to_db() {\n\t\t\t\t\tjQuery(\"#wpda_table_name_export > option\").each(function () {\n\t\t\t\t\t\tjQuery('#wpda_table_name_db').append(jQuery('<option>', {\n\t\t\t\t\t\t\tvalue: this.text,\n\t\t\t\t\t\t\ttext: this.text\n\t\t\t\t\t\t}));\n\t\t\t\t\t});\n\t\t\t\t\tjQuery('#wpda_table_name_export > option').remove();\n\t\t\t\t}\n\n\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\tjQuery('#wpda_table_name_db').on('click', function (event) {\n\t\t\t\t\t\tif ('' !== event.target.text && undefined != event.target.text) {\n\t\t\t\t\t\t\tjQuery('#wpda_table_name_export').append(jQuery('<option>', {\n\t\t\t\t\t\t\t\tvalue: event.target.text,\n\t\t\t\t\t\t\t\ttext: event.target.text\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\tjQuery(\"#wpda_table_name_db option[value=\" + event.target.text + \"]\").remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\tjQuery('#wpda_table_name_export').on('click', function (event) {\n\t\t\t\t\t\tif ('' !== event.target.text && undefined != event.target.text) {\n\t\t\t\t\t\t\tjQuery('#wpda_table_name_db').append(jQuery('<option>', {\n\t\t\t\t\t\t\t\tvalue: event.target.text,\n\t\t\t\t\t\t\t\ttext: event.target.text\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\tjQuery(\"#wpda_table_name_export option[value=\" + event.target.text + \"]\").remove();\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}", "public function delete(Pickup $object);", "function deletePartition() {\n\n global $connection_production;\n\n if (isset($_POST['delete_league'])) {\n\n echo 'working';\n }\n }", "function deleteSettings() {\n\t\tdelete_option('wassup_settings');\n\t}", "function delete(&$db,$DemandID,$DemandType,$StockID) { //####DELETE_DELETE_DELETE_DELETE_DELETE_DELETE_####\n\n// If wanted to have a Confirm routine before did actually deletion, could check if\n// deletion = \"yes\"; if it did, display link that redirects back to this page\n// like this - <a href=\" ' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?&delete=confirm&StockID=' . \"$StockID\" . ' \">\n// that sets delete=confirm. If delete=confirm, do actually deletion.\n// This deletes an individual record by DemandID if called from a listall that shows\n// edit/delete or deletes all of a particular demand type if press Delete Demand Type button.\n\t$where = \" \";\n\tif ($DemandType) {\n\t\t$where = \" WHERE mrpdemandtype ='\" . $DemandType . \"'\";\n\t}\n\tif ($DemandID) {\n\t\t$where = \" WHERE demandid ='\" . $DemandID . \"'\";\n\t}\n\t$sql=\"DELETE FROM mrpdemands\n\t\t $where\";\n\t$result = DB_query($sql);\n\tif ($DemandID) {\n\t\tprnMsg(_('The MRP demand record for') .' '. $StockID .' '. _('has been deleted'),'succes');\n\t} else {\n\t\tprnMsg(_('All records for demand type') .' '. $DemandType .' ' . _('have been deleted'),'succes');\n\t}\n\tunset ($DemandID);\n\tunset ($StockID);\n\tdisplay($db,$stockID,$DemandID);\n\n}" ]
[ "0.6767327", "0.6604233", "0.6200085", "0.61515266", "0.6100696", "0.6095625", "0.60843015", "0.605026", "0.59537905", "0.58624715", "0.58305544", "0.58263695", "0.5792715", "0.57247156", "0.5703343", "0.5700802", "0.5677226", "0.5662525", "0.5660134", "0.56213355", "0.56003886", "0.5597328", "0.5591274", "0.5589969", "0.5577356", "0.5565942", "0.5555585", "0.5552766", "0.55406755", "0.55383456", "0.55167246", "0.5516208", "0.5507238", "0.55004483", "0.5490183", "0.54828036", "0.54828036", "0.54656637", "0.5458751", "0.54464114", "0.543025", "0.54236066", "0.5417979", "0.5392445", "0.538902", "0.5384965", "0.5381119", "0.53640825", "0.5363143", "0.53594655", "0.5342436", "0.5342111", "0.53412133", "0.53354686", "0.53046584", "0.53012604", "0.5299842", "0.5296312", "0.5292976", "0.5286088", "0.5282799", "0.5278236", "0.52772427", "0.52727246", "0.5271235", "0.5262147", "0.5259872", "0.5259097", "0.5252414", "0.5252368", "0.5240007", "0.52399385", "0.52359325", "0.52231383", "0.5221393", "0.5219168", "0.5219168", "0.52134967", "0.5212397", "0.52101684", "0.520144", "0.5195092", "0.51929325", "0.5192806", "0.5192532", "0.5191902", "0.5191264", "0.5189676", "0.5187987", "0.5185788", "0.51815575", "0.5176609", "0.5169129", "0.51637065", "0.5162155", "0.51597744", "0.51595867", "0.5155832", "0.51557016", "0.5154467", "0.5150961" ]
0.0
-1
Constructor of an sfImageReflection transformation
public function __construct($reflection_height=20, $start_transparency=30) { $this->setReflectionHeight($reflection_height); $this->setStartTransparency($start_transparency); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function transform(sfImage $image)\r\n {\r\n\r\n // Get the actual image resource\r\n $resource = $image->getAdapter()->getHolder();\r\n\r\n //get the resource dimentions\r\n $width = $image->getWidth();\r\n $height = $image->getHeight();\r\n\r\n $reflection = $image->copy();\r\n\r\n $reflection->flip()->resize($width, $this->reflection_height);\r\n\r\n $r_resource = $reflection->getAdapter()->getHolder();\r\n\r\n $dest_resource = $reflection->getAdapter()->getTransparentImage($width, $height + $this->reflection_height);\r\n\r\n imagecopymerge($dest_resource, $resource, 0, 0, 0 ,0, $width, $height, 100);\r\n\r\n imagecopymerge($dest_resource, $r_resource, 0, $height, 0 ,0, $width, $this->reflection_height, 100);\r\n\r\n // Increments we are going to increase the transparency\r\n $increment = 100 / $this->reflection_height;\r\n\r\n // Overlay line we use to apply the transparency\r\n $line = imagecreatetruecolor($width, 1);\r\n\r\n // Use white as our overlay color\r\n imagefilledrectangle($line, 0, 0, $width, 1, imagecolorallocate($line, 255, 255, 255));\r\n\r\n $tr = $this->start_transparency;\r\n\r\n // Start at the bottom of the original image\r\n for ($i = $height; $i <= $height + $this->reflection_height; $i++)\r\n {\r\n\r\n if ($tr > 100)\r\n {\r\n $tr = 100;\r\n }\r\n\r\n imagecopymerge($dest_resource, $line, 0, $i, 0, 0, $width, 1, $tr);\r\n\r\n $tr += $increment;\r\n\r\n }\r\n\r\n // To set a new resource for the image object\r\n $image->getAdapter()->setHolder($dest_resource);\r\n\r\n return $image;\r\n }", "public function __construct($gd_image) {}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->imageChangeParams = func_get_arg(0);\n $this->type = func_get_arg(1);\n }\n }", "protected function initializeReflection() {}", "public function __construct($image)\n {\n $this->image = $image;\n }", "public function __construct(Image $image){\n\t\t$this->addImage($image);\n\t}", "public function __construct($image = null){\n\t\tparent::__construct($image);\n\t}", "public function __construct($image)\n {\n $this->image = imagecreatefromstring($image);\n }", "public function __construct($img)\r\n\t{\r\n\t\t$this->_imagen = $img;\r\n\t}", "public function __construct(Image $image)\n {\n $this->image = $image;\n }", "public function __construct()\n {\n foreach (GeneralUtility::makeInstance(\\ReflectionClass::class, static::class)->getProperties() ?? [] as $reflection) {\n if (!$reflection->isProtected()) {\n $name = $reflection->getName();\n $value = $this->{$name};\n\n // Define parameter name of property\n $this->parameterMapping[$name] = GeneralUtility::camelCaseToLowerCaseUnderscored($name);\n\n // Map the type of properties\n $this->typeMapping[$name] = is_int($value) ? 'int' : (is_array($value) ? 'array' : (is_bool($value) ? 'bool' : (is_string($value) ? 'string' : null)));\n }\n }\n }", "protected function transform(sfImage $image)\n {\n $resource_w = $image->getWidth();\n $resource_h = $image->getHeight();\n\n $scale_w = $this->getWidth()/$resource_w;\n $scale_h = $this->getHeight()/$resource_h;\n switch ($this->getMethod())\n {\n case 'deflate':\n case 'inflate':\n\n return $image->resize($this->getWidth(), $this->getHeight());\n\n case 'left':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(0, (int)round(($image->getHeight() - $this->getHeight()) / 2), $this->getWidth(), $this->getHeight());\n\n case 'right':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(($image->getWidth() - $this->getWidth()), (int)round(($image->getHeight() - $this->getHeight()) / 2),$this->getWidth(), $this->getHeight());\n\n case 'top':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), 0, $this->getWidth(), $this->getHeight());\n\n case 'bottom':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), ($image->getHeight() - $this->getHeight()), $this->getWidth(), $this->getHeight());\n \n case 'center':\n $image->scale(max($scale_w, $scale_h));\n \n $left = (int)round(($image->getWidth() - $this->getWidth()) / 2);\n $top = (int)round(($image->getHeight() - $this->getHeight()) / 2);\n\n return $image->crop($left, $top, $this->getWidth(), $this->getHeight());\n case 'scale':\n return $image->scale(min($scale_w, $scale_h));\n\n case 'fit': \n default:\n $img = clone $image;\n\n $image->create($this->getWidth(), $this->getHeight());\n \n // Set a background color if specified\n if(!is_null($this->getBackground()) && $this->getBackground() != '')\n {\n $image->fill(0,0, $this->getBackground());\n }\n\n $img->scale(min($this->getWidth() / $img->getWidth(), $this->getHeight() / $img->getHeight()));\n \n $image->overlay($img, 'center');\n\n return $image;\n \n }\n }", "public function __construct()\n\t{\n\t\t// Initialize reflectionClass with information about the target class\n\t\t$this->reflectionClass = new \\ReflectionClass($this);\n\t}", "public function __construct(Image $image)\n {\n $this->images = $image;\n }", "public function __construct()\n {\n $this->dice = new DiceImage();\n $this->resetVariables();\n }", "public function __construct()\n {\n $this->dice = new DiceImage();\n $this->resetVariables();\n }", "public function __construct()\n {\n $this->entity = $this->entity();\n $this->map = $this->map();\n $this->regex = $this->regex();\n }", "function __construct() {\r\n\t\tforeach ($_POST as $field => $value) {\r\n\t\t\t$this->{$field} = $value;\r\n\t\t}\r\n\t\t$this->setMode();\r\n\t\t$this->setImageUpload();\r\n\t\tif($this->logo['size'] > 0) {\r\n\t\t\t$this->setFile();\r\n\t\t}\r\n\t}", "protected function transform(sfImage $image)\r\n {\r\n\r\n $resource = $image->getAdapter()->getHolder();\r\n\r\n $image->resize( $this->getWidth(), $this->getHeight() );\r\n\r\n $resource->roundCorners( $this->getRadius(), $this->getRadius() );\r\n\r\n $shadow = $resource->clone();\r\n\r\n $shadow->setImageBackgroundColor( new ImagickPixel( 'black' ) );\r\n\r\n $shadow->shadowImage( 80, 3, 5, 5 );\r\n\r\n $shadow->compositeImage( $resource, Imagick::COMPOSITE_OVER, 0, 0 );\r\n\r\n return $image;\r\n\r\n }", "public function __construct(Obj\\ProductImage $imageObj)\n {\n $this->imageObj = $imageObj;\n }", "function __construct(TagTransformer $tagTransformer)\n\t{\n\t\t$this->tagTransformer = $tagTransformer;\n\t}", "public function __construct(IDataTransformer $transformer, TariffEntityService $tariffService)\n {\n parent::__construct($transformer);\n $this->tariffService = $tariffService;\n }", "public function __construct(DOMElement $dom)\n {\n $xpath = new DOMXPath($dom->ownerDocument);\n $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/' . Amazon::getVersion());\n\n $map = array(\n 'SwatchImage' => './az:SwatchImage',\n 'SmallImage' => './az:SmallImage',\n 'ThumbnailImage' => './az:ThumbnailImage',\n 'TinyImage' => './az:TinyImage',\n 'MediumImage' => './az:MediumImage',\n 'LargeImage' => './az:LargeImage',\n );\n\n $a = $dom->ownerDocument->saveXml($dom);\n\n foreach ($map as $paramName => $xquery) {\n $queryResult = $xpath->query($xquery, $dom);\n if ($queryResult->length <= 0) {\n continue;\n }\n $item = $queryResult->item(0);\n\n $this->$paramName = new Image($item);\n }\n }", "public function __construct() {\n\n add_filter( 'wp_handle_upload_prefilter', array( $this, 'process_image' ) );\n }", "public function __construct()\n {\n $this->transformer = new ReactionTransformer;\n }", "function __construct( /*..*/ )\n\t{\n\t\t$args = func_get_args();\n\t\t\n\t\t//1 arg - arg is URL to existing image\n\t\tif( func_num_args() == 1 )\n\t\t\t$this->load_image( $args[0] );\n\t\telse\n\t\t\t$this->new_image( $args[0], $args[1] );\n\t}", "public function __construct($sourceFile, $outputReferenceFile)\r\n\t{\r\n\t\tif (!file_exists($sourceFile))\r\n\t\t\tthrow new Exception(\"[$sourceFile] file dose not exists\");\r\n\t\t$this->sourceFile = $sourceFile;\r\n\t\t$this->outputReferenceFile = $outputReferenceFile;\r\n\t\t$this->referenceFile = $outputReferenceFile;\r\n\t\t$fileName = explode('.', basename($this->sourceFile));\r\n\t\t$this->targetFile = dirname($this->sourceFile) . \"/\" . $fileName[0] . 'Target.' . $fileName[1];\r\n\t\t\r\n\t\t// set up default parameters for convertion\r\n\t\t$this->params = array\r\n\t\t(\r\n\t\t\t'width' => 120,\r\n\t\t\t'height' => 90,\r\n\t\t\t'cropType' => 1,\r\n\t\t\t'bGColor' => 0xffffff,\r\n\t\t\t'forceJpeg' => 0,\r\n\t\t\t'quality' => 0,\r\n\t\t\t'srcX' => 0,\r\n\t\t\t'srcY' => 0,\r\n\t\t\t'srcW' => 0,\r\n\t\t\t'srcH' => 0,\r\n\t\t);\r\n\t}", "public function __construct(SysImages $sysImages)\n {\n parent::__construct();\n $this->sysImages = $sysImages;\n }", "public function __construct(\n private ClassFileNormalizer $classFileNormalizer,\n private ClassMoverFacade $classMover,\n private Filesystem $filesystem\n ) {\n }", "function iems_StageMap()\n {\n self::__construct();\n }", "function _construct(){ }", "public function __construct()\n {\n $this->makeSignature();\n\n parent::__construct();\n }", "public function __construct() {\n // Replaced two mappers with the MapperAspect\n //$this->userCatalogMapper = new UserCatalogMapper();\n //$this->electronicCatalogMapper = new ElectronicCatalogMapper();\n }", "public function __construct()\n {\n parent::__construct();\n $this->consultar = array(0);\n $this->registrar = array(0);\n $this->editar = array(0);\n $this->eliminar = array(0);\n $this->table_name = 'user';\n $this->_user = $this->loadModel('user');\n $this->getLibreria('fpdf/','pdfGenerador');\n $this->_pdf = new PDF;\n\n $this->getLibreria('resizeimage/','ModifiedImage');\n\n }", "function construct( ) {\n\n\t\t$name = \"image\";\n\t\t$this->name = $name;\n\t\t$sitepath = fieldsattachHelper::getabsoluteURL();\n\t\t$this->path1 = $sitepath .'images'.DS.'documents' ;\n\t\t$documentpath = fieldsattachHelper::getabsolutePATH();\n\n\t\tif ((JRequest::getVar('option')=='com_categories' && JRequest::getVar('layout')==\"edit\" )) {\n\t\t\t$this->documentpath = $documentpath.DS.'images'.DS.'documentscategories' ;\n\t\t}\n\n\n\t\t//LOAD LANGUAGE --------------------------------------------------------------\n\t\tparent::getLanguage($name);\n\t\t//-----------------------------------------------------------------------------\n\n\t}", "abstract public function __construct(string $name, int $width, int $height, array $images);", "public function __construct() {\r\n\r\n // set default values for properties\r\n $this->chmod_value = 0755;\r\n\r\n $this->error = 0;\r\n\r\n $this->jpeg_quality = 85;\r\n\r\n $this->png_compression = 9;\r\n\r\n $this->webp_quality = 80;\r\n\r\n $this->preserve_aspect_ratio = $this->preserve_time = $this->enlarge_smaller_images = $this->bmp_compressed = true;\r\n\r\n $this->sharpen_images = $this->auto_handle_exif_orientation = $this->jpeg_interlace = false;\r\n\r\n $this->source_path = $this->target_path = '';\r\n\r\n }", "public function __construct()\r\n {\r\n $this->file_type=self::IMAGE_TYPE_JPG;\r\n $this->manipulation_action=self::IMAGE_ACTION_FILL;\r\n $this->result=false;\r\n $this->whitepaper_color=[255,255,255];\r\n $this->transparency_color=[0,0,0,127];\r\n $this->msg=\"Please select image file path/URL!\";\r\n }", "public function __construct($reflectionClass) {\r\n $this->setReflectionClass($reflectionClass);\r\n }", "public function __construct(Image $originalAsset)\n {\n $this->originalAsset = $originalAsset;\n\n $this->thumbnails = new ArrayCollection();\n $this->adjustments = new ArrayCollection();\n $this->tags = new ArrayCollection();\n $this->lastModified = new \\DateTime();\n }", "public function __construct($image){\t\t$this->cache_folder = parent::getApplicationPath().parent::getConfiguration()['cache_folder'];\n\t\t$this->images_folder = parent::getApplicationPath().parent::getConfiguration()['images_folder'];\n\n\n\t\tif(!file_exists($this->cache_folder)){\n\t\t\tmkdir($this->cache_folder, 0777, true);\n\t\t}\n\n\t\tself::makeParameters($image);\n\t}", "protected function transform(sfImage $image)\r\n {\r\n $new_img = $image->getAdapter()->getTransparentImage($image->getWidth(), $image->getHeight());\r\n\r\n imagealphablending($new_img, false);\r\n imagesavealpha($new_img, true);\r\n\r\n $opacity = (int)round(127-((127/100)*$this->getOpacity()));\r\n\r\n // imagesavealpha($new_img, true);\r\n $width = $image->getWidth();\r\n $height = $image->getHeight();\r\n\r\n for ($x=0;$x<$width; $x++)\r\n {\r\n for ($y=0;$y<$height; $y++)\r\n {\r\n $rgb = imagecolorat($image->getAdapter()->getHolder(), $x, $y);\r\n $r = ($rgb >> 16) & 0xFF;\r\n $g = ($rgb >> 8) & 0xFF;\r\n $b = $rgb & 0xFF;\r\n $alpha = ($rgb & 0x7F000000) >> 24;\r\n\r\n $new_opacity = ($alpha + ((127-$alpha)/100)*$this->getOpacity());\r\n\r\n $colors[$alpha] = $new_opacity;\r\n\r\n $color = imagecolorallocatealpha($new_img, $r, $g, $b, $new_opacity);\r\n imagesetpixel($new_img,$x, $y, $color);\r\n }\r\n }\r\n\r\n $image->getAdapter()->setHolder($new_img);\r\n\r\n return $image;\r\n }", "function metaInit () {\n $this->imageMeta = new ImageMeta($this->getImagePath());\n $this->imageMeta->getMeta();\n }", "public function __construct($image,$dimensions)\n {\n $this->image=$image;\n $this->dimensions=$dimensions;\n }", "public function __construct($img, $nombre, $precio)\n {\n $this->nombre= $nombre;\n $this->img= $img;\n $this->precio= $precio;\n }", "function Utilities_Image(){\n\t\t// $this->$imageAsset = $img;\t\t\n\t}", "public function initializeObject() {\n\t\t$transformClassNames = static::getTransformImplementationClassNames($this->objectManager);\n\t\tforeach ($transformClassNames as $transformClassName) {\n\t\t\t/** @var TransformInterface $transform */\n\t\t\t$transform = $this->objectManager->get($transformClassName);\n\t\t\tif (isset($this->transforms[$transform->getAttributeType()][$transform->getPriority()])) {\n\t\t\t\tthrow new DuplicateTransformException('There is more than one transform that can transform the attribute type ' . $transform->getAttributeType() . ' with priority ' . $transform->getPriority() . ' and ' . get_class($transform) . '.', 1391459078);\n\t\t\t}\n\t\t\t$this->transforms[$transform->getAttributeType()][$transform->getPriority()] = $transform;\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->fileClassFactory = new FileFactory();\n }", "public function __construct() {\n $this->img = 'test_crown_1.png';\n $this->type = array('orientation' => 'bottom', 'count' => 1);\n }", "function __constructor(){}", "function __construct($row, AttributeGroup $grp){\n\t\tFEAttribute::__construct($row, $grp);\n\n\t\t$this->ImageSizes = $this->getSizes($this->PHPData['sizes']);\n\t\treset($this->ImageSizes);\n\t\t$this->imageSize = key($this->ImageSizes);\n\t}", "public function __construct() {\n\t\t$this\n\t\t\t->calculateMaxTargets()\n\t\t\t->generateMap()\n\t\t\t->populateMap();\n\t}", "public function __construct($id=0,$image='',$coord_x=0,$coord_y=0,$terrain=0,$occupe='') {\n\t\t//Generated by ObjectGenerator::generateConstruct()\n\t\tparent::__construct($titre,$nb_joueur_min,$nb_joueur_max,$fantassins_min,$fantassins_max,$motorise_min,$motorise_max,$aerien_min,$aerien_max);\n\t\t$this->_id = $id;\n\t\t$this->_image = $image;\n\t\t$this->_coord_x = $coord_x;\n\t\t$this->_coord_y = $coord_y;\n\t\t$this->_terrain = $terrain;\n\t\t$this->_occupe = $occupe;\n\n\t/*\n\t * Entre ces deux balises vous pourrez mettre votre code specifique a la classe.\n\t * Il sera preserve lors de la reconstruction automatique.\n\t */\n\t/*[TAG-__construct1]*/\t/*[/TAG-__construct1]*/\n\n\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function __construct() {\n parent::__construct(WS_PHIS_PATH, \"images\");\n }", "public function __construct($planet_image, $planet_data_file)\n {\n if (file_exists($planet_image))\n $this->image = $planet_image;\n else\n echo \"ERROR CANNOT FIND IMAGE FILE: $planet_image <br>\";\n \n //set the data file\n if (file_exists($planet_data_file))\n $data = file_get_contents($planet_data_file);\n else\n echo \"ERROR CANNOT FIND DATA FILE: $planet_data_file <br>\";\n \n //snip out all the tags from the data file\n preg_match_all (\"#\\[.*?\\].*?\\[/\\]#sm\",$data,$tags);\n $tags = $tags[0];\n\n \n if (!empty($tags))\n {\n foreach ($tags as $tag)\n {\n $tag_type = strtolower(substr($tag, 1, strpos($tag,\"]\")-1));\n $tag_type[0] = strtoupper($tag_type[0]);\n $tag_data = substr($tag, (strlen($tag_type) + 2), (strlen($tag) - strlen($tag_type) - 5));\n $tag_data = trim($tag_data);\n\n\n switch ($tag_type){\n case \"Title\":\n $this->title = $tag_data;\n break;\n case \"Info\":\n $this->info = $tag_data;\n break;\n case \"Gravity\":\n $this->gravity = $tag_data;\n break;\n default:\n $this->facts[$tag_type] = $tag_data;\n\n }\n }\n }\n }", "public function __construct($imagePath)\n {\n if (!file_exists($imagePath)) {\n throw new \\Exception(\n \"Unable in instantiate ImageProcessor {$imagePath} does not exist.\"\n );\n }\n\n $imageInfo = pathinfo($imagePath);\n $imageType = $imageInfo['extension'];\n\n switch (strtolower($imageType)) {\n case \"jpeg\":\n case \"jpg\":\n $this->image = @imagecreatefromjpeg($imagePath);\n if ($this->image === false) {\n throw new \\Exception(\"{$imagePath} is not a valid jpeg file\");\n }\n break;\n case \"png\":\n $this->image = @imagecreatefrompng($imagePath);\n if ($this->image === false) {\n throw new \\Exception(\"{$imagePath} is not a valid png file\");\n }\n imagealphablending($this->image, true);\n imagesavealpha($this->image, true);\n break;\n default:\n throw new \\Exception(\"Unsupported file type {$imageType} supplied.\");\n }\n\n list($this->width, $this->height) = getimagesize($imagePath);\n }", "public function __construct($file)\n {\n try\n {\n // Get the real path to the file\n $file = realpath($file);\n\n // Get the image information\n $info = getimagesize($file);\n }\n catch (Exception $e)\n {\n // Ignore all errors while reading the image\n }\n\n if (empty($file) OR empty($info))\n {\n // throw new Exception('Not an image or invalid image: :file',\n // array(':file' => Kohana::debug_path($file)));\n return '';\n }\n\n // Store the image information\n $this->file = $file;\n $this->width = $info[0];\n $this->height = $info[1];\n $this->type = $info[2];\n $this->mime = image_type_to_mime_type($this->type);\n\n // Set the image creation function name\n switch ($this->type)\n {\n case IMAGETYPE_JPEG:\n $create = 'imagecreatefromjpeg';\n break;\n case IMAGETYPE_GIF:\n $create = 'imagecreatefromgif';\n break;\n case IMAGETYPE_PNG:\n $create = 'imagecreatefrompng';\n break;\n }\n\n if ( ! isset($create) OR ! function_exists($create))\n {\n // throw new Exception('Installed GD does not support :type images',\n // array(':type' => image_type_to_extension($this->type, FALSE)));\n }\n\n // Save function for future use\n $this->_create_function = $create;\n\n // Save filename for lazy loading\n $this->_image = $this->file;\n }", "public function getTransformFactory()\n {\n return $this->transform_factory;\n }", "public function __construct()\n {\n parent::__construct('Transformer must be a callable or an instance of [' . Transformer::class . '].');\n }", "public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/Google/ComputeEngine/Images/GetImage/');\n }", "protected function _construct() {\n\t\t$this->_fileObj = $this->fileObj();\n\t}", "public function construct() {\n\n\t // Declare each ACF fields on the entity\n\t foreach (static::$acf_mapping as $fieldName => $fieldKey) {\n\t $this->set($fieldName, new LazyACFLoader($fieldKey, $fieldName, $this->ID));\n }\n\n\t}", "public function __construct($img = false) {\n\t\tif($img) {\n\t\t\t$img = (string) $img;\n\t\t\tif(file_exists($img) && is_readable($img)) {\n\t\t\t\t// Basic details we need to figure out how to handle the image.\n\t\t\t\t$supported_image_type = false;\n\t\t\t\t$img_extension = pathinfo($img, PATHINFO_EXTENSION);\n\t\t\t\t$img_file_name = pathinfo($img, PATHINFO_BASENAME);\n\t\t\t\t$img_mime = mime_content_type($img);\n\t\t\t\t$img_size = getimagesize($img);\n\n\t\t\t\t// Convert valid types to a true color image.\n\t\t\t\tswitch($img_extension) {\n\t\t\t\t\tcase 'gif':\n\t\t\t\t\t\tif($img_mime === 'image/gif') {\n\t\t\t\t\t\t\t$supported_image_type = true;\n\t\t\t\t\t\t\t$gif_img = imagecreatefromgif($img);\n\t\t\t\t\t\t\tif($gif_img) {\n\t\t\t\t\t\t\t\t$this->image = imagecreatetruecolor($img_size[0], $img_size[1]);\n\t\t\t\t\t\t\t\tif(!imagecopy($this->image, $gif_img, 0, 0, 0, 0, $img_size[0], $img_size[1])) {\n\t\t\t\t\t\t\t\t\t$this->image = false;\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\tbreak;\n\t\t\t\t\tcase 'png':\n\t\t\t\t\t\tif($img_mime === 'image/png') {\n\t\t\t\t\t\t\t$supported_image_type = true;\n\t\t\t\t\t\t\t$png_img = imagecreatefrompng($img);\n\t\t\t\t\t\t\tif($png_img) {\n\t\t\t\t\t\t\t\t$this->image = imagecreatetruecolor($img_size[0], $img_size[1]);\n\t\t\t\t\t\t\t\tif(!imagecopy($this->image, $png_img, 0, 0, 0, 0, $img_size[0], $img_size[1])) {\n\t\t\t\t\t\t\t\t\t$this->image = false;\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\tbreak;\n\t\t\t\t\tcase 'jpg':\n\t\t\t\t\tcase 'jpeg':\n\t\t\t\t\t\t$img_extension = 'jpg';\n\t\t\t\t\t\tif($img_mime === 'image/jpeg') {\n\t\t\t\t\t\t\t$supported_image_type = true;\n\t\t\t\t\t\t\t$jpg_img = imagecreatefromjpeg($img);\n\t\t\t\t\t\t\tif($jpg_img) {\n\t\t\t\t\t\t\t\t$this->image = imagecreatetruecolor($img_size[0], $img_size[1]);\n\t\t\t\t\t\t\t\tif(!imagecopy($this->image, $jpg_img, 0, 0, 0, 0, $img_size[0], $img_size[1])) {\n\t\t\t\t\t\t\t\t\t$this->image = false;\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\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// If we have a working image, get rolling.\n\t\t\t\tif($supported_image_type && $this->image) {\n\t\t\t\t\t// Make alpha work.\n\t\t\t\t\timagealphablending($this->image, true);\n\t\t\t\t\timagesavealpha($this->image, true);\n\n\t\t\t\t\t// Set helpful info about the file.\n\t\t\t\t\t$this->width = $img_size[0];\n\t\t\t\t\t$this->height = $img_size[1];\n\t\t\t\t\t$this->path = $img;\n\t\t\t\t\t$this->filename = $img_file_name;\n\t\t\t\t\t$this->mime = $img_mime;\n\t\t\t\t\t$this->ext = $img_extension;\n\t\t\t\t\t$this->aspect = $this->width/$this->height;\n\t\t\t\t\tif($this->aspect > 1) {\n\t\t\t\t\t\t$this->orientation = 'landscape';\n\t\t\t\t\t} else if($this->aspect < 1) {\n\t\t\t\t\t\t$this->orientation = 'portrait';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->orientation = 'square';\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error('The image could not be opened because it is not a valid image.', E_USER_WARNING);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function __construct()\n {\n if (6 == func_num_args()) {\n $this->fmiId = func_get_arg(0);\n $this->fmiText = func_get_arg(1);\n $this->occurrenceCount = func_get_arg(2);\n $this->spnDescription = func_get_arg(3);\n $this->spnId = func_get_arg(4);\n $this->txId = func_get_arg(5);\n }\n }", "public function __construct(){\n $this->_converterIndexation = new ConverterIndexation();\n }", "public function __construct(BaseImagick $image)\n {\n $this->image = $image;\n\n //Convert CMYK to RGB\n if ($this->image->getImageColorspace() !== BaseImagick::COLORSPACE_CMYK) {\n return $this;\n }\n\n $profiles = $this->image->getImageProfiles('*', false);\n\n if (array_search('icc', $profiles) === false) {\n $this->image->profileImage('icc', file_get_contents(__DIR__.'/icc/us_web_uncoated.icc'));\n }\n\n $this->image->profileImage('icm', file_get_contents(__DIR__.'/icc/srgb.icm'));\n $this->image->transformImageColorspace(BaseImagick::COLORSPACE_SRGB);\n }", "public function __construct()\n {\n $this->transformations = [\n function ($value) : bool {\n return 'false' === $value ? false : (bool) $value;\n }\n ];\n }", "private function __construct()\n {\n $this->create_acf_group();\n }", "function img ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('timg');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function __construct(Image $image)\n {\n // $this->middleware('auth:api');\n $this->model = $image;\n }", "public function __construct()\n {\n $this->setActive( TRUE );\n $this->setAllowGif( FALSE );\n $this->setAllowPng( FALSE );\n $this->setApplyWatermark( TRUE );\n $this->setCreatedAt( new \\DateTime() );\n $this->setFilename( NULL );\n $this->setGif( FALSE );\n $this->setPng( FALSE );\n $this->setPosition( 0 );\n $this->setRating( 3 );\n $this->setRatingsCount( 1 );\n $this->setTitle( NULL );\n $this->setType( 'pin' );\n $this->setViews( 0 );\n }", "public function __construct()\n {\n parent::__construct();\n $this->pipeline = getAssetPipeline();\n }", "public function __construct() {\n $this->customerOriginalImageUploadPath = Config::get('constant.CUSTOMER_ORIGINAL_IMAGE_UPLOAD_PATH');\n $this->customerThumbImageUploadPath = Config::get('constant.CUSTOMER_THUMB_IMAGE_UPLOAD_PATH');\n $this->customerThumbImageHeight = Config::get('constant.CUSTOMER_THUMB_IMAGE_HEIGHT');\n $this->customerThumbImageWidth = Config::get('constant.CUSTOMER_THUMB_IMAGE_WIDTH');\n\n $this->customerProofFrontOriginalImageUploadPath = Config::get('constant.CUSTOMER_PROOF_FRONT_ORIGINAL_IMAGE_UPLOAD_PATH');\n $this->customerProofFrontThumbImageUploadPath = Config::get('constant.CUSTOMER_PROOF_FRONT_THUMB_IMAGE_UPLOAD_PATH');\n $this->customerProofFrontThumbImageHeight = Config::get('constant.CUSTOMER_PROOF_FRONT_THUMB_IMAGE_HEIGHT');\n $this->customerProofFrontThumbImageWidth = Config::get('constant.CUSTOMER_PROOF_FRONT_THUMB_IMAGE_WIDTH');\n\n $this->customerProofBackOriginalImageUploadPath = Config::get('constant.CUSTOMER_PROOF_BACK_ORIGINAL_IMAGE_UPLOAD_PATH');\n $this->customerProofBackThumbImageUploadPath = Config::get('constant.CUSTOMER_PROOF_BACK_THUMB_IMAGE_UPLOAD_PATH');\n $this->customerProofBackThumbImageHeight = Config::get('constant.CUSTOMER_PROOF_BACK_THUMB_IMAGE_HEIGHT');\n $this->customerProofBackThumbImageWidth = Config::get('constant.CUSTOMER_PROOF_BACK_THUMB_IMAGE_WIDTH');\n }", "abstract public function transform();", "public function __construct(IReflection $reflection, Generator $generator)\n\t{\n\t\t$this->generator = $generator;\n\t\t$this->config = $generator->getConfig();\n\t\t$this->classes = $generator->getClasses();\n\t\t$this->functions = $generator->getFunctions();\n\n\t\t$this->reflectionType = get_class($this);\n\t\tif (!isset(self::$reflectionMethods[$this->reflectionType])) {\n\t\t\tself::$reflectionMethods[$this->reflectionType] = array_flip(get_class_methods($this));\n\t\t}\n\n\t\t$this->reflection = $reflection;\n\t}", "public function __construct()\n {\n $this->defaultStyle = \"rotatingPlane\";\n $this->defaultColor = \"black\";\n $this->container = null;\n }", "function __construct() ;", "public function __construct(ImageLogicAgent $imageLogicAgent)\n {\n $this->imageLogicAgent = $imageLogicAgent;\n }", "public function initFromVips(VipsImage $object): InterventionImage\n {\n return new InterventionImage(new Driver, $object);\n }", "function __construct() {\r\n\t\tfor($x=1; $x <= $this->map['width']; $x++):\r\n\t\t\tfor($y=1; $y <= $this->map['height']; $y++):\r\n\t\t\t\t$this->map['tiles'][$x][$y]['init'] = true;\r\n\t\t\tendfor;\r\n\t\tendfor;\t\t\r\n\t}", "function __construct() {\n parent::__construct();\n\n $this->_converter = new \\System\\Data\\Converter();\n }", "public function __construct()\n\t{\n\t\t// to install GD in Ubuntu server:\n\t\t// sudo apt-get install php5-gd\n\t\tif(!function_exists('ImageCreate'))\n\t\t\tfatal_error('Error: GD is not installed') ;\n\t}", "public function __construct($path_img)\n {\n\t\t$this->pathToImg = $path_img;\n\n\t\t\tif($this->getImgType($path_img)==2 || $this->getImgType($path_img)==3){ // IMAGETYPE_JPEG || IMAGETYPE_PNG\n\t\t\t}else{\n\t\t\t\techo $this->is_img($this->pathToImg);\n\t\t\t}\n }", "public function __construct($imagem){\r\n\t\t\r\n\t\t$this->imagem = $imagem;\r\n\t\t$this->pasta = 'uploads/';\r\n\t\t$this->cont = 0;\r\n\t\t$this->erros = 0;\r\n\t\t$this->envios = 0;\r\n\t\t$this->sucesso = 0;\r\n\t }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->circle = func_get_arg(0);\n $this->polygon = func_get_arg(1);\n }\n }", "public function fromDocument($document) {\r\n parent::fromDocument($document);\r\n $this->imageRef = $document[self::FIELD_IMAGE_REF];\r\n return $this;\r\n }", "protected function createCsConvObject() {}", "public function __construct($iCodigoMatricula = null) {\n $this->oMatricula = new Matricula($iCodigoMatricula);\n }", "protected function createTransformer()\n {\n $this->createClass('transformer');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->demandSourceTransparency = false;\n $this->enableViewTagcadeReport = false;\n }", "public function fn_construct_class() {\n\t}", "private final function __construct() {}", "public function __construct($file)\n {\n // GD is required for image processing\n if (!extension_loaded('gd') || !function_exists('imagecreatefrompng'))\n {\n throw new PHPMapper_Exception(\n 'The PHP GD extension is required.'\n );;\n }\n\n if (!file_exists($file))\n {\n throw new PHPMapper_Exception_Image(\n \"Map image '$file' does not exist.\"\n );\n }\n\n if (!$this->_image = imagecreatefrompng($file))\n {\n throw new PHPMapper_Exception_Image(\"Failed to load {$file}.\");\n }\n\n list($this->_maxWidth, $this->_maxHeight) = getimagesize($file);\n }", "public function __construct() {\n\t\trequire_once 'fs.php';\n\t\t$this->a = new Advertikon\\Fs();\n\t}", "public function __construct()\n {\n if (!extension_loaded('gd')) {\n throw new Omeka_File_Derivative_Exception('This derivative strategy requires the extension GD.');\n }\n }", "public function __construct(\n // img service needed params\n string $src = '',\n bool $local = false,\n bool $original = false,\n int $compression = null,\n int $compressionWebp = null,\n int $width = 0,\n int $height = 0,\n string $fit = '',\n string $position = '',\n bool $greyscale = false,\n string $colorize = '',\n // this core component specific options\n string $tag = 'span',\n string $href = '',\n string $alt = '',\n bool $immediate = false,\n bool $thumb = true,\n bool $fixed = false,\n string $bgColor = '',\n bool $cage = true,\n string $cssFit = 'cover',\n bool $progress = false,\n string $attrsRoot = '',\n string $attrs = ''\n ) {\n $img = new ImgService($src, [\n 'local' => $local,\n 'original' => $original,\n 'compression' => $compression,\n 'compressionWebp' => $compressionWebp,\n 'w' => $width,\n 'h' => $height,\n 'fit' => $fit,\n 'position' => $position,\n 'greyscale' => $greyscale,\n 'colorize' => $colorize,\n ]);\n\n $this->img = $img->getMeta();\n $this->tag = $href ? 'a' : $tag;\n $this->href = $href;\n $this->alt = $alt;\n $this->immediate = $immediate;\n $this->thumb =\n $thumb && $this->img['thumb']\n ? $this->img['thumb']\n : 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n $this->fixed = $fixed;\n $this->bgColor = $bgColor;\n $this->cage = $cage;\n $this->cssFit = $cssFit;\n $this->progress = $progress;\n $this->attrsRoot = $attrsRoot;\n $this->attrs = $attrs;\n }", "public function __construct()\n {\n $this->name = \"Вода\";\n $this->src = 'water.png';\n $this->color_test = \"#0048BA\";\n\n parent::__construct();\n }", "public function __construct()\n {\n if (8 == func_num_args()) {\n $this->signatureMethodUniqueId = func_get_arg(0);\n $this->firstName = func_get_arg(1);\n $this->middleName = func_get_arg(2);\n $this->lastName = func_get_arg(3);\n $this->fullName = func_get_arg(4);\n $this->dateOfBirth = func_get_arg(5);\n $this->signatureMethod = func_get_arg(6);\n $this->signedTime = func_get_arg(7);\n }\n }", "public function __construct() {\n // update default vars with configuration file\n SELF::updateVars();\n // add custom fields\n if($this->WPimgAttr_Alt_content == 1 || $this->WPimgAttr_Alt_attachment == 1):\n // add custom fields\n add_filter( 'attachment_fields_to_edit', array( $this, 'WPimgAttr_Alt_meta_CustomFields' ), null, 2 );\n // update custom fields\n add_action('add_attachment', array( $this, 'WPimgAttr_Alt_meta_Attachments_Save' ), 10, 2 );\n add_action('edit_attachment', array( $this, 'WPimgAttr_Alt_meta_Attachments_Save' ), 10, 2 );\n endif;\n // alt img in the_content\n if($this->WPimgAttr_Alt_content == 1):\n add_filter('the_content', array( $this, 'IMGalt_Content' ) );\n endif;\n // alt img in do_shortcode\n if($this->WPimgAttr_Alt_shortcode == 1):\n add_filter('do_shortcode', array( $this, 'IMGalt_Content' ) );\n endif;\n // alt img for attachments\n if($this->WPimgAttr_Alt_attachment == 1):\n add_filter( 'wp_get_attachment_image_attributes', array( $this, 'IMGalt_Attachment' ), 10, 2 );\n endif;\n }" ]
[ "0.65810734", "0.5751777", "0.56694704", "0.5645388", "0.5523482", "0.5435533", "0.5394683", "0.53942305", "0.53505343", "0.53191453", "0.5273299", "0.52680194", "0.5261706", "0.5187083", "0.5161405", "0.5161405", "0.5158899", "0.5125734", "0.51200116", "0.5053963", "0.5051154", "0.50403565", "0.5026857", "0.5011655", "0.4968444", "0.49595237", "0.4951001", "0.49383083", "0.49296138", "0.49080977", "0.49073833", "0.48875612", "0.48865503", "0.48690194", "0.48635477", "0.48615417", "0.4860102", "0.48574576", "0.48408192", "0.4837625", "0.48189434", "0.48168015", "0.4808821", "0.4808391", "0.4799824", "0.4795612", "0.47875097", "0.4787421", "0.477806", "0.477108", "0.47635567", "0.47499296", "0.47409654", "0.4737562", "0.4732157", "0.47283152", "0.47269863", "0.47212008", "0.47207978", "0.47145244", "0.4709699", "0.47029558", "0.47025478", "0.469989", "0.4695592", "0.46911114", "0.46895584", "0.46882558", "0.46842656", "0.4680488", "0.46760333", "0.46745476", "0.46708003", "0.46673715", "0.46659636", "0.46427566", "0.46426624", "0.46392804", "0.4639063", "0.46337402", "0.46263438", "0.4618015", "0.46144602", "0.46107092", "0.4608458", "0.4603277", "0.4602575", "0.4590838", "0.45873308", "0.4574395", "0.45668533", "0.4562258", "0.45566803", "0.45519152", "0.4549468", "0.45492262", "0.4541693", "0.45387852", "0.45348942", "0.45338738" ]
0.5440203
5
Sets the reflection height
public function setReflectionHeight($reflection_height) { if (is_numeric($reflection_height)) { $this->reflection_height = (int)$reflection_height; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setHeight($height) {}", "public function setHeight($height);", "public function setHeight($height);", "function set_height($height) {\n $this->height = $height;\n }", "public function setHeight($height) {\n $this->h = $height;\n }", "public function setHeight($height)\n {\n $this->height = $height;\n }", "public function setHeight($height)\n {\n $this->height = $height;\n }", "#[@fromDia(xpath= 'dia:attribute[@name=\"height\"]/dia:real/@val', value= 'real')]\n public function setHeight($height) {\n $this->setReal('height', $height);\n }", "public function setHeight($height = 40)\n {\n $this->height = $height;\n $this->setAttributes(\"Height\");\n }", "public function getReflectionHeight()\r\n {\r\n return $this->reflection_height;\r\n }", "public function setHeight($height)\n {\n $this->height = (int) $height;\n }", "function setImageHeight($height)\n {\n $this->imageHeight = $height;\n }", "public function setHeight($height)\r\n {\r\n if (is_numeric($height))\r\n {\r\n $this->height = (int)$height;\r\n }\r\n }", "public function setHeight($val)\n {\n $this->_propDict[\"height\"] = floatval($val);\n return $this;\n }", "public function setHeight($height) {\n\t\t$this->_height=$height;\n\t\t$this->_autoHeight=$height;\n\t}", "public function setImageHeight($value)\n\t{\n\t\t$this->setViewSTate('ImageHeight',$value,'');\n\t}", "public function setHeight($height) {\n\t\t$height = (int) $height;\n\t\t$this->height = (($height > 0) && ($height <= self::MAX_HEIGHT)) ? $height : self::DEFAULT_HEIGHT;\n\t}", "public final function setHeight($height)\n {\n $this->googleVisualization->setHeight($height);\n }", "public function setHeaderHeightProps() {\n\t\t$this->heightOfTransparency = $this->calculateHeightOfTransparency();\n\t\t$this->heightOfCompleteTransparency = $this->calculateHeightOfCompleteTransparency();\n\t\t$this->headerHeight = $this->calculateHeaderHeight();\n\t}", "public function r_height($value = null)\n {\n $this->r_height = $value;\n }", "public function setHeight($value)\n {\n return $this->setProperty(\"Height\", $value, true);\n }", "public function setHeightAttribute($height = null)\n\t{\n\t\t$this->attributes['height'] = intval($height);\n\t}", "function getHeight() {\n\t\t}", "public function setHeight($value) {\n $this->settings['height'] = $value;\n // Return for chaining\n return $this;\n }", "public function setImageHeight(int $iHeight) : void\n {\n $this->iImageHeight = $iHeight;\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "public function height($value) {\n return $this->setProperty('height', $value);\n }", "function setPaperHeight($paperHeight) {\t \r\n\t $this->paperHeight = $paperHeight;\r\n\t}", "public function setImageHeight($value)\n\t{\n\t\t$this->imageHeight = $value;\n\t\treturn $this;\n\t}", "public function setHeight($var)\n {\n GPBUtil::checkUint32($var);\n $this->height = $var;\n\n return $this;\n }", "public function getLineHeightFactor() {}", "final public function set_height($height)\n {\n $this->height = $height;\n return $this;\n }", "public function setHeight($value)\n {\n $this->height = (int) $value;\n\n if ($this->height < 1) {\n throw new \\RuntimeException('Height must be greater than 0: ' . $this->height);\n }\n }", "protected function addHeight()\n {\n $this->add(array(\n 'name' => 'height',\n 'required' => true,\n 'filters' => array(\n array('name' => 'Zend\\Filter\\Int'),\n ),\n ));\n \n return $this;\n }", "public function setHeight($height)\n\t{\n\t\tif (is_numeric($height))\n\t\t{\n\t\t\t$height = $height . 'px';\n\t\t}\n\t\t$this->setContainerStyle('height', $height);\n\t}", "function setHeight($inHeight) {\n\t\tif ( $inHeight !== $this->_Height ) {\n\t\t\t$this->_Height = $inHeight;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function setDimensions($width, $height) {}", "public function setPageHeight($value)\n {\n $this->fields['options']['height'] = $value;\n }", "public function setHeight($height)\n {\n $this->Height = $height;\n return $this;\n }", "public function Height(int $height)\n {\n return $this->setOption('h', $height);\n }", "public function __construct($reflection_height=20, $start_transparency=30)\r\n {\r\n $this->setReflectionHeight($reflection_height);\r\n $this->setStartTransparency($start_transparency);\r\n }", "public function setHeight($height)\n {\n $this->height = (float) $height;\n\n return $this;\n }", "function ks_acf_wysiwyg_field_height_setting($field) {\n\tacf_render_field_setting($field, array(\n\t\t'label'\t=> 'Height',\n\t\t'name' => 'editor_height',\n\t\t'type' => 'number',\n 'placeholder' => '300',\n 'append' => 'px'\n\t));\n}", "public function reflection($height=null, $opacity=null, $fade_in=null);", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "function get_height() {\n //based on image height\n return $this->_height;\n }", "public function setHeight($height)\n\t{\n\t\tif (preg_match ( '/^\\d+$/', $height ))\n\t\t{\n\t\t\tif ($height > 0)\n\t\t\t{\n\t\t\t\t$this->_height = $height;\n\t\t\t} else\n\t\t\t{\n\t\t\t\tthrow new Lumia_Placeholder_Exception(__METHOD__ . '() Height must be greater than zero.');\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tthrow new Lumia_Placeholder_Exception(__METHOD__ . '() Height must be an integer.');\n\t\t}\n\t}", "private function scaleY() : void \n\t{\n\t\t$this->range = abs($this->rangeYLow) + abs($this->rangeYHigh);\n\n\t\t$this->scaleY = ((float)$this->sizeY / $this->range);\n\t\t$this->originY = $this->sizeY >> 1;\n\t}", "public function testSetHeightProduct()\n {\n $product = new Product();\n $value = 9;\n $product->setHeight($value);\n $this->assertEquals($value, $product->getHeight());\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }", "function getHeight() {\n // return $originalHeight;\n\t\t\n return $this->height;\n }", "public function setHeight(int $height): self\n {\n $this->height = $height;\n return $this;\n }", "public function getLineHeight() {}", "function setMaxHeight($height) {\n $this->field['max_height'] = (int) $height;\n\n return $this;\n }", "function getHeight();", "function getHeight() {\n\t\treturn $this->_Height;\n\t}", "public function set_height($height, $hpp) {\n if (is_numeric($height) && $height > 0) {\n $hpp = strtolower($hpp);\n if ($hpp == 'px' || $hpp == '%') {\n $this->_height = abs($height);\n $this->_hpp = $hpp;\n }\n }\n }", "public function height(){\n\t\t\t\treturn\t$this->_actual_height + $this->_titleHeight + $this->_spacing;\n\t\t}", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function resizeToHeight($height) {\r\n\t\t$ratio = $height / $this->getHeight();\r\n\t\t$width = $this->getWidth() * $ratio;\r\n\t\t$this->resize($width,$height);\r\n\t}", "protected function setHeight($height)\n\t{\n\t\tif ( ! is_numeric($height) || $height < 1)\n\t\t{\n\t\t\tthrow new \\InvalidArgumentException('Wrong the height value.');\n\t\t}\n\t\t\n\t\t$this->height = $height;\n\t\t\n\t\treturn $this;\n\t}", "public function setLineHeight($lineHeight) {}", "public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }", "public function setSize($width,$height) \n {\n $this->width = $width;\n $this->height = $height;\n }", "protected function height() {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function setHeight(int $height)\n {\n $this->height = $height / 100;\n\n return $this;\n }", "function resizeToHeight($height)\n {\n //obtine ratio dividiendo altura dada entre la altura actual de la imagen.\n $ratio = $height / $this->getHeight();\n //obtiene ancho con el ancho actual de la imagen por el ratio.\n $width = $this->getWidth() * $ratio;\n //redimensiona la imagen.\n $this->resize($width,$height);\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 }", "final public function get_height()\n {\n return $this->height;\n }", "public function height(int $height): self\n {\n $this->height = $height;\n\n return $this;\n }", "public function setHeight($height)\n {\n if(is_numeric($height) && $height > 0)\n {\n $this->height = (int)$height;\n \n return true;\n }\n \n return false;\n }", "function _set_img_y($size)\r\n {\r\n $this->img_y = $size;\r\n }", "public function get_image_height()\n {\n }", "public function setPixelHeightUnwrapped($var)\n {\n $this->writeWrapperValue(\"pixel_height\", $var);\n return $this;}", "public function setDimensions($width, $height) {\n $this->width = $width;\n $this->height = $height;\n }" ]
[ "0.74369156", "0.72017986", "0.72017986", "0.7192791", "0.67549103", "0.66660833", "0.66660833", "0.6662472", "0.6655143", "0.6621353", "0.6537371", "0.6536875", "0.6398766", "0.6393899", "0.63867325", "0.63680416", "0.62719893", "0.62236655", "0.6198926", "0.6198861", "0.6178188", "0.6155734", "0.60917014", "0.60657454", "0.60603935", "0.60527444", "0.60527444", "0.60527444", "0.60527444", "0.6036693", "0.59663415", "0.5960946", "0.593584", "0.5900697", "0.5854442", "0.58345497", "0.5810548", "0.579672", "0.57528675", "0.575138", "0.575138", "0.575138", "0.575138", "0.575138", "0.5751327", "0.57494956", "0.5705129", "0.5643335", "0.56402886", "0.563574", "0.5630765", "0.5617361", "0.5605789", "0.55978024", "0.55978024", "0.55978024", "0.55978024", "0.55978024", "0.55977255", "0.5565539", "0.5564773", "0.55644155", "0.55476433", "0.55201316", "0.5513088", "0.5512654", "0.5510834", "0.5507717", "0.5500648", "0.54879785", "0.54840654", "0.54743725", "0.54647183", "0.5461449", "0.5433087", "0.5426742", "0.5417945", "0.54095364", "0.5406389", "0.54045945", "0.5402454", "0.5402454", "0.5402454", "0.5402454", "0.5402454", "0.5402454", "0.5402454", "0.5402454", "0.5402454", "0.5402454", "0.5399548", "0.5388445", "0.5381111", "0.5370532", "0.5359078", "0.5355895", "0.5354933", "0.5350302", "0.5346695", "0.5335135" ]
0.71712685
4
Gets the reflection height
public function getReflectionHeight() { return $this->reflection_height; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }", "public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }", "public function getHeight()\n {\n return $this->data->height;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "public function getHeight()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_v($this->h);\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight()\n {\n return $this->height;\n }", "public function getHeight() {\n return $this->h;\n }", "public function getHeight() {\n\t\treturn $this->_height;\n\t}", "protected function height() {\n return $this->height;\n }", "public function getHeight()\r\n {\r\n return $this->height;\r\n }", "function\tgetHeight() {\n\t\treturn $this->height ;\n\t}", "public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}", "function getHeight() {\n\t\treturn $this->_Height;\n\t}", "public function height() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$height = 0;\n\n\t\t\tif ($dims = $file->dimensions()) {\n\t\t\t\t$height = $dims['height'];\n\t\t\t}\n\n\t\t\treturn $height;\n\t\t});\n\t}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "public function getHeight() {}", "final public function get_height()\n {\n return $this->height;\n }", "function get_height() {\n //based on image height\n return $this->_height;\n }", "public function getHeight() {\n return Image::make($this->file)->height();\n }", "public function getHeight()\n\t{\n\t\treturn $this->image->getHeight();\n\t}", "public function getHeight()\n {\n if (!isset($this->height)) {\n $this->height = ps_get_value($this->document->resource, \"imageheight\", $this->id);\n }\n\n return $this->height;\n }", "public function getImageHeight()\n {\n return $this->imageHeight;\n }", "function getHeight() {\n // return $originalHeight;\n\t\t\n return $this->height;\n }", "function getHeight() {\r\n\t\treturn imagesy($this->image);\r\n\t}", "public function getPixelHeight()\n {\n return isset($this->pixel_height) ? $this->pixel_height : null;\n }", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight();", "public function getHeight() {\n return imagesy($this->image);\n }", "public function getPixelHeightUnwrapped()\n {\n return $this->readWrapperValue(\"pixel_height\");\n }", "public function getHeight()\n {\n return imagesy($this->image);\n }", "public function getImageHeight()\n\t{\n\t\treturn $this->imageHeight;\n\t}", "function getHeight() \n {\n return imagesy($this->image);\n }", "public final function getHeight()\n {\n return $this->googleVisualization->getHeight();\n }", "public function getHeight(): int\n {\n return $this->height;\n }", "public function getHeightZ()\n {\n if (! isset($this->heightZ)) {\n $this->heightZ = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightZQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightZ;\n }", "public function getHeight() {\n $height = false;\n if (isset($this->_height)) {\n $height = $this->_height;\n }\n\n return $height;\n }", "public function get_image_height()\n {\n }", "public function getHeightM()\n {\n if (! isset($this->heightM)) {\n $this->heightM = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightMQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightM;\n }", "public function getPreviewPixelHeightUnwrapped()\n {\n return $this->readWrapperValue(\"preview_pixel_height\");\n }", "public function height()\r\n {\r\n if (is_null($this->height)) {\r\n $this->height = imagesy($this->image);\r\n }\r\n\r\n return $this->height;\r\n }", "public function getImageHeight(): int\n {\n return $this->imageHeight;\n }", "function getHeight() {\n\t\t}", "public function height(){\n\t\t\t\treturn\t$this->_actual_height + $this->_titleHeight + $this->_spacing;\n\t\t}", "public function height()\n {\n return $this->setRightOperand(PVar::HEIGHT);\n }", "public function getPreviewPixelHeight()\n {\n return isset($this->preview_pixel_height) ? $this->preview_pixel_height : null;\n }", "public static function getHeight($aspect)\n {\n return self::getMetaProperty($aspect, 'height');\n }", "public function getHeightC()\n {\n if (! isset($this->heightC)) {\n $this->heightC = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightCQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightC;\n }", "public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getCapHeight() {}", "public function getHeightO()\n {\n if (! isset($this->heightO)) {\n $this->heightO = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightOQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightO;\n }", "public function getFrameHeight() {}", "public function getHeightT()\n {\n if (! isset($this->heightT)) {\n $this->heightT = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightTQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightT;\n }", "function getWorldHeight();", "public function getHeight() {\n\t\tif (!$this->isBound()) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn $this->h;\n\t}", "function getHeight();", "public function getHeight(): int\n {\n return (int) $this->height;\n }", "public function getHeightN()\n {\n if (! isset($this->heightN)) {\n $this->heightN = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightNQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightN;\n }", "public function height() : int;", "protected function getPageHeight()\n {\n return $this->inchToPoint(3.75);\n }", "function getHeight($image) {\n\t\t\t\t$size = getimagesize($image);\n\t\t\t\t$height = $size[1];\n\t\t\t\treturn $height;\n\t\t\t}", "public function getHeight(): int\n\t{\n\t\treturn $this->processor->getHeight();\n\t}", "public function getLineHeight() {}", "function getHeight($image) {\r\n\t\t\t$size = getimagesize($image);\r\n\t\t\t$height = $size[1];\r\n\t\t\treturn $height;\r\n\t\t}", "public function getXHeight() {}", "public function getXHeight() {}", "public function getHeightS()\n {\n if (! isset($this->heightS)) {\n $this->heightS = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightSQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightS;\n }", "public function getSpriteHeightPixels()\n {\n return $this->sprite_height_pixels;\n }", "function getHeight($image) {\r\n\t\t$size = getimagesize($image);\r\n\t\t$height = $size[1];\r\n\t\treturn $height;\r\n\t}", "function getHeight($image) {\n\t\t$size = getimagesize($image);\n\t\t$height = $size[1];\n\t\treturn $height;\n\t}", "public function getStyleHeight()\n\t{\n\t\tif (!$this->getBox()->isForMeasurement()) {\n\t\t\treturn '0';\n\t\t}\n\t\t$height = $this->getBox()->getStyle()->getRules('height');\n\t\tif ('auto' === $height) {\n\t\t\treturn null;\n\t\t}\n\t\t$percentPos = strpos($height, '%');\n\t\tif (false !== $percentPos) {\n\t\t\t$widthInPercent = substr($height, 0, $percentPos);\n\t\t\t$closestBoxDimensions = $this->getBox()->getClosestBox()->getDimensions();\n\t\t\tif (null !== $closestBoxDimensions->getHeight()) {\n\t\t\t\t$parentHeight = $closestBoxDimensions->getInnerHeight();\n\t\t\t\tif ($parentHeight) {\n\t\t\t\t\treturn Math::percent($widthInPercent, $parentHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn $height;\n\t\t}\n\t\treturn null;\n\t}", "public function getHeight()\n {\n if (null === $this->height && !$this->initialised) {\n $this->refreshDimensions();\n }\n\n if (null === $this->height) {\n $height = getenv('LINES');\n if (false !== $height) {\n $this->height = (int) trim($height);\n }\n }\n\n return $this->height ?: static::DEFAULT_HEIGHT;\n }", "public function getHeight() : ?float ;", "function height() {\n if (empty($this->bodyheight)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Height<\\/h5>\\s*\\n(.*?)\\s*\\((.*?)\\)/m\",$this->page[\"Bio\"],$match)) {\n $this->bodyheight[\"imperial\"] = trim($match[1]);\n $this->bodyheight[\"metric\"] = trim($match[2]);\n }\n }\n return $this->bodyheight;\n }", "private function getGraphHeight() {\n\t\treturn $this->graphHeight;\n\t}", "public function getTextHeight() {}", "function getHeight($image) {\n\t$size = getimagesize($image);\n\t$height = $size[1];\n\treturn $height;\n}", "private function get_signature_image_height() {\n\t\t$height = FrmField::get_option( $this->field, 'max' );\n\t\treturn $this->get_signature_image_dimension( $height, 'max' );\n\t}" ]
[ "0.7776123", "0.765625", "0.7608425", "0.75245243", "0.7518394", "0.7516475", "0.7486375", "0.7486375", "0.7486375", "0.7486375", "0.7486375", "0.7486375", "0.7486375", "0.7486375", "0.7486375", "0.7486375", "0.74523824", "0.744277", "0.7417937", "0.73934263", "0.7363607", "0.7361609", "0.7358197", "0.7358197", "0.7358197", "0.73546463", "0.7341161", "0.7338622", "0.7338288", "0.7338288", "0.7338288", "0.7338288", "0.7338288", "0.7338175", "0.7322001", "0.72716665", "0.7216164", "0.72092265", "0.71993566", "0.71700495", "0.71450627", "0.7144941", "0.7132693", "0.7132145", "0.7132145", "0.7132145", "0.7132145", "0.7132145", "0.7108513", "0.70796365", "0.7077454", "0.7067723", "0.70577943", "0.70459366", "0.70370156", "0.6998886", "0.69552314", "0.6887651", "0.6862548", "0.68491215", "0.68267304", "0.6819041", "0.68176746", "0.6796004", "0.67820024", "0.6741549", "0.6736037", "0.67276365", "0.67118704", "0.6707316", "0.6707316", "0.6707316", "0.6707303", "0.6701048", "0.6687597", "0.66652304", "0.66545475", "0.6641102", "0.66323763", "0.66193056", "0.6617002", "0.6599416", "0.65474474", "0.6542775", "0.65178925", "0.65018684", "0.6496451", "0.6494517", "0.6492893", "0.6484201", "0.64680094", "0.64553577", "0.64405525", "0.6427725", "0.64223343", "0.6421569", "0.641882", "0.6408877", "0.6391692", "0.6383193" ]
0.903171
0
Sets the start transparency
public function setStartTransparency($start_transparency) { if (is_numeric($start_transparency)) { $this->start_transparency = (int)$start_transparency; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStartTransparency()\r\n {\r\n return $this->start_transparency;\r\n }", "protected function setTransparencyColor():void{\n\n\t\tif(!$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\t$this->imagick->transparentPaintImage($transparencyColor, 0.0, 10, false);\n\t}", "protected function setTransparencyColor():void{\n\n\t\tif($this->options->outputType === QROutputInterface::GDIMAGE_JPG || !$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\timagecolortransparent($this->image, $transparencyColor);\n\t}", "public function setTransparency($value)\r\n {\r\n $this->_cleanse($value, __METHOD__);\r\n $this->_transparent = $value;\r\n \r\n return $this;\r\n }", "private function _setTransparency($color) {\r\n\t\t// Define a color as transparent\r\n\t\timagecolortransparent($this->_resource, $color);\r\n\t\t\r\n\t\t// Enable alpha-blending and save that information\r\n\t\timagealphablending($this->_resource, true);\r\n\t\timagesavealpha($this->_resource, true);\r\n\t}", "function setTransparency($new_image,$image_source) { \n $transparencyIndex = imagecolortransparent($image_source); \n $transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255); \n \n if ($transparencyIndex >= 0) { \n $transparencyColor = imagecolorsforindex($image_source, $transparencyIndex); \n } \n \n $transparencyIndex = imagecolorallocate($new_image, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']); \n imagefill($new_image, 0, 0, $transparencyIndex); \n imagecolortransparent($new_image, $transparencyIndex); \n }", "private function set_background_color()\n {\n imagecolorallocate(\n $this->img,\n L_BACKGROUND_COLOR_R,\n L_BACKGROUND_COLOR_G,\n L_BACKGROUND_COLOR_B\n );\n }", "public function ImagePreserverTransparent($transparent){\r\n $this->image_transparent=$transparent;\r\n }", "public function TransparencyColor($red, $green, $blue,$alpha){\r\n $this->transparency_color=[$red,$green,$blue,$alpha];\r\n }", "public function setAlpha($alpha = 100)\n {\n if ($alpha < 0) {\n $alpha = 0;\n }\n if ($alpha > 100) {\n $alpha = 100;\n }\n $alpha = round(($alpha / 100) * 255);\n $alpha = dechex((int) $alpha);\n $alpha = str_pad($alpha, 2, '0', STR_PAD_LEFT);\n $this->argb = $alpha . substr($this->argb, 2);\n\n return $this;\n }", "function setBackground($c1 = 0xEEEEEE, $c2 = false)\n {\n if ($c2 === false) {\n $c2 = $c1;\n }\n $this->bg1 = $this->hexcol($c1);\n $this->bg2 = $this->hexcol($c2);\n }", "function setBackground($c1 = 0xEEEEEE, $c2 = false)\n {\n if ($c2 === false) {\n $c2 = $c1;\n }\n $this->bg1 = $this->hexcol($c1);\n $this->bg2 = $this->hexcol($c2);\n }", "public function setOpacity($opacity) {}", "public static function background($value)\n {\n self::$background = Color::toRGBA($value);\n }", "public function setAlpha($alpha = 40) {\n\t\t$this->alpha = $alpha;\n\t}", "function SetAlpha($alpha, $bm='Normal')\n {\n // set alpha for stroking (CA) and non-stroking (ca) operations\n $gs = $this->AddExtGState(array('ca'=>$alpha, 'CA'=>$alpha, 'BM'=>'/'.$bm));\n $this->SetExtGState($gs);\n }", "protected function setBgColor():void{\n\n\t\tif(isset($this->background)){\n\t\t\treturn;\n\t\t}\n\n\t\tif($this::moduleValueIsValid($this->options->bgColor)){\n\t\t\t$this->background = $this->prepareModuleValue($this->options->bgColor);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->background = $this->prepareModuleValue([255, 255, 255]);\n\t}", "public static function preserveTransparency()\n {\n return new FlagQualifier(self::PRESERVE_TRANSPARENCY);\n }", "function __construct()\n {\n $this\n ->setOpacity(1.0)\n ->setUpdatedAt(new \\DateTime('now'))\n ->setActive(false)\n ;\n }", "public function test_image_preserves_alpha() {\n\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = wp_get_image_editor( $file );\n\t\t$editor->load();\n\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\t\t\n\t\t$editor->save( $save_to_file );\n\n\t\t$this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );\n\t}", "public function __construct($reflection_height=20, $start_transparency=30)\r\n {\r\n $this->setReflectionHeight($reflection_height);\r\n $this->setStartTransparency($start_transparency);\r\n }", "protected function setBgColor():void{\n\n\t\tif(isset($this->background)){\n\t\t\treturn;\n\t\t}\n\n\t\tif($this::moduleValueIsValid($this->options->bgColor)){\n\t\t\t$this->background = $this->prepareModuleValue($this->options->bgColor);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->background = $this->prepareModuleValue('white');\n\t}", "function background_color()\n {\n }", "public function __construct($opacity)\r\n {\r\n $this->setOpacity($opacity);\r\n }", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function setConstantOpacity($opacity) {}", "public function setConstantOpacityNonStroking($opacity) {}", "public function testTransparency()\n {\n $feed = $this->eventFeed;\n\n // Assert that all entry's have a transparency object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getTransparency() instanceof Zend_Gdata_Extension_Transparency);\n }\n\n // Assert one of the entries values\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"transparency\", \"value\", \"http://schemas.google.com/g/2005#event.transparent\");\n }", "function BeforeShowView(&$xt, &$templatefile, &$values, &$pageObject)\n{\n\n\t\t$xt->assign(\"bg_edit\",\"style=\\\"background-color:\" . $values[\"Color\"].\";\\\"\");\n;\t\t\n}", "public function __construct()\n {\n $this->defaultStyle = \"rotatingPlane\";\n $this->defaultColor = \"black\";\n $this->container = null;\n }", "public function getOpacity() {}", "public function setAlpha(int $alpha): Color\n {\n self::validateAlpha($alpha);\n\n $this->alpha = $alpha;\n\n return $this;\n }", "function setActive() ;", "public function addBackground($Settings = array(\"R\"=>230, \"G\"=>230, \"B\"=>230, \"Dash\"=>1, \"DashR\"=>240, \"DashG\"=>240, \"DashB\"=>240)) {\n\t\t $this->drawFilledRectangle(0, 0, $this->XSize, $this->YSize,$Settings);\n\t\t $this->drawRectangle(0,0,$this->XSize - 1,$this->YSize - 1,array(\"R\"=> 80,\"G\"=>80,\"B\"=>80));\n\t}", "protected function preserveAlpha()\n {\n if ($this->format == 'PNG' && $this->options['preserveAlpha'] === true) {\n imagealphablending($this->workingImage, false);\n\n $colorTransparent = imagecolorallocatealpha($this->workingImage,\n $this->options['alphaMaskColor'][0],\n $this->options['alphaMaskColor'][1],\n $this->options['alphaMaskColor'][2],\n 0\n );\n\n imagefill($this->workingImage, 0, 0, $colorTransparent);\n imagesavealpha($this->workingImage, true);\n }\n // preserve transparency in GIFs... this is usually pretty rough tho\n if ($this->format == 'GIF' && $this->options['preserveTransparency'] === true) {\n $colorTransparent = imagecolorallocate($this->workingImage,\n $this->options['transparencyMaskColor'][0],\n $this->options['transparencyMaskColor'][1],\n $this->options['transparencyMaskColor'][2]\n );\n\n imagecolortransparent($this->workingImage, $colorTransparent);\n imagetruecolortopalette($this->workingImage, true, 256);\n }\n }", "function _wp_tinycolor_bound_alpha($n)\n {\n }", "function BeforeShowView(&$xt, &$templatefile, &$values, &$pageObject)\n{\n\n\t\tif ($values['Color']) {\n\t$xt->assign(\"bgc_category\",'style=\"background:'.$values['Color'].';\" ');\n}\n\n\n;\t\t\n}", "function kickstart_background_callback() {\n if ( ! get_background_color() ) {\n return;\n }\n printf( '<style>body { background-color: #%s; }</style>' . \"\\n\", get_background_color() );\n}", "private function setRedTopBorder(){\n\t\techo \"decor| TopBorder RED \\n\";\n\t}", "public function background($color)\n {\n $this->background = $color;\n }", "public function test_image_preserves_alpha() {\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = new WP_Image_Editor_Imagick( $file );\n\n\t\t$this->assertNotInstanceOf( 'WP_Error', $editor );\n\n\t\t$editor->load();\n\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\n\t\t$editor->save( $save_to_file );\n\n\t\t$im = new Imagick( $save_to_file );\n\t\t$pixel = $im->getImagePixelColor( 0, 0 );\n\t\t$expected = $pixel->getColorValue( imagick::COLOR_ALPHA );\n\n\t\t$this->assertImageAlphaAtPointImagick( $save_to_file, array( 0, 0 ), $expected );\n\n\t\tunlink( $save_to_file );\n\t}", "function voegToe()\n{\n echo \"<style> #foto{ opacity: 0.5%; fill-rule: alpha(opacity=50) } </style>\";\n\n}", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "public function background($value) {\n return $this->setProperty('background', $value);\n }", "public function test_image_preserves_alpha_on_resize() {\n\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = wp_get_image_editor( $file );\n\t\t$editor->load();\n\t\t$editor->resize(5,5);\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\t\t\n\t\t$editor->save( $save_to_file );\n\n\t\t$this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );\n\n\t}", "public function setBackgroundColor($backgroundColor) {}", "function elementor_overlay_zindex()\n {\n if (!$this->is_elementor_editor()) {\n return;\n }\n\n ?>\n <style type=\"text/css\" id=\"yatri-elementor-overlay-css\">\n .elementor-editor-active .elementor-element > .elementor-element-overlay {\n z-index: 9999;\n }\n </style>\n\n <?php\n }", "public function background($color, $quality=null);", "protected function applyBackgroundTransparency($file, $width, $height)\n { \n imagealphablending($file, false);\n imagesavealpha($file, true);\n imagefilledrectangle($file, 0, 0, $width, $height, $this->transparentBackground($file));\n }", "public function setInteriorColor($color) {}", "public function setInteriorColor($color) {}", "public function setInteriorColor($color) {}", "function get_background_color()\n {\n }", "function drawStyle()\r\n\t{\r\n\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->demandSourceTransparency = false;\n $this->enableViewTagcadeReport = false;\n }", "public function backgroundColor()\n {\n return '#dddddd';\n }", "public function is_transparent_header_enabled() {\r\n\t\t\t$status = Astra_Ext_Transparent_Header_Markup::is_transparent_header();\r\n\t\t\treturn ( true === $status ? true : false );\r\n\t\t}", "public function setBackgroundColor($color) {}", "public function White()\r\n {return new CmykColor(0, 0, 0, 0);}", "function _custom_header_background_just_in_time()\n {\n }", "public function fillAndStroke() {}", "public final function setLowerAlpha($lowerAlpha) {\n\t\t\t$this->lowerAlpha = (bool)$lowerAlpha;\n\t\t}", "public function setLinesFilled($keys = array(), $opacity=0.7) {\n\t\tif (empty($keys))\n\t\t\t$keys = array_keys($this->Data);\n\n\t\tforeach ($keys as $key)\n\t\t\t$this->Data[$key]['lines']['fill'] = $opacity;\n\t}", "protected function preserveAlpha($dest, $src)\n {\n $transparent = @imagecolortransparent($src);\n if (-1 != $transparent) {\n $color = @imagecolorsforindex($src, $transparent);\n $allocated = @imagecolorallocatealpha(\n $dest\n , $color['red']\n , $color['green']\n , $color['blue']\n , $color['alpha']\n );\n @imagecolortransparent($dest, $allocated);\n @imagefill($dest, 0, 0, $allocated);\n }\n }", "public function setOpacity($opacity=1.0){\n\t\ttry{\n\t\t\tif(!is_float($value))\n\t\t\t\tthrow new Exception(\"opacity value must be a float number, value provided is \".$opacity);\n\t\t\t\tif($opacity< 0.0 || $opacity> 1)\n\t\t\t\t\tthrow new Exception(\"opacity value must be between 0.0 to 1.0, value provided is \".$opacity);\n\t\t\t\t\t$this->opacity = $opacity;\n\t\t}catch(Exception $e){\n\t\t\tthrow new Exception(ErrorHelper::formatMessage(__FUNCTION__,__CLASS__,$e));\n\t\t}\n\t}", "public function bg($value)\n {\n $this->args = array_merge($this->args, ['bg' => $value]);\n\n return $this;\n }", "public function getOpacity()\r\n {\r\n return $this->opacity;\r\n }", "function imagemergealpha($i) {\n $s = imagecreatetruecolor(imagesx($i[0]),imagesy($i[1]));\n $back_color=imagecolorallocate($s,0xa9,0xb1,0xd3);\n\n //merge all images\n imagealphablending($s,true);\n $z = $i;\n while($d = each($z)) {\n imagecopy($s,$d[1],0,0,0,0,imagesx($d[1]),imagesy($d[1]));\n }\n\n //restore the transparency\n imagealphablending($s,false);\n $w = imagesx($s);\n $h = imagesy($s);\n for($x=0;$x<$w;$x++) {\n for($y=0;$y<$h;$y++) {\n $c = imagecolorat($s,$x,$y);\n $c = imagecolorsforindex($s,$c);\n $z = $i;\n $t = 0;\n while($d = each($z)) {\n $ta = imagecolorat($d[1],$x,$y);\n $ta = imagecolorsforindex($d[1],$ta);\n $t += 127-$ta['alpha'];\n }\n $t = ($t > 127) ? 127 : $t;\n $t = 127-$t;\n $c = imagecolorallocatealpha($s,$c['red'],$c['green'],$c['blue'],$t);\n imagesetpixel($s,$x,$y,$c);\n }\n }\n imagesavealpha($s,true);\n return $s;\n}", "function SetFillColor($r,$g=-1,$b=-1)\n\t\t{\n\t\t\tif(($r==0 and $g==0 and $b==0) or $g==-1)\t$this->FillColor=sprintf('%.3f g',$r/255);\n\t\t\telse$this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);\n\t\t\t$this->ColorFlag = ($this->FillColor != $this->TextColor);\n\t\t\tif($this->page>0)\t$this->_out($this->FillColor);\n\t\t}", "public function setSaveAlpha($bool)\n {\n $this->PNGIsSaveAlpha = (boolean) $bool;\n\n return $this;\n }", "public function setActivation(): void;", "public function reset()\n {\n parent::reset();\n $this->attr('Material')->shader('flat');\n $this->attr('Material')->side('double');\n $this->color('#FFF');\n $this->transparent(true);\n $this->height(1.75);\n $this->width(1.75);\n }", "public function color()\n {\n }", "public function setBGColor($arrColor)\r\n\t{\r\n\t\t$this->bgColor = $arrColor;\r\n\t}", "public function start()\n {\n $this->_marks = array();\n $this->mark('__start');\n }", "function is_transparent( JNodeBase $Parent ){\n\t\treturn false;\n\t}", "function beginDraw()\r\n {\r\n echo \"<script type=\\\"text/javascript\\\">\\n\";\r\n echo \" var cnv=findObj('$this->_object');\\n\";\r\n echo \" if (cnv==null) cnv=findObj('{$this->_object}_outer');\\n\";\r\n echo \" var $this->_canvas = new jsGraphics(cnv);\\n\";\r\n $this->_canvas= \" \" . $this->_canvas;\r\n }", "private function setBackground($width, $height)\n {\n list($r, $g, $b, $a) = self::$background;\n\n $color = imagecolorallocate($this->image, $r, $g, $b);\n\n if ($a === 0) {\n imagecolortransparent($this->image, $color);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $color);\n }", "public function transparentToolbarProvider()\n {\n return [[true], [false]];\n }", "public function setAlphaValue( kaforkl_Position $position, $value )\n {\n $this->valueArray[$position->getX()][$position->getY()][self::ALPHA] = $value;\n }", "public function setActive() {}", "function setDefaults() {\r\n\t\t$this->border='1px solid #46b0ee';\r\n\t\t$this->fgColor='#ff9000';\r\n\t\t$this->bgColor='#FFFFFF';\r\n\t}", "private function getAlpha() {\n\t\treturn $this->alpha;\n\t}", "function costum_setting_colors_transparentColor_callback() {\n\t$transparentColor = esc_attr( get_option( 'transparentColor' ) ); ?>\n\n\t<div class=\"input-color-container\">\n\t\t<input name=\"transparentColor\" id=\"input-transparentColor\" value=\"<?php echo $transparentColor; ?>\" class=\"input-color\" type=\"color\">\n\t</div>\n\n\t<?php\n}", "private static function ensureTransparency(Imagick $im): Imagick\n {\n $im->setImageMatte(true);\n\n if (Imagick::VIRTUALPIXELMETHOD_TRANSPARENT !== $im->getImageVirtualPixelMethod()) {\n $im->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);\n }\n\n return $im;\n }", "public function set_plot_bg_color($values, $by_lines = FALSE)\n\t{\n\t\t$this->plot_bg_color = $values;\n\t\t$this->plot_bg_by_lines = $by_lines;\n\t}", "public function set_plot_bg_color($values, $by_lines = FALSE)\n\t{\n\t\t$this->plot_bg_color = $values;\n\t\t$this->plot_bg_by_lines = $by_lines;\n\t}", "public function test_image_preserves_alpha_on_resize() {\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = new WP_Image_Editor_Imagick( $file );\n\n\t\t$this->assertNotInstanceOf( 'WP_Error', $editor );\n\n\t\t$editor->load();\n\t\t$editor->resize( 5, 5 );\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\n\t\t$editor->save( $save_to_file );\n\n\t\t$im = new Imagick( $save_to_file );\n\t\t$pixel = $im->getImagePixelColor( 0, 0 );\n\t\t$expected = $pixel->getColorValue( imagick::COLOR_ALPHA );\n\n\t\t$this->assertImageAlphaAtPointImagick( $save_to_file, array( 0, 0 ), $expected );\n\n\t\tunlink( $save_to_file );\n\t}", "function setColor( $c ) {\n $this->currentColor = $c;\n}", "protected function forceBrush()\r\n {\r\n if ($this->_brush->isModified())\r\n {\r\n echo \"$this->_canvas.setColor(\\\"\" . $this->_brush->Color . \"\\\");\\n\";\r\n $this->_brush->resetModified();\r\n $this->_pen->modified();\r\n }\r\n }", "static function colorize() {\n\t\tself::$colorize = true;\n\t}", "public function __construct() {\n\t\t$this->colorY = new Color(107,150,0);\n\t\t$this->colorV = new Color(122,170,0);\n\t\t$this->colorLeft = new Color(182,255,0);\n\t\t$this->colorRight = new Color(157,219,0);\n\t}", "function remove_custom_background()\n {\n }", "public function Colorcase(){\n\t\t$this->__construct();\n\t}", "public function setBackColor($value)\r\n {\r\n $this->_cleanse($value, __METHOD__);\r\n $this->_backColor = $value;\r\n \r\n return $this;\r\n }" ]
[ "0.7295902", "0.69557166", "0.6845795", "0.63296485", "0.59367144", "0.5861437", "0.5700456", "0.5630525", "0.5604222", "0.5500081", "0.54913753", "0.54913753", "0.5425511", "0.5393143", "0.53355974", "0.5273752", "0.5170394", "0.51665926", "0.51208997", "0.5081462", "0.5078207", "0.50613", "0.5055382", "0.50295126", "0.5016325", "0.5016325", "0.5016325", "0.5016325", "0.50072956", "0.4999244", "0.49962786", "0.4977954", "0.4961508", "0.49545106", "0.4923962", "0.49187398", "0.49040312", "0.48762113", "0.4859283", "0.48304307", "0.4744805", "0.47009912", "0.4700805", "0.47001272", "0.4674533", "0.46629173", "0.46629173", "0.46629173", "0.46629173", "0.46525246", "0.4648606", "0.46430057", "0.4579832", "0.4574678", "0.45645702", "0.45634818", "0.45634818", "0.45627487", "0.45517743", "0.45288387", "0.4513469", "0.45102608", "0.44624656", "0.44572777", "0.44520184", "0.44443884", "0.44206017", "0.43975124", "0.4393488", "0.43863723", "0.43845177", "0.4378733", "0.437153", "0.4369508", "0.4366764", "0.43625596", "0.43568817", "0.4351791", "0.43358532", "0.43317553", "0.4327396", "0.43251044", "0.4321052", "0.43209168", "0.43206638", "0.43184963", "0.43169686", "0.43145552", "0.431033", "0.4302917", "0.4302108", "0.4302108", "0.4300276", "0.42933613", "0.42899334", "0.4289454", "0.42842805", "0.42706153", "0.4265304", "0.4250739" ]
0.73084086
0
Gets the start transparency
public function getStartTransparency() { return $this->start_transparency; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setStartTransparency($start_transparency)\r\n {\r\n if (is_numeric($start_transparency))\r\n {\r\n $this->start_transparency = (int)$start_transparency;\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public function getOpacity() {}", "private function getAlpha() {\n\t\treturn $this->alpha;\n\t}", "public function getAlpha()\n {\n $alpha = 100;\n if (strlen($this->argb) >= 6) {\n $dec = hexdec(substr($this->argb, 0, 2));\n $alpha = number_format(($dec / 255) * 100, 2);\n }\n\n return $alpha;\n }", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "function getBackgroundPosition() {return $this->readBackgroundPosition();}", "function get_background_color()\n {\n }", "function mkd_burst_get_header_transparency() {\r\n global $mkd_burst_options;\r\n\r\n $id = mkd_burst_get_page_id();\r\n $header_color_transparency_per_page = '';\r\n\r\n\r\n if(get_post_meta($id, \"mkd_header_color_transparency_per_page\", true) != \"\"){\r\n $header_color_transparency_per_page = get_post_meta($id, \"mkd_header_color_transparency_per_page\", true);\r\n } elseif($mkd_burst_options['header_background_transparency_initial'] != \"\") {\r\n $header_color_transparency_per_page = $mkd_burst_options['header_background_transparency_initial'];\r\n }\r\n\r\n return $header_color_transparency_per_page;\r\n }", "public function getOpacity()\r\n {\r\n return $this->opacity;\r\n }", "public function getBackgroundColor() {}", "public function getBackgroundColor() {}", "public function getBackgroundColor() {}", "protected function _getGradientStartColour() {\n $base_colour = $this->_getColour();\n $colour = \"\";\n foreach (array(0, 2, 4) as $pos) {\n $rgb_val = hexdec(substr($base_colour, $pos, 2));\n $rgb_val = max(0, min(255, $rgb_val + (self::GRADIENT_COLOUR_STEP / 2)));\n $colour .= str_pad(dechex($rgb_val), 2, \"0\", STR_PAD_LEFT);\n }\n return $colour;\n }", "public function getSaveAlpha()\n {\n return $this->PNGIsSaveAlpha;\n }", "public function getCategoryBalloonAlpha()\n {\n return $this->categoryBalloonAlpha->getOpacity();\n }", "function readBackground() {return $this->_background;}", "public function get_bg_colour() {\n\t\treturn $this->bg_colour;\n\t}", "function readBackgroundPosition() {return $this->_backgroundposition;}", "function getBackground() {return $this->readBackground();}", "public function getAlpha(): int\n {\n return $this->alpha;\n }", "function mkd_burst_get_header_top_transparency() {\r\n global $mkd_burst_options;\r\n\r\n $id = mkd_burst_get_page_id();\r\n $header_top_color_transparency_per_page = '';\r\n\r\n\r\n if(get_post_meta($id, \"mkd_header_top_color_transparency_per_page\", true) != \"\"){\r\n $header_top_color_transparency_per_page = get_post_meta($id, \"mkd_header_top_color_transparency_per_page\", true);\r\n } elseif($mkd_burst_options['header_top_transparency'] != \"\") {\r\n $header_top_color_transparency_per_page = $mkd_burst_options['header_top_transparency'];\r\n }\r\n\r\n return $header_top_color_transparency_per_page;\r\n }", "public function getBackgroundColor() {\n\t\treturn $this->background_color;\n\t}", "public static function preserveTransparency()\n {\n return new FlagQualifier(self::PRESERVE_TRANSPARENCY);\n }", "public function getBackgroundColor()\n {\n return $this->backgroundColor;\n }", "function GetAnimation() {\n return ($this->GIF);\n }", "function getColor() { return $this->_color; }", "public function getBackgroundColor() {\n return $this->backgroundColor;\n }", "function getColor() { return $this->_color; }", "function getColor() { return $this->_color; }", "public function getBgImage(){\r\n return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_BG_IMAGE,ScopeInterface::SCOPE_WEBSITE);\r\n }", "public function getStrokeOpacity(): int\n {\n return $this->strokeOpacity;\n }", "function pl_bg_color(){\n\t\n\tif( pl_check_color_hash( get_set_color( 'the_bg' ) ) )\n\t\treturn get_set_color( 'the_bg' );\n\telse \n\t\treturn 'FFFFFF';\t\n}", "public static function color()\n {\n return null;\n }", "public static function color()\n {\n return null;\n }", "public function color()\n\t{\n\t\treturn $this->fill_color;\n\t}", "public function complementary()\n {\n return $this->hueShift(180);\n }", "public function getColor() {\n //Busca en esta clase la propiedad x\n return $this->color;\n }", "function readBackgroundRepeat() {return $this->_backgroundrepeat;}", "protected function setTransparencyColor():void{\n\n\t\tif($this->options->outputType === QROutputInterface::GDIMAGE_JPG || !$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\timagecolortransparent($this->image, $transparencyColor);\n\t}", "private final function getLowerAlpha() {\n\t\t\treturn $this->lowerAlpha;\n\t\t}", "function getColor() {\n\t\treturn $this->color;\n\t}", "public function getColor()\n {\n // Busca en esta clase la propiedad X\n return $this->color;\n }", "public function setTransparency($value)\r\n {\r\n $this->_cleanse($value, __METHOD__);\r\n $this->_transparent = $value;\r\n \r\n return $this;\r\n }", "public function getGreen()\n {\n return (0.5 + $this->green) | 0;\n }", "function background_color()\n {\n }", "function getColor(){\n\t\treturn $this->color_ficha;\n\t}", "public static function getCoverOpacityArray()\n {\n $ret = [\n '0' => 'none',\n '0.1' => '10%',\n '0.2' => '20%',\n '0.3' => '30%',\n '0.4' => '40%',\n '0.5' => '50%',\n ];\n\n return $ret;\n }", "function getParentColor() {return $this->readParentColor();}", "public function get_background_card(){ return $this->_background_card;}", "public function getBackgroundColorIndex()\n {\n if ($this->logicalScreenDescriptor) {\n $index = substr($this->logicalScreenDescriptor, 5, 1);\n $index = unpack('C', $index)[1];\n\n return $index;\n }\n\n return 0;\n }", "function getOpaque()\n\t\t{\n\t\t\treturn md5($this->opaque);\n\t\t}", "function getColor() { return $this->readColor(); }", "abstract public function getVerticesStart();", "function get_background() {\r\n return $this->db->get($this->table);\r\n\t}", "function getBrush() { return $this->_brush; }", "function getParentColor() { return $this->readParentColor(); }", "public function getColor() {\n\t\t\treturn $this->_color;\n\t\t}", "public function getColor ()\r\n {\r\n return $this->color;\r\n }", "public function getStartBeginning();", "public function getRed()\n {\n return (0.5 + $this->red) | 0;\n }", "public function testTransparency()\n {\n $feed = $this->eventFeed;\n\n // Assert that all entry's have a transparency object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getTransparency() instanceof Zend_Gdata_Extension_Transparency);\n }\n\n // Assert one of the entries values\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"transparency\", \"value\", \"http://schemas.google.com/g/2005#event.transparent\");\n }", "function getColor() {return $this->readColor();}", "public function getFillColor(): string\n {\n return $this->fillColor;\n }", "public function getColor()\n {\n return $this->color;\n }", "protected function setTransparencyColor():void{\n\n\t\tif(!$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\t$this->imagick->transparentPaintImage($transparencyColor, 0.0, 10, false);\n\t}", "function getBrush() { return $this->_brush; }", "public function getColor()\n {\n return self::QUALITY_MAP[$this->qualityID]['color'];\n }", "public function get_url_background_pion(){ return $this->_url_background_pion;}", "public function getColor() {\n\t\treturn $this->color;\n\t}", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n\t{\n\t\treturn $this->color;\n\t}", "function getBackgroundRepeat() {return $this->readBackgroundRepeat();}", "public function getColor()\n {\n return $this->color;\n }", "public function get_color()\n\t{\n\t\treturn $this->color;\n\t}", "public function lineColor()\n {\n return isset($this->data->graphicElement->pen[\"lineColor\"]) ? (string) $this->data->graphicElement->pen[\"lineColor\"] : NULL;\n }", "public function formatted()\n {\n return 'rgba('.$this->red.', '.$this->green.', '.$this->blue.', '.$this->alpha.')';\n }", "function getStart() {\n\t\t\treturn $this->start;\n\t\t}", "public function getStart ()\r\n\t{\r\n\t\treturn $this->start;\r\n\t}", "public function getStart()\n {\n return clone $this->_start;\n }", "public function getCurrentBackgroundColor() {\n return $currentBackgroundColor;\n }", "public function getStartTransform()\n {\n $this->saveStyleStaus();\n $this->ctm[++$this->ctmid] = array();\n return 'q'.\"\\n\";\n }", "public function getColor() {}", "public function getColor() {}", "public function getStart();", "public function getStart();", "public function getStart(): float;", "public function getStart() {\n\t\treturn $this->start;\n\t}", "function getBgColor($class,$special=0) {\n\t$baseR = 7;\n\t$baseG = 7;\n\t$baseB = 8;\n\t$step = 2;\n\t$lockedR = 1; \n\t$viewG = 1;\n\tif ($class == \"site\") $level = 0;\n\tif ($class == \"section\") $level = 1;\n\tif ($class == \"page\") $level = 2;\n\tif ($class == \"story\") $level = 3;\n\t\n\t$finalR = $baseR + $step*$level;\n\t$finalG = $baseG + $step*$level;\n\t$finalB = $baseB + $step*$level;\n\n\tif ($special == \"locked\") {\n\t\t$finalR = $finalR + $lockedR;\n\t\t$finalG = $finalG - $lockedR;\n\t\t$finalB = $finalB - $lockedR;\n\t}\n\n\tif ($special == \"view\") {\n $finalR = $finalR - $viewG;\n $finalG = $finalG + $viewG;\n $finalB = $finalB - $viewG;\n }\n\n\t$finalR = dechex($finalR);\n $finalG = dechex($finalG);\n $finalB = dechex($finalB);\n\n\t$color = \"#\".$finalR.$finalG.$finalB;\n\treturn $color;\n}", "public function getCurStage()\n {\n return $this->get(self::_CUR_STAGE);\n }", "function get_background_image()\n {\n }", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}" ]
[ "0.6580756", "0.6454634", "0.59673285", "0.5934663", "0.5894233", "0.58935803", "0.58935803", "0.58386916", "0.5805726", "0.5793521", "0.57534885", "0.57283217", "0.5726788", "0.5726788", "0.5707437", "0.5650272", "0.5600017", "0.54338074", "0.5424237", "0.5408973", "0.5402186", "0.5384467", "0.5339301", "0.53383833", "0.5320395", "0.53193146", "0.52894807", "0.52824515", "0.5267807", "0.5245584", "0.5245584", "0.5214678", "0.5200694", "0.5183341", "0.5152218", "0.5152218", "0.5152056", "0.5147741", "0.51330173", "0.5130807", "0.5122414", "0.5118296", "0.5081493", "0.507145", "0.5058266", "0.50526166", "0.5044138", "0.5036506", "0.50348234", "0.5024166", "0.5019617", "0.50149804", "0.4989474", "0.4987255", "0.49849385", "0.49848887", "0.4982208", "0.4976612", "0.49725708", "0.49696967", "0.49688572", "0.49421757", "0.4931915", "0.49278444", "0.4926259", "0.49199322", "0.49177024", "0.49056953", "0.4902156", "0.489644", "0.48893198", "0.4880987", "0.4880987", "0.4880987", "0.4878676", "0.48732403", "0.48656815", "0.48631734", "0.4862985", "0.48570734", "0.48538896", "0.48537368", "0.48501602", "0.4834054", "0.48323625", "0.4832103", "0.4832103", "0.48289242", "0.48289242", "0.48283672", "0.4817931", "0.48162898", "0.48137024", "0.481264", "0.48043054", "0.48042762", "0.48042762", "0.48042762", "0.48042762", "0.48042762" ]
0.91026735
0
Apply the opacity transformation to the sfImage object
public function transform(sfImage $image) { // Get the actual image resource $resource = $image->getAdapter()->getHolder(); //get the resource dimentions $width = $image->getWidth(); $height = $image->getHeight(); $reflection = $image->copy(); $reflection->flip()->resize($width, $this->reflection_height); $r_resource = $reflection->getAdapter()->getHolder(); $dest_resource = $reflection->getAdapter()->getTransparentImage($width, $height + $this->reflection_height); imagecopymerge($dest_resource, $resource, 0, 0, 0 ,0, $width, $height, 100); imagecopymerge($dest_resource, $r_resource, 0, $height, 0 ,0, $width, $this->reflection_height, 100); // Increments we are going to increase the transparency $increment = 100 / $this->reflection_height; // Overlay line we use to apply the transparency $line = imagecreatetruecolor($width, 1); // Use white as our overlay color imagefilledrectangle($line, 0, 0, $width, 1, imagecolorallocate($line, 255, 255, 255)); $tr = $this->start_transparency; // Start at the bottom of the original image for ($i = $height; $i <= $height + $this->reflection_height; $i++) { if ($tr > 100) { $tr = 100; } imagecopymerge($dest_resource, $line, 0, $i, 0, 0, $width, 1, $tr); $tr += $increment; } // To set a new resource for the image object $image->getAdapter()->setHolder($dest_resource); return $image; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function transform(sfImage $image)\r\n {\r\n $new_img = $image->getAdapter()->getTransparentImage($image->getWidth(), $image->getHeight());\r\n\r\n imagealphablending($new_img, false);\r\n imagesavealpha($new_img, true);\r\n\r\n $opacity = (int)round(127-((127/100)*$this->getOpacity()));\r\n\r\n // imagesavealpha($new_img, true);\r\n $width = $image->getWidth();\r\n $height = $image->getHeight();\r\n\r\n for ($x=0;$x<$width; $x++)\r\n {\r\n for ($y=0;$y<$height; $y++)\r\n {\r\n $rgb = imagecolorat($image->getAdapter()->getHolder(), $x, $y);\r\n $r = ($rgb >> 16) & 0xFF;\r\n $g = ($rgb >> 8) & 0xFF;\r\n $b = $rgb & 0xFF;\r\n $alpha = ($rgb & 0x7F000000) >> 24;\r\n\r\n $new_opacity = ($alpha + ((127-$alpha)/100)*$this->getOpacity());\r\n\r\n $colors[$alpha] = $new_opacity;\r\n\r\n $color = imagecolorallocatealpha($new_img, $r, $g, $b, $new_opacity);\r\n imagesetpixel($new_img,$x, $y, $color);\r\n }\r\n }\r\n\r\n $image->getAdapter()->setHolder($new_img);\r\n\r\n return $image;\r\n }", "public function getOpacity() {}", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function opacity($value) {\n return $this->setProperty('opacity', $value);\n }", "public function setOpacity($opacity) {}", "protected function preserveAlpha()\n {\n if ($this->format == 'PNG' && $this->options['preserveAlpha'] === true) {\n imagealphablending($this->workingImage, false);\n\n $colorTransparent = imagecolorallocatealpha($this->workingImage,\n $this->options['alphaMaskColor'][0],\n $this->options['alphaMaskColor'][1],\n $this->options['alphaMaskColor'][2],\n 0\n );\n\n imagefill($this->workingImage, 0, 0, $colorTransparent);\n imagesavealpha($this->workingImage, true);\n }\n // preserve transparency in GIFs... this is usually pretty rough tho\n if ($this->format == 'GIF' && $this->options['preserveTransparency'] === true) {\n $colorTransparent = imagecolorallocate($this->workingImage,\n $this->options['transparencyMaskColor'][0],\n $this->options['transparencyMaskColor'][1],\n $this->options['transparencyMaskColor'][2]\n );\n\n imagecolortransparent($this->workingImage, $colorTransparent);\n imagetruecolortopalette($this->workingImage, true, 256);\n }\n }", "public function getOpacity()\r\n {\r\n return $this->opacity;\r\n }", "public function test_image_preserves_alpha() {\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = new WP_Image_Editor_Imagick( $file );\n\n\t\t$this->assertNotInstanceOf( 'WP_Error', $editor );\n\n\t\t$editor->load();\n\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\n\t\t$editor->save( $save_to_file );\n\n\t\t$im = new Imagick( $save_to_file );\n\t\t$pixel = $im->getImagePixelColor( 0, 0 );\n\t\t$expected = $pixel->getColorValue( imagick::COLOR_ALPHA );\n\n\t\t$this->assertImageAlphaAtPointImagick( $save_to_file, array( 0, 0 ), $expected );\n\n\t\tunlink( $save_to_file );\n\t}", "public function test_image_preserves_alpha() {\n\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = wp_get_image_editor( $file );\n\t\t$editor->load();\n\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\t\t\n\t\t$editor->save( $save_to_file );\n\n\t\t$this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );\n\t}", "public function ImagePreserverTransparent($transparent){\r\n $this->image_transparent=$transparent;\r\n }", "protected function transform(\\ImageTransform\\Image $image)\r\n {\r\n $resource = $image->getAdapter()->getHolder();\r\n\r\n // Use GD's built in filter\r\n if (function_exists('imagefilter'))\r\n {\r\n // we have to check for the php version as alpha support was added to imagefilter/IMG_FILTER_COLORIZE in 5.2.5\r\n if (strnatcmp(phpversion(), '5.2.5') >= 0)\r\n {\r\n imagefilter($resource, IMG_FILTER_COLORIZE, $this->red_tint, $this->green_tint, $this->blue_tint, $this->alpha);\r\n }\r\n else\r\n {\r\n imagefilter($resource, IMG_FILTER_COLORIZE, $this->red_tint, $this->green_tint, $this->blue_tint);\r\n }\r\n }\r\n\r\n // Throw Exception....\r\n // Alpha not supported\r\n else\r\n {\r\n throw new \\ImageTransform\\Exception(\"Transformation not supported\");\r\n }\r\n\r\n return $image;\r\n }", "public function test_image_preserves_alpha_on_resize() {\n\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = wp_get_image_editor( $file );\n\t\t$editor->load();\n\t\t$editor->resize(5,5);\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\t\t\n\t\t$editor->save( $save_to_file );\n\n\t\t$this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );\n\n\t}", "public function test_image_preserves_alpha_on_resize() {\n\t\t$file = DIR_TESTDATA . '/images/transparent.png';\n\n\t\t$editor = new WP_Image_Editor_Imagick( $file );\n\n\t\t$this->assertNotInstanceOf( 'WP_Error', $editor );\n\n\t\t$editor->load();\n\t\t$editor->resize( 5, 5 );\n\t\t$save_to_file = tempnam( get_temp_dir(), '' ) . '.png';\n\n\t\t$editor->save( $save_to_file );\n\n\t\t$im = new Imagick( $save_to_file );\n\t\t$pixel = $im->getImagePixelColor( 0, 0 );\n\t\t$expected = $pixel->getColorValue( imagick::COLOR_ALPHA );\n\n\t\t$this->assertImageAlphaAtPointImagick( $save_to_file, array( 0, 0 ), $expected );\n\n\t\tunlink( $save_to_file );\n\t}", "function setTransparency($new_image,$image_source) { \n $transparencyIndex = imagecolortransparent($image_source); \n $transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255); \n \n if ($transparencyIndex >= 0) { \n $transparencyColor = imagecolorsforindex($image_source, $transparencyIndex); \n } \n \n $transparencyIndex = imagecolorallocate($new_image, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']); \n imagefill($new_image, 0, 0, $transparencyIndex); \n imagecolortransparent($new_image, $transparencyIndex); \n }", "protected function transform(sfImage $image)\r\n {\r\n\r\n $resource = $image->getAdapter()->getHolder();\r\n\r\n $image->resize( $this->getWidth(), $this->getHeight() );\r\n\r\n $resource->roundCorners( $this->getRadius(), $this->getRadius() );\r\n\r\n $shadow = $resource->clone();\r\n\r\n $shadow->setImageBackgroundColor( new ImagickPixel( 'black' ) );\r\n\r\n $shadow->shadowImage( 80, 3, 5, 5 );\r\n\r\n $shadow->compositeImage( $resource, Imagick::COMPOSITE_OVER, 0, 0 );\r\n\r\n return $image;\r\n\r\n }", "protected function setTransparencyColor():void{\n\n\t\tif(!$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\t$this->imagick->transparentPaintImage($transparencyColor, 0.0, 10, false);\n\t}", "public function setConstantOpacity($opacity) {}", "protected function setTransparencyColor():void{\n\n\t\tif($this->options->outputType === QROutputInterface::GDIMAGE_JPG || !$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\timagecolortransparent($this->image, $transparencyColor);\n\t}", "public function applyMask($image)\n {\n $this->setForceAlpha(true)->saveIfRequired('mask');\n\n $image = PIMCORE_DOCUMENT_ROOT . \"/\" . ltrim($image, \"/\");\n\n $this->addConvertOption('alpha', 'off')->addConvertOption('compose', 'CopyOpacity')\n ->addConvertOption('composite')\n ->addFilter('alpha', $image);\n\n\n return $this;\n }", "function alpha($psdata, $src_img, &$size_x, &$size_y, &$image, &$mask) {\n $id = $this->generate_id();\n\n // Generate the unique temporary file name for this image; \n // we'll use it for imagemagick temporary files\n $tempfile = $psdata->mk_filename();\n\n // Save image as PNG for further processing\n imagepng($src_img, $tempfile.'.png');\n\n // Call image magick - convert to raw RGB samples (binary)\n safe_exec('\"'.IMAGE_MAGICK_CONVERT_EXECUTABLE.'\"'.\" ${tempfile}.png ${tempfile}.rgba\", $output);\n\n // read raw rgba samples\n $samples = file_get_contents($tempfile.'.rgba');\n\n // Determine image size\n $size_x = imagesx($src_img); \n $size_y = imagesy($src_img);\n \n // write stread header to the postscript file\n $psdata->write(\"/image-{$id}-init { image-{$id}-data 0 setfileposition } def\\n\");\n $psdata->write(\"/image-{$id}-data currentfile << /Filter /ASCIIHexDecode >> /ReusableStreamDecode filter\\n\");\n\n // initialize line length counter\n $ctr = 0;\n\n // Save visible background color\n $handler =& get_css_handler('background-color');\n $bg = $handler->get_visible_background_color();\n\n for ($i = 0; $i < strlen($samples); $i += 4) {\n // Save image pixel to the stream data\n $r = ord($samples{$i});\n $g = ord($samples{$i+1});\n $b = ord($samples{$i+2});\n $a = 255-ord($samples{$i+3});\n\n // Calculate approximate color \n $r = (int)($r + ($bg[0] - $r)*$a/255);\n $g = (int)($g + ($bg[1] - $g)*$a/255);\n $b = (int)($b + ($bg[2] - $b)*$a/255);\n\n // Save image pixel to the stream data\n $psdata->write(sprintf(\"%02X%02X%02X\",\n min(max($r,0),255),\n min(max($g,0),255),\n min(max($b,0),255)));\n\n // Increate the line length counter; check if stream line needs to be terminated\n $ctr += 6;\n if ($ctr > MAX_LINE_LENGTH) { \n $psdata->write(\"\\n\");\n $ctr = 0;\n }\n };\n\n // terminate the stream data\n $psdata->write(\">\\ndef\\n\");\n\n // return image and mask data references\n $image = \"image-{$id}-data\";\n $mask = \"\";\n\n // Delete temporary files \n unlink($tempfile.'.png');\n unlink($tempfile.'.rgba');\n\n return $id;\n }", "public function __construct($opacity)\r\n {\r\n $this->setOpacity($opacity);\r\n }", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct, $dst_im_ext) {\n\tif($dst_im_ext=='jpg' && $pct==100) {\n\t\timagealphablending($dst_im, true);\n\t\timagealphablending($src_im, true);\n\t\timagecopy($dst_im, $src_im, $dst_x, $dst_y, 0, 0, $src_w, $src_h);\n\t} else {\n\t\t$transparent_index = imagecolortransparent($dst_im);\n\t\t$colors_total = imagecolorstotal($dst_im);\n\t\t$cut = imagecreatetruecolor($src_w, $src_h);\n\t\t\n\t\tif($transparent_index >= 0) {\n\t\t\t$transparent_color = imagecolorsforindex($dst_im, $transparent_index);\n\t\t\t$transparent_index = imagecolorallocatealpha($cut, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'], 127);\n\t\t\timagefill($cut, 0, 0, $transparent_index);\n\t\t\timagecolortransparent($cut, $transparent_index);\n\t\t} else {\n\t\t\t$color = imagecolorallocatealpha($cut, 0, 0, 0, 127);\n\t\t\timagefill($cut, 0, 0, $color);\n\t\t}\n\t\t\n\t\tif($dst_im_ext=='png') {\n\t\t\timagealphablending($dst_im, false);\n\t\t\timagesavealpha($dst_im, true);\n\t\t} else {\n\t\t\tif($dst_im_ext!=='jpg') {\n\t\t\t\timagetruecolortopalette($dst_im, true, 255);\n\t\t\t\timagesavealpha($dst_im, false);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tif($dst_im_ext=='png' && $colors_total==0) {\n\t\t\tif($pct<100) filter_opacity($src_im, $pct);\n\t\t\timagealphablending($dst_im, true);\n\t\t\timagesavealpha($dst_im, true);\n\t\t\timagecopy($dst_im, $src_im, $dst_x, $dst_y, 0, 0, $src_w, $src_h);\n\t\t\timagealphablending($dst_im, false);\n\t\t} else {\n\t\t\timagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h);\n\t\t\timagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h);\n\t\t\timagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n\t\t}\n\t}\n\t\n\timagedestroy($cut);\n\timagedestroy($src_im);\n\n}", "function imagemergealpha($i) {\n $s = imagecreatetruecolor(imagesx($i[0]),imagesy($i[1]));\n $back_color=imagecolorallocate($s,0xa9,0xb1,0xd3);\n\n //merge all images\n imagealphablending($s,true);\n $z = $i;\n while($d = each($z)) {\n imagecopy($s,$d[1],0,0,0,0,imagesx($d[1]),imagesy($d[1]));\n }\n\n //restore the transparency\n imagealphablending($s,false);\n $w = imagesx($s);\n $h = imagesy($s);\n for($x=0;$x<$w;$x++) {\n for($y=0;$y<$h;$y++) {\n $c = imagecolorat($s,$x,$y);\n $c = imagecolorsforindex($s,$c);\n $z = $i;\n $t = 0;\n while($d = each($z)) {\n $ta = imagecolorat($d[1],$x,$y);\n $ta = imagecolorsforindex($d[1],$ta);\n $t += 127-$ta['alpha'];\n }\n $t = ($t > 127) ? 127 : $t;\n $t = 127-$t;\n $c = imagecolorallocatealpha($s,$c['red'],$c['green'],$c['blue'],$t);\n imagesetpixel($s,$x,$y,$c);\n }\n }\n imagesavealpha($s,true);\n return $s;\n}", "public function setConstantOpacityNonStroking($opacity) {}", "function voegToe()\n{\n echo \"<style> #foto{ opacity: 0.5%; fill-rule: alpha(opacity=50) } </style>\";\n\n}", "function _add_image_data( $im ) {\n\t\t$width = imagesx( $im );\n\t\t$height = imagesy( $im );\n\t\t\n\t\t\n\t\t$pixel_data = array();\n\t\t\n\t\t$opacity_data = array();\n\t\t$current_opacity_val = 0;\n\t\t\n\t\tfor ( $y = $height - 1; $y >= 0; $y-- ) {\n\t\t\tfor ( $x = 0; $x < $width; $x++ ) {\n\t\t\t\t$color = imagecolorat( $im, $x, $y );\n\t\t\t\t\n\t\t\t\t$alpha = ( $color & 0x7F000000 ) >> 24;\n\t\t\t\t$alpha = ( 1 - ( $alpha / 127 ) ) * 255;\n\t\t\t\t\n\t\t\t\t$color &= 0xFFFFFF;\n\t\t\t\t$color |= 0xFF000000 & ( $alpha << 24 );\n\t\t\t\t\n\t\t\t\t$pixel_data[] = $color;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$opacity = ( $alpha <= 127 ) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t$current_opacity_val = ( $current_opacity_val << 1 ) | $opacity;\n\t\t\t\t\n\t\t\t\tif ( ( ( $x + 1 ) % 32 ) == 0 ) {\n\t\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t\t$current_opacity_val = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ( $x % 32 ) > 0 ) {\n\t\t\t\twhile ( ( $x++ % 32 ) > 0 )\n\t\t\t\t\t$current_opacity_val = $current_opacity_val << 1;\n\t\t\t\t\n\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t$current_opacity_val = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$image_header_size = 40;\n\t\t$color_mask_size = $width * $height * 4;\n\t\t$opacity_mask_size = ( ceil( $width / 32 ) * 4 ) * $height;\n\t\t\n\t\t\n\t\t$data = pack( 'VVVvvVVVVVV', 40, $width, ( $height * 2 ), 1, 32, 0, 0, 0, 0, 0, 0 );\n\t\t\n\t\tforeach ( $pixel_data as $color )\n\t\t\t$data .= pack( 'V', $color );\n\t\t\n\t\tforeach ( $opacity_data as $opacity )\n\t\t\t$data .= pack( 'N', $opacity );\n\t\t\n\t\t\n\t\t$image = array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'color_palette_colors' => 0,\n\t\t\t'bits_per_pixel' => 32,\n\t\t\t'size' => $image_header_size + $color_mask_size + $opacity_mask_size,\n\t\t\t'data' => $data,\n\t\t);\n\t\t\n\t\t$this->_images[] = $image;\n\t}", "private function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $opacity = 1, $rotate = 0, $color = 0){\n $src_w = imagesx($src_im);\n $src_h = imagesy($src_im);\n if ($rotate) {\n $transparent = imagecolorallocatealpha($src_im, 0, 0, 0, 127);\n\n $src_im = imagerotate($src_im, $rotate, $transparent);\n $dx = imagesx($src_im) - $src_w;\n $dy = imagesy($src_im) - $src_h;\n }else{\n $dx = $dy = 0;\n }\n\n // Creating a cut resource\n $cut = imagecreatetruecolor($src_w + $dx, $src_h + $dy);\n // Copying relevant section from background to the cut resource\n imagecopy($cut, $dst_im, 0, 0, $dst_x - round($dx / 2), $dst_y - round($dy / 2), $src_w + $dx, $src_h + $dy);\n // Copying relevant section from watermark to the cut resource\n imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w + $dx, $src_h + $dy);\n // Insert cut resource to destination image\n imagecopymerge($dst_im, $cut, $dst_x - round($dx / 2), $dst_y - round($dy / 2), 0, 0, $src_w + $dx, $src_h + $dy, round($opacity * 100));\n // Destroy temporary image\n imagedestroy($cut);\n }", "function transparent($psdata, $src_img, &$size_x, &$size_y, &$image, &$mask) {\n // Generate an unique image id\n $id = $this->generate_id();\n\n // Generate the unique temporary file name for this image; \n // we'll use it for imagemagick temporary files\n $tempfile = $psdata->mk_filename();\n\n // Save image as PNG for further processing\n imagepng($src_img, $tempfile.'.png');\n\n // Call image magick - convert to raw RGBA samples (binary)\n safe_exec('\"'.IMAGE_MAGICK_CONVERT_EXECUTABLE.'\"'.\" ${tempfile}.png ${tempfile}.rgba\", $output);\n\n // read raw RGBA samples\n $samples = file_get_contents($tempfile.'.rgba');\n\n // Determine image size and create a truecolor copy of this image \n // (as we don't want to work with palette-based images manually)\n $size_x = imagesx($src_img); \n $size_y = imagesy($src_img);\n \n // write stream header to the postscript file\n $psdata->write(\"/image-{$id}-init { image-{$id}-data 0 setfileposition mask-{$id}-data 0 setfileposition } def\\n\");\n\n // Create IMAGE data stream\n $psdata->write(\"/image-{$id}-data currentfile << /Filter /ASCIIHexDecode >> /ReusableStreamDecode filter\\n\");\n\n // initialize line length counter\n $ctr = 0;\n \n for ($i = 0; $i < strlen($samples); $i += 4) {\n // Save image pixel to the stream data\n $r = ord($samples{$i});\n $g = ord($samples{$i+1});\n $b = ord($samples{$i+2});\n $psdata->write(sprintf(\"%02X%02X%02X\",$r,$g,$b));\n\n // Increate the line length counter; check if stream line needs to be terminated\n $ctr += 6;\n if ($ctr > MAX_LINE_LENGTH) { \n $psdata->write(\"\\n\");\n $ctr = 0;\n }\n };\n\n // terminate the stream data\n $psdata->write(\">\\ndef\\n\");\n\n // Create MASK data stream\n $psdata->write(\"/mask-{$id}-data currentfile << /Filter /ASCIIHexDecode >> /ReusableStreamDecode filter\\n\");\n\n // initialize line length counter\n $ctr = 0;\n\n // initialize mask bit counter\n $bit_ctr = 0;\n $mask_data = 0xff;\n\n for ($y = 0; $y < $size_y; $y++) {\n for ($x = 0; $x < $size_x; $x++) {\n // Check if this pixel should be transparent\n $a = ord($samples{($y*$size_x + $x)*4+3});\n \n if ($a < 255) {\n $mask_data = ($mask_data << 1) | 0x1;\n } else {\n $mask_data = ($mask_data << 1);\n };\n $bit_ctr ++;\n \n // If we've filled the whole byte, write it into the mask data stream\n if ($bit_ctr >= 8 || $x + 1 == $size_x) { \n // Pad mask data, in case we have completed the image row\n while ($bit_ctr < 8) {\n $mask_data = ($mask_data << 1) | 0x01;\n $bit_ctr ++;\n };\n \n $psdata->write(sprintf(\"%02X\", $mask_data & 0xff)); \n\n // Clear mask data after writing \n $mask_data = 0xff;\n $bit_ctr = 0;\n\n // Increate the line length counter; check if stream line needs to be terminated\n $ctr += 1;\n if ($ctr > MAX_LINE_LENGTH) { \n $psdata->write(\"\\n\");\n $ctr = 0;\n }\n };\n };\n };\n\n // terminate the stream data\n // Write any incomplete mask byte to the mask data stream\n if ($bit_ctr != 0) {\n while ($bit_ctr < 8) {\n $mask_data <<= 1;\n $mask_data |= 1;\n $bit_ctr ++;\n }\n $psdata->write(sprintf(\"%02X\", $mask_data));\n };\n $psdata->write(\">\\ndef\\n\");\n\n // return image and mask data references\n $image = \"image-{$id}-data\";\n $mask = \"mask-{$id}-data\";\n\n // Delete temporary files \n unlink($tempfile.'.png');\n unlink($tempfile.'.rgba');\n\n return $id;\n }", "private static function alphaRemove(Imagick $im)\n {\n $flat = new \\Imagick();\n $flat -> newImage($im -> getimagewidth(), $im -> getimageheight(), \"white\", $im -> getimageformat());\n $flat -> compositeimage($im, \\Imagick::COMPOSITE_OVER, 0, 0);\n return $flat;\n }", "private static function ensureTransparency(Imagick $im): Imagick\n {\n $im->setImageMatte(true);\n\n if (Imagick::VIRTUALPIXELMETHOD_TRANSPARENT !== $im->getImageVirtualPixelMethod()) {\n $im->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);\n }\n\n return $im;\n }", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "public function frontImage()\r\n {\r\n $wrapper = imagecreatetruecolor(16 * $this->ratio(), 32 * $this->ratio());\r\n $background = imagecolorallocatealpha($wrapper, 255, 255, 255, 127);\r\n imagefill($wrapper, 0, 0, $background);\r\n\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 8 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n //arms\r\n imagecopy($wrapper, $this->image, 0 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 12 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //chest\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 8 * $this->ratio(), 20 * $this->ratio(),\r\n 20 * $this->ratio(), 8 * $this->ratio(), 12 * $this->ratio());\r\n //legs\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 8 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //hat\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 40 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n\r\n return $wrapper;\r\n }", "protected function transform(sfImage $image)\n {\n $resource_w = $image->getWidth();\n $resource_h = $image->getHeight();\n\n $scale_w = $this->getWidth()/$resource_w;\n $scale_h = $this->getHeight()/$resource_h;\n switch ($this->getMethod())\n {\n case 'deflate':\n case 'inflate':\n\n return $image->resize($this->getWidth(), $this->getHeight());\n\n case 'left':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(0, (int)round(($image->getHeight() - $this->getHeight()) / 2), $this->getWidth(), $this->getHeight());\n\n case 'right':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop(($image->getWidth() - $this->getWidth()), (int)round(($image->getHeight() - $this->getHeight()) / 2),$this->getWidth(), $this->getHeight());\n\n case 'top':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), 0, $this->getWidth(), $this->getHeight());\n\n case 'bottom':\n $image->scale(max($scale_w, $scale_h));\n\n return $image->crop((int)round(($image->getWidth() - $this->getWidth()) / 2), ($image->getHeight() - $this->getHeight()), $this->getWidth(), $this->getHeight());\n \n case 'center':\n $image->scale(max($scale_w, $scale_h));\n \n $left = (int)round(($image->getWidth() - $this->getWidth()) / 2);\n $top = (int)round(($image->getHeight() - $this->getHeight()) / 2);\n\n return $image->crop($left, $top, $this->getWidth(), $this->getHeight());\n case 'scale':\n return $image->scale(min($scale_w, $scale_h));\n\n case 'fit': \n default:\n $img = clone $image;\n\n $image->create($this->getWidth(), $this->getHeight());\n \n // Set a background color if specified\n if(!is_null($this->getBackground()) && $this->getBackground() != '')\n {\n $image->fill(0,0, $this->getBackground());\n }\n\n $img->scale(min($this->getWidth() / $img->getWidth(), $this->getHeight() / $img->getHeight()));\n \n $image->overlay($img, 'center');\n\n return $image;\n \n }\n }", "public function apply($resource){\n\t\t// Verify support\n\t\tif(!function_exists('imagefilter')){\n\t\t\tthrow new Exception(\"It seems your PHP version is not compiled with the bundled version of the GD library\");\n\t\t}\n\t\t// Extract arguments\n\t\t@list(,$color,$opacity)=func_get_args();\n\t\t$rgb=html2rgb($color);\n\t\t// Normalize\n\t\tif($opacity===null)\t\t$opacity=100;\n\t\telseif($opacity<0)\t\t$opacity=0;\n\t\telseif($opacity>100)\t$opacity=100;\n\t\t$a=(100-$opacity)*1.27;\n\t\t// Apply effect\n\t\tif(!imagefilter($resource,IMG_FILTER_COLORIZE,$rgb[0],$rgb[1],$rgb[2],$a)){\n\t\t\tthrow new Exception(\"COLORIZE filter failed\");\n\t\t}\n\t\treturn $resource;\n\t}", "function hook_image_default_styles() {\n $styles = array();\n\n $styles['mymodule_preview'] = array(\n 'label' => 'My module preview',\n 'effects' => array(\n array(\n 'name' => 'image_scale',\n 'data' => array('width' => 400, 'height' => 400, 'upscale' => 1),\n 'weight' => 0,\n ),\n array(\n 'name' => 'image_desaturate',\n 'data' => array(),\n 'weight' => 1,\n ),\n ),\n );\n\n return $styles;\n}", "public function setOpacity($opacity=1.0){\n\t\ttry{\n\t\t\tif(!is_float($value))\n\t\t\t\tthrow new Exception(\"opacity value must be a float number, value provided is \".$opacity);\n\t\t\t\tif($opacity< 0.0 || $opacity> 1)\n\t\t\t\t\tthrow new Exception(\"opacity value must be between 0.0 to 1.0, value provided is \".$opacity);\n\t\t\t\t\t$this->opacity = $opacity;\n\t\t}catch(Exception $e){\n\t\t\tthrow new Exception(ErrorHelper::formatMessage(__FUNCTION__,__CLASS__,$e));\n\t\t}\n\t}", "public function render()\n {\n $this->image->blurImage($this->radius, $this->sigma, $this->channel);\n }", "abstract public function applyToImage(Image $image, $posx = 0, $posy = 0);", "abstract public function applyToImage(Image $image, $posx = 0, $posy = 0);", "public function colorImage() {}", "public function transparentAction() {\n $width = 400;\n $height = 300;\n $radius = 200;\n $numberOfSpots = 20;\n $intensity = 20;\n\n // get service\n $heatmap = $this->get('morgenstille.visual.heatmap')->create($width, $height);\n\n // add random spots to the heatmap\n for($i = 0; $i < $numberOfSpots; $i++) {\n $heatmap->add(new SpotInterpolate(rand(0, $width), rand(0, $height), rand(0, $radius), rand(0, $intensity)));\n }\n\n // render the heatmap and return the png response\n return $heatmap->renderPngResponse(new TransparentRenderer($heatmap->getMinValue(), $heatmap->getMaxValue()));\n\n }", "function image_filter($im, $name){\n\tif($im && imagefilter($im, IMG_FILTER_NEGATE)){\n\t\timagepng($im, '../upload/filter/effect_invert/'. $name);\n\t}\n\tif($im && imagefilter($im, IMG_FILTER_GRAYSCALE)){\n\t\timagepng($im, '../upload/filter/effect_grayscale/'. $name);\n\t}\n\tif($im && imagefilter($im, IMG_FILTER_BRIGHTNESS, 20)){\n\t\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t}\n\tif($im && imagefilter($im, IMG_FILTER_CONTRAST, 20)){\n\t\timagepng($im, '../upload/filter/effect_contrast/'. $name);\n\t}\n\t\n\t\t\n\tif($im && imagefilter($im, IMG_FILTER_COLORIZE, 255, 0, 0)){\n\t\timagepng($im, '../upload/filter/effect_color_red/'. $name);\n\t}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0)){\n\t\timagepng($im, '../upload/filter/effect_color_green/'. $name);\n\t}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_COLORIZE, 0, 0, 255)){\n\t\timagepng($im, '../upload/filter/effect_color_blue/'. $name);\n\t}\n\t\n\t\n\t\n\t//if($im && imagefilter($im, IMG_FILTER_EDGEDETECT, 20)){\n\t//\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t//}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_EMBOSS)){\n\t\timagepng($im, '../upload/filter/effect_emboss/'. $name);\n\t}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_GAUSSIAN_BLUR)){\n\t\timagepng($im, '../upload/filter/effect_gaussian_blue/'. $name);\n\t}\n\t\n\t//if($im && imagefilter($im, IMG_FILTER_SELECTIVE_BLUR, 20)){\n\t//\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t//}\n\n\tif($im && imagefilter($im, IMG_FILTER_MEAN_REMOVAL, 20)){\n\t\timagepng($im, '../upload/filter/effect_mean_remove/'. $name);\n\t}\n\n\tif($im && imagefilter($im, IMG_FILTER_SMOOTH, 1)){\n\t\timagepng($im, '../upload/filter/effect_smooth/'. $name);\n\t}\n\n\tif($im && imagefilter($im, IMG_FILTER_PIXELATE, 3, TRUE)){\n\t\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t}\n}", "public function setTransparency($value)\r\n {\r\n $this->_cleanse($value, __METHOD__);\r\n $this->_transparent = $value;\r\n \r\n return $this;\r\n }", "function escort_watermark_image( $filename, $upload_dir, $watermark_image ) {\n\n $original_image_path = trailingslashit( $upload_dir['basedir'] ) . $filename;\n \n $image_resource = new Imagick( $original_image_path );\n \n //$image_resource->blurImage( 20, 10 );\n\n $watermark_resource = new Imagick($watermark_image);\n\n // tamaños\n $iWidth = $image_resource->getImageWidth();\n $iHeight = $image_resource->getImageHeight();\n\n $wWidth = $watermark_resource->getImageWidth();\n $wHeight = $watermark_resource->getImageHeight();\n\n if ($iHeight < $wHeight || $iWidth < $wWidth) {\n // resize the watermark\n $watermark_resource->scaleImage($iWidth, $iHeight);\n \n // get new size\n $wWidth = $watermark_resource->getImageWidth();\n $wHeight = $watermark_resource->getImageHeight();\n }\n\n\n // calculate the position\n $x = ($iWidth - $wWidth) / 2;\n $y = ($iHeight - $wHeight) / 2;\n\n $image_resource->compositeImage( $watermark_resource, Imagick::COMPOSITE_OVER, $x, $y );\n \n return save_watermarked_image( $image_resource, $original_image_path, $upload_dir );\n \n}", "public function setSaveAlpha($bool)\n {\n $this->PNGIsSaveAlpha = (boolean) $bool;\n\n return $this;\n }", "function vcex_get_entry_image_overlay( $position = '', $shortcode_tag = '', $atts = '' ) {\n\tif ( empty( $atts['overlay_style'] ) || 'none' === $atts['overlay_style'] ) {\n\t\treturn '';\n\t}\n\n\tob_start();\n\t\tvcex_image_overlay( $position, $atts['overlay_style'], $atts );\n\t$overlay = ob_get_clean();\n\n\t/**\n\t * Filters the entry image overlay html.\n\t *\n\t * @param string $overlay_html\n\t * @param string $overlay_position\n\t * @param string $shortcode_tag\n\t * @param array $shortcode_attributes\n\t */\n\t$overlay = apply_filters( 'vcex_entry_image_overlay', $overlay, $position, $shortcode_tag, $atts );\n\n\treturn $overlay;\n}", "function zbx_colormix($image, $bgColor, $fgColor, $alpha) {\n\t$r = $bgColor[0] + ($fgColor[0] - $bgColor[0]) * $alpha;\n\t$g = $bgColor[1] + ($fgColor[1] - $bgColor[1]) * $alpha;\n\t$b = $bgColor[2] + ($fgColor[2] - $bgColor[2]) * $alpha;\n\n\treturn imagecolorresolvealpha($image, $r, $g, $b, 0);\n}", "public function applyFilter(\\Intervention\\Image\\Image $image)\n {\n return $image->fit(120, 120);\n }", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n\t$cut = imagecreatetruecolor($src_w, $src_h); \n\n // copying relevant section from background to the cut resource \n\timagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h); \n\n // copying relevant section from watermark to the cut resource \n\timagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h); \n\n // insert cut resource to destination image \n\timagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct); \n}", "public function implement_all_effects()\n\t{\n\t\tforeach ($this->collection as $image)\n\t\t{\n\t\t\t$image->implement_effects();\n\t\t}\n\t}", "protected function preserveAlpha($dest, $src)\n {\n $transparent = @imagecolortransparent($src);\n if (-1 != $transparent) {\n $color = @imagecolorsforindex($src, $transparent);\n $allocated = @imagecolorallocatealpha(\n $dest\n , $color['red']\n , $color['green']\n , $color['blue']\n , $color['alpha']\n );\n @imagecolortransparent($dest, $allocated);\n @imagefill($dest, 0, 0, $allocated);\n }\n }", "public function applyFilter(Image $image)\n {\n // transparent background if possible\n\n $mirror = strpos($this->rotation, '!') === false ? false : true;\n $rotation = $mirror ? substr($this->rotation, 1) : $this->rotation;\n if ($mirror) {\n $image->flip('h');\n }\n\n return $image->rotate(-$rotation);\n }", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n $cut = imagecreatetruecolor($src_w, $src_h); \n\n // copying relevant section from background to the cut resource \n imagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h); \n \n // copying relevant section from watermark to the cut resource \n imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h); \n \n // insert cut resource to destination image \n imagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n\n }", "function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){\n // creating a cut resource \n $cut = imagecreatetruecolor($src_w, $src_h);\n\n // copying relevant section from background to the cut resource \n imagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h);\n\n // copying relevant section from watermark to the cut resource \n imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h);\n\n // insert cut resource to destination image \n imagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);\n }", "public static function preserveTransparency()\n {\n return new FlagQualifier(self::PRESERVE_TRANSPARENCY);\n }", "private function imageCopyMergeAlpha(\n\t\tGdImage $dstIm,\n\t\tGdImage $srcIm,\n\t\tint $dstX,\n\t\tint $dstY,\n\t\tint $srcX,\n\t\tint $srcY,\n\t\tint $srcW,\n\t\tint $srcH,\n\t\tfloat $pct\n\t): void {\n\t\t$pct /= 100;\n\t\t// Get image width and height \n\t\t$w = imagesx($srcIm);\n\t\t$h = imagesy($srcIm);\n\t\t// Turn alpha blending off \n\t\timagealphablending($srcIm, false);\n\t\t// Find the most opaque pixel in the image (the one with the smallest alpha value) \n\t\t$minAlpha = 127;\n\t\tfor ($x = 0; $x < $w; $x++)\n\t\t\tfor ($y = 0; $y < $h; $y++) {\n\t\t\t\t$alpha = (imagecolorat($srcIm, $x, $y) >> 24) & 0xFF;\n\t\t\t\tif ($alpha < $minAlpha) {\n\t\t\t\t\t$minAlpha = $alpha;\n\t\t\t\t}\n\t\t\t}\n\t\t// Loop through image pixels and modify alpha for each \n\t\tfor ($x = 0; $x < $w; $x++) {\n\t\t\tfor ($y = 0; $y < $h; $y++) {\n\t\t\t\t// Get current alpha value (represents the TANSPARENCY!) \n\t\t\t\t$colorXY = imagecolorat($srcIm, $x, $y);\n\t\t\t\t$alpha = ($colorXY >> 24) & 0xFF;\n\t\t\t\t// Calculate new alpha \n\t\t\t\tif ($minAlpha !== 127) {\n\t\t\t\t\t$alpha = 127 + 127 * $pct * ($alpha - 127) / (127 - $minAlpha);\n\t\t\t\t} else {\n\t\t\t\t\t$alpha += 127 * $pct;\n\t\t\t\t}\n\t\t\t\t// Get the color index with new alpha \n\t\t\t\t$alphaColorXY = imagecolorallocatealpha($srcIm, ($colorXY >> 16) & 0xFF, ($colorXY >> 8) & 0xFF, $colorXY & 0xFF, $alpha);\n\t\t\t\t// Set pixel with the new color + opacity \n\t\t\t\tif (!imagesetpixel($srcIm, $x, $y, $alphaColorXY)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// The image copy \n\t\timagecopy($dstIm, $srcIm, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH);\n\t}", "public function test_flip() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->flip( true, false );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 99 )->getColor() );\n\t}", "public function watermark($watermark, $offset_x=null, $offset_y=null, $opacity=null);", "function hook_image_styles_alter(&$styles) {\n // Check that we only affect a default style.\n if ($styles['thumbnail']['storage'] == IMAGE_STORAGE_DEFAULT) {\n // Add an additional effect to the thumbnail style.\n $styles['thumbnail']['effects'][] = array(\n 'name' => 'image_desaturate',\n 'data' => array(),\n 'weight' => 1,\n 'effect callback' => 'image_desaturate_effect',\n );\n }\n}", "function solid(&$psdata, $src_img, &$size_x, &$size_y, &$image, &$mask) {\n // Generate an unique image id\n $id = $this->generate_id();\n\n // Generate the unique temporary file name for this image; \n // we'll use it for imagemagick temporary files\n $tempfile = $psdata->mk_filename();\n\n // Save image as PNG for further processing\n imagepng($src_img, $tempfile.'.png');\n\n // Call image magick - convert to raw RGB samples (binary)\n safe_exec('\"'.IMAGE_MAGICK_CONVERT_EXECUTABLE.'\"'.\" ${tempfile}.png ${tempfile}.rgb\", $output);\n\n // read raw rgb samples\n $samples = file_get_contents($tempfile.'.rgb');\n\n // Determine image size \n $size_x = imagesx($src_img); \n $size_y = imagesy($src_img);\n\n // write stread header to the postscript file\n $psdata->write(\"/image-{$id}-init { image-{$id}-data 0 setfileposition } def\\n\");\n $psdata->write(\"/image-{$id}-data currentfile << /Filter /ASCIIHexDecode >> /ReusableStreamDecode filter\\n\");\n\n // initialize line length counter\n $ctr = 0;\n \n for ($i = 0; $i < strlen($samples); $i += 3) {\n // Save image pixel to the stream data\n $r = ord($samples{$i});\n $g = ord($samples{$i+1});\n $b = ord($samples{$i+2});\n $psdata->write(sprintf(\"%02X%02X%02X\\n\",$r,$g,$b));\n\n // Increate the line length counter; check if stream line needs to be terminated\n $ctr += 6;\n if ($ctr > MAX_LINE_LENGTH) { \n $psdata->write(\"\\n\");\n $ctr = 0;\n };\n };\n\n // terminate the stream data\n $psdata->write(\">\\ndef\\n\");\n\n // return image and mask data references\n $image = \"image-{$id}-data\";\n $mask = \"\";\n\n // Delete temporary files \n unlink($tempfile.'.png');\n unlink($tempfile.'.rgb');\n\n return $id;\n }", "public function mergeAlpha(\n Image $srcImage,\n int $dstX,\n int $dstY,\n int $alpha = 127\n ): Image {\n if (!is_resource($this->image) || !is_resource($srcImage->image)) {\n throw new \\RuntimeException(\n 'Attempt to merge image data using an invalid image resource.'\n );\n }\n\n $percent = (int) (100 - min(max(round($alpha / 127 * 100), 1), 100));\n\n // copy images around\n @imagecopymerge(\n $this->image,\n $srcImage->image,\n (int) $dstX,\n (int) $dstY,\n 0,\n 0,\n $srcImage->width,\n $srcImage->height,\n $percent\n );\n\n return $this;\n }", "public function applyFilter(Image $image)\n {\n return $image->encode('jpg', 90)->resize(400, 300);\n }", "public function test_flip() {\n\t\t$file = DIR_TESTDATA . '/images/one-blue-pixel-100x100.png';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 0 )->getColor();\n\n\t\t$imagick_image_editor->flip( true, false );\n\n\t\t$this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 99 )->getColor() );\n\t}", "protected function _colorize($img, $percent) {\n $phpErrorHandler = new PhpErrorHandler();\n $res = $phpErrorHandler->call(function()use($img){\n return imagealphablending($img, false);\n });\n if(! $res) {\n $function = 'imagealphablending';\n }\n else {\n $res = $phpErrorHandler->call(function()use($img){\n return imagesavealpha($img, true);\n });\n if(! $res) {\n $function = 'imagesavealpha';\n }\n else {\n $res = $phpErrorHandler->call(function()use($img, $percent){\n // Get a percent value 0 to 100\n $abs = abs(intval($percent));\n $pct = $abs ? (($abs - 1) % 100 + 1) : $abs;\n $alpha = 127 * (1 - $pct / 100);\n return imagefilter($img, IMG_FILTER_COLORIZE, 0, 0, 0, $alpha);\n });\n if($res) {\n return true;\n }\n $function = 'imagefilter';\n }\n }\n // T_PHP_FUNCTION_FAILED = image function '%s' failed\n $msg = $phpErrorHandler->getErrorMsg(sprintf(MediaConst::T_PHP_FUNCTION_FAILED, $function), \"cannot apply image fading\");\n // a PHP image function has failed\n throw new Exception\\RuntimeException($msg, MediaConst::E_PHP_FUNCTION_FAILED);\n }", "public function apply(){\n $base = $this->getBackground('base', $this->getParameter('base-color'));\n if(!$base) return;\n \n $x = $this->getFuncard()->xc($this->getParameter('base-x'));\n $y = $this->getFuncard()->yc($this->getParameter('base-y'));\n \n $this->getFuncard()->getCanvas()->compositeImage(\n $base, Imagick::COMPOSITE_OVER, $x, $y\n );\n \n // Etape 2 : le liseré !\n $edging = $this->getBackground('edging', $this->getParameter('edging-color'));\n if($edging){\n $x = $this->getFuncard()->xc($this->getParameter('edging-x'));\n $y = $this->getFuncard()->yc($this->getParameter('edging-y'));\n \n $this->getFuncard()->getCanvas()->compositeImage(\n $edging, Imagick::COMPOSITE_OVER, $x, $y\n );\n \n }\n \n // Etape 3 : Les box !\n $titlebox = $this->getBackground('titlebox', $this->getParameter('box-color'));\n if($titlebox){\n $x = $this->getFuncard()->xc($this->getParameter('titlebox-x'));\n $y = $this->getFuncard()->yc($this->getParameter('titlebox-y'));\n \n $this->getFuncard()->getCanvas()->compositeImage(\n $titlebox, Imagick::COMPOSITE_OVER, $x, $y\n );\n \n }\n \n $typebox = $this->getBackground('typebox', $this->getParameter('box-color'));\n if($typebox){\n \n $x = $this->getFuncard()->xc($this->getParameter('typebox-x'));\n $y = $this->getFuncard()->yc($this->getParameter('typebox-y'));\n \n $this->getFuncard()->getCanvas()->compositeImage(\n $typebox, Imagick::COMPOSITE_OVER, $x, $y\n );\n \n }\n \n // Dernière étape : il faut calculer la couleur la febox\n \n $ret = '';\n if($titlebox) $ret = substr($this->getParameter('box-color'), -1, 1);\n elseif($edging) $ret = substr($this->getParameter('edging-color'), -1, 1);\n else $ret = substr($this->getParameter('base-color'), -1, 1);\n \n $ret = [\n 'fe' => ['color' => $ret]\n ];\n \n // Re-dernière étape, il faut calculer la couleur de l'illustrateur\n \n $base_letter = $this->getParameter('base-color')[0];\n if($base_letter == 'b' || $base_letter == 'l'){\n $ret['illus'] = [\n 'color' => 'white',\n 'altcolor' => 'black'\n ];\n $ret['copyright'] = [\n 'color' => 'white',\n ];\n }\n \n return $ret;\n \n }", "public function greyScale()\n {\n if (imagefilter($this->sourceImage, IMG_FILTER_GRAYSCALE))\n $this->objet->setSource($this->sourceImage);\n }", "public function contrast($factor)\n {\n if (imagefilter($this->sourceImage, IMG_FILTER_CONTRAST, $factor))\n $this->objet->setSource($this->sourceImage);\n }", "private function createImageKeepTransparency($width, $height) {\n $img = imagecreatetruecolor($width, $height);\n imagealphablending($img, false);\n imagesavealpha($img, true); \n return $img;\n }", "private function _setTransparency($color) {\r\n\t\t// Define a color as transparent\r\n\t\timagecolortransparent($this->_resource, $color);\r\n\t\t\r\n\t\t// Enable alpha-blending and save that information\r\n\t\timagealphablending($this->_resource, true);\r\n\t\timagesavealpha($this->_resource, true);\r\n\t}", "public function invert() {\n if (isset($this->_resource)) {\n imagefilter($this->_resource, IMG_FILTER_NEGATE);\n } else {\n trigger_error(\"CAMEMISResizeImage::invert() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "private static function getNodeOpacity(SVGNode $node): float\n {\n $opacity = $node->getStyle('opacity');\n\n if ($opacity === 'inherit') {\n $parent = $node->getParent();\n if (isset($parent)) {\n return self::getNodeOpacity($parent);\n }\n }\n\n return self::parseOpacity($opacity);\n }", "public function applyFilter(Image $image)\n {\n return $image->fit(120, 90)->greyscale();\n }", "public function setBlendMode($blendMode) {}", "protected function keepColor($image) {\n imagesavealpha($image, true);\n $color = imagecolorallocatealpha($image, 0, 0, 0, 127);\n imagefill($image, 0, 0, $color);\n return $image;\n }", "public function alphaBlending($blendMode)\n {\n return imagealphablending($this->imageRes, $blendMode);\n }", "public function emboss() {\r\n\t\t$matrix = array(\r\n\t\t\tarray(1, 1, -1),\r\n\t\t\tarray(1, 1, -1),\r\n\t\t\tarray(1, -1, -1)\r\n\t\t);\r\n\t\t$this->convolution($matrix, array_sum(array_map('array_sum', $matrix)));\r\n\t}", "public static function watermark(){\n\n}", "public function reflection($height=null, $opacity=null, $fade_in=null);", "private function transparentImage($width, $height)\n {\n $img = imagecreatetruecolor($width, $height);\n imagealphablending($img, false);\n imagesavealpha($img, true);\n $backgr = imagecolorallocatealpha($img, 255, 255, 255, 127);\n imagefilledrectangle($img, 0, 0, $width, $height, $backgr);\n return $img;\n }", "public function getStrokeOpacity(): int\n {\n return $this->strokeOpacity;\n }", "public function applyToImage(Image $image, $x = 0, $y = 0)\n {\n return parent::applyToImage($image, $x, $y);\n }", "public function watermark(string $file, int $position = Image::WATERMARK_TOP_LEFT, int $opacity = 100): Image\n\t{\n\t\t// Check if the image exists\n\n\t\tif(file_exists($file) === false)\n\t\t{\n\t\t\tthrow new PixlException(vsprintf('The watermark image [ %s ] does not exist.', [$file]));\n\t\t}\n\n\t\t// Make sure that opacity is between 0 and 100\n\n\t\t$opacity = max(min((int) $opacity, 100), 0);\n\n\t\t// Add watermark to the image\n\n\t\t$this->processor->watermark($file, $position, $opacity);\n\n\t\treturn $this;\n\t}", "public function getSaveAlpha()\n {\n return $this->PNGIsSaveAlpha;\n }", "public function applyToImage($image_uri);", "function Utilities_Image(){\n\t\t// $this->$imageAsset = $img;\t\t\n\t}", "function imagesetstyle($image, $style)\n{\n}", "protected function _do_background($r, $g, $b, $opacity)\n {\n $this->_load_image();\n\n // Convert an opacity range of 0-100 to 127-0\n $opacity = round(abs(($opacity * 127 / 100) - 127));\n\n // Create a new background\n $background = $this->_create($this->width, $this->height);\n\n // Allocate the color\n $color = imagecolorallocatealpha($background, $r, $g, $b, $opacity);\n\n // Fill the image with white\n imagefilledrectangle($background, 0, 0, $this->width, $this->height, $color);\n\n // Alpha blending must be enabled on the background!\n imagealphablending($background, TRUE);\n\n // Copy the image onto a white background to remove all transparency\n if (imagecopy($background, $this->_image, 0, 0, 0, 0, $this->width, $this->height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $background;\n }\n }", "public function testTransparency()\n {\n $feed = $this->eventFeed;\n\n // Assert that all entry's have a transparency object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getTransparency() instanceof Zend_Gdata_Extension_Transparency);\n }\n\n // Assert one of the entries values\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"transparency\", \"value\", \"http://schemas.google.com/g/2005#event.transparent\");\n }", "private function createImageKeepTransparency($width, $height) {\n $img = imagecreatetruecolor($width, $height);\n imagealphablending($img, false);\n imagesavealpha($img, true);\n return $img;\n }", "public function smooth($value=6)\n\t{\n\t\tif (!function_exists('imagefilter')) {\n\t\t\tthrow new Exception('imagefilter function is only available if PHP is compiled with the bundled version of the GD library.');\n\t\t}\n\t\t$this->checkImage();\n\t\t$value = max(-12, min($value, 12));\n\t\timagefilter($this->imageResized, IMG_FILTER_SMOOTH, $value);\n\n\t\treturn $this;\n\t}", "function __construct()\n {\n $this\n ->setOpacity(1.0)\n ->setUpdatedAt(new \\DateTime('now'))\n ->setActive(false)\n ;\n }", "private function handleTransparency( &$dst_img, $imgType, $newWidth, $newHeight ) {\n\t\t// handle transparency:\n\t\tif ( $imgType == IMAGETYPE_PNG || $imgType == IMAGETYPE_GIF ) {\n\t\t\timagealphablending( $dst_img, false );\n\t\t\timagesavealpha( $dst_img,true );\n\t\t\t$transparent = imagecolorallocatealpha( $dst_img, 255, 255, 255, 127 );\n\t\t\timagefilledrectangle( $dst_img, 0, 0, $newWidth, $newHeight, $transparent );\n\t\t}\n\t}", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "public function get_transition_effects() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_transition_effects();\n\n }", "public function overlay($layer, $position = null, $blendMode = null)\n {\n return $this->addAction(\n ClassUtils::verifyInstance(\n $layer,\n BasePositionalSourceContainer::class,\n ImageOverlay::class,\n $position,\n $blendMode\n )\n );\n }", "function auto($psdata, $src_img, &$size_x, &$size_y, &$tcolor, &$image, &$mask) {\n if (imagecolortransparent($src_img) == -1) {\n $id = $this->solid($psdata, $src_img, $size_x, $size_y, $image, $mask);\n $tcolor = 0;\n return $id;\n } else {\n $id = $this->transparent($psdata, $src_img, $size_x, $size_y, $image, $mask);\n $tcolor = 1;\n return $id;\n };\n }", "protected function validateOpacity($value) {\n if (!is_numeric($value) || $value < 0 || $value > 100) {\n $this->triggerError('opacity is not valid');\n return FALSE;\n }\n return TRUE;\n }", "function watermarkText21Image ($SourceFile,$WaterMarkText) {\n header(\"Content-type: image/jpg\");\n //Using imagecopymerge() to create a translucent watermark\n \n // Load the image on which watermark is to be applied\n $original_image = imagecreatefromjpeg($SourceFile);\n // Get original parameters\n list($original_width, $original_height, $original_type, $original_attr) = getimagesize($original_image); \n \n // create watermark with orig size\n $watermark = imagecreatetruecolor(200, 60);\n \n $original_image = imagecreatefromjpeg($SourceFile);\n \n // Define text\n $font = $_SERVER['DOCUMENT_ROOT'].'/include/captcha/fonts/moloto.otf';\n $white = imagecolorallocate($watermark, 255, 255, 255);\n // Add some shadow to the text\n imagettftext($watermark, 18, 0, 30, 35, $white, $font, $WaterMarkText);\n \n // Set the margins for the watermark and get the height/width of the watermark image\n $marge_right = 10;\n $marge_bottom = 10;\n $sx = imagesx($watermark);\n $sy = imagesy($watermark);\n \n // Merge the watermark onto our photo with an opacity (transparency) of 50%\n imagecopymerge($original_image, \n $watermark,\n imagesx($original_image)/2 - $sx/2 , \n imagesy($original_image) /2 - $sy/2,\n 0, \n 0, \n imagesx($watermark), \n imagesy($watermark),\n 20\n );\n \n // Save the image to file and free memory\n imagejpeg($original_image, null, 100); //$SourceFile\n imagedestroy($original_image);\n}" ]
[ "0.75872093", "0.59292674", "0.5822969", "0.5822969", "0.5822969", "0.5822969", "0.5741829", "0.57286924", "0.5635671", "0.5533958", "0.5518543", "0.548572", "0.54534686", "0.5363476", "0.53465366", "0.52536803", "0.52138495", "0.5168737", "0.5166057", "0.5142587", "0.5133603", "0.5098053", "0.5043311", "0.49776825", "0.49042538", "0.49038133", "0.4901812", "0.4895116", "0.48268506", "0.48225874", "0.4792151", "0.4791888", "0.47822228", "0.47239214", "0.47111776", "0.468327", "0.46512198", "0.46298084", "0.46078622", "0.45890167", "0.45890167", "0.45593768", "0.45417276", "0.45357886", "0.45118263", "0.448176", "0.4479133", "0.44495812", "0.4420882", "0.44109794", "0.4378815", "0.4376363", "0.4361963", "0.43413427", "0.43407923", "0.43356848", "0.43097517", "0.4303859", "0.43015814", "0.42750973", "0.42694306", "0.42632785", "0.426158", "0.42506915", "0.42476654", "0.42322874", "0.42275983", "0.4208799", "0.42087018", "0.4208037", "0.41980132", "0.41930947", "0.41765693", "0.41234317", "0.41221133", "0.4119632", "0.41145235", "0.4106577", "0.4098353", "0.40982807", "0.40822545", "0.40729624", "0.40680483", "0.4056277", "0.40511665", "0.40423986", "0.40341544", "0.40283516", "0.40236127", "0.4021884", "0.40030447", "0.39945", "0.39865103", "0.3977132", "0.39763173", "0.39662024", "0.3955637", "0.39482877", "0.3945291", "0.39392298" ]
0.6452402
1
Update child pages URLs
function updateChildPageUrls($id, $oldUrl, $newUrl) { $children = $this->children($id); if (!empty($children)) { foreach ($children as $page) { // Just resave, beforeSave does the magic $this->create($page); $this->save(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function company_addUrl() {\n $this->layout = \"ajax\";\n if (isset($_POST['child'])) {\n $child = $_POST['child'] + 1;\n $this->set('child', $child);\n }\n }", "public function onAfterWrite() {\n\n\t\tparent::onAfterWrite();\n\n\t\t// Determine whether the default automated URL handling has been replaced.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default')) {\n\n\t\t\t// Determine whether the URL segment or parent ID has been updated.\n\n\t\t\t$changed = $this->owner->getChangedFields();\n\t\t\tif((isset($changed['URLSegment']['before']) && isset($changed['URLSegment']['after']) && ($changed['URLSegment']['before'] != $changed['URLSegment']['after'])) || (isset($changed['ParentID']['before']) && isset($changed['ParentID']['after']) && ($changed['ParentID']['before'] != $changed['ParentID']['after']))) {\n\n\t\t\t\t// The link mappings should only be created for existing pages.\n\n\t\t\t\t$URL = (isset($changed['URLSegment']['before']) ? $changed['URLSegment']['before'] : $this->owner->URLSegment);\n\t\t\t\tif(strpos($URL, 'new-') !== 0) {\n\n\t\t\t\t\t// Determine the page URL.\n\n\t\t\t\t\t$parentID = (isset($changed['ParentID']['before']) ? $changed['ParentID']['before'] : $this->owner->ParentID);\n\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parentID}\");\n\t\t\t\t\twhile($parent) {\n\t\t\t\t\t\t$URL = Controller::join_links($parent->URLSegment, $URL);\n\t\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parent->ParentID}\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a link mapping for this page.\n\n\t\t\t\t\tsingleton(MisdirectionService::class)->createPageMapping($URL, $this->owner->ID);\n\n\t\t\t\t\t// Purge any link mappings that point back to the same page.\n\n\t\t\t\t\t$this->owner->regulateMappings(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link(), $this->owner->ID);\n\n\t\t\t\t\t// Recursively create link mappings for any children.\n\n\t\t\t\t\t$children = $this->owner->AllChildrenIncludingDeleted();\n\t\t\t\t\tif($children->count()) {\n\t\t\t\t\t\t$this->owner->recursiveMapping($URL, $children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function initUrlProcess() {\n $url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $urld = urldecode($url);\n $url = trim(str_replace($this->subdir, \"\", $urld), '/');\n\n // Redirect index aliases\n if (in_array($url, ['home', 'index', 'index.php'])) {\n redirect($this->subdir, 301);\n }\n\n $this->url = $url;\n $this->segments = empty($url) ? [] : explode('/', $url);\n }", "function make_urls() {\n $url = '/search/' . $this->id . '/';\n $this->append_urls('self', $url);\n }", "public function rebuildURLs($recursive=false,$clearcache=false)\r\n\t{\r\n\t\tglobal $myDB;\r\n\t\tglobal $PTC_LANGUAGES;\r\n\t\tglobal $myPT;\r\n\r\n\t\t$url_changed = false;\r\n\r\n\t\t$mySQL = new SQLBuilder();\r\n\r\n\r\n\t\t$url = $this->buildURL();\r\n\t\t$mySQL->addField(\"pag_url\",$url);\r\n\t\tif ($url!=$this->row[\"pag_url\"])\r\n\t\t{\r\n\t\t\t$url_changed = true;\r\n\t\t}\r\n\r\n\r\n\t\tforeach ($PTC_LANGUAGES AS $k =>$v)\r\n\t\t{\r\n\t\t\t//if ($this->multilanguage)\r\n\t\t\t//{\r\n\t\t\t\t$url = $this->buildURL($k);\r\n\t\t\t//}\r\n\r\n\t\t\t$mySQL->addField(\"pag_url\".$k,$url);\r\n\t\t\tif ($url!=$this->row[\"pag_url\".$k])\r\n\t\t\t{\r\n\t\t\t\t$url_changed = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sql = $mySQL->update(\"page\",\"pag_id=\".$this->id);\r\n\t\t$myDB->query($sql);\r\n\r\n\t\t// rebuild url of child pages, if any url has changed\r\n\t\tif ($url_changed==true AND $recursive=true)\r\n\t\t{\r\n\t\t\t$sql = \"SELECT pag_id FROM page WHERE pag_id_top=\".$this->id;\r\n\t\t\t$rs = $myDB->query($sql);\r\n\t\t\twhile ($row=mysql_fetch_array($rs))\r\n\t\t\t{\r\n\t\t\t\t$myPage = new PhenotypePage($row[\"pag_id\"]);\r\n\t\t\t\t$myPage->rebuildURLs(true);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($clearcache==true)\r\n\t\t{\r\n\t\t\t$myPT->clearcache();\r\n\t\t}\r\n\t}", "function ajan_core_update_directory_page_ids( $blog_page_ids ) {\n\tajan_update_option( 'ajan-pages', $blog_page_ids );\n}", "abstract public function get_url_update();", "public function createNestedPagesAndCopyLiveParentPage() {}", "public function setSubpages() {\n $sendbadgeTemp = new SendBadgeTemp();\n $settingTemp = new SettingsTemp();\n $userTemp = new UserTemp();\n $badgesTemp = new BadgesTemp();\n $singleBadgesTemp = new SingleBadgeTemp();\n\t\t$staticPagesTemp = new StaticPagesTemp();\n\n $this->subpages = array(\n // ## Badges ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Badges',\n 'menu_title' => 'Badges',\n 'capability' => 'manage_options',\n 'menu_slug' => 'edit.php?post_type=' . self::POST_TYPE_BADGES,\n 'callback' => ''\n ),\n // ## Fields ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Fields of education',\n 'menu_title' => 'Fields of education',\n 'capability' => 'manage_options',\n 'menu_slug' => 'edit-tags.php?taxonomy=' . self::TAX_FIELDS . '&post_type=' . self::POST_TYPE_BADGES,\n 'callback' => ''\n ),\n // ## Levels ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Levels',\n 'menu_title' => 'Levels',\n 'capability' => 'manage_options',\n 'menu_slug' => 'edit-tags.php?taxonomy=' . self::TAX_LEVELS . '&post_type=' . self::POST_TYPE_BADGES,\n 'callback' => ''\n ),\n // ## Send Badges ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Send Badges',\n 'menu_title' => 'Send Badges',\n 'capability' => WPUser::CAP_SELF,\n 'menu_slug' => self::PAGE_SEND_BADGE,\n 'callback' => array($sendbadgeTemp, 'main')\n ),\n // ## All Badges ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'All Badges',\n 'menu_title' => 'All Badges',\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_BADGES,\n 'callback' => array($badgesTemp, 'main')\n ),\n // ## User ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'User',\n 'menu_title' => 'User',\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_PROFILE,\n 'callback' => array($userTemp, 'main')\n ),\n // ## Settings ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Settings',\n 'menu_title' => 'Settings',\n 'capability' => 'manage_options',\n 'menu_slug' => self::PAGE_SETTINGS,\n 'callback' => array($settingTemp, 'main')\n ),\n\t\t\t\n\t\t\t// ## About us ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'About us',\n 'menu_title' => 'About us',\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_ABOUT,\n 'callback' => array($staticPagesTemp, 'aboutTab')\n ),\n\t\t\t\n // ## Single Badge ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Badge',\n 'menu_title' => null,\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_SINGLE_BADGES,\n 'callback' => array($singleBadgesTemp, 'main')\n ),\n\t\t\t\n\n );\n\n\n // ## Restrict Access ##\n // Be careful HERE, this sub-page is created only for rcp-restrict-post-type\n $this->subpages[] = array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Restrict Access',\n 'menu_title' => 'Restrict Access',\n 'capability' => 'manage_options',\n 'menu_slug' => 'admin.php?page=rcp-restrict-post-type-' . self::POST_TYPE_BADGES,\n 'callback' => ''\n );\n }", "public function update(){\n foreach (the()->project->languages as $lang){\n $field=\"url_$lang\";\n if($this->urlExists($this->$field,$lang)){\n $increment=1;\n $url=$this->$field.'-'.$increment;\n while($this->urlExists($url,$lang)){\n $increment++;\n $url=$this->$field.'-'.$increment;\n }\n $this->$field=$url;\n }\n $this->$field=strtolower($this->$field);\n $this->$field=pov()->utils->string->clean($this->$field,\"/\");\n }\n\n\n parent::update();\n\n }", "function set_page_link($newqs = array(), $newpath = null) {\n $get = $_GET;\n unset($get['request_uri']);\n $allqet = array_merge($get, $newqs);\n if (empty($newpath)) {\n $qs = http_build_query($allqet);\n return Router::$page_url . (!empty($qs) ? \"?$qs\" : null);\n }\n $qs = http_build_query($allqet);\n return \"$newpath\" . (!empty($qs) ? \"?$qs\" : null);\n}", "function dispatch_rewrites() {\n\t\\path_dispatch()->add_path(\n\t\t[\n\t\t\t'path' => 'homepage',\n\t\t\t'rewrite' => [\n\t\t\t\t'rule' => 'page/([0-9]+)/?',\n\t\t\t\t'redirect' => 'index.php?dispatch=homepage&pagination=$matches[1]',\n\t\t\t\t'query_vars' => 'pagination',\n\t\t\t],\n\t\t]\n\t);\n}", "protected function getUpdatablePages() {}", "public function setPageUrls($urls);", "function pagination( $which ) {\r\n\t\t$save_uri = $_SERVER['REQUEST_URI'];\r\n\t\t$_SERVER['REQUEST_URI'] = add_query_arg( self::mla_submenu_arguments(), $save_uri );\r\n\t\tparent::pagination( $which );\r\n\t\t$_SERVER['REQUEST_URI'] = $save_uri;\r\n\t}", "function wv_make_child_page($postid, $parentid) {\n $my_post = array(\n 'ID' => $postid,\n 'post_parent' => $parentid\n );\n\n // Update the post into the database\n wp_update_post($my_post);\n }", "public function iis7_url_rewrite_rules($add_parent_tags = \\false)\n {\n }", "private function migrateLinksPerIndex() {\n\t\tif ( ! empty( $this->oldOptions['modules']['aiosp_sitemap_options']['aiosp_sitemap_max_posts'] ) ) {\n\t\t\t$value = intval( $this->oldOptions['modules']['aiosp_sitemap_options']['aiosp_sitemap_max_posts'] );\n\t\t\tif ( ! $value ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$value = $value > 50000 ? 50000 : $value;\n\t\t\taioseo()->options->sitemap->general->linksPerIndex = $value;\n\t\t}\n\t}", "public function getNextPageUrl();", "public function getNextPageUrl();", "protected function setUpInstanceCoreLinks() {}", "public function getAllPagesUrl() {\n return $this->getUrl('adminhtml/mzeis_documentation_list/allPages');\n }", "function fc_update_parent_links()\n{\n $db = new PHPWS_DB('images');\n $db->addWhere('url', 'parent');\n $db->addValue('url', NULL);\n PHPWS_Error::logIfError($db->update());\n\n // remove superfluous column\n PHPWS_Error::logIfError($db->dropTableColumn('parent_id'));\n}", "public function page_rewrite_rules()\n {\n }", "protected function currentPageHasSubPages() {}", "protected function sectionUrls()\n {\n // One place to set Friendly URL for all pages\n // originally code F (delete this line later)\n $output = '<h1><i class=\"fa fa-link\"></i> ' . $this->tableAdmin->translate('Friendly URL')\n . '</h1><div id=\"agenda-urls\">'\n . '<form action=\"\" method=\"post\" class=\"friendly-urls\" onsubmit=\"return confirm(\\''\n . $this->tableAdmin->translate('Are you sure?') . '\\')\">'\n . Tools::htmlInput('urls', '', 1, ['type' => 'hidden'])\n . Tools::htmlInput('token', '', end($_SESSION['token']), 'hidden');\n $urls = []; // all URLs, all language versions with a link to what it links to (product, page, … id, etc.)\n $langs = array_keys($this->MyCMS->TRANSLATIONS);\n // Todo queryStrictArray\n $query = $this->MyCMS->dbms->queryStrictNonEmptyArray(\n 'SELECT id,\"content\" AS _table,type,' . Tools::arrayListed($langs, 0, ',', 'url_') . ','\n . Tools::arrayListed($langs, 0, ',', 'name_') . ' FROM `' . TAB_PREFIX . 'content` WHERE type IN ('\n . '\"article\", \"page\", \"news\"' // list of types to be listed for Friendly URL settings\n . ') ORDER BY type'\n );\n foreach ($query as $row) {\n $urls [] = $row;\n }\n // Friendly URL folders for types to be listed for Friendly URL settings\n $TYPE2PATH = [\n 'content-article' => '',\n 'content-page' => '',\n 'content-news' => 'news'\n ];\n $lastType = false;\n foreach ($urls as $value) {\n Assert::isArray($value);\n if ($lastType != $value['_table'] . '-' . $value['type']) {\n $output .= '<h3 class=\"lead\">' . Tools::h($lastType = $value['_table'] . '-' . $value['type'])\n . '</h3>' . PHP_EOL;\n }\n $output .= '<div class=\"mb-3\"><div><a href=\"?table=' . urlencode(TAB_PREFIX . $value['_table'])\n . '&where[id]=' . (int) $value['id'] . '\" target=\"_blank\">'\n . '<i class=\"fa fa-external-link\"></i></a> ' .\n (Tools::h($value['name_' . DEFAULT_LANGUAGE]) ?: '<i>N/A</i>') . '</div>';\n foreach ($langs as $key => $lang) {\n // TODO should trailing slash be present?\n $value['fill'] = rtrim('/' . Tools::wrap($TYPE2PATH[$lastType], '', '/') .\n /* $value['id'] . '-' . */ Tools::webalize($value[\"name_$lang\"]), '-');\n $output .= '<div class=\"input-group input-group-sm\">'\n . '<div class=\"input-group-prepend\"><tt class=\"input-group-text btn\" title=\"'\n . $this->tableAdmin->translate('Fill up') . '\">' . $lang . '</tt></div>'\n . Tools::htmlInput(\n 'url-' . urlencode($value['_table']) . '-' . $value['id'] . '-' . $lang,\n '',\n $value[\"url_$lang\"],\n array('class' => 'form-control monospace', 'data-fill' => $value['fill'])\n )\n . '</div>' . PHP_EOL;\n }\n $output .= '</div>';\n }\n $output .= '<p><button class=\"btn btn-primary mr-1\" type=\"submit\" name=\"urls-save\"><i class=\"fa fa-save\"></i> '\n . $this->tableAdmin->translate('Save') . '</button>\n <button class=\"btn btn-secondary btn-fill\" type=\"button\"><i class=\"fa fa-edit\"></i> '\n . $this->tableAdmin->translate('Fill up') . '</button>\n ' . Tools::htmlInput(\n '',\n $this->tableAdmin->translate('only empty'),\n '',\n array('type' => 'checkbox', 'id' => 'only-empty', 'label-after' => true, 'label-class' => 'mx-1')\n ) . '\n <button class=\"btn btn-secondary btn-check-up\" type=\"button\"><i class=\"fa fa-eye\"></i> '\n . $this->tableAdmin->translate('Check up') . '</button>\n </p></form>';\n\n // Identify duplicit URLs\n // originally code A (delete this line later)\n $output .= '<hr><h1><i class=\"fa fa-unlink\"></i> ' . $this->tableAdmin->translate('Duplicit URL') . '</h1>'\n . '<p>' . $this->tableAdmin->translate('Duplicities may appear across languages.') . '</p>'\n . '<div id=\"agenda-urls\">';\n $urls = [];\n foreach (\n [\n // Note: not all apps have all those tables\n 'category',\n 'content',\n 'product'\n ] as $table\n ) {\n foreach (array_keys($this->tableAdmin->TRANSLATIONS) as $i) {\n foreach (\n $this->MyCMS->dbms->fetchAll(\"SELECT COUNT(url_$i) AS _count, url_$i AS url\"\n . ' FROM `' . TAB_PREFIX . \"{$table}` GROUP BY url ORDER BY _count DESC\") as $row\n ) {\n // Tools::add($urls[$row['url']], $row['_count']); // next line is more static analysis friendly:\n $urls[$row['url']] = (isset($urls[$row['url']]) ? $urls[$row['url']] : 0) + $row['_count'];\n }\n }\n }\n foreach ($urls as $key => $value) {\n if ($value <= 1) {\n unset($urls[$key]);\n }\n }\n foreach (array_keys($urls) as $url) {\n $sql = [];\n foreach (['category', 'content', 'product'] as $table) {\n $sql [] = \"SELECT '$table' AS type,id,name\" . '_' . $_SESSION['language']\n . ' AS name FROM `' . TAB_PREFIX . \"{$table}` WHERE \" .\n Tools::arrayListed(\n array_keys($this->tableAdmin->TRANSLATIONS),\n 0,\n ' OR ',\n 'url_',\n '=\"' . $this->MyCMS->escapeSQL((string) $url) . '\"'\n );\n }\n $query = $this->MyCMS->fetchAll(implode(\" UNION\\n\", $sql));\n $output .= '<details><summary>' . Tools::h((string) $url) . ' <sup class=\"badge badge-secondary\">'\n . count($query) . '</sup></summary>';\n foreach ($query as $row) {\n $output .= '<div class=\"ml-2\"><a href=\"?table=' . TAB_PREFIX . $row['type'] . '&amp;where[id]='\n . $row['id'] . '\"><i class=\"fa fa-table\"></i> ' . Tools::h((string) $row['name'])\n . ' (' .\n// $this->tableAdmin->translate(\n $row['type']\n// )\n .\n ')</a></div>' . PHP_EOL;\n }\n $output .= '</details>' . PHP_EOL;\n }\n $output .= (count($urls) ? '' : '<i>' . $this->tableAdmin->translate('None') . '</i>')\n . '</div><footer class=\"mt-2\">'\n . (count($urls) ? '<button type=\"button\" class=\"btn btn-sm btn-secondary mr-2\" id=\"urls-toggle\" title=\"'\n . $this->tableAdmin->translate('Open/close')\n . '\" data-open=\"1\"><i class=\"fas fa-caret-right\"></i> <i class=\"fas fa-caret-down\"></i></button>' : '')\n . '</footer>';\n return $output;\n }", "protected function updateBrokenLinks() {}", "function HookResourceconnectAllGenerateurl($url)\n\t{\n\tglobal $baseurl,$baseurl_short,$pagename,$resourceconnect_fullredir_pages;\n\t\n\tif (!in_array($pagename,$resourceconnect_fullredir_pages)) {return $url;} # Only fire for certain pages as needed.\n\t\n\t# Trim off the short base URL if it's been set.\n\tif (substr($url,0,strlen($baseurl_short))==$baseurl_short) {$url=substr($url,strlen($baseurl_short));}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\treturn ($baseurl . \"/\" . $url);\n\t}", "function updatePages() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) FROM \" . TABLE_PREFIX . \"modules WHERE name = 'notebooks'\")) {\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n\n DB::beginWork('Updating pages @ ' . __CLASS__);\n\n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'activity_logs WHERE type = ?', 'NewPageVersionActivityLog'); // We'll rebuild this\n\n $notebook_ids = DB::execute(\"SELECT id FROM $project_objects_table WHERE type = 'Notebook'\");\n\n if($notebook_ids) {\n foreach($notebook_ids as $notebook_id) {\n $this->doUpdatePages($notebook_id, 'Notebook', $notebook_id);\n } // foreach\n } // if\n\n DB::execute('UPDATE ' . TABLE_PREFIX . 'comments SET type = ? WHERE parent_type = ?', 'NotebookPageComment', 'NotebookPage'); // Make sure that comments have proper class\n DB::execute(\"DELETE FROM $project_objects_table WHERE type = 'Page'\"); // Cleanup\n\n DB::commit('Pages updated @ ' . __CLASS__);\n\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'page_versions');\n } // if\n } catch(Exception $e) {\n DB::rollback('Failed to updated pages @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function init() {\r\n\t\tadd_action( 'check_admin_referer', array( self::get_class_name(), 'permalink_changed' ) );\r\n\t\tif ( get_option( 'mainwp_child_clone_permalink' ) || get_option( 'mainwp_child_restore_permalink' ) ) {\r\n\t\t\tadd_action( 'admin_notices', array( MainWP_Clone_Page::get_class_name(), 'permalink_admin_notice' ) );\r\n\t\t}\r\n\t}", "function custom_rewrite_rule(){\n $page_id = $this->page_id;\n $slugs = $this->slugs;\n foreach ($slugs as $key => $value){\n if($value['slug']){\n add_rewrite_rule($key.'/([a-z0-9-]+)[/]?$','index.php?page_id='.$page_id.'&'.$key.'=$matches[1]','top');\n }else{\n add_rewrite_rule($key.'[/]?$','index.php?page_id='.$page_id.'&'.$key.'=$matches[1]','top');\n }\n }\n /// end rewrite\n flush_rewrite_rules();\n }", "public function testPublishRecursiveUrlChange(): void\n {\n SiteTree::config()->set('regenerate_parents', PublishableSiteTree::REGENERATE_RELATIONS_NONE);\n SiteTree::config()->set('regenerate_children', PublishableSiteTree::REGENERATE_RELATIONS_NONE);\n\n /** @var QueuedJobsTestService $service */\n $service = Injector::inst()->get(QueuedJobService::class);\n\n $page = $this->objFromFixture(SiteTree::class, 'page4');\n $page->URLSegment = 'page-4-v2';\n $page->write();\n $page->publishRecursive();\n\n $jobs = $service->getJobs();\n\n // There should be 2 jobs queued, one to clear old caches, and one to generate new caches\n $this->assertCount(2, $jobs);\n\n // Grab our two expected jobs\n /** @var GenerateStaticCacheJob $updateJob */\n $updateJob = $this->getJobByClassName($jobs, GenerateStaticCacheJob::class);\n /** @var DeleteStaticCacheJob $deleteJob */\n $deleteJob = $this->getJobByClassName($jobs, DeleteStaticCacheJob::class);\n\n // Set up our expected URLs\n $expectedUpdateUrls = [\n 'http://example.com/page-1/page-2/page-4-v2',\n 'http://example.com/page-1/page-2/page-4-v2/page-5',\n 'http://example.com/page-1/page-2/page-4-v2/page-5/page-6',\n ];\n $expectedPurgeUrls = [\n 'http://example.com/page-1/page-2/page-4',\n 'http://example.com/page-1/page-2/page-4/page-5',\n 'http://example.com/page-1/page-2/page-4/page-5/page-6',\n ];\n\n $resultUpdateUrls = array_keys($updateJob->getJobData()->jobData->URLsToProcess);\n $resultPurgeUrls = array_keys($deleteJob->getJobData()->jobData->URLsToProcess);\n\n // Test our update job\n $this->assertInstanceOf(GenerateStaticCacheJob::class, $updateJob);\n $this->assertEqualsCanonicalizing($expectedUpdateUrls, $resultUpdateUrls);\n // Test our delete job\n $this->assertInstanceOf(DeleteStaticCacheJob::class, $deleteJob);\n $this->assertEqualsCanonicalizing($expectedPurgeUrls, $resultPurgeUrls);\n }", "public function generateUrl(): void\n {\n $this->load('urls');\n $createRecords = [];\n\n $existingLanguages = $this->urls->keyBy('language');\n\n foreach (config('unique-urls.languages') as $locale => $lang) {\n $uniqueUrl = Url::makeSlug($this->urlStrategy($lang, $locale), $this);\n $newUrl = $this->urlHandler();\n\n $this->handleExistingUrl($existingLanguages, $lang, $uniqueUrl);\n\n if (! $existingLanguages->has($lang)) {\n $newUrl['language'] = $lang;\n $newUrl['slug'] = $uniqueUrl;\n $createRecords[] = $newUrl;\n }\n }\n\n if (count($createRecords)) {\n $this->urls()->createMany($createRecords);\n }\n }", "protected function ___url() {\n\t\treturn $this->pagefiles->url . $this->basename;\n\t}", "function update_home_siteurl($old_value, $value)\n {\n }", "function simple_history_add_update_option_page_permalinks($action, $result) {\n\t\n\tif (\"update-permalink\" == $action) {\n\t\t$option_page_name = __(\"Permalink Settings\");\n\t\t$option_page = \"permalink\";\n\t\tsimple_history_add(\"action=modified&object_type=settings page&object_id=$option_page&object_name=$option_page_name\");\n\t}\n\n}", "public function add_subpages() {\n\n\t\t$this->settings_page_id = add_submenu_page(\n\t\t\t'edit.php?post_type=schedule',\n\t\t\t__( 'Conference Schedule Settings', 'conf-schedule' ),\n\t\t\t__( 'Settings', 'conf-schedule' ),\n\t\t\t'edit_posts',\n\t\t\t'conf-schedule-settings',\n\t\t\t[ $this, 'print_settings_page' ]\n\t\t);\n\n\t\t$this->preview_page_id = add_submenu_page(\n\t\t\t'edit.php?post_type=schedule',\n\t\t\t__( 'Conference Schedule Preview', 'conf-schedule' ),\n\t\t\t__( 'Preview', 'conf-schedule' ),\n\t\t\t'edit_posts',\n\t\t\t'conf-schedule-preview',\n\t\t\t[ $this, 'print_preview_page' ]\n\t\t);\n\n\t\t$this->downloads_page_id = add_submenu_page(\n\t\t\t'edit.php?post_type=schedule',\n\t\t\t__( 'Conference Schedule Downloads', 'conf-schedule' ),\n\t\t\t__( 'Downloads', 'conf-schedule' ),\n\t\t\t'edit_posts',\n\t\t\t'conf-schedule-downloads',\n\t\t\t[ $this, 'print_downloads_page' ]\n\t\t);\n\t}", "public function setPaths()\n\t{\n\t\t$this->componentURL = Request::base() . 'publications/';\n\t\t$this->resourceURL = $this->componentURL . $this->id;\n\n\t\t$database = \\App::get('db');\n\t\t$pub = new \\Components\\Publications\\Tables\\Publication($database);\n\t\t$publication = $pub->getPublication($this->id);\n\t\t$this->resourceSite = \\Components\\Publications\\Helpers\\Html::buildPubPath($this->id, $publication->version_id, '', $publication->secret, 1);\n\t}", "function drush_ti_amg_fw_topics_urls() {\n $batch = array();\n $batch_nodes = array();\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')->entityCondition('bundle', array('topic_page_child'), 'IN');\n $result = $query->execute();\n\n if ($result['node']) {\n $batch_nodes = array_keys($result['node']);\n }\n\n foreach ($batch_nodes as $nid) {\n $batch['operations'][] = array(\n '_ti_amg_fw_topics_do_drush_fix_urls',\n array(\n $nid,\n ),\n );\n }\n\n $batch['finished'] = '_ti_amg_fw_topics_do_drush_fix_urls_finished';\n batch_set($batch);\n drush_backend_batch_process();\n}", "public function createPageAndCopyLiveParentPage() {}", "function SetupMultiPages() {\r\n\t\t$pages = new cSubPages();\r\n\t\t$pages->Add(0);\r\n\t\t$pages->Add(1);\r\n\t\t$pages->Add(2);\r\n\t\t$pages->Add(3);\r\n\t\t$pages->Add(4);\r\n\t\t$pages->Add(5);\r\n\t\t$pages->Add(6);\r\n\t\t$this->MultiPages = $pages;\r\n\t}", "public function page_uri_index()\n {\n }", "private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}", "function myAccountNewEndpoints()\n{\n add_rewrite_endpoint(SUBS_ENDPOINT, EP_ROOT | EP_PAGES);\n}", "private function migrateAdditionalPages() {\n\t\tif ( empty( $this->oldOptions['modules']['aiosp_sitemap_options']['aiosp_sitemap_addl_pages'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$pages = [];\n\t\tforeach ( $this->oldOptions['modules']['aiosp_sitemap_options']['aiosp_sitemap_addl_pages'] as $url => $values ) {\n\t\t\t$page = new \\stdClass();\n\t\t\t$page->url = esc_url( wp_strip_all_tags( $url ) );\n\t\t\t$page->priority = [ 'label' => $values['prio'], 'value' => $values['prio'] ];\n\t\t\t$page->frequency = [ 'label' => $values['freq'], 'value' => $values['freq'] ];\n\t\t\t$page->lastModified = gmdate( 'm/d/Y', strtotime( $values['mod'] ) );\n\n\t\t\t$pages[] = wp_json_encode( $page );\n\t\t}\n\n\t\taioseo()->options->sitemap->general->additionalPages->enable = true;\n\t\taioseo()->options->sitemap->general->additionalPages->pages = $pages;\n\t}", "public function onAfterDelete() {\n\n\t\tparent::onAfterDelete();\n\n\t\t// Determine whether this page has been completely removed.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default') && !$this->owner->isPublished() && !$this->owner->isOnDraft()) {\n\n\t\t\t// Convert any link mappings that are directly associated with this page.\n\n\t\t\t$mappings = LinkMapping::get()->filter(array(\n\t\t\t\t'RedirectType' => 'Page',\n\t\t\t\t'RedirectPageID' => $this->owner->ID\n\t\t\t));\n\t\t\tforeach($mappings as $mapping) {\n\t\t\t\t$mapping->RedirectType = 'Link';\n\t\t\t\t$mapping->RedirectLink = Director::makeRelative(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link());\n\t\t\t\t$mapping->write();\n\t\t\t}\n\t\t}\n\t}", "public function crawl()\n\t{\n \t// truncate any non-existant pages\n\t\t$this->resetIndex();\n\n\t\t// create a temporary table for incrementing counts\n\t\t$this->createTempTable();\n\n\t\t// add initial URL to crawl list\n\t\t$this->addRequest($this->startUrl);\n\n\t\t// begin crawling the url\n\t\t$this->crawlUrls();\n\n\t\t// update url counts and remove the temp table\n\t\t$this->finalizeUrlCounts();\n\t}", "protected function initCurrentUrl() {}", "protected function initCurrentUrl() {}", "function findPageUrls();", "public function using_mod_rewrite_permalinks()\n {\n }", "function add_admin_pages () {\n define( \"CLRANGER_PATHS\", ['clarity-ranger'] );\n add_menu_page( 'Marc Moeller Clarity Ranger', 'Clarity Ranger', 'manage_options', 'clarity-ranger', array($this, 'clranger_internal_links_page') , CLARITY_URL . '/images/icon2.png' , 6 );\n\t\t\n\t\tadd_submenu_page( 'clarity-ranger', 'Reverse Silo', 'Reverse Silo','manage_options', 'clarity-reverse-silo' ,array($this, 'clranger_reverse_silo_page') );\n }", "function updateSubpagesContent() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='notebooks'\")) {\n try {\n $notebook_pages_table = TABLE_PREFIX . 'notebook_pages';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating subpages @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, body FROM $notebook_pages_table WHERE parent_type = 'NotebookPage' AND body != '' AND body IS NOT NULL\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('NotebookPage', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $notebook_pages_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('Subpages updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update subpages @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function reorderChildren()\n {\n $sql = \"select ID_PAGE from \" . $this->mode . \"PAGE where PAG_IDPERE=\" . $this->getID() . \" order by PAG_POIDS\";\n $stmt = $this->dbh->prepare(\"update \" . $this->mode . \"PAGE set PAG_POIDS=:PAG_POIDS where ID_PAGE=:ID_PAGE\");\n $PAG_POIDS = 1;\n $stmt->bindParam(':PAG_POIDS', $PAG_POIDS, PDO::PARAM_INT);\n foreach ($this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN) as $ID_PAGE) {\n $stmt->bindValue(':ID_PAGE', $ID_PAGE, PDO::PARAM_INT);\n $stmt->execute();\n $PAG_POIDS ++;\n }\n }", "function custom_page_permalink() {\r\n global $wp_rewrite;\r\n\r\n if ( get_option('permalink_structure') != '' && !strpos($wp_rewrite->get_page_permastruct(), '.' . $this->options->extension) ) {\r\n $wp_rewrite->page_structure = $wp_rewrite->page_structure . '.' . $this->options->extension;\r\n }\r\n }", "public function set_core_pages()\n {\n if ($this->is_installed())\n {\n $qry = ee()->db->select('site_pages')\n ->where('site_id', ee()->publisher_lib->site_id)\n ->get('sites');\n\n $this->core_site_pages = unserialize(base64_decode($qry->row('site_pages')));\n }\n }", "public function setFrontEndPages() {\n // Get badge page retrieved from the plugin setting\n $getBadgePage = get_post(\n SettingsTemp::getOption(SettingsTemp::FI_GET_BADGE)\n );\n\n if ($getBadgePage) {\n $args = array(\n // # GET BADGE PAGE\n array(\n 'slug' => $getBadgePage->post_name,\n 'class' => GetBadgeTemp::class,\n ),\n );\n $this->settings->loadFrontEndPages($args);\n }\n }", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'Open Badge',\n 'menu_title' => 'Open Badge',\n 'capability' => 'manage_options',\n 'menu_slug' => self::SLUG_PLUGIN,\n 'callback' => array(DashboardTemp::class, 'main'),\n 'icon_url' => 'dashicons-awards',\n 'position' => '110'\n )\n );\n }", "function page_url($slash = TRUE)\n{\n\t$CI =& get_instance();\n\t$CI->load->library('fs_navigation');\n\t\n\tif($slash == TRUE)\n\t{\n\t\treturn $CI->config->slash_item('base_url').variable($CI->config->unslash_item('url_parts')).$CI->fs_navigation->current('path').'/';\n\t}\n\telse\n\t{\n\t\treturn $CI->config->slash_item('base_url').variable($CI->config->unslash_item('url_parts')).$CI->fs_navigation->current('path');\n\t}\n}", "function theme_parent_url($url) {\n return create_url(CAsdf::Instance()->themeParentUrl . \"/{$url}\");\n}", "function create_pages() {\r\n\r\n $wpc_pages = $this->pre_set_pages();\r\n\r\n $wpc_client_page = get_page_by_title( 'Portal' );\r\n\r\n if ( !isset( $wpc_client_page ) || 0 >= $wpc_client_page->ID ) {\r\n\r\n $current_user = wp_get_current_user();\r\n //Construct args for the new page\r\n $args = array(\r\n 'post_title' => 'Portal',\r\n 'post_status' => 'publish',\r\n 'post_author' => $current_user->ID,\r\n 'post_content' => '[wpc_redirect_on_login_hub]',\r\n 'post_type' => 'page',\r\n 'ping_status' => 'closed',\r\n 'comment_status' => 'closed'\r\n );\r\n $parent_page_id = wp_insert_post( $args );\r\n }\r\n\r\n $settings = get_option( 'wpc_settings' );\r\n\r\n foreach( $wpc_pages as $wpc_page ) {\r\n\r\n $wpc_client_page = get_page_by_title( $wpc_page['name'] );\r\n\r\n if ( !isset( $wpc_client_page ) || 0 >= $wpc_client_page->ID ) {\r\n\r\n $current_user = wp_get_current_user();\r\n //Construct args for the new page\r\n $args = array(\r\n 'post_title' => $wpc_page['name'],\r\n 'post_status' => 'publish',\r\n 'post_author' => $current_user->ID,\r\n 'post_content' => $wpc_page['content'],\r\n 'post_type' => 'page',\r\n 'ping_status' => 'closed',\r\n 'comment_status' => 'closed',\r\n 'post_parent' => $parent_page_id,\r\n );\r\n $page_id = wp_insert_post( $args );\r\n\r\n $settings['pages'][$wpc_page['id']] = $page_id;\r\n }\r\n\r\n\r\n }\r\n\r\n update_option( 'wpc_settings', $settings );\r\n\r\n }", "function _wp_auto_add_pages_to_menu($new_status, $old_status, $post)\n {\n }", "function load_site_pages()\n\t{\n $sites\t\t\t= ee()->TMPL->fetch_param('site', '');\n\t\t$current_site\t= ee()->config->item('site_short_name');\n\n\t\t// Always include the current site\n\n\t\t$site_names = explode('|', $sites);\n\n\t\tif ( ! in_array($current_site, $site_names))\n\t\t{\n\t\t\t$site_names[] = $current_site;\n\t\t}\n\n\t\t// Fetch all pages\n\t\t$sites = ee('Model')->get('Site')\n\t\t\t->fields('site_id', 'site_name', 'site_pages')\n\t\t\t->filter('site_name', $site_names)\n\t\t\t->all();\n\n\t\t$new_pages = array();\n\n\t\tforeach($sites as $site)\n\t\t{\n\t\t\tif (is_array($site->site_pages))\n\t\t\t{\n\t\t\t\t$new_pages += $site->site_pages;\n\t\t\t}\n\t\t}\n\n\t\t// Update config\n\n\t\tee()->config->set_item('site_pages', $new_pages);\n\n\t\treturn '';\n\t}", "public function update_page(Page $p, ModelClass $object, $parentselector = '') {\n\n }", "public function rewriteURL(): void\n {\n global $wp_rewrite;\n $customEndpoint = $this->customEndpoint();\n $newRules = [\n $customEndpoint . '/?$' => 'index.php?' . self::CUSTOMPAGEVAR . '=' . $customEndpoint,\n ];\n $wp_rewrite->rules = $newRules + (array) $wp_rewrite->rules;\n }", "private function fixWebPath(){\n\t\t$webPathMembers = explode('/', SpanArt::$WEB_PATH);\n\t\t$this->webPathNumber = count($webPathMembers);\n\t}", "public function delete_page_links() {\n\t\t\t$this->linked_postid = '';\n\t\t\t$this->pages_url = '';\n\t\t\t$this->MakePersistent();\n\n\t\t}", "public function set_children($children)\n {\n $childData = [];\n foreach ($children as $child) {\n $childData[] = new Page($child);\n }\n $this->data['children'] = $childData;\n }", "protected function addLinks()\n {\n }", "public abstract function get_url_list($page_num, $object_subtype = '');", "public function change_details_url() {\n\t\t\tglobal $change_details_plugin_url_script, $pagenow;\n\t\t\t$plugins = get_plugin_updates();\n\t\t\tif ( ! $change_details_plugin_url_script && in_array( $pagenow, array( 'update-core.php', 'plugins.php' ) ) && ! empty( $plugins ) ) {\n\t\t\t\t$plugins_string = '';\n\t\t\t\tforeach ( $plugins as $plugin_key => $plugin_value ) {\n\t\t\t\t\t$plugin_key = strtolower( $plugin_key );\n\t\t\t\t\tif ( strpos( $plugin_key, 'cherry' ) !== false ) {\n\t\t\t\t\t\t$plugins_string .= '\"' . $plugin_value ->update ->slug . '\" : \"' . $plugin_value ->update ->url .'\", ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<script>\n\t\t\t\t\t( function( $ ){\n\t\t\t\t\t\tvar plugin_updates = {<?php echo $plugins_string; ?>};\n\t\t\t\t\t\tfor ( var plugin in plugin_updates ) {\n\t\t\t\t\t\t\t$('[href*=\"' + plugin + '\"].thickbox').removeClass('thickbox').attr( {'href': plugin_updates[plugin], 'target' : \"_blank\" } );\n\t\t\t\t\t\t};\n\t\t\t\t\t}( jQuery ) )\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t$change_details_plugin_url_script = true;\n\t\t}", "public function loadProcess() {\n\t\t// register page view\n\t\t$this->pixelPageView();\n\t\t\n\t\t// load next URL string\n\t\t$nextPosition = $this->position + 1;\n\t\t$lastPosition = array_pop(array_keys($this->pathOrderArr));\n\t\t\n\t\tfor ($i = $nextPosition; $i <= $lastPosition + 1; $i++) {\n\t\t\tif (array_key_exists($i, $this->pathOrderArr)) {\n\t\t\t\t$nextPosition = $i;\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t// generate next page's URL\n\t\tif ($nextPosition > $lastPosition)\n\t\t\t$this->nextUrl = 'javascript: parent.location.href=\\''. $this->redirectURL .'\\''; // end of path, redirect to affiliate's URL\n\t\telse \n\t\t\t$this->nextUrl = $this->getNextUrl($nextPosition);\n\t\t\n\t\t$this->loadView();\n\t}", "public function updatePages()\n {\n $input = Input::all();\n $pages = Page::all();\n foreach ($pages as $page) {\n $page->description = $input[$page->title];\n $page->save();\n }\n\n return Redirect::to('admin/pages')->with(array('message' => Lang::get('words.pages-updated'), 'status' => 'showSuccessToast'));\n }", "public function router()\n\t{\n\t\t$this->getDomainName();\n\t\t$current_page = $this->getCurentPage();\t\n\t\tif($current_page){\n\t\t\t$this->getContent($current_page);\n\t\t}\n\t\t$this->initPageController($current_page);\n\t}", "public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }", "public function run()\n {\n foreach(DB::table('content_kinds')->get() as $d){\n \tDB::table('content_kinds')->where('id', $d->id)->update([\n \t\t'url' => str_slug($d->name)\n \t]);\n }\n }", "public function crawl(){\n\t\t\t$this->collectUrls();\n\t\t}", "private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}", "function cu_rewrite_add_rewrites() {\n\tadd_rewrite_tag( '%cpage%', '[^/]' );\n\tadd_rewrite_rule(\n\t\t'^users/?$',\n\t\t'index.php?cpage=custom_page_url',\n\t\t'top'\n\t);\n}", "function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}", "public function addUrl() {\r\n\t\t$current = $this->params['url']['url'];\r\n\t\t$accept = array('show', 'admin_show', 'admin_index');\r\n\t\tif(in_array($this->action, $accept)) {\r\n\t\t\tif ($this->Session->read('history.current') != $current){\r\n\t\t\t\t//$this->Session->write('history.previous', $this->Session->read('history.current'))->write('history.current', $current);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function onAdminMenu()\n {\n foreach( $this->pages as $slug => $page ) {\n add_submenu_page(\n $page['parent'], L10n::__( $page['title'] ), \n L10n::__( $page['title_menu'] ), $page['capability'], \n $slug, array( $this, 'page' . ucfirst( $slug ) )\n );\n }\n }", "private function updatePaths()\n\t{\n\t\t$hash = $this->e107->makeSiteHash($this->previous_steps['mysql']['db'],$this->previous_steps['mysql']['prefix']);\n\t\t$this->e107->site_path = $hash;\t\n\t\t\n\t\t$this->previous_steps['paths']['hash'] = $hash;\n\n\t\t$omit = array('FILES_DIRECTORY','WEB_IMAGES_DIRECTORY');\n\t\t\n\t\tforeach($this->e107->e107_dirs as $dir => $p)\n\t\t{\n\t\t\tif(in_array($dir, $omit)) { continue; }\t\n\t\t\t\n\t\t\t$this->e107->e107_dirs[$dir] = str_replace(\"[hash]\", $hash, $this->e107->e107_dirs[$dir]);\n\t\t\t\t\t\n\t\t\tif(!is_dir($this->e107->e107_dirs[$dir]))\n\t\t\t{\n\t\t\t\t@mkdir($this->e107->e107_dirs[$dir]);\t\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t}", "function page_path_to_page_link($page)\n{\n require_code('urls2');\n return _page_path_to_page_link($page);\n}", "function sfgov_utilities_deploy_12_dept_go_to_url() {\n try {\n $deptNodes = Utility::getNodes('department');\n foreach($deptNodes as $dept) {\n $currentSite = $dept->field_url->uri;\n $goToSite = $dept->field_go_to_current_url->value;\n echo $dept->getTitle() . \" (\" . $dept->id() . \") \\n\" . \n \"\\tcurrent site url: $currentSite\\n\" .\n \"\\tgo to site: $goToSite\" .\n \"\\n\";\n \n if ($goToSite == true) {\n $dept->set('field_direct_external_url', [\n 'uri' => $currentSite\n ]);\n $dept->save();\n echo \"saved \" . $dept->getTitle() . \" <---\\n\";\n }\n }\n } catch(\\Exception $e) {\n error_log($e->getMessage(), \"\\n\");\n }\n}", "abstract public function get_url_list( $page_num, $object_subtype = '' );", "function put_my_url(){\n\treturn (get_home_url());\n}", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'PM Plugin',\n 'menu_title' => 'PM',\n 'capability' => 'manage_options',\n 'menu_slug' => 'pm_plugin',\n 'callback' => array($this->callbacks, 'adminDashboard'),\n 'icon_url' => 'dashicons-store',\n 'position' => 110,\n ),\n );\n\n }", "public function url() {\n\n if(isset($this->cache['url'])) return $this->cache['url'];\n\n // Kirby is trying to remove the home folder name from the url\n if($this->isHomePage()) {\n // return the base url\n return $this->cache['url'] = $this->site->url();\n } else if($this->parent->isHomePage()) {\n return $this->cache['url'] = $this->site->url() . '/' . $this->parent->uid . '/' . $this->uid;\n } else {\n $purl = $this->parent->url();\n return $this->cache['url'] = $purl == '/' ? '/' . $this->uid : $this->parent->url() . '/' . $this->uid;\n }\n\n }", "function updateSubpageVersions() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='notebooks'\")) {\n try {\n $pages_table = TABLE_PREFIX . 'notebook_pages';\n $page_versions_table = TABLE_PREFIX . 'notebook_page_versions';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating subpage versions @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT $page_versions_table.id, $page_versions_table.body FROM $pages_table, $page_versions_table WHERE $pages_table.id = $page_versions_table.notebook_page_id AND $pages_table.parent_type = 'NotebookPage'\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('NotebookPageVersion', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $page_versions_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('Subpage versions updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update subpage versions @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function gridSetPagesUrlNext($url = ''){\n if(!empty($url)){\n $this->setVar('PAGES_URL_NEXT', $url);\n $this->setVar('NEXT_PAGE_TAG', __('Next page'));\n }\n }", "protected function applyUrl()\n\t{\n\t\t// CSS\n\t\t$nodes = $this->dom->getElementsByTagName('link');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('href');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('href', $url);\n\t\t\t}\n\t\t}\n\t\t// JS\n\t\t$nodes = $this->dom->getElementsByTagName('script');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('src');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('src', $url);\n\t\t\t}\n\t\t}\n\t\t// Image\n\t\t$nodes = $this->dom->getElementsByTagName('img');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('src');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('src', $url);\n\t\t\t}\n\t\t}\n\t\t// Anchor\n\t\t$nodes = $this->dom->getElementsByTagName('a');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('href');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->base_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('href', $url);\n\t\t\t}\n\t\t}\n\t}", "function urlSeoGen($lang) {\n\t\t$sql = $this->sql(\"SELECT * FROM page_url WHERE page_id = \".$this.\" AND lang = \".D()->quote($lang));\n\t\t$row = D()->row($sql);\n\t\t$url = $row && $row['custom'] ? $row['url'] : $this->urlSeoGenerated($lang);\n\t\t$this->urlSet($lang, ['url'=>$url]);\n\t\tforeach ($this->Children(['type'=>'*']) as $C) {\n\t\t\t$C->urlSeoGen($lang);\n\t\t}\n\t\treturn $url;\n\t}", "public function getUrl()\n {\n // looping through parents to create ancestors array..\n\n $parentPages = [];\n $current = $this;\n while ($current->parent)\n {\n $parentPages[] = $current->parent;\n $current = $current->parent;\n }\n\n $parentPages = array_reverse($parentPages);\n\n $paths = [];\n\n foreach ($parentPages as $pp) {\n if ($pp->path != 'ROOT') {\n $paths[] = $pp->path;\n }\n }\n\n if (count($paths) > 0) {\n $root = implode('/', $paths);\n return '/' . $root . '/' . $this->path;\n } else {\n if ($this->path == 'ROOT') {\n return '/';\n }\n return '/' . $this->path;\n }\n }", "function dsq_add_pages() {\n \tadd_submenu_page(\n \t\t'edit-comments.php',\n \t\t'Disqus', \n \t\t'Disqus', \n \t\t'moderate_comments',\n \t\t'disqus',\n \t\t'dsq_manage'\n \t);\n}", "public function add_endpoints() {\n\t\tadd_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );\n\t\t//flush_rewrite_rules();\n\t}", "public function onAfterWrite() {\n if (!$this->URLPath) {\n $this->URLPath = Utils::generateURLPath($this->Title, $this->ID);\n $this->write();\n }\n\n parent::onAfterWrite();\n }", "private function childPages($list,$id,$space = '-'){\n\t\t$db = Zend_Registry::get('db');\n\t\t$select = $db->select()\n\t\t\t\t\t->from('pages')\n\t\t\t\t\t->where('parent_id = ?',$id)\n\t\t\t\t\t->order('pgsort DESC')\n\t\t\t\t\t->order('title ASC');\n\t\t$results = $db->fetchAll($select);\n\t\tforeach($results as $cur){\n\t\t\t$list[$cur[id]] = $space.$cur[title];\n\t\t\t$list = $this->childPages($list,$cur[id],$space.'-');\n\t\t}\n\treturn $list;\n\t}", "function iis7_save_url_rewrite_rules()\n {\n }", "public function gridSetPagesUrlLast($url = ''){\n if(!empty($url)){\n $this->setVar('PAGES_URL_LAST', $url);\n $this->setVar('LAST_PAGE_TAG', __('Last page'));\n }\n }" ]
[ "0.63975614", "0.63432276", "0.619601", "0.6061517", "0.6007782", "0.5872733", "0.5858648", "0.582612", "0.5810113", "0.577018", "0.5760534", "0.570477", "0.56791854", "0.56671816", "0.56643504", "0.5658041", "0.5611799", "0.55655754", "0.55655", "0.55655", "0.5555176", "0.5547986", "0.55218416", "0.55207646", "0.5510207", "0.5503906", "0.54723203", "0.5450958", "0.5450231", "0.5442667", "0.5435493", "0.54208386", "0.5417455", "0.5415768", "0.5410282", "0.54072684", "0.53953207", "0.5370103", "0.5367673", "0.5354268", "0.5354221", "0.5353258", "0.5345334", "0.5320404", "0.52976143", "0.5297159", "0.5293764", "0.5290542", "0.5290542", "0.52875483", "0.52841717", "0.5281963", "0.5267381", "0.5266598", "0.52569675", "0.5244249", "0.52359575", "0.523387", "0.522956", "0.52216786", "0.522149", "0.5212913", "0.5208688", "0.5200804", "0.51985914", "0.5195624", "0.5190786", "0.5188128", "0.5183779", "0.51763684", "0.5175689", "0.5174257", "0.51678973", "0.5166503", "0.5164803", "0.515823", "0.51543283", "0.51492965", "0.5145573", "0.5136819", "0.51334924", "0.51228356", "0.51222503", "0.5119979", "0.5118247", "0.51172334", "0.51166964", "0.5114371", "0.51128983", "0.51061434", "0.5105311", "0.51049227", "0.5101802", "0.510137", "0.5100248", "0.50993204", "0.5098832", "0.5088895", "0.5087305", "0.50852" ]
0.73686093
0
Mark a page(s) as a draft
function draft($ids) { if (!is_array($ids)) { $ids = array(intval($ids)); } $ids = join(', ', $ids); $this->query("UPDATE {$this->useTable} SET draft = 1 WHERE id IN ($ids)"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAsDraft();", "public function isDraft();", "public function isDraft();", "public function isDraft();", "public function moveContentAndCopyDraftPage() {}", "public function createContentAndCopyDraftPage() {}", "public function draft_publish()\n\t{\n\t\t$where = array(\n\t\t\t'parent_entry_id' => $this->settings['entry_id'],\n\t\t\t'parent_is_draft' => 0\n\t\t);\n\t\t$this->EE->db->where($where)->delete('playa_relationships');\n\n\t\t$where['parent_is_draft'] = 1;\n\t\t$update = array('parent_is_draft' => 0);\n\t\t$this->EE->db->where($where)->update('playa_relationships', $update);\n\n\t\treturn;\n\t}", "function conv_drafts($doc) {\n\t\t\t$ids = $doc->getChildrenDocumentIds();\n\t\t\tforeach ($ids as $cid) {\n\t\t\t\t$chdoc = new Document($cid);\n\t\t\t\t$chdoc->isdraft = 1;\n\t\t\t\t$chdoc->attachId = \"\";\n\t\t\t\t$chdoc->type = \"page\";\n\t\t\t\t$chdoc->save();\n\t\t\t\t// recurse\n\t\t\t\tconv_drafts($chdoc);\n\t\t\t}\n\t\t}", "protected function set_draft_bulk_actions() {\n\t\t\t\n\t\t\t$post_id = '';\n\t\t\tif ( ! empty( $_GET['post_id'] ) ) {\n\t\t\t\t$post_id = (int) sanitize_text_field($_GET['post_id']);\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<h1>WPGlobus :: <?php esc_html_e( 'Set Draft', 'wpglobus-plus' ); ?></h1>\n\t\t\t\t<hr />\n\t\t\t\t<?php\n\t\t\t\t$params = array();\n\t\t\t\tif ( ! empty($post_id) && $post_id > 0 ) {\n\t\t\t\t\t$this->process_by_post_id($post_id, $_GET['lang']);\n\t\t\t\t\t$params['post_id'] = $post_id;\n\t\t\t\t}\n\t\t\t\t$this->back_button('bulk-actions', $params);\n\t\t\t\t?>\n\t\t\t</div><!-- .wrap -->\t<?php\n\t\t}", "public function changeContentSortingAndCopyDraftPage() {}", "public function set_draft_single_action() {\n\t\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<h1>WPGlobus :: <?php esc_html_e( 'Set Draft', 'wpglobus-plus' ); ?></h1>\n\t\t\t\t<hr />\n\t\t\t\t<?php\n\n\t\t\t\t$ok_to_process = true;\n\n\t\t\t\t// Check for required parameters.\n\t\t\t\tif ( empty( $_GET['lang'] ) || empty( $_GET['post_type'] ) ) {\n\t\t\t\t\tesc_html_e( 'URL format', 'wpglobus-plus' );\n\t\t\t\t\techo \": &lang=...&post_type=...\";\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\t// Check if language is one of the enabled\n\t\t\t\t$language = $_GET['lang'];\n\t\t\t\tif ( ! WPGlobus_Utils::is_enabled( $language ) ) {\n\t\t\t\t\techo '<p>';\n\t\t\t\t\tesc_html_e( 'Unknown language', 'wpglobus-plus' );\n\t\t\t\t\techo ': ' . esc_html( $language );\n\t\t\t\t\techo '</p>';\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\t$post_type = $_GET['post_type'];\n\n\t\t\t\t/**\n\t\t\t\t * Filter the array of disabled entities on page of module Publish.\n\t\t\t\t *\n\t\t\t\t * @since 1.1.22\n\t\t\t\t * @scope admin\n\t\t\t\t *\n\t\t\t\t * @param array WPGlobus::Config()->disabled_entities Array of disabled entities.\n\t\t\t\t */\n\t\t\t\t$disabled_entities = apply_filters( 'wpglobus_plus_publish_bulk_disabled_entities', WPGlobus::Config()->disabled_entities );\n\n\t\t\t\tif ( in_array( $post_type, $disabled_entities, true ) ) {\n\t\t\t\t\techo '<p>';\n\t\t\t\t\tesc_html_e( 'Disabled post type', 'wpglobus-plus' );\n\t\t\t\t\techo ': <strong>' . esc_html( $post_type ) . '</strong>';\n\t\t\t\t\techo '</p>';\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\tif ( $ok_to_process ) {\n\n\t\t\t\t\techo '<h2>';\n\t\t\t\t\techo esc_html( sprintf(\n\t\t\t\t\t\t__( 'Setting as \"draft\" all records with post type \"%1$s\" for language \"%2$s\"',\n\t\t\t\t\t\t\t'wpglobus-plus' ),\n\t\t\t\t\t\t$post_type, $language\n\t\t\t\t\t) );\n\t\t\t\t\techo '</h2>';\n\t\t\t\t\techo '<hr/>';\n\n\t\t\t\t\t// Get all posts with the specified type\n\t\t\t\t\t$posts = get_posts( array(\n\t\t\t\t\t\t'numberposts' => - 1,\n\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t'orderby' => 'ID',\n\t\t\t\t\t\t'order' => 'ASC'\n\t\t\t\t\t) );\n\n\t\t\t\t\t// Loop through the posts\n\t\t\t\t\tforeach ( $posts as $post ) {\n\n\t\t\t\t\t\t$order = array(\n\t\t\t\t\t\t\t'action' \t=> 'set_status',\n\t\t\t\t\t\t\t'post_id' \t=> $post->ID,\n\t\t\t\t\t\t\t'language'\t=> $language,\n\t\t\t\t\t\t\t'status'\t=> 'draft'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$result = $this->set_status( $order );\n\n\t\t\t\t\t\t// Print the post title and link to edit\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\">%s</a> : %s : ',\n\t\t\t\t\t\t\tadmin_url( '/post.php?post=' . $post->ID . '&action=edit' ),\n\t\t\t\t\t\t\t$post->ID,\n\t\t\t\t\t\t\tesc_html( apply_filters( 'the_title', $post->post_title ) )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\techo $result[ 'message' ];\n\n\t\t\t\t\t\techo '<br/>';\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( count( $posts ) === 0 ) {\n\t\t\t\t\t\tesc_html_e( 'No records found.', 'wpglobus-plus' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<br/>';\n\t\t\t\t\t\tesc_html_e( 'Done.', 'wpglobus-plus' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->back_button('single-action');\n\t\t\t\t?>\n\t\t\t</div><!-- .wrap -->\t\n\t\t\t<?php\n\t\t}", "public function drafts()\n {\n if (is_a($this->drafts, 'Kirby\\Cms\\Pages') === true) {\n return $this->drafts;\n }\n\n $kirby = $this->kirby();\n\n // create the inventory for all drafts\n $inventory = Dir::inventory(\n $this->root() . '/_drafts',\n $kirby->contentExtension(),\n $kirby->contentIgnore(),\n $kirby->multilang()\n );\n\n return $this->drafts = Pages::factory($inventory['children'], $this, true);\n }", "public function deleteContentAndCopyDraftPage() {}", "public function draftPage()\n\t{\n\t\treturn $this->hasOne(Page::class, 'revision_id')->where('version', Page::STATE_DRAFT);\n\t}", "public function isDraft()\n {\n return $this->publish_status == Status::DRAFT;\n }", "public function setStatus ($value) {\n\t\t$vals = array(\"Published\", \"Draft\");\n\t\tif (in_array($value, $vals)) {\n\t\t\t$this->setData(\"pageStatus\", $value);\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->setMessage(LANG_INVALID.\" \".LANG_STATUS);\n\t\t\treturn false;\n\t\t}\n\t}", "public function draftsCreate($page_id) {\n\t\t// Build the MindTouch API URL to create or update a page's content.\n\t\t$url = $this->draftsUrl($page_id) . \"/create\";\n\n\t\t// Get output from API.\n\t\t$output = $this->post($url, '');\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function setDraft(bool $draft) : self\n {\n $this->initialized['draft'] = true;\n $this->draft = $draft;\n return $this;\n }", "public function isDraft() {\n return $this->state === self::STATUS_DRAFT;\n }", "public function createPageAndCopyDraftParentPage() {}", "public function draftsPublish($page_id) {\n\t\t// Build the MindTouch API URL to publish a draft.\n\t\t$url = $this->draftsUrl($page_id) . \"/publish\";\n\n\t\t// Get output from API.\n\t\t$output = $this->post($url, '');\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function isDraft() {\r\n return $this->isDraft;\r\n }", "public function draftsActivate($page_id) {\n\t\t// Build the MindTouch API URL to activate a draft.\n\t\t$url = $this->draftsUrl($page_id) . \"/activate\";\n\n\t\t// Get output from API.\n\t\t$output = $this->post($url, '');\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "private function set_files_by_draft()\n\t\t{\n\t\t\t$this->files = Filesystem::ls(PATH_POSTS, '*.*.*.*.draft.*.*.*.*.*.*', 'xml', false, false, true);\n\t\t\t$this->files_count = count( $this->files );\n\t\t}", "function _wp_block_editor_posts_page_notice()\n {\n }", "protected function savedraft()\n {\n global $INFO, $ID, $INPUT, $conf;\n\n if (class_exists('\\\\dokuwiki\\\\Draft', false)) {\n /* Release Hogfather (and above) */\n\n $draft = new \\dokuwiki\\Draft($ID, $INFO['client']);\n if (!$draft->saveDraft()) {\n $errors = $draft->getErrors();\n foreach ($errors as $error) {\n msg(hsc($error), -1);\n }\n }\n\n } else {\n /* Release Greebo and below */\n\n if (!$conf['usedraft']) return;\n if (!$INPUT->post->has('wikitext')) return;\n\n // ensure environment (safeguard when used via AJAX)\n assert(isset($INFO['client']), 'INFO.client should have been set');\n assert(isset($ID), 'ID should have been set');\n\n $draft = array(\n 'id' => $ID,\n 'prefix' => substr($INPUT->post->str('prefix'), 0, -1),\n 'text' => $INPUT->post->str('wikitext'),\n 'suffix' => $INPUT->post->str('suffix'),\n 'date' => $INPUT->post->int('date'),\n 'client' => $INFO['client'],\n );\n $cname = getCacheName($draft['client'] . $ID, '.draft');\n if (io_saveFile($cname, serialize($draft))) {\n $INFO['draft'] = $cname;\n }\n }\n }", "public function isDraft()\n {\n return ($this->getData('draft')) ? true : false;\n }", "public function ajax_insert_auto_draft_post()\n {\n }", "public function make_auto_draft_status_previewable()\n {\n }", "public function isDraft()\n {\n return $this->isInStatus($this::DRAFT);\n }", "public function actionSaveDraft()\n\t{\n\t\t$this->requirePostRequest();\n\n\t\t$draftId = blx()->request->getPost('draftId');\n\n\t\tif ($draftId)\n\t\t{\n\t\t\t$draft = blx()->entryRevisions->getDraftById($draftId);\n\n\t\t\tif (!$draft)\n\t\t\t{\n\t\t\t\tthrow new Exception(Blocks::t('No draft exists with the ID “{id}”', array('id' => $draftId)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$draft = new EntryDraftModel();\n\t\t\t$draft->id = blx()->request->getRequiredPost('entryId');\n\t\t\t$draft->sectionId = blx()->request->getRequiredPost('sectionId');\n\t\t\t$draft->creatorId = blx()->userSession->getUser()->id;\n\n\t\t\t$draft->language = blx()->language;\n\t\t}\n\n\t\t$this->_setDraftValuesFromPost($draft);\n\n\t\tif (blx()->entryRevisions->saveDraft($draft))\n\t\t{\n\t\t\tblx()->userSession->setNotice(Blocks::t('Draft saved.'));\n\n\t\t\t$this->redirectToPostedUrl(array(\n\t\t\t\t'entryId' => $draft->id,\n\t\t\t\t'draftId' => $draft->draftId\n\t\t\t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tblx()->userSession->setError(Blocks::t('Couldn’t save draft.'));\n\n\t\t\t$this->renderRequestedTemplate(array(\n\t\t\t\t'entry' => $draft\n\t\t\t));\n\t\t}\n\t}", "function wp_dashboard_recent_drafts($drafts = \\false)\n {\n }", "public static function get_draft_pages() {\n\t\t$pages = wp_cache_get( 'snow-monkey-category-content-draft-pages' );\n\t\tif ( is_array( $pages ) ) {\n\t\t\treturn $pages;\n\t\t}\n\n\t\t$pages = get_pages(\n\t\t\t[\n\t\t\t\t'parent' => 0,\n\t\t\t\t'post_status' => 'draft',\n\t\t\t]\n\t\t);\n\n\t\twp_cache_set( 'snow-monkey-category-content-draft-pages', $pages );\n\t\treturn $pages;\n\t}", "public function draftsDeactivate($page_id) {\n\t\t// Build the MindTouch API URL to deactivate a draft.\n\t\t$url = $this->draftsUrl($page_id) . \"/deactivate\";\n\n\t\t// Get output from API.\n\t\t$output = $this->post($url, '');\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function pageIsNotLockedForEditors() {}", "protected function setDrafts(array $drafts = null)\n {\n if ($drafts !== null) {\n $this->drafts = Pages::factory($drafts, $this, true);\n }\n\n return $this;\n }", "public function draftsExists($page_id) {\n\t\t// Build the MindTouch API URL to check a draft's existence.\n\t\t$url = $this->draftsUrl($page_id);\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\tif ((string) $output['state'] === 'active' \n\t\t\t|| (string) $output['state'] === 'unpublished'\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function _deactivate()\n\t{\n\t\tif( empty(self::$page_ids) )\n\t\t\terror_log('ABNOT@deactivate: Empty $page_ids!');\n\n\t\tforeach( self::$tools as $tool => $t )\n\t\t{\n\t\t\t$pid = get_page_by_title($t['title'], 'OBJECT', 'page');\n\t\t\twp_update_post(array('ID' => $pid->ID, 'post_status' => 'draft'));\n\t\t}\n\t}", "public function isDraft() {\n return $this->getEditingStatus() != '';\n }", "public function bookmarked($page = '0') {\n $this->permission('Garden.SignIn.Allow');\n Gdn_Theme::section('DiscussionList');\n\n // Figure out which discussions layout to choose (Defined on \"Homepage\" settings page).\n $layout = c('Vanilla.Discussions.Layout');\n switch ($layout) {\n case 'table':\n if ($this->SyndicationMethod == SYNDICATION_NONE) {\n $this->View = 'table';\n }\n break;\n default:\n $this->View = 'index';\n break;\n }\n\n // Determine offset from $Page\n list($page, $limit) = offsetLimit($page, c('Vanilla.Discussions.PerPage', 30));\n $this->canonicalUrl(url(concatSep('/', 'discussions', 'bookmarked', pageNumber($page, $limit, true, false)), true));\n\n // Validate $Page\n if (!is_numeric($page) || $page < 0) {\n $page = 0;\n }\n\n $discussionModel = new DiscussionModel();\n $discussionModel->setSort(Gdn::request()->get());\n $discussionModel->setFilters(Gdn::request()->get());\n $this->setData('Sort', $discussionModel->getSort());\n $this->setData('Filters', $discussionModel->getFilters());\n\n $wheres = [\n 'w.Bookmarked' => '1',\n 'w.UserID' => Gdn::session()->UserID\n ];\n\n $this->DiscussionData = $discussionModel->get($page, $limit, $wheres);\n $this->setData('Discussions', $this->DiscussionData);\n $countDiscussions = $discussionModel->getCount($wheres);\n $this->setData('CountDiscussions', $countDiscussions);\n $this->Category = false;\n\n $this->setJson('Loading', $page.' to '.$limit);\n\n // Build a pager\n $pagerFactory = new Gdn_PagerFactory();\n $this->EventArguments['PagerType'] = 'Pager';\n $this->fireEvent('BeforeBuildBookmarkedPager');\n $this->Pager = $pagerFactory->getPager($this->EventArguments['PagerType'], $this);\n $this->Pager->ClientID = 'Pager';\n $this->Pager->configure(\n $page,\n $limit,\n $countDiscussions,\n 'discussions/bookmarked/%1$s'\n );\n\n if (!$this->data('_PagerUrl')) {\n $this->setData('_PagerUrl', 'discussions/bookmarked/{Page}');\n }\n $this->setData('_Page', $page);\n $this->setData('_Limit', $limit);\n $this->fireEvent('AfterBuildBookmarkedPager');\n\n // Deliver JSON data if necessary\n if ($this->_DeliveryType != DELIVERY_TYPE_ALL) {\n $this->setJson('LessRow', $this->Pager->toString('less'));\n $this->setJson('MoreRow', $this->Pager->toString('more'));\n $this->View = 'discussions';\n }\n\n // Add modules\n $this->addModule('DiscussionFilterModule');\n $this->addModule('NewDiscussionModule');\n $this->addModule('CategoriesModule');\n $this->addModule('TagModule');\n\n // Render default view (discussions/bookmarked.php)\n $this->setData('Title', t('My Bookmarks'));\n $this->setData('Breadcrumbs', [['Name' => t('My Bookmarks'), 'Url' => '/discussions/bookmarked']]);\n $this->render();\n }", "public function is_submission_draft($itemid) {\n return false;\n }", "public function drafts()\n {\n $postsQuery = Post::unpublished();\n $posts = $postsQuery->paginate();\n return view('posts.drafts', compact('posts'));\n }", "function newDraft($save = false){\n\t\tglobal $tsCore, $tsUser;\n\t\t//\n\t\t$draftData = array(\n\t\t\t'date' => time(),\n\t\t\t'title' => $tsCore->setSecure($tsCore->parseBadWords($_POST['titulo']), true),\n\t\t\t'portada' => $tsCore->setSecure($_POST['imagen'], true),\n\t\t\t'body' => $tsCore->setSecure($_POST['cuerpo'], true),\n\t\t\t'tags' => $tsCore->setSecure($tsCore->parseBadWords($_POST['tags']), true),\n\t\t\t'category' => $tsCore->setSecure($_POST['categoria']),\n\t\t\t'private' => empty($_POST['privado']) ? 0 : 1,\n\t\t\t'block_comments' => empty($_POST['sin_comentarios']) ? 0 : 1,\n\t\t\t'sponsored' => empty($_POST['patrocinado']) ? 0 : 1,\n 'sticky' => empty($_POST['sticky']) ? 0 : 1,\n\t\t\t'smileys' => empty($_POST['smileys']) ? 0 : 1,\n\t\t\t'visitantes' => empty($_POST['visitantes']) ? 0 : 1,\n\t\t);\n\t\t//\n\t\tif(!empty($draftData['title'])) {\n\t\t\tif(!empty($draftData['category']) && $draftData['category'] > 0) {\n\t\t\tif($save) {\n\t\t\t\t// UPDATE\n\t\t\t\t$bid = intval($_POST['borrador_id']);\n\t\t\t\t$updates = $tsCore->getIUP($draftData, 'b_');\n\t\t\t\t//\n if(db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `p_borradores` SET '.$updates.' WHERE bid = \\''.(int)$bid.'\\' AND b_user = \\''.$tsUser->info['user_id'].'\\'')) return '1: '.$bid;\n\t\t\t\telse return '0: '.show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.', 'db');\n\t\t } else {\n\t\t\t\t// INSERT\n\t\t\t if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_borradores` (`b_user`, `b_date`, `b_title`, `b_portada`, `b_body`, `b_tags`, `b_category`, `b_private`, `b_block_comments`, `b_sponsored`, `b_sticky`, `b_smileys`, `b_visitantes`, `b_status`, `b_causa`) VALUES (\\''.$tsUser->info['user_id'].'\\', \\''.$draftData['date'].'\\', \\''.$draftData['title'].'\\', \\''.$draftData['portada'].'\\', \\''.$draftData['body'].'\\', \\''.$draftData['tags'].'\\', \\''.$draftData['category'].'\\', \\''.$draftData['private'].'\\', \\''.$draftData['block_comments'].'\\', \\''.$draftData['sponsored'].'\\', \\''.$draftData['sticky'].'\\', \\''.$draftData['smileys'].'\\', \\''.$draftData['visitantes'].'\\', \\'1\\', \\'\\')')) return '1: '.db_exec('insert_id');\n\t\t\t else return '0: '.show_error('Error al ejecutar la consulta de la l&iacute;nea '.__LINE__.' de '.__FILE__.'.', 'db');\n\t\t\t}\n\t\t\t} else $return = 'Categor&iacute;a';\n\t\t} else $return = 'T&iacute;tulos';\n\t\t//\n\t\treturn '0: El campo <b>'.$return.'</b> es requerido para esta operaci&oacute;n';\n\t\t//\n\t}", "public static function drafted()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->drafted();\n }", "public function markUnapproved()\n {\n $this->Moderated = false;\n $this->write();\n $this->extend('afterMarkUnapproved');\n }", "function _wp_keep_alive_customize_changeset_dependent_auto_drafts($new_status, $old_status, $post)\n {\n }", "function _wp_privacy_settings_filter_draft_page_titles($title, $page)\n {\n }", "function wp_delete_auto_drafts()\n {\n }", "function wyz_bus_save_draft() {\n\n}", "function updatePage(){\r\n\t$pageData=base64_decode($_POST['data']);\r\n\t// Get the page we need to edit\r\n\t$html=getPage();\r\n\t// Iterate HTML, look for the editable region and make sure it's count matches the one being sent. \r\n\t$eid=0; // Assign logical number to each found class tag\r\n\tforeach($html->find('.clienteditor') as $e){ // TODO: change this to variable defined topic for edit regions\r\n\t \tif($eid==$_GET['id']){\r\n\t \t\t$e->innertext=$pageData;\r\n\t \t}\r\n\t\t$eid++;\r\n\t}\r\n\t// Post Back the updated HTML object.\r\n\t$result=postData($html);\r\n\techo \"{'status':'$result'}\";\r\n}", "public function testBookWithPendingRevisions() {\n // Create two books.\n $book_1_nodes = $this->createBook(['moderation_state[0][state]' => 'published']);\n $book_1 = $this->book;\n\n $this->createBook(['moderation_state[0][state]' => 'published']);\n $book_2 = $this->book;\n\n $this->drupalLogin($this->bookAuthor);\n\n // Check that book pages display along with the correct outlines.\n $this->book = $book_1;\n $this->checkBookNode($book_1, [$book_1_nodes[0], $book_1_nodes[3], $book_1_nodes[4]], FALSE, FALSE, $book_1_nodes[0], []);\n $this->checkBookNode($book_1_nodes[0], [$book_1_nodes[1], $book_1_nodes[2]], $book_1, $book_1, $book_1_nodes[1], [$book_1]);\n\n // Create a new book page without actually attaching it to a book and create\n // a draft.\n $edit = [\n 'title[0][value]' => $this->randomString(),\n 'moderation_state[0][state]' => 'published',\n ];\n $this->drupalGet('node/add/book');\n $this->submitForm($edit, 'Save');\n $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);\n $this->assertNotEmpty($node);\n\n $edit = [\n 'moderation_state[0][state]' => 'draft',\n ];\n $this->drupalGet('node/' . $node->id() . '/edit');\n $this->submitForm($edit, 'Save');\n $this->assertSession()->pageTextNotContains('You can only change the book outline for the published version of this content.');\n\n // Create a book draft with no changes, then publish it.\n $edit = [\n 'moderation_state[0][state]' => 'draft',\n ];\n $this->drupalGet('node/' . $book_1->id() . '/edit');\n $this->submitForm($edit, 'Save');\n $this->assertSession()->pageTextNotContains('You can only change the book outline for the published version of this content.');\n $edit = [\n 'moderation_state[0][state]' => 'published',\n ];\n $this->drupalGet('node/' . $book_1->id() . '/edit');\n $this->submitForm($edit, 'Save');\n\n // Try to move Node 2 to a different parent.\n $edit = [\n 'book[pid]' => $book_1_nodes[3]->id(),\n 'moderation_state[0][state]' => 'draft',\n ];\n $this->drupalGet('node/' . $book_1_nodes[1]->id() . '/edit');\n $this->submitForm($edit, 'Save');\n\n $this->assertSession()->pageTextContains('You can only change the book outline for the published version of this content.');\n\n // Check that the book outline did not change.\n $this->book = $book_1;\n $this->checkBookNode($book_1, [$book_1_nodes[0], $book_1_nodes[3], $book_1_nodes[4]], FALSE, FALSE, $book_1_nodes[0], []);\n $this->checkBookNode($book_1_nodes[0], [$book_1_nodes[1], $book_1_nodes[2]], $book_1, $book_1, $book_1_nodes[1], [$book_1]);\n\n // Try to move Node 2 to a different book.\n $edit = [\n 'book[bid]' => $book_2->id(),\n 'moderation_state[0][state]' => 'draft',\n ];\n $this->drupalGet('node/' . $book_1_nodes[1]->id() . '/edit');\n $this->submitForm($edit, 'Save');\n\n $this->assertSession()->pageTextContains('You can only change the book outline for the published version of this content.');\n\n // Check that the book outline did not change.\n $this->book = $book_1;\n $this->checkBookNode($book_1, [$book_1_nodes[0], $book_1_nodes[3], $book_1_nodes[4]], FALSE, FALSE, $book_1_nodes[0], []);\n $this->checkBookNode($book_1_nodes[0], [$book_1_nodes[1], $book_1_nodes[2]], $book_1, $book_1, $book_1_nodes[1], [$book_1]);\n\n // Try to change the weight of Node 2.\n $edit = [\n 'book[weight]' => 2,\n 'moderation_state[0][state]' => 'draft',\n ];\n $this->drupalGet('node/' . $book_1_nodes[1]->id() . '/edit');\n $this->submitForm($edit, 'Save');\n\n $this->assertSession()->pageTextContains('You can only change the book outline for the published version of this content.');\n\n // Check that the book outline did not change.\n $this->book = $book_1;\n $this->checkBookNode($book_1, [$book_1_nodes[0], $book_1_nodes[3], $book_1_nodes[4]], FALSE, FALSE, $book_1_nodes[0], []);\n $this->checkBookNode($book_1_nodes[0], [$book_1_nodes[1], $book_1_nodes[2]], $book_1, $book_1, $book_1_nodes[1], [$book_1]);\n\n // Save a new draft revision for the node without any changes and check that\n // the error message is not displayed.\n $edit = [\n 'moderation_state[0][state]' => 'draft',\n ];\n $this->drupalGet('node/' . $book_1_nodes[1]->id() . '/edit');\n $this->submitForm($edit, 'Save');\n\n $this->assertSession()->pageTextNotContains('You can only change the book outline for the published version of this content.');\n }", "public function deleteDrafts(PageModelInterface $page)\n {\n $this->model\n ->where(Model::ATTR_PAGE, $page->getId())\n ->where(function (Builder $query) {\n $query\n ->whereNull(Model::ATTR_EMBARGOED_UNTIL)\n ->orWhere(Model::ATTR_EMBARGOED_UNTIL, '>', time());\n })\n ->where(Model::ATTR_EDITED_AT, '>', $page->getLastPublishedTime()->getTimestamp())\n ->delete();\n\n return $this;\n }", "public function createNestedPagesAndCopyDraftParentPage() {}", "public function setDraftId($value)\n {\n return $this->set(self::DRAFTID, $value);\n }", "private function _setDraftValuesFromPost(EntryDraftModel $draft)\n\t{\n\t\t$draft->title = blx()->request->getPost('title');\n\t\t$draft->slug = blx()->request->getPost('slug');\n\t\t$draft->postDate = $this->getDateFromPost('postDate');\n\t\t$draft->expiryDate = $this->getDateFromPost('expiryDate');\n\t\t$draft->enabled = blx()->request->getPost('enabled');\n\t\t$draft->tags = blx()->request->getPost('tags');\n\n\t\t$draft->setContent(blx()->request->getPost('blocks'));\n\n\t\tif (Blocks::hasPackage(BlocksPackage::Users))\n\t\t{\n\t\t\t$draft->authorId = blx()->request->getPost('author');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$draft->authorId = blx()->userSession->getUser()->id;\n\t\t}\n\t}", "public function hasDrafts(): bool\n {\n return $this->drafts()->count() > 0;\n }", "public function drafts()\n {\n $rqsQuery = RequestModel::all();\n\n $rqs = $rqsQuery;\n $id = Auth::user()->id;\n $user = User::where('id', $id)->first();\n if ($user->inRole('admin')) {\n $rqs = $rqsQuery->where('status', '<>', 'Close');\n }\n if ($user->inRole('user')) {\n $rqs = $rqsQuery->where('user_id', Auth::user()->id);\n }\n if ($user->inRole('manager')) {\n $rqs = $rqsQuery->where('manager', $user->name);\n }\n return view('requests.drafts', compact('rqs'));\n }", "function setAsStartPageObject()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\n\t\t$this->checkPermission(\"write\");\n\n\t\tif (!is_array($_POST[\"imp_page_id\"]) || count($_POST[\"imp_page_id\"]) != 1)\n\t\t{\n\t\t\tilUtil::sendInfo($lng->txt(\"wiki_select_one_item\"), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->object->removeImportantPage((int) $_POST[\"imp_page_id\"][0]);\n\t\t\t$this->object->setStartPage(ilWikiPage::lookupTitle((int) $_POST[\"imp_page_id\"][0]));\n\t\t\t$this->object->update();\n\t\t\tilUtil::sendSuccess($this->lng->txt(\"msg_obj_modified\"),true);\n\t\t}\n\t\t$ilCtrl->redirect($this, \"editImportantPages\");\n\t}", "public static function drafts()\n {\n return self::where('published', '=', false)->get();\n }", "public static function withDrafted()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->withDrafted();\n }", "public function getDraft() : bool\n {\n return $this->draft;\n }", "function fix_no_editor_on_posts_page($post)\n{\n\n if ($post->ID != get_option('page_for_posts')) {\n return;\n }\n\n remove_action('edit_form_after_title', '_wp_posts_page_notice');\n add_post_type_support('page', 'editor');\n\n}", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "public function draftPost()\n {\n \t$posts = Post::where([['status', 0], ['user_id', auth()->id()]])->get();\n \t$countPublicPosts = Post::where([['status', 1], ['user_id', auth()->id()]])->count();\n\n \treturn view('users.posts.draft', compact('posts', 'countPublicPosts'));\n }", "function setEditorFlags($args) {\n\t\t$this->validate();\n\n\t\t$press =& Request::getPress();\n\t\t$monographId = (int) Request::getUserVar('monographId');\n\n\t\t$monographDao =& DAORegistry::getDAO('MonographDAO');\n\t\t$monograph =& $monographDao->getMonograph($monographId);\n\n\t\tif ($monograph && $monograph->getPressId() === $press->getId()) {\n\t\t\t$editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');\n\t\t\t$editAssignments =& $editAssignmentDao->getByMonographId($monographId);\n\n\t\t\twhile($editAssignment =& $editAssignments->next()) {\n\t\t\t\tif ($editAssignment->getIsEditor()) continue;\n\n\t\t\t\t$canReview = Request::getUserVar('canReview-' . $editAssignment->getEditId()) ? 1 : 0;\n\t\t\t\t$canEdit = Request::getUserVar('canEdit-' . $editAssignment->getEditId()) ? 1 : 0;\n\n\t\t\t\t$editAssignment->setCanReview($canReview);\n\t\t\t\t$editAssignment->setCanEdit($canEdit);\n\n\t\t\t\t$editAssignmentDao->updateEditAssignment($editAssignment);\n\t\t\t}\n\t\t}\n\n\t\tRequest::redirect(null, null, 'submission', $monographId);\n\t}", "public function rejectedits() {\n\t\t\tglobal $db, $user;\n\t\t\t$query = \"delete from content where parent = '\".$this->guid.\"' and revision_id=1\";\n\t\t\t//print \"$query<br>\\n\";\n\t\t\tif ($db->query($query)) {\n\n\t\t\t\t// We have rejected edits to the page\n\t\t\t\taddHistory($user->id, \"\", $this->guid, \"Changes rejected\", $this->template_type.\"s\");\n\n\t\t\t\t// Update this page in the history table also\n\t\t\t\t$query = \"UPDATE history \n\t\t\t\t\tSET completed_action='CHANGES REJECTED', completed_date=now(), completed_by=\".$user->id.\" \n\t\t\t\t\tWHERE action='publish' \n\t\t\t\t\tAND completed_action is null\n\t\t\t\t\tAND (info='Page saved' OR info='Panel saved')\n\t\t\t\t\tAND guid='\".$this->guid.\"'\";\n\t\t\t\tif (!$db->query($query)) {\n\t\t\t\t\t//print \"failed($query)<br>\\n\";\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function publishExhibit(){\n\t\t$this->setVisible('1');\n\t\t$res = requete_sql(\"UPDATE exhibit SET visible = '\".$this->visible.\"' WHERE id = '\".$this->id.\"' \");\n\t\tif ($res) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setPublished()\n\t{\n\t\t$this->published_at = $this->published_at ? $this->published_at : Carbon::now();\n\t\t$this->save();\n\t}", "function updatePages() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) FROM \" . TABLE_PREFIX . \"modules WHERE name = 'notebooks'\")) {\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n\n DB::beginWork('Updating pages @ ' . __CLASS__);\n\n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'activity_logs WHERE type = ?', 'NewPageVersionActivityLog'); // We'll rebuild this\n\n $notebook_ids = DB::execute(\"SELECT id FROM $project_objects_table WHERE type = 'Notebook'\");\n\n if($notebook_ids) {\n foreach($notebook_ids as $notebook_id) {\n $this->doUpdatePages($notebook_id, 'Notebook', $notebook_id);\n } // foreach\n } // if\n\n DB::execute('UPDATE ' . TABLE_PREFIX . 'comments SET type = ? WHERE parent_type = ?', 'NotebookPageComment', 'NotebookPage'); // Make sure that comments have proper class\n DB::execute(\"DELETE FROM $project_objects_table WHERE type = 'Page'\"); // Cleanup\n\n DB::commit('Pages updated @ ' . __CLASS__);\n\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'page_versions');\n } // if\n } catch(Exception $e) {\n DB::rollback('Failed to updated pages @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function isNotDraft()\n {\n return ! $this->isDraft();\n }", "private function draftsUrl($page_id = '') {\n\t\t$url = \"drafts\";\n\t\tif (!empty($page_id)) {\n\t\t\t$url .= '/';\n\t\t\tif (is_string($page_id)) {\n\t\t\t\t$url .= '=';\n\t\t\t}\n\t\t\t$url .= $page_id;\n\t\t}\n\t\treturn $url;\n\t}", "function publish($ids) {\n if (!is_array($ids)) {\n $ids = array(intval($ids));\n }\n $ids = join(', ', $ids);\n $this->query(\"UPDATE {$this->useTable} SET draft = 0 WHERE id IN ($ids)\");\n }", "function gwt_drupal_page_alter(&$page) {\n // Look in each visible region for blocks.\n foreach (system_region_list($GLOBALS['theme'], REGIONS_VISIBLE) as $region => $name) {\n if (!empty($page[$region])) {\n // Find the last block in the region.\n $blocks = array_reverse(element_children($page[$region]));\n while ($blocks && !isset($page[$region][$blocks[0]]['#block'])) {\n array_shift($blocks);\n }\n if ($blocks) {\n $page[$region][$blocks[0]]['#block']->last_in_region = TRUE;\n }\n }\n }\n}", "public static function isDrafted()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t$template = $app->getTemplate(true);\n\t\t$templateId = 0;\n\n\t\tif ($app->isClient('site'))\n\t\t{\n\t\t\t$templateId = $template->id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($app->input->get('option') === 'com_ajax' && $app->input->get('helix') === 'ultimate')\n\t\t\t{\n\t\t\t\t$templateId = $app->input->get('id', 0, 'INT');\n\t\t\t}\n\t\t}\n\n\t\t$draftKeyOptions = [\n\t\t\t'option' => 'com_ajax',\n\t\t\t'helix' => 'ultimate',\n\t\t\t'status' => 'draft',\n\t\t\t'id' => $templateId\n\t\t];\n\n\t\t$key = self::generateKey($draftKeyOptions);\n\t\t$cache = new HelixCache($key);\n\n\t\treturn $cache->contains();\n\t}", "public function draftsGet($page_id = '') {\n\t\t$url = $this->draftsUrl($page_id);\n\n\t\t$output = $this->get($url);\n\t\treturn $this->parseOutput($output);\n\t}", "public function draft_discard() {\n\n\t\t// Delete all the current draft content\n\t\treturn $this->save($this->_get_current_data(), 0, 'draft_discard');\n\t}", "public function draft_discard()\n\t{\n\t\t$where = array(\n\t\t\t'parent_entry_id' => $this->settings['entry_id'],\n\t\t\t'parent_is_draft' => 1\n\t\t);\n\n\t\t$this->EE->db->where($where)->delete('playa_relationships');\n\t}", "final public function setPages(iterable $pages): void\n {\n $this->removePages();\n $this->addPages($pages);\n }", "function test_has_published_pages_when_nav_menus_created_posts() {\n\t\tforeach ( get_pages() as $page ) {\n\t\t\twp_delete_post( $page->ID, true );\n\t\t}\n\t\t$this->assertFalse( $this->manager->has_published_pages() );\n\n\t\twp_set_current_user( $this->factory()->user->create( array( 'role' => 'editor' ) ) );\n\t\t$this->manager->nav_menus->customize_register();\n\t\t$setting_id = 'nav_menus_created_posts';\n\t\t$setting = $this->manager->get_setting( $setting_id );\n\t\t$this->assertInstanceOf( 'WP_Customize_Filter_Setting', $setting );\n\t\t$auto_draft_page = $this->factory()->post->create( array( 'post_type' => 'page', 'post_status' => 'auto-draft' ) );\n\t\t$this->manager->set_post_value( $setting_id, array( $auto_draft_page ) );\n\t\t$setting->preview();\n\t\t$this->assertTrue( $this->manager->has_published_pages() );\n\t}", "public function hasIsDraft()\n {\n return $this->IsDraft !== null;\n }", "public function update_page_content() {\n\t\tglobal $post;\n\t\tif ( empty( $post->post_content_filtered ) ) {\n\t\t\t$post->post_content_filtered = $post->post_content;\n\t\t\twp_update_post( $post, false );\n\t\t}\n\t}", "public function pageIdCanBeDeterminedWhileEditingAPageRecord() {}", "public function draft_save($data)\n\t{\n\t\t$this->field_id = $this->settings['field_id'];\n\t\t$this->is_draft = 1;\n\t\t$this->post_save($data);\n\t\treturn $data;\n\t}", "public function markApproved()\n {\n $this->IsSpam = false;\n $this->Moderated = true;\n $this->write();\n $this->extend('afterMarkApproved');\n }", "function do_meta_boxes( $page, $context ) {\n\t\t\treturn;\n\t\t\tif ( ( 'page' === $page || 'post' === $page ) && 'side' === $context )\n\t\t\t\tadd_meta_box( 'draft-publish-notify', __( 'Revision Workflow', $this->text_domain ), array( &$this, 'meta_box' ), $page, 'side', 'high' );\n\t\t}", "public function draftsContentsPost($page_id, $content, $title = '') {\n\t\t// Build the MindTouch API URL to update a draft's content.\n\t\t$url = $this->draftsUrl($page_id) . \"/contents?edittime=\" . $this->edit_time . \"&overwrite=true\";\n\n\t\t// Deal with title when provided.\n\t\tif (!empty($title)) {\n\t\t\t$url .= \"&title=\" . urlencode($title);\n\t\t}\n\n\t\t// Get output from API.\n\t\t$output = $this->post($url, $content);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function submissionAsDraft(Request $request)\n {\n\n if ($_POST) {\n $result['submission_status_id'] = config('constant.status.SUBMISSION_DRAFT');\n if (isset($_POST['submission_status_id']) && $_POST['submission_status_id'] == $result['submission_status_id']) {\n $result['status'] = $this->update($request, TRUE);\n }else {\n $result['status'] = $this->save($request, TRUE);\n }\n return response()->json($result, 200);\n }\n }", "public function toggleStatus()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->update(\n $this->module->table_name,\n ['active' => !$this->module->getHTMLPageStatus($pageId)],\n 'id_page = ' . $pageId\n );\n }", "public function edit(Draft $draft)\n {\n //\n }", "public function draftsUnpublish($page_id) {\n\t\t// Build the MindTouch API URL to unpublish a draft.\n\t\t$url = $this->draftsUrl($page_id) . \"/unpublish\";\n\n\t\t// Get output from API.\n\t\t$output = $this->post($url, '');\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function createPlaceholdersAndDeleteDraftParentPage() {}", "public function getDrafts()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('drafts');\n }", "function sendit_duplicate_post_as_draft(){\n\tglobal $wpdb;\n\tif (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {\n\t\twp_die('No post to duplicate has been supplied!');\n\t}\n \n\t/*\n\t * get the original post id\n\t */\n\t$post_id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);\n\t/*\n\t * and all the original post data then\n\t */\n\t$post = get_post( $post_id );\n \n\t/*\n\t * if you don't want current user to be the new post author,\n\t * then change next couple of lines to this: $new_post_author = $post->post_author;\n\t */\n\t$current_user = wp_get_current_user();\n\t$new_post_author = $current_user->ID;\n \n\t/*\n\t * if post data exists, create the post duplicate\n\t */\n\tif (isset( $post ) && $post != null) {\n \n\t\t/*\n\t\t * new post data array\n\t\t */\n\t\t$args = array(\n\t\t\t'comment_status' => $post->comment_status,\n\t\t\t'ping_status' => $post->ping_status,\n\t\t\t'post_author' => $new_post_author,\n\t\t\t'post_content' => $post->post_content,\n\t\t\t'post_excerpt' => $post->post_excerpt,\n\t\t\t'post_name' => $post->post_name,\n\t\t\t'post_parent' => $post->post_parent,\n\t\t\t'post_password' => $post->post_password,\n\t\t\t'post_status' => 'draft',\n\t\t\t'post_title' => $post->post_title,\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'to_ping' => $post->to_ping,\n\t\t\t'menu_order' => $post->menu_order\n\t\t);\n \n\t\t/*\n\t\t * insert the post by wp_insert_post() function\n\t\t */\n\t\t$new_post_id = wp_insert_post( $args );\n \n\t\t/*\n\t\t * get all current post terms ad set them to the new post draft\n\t\t */\n\t\t$taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array(\"category\", \"post_tag\");\n\t\tforeach ($taxonomies as $taxonomy) {\n\t\t\t$post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));\n\t\t\twp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\n\t\t}\n \n\t\t/*\n\t\t * duplicate all post meta apart from sendit custom post_meta (sendit_list, startnum, subscribers)\n\t\t */\n\t\t$post_meta_infos = $wpdb->get_results(\"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id and meta_key!='send_now' and meta_key!='subscribers' and meta_key!='startnum' and meta_key!='sendit_list'\");\n\t\tif (count($post_meta_infos)!=0) {\n\t\t\t$sql_query = \"INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) \";\n\t\t\tforeach ($post_meta_infos as $meta_info) {\n\t\t\t\t$meta_key = $meta_info->meta_key;\n\t\t\t\t$meta_value = addslashes($meta_info->meta_value);\n\t\t\t\t$sql_query_sel[]= \"SELECT $new_post_id, '$meta_key', '$meta_value'\";\n\t\t\t}\n\t\t\t$sql_query.= implode(\" UNION ALL \", $sql_query_sel);\n\t\t\t$wpdb->query($sql_query);\n\t\t}\n \n \n\t\t/*\n\t\t * finally, redirect to the edit post screen for the new draft\n\t\t */\n\t\twp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );\n\t\texit;\n\t} else {\n\t\twp_die('Post creation failed, could not find original post: ' . $post_id);\n\t}\n}", "function add_custom_post_states($states) {\n \n global $post;\n\n // get saved project page ID\n $project_page_id = get_option('ccmsversion_page');\n\n // add our custom state after the post title only,\n // if post-type is \"page\",\n // \"$post->ID\" matches the \"$project_page_id\",\n // and \"$project_page_id\" is not \"0\"\n if( 'page' == get_post_type(get_the_ID()) && get_the_ID() == $project_page_id && $project_page_id != '0') {\n $states[] = __('CCMS Versions Landing Page', 'textdomain');\n }\n\n return $states;\n }", "public function pageIdCanBeDeterminedWhileEditingARegularRecord() {}", "public function getDrafts()\n {\n $mostRecommended = Post::mostRecommended();\n $last = Post::lastPosts()\n ->orderBy('created_at')\n ->where('public', 0)\n ;\n\n $categories = PostCategory::all();\n\n $drafts = Post::where('public', 0)->get();\n\n $last = $last->paginate(4);\n\n return View('blog/index',\n array(\n 'title'=>\"News\",\n 'mostRecommended'=>$mostRecommended,\n 'last'=>$last,\n 'categories' => $categories,\n 'category' => \"Drafts\" , \n 'drafts' => $drafts\n )\n );\n }", "public function set_attachmentsdraftid($attachmentsdraftitemid) {\n $fileareainfo = file_get_draft_area_info($attachmentsdraftitemid);\n if ($fileareainfo['filecount']) {\n $this->_attachmentsdraftid = $attachmentsdraftitemid;\n }\n }", "function wp_revisions_to_keep($post)\n {\n }", "public function setPageVisiable(\\SetaPDF_Core_Document_Action $action) {}", "public static function createDraftFromRequest() {\n global $member, $manager;\n\n $i_author = $member->getID();\n $i_body = postVar('body');\n $i_title = postVar('title');\n $i_more = postVar('more');\n\n if((strtoupper(_CHARSET) != 'UTF-8')\n && ( ($mb = function_exists('mb_convert_encoding')) || function_exists('iconv') )\n ) {\n if ($mb) {\n $i_body = mb_convert_encoding($i_body, _CHARSET, \"UTF-8\");\n $i_title = mb_convert_encoding($i_title, _CHARSET, \"UTF-8\");\n $i_more = mb_convert_encoding($i_more, _CHARSET, \"UTF-8\");\n } else {\n $i_body = iconv(\"UTF-8\", _CHARSET, $i_body);\n $i_title = iconv(\"UTF-8\", _CHARSET, $i_title);\n $i_more = iconv(\"UTF-8\", _CHARSET, $i_more);\n }\n }\n //$i_actiontype = postVar('actiontype');\n $i_closed = intPostVar('closed');\n //$i_hour = intPostVar('hour');\n //$i_minutes = intPostVar('minutes');\n //$i_month = intPostVar('month');\n //$i_day = intPostVar('day');\n //$i_year = intPostVar('year');\n $i_catid = postVar('catid');\n $i_draft = 1;\n $type = postVar('type');\n if ($type == 'edit') {\n $i_blogid = getBlogIDFromItemID(intPostVar('itemid'));\n }\n else {\n $i_blogid = intPostVar('blogid');\n }\n $i_draftid = intPostVar('draftid');\n\n if (!$member->canAddItem($i_catid)) {\n return array('status' => 'error', 'message' => _ERROR_DISALLOWED);\n }\n\n if (!trim($i_body)) {\n return array('status' => 'error', 'message' => _ERROR_NOEMPTYITEMS);\n }\n\n // create new category if needed\n if (strstr($i_catid, 'newcat')) {\n // Set in default category\n $blog =& $manager->getBlog($i_blogid);\n $i_catid = $blog->getDefaultCategory();\n }\n else {\n // force blogid (must be same as category id)\n $i_blogid = getBlogIDFromCatID($i_catid);\n $blog =& $manager->getBlog($i_blogid);\n }\n\n $posttime = 0;\n\n if ($i_draftid > 0) {\n ITEM::update($i_draftid, $i_catid, $i_title, $i_body, $i_more, $i_closed, 1, 0, 0);\n $itemid = $i_draftid;\n }\n else {\n $itemid = $blog->additem($i_catid, $i_title, $i_body, $i_more, $i_blogid, $i_author, $posttime, $i_closed, $i_draft);\n }\n\n // success\n return array('status' => 'added', 'draftid' => $itemid);\n }" ]
[ "0.73212045", "0.63144994", "0.63144994", "0.63144994", "0.6159477", "0.61202013", "0.60926974", "0.60233706", "0.60225785", "0.5997254", "0.59617937", "0.59500796", "0.58891255", "0.5865054", "0.5825467", "0.5787281", "0.56615436", "0.5652611", "0.55780053", "0.55590653", "0.5555535", "0.55399144", "0.552308", "0.547978", "0.54604596", "0.5448675", "0.54373056", "0.54332674", "0.54114676", "0.5404565", "0.53930074", "0.53728807", "0.53619707", "0.5351082", "0.5308295", "0.52983683", "0.52784103", "0.5243196", "0.5238526", "0.52187914", "0.5212303", "0.52079445", "0.52057683", "0.52029496", "0.51946926", "0.51755977", "0.5173122", "0.516923", "0.51585585", "0.51471484", "0.51425457", "0.5142309", "0.5131845", "0.5130287", "0.51212347", "0.5100646", "0.50959116", "0.50915504", "0.5090121", "0.50678784", "0.50553334", "0.5052832", "0.5041503", "0.50397784", "0.50363547", "0.50347054", "0.50325984", "0.5023552", "0.5014101", "0.50019217", "0.5000931", "0.50000703", "0.49995494", "0.4996465", "0.49893355", "0.49757552", "0.49746037", "0.4974006", "0.4972856", "0.49502692", "0.49443474", "0.4933381", "0.48996523", "0.4899028", "0.48965245", "0.48935696", "0.48786867", "0.487485", "0.48658362", "0.48597232", "0.48549655", "0.48508677", "0.48339602", "0.4829192", "0.48253682", "0.48178285", "0.48001093", "0.47899976", "0.47799784", "0.4779959" ]
0.60022277
9
Find all pages ordered alphabetically
function findAllForSidebar($fields = array('id', 'title')) { return $this->findAll(null, $fields, "{$this->name}.title ASC", null, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPageNames()\n{\n $all = array_merge(getSinglepageNames(), getMultipageNames());\n uasort($all,'cmpByName');\n return $all;\n}", "function pageList(){\n\t\t$path = ROOT . DS . 'pages';\n\t\t$pagesArray = array_diff(scandir($path), array('..', '.', '.svn','.htaccess'));\n\n\t\tforeach ($pagesArray as $page) {\n\t\t\t$tmp[basename($page)] = filemtime($page);\n\t\t}\n\t\tasort($tmp);\n\t\t$pagesArray = array_keys($tmp);\n\n\t\t// sorting by date can be added but name wise listing pages seems more pleasing.\n\t\t// later add extra sort-by-date option.\n\t\treturn $pagesArray;\n\t}", "function wv_wp_page_list() {\n\n $arglist = array(\n 'sort_order' => 'ASC',\n 'sort_column' => 'post_title',\n 'hierarchical' => 1,\n 'post_type' => 'page',\n 'post_status' => 'publish'\n );\n $mypages = get_pages($arglist);\n return $mypages;\n }", "function get_all_sorted_page($id)\n\t{\n\t\t$query=$this->db->select('p.id,p.title,p.slug,nl.url')\n\t\t->from('pages as p')\n\t\t->join('navigation_link as nl','p.id=nl.page_id')\n\t\t->join('navigation_groups as ng','ng.id=nl.nav_group_id')\n\t\t->where('ng.id',$id)\n\t\t->get();\n\t\tif ($query->num_rows() == 0) {\n return FALSE;\n } else {\n return $query->result();\n }\n\t}", "public function &getOrderBy();", "public function getSortBy();", "private function sort(): void\n {\n if (!$this->dirtyIndex) {\n return;\n }\n\n $newIndex = [];\n $index = 0;\n\n foreach ($this->pages as $hash => $page) {\n $order = $page->getOrder();\n\n if (null === $order) {\n $newIndex[$hash] = $index;\n ++$index;\n } else {\n $newIndex[$hash] = $order;\n }\n }\n\n asort($newIndex);\n\n $this->index = $newIndex;\n $this->dirtyIndex = false;\n }", "public function writeRecords_pages_order() {}", "public function getMainPageList()\r\n {\r\n $q = $this->createQuery('c')\r\n ->orderBy('ordered');\r\n return $q->execute();\r\n }", "public function getXXXOrdering()\n\t{\n\t\treturn array('title_asc', 'title_desc');\n\t}", "function get_pages($title = false, $indent = true) {\r\n $wp_pages = get_pages('sort_column=menu_order');\r\n $page_list = array();\r\n if ($title) $page_list[] = $title;\r\n foreach ($wp_pages as $page) {\r\n $prefix = '';\r\n // show indented child pages?\r\n if ($indent) {\r\n $has_parent = $page->post_parent;\r\n while($has_parent) {\r\n $prefix .= ' - ';\r\n $next_page = get_page($has_parent);\r\n $has_parent = $next_page->post_parent;\r\n }\r\n }\r\n // add to page list array array\r\n $page_list[$page->ID] = $prefix . $page->post_title;\r\n }\r\n return $page_list;\r\n }", "public function getAscent();", "public function getPages();", "function getSort(){ return 301; }", "function allApprenticesAscending() {\n\n\t\t\t\t\treturn Apprentice::find('all', array('order'=>'name Asc'));\n\t\t\t\t}", "public static function orderAsc($parameter);", "function listAllPages() {\n $PAGES_PATH = $_SERVER['DOCUMENT_ROOT'] . '/pages';\n //Ignore '.', '..', and '.gitkeep' in the returned directory array:\n $files = array_diff(scandir($PAGES_PATH), array('.', '..', '.gitkeep'));\n\n //ignore if there are no pages\n if ($files) {\n foreach($files as $file) {\n $pageName = substr($file, 0, strrpos($file, \".\"));\n echo '<li class=\"pages-menu-item\"><a href=\"/pages/' . $pageName . '.php\" id=\"pages-menu-' . $pageName . '\" style=\"text-decoration: none; color: #FFFFFF;\">' . $pageName . '</a></li>';\n }\n }\n }", "public function order();", "function getSort(){\n return 301;\n }", "function get_all_page_ids()\n {\n }", "function languagelesson_reorder_pages($lessonid) {\n global $DB;\n $startpage = $DB->get_record(\"languagelesson_pages\", array('lessonid'=> $lessonid, 'prevpageid'=>0));\n $order = 0;\n $DB->set_field(\"languagelesson_pages\", 'ordering', $order, array('id'=>$startpage->id));\n $order++;\n $nextpageid = $DB->get_field(\"languagelesson_pages\", 'id', array('id'=>$startpage->nextpageid));\n\n for (; $nextpageid != 0; $order++) {\n $DB->set_field(\"languagelesson_pages\", 'ordering', $order, array('id'=>$nextpageid));\n $nextpageid = (int)$DB->get_field(\"languagelesson_pages\", 'nextpageid', array('id'=>$nextpageid));\n }\n}", "function getPages() {\r\n\tglobal $S;\r\n\tif (!is_array($S->arbo)) {\r\n\t\trequire_once('../lib/class/class_arbo.php');\r\n\t\t$S =& new ARBO();\r\n\t\t$S->fields = array('id', 'pid', 'type_id', 'titre_fr');\r\n\t\t$S->buildArbo();\r\n\t}\r\n\t$options = array();\r\n\tforeach($S->arbo as $rid=>$tmp) {\r\n\t\t$options[urlencode($S->arbo[$rid]['url'])] = $S->arbo[$rid]['titre_fr'].' (#'.$rid.')';\r\n\t}\r\n\treturn $options;\r\n}", "public function getSorting();", "public function test_scan_sort_desc()\n {\n $content = array('.','..','application','.git','.gitignore','.htaccess','index.php','nbproject','README','system');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_DESC);\n \n $output = array();\n foreach($res as $f) $output[] = $f->get_base_name();\n $this->assertEquals(array_reverse($content), $output);\n }", "function findPageUrls();", "public function getPages() {}", "public function natcasesort()\n {\n }", "public function load_all_pages(languagelesson $lesson) {\n global $DB;\n if (!($pages =$DB->get_records('languagelesson_pages', array('lessonid'=>$lesson->id)))) {\n print_error('cannotfindpages', 'languagelesson');\n }\n foreach ($pages as $key=>$page) {\n $pagetype = get_class($this->types[$page->qtype]);\n $pages[$key] = new $pagetype($page, $lesson);\n }\n\n $orderedpages = array();\n $lastpageid = 0;\n\n while (true) {\n foreach ($pages as $page) {\n if ((int)$page->prevpageid === (int)$lastpageid) {\n $orderedpages[$page->id] = $page;\n unset($pages[$page->id]);\n $lastpageid = $page->id;\n if ((int)$page->nextpageid===0) {\n break 2;\n } else {\n break 1;\n }\n }\n }\n }\n\n return $orderedpages;\n }", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "private function getPages()\n {\n $directory = __DIR__.'/Page/';\n // remove .. and . folder in unix\n $pageFolders = array_diff(scandir($directory), array('..', '.'));\n\n return $pageFolders;\n }", "function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}", "public function getPages()\n {\n return $this->getTable('ExhibitPage')->findBy(array('exhibit' => $this->id, 'sort_field' => 'order'));\n }", "function allPartnersAscending() {\n\n\t\t\t\t\t/* Returns all partner companies in database in alphabetical order. */\n\n\t\t\t\t\treturn Partner::find('all', array('order'=>'name Asc'));\n\t\t\t\t}", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "public static function find_all()\n\t{\n\t\t# TODO: return WikirPage instances\n\t\treturn file_list_dir(option('pages_dir'));\n\t}", "function faculty_alphabet_header( $show_all = true ) {\n\n echo '<nav aria-label=\"Alphabet Links\"><ul class=\"pagination flex-wrap\">';\n\n foreach ( range( 'a', 'z' ) as $letter) {\n $term = get_term_by( 'slug', $letter, 'letter' );\n\n if ( $term ) {\n $link = get_term_link( $term );\n if ( ! is_wp_error( $link ) ) {\n if ( $term->count > 0 ) {\n echo '<li class=\"page-item\"><a class=\"page-link bg-primary-lighter\" href=\"'.$link.'\" data-letter=\"'.$letter.'\">'.strtoupper( $letter ).'</a></li>';\n } else {\n echo '<li class=\"page-item\"><a class=\"page-link disabled bg-primary-lighter\">'.strtoupper( $letter ).'</a></li>';\n }\n }\n } else {\n echo '<li class=\"page-item\"><a class=\"page-link disabled bg-primary-lighter\">'.strtoupper( $letter ).'</a></li>';\n }\n }\n if ( $show_all ) {\n echo '<li class=\"page-item\"><a class=\"page-link bg-primary-lighter\" href=\"'.get_post_type_archive_link( 'faculty' ).'\">ALL</a></li>';\n }\n\n echo '</ul></nav>';\n}", "public function getSortOrder();", "public function getSortOrder();", "public function getSortOrder();", "public function changeContentSortingAndCopyDraftPage() {}", "public function sort();", "function renderChapterNavigation($path) {\n $objects = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path),\n RecursiveIteratorIterator::SELF_FIRST\n );\n $items = array();\n foreach ($objects as $o) {\n $filename = $o->getFileName();\n $re = '/ch([0-9]{1,2})\\.html/';\n preg_match($re, $filename, $matches);\n if (count($matches) == 2) {\n $filename = basename($filename, '.html');\n $filepath = '/' . $path . '/' . $filename;\n $items[$matches[1]] = $filepath;\n }\n }\n ksort($items);\n $html = '';\n foreach ($items as $num=>$href) {\n $href = basepath() . $href;\n $html .=\n '<li>' .\n '<a class=\"page chapter\"' .\n ' href=\"' . $href . '\">' .\n 'Chapter ' . $num .\n '</a>' .\n '</li>' . PHP_EOL;\n\n }\n return $html;\n}", "function tmpl_sort_by_character($where){\r\n\tglobal $wpdb;\t\r\n\tif(isset($_REQUEST['sortby']) && $_REQUEST['sortby']!=''){\r\n\t\t$where .= \" AND $wpdb->posts.post_title like '\".$_REQUEST['sortby'].\"%'\";\r\n\t}\r\n\treturn $where;\r\n}", "public function changeContentSortingAndCopyLivePage() {}", "function languagelesson_sort_by_ordering($lessonid) {\n global $DB;\n \n $pages = $DB->get_records('languagelesson_pages', array('lessonid'=>$lessonid));\n\n // Make sure they are in order by field ordering.\n $order = array();\n foreach ($pages as $key => $obj) {\n $order[$key] = $obj->ordering;\n }\n array_multisort($order, SORT_ASC, $pages);\n \n $pagecount = count($pages);\n $keys = array_keys($pages);\n \n $i = array_shift($keys);\n $last = array_pop($keys);\n \n $prev = $pages[$i];\n $prev->prevpageid = 0;\n $prev->nextpageid = $pages[$i += 1];\n $DB->update_record('languagelesson_pages', $prev);\n \n while ($i < $pagecount) {\n $thispage = $pages[$i];\n $thispage->prevpageid = $prev->id;\n if (!$pages[$i += 1]) {\n $thispage->nextpageid = 0;\n $DB->update_record('languagelesson_pages', $thispage);\n break;\n } else {\n $thispage->nextpageid = $i;\n }\n $DB->update_record($thispage);\n $prev = $thispage;\n }\n \n }", "public function sortDirection();", "public function getList($page);", "private function getListOrder($currentPage) {\n switch ($currentPage) {\n case 'home':\n return $this->homePageOrder;\n break;\n case 'ology':\n return $this->ologyPageOrder;\n break;\n case 'profile':\n return $this->profilePageOrder;\n break;\n case 'settings':\n return $this->settingsPageOrder;\n break;\n case 'post':\n return $this->postPageOrder;\n break;\n case 'media':\n return $this->mediaPageOrder;\n break;\n case 'edit':\n return $this->editPageOrder;\n break;\n default:\n return array();\n break;\n }\n }", "function _titlesort($a,$b){\n $ta = $this->_meta($a,'title');\n $tb = $this->_meta($b,'title');\n return strcmp($ta,$tb);\n }", "public function getSorters()\n\t{\n\t\t$fragments = [];\n\t\t$query = parse_url(self::$url, PHP_URL_QUERY);\n\t\tparse_str($query, $params);\n\n\t\tif (isset($params['sort']))\n\t\t{\n\t\t\t$params['sort'] = urlencode($params['sort']);\n\t\t\t$vars = explode('%2C', $params['sort']);\n\t\t\tforeach ($vars as $var)\n\t\t\t{\n\t\t\t\t$symbol = $var[0];\n\t\t\t\t$field = preg_replace(\"/[^a-z0-9_]/i\", null, $var);\n\t\t\t\t$fragments[$field] = ('+' === $symbol)?'ASC' :'DESC';\n\t\t\t}\n\n\t\t\treturn $fragments;\n\t\t}\n\n\t\treturn false;\n\t}", "public function SortedContentModules()\n {\n return ContentModule::get()\n ->innerJoin('Page_ContentModules', '\"ContentModule\".\"ID\" = \"Page_ContentModules\".\"ContentModuleID\"')\n ->where(\"\\\"Page_ContentModules\\\".\\\"PageID\\\" = '{$this->owner->ID}'\")\n ->sort('\"Sort\" ASC');\n }", "public function getPages()\n\t {\n\t \t$args = array(\n\t\t\t\t'sort_order' => 'asc',\n\t\t\t\t'sort_column' => 'post_title',\n\t\t\t\t'hierarchical' => 1,\n\t\t\t\t'child_of' => 0,\n\t\t\t\t'parent' => -1,\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_status' => 'publish'\n\t\t\t); \n\n\t\t\treturn get_pages($args);\n\t }", "function reorder_pages($arr)\n\t{\n\t\t$db = new db;\n\t\tforeach ($arr as $key=>$value )\n\t\t{\n\t\t\t$order = $key+1;\n\t\t\t$query_str = \"UPDATE pages SET `order` = $order WHERE id=$value\";\n\t\t\t$db->set_query_str($query_str);\n\t\t\t$db->db_query();\n\t\t\t\n\t\t\t$query_str = \"UPDATE pages_published SET `order` = $order WHERE id=$value\";\n\t\t\t$db->set_query_str($query_str);\n\t\t\t$db->db_query();\n\t\t}\n\t}", "public function getAscent() {}", "public function getAscent() {}", "public function getAscent() {}", "public function getAscent() {}", "public function getAscent() {}", "public function getOrderByAllowed(): string;", "function findAllOrdersDescPaginated();", "function get_links_list($order = 'name')\n {\n }", "public function findAllOrderByUrl()\n {\n return $this->createQueryBuilder('fp')\n ->orderBy('fp.url')\n ->getQuery()\n ->getResult();\n }", "public function getAllOrderedByName()\n {\n return $this->model->orderBy('name', 'asc')->get();\n }", "public function getElementSortOrder();", "public function indexAlphabeticallyAction()\n {\n $tags = $this->getTagRepository()->findBy([], ['name'=>'ASC']);\n\n return $this->respond([\n 'tags' => $tags\n ]);\n }", "function getPageFiles()\r\n{\r\n\t$directory = \"\";\r\n\t$pages = glob($directory . \"*.php\");\r\n\t//print each file name\r\n\tforeach ($pages as $page){\r\n\t\t$row[$page] = $page;\r\n\t}\r\n\treturn $row;\r\n}", "function get_abook_sort() {\n global $data_dir, $username;\n\n /* get sorting order */\n if(sqgetGlobalVar('abook_sort_order', $temp, SQ_GET)) {\n $abook_sort_order = (int) $temp;\n\n if ($abook_sort_order < 0 or $abook_sort_order > 8)\n $abook_sort_order=8;\n\n setPref($data_dir, $username, 'abook_sort_order', $abook_sort_order);\n } else {\n /* get previous sorting options. default to unsorted */\n $abook_sort_order = getPref($data_dir, $username, 'abook_sort_order', 8);\n }\n\n return $abook_sort_order;\n}", "function &MWX__get_pages($args = '') {\n global $wpdb;\n\n $defaults = array(\n 'child_of' => 0, 'sort_order' => 'ASC',\n 'sort_column' => 'post_title', 'hierarchical' => 1,\n 'exclude' => '', 'include' => '',\n 'meta_key' => '', 'meta_value' => '',\n 'authors' => '', 'parent' => -1, 'exclude_tree' => '',\n 'number' => '', 'offset' => 0, 'status' => 'publish'\n );\n\n $r = wp_parse_args( $args, $defaults );\n extract( $r, EXTR_SKIP );\n $number = (int) $number;\n $offset = (int) $offset;\n\n if ($status == 'all' || $status == 'All' || $status == 'ALL') $statusquery = '';\n else $statusquery = $wpdb->prepare(\" AND post_status = '\". $status .\"'\");\n\n\n $cache = array();\n $key = md5( serialize( compact(array_keys($defaults)) ) );\n if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) {\n if ( is_array($cache) && isset( $cache[ $key ] ) ) {\n $pages = apply_filters('get_pages', $cache[ $key ], $r );\n return $pages;\n }\n }\n\n if ( !is_array($cache) )\n $cache = array();\n\n $inclusions = '';\n if ( !empty($include) ) {\n $child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include\n $parent = -1;\n $exclude = '';\n $meta_key = '';\n $meta_value = '';\n $hierarchical = false;\n $incpages = preg_split('/[\\s,]+/',$include);\n if ( count($incpages) ) {\n foreach ( $incpages as $incpage ) {\n if (empty($inclusions))\n $inclusions = $wpdb->prepare(' AND ( ID = %d ', $incpage);\n else\n $inclusions .= $wpdb->prepare(' OR ID = %d ', $incpage);\n }\n }\n }\n if (!empty($inclusions))\n $inclusions .= ')';\n\n $exclusions = '';\n if ( !empty($exclude) ) {\n $expages = preg_split('/[\\s,]+/',$exclude);\n if ( count($expages) ) {\n foreach ( $expages as $expage ) {\n if (empty($exclusions))\n $exclusions = $wpdb->prepare(' AND ( ID <> %d ', $expage);\n else\n $exclusions .= $wpdb->prepare(' AND ID <> %d ', $expage);\n }\n }\n }\n if (!empty($exclusions))\n $exclusions .= ')';\n\n $author_query = '';\n if (!empty($authors)) {\n $post_authors = preg_split('/[\\s,]+/',$authors);\n\n if ( count($post_authors) ) {\n foreach ( $post_authors as $post_author ) {\n //Do we have an author id or an author login?\n if ( 0 == intval($post_author) ) {\n $post_author = get_userdatabylogin($post_author);\n if ( empty($post_author) )\n continue;\n if ( empty($post_author->ID) )\n continue;\n $post_author = $post_author->ID;\n }\n\n if ( '' == $author_query )\n $author_query = $wpdb->prepare(' post_author = %d ', $post_author);\n else\n $author_query .= $wpdb->prepare(' OR post_author = %d ', $post_author);\n }\n if ( '' != $author_query )\n $author_query = \" AND ($author_query)\";\n }\n }\n\n $join = '';\n $where = \"$exclusions $inclusions \";\n if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) {\n $join = \" LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )\";\n\n // meta_key and meta_value might be slashed\n $meta_key = stripslashes($meta_key);\n $meta_value = stripslashes($meta_value);\n if ( ! empty( $meta_key ) )\n $where .= $wpdb->prepare(\" AND $wpdb->postmeta.meta_key = %s\", $meta_key);\n if ( ! empty( $meta_value ) )\n $where .= $wpdb->prepare(\" AND $wpdb->postmeta.meta_value = %s\", $meta_value);\n\n }\n\n // here we call on the existing join condition used for posts\n $join = MWX__join ($join);\n\n if ( $parent >= 0 )\n $where .= $wpdb->prepare(' AND post_parent = %d ', $parent);\n\n // here we call on the existing where clause used for posts\n $where = MWX__where ($where);\n\n $query = \"SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page'$statusquery) $where \";\n $query .= $author_query;\n $query .= \" ORDER BY \" . $sort_column . \" \" . $sort_order ;\n\n if ( !empty($number) )\n $query .= ' LIMIT ' . $offset . ',' . $number;\n\n //echo $query;\n\n $pages = $wpdb->get_results($query);\n\n if ( empty($pages) ) {\n $pages = apply_filters('get_pages', array(), $r);\n return $pages;\n }\n\n // Update cache.\n update_page_cache($pages);\n\n if ( $child_of || $hierarchical )\n $pages = & get_page_children($child_of, $pages);\n\n if ( !empty($exclude_tree) ) {\n $exclude = array();\n\n $exclude = (int) $exclude_tree;\n $children = get_page_children($exclude, $pages);\n $excludes = array();\n foreach ( $children as $child )\n $excludes[] = $child->ID;\n $excludes[] = $exclude;\n $total = count($pages);\n for ( $i = 0; $i < $total; $i++ ) {\n if ( in_array($pages[$i]->ID, $excludes) )\n unset($pages[$i]);\n }\n }\n\n $cache[ $key ] = $pages;\n wp_cache_set( 'get_pages', $cache, 'posts' );\n\n $pages = apply_filters('get_pages', $pages, $r);\n\n return $pages;\n}", "public function titleList($page = NULL) {\n\t\tglobal $db;\n\t\t\n\t\t$qry = \"SELECT title FROM $this->table\";\n\t\t\n\t\tif (! empty ( $page )) {\n\t\t\t$qry .= \" WHERE page = '$page'\";\n\t\t}\n\t\t\n\t\tif ($this->orderby) {\n\t\t\t$qry .= \" ORDER BY $this->orderby\";\n\t\t}\n\t\t\n\t\t// echo $qry;\n\t\tif ($result = $db->query ( $qry )) {\n\t\t\twhile ( $row = $result->fetch_assoc () ) {\n\t\t\t\t$data [] = $row ['title'];\n\t\t\t}\n\t\t} \n\n\t\telse {\n\t\t\techo \"Fehler in titleList! \" . $db->error;\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "public function allpages() {\n $query = $this->db->get('page');\n return $query->result();\n }", "static function get_pages(){\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish'\";\n\t\t\n\t\treturn $wpdb->get_results($sql);\n\t}", "private static function findAllOrderedBy($value_id, $field) {\n $table = new Cms_Model_Db_Table_Application_Page();\n $select = $table->select(Zend_Db_Table::SELECT_WITH_FROM_PART);\n $select->setIntegrityCheck(false);\n $select->join('cms_application_page_block', 'cms_application_page_block.page_id = cms_application_page.page_id')\n ->join('cms_application_page_block_address', 'cms_application_page_block_address.value_id = cms_application_page_block.value_id')\n ->where(\"cms_application_page.value_id = ?\", $value_id)\n ->order(\"cms_application_page_block_address.\" . $field . \" asc\");\n return $table->fetchAll($select);\n }", "public static function getPageList($name) {\r\n\t$links = array();\r\n\tforeach ($this->getPages() AS $page) {\r\n\t $links[$page->getURL()] = $page->getTitle();\r\n\t}\r\n\treturn $links;\r\n }", "function getPageFiles() {\n $directory = \"\";\n $pages = glob($directory . \"*.php\");\n //print each file name\n foreach ($pages as $page) {\n $row[$page] = $page;\n }\n return $row;\n}", "function elm_admin_get_order_by_options() {\n\t$options = array(\n\t\t'asc' => __('ASC', 'elm'),\n\t\t'desc' => __('DESC', 'elm')\n\t);\n\t\n\treturn $options;\n}", "public function getPages()\n {\n list($page_id, $scope_pages, $scope_page_type) = array(\n $this['page_id'],\n $this['scope']['pages'],\n $this['scope']['page_type']\n );\n\n $result_pages = array();\n\n if ($scope_pages == 'this') {\n /**\n * Only current page\n */\n $result_pages[] = $page_id;\n } elseif (in_array($scope_pages, array('descendants', 'children'))) {\n /**\n * All descendants\n */\n $finder = fx::data('content')->descendantsOf($page_id);\n if ($scope_page_type) {\n $finder->where('type', $scope_page_type);\n }\n $result_pages = array_merge($result_pages, $finder->all()->getValues('id'));\n /**\n * With self page\n */\n if ($scope_pages == 'descendants') {\n $result_pages[] = $page_id;\n }\n }\n return array_unique($result_pages);\n }", "function getSort(){\n return 100;\n }", "function generate_page_links($user_search, $sort, $cur_page, $num_pages) {\n $page_links = '';\n\n // If this page is not the first page, generate the \"previous\" link\n if ($cur_page > 1) {\n $page_links .= '<a class=\"pagelinks\" href=\"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=' . $sort . '&page=' . ($cur_page - 1) . '\"><-Previous</a> ';\n }\n else {\n $page_links .= '<- ';\n }\n\n // Loop through the pages generating the page number links\n for ($i = 1; $i <= $num_pages; $i++) {\n if ($cur_page == $i) {\n $page_links .= ' ' . $i;\n }\n else {\n $page_links .= ' <a class=\"pagelinks\" href=\"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=' . $sort . '&page=' . $i . '\"> ' . $i . '</a>';\n }\n }\n\n // If this page is not the last page, generate the \"next\" link\n if ($cur_page < $num_pages) {\n $page_links .= ' <a class=\"pagelinks\"href=\"' . $_SERVER['PHP_SELF'] . '?usersearch=' . $user_search . '&sort=' . $sort . '&page=' . ($cur_page + 1) . '\">Next-></a>';\n }\n else {\n $page_links .= ' ->';\n }\n\n return $page_links;\n }", "public function getActivePages()\n {\n $qb = $this->getEntityManager()->createQueryBuilder();\n $qb->select(['p'])\n ->from('ArcmediaCmsBundle:ArcmediaPage', 'p')\n ->where('p.active = :state')\n ->orderBy('p.order', 'ASC')\n ->setParameter('state',true)\n ;\n\n return $qb->getQuery()->getResult();\n }", "function getPageFiles() // used in admin_pages.php\r\n\r\n{\r\n\r\n\t$directory = \"\";\r\n\r\n\t$pages = glob($directory . \"*.php\");\r\n\r\n\t//print each file name\r\n\r\n\tforeach ($pages as $page){\r\n\r\n\t\t$row[$page] = $page;\r\n\r\n\t}\r\n\r\n\treturn $row;\r\n\r\n}", "public function getPages() {\r\n\t$pages = array();\r\n\tforeach ($this->pages as $key => $page) {\r\n\t $page = $this->getPage($key);\r\n\t if ($page != FALSE)\r\n\t\t$pages[$key] = $page;\r\n\t}\r\n\treturn $pages;\r\n }", "public function stripOrderByForOrderByKeywordDataProvider() {}", "function shows_alphabetical( $orderby )\n{\n if( !is_admin() && is_post_type_archive( \"shows\" ) ){\n // alphabetical order by post title\n return \"post_title ASC\";\n }\n else return $orderby;\n}", "function getPagesLinks()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$lang =& JFactory::getLanguage();\n\n\t\t// Build the page navigation list\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\n\t\t$itemOverride = false;\n\t\t$listOverride = false;\n\n\t\t$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists($chromePath))\n\t\t{\n\t\t\trequire_once ($chromePath);\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) {\n\t\t\t\t$itemOverride = true;\n\t\t\t}\n\t\t\tif (function_exists('pagination_list_render')) {\n\t\t\t\t$listOverride = true;\n\t\t\t}\n\t\t}\n\n\t\t// Build the select list\n\t\tif ($data->all->base !== null) {\n\t\t\t$list['all']['active'] = true;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\n\t\t} else {\n\t\t\t$list['all']['active'] = false;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\n\t\t}\n\n\t\tif ($data->start->base !== null) {\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\n\t\t} else {\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\n\t\t}\n\t\tif ($data->previous->base !== null) {\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\n\t\t} else {\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array(); //make sure it exists\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null) {\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\n\t\t\t} else {\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null) {\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\n\t\t} else {\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\n\t\t}\n\t\tif ($data->end->base !== null) {\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\n\t\t} else {\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\n\t\t}\n\n\t\tif($this->total > $this->limit){\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\n\t\t}\n\t\telse{\n\t\t\treturn '';\n\t\t}\n\t}", "public function asort() {}", "public function orderby(){\n\n $rows = $this\n ->db\n ->order_by(\"title\", \"asc\")\n ->order_by(\"id\", \"random\")\n ->get(\"personel\")\n ->result();\n\n print_r($rows);\n\n }", "public function findPublicContributionsAlphabetically()\n {\n $queryBuilder = $this->createQueryBuilder('contribution')\n ->select('contribution')\n ->where('contribution.creditWanted = true')\n ->orderBy('contribution.identifier', 'ASC')\n ->addOrderBy('contribution.authProvider', 'ASC');\n\n return $queryBuilder\n ->getQuery()\n ->getResult();\n }", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "function eblex_findhrefs2($page)\r\n{\r\n $using = false;\r\n $href = \"\";\r\n $hrefs[0] = \"\";\r\n $hrefcount = 0;\r\n\r\n for ($i = 0;$i < strlen($page)-1;$i++) {\r\n $a = $page[$i] . $page[$i + 1];\r\n ///\tModification\t30/06/2008\tmVicenik\tFoliovision\r\n //if ($a == \"<a\") {\r\n if ($a == \"<a\" || $a == \"<A\") {\r\n ///\tend of modification\r\n $using = true;\r\n }\r\n\t\tif ($page[$i] == \">\") {\r\n $using = false;\r\n if ($href != \"\") {\r\n $hrefs[$hrefcount] = $href . \">\";\r\n $hrefcount++;\r\n } \r\n $href = \"\";\r\n } \r\n\r\n if ($using == true) {\r\n $href .= $page[$i];\r\n } \r\n } \r\n\r\n return $hrefs;\r\n}", "protected function getPrintPageIds()\n\t{\n\t\tif(is_array($_POST[\"wordr\"]))\n\t\t{\n\t\t\tasort($_POST[\"wordr\"]);\t\t\t\n\t\t\t$page_ids = array_keys($_POST[\"wordr\"]);\t\n\t\t}\n\t\t// single page\n\t\telse if((int)$_GET[\"wpg_id\"])\n\t\t{\n\t\t\t$page_ids = array((int)$_GET[\"wpg_id\"]);\n\t\t}\n\t\t\n\t\treturn $page_ids;\n\t}", "function array_alphabetsort() {\n $arguments = func_get_args();\n $arrays = $arguments[0]; \n for ($c = (count($arguments)-1); $c > 0; $c--) {\n if (in_array($arguments[$c], array(SORT_ASC , SORT_DESC))) {\n continue;\n }\n $compare = create_function('$a,$b','return strcasecmp($a[\"'.$arguments[$c].'\"], $b[\"'.$arguments[$c].'\"]);');\n usort($arrays, $compare);\n if ($arguments[$c+1] == SORT_DESC) {\n $arrays = array_reverse($arrays);\n }\n }\n return $arrays;\n}", "public function findAllActiveOrderedByName() {\r\n\t\t$query = $this->createQueryBuilder('a')\r\n\t\t\t->where('a.isActive = :active')\r\n\t\t\t->orderBy('a.firstname', 'ASC')\r\n\t\t\t->orderBy('a.lastname', 'ASC')\r\n\t\t\t->setParameter('active', true)\r\n\t\t\t->getQuery();\r\n\t\t\r\n\t\treturn $query->getResult();\r\n\t}", "function getSort(){\n return 999;\n }", "function getSort(){\n return 999;\n }", "public function getUrlOptions()\n {\n $allPages = Page::sortBy('baseFileName')->lists('title', 'baseFileName');\n $pages = array(\n '' => 'No page link'\n );\n foreach ($allPages as $key => $value) {\n $pages[$key] = \"$key\";\n }\n return $pages;\n }", "protected function get_sort_order() {\n return 111;\n }", "function generate_page_links($user_search, $sort, $cur_page, $num_pages) {\n $page_links = '<p>';\n\n // Generate \"previous page\" link if page is not the first page\n if ($cur_page > 1) {\n // Generate back arrow as an HTML link\n $page_links .= '<a href=\"' . $_SERVER['PHP_SELF']\n . '?usersearch=' . $user_search . '&sort=' . $sort\n . '&page=' . ($cur_page - 1) . '\"><-</a> ';\n } else {\n // Generate back arrow as a non-HTML link\n $page_links .= '<- ';\n }\n\n // Generate page links for each individual page\n for ($index = 1; $index <= $num_pages; $index++) {\n // Generate clickable link if page is not current page\n if ($index == $cur_page) {\n $page_links .= ' ' . $index;\n } else {\n $page_links .= '<a href=\"' . $_SERVER['PHP_SELF']\n . '?usersearch=' . $user_search . '&sort=' . $sort\n . '&page=' . $index . '\"> ' . $index . '</a> ';\n }\n }\n\n // Generate clickable link if current page is not the last page\n if ($cur_page < $num_pages) {\n // Generate back arrow as an HTML link\n $page_links .= '<a href=\"' . $_SERVER['PHP_SELF']\n . '?usersearch=' . $user_search . '&sort=' . $sort\n . '&page=' . ($cur_page + 1) . '\"> -></a> ';\n } else {\n // Generate back arrow as a non-HTML link\n $page_links .= ' ->';\n }\n\n $page_links .= '</p>';\n\n return $page_links;\n }", "private function pageList() {\n //get pager range\n $this->getPagerRange();\n\n //loop specified ranged pager list\n\t\t//there is no link for current page number\n for ($i = $this->minPager; $i <= $this->maxPager; $i++) {\n if ($i == $this->currentPage) {\n print '<li class=\"current-page\">' . $i . '</li>';\n } else {\n print '<li><a href=\"' . $this->url . '&page=' . $i . '\">' . $i . '</a></li>';\n }\n }\n }", "private function page()\n {\n $records = array();\n $uid = $this->pObj->zz_getMaxDbUid('sys_template');\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrg($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalCaddy($uid);\n\n // #61838, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCal($uid);\n\n // #61826, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalEvents($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalLocations($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocuments($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocumentsCaddy($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgHeadquarters($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobs($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobsJobsApply($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgNews($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgService($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaff($uid);\n\n // #67210, 150531, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaffVcard($uid);\n\n return $records;\n }", "public function getPageFolders();", "function issuu_api_folder_result_orders() {\n $result_orders = &drupal_static(__FUNCTION__);\n // Check if the array is not already initialized.\n if (!isset($result_orders)) {\n $result_orders = array(\n 'asc' => t('Ascending'),\n 'desc' => t('Descending'),\n );\n }\n return $result_orders;\n}" ]
[ "0.6904093", "0.64596665", "0.6014721", "0.5966445", "0.5941344", "0.587833", "0.58601964", "0.5849311", "0.58485967", "0.5835674", "0.58120817", "0.57708496", "0.5765892", "0.5759099", "0.5735826", "0.5709691", "0.5696208", "0.56101966", "0.5606863", "0.5590436", "0.5586214", "0.5583526", "0.55502594", "0.5549146", "0.5522062", "0.54848164", "0.54715735", "0.5466272", "0.5456173", "0.5453608", "0.5438963", "0.5436241", "0.543337", "0.5431785", "0.5429572", "0.54275984", "0.54250926", "0.54250926", "0.54250926", "0.5421189", "0.5416944", "0.54169065", "0.54103404", "0.54050654", "0.5396602", "0.53933495", "0.5391665", "0.5386466", "0.5384054", "0.5380246", "0.5376022", "0.5373683", "0.5355481", "0.5345969", "0.53448325", "0.53448325", "0.53448325", "0.53448325", "0.5323763", "0.53206384", "0.5298515", "0.52973604", "0.52840924", "0.52768046", "0.527444", "0.52662456", "0.5265701", "0.52637124", "0.5258278", "0.5252352", "0.52459437", "0.5229149", "0.52202475", "0.5213111", "0.5208221", "0.520811", "0.5198762", "0.5192187", "0.5192107", "0.51853406", "0.51850885", "0.5173942", "0.51680934", "0.5165311", "0.5157239", "0.5151563", "0.5142417", "0.51384085", "0.51368463", "0.5132059", "0.51317394", "0.51312566", "0.5112947", "0.5112947", "0.51107395", "0.5104282", "0.5104025", "0.5097784", "0.50963724", "0.50910836", "0.50833505" ]
0.0
-1
Return [title => url] pairs of children pages
function getChildrenForMenu($pageSlug) { $page = $this->findBySlug($pageSlug); $pages = $this->children($page[$this->name]['id']); if (empty($pages)) { return null; } $titles = Set::extract($pages, "{n}.{$this->name}.title"); $urls = Set::extract($pages, "{n}.{$this->name}.url"); return array_combine($titles, $urls); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function children_of_parent_page($parent_title){\n $my_wp_query = new WP_Query();\n $all_wp_pages = $my_wp_query->query(array('post_type' => 'page', 'order' => 'ASC', 'orderby' => 'menu_order', 'posts_per_page' => -1));\n $parent_page = get_page_by_title($parent_title);\n $page_children = get_page_children($parent_page->ID, $all_wp_pages);\n return $page_children; //outputs an array of child page objects\n}", "function get_pages($title = false, $indent = true) {\r\n $wp_pages = get_pages('sort_column=menu_order');\r\n $page_list = array();\r\n if ($title) $page_list[] = $title;\r\n foreach ($wp_pages as $page) {\r\n $prefix = '';\r\n // show indented child pages?\r\n if ($indent) {\r\n $has_parent = $page->post_parent;\r\n while($has_parent) {\r\n $prefix .= ' - ';\r\n $next_page = get_page($has_parent);\r\n $has_parent = $next_page->post_parent;\r\n }\r\n }\r\n // add to page list array array\r\n $page_list[$page->ID] = $prefix . $page->post_title;\r\n }\r\n return $page_list;\r\n }", "function get_child_pages_by_parent_title($pageId,$limit)\n{\n // needed to use $post\n global $post;\n // used to store the result\n $pages = array();\n\n // What to select\n $args = array(\n 'post_type' => 'page',\n 'post_parent' => $pageId,\n 'posts_per_page' => $limit\n );\n $the_query = new WP_Query( $args );\n\n while ( $the_query->have_posts() ) {\n $the_query->the_post();\n $pages[] = $post;\n }\n wp_reset_postdata();\n return $pages;\n}", "public function getChildPages(): array\n {\n return $this->childPages;\n }", "public function getPages();", "public function get_page_slugs()\n\t{\n\t\t// assign the slugs to the $options...\n\t\t$options = $this->db->select('title, url_title')->get($this->_table['pages'])->result();\n\n\t\t// there's a couple outside of normal possibilities in the db\n\t\t// so I add them here.\n\t\t$return[null] = lang('nav_form_choose_page');\n\t\t$return['pages/'] = lang('pages_index_controller_label');\n\n\t\t// foreach through them and add the url_title as key\n\t\t// and title as option text.\n\t\tforeach ($options as $opt)\n\t\t{\n\t\t\t$return[$opt->url_title] = $opt->title;\n\n\t\t}\n\n\t\t// return the obj\n\t\treturn $return;\n\t}", "public function children() {\n\n if(isset($this->cache['children'])) return $this->cache['children'];\n\n $this->cache['children'] = new Children($this);\n\n $inventory = $this->inventory();\n\n // with page models\n if(!empty(static::$models)) {\n foreach($inventory['children'] as $dirname) {\n $child = new Page($this, $dirname);\n // let's create a model if one is defined\n if(isset(static::$models[$child->intendedTemplate()])) {\n $model = static::$models[$child->intendedTemplate()];\n $child = new $model($this, $dirname);\n }\n $this->cache['children']->data[$child->id()] = $child;\n }\n // without page models\n } else {\n foreach($inventory['children'] as $dirname) {\n $child = new Page($this, $dirname);\n $this->cache['children']->data[$child->id()] = $child;\n }\n }\n\n return $this->cache['children'];\n\n }", "function navegacao_paginas_internas() { \n\n // creditos: http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-child-pages-for-a-parent-page-in-wordpress/\n \n global $post; \n // $pai = wp_get_post_parent_id( $post->ID );\n $parent_post = wp_get_post_parent_id($post->ID);\n $parent_name = get_the_title($parent_post);\n $parent_link = get_the_permalink($parent_post);\n \n if ( is_page() && $post->post_parent )\n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0&depth=1' );\n else\n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0&depth=1' );\n\n if ( $childpages ) {\n $string = '<div class=\"navegacao-interna\">Mais sobre <a href=\"'.$parent_link.'\">'.$parent_name.'</a>:&nbsp; '.$childpages.'</div>';\n }\n \n return $string;\n \n}", "function ph_display_page_children($post)\n{\n\n $html = '';\n if ($post) {\n $args = array(\n 'post_status' => 'publish',\n 'post_type' => 'page',\n 'post_parent' => $post->ID,\n 'orderby' => 'menu_order',\n 'order' => 'ASC',\n 'nopaging' => true,\n );\n\n query_posts($args);\n\n if (have_posts()) {\n $html = '<ul class=\"page-children ph-page-children\">';\n while (have_posts()) {\n the_post();\n $html .= '<li>'.get_the_title().' · '.get_the_excerpt().'</li>';\n }\n $html .= '</ul>';\n }\n\n wp_reset_query();\n }\n\n return $html;\n}", "private function childPages($list,$id,$space = '-'){\n\t\t$db = Zend_Registry::get('db');\n\t\t$select = $db->select()\n\t\t\t\t\t->from('pages')\n\t\t\t\t\t->where('parent_id = ?',$id)\n\t\t\t\t\t->order('pgsort DESC')\n\t\t\t\t\t->order('title ASC');\n\t\t$results = $db->fetchAll($select);\n\t\tforeach($results as $cur){\n\t\t\t$list[$cur[id]] = $space.$cur[title];\n\t\t\t$list = $this->childPages($list,$cur[id],$space.'-');\n\t\t}\n\treturn $list;\n\t}", "public function getPages() {}", "public function pagesFlatView()\n {\n $pages = (new PageManager)->select(['id'])->execute()->rows();\n\n foreach ($pages as &$p) {\n $p['title'] = PageManager::resolvePageTitle($p['id']);\n }\n\n return $pages;\n }", "function wpb_list_child_pages() { \n \nglobal $post; \n \nif ( is_page() && $post->post_parent )\n \n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );\nelse\n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );\n \nif ( $childpages ) {\n \n $string = '<ul>' . $childpages . '</ul>';\n}\n \nreturn $string;\n \n}", "function _get_breadcrumbs($starting_page, $container = array())\n{\n\n //make sure you're working with an object\n $sp = (!is_object($starting_page)) ? get_post($starting_page) : $starting_page;\n\n //make sure to insert starting page only once\n if (!in_array(get_permalink($sp->ID), $container)) {\n $container[get_permalink($sp->ID)] = get_the_title($sp->ID);\n }\n\n //if parent, recursion!\n if ($sp->post_parent > 0) {\n $container[get_permalink($sp->post_parent)] = get_the_title($sp->post_parent);\n $container = _get_breadcrumbs($sp->post_parent, $container);\n }\n\n return $container;\n}", "function findPageUrls();", "function wv_wp_page_list() {\n\n $arglist = array(\n 'sort_order' => 'ASC',\n 'sort_column' => 'post_title',\n 'hierarchical' => 1,\n 'post_type' => 'page',\n 'post_status' => 'publish'\n );\n $mypages = get_pages($arglist);\n return $mypages;\n }", "function get_page_children($page_id, $pages)\n {\n }", "public function getPages()\n\t {\n\t \t$args = array(\n\t\t\t\t'sort_order' => 'asc',\n\t\t\t\t'sort_column' => 'post_title',\n\t\t\t\t'hierarchical' => 1,\n\t\t\t\t'child_of' => 0,\n\t\t\t\t'parent' => -1,\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_status' => 'publish'\n\t\t\t); \n\n\t\t\treturn get_pages($args);\n\t }", "function getPages() {\r\n\tglobal $S;\r\n\tif (!is_array($S->arbo)) {\r\n\t\trequire_once('../lib/class/class_arbo.php');\r\n\t\t$S =& new ARBO();\r\n\t\t$S->fields = array('id', 'pid', 'type_id', 'titre_fr');\r\n\t\t$S->buildArbo();\r\n\t}\r\n\t$options = array();\r\n\tforeach($S->arbo as $rid=>$tmp) {\r\n\t\t$options[urlencode($S->arbo[$rid]['url'])] = $S->arbo[$rid]['titre_fr'].' (#'.$rid.')';\r\n\t}\r\n\treturn $options;\r\n}", "public function get_instance_pages() {\n\n\t\t\t$base_path = $this->component_path( 'pages/' );\n\n\t\t\treturn array(\n\t\t\t\t'Jet_Engine_Relations_Page_List' => $base_path . 'list.php',\n\t\t\t\t'Jet_Engine_Relations_Page_Edit' => $base_path . 'edit.php',\n\t\t\t);\n\t\t}", "private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}", "protected function _getPages(){\n $pages = array(\n array(\n 'main' => array(\n 'label' => 'Dashboard',\n 'controller' => 'dashboard',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Summary',\n 'controller' => 'dashboard',\n 'action' => 'index',\n ),\n array(\n 'label' => 'Profile',\n 'controller' => 'profile',\n 'action' => 'index',\n ),\n \tarray(\n \t\t'label' => 'Phpinfo',\n \t\t'controller' => 'system',\n \t\t'action' => 'phpinfo',\n \t),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'System',\n 'controller' => 'system',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Groups',\n 'controller' => 'groups',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Users',\n 'controller' => 'users',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Privileges',\n 'controller' => 'privileges',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Flags',\n 'controller' => 'flags',\n 'action' => 'index',\n 'scope' => '*'\n ),\n ),\n\n ),\n array(\n 'main' => array(\n 'label' => 'Parameters',\n 'controller' => 'portails',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Portails',\n 'controller' => 'portails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'PortailUrl',\n 'controller' => 'portailurl',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Paramètres',\n 'controller' => 'params',\n 'action' => 'index',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Mails',\n 'controller' => 'mails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Exporter',\n 'controller' => 'params',\n 'action' => 'exportparam',\n //'scope' => 'export'\n ),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Tools',\n 'controller' => 'tools',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Generate Models',\n 'controller' => 'generate',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Clear Cache',\n 'controller' => 'tools',\n 'action' => 'cleancache',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Bdd',\n 'controller' => 'tools',\n 'action' => 'adminer',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Backups',\n 'controller' => 'backup',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Backup Bdd',\n 'controller' => 'backup',\n 'action' => 'bdd',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Backup Files',\n 'controller' => 'backup',\n 'action' => 'files',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Benchmark',\n 'controller' => 'benchmark',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Benchmark 1',\n 'controller' => 'benchmark',\n 'action' => 'benchmark1',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Benchmark 2',\n 'controller' => 'benchmark',\n 'action' => 'benchmark2',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Examples',\n 'controller' => 'system',\n 'action' => 'example'\n ),\n 'pages' => array(\n array(\n 'label' => 'Theme',\n 'controller' => 'system',\n 'action' => 'example',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Errors',\n 'controller' => 'system',\n 'action' => 'example-errors',\n //'scope' => '*'\n ),\n\n ),\n\n ),\n );\n\n return $pages;\n }", "function ajan_core_get_directory_pages() {\n\tglobal $wpdb;\n\n\t// Look in cache first\n\t$pages = wp_cache_get( 'directory_pages', 'bp' );\n\n\tif ( false === $pages ) {\n\n\t\t// Set pages as standard class\n\t\t$pages = new stdClass;\n\n\t\t// Get pages and IDs\n\t\t$page_ids = ajan_core_get_directory_page_ids();\n\t\tif ( !empty( $page_ids ) ) {\n\n\t\t\t// Always get page data from the root blog, except on multiblog mode, when it comes\n\t\t\t// from the current blog\n\t\t\t$posts_table_name = ajan_is_multiblog_mode() ? $wpdb->posts : $wpdb->get_blog_prefix( ajan_get_root_blog_id() ) . 'posts';\n\t\t\t$page_ids_sql = implode( ',', wp_parse_id_list( $page_ids ) );\n\t\t\t$page_names = $wpdb->get_results( \"SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' \" );\n\n\t\t\tforeach ( (array) $page_ids as $component_id => $page_id ) {\n\t\t\t\tforeach ( (array) $page_names as $page_name ) {\n\t\t\t\t\tif ( $page_name->ID == $page_id ) {\n\t\t\t\t\t\tif ( !isset( $pages->{$component_id} ) || !is_object( $pages->{$component_id} ) ) {\n\t\t\t\t\t\t\t$pages->{$component_id} = new stdClass;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pages->{$component_id}->name = $page_name->post_name;\n\t\t\t\t\t\t$pages->{$component_id}->id = $page_name->ID;\n\t\t\t\t\t\t$pages->{$component_id}->title = $page_name->post_title;\n\t\t\t\t\t\t$slug[] = $page_name->post_name;\n\n\t\t\t\t\t\t// Get the slug\n\t\t\t\t\t\twhile ( $page_name->post_parent != 0 ) {\n\t\t\t\t\t\t\t$parent = $wpdb->get_results( $wpdb->prepare( \"SELECT post_name, post_parent FROM {$posts_table_name} WHERE ID = %d\", $page_name->post_parent ) );\n\t\t\t\t\t\t\t$slug[] = $parent[0]->post_name;\n\t\t\t\t\t\t\t$page_name->post_parent = $parent[0]->post_parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pages->{$component_id}->slug = implode( '/', array_reverse( (array) $slug ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tunset( $slug );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twp_cache_set( 'directory_pages', $pages, 'bp' );\n\t}\n\n\treturn apply_filters( 'ajan_core_get_directory_pages', $pages );\n}", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "function fetch_children($obj = null){\n\t$parent = ($obj == null) ? get_parent() : $obj;\n\t$id = ($parent->post_parent) ? $parent->post_parent : $parent->ID;\n\n\t// Fetch all child pages of the parent OR siblings:\n\treturn get_pages(\"hierarchical=0&parent=\".$id.\"&child_of=\".$id);\n}", "function get_child_pages($id = NULL) {\n\n\tif ( empty($id) ) {\n\t\t$id = get_the_ID();\n\t}\n\n\treturn new WP_Query(\n\t\tarray(\n\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t'post_parent'\t\t=> $id,\n\t\t\t'posts_per_page'\t=> -1\n\t\t)\n\t);\n\n}", "private function get_node_children(midgard_page $node)\n {\n $children = array();\n $mc = midgard_page::new_collector('up', $node->id);\n $mc->set_key_property('name');\n $mc->add_value_property('title');\n $mc->execute(); \n $pages = $mc->list_keys();\n foreach ($pages as $name => $array)\n {\n if (empty($name))\n {\n continue;\n }\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}{$name}/\", // FIXME: dispatcher::generate_url\n 'title' => $mc->get_subkey($name, 'title'),\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n }\n \n if ($_MIDCOM->context->page->id == $_MIDCOM->context->host->root)\n {\n // Additional \"special\" URLs\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}__snippets/\", // FIXME: dispatcher::generate_url\n 'title' => 'Code Snippets',\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}__styles/\", // FIXME: dispatcher::generate_url\n 'title' => 'Style Templates',\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n }\n\n return $children;\n }", "public function getPageFolders();", "abstract public function get_url_list( $page_num, $object_subtype = '' );", "public function children()\n {\n if (is_a($this->children, 'Kirby\\Cms\\Pages') === true) {\n return $this->children;\n }\n\n return $this->children = Pages::factory($this->inventory()['children'], $this);\n }", "static function get_pages(){\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish'\";\n\t\t\n\t\treturn $wpdb->get_results($sql);\n\t}", "function build_pages_tree($pages) {\n\t// Create an array with the path as the key and the title as the value.\n\t$paths = array();\n\tforeach ($pages as $page) {\n\t\t// Escape any slashes in the paths or title.\n\t\tforeach ($page['path'] as $key => $path) {\n\t\t\t$page['path'][$key] = str_replace('/', '%2F', $path);\n\t\t}\n\t\t$page['title'] = str_replace('/', '%2F', $page['title']);\n\t\t$path = implode('/', $page['path']);\n\t\tif (!empty($path)) {\n\t\t\t$path .= '/';\n\t\t}\n\t\t$paths[$path . $page['title']] = $page['title'];\n\t}\n\n\t// Create nested tree array for the pages.\n\t$pages_tree = array();\n\tforeach ($paths as $path => $title) {\n\t\t$list = explode('/', trim($path, '/'));\n\t\t$last_dir = &$pages_tree;\n\t\tforeach ($list as $dir) {\n\t\t\t// Unescape slashes in paths.\n\t\t\t$dir = str_replace('%2F', '/', $dir);\n\t\t\t$last_dir =& $last_dir[$dir];\n\t\t}\n\t\t// Unescape slashes in titles.\n\t\t$last_dir['title'] = str_replace('%2F', '/', $title);\n\t}\n\n\treturn $pages_tree;\n}", "public function pages()\n {\n return $this->morphedByMany('App\\Page', 'imageable');\n }", "public function get_children();", "public abstract function get_url_list($page_num, $object_subtype = '');", "public function getPageUris();", "public function getUrlOptions()\n {\n $allPages = Page::sortBy('baseFileName')->lists('title', 'baseFileName');\n $pages = array(\n '' => 'No page link'\n );\n foreach ($allPages as $key => $value) {\n $pages[$key] = \"$key\";\n }\n return $pages;\n }", "public function children()\n\t{\n\t\tif (is_null($this->children)) {\n\t\t\t$this->children = \\App::make('Illuminate\\Database\\Eloquent\\Collection');\n\t\t\tforeach (\\PagesRepository::retrieveChildren($this->id) as $child) {\n\t\t\t\t$this->children->add(\\App::make('Monal\\Pages\\Models\\FrontendPage', $child));\n\t\t\t}\n\t\t}\n\t\treturn $this->children;\n\t}", "function echo_page_children_submenu($children) {\n if ($children) {\n echo '<ul class=\"submenu\">';\n foreach($children as $child) {\n echo '<li><a href=\"' . get_the_permalink($child->ID) . '\">' . $child->post_title . '</a></li>';\n }\n echo '</ul>';\n }\n}", "public function generateContent()\n {\n parent::generateContent();\n $pathArray = $this->currentPageStrategy->getCurrentPagePath();\n $titleString = '';\n foreach ($pathArray as $page) {\n /** @var $page Page */\n\n $titleString .= ' - ' . (($t = $page->getTitle()) == '_404' ? 'Siden blev ikke fundet' : $t);\n }\n\n return $titleString;\n }", "private function getPages($parent = 0)\n\t{\n\t\t//Get the pages\n\t\t$data = Database::execProcedure('GetNavigation', array('page' => $parent));\n\t\treturn $data;\n\t}", "public function provideTestLinks() {\n\t\t$extraPages = [\n\t\t\t'Elephant Page' => 'Content'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|Elephant_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant_Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page|Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page|elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to redirect to content page without display title\n\t\t$extraPages = [\n\t\t\t'Elephant Page' => 'Content',\n\t\t\t'Redirect To Elephant Page' => '#REDIRECT [[Elephant Page]]'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|Redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|Redirect_To_Elephant_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page|Redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page|redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|redirect To Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to user page without display title\n\t\t$extraPages = [\n\t\t\t'User:Elephant Page' => 'Content'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|User:Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|User:Elephant_Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant_Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page|User:Elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:Elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page|User:elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|User:elephant Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:elephant Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:elephant Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to content page with display title\n\t\t$extraPages = [\n\t\t\t'Dingo Page' => '{{DISPLAYTITLE:Zebra}}'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|Dingo_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page|Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page|dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to redirect to content page with display title\n\t\t$extraPages = [\n\t\t\t'Dingo Page' => '{{DISPLAYTITLE:Zebra}}',\n\t\t\t'Redirect To Dingo Page' => '#REDIRECT [[Dingo Page]]'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|Redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|Redirect_To_Dingo_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page|Redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page|redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|redirect To Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'redirect To Dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[Redirect To Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Redirect to page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[redirect To Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// link to user page with display title\n\t\t$extraPages = [\n\t\t\t'User:Dingo Page' => '{{DISPLAYTITLE:Zebra}}'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lower case page title, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, fragment, no link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page#Fragment]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|User:Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, page name with underscores link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|User:Dingo_Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page|User:Dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page|User:dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|User:dingo Page]]',\n\t\t\t$extraPages,\n\t\t\t'User:dingo Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:Dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Link to user page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[User:dingo Page|Coyote]]',\n\t\t\t$extraPages,\n\t\t\t'Coyote'\n\t\t];\n\t}", "public function getPageUrl($page_title) {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\n\t\t\t// Get parent id of subjects\n\t\t\t$parent_id = '';\n\t\t\t$query = \"SELECT structure_parent from webmatrix_structure where structure_id = \".$this->subjects_structure_id;\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$parent_id = $sql->Record['structure_parent'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get parent url of subjects\n\t\t\tif ($parent_id != '') {\n\t\t\t\t$query = \"SELECT structure_url FROM webmatrix_structure WHERE structure_id = $parent_id\";\n\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$parent_url = $sql->Record['structure_url'] . \"/\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get url of subjects page\n\t\t\t$subjects_url = '';\n\t\t\t$query = \"SELECT structure_url FROM webmatrix_structure WHERE structure_id = \".$this->subjects_structure_id;\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$subjects_url = $sql->Record['structure_url'] . \"/\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get url of given subject page\n\t\t\t$pagename_url = '';\n\t\t\t$page_title = mysql_real_escape_string($page_title, $sql->Link_ID);\n\t\t\t$query = \"SELECT structure_url FROM webmatrix_structure WHERE structure_parent = \".$this->subjects_structure_id.\" and structure_text = '$page_title'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$pagename_url = $sql->Record['structure_url'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Build page url\n\t\t\t$page_url = \"/\" . $parent_url . $subjects_url . $pagename_url;\n\t\t\t$page_url = ($pagename_url != '') ? $page_url : '';\n\n\t\t\treturn $page_url;\n\n\t\t}", "function MWX__list_pages($args = '')\n{\n $defaults = array(\n 'depth' => 0, 'show_date' => '',\n 'date_format' => get_option('date_format'),\n 'child_of' => 0, 'exclude' => '',\n 'title_li' => __('Pages'), 'echo' => 1,\n 'authors' => '', 'sort_column' => 'menu_order, post_title',\n 'link_before' => '', 'link_after' => ''\n );\n\n $r = wp_parse_args( $args, $defaults );\n extract( $r, EXTR_SKIP );\n\n $output = '';\n $current_page = 0;\n\n // sanitize, mostly to keep spaces out\n $r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']);\n\n // Allow plugins to filter an array of excluded pages\n $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));\n\n // Query pages.\n $r['hierarchical'] = 0;\n $pages = MWX__get_pages($r);\n\n if ( !empty($pages) ) {\n if ( $r['title_li'] )\n $output .= '<li class=\"pagenav\">' . $r['title_li'] . '<ul>';\n\n global $wp_query;\n if ( is_page() || is_attachment() || $wp_query->is_posts_page )\n $current_page = $wp_query->get_queried_object_id();\n $output .= walk_page_tree($pages, $r['depth'], $current_page, $r);\n\n if ( $r['title_li'] )\n $output .= '</ul></li>';\n }\n\n $output = apply_filters('wp_list_pages', $output);\n\n if ( $r['echo'] )\n echo $output;\n else\n return $output;\n}", "function child_page_title($content) {\r\nglobal $post;\r\n\tif ( is_archive() ) {\r\n\t\t$destinationstree = destinationstaxtree();\r\n\t\t$dest = $destinationstree['dest'];\r\n\t\t$reg = $destinationstree['reg'];\r\n\t\t$top = $destinationstree['top'];\r\n\t\t$depth = $destinationstree['depth'];\r\n\t}\r\n\r\n\t// nothing for destination report archives | article archives | offer archives | insidertrip archives | magazine archive | press archive | career archive | search\r\n\tif (\r\n\t\t\t( is_archive() && $reg && $depth == 1 )\r\n\t\t\t|| ( is_archive() && $dest && $depth == 2 && get_query_var('post_type') !== 'itinerary' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'hotel' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'restaurant' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'shop' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'activity' )\r\n//\t\t\t|| ( is_archive() && get_query_var('post_type') == 'itinerary' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'library' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'article' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'offer' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'insidertrip' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'magazine' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'press' )\r\n\t\t\t|| ( is_archive() && get_query_var('post_type') == 'career' )\r\n\t\t\t|| is_search()\r\n\t\t\t|| is_author()\r\n\t\t)\r\n\t {\r\n\r\n\t\t$content = '';\r\n\r\n\t} else if ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\t// title only for logged in user\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\t$content = '';\r\n\r\n\t\t\twhile ( have_posts() ) {\r\n\t\t\t\tthe_post();\r\n\t\t\t\t// !!ALERT!! This will only display the last one. Is this what we want??\r\n\t\t\t\t$content = '<h2>'.get_the_title().'</h2>'.\"\\n\";\r\n\t\t\t\t$content .= '<p>'.get_the_author_meta( 'display_name', $post->post_author ).' | '.get_the_time( get_option('date_format') ).'</p>'.\"\\n\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$content = '<h2>'.__('Members-Only Content','indagare').'</h2>'.\"\\n\";\r\n\t\t}\r\n\t}\r\n\r\n\treturn $content;\r\n}", "public function createNestedPagesAndCopyLiveParentPage() {}", "public function get_admin_pages() {\n\t\treturn apply_filters( 'pslug_admin_pages_object', array(\n\t\t\t'settings' => array(\n\t\t\t\t'general',\n\t\t\t),\n\t\t) );\n\t}", "function five_get_ancestors(){\n\t\t\n\t\tglobal $wpdb;\n\t\t$result = $wpdb->get_results(\"SELECT ID, post_title, guid FROM $wpdb->posts WHERE post_type = 'page' AND post_parent = 0 AND post_status = 'publish'\");\n\t\treturn $result;\n\t\t}", "function _page_traverse_name($page_id, &$children, &$result)\n {\n }", "public function getChild()\n {\n return $this->hasMany(Pages::className(), ['parent_id' => 'id']);\n }", "public function getWikiPages()\n {\n if ($this->request->get('explore')) {\n // Fetch the pages tree to a specified page\n return $this->explorePagesTo($this->request->get('page'));\n }\n\n if ($this->request->get('wiki')) {\n // Get the root pages of a wiki\n return $this->getWikiRootPages($this->request->get('wiki'));\n }\n\n // Get the child pages of a page\n return $this->getPageChilds($this->request->get('page'));\n }", "public static function getPageList($name) {\r\n\t$links = array();\r\n\tforeach ($this->getPages() AS $page) {\r\n\t $links[$page->getURL()] = $page->getTitle();\r\n\t}\r\n\treturn $links;\r\n }", "function pagesDirectory($level) {\n\t\tif ($level == \"0\") {\n\t\t\t$pagesGrabber = query(\"SELECT * FROM `pages` WHERE `parentPage` = '{$level}' AND `visible` = 'on' AND `published` != '0' ORDER BY `position` ASC\", \"raw\");\n\t\t} else {\n\t\t\t$pagesGrabber = query(\"SELECT * FROM `pages` WHERE `parentPage` = '{$level}' AND `visible` = 'on' AND `published` != '0' ORDER BY `subPosition` ASC\", \"raw\");\n\t\t}\n\t\t\n\t\twhile ($pages = mysql_fetch_array($pagesGrabber)) {\n\t\t\tif (isset($_GET['id'])) {\n\t\t\t $parentPage = query(\"SELECT * FROM `pages` WHERE `id` = '{$_GET['id']}'\");\n\t\t\t}\n\t\t\t\n\t\t\t$title = unserialize($pages['content' . $pages['display']]);\n\t\t\t\n\t\t\techo level($pages['parentPage']);\n\t\t\t\n\t\t\tif ($pages['position'] == \"1\") {\n\t\t\t\techo \"<span class=\\\"homePage\\\">\";\n\t\t\t} else {\n\t\t\t\techo \"<span class=\\\"page\\\">\";\n\t\t\t}\n\t\t\t \n\t\t\techo \"<a href=\\\"index.php?page=\" . $pages['id'] . \"\\\"\";\n\t\t\t\n\t\t\techo \">\" . $title['title'] . \"</a>\";\n\t\t\t\n\t\t\techo \"</span><br /><br />\";\n\t\t\t\n\t\t\tif (exist(\"pages\", \"parentPage\", $pages['id'])) {\n\t\t\t\tpagesDirectory($pages['id']);\n\t\t\t}\n\t\t}\n\t}", "public function getPageUrlOptions()\n {\n $currentTheme = Theme::getEditTheme();\n $allThemePages = Page::listInTheme($currentTheme, true);\n $options = [];\n foreach ($allThemePages as $p){\n $options['url='.$p->url.'&type=cms_pages'] = $p->title;\n }\n\n $tree = StaticPageClass::buildMenuTree($currentTheme); \n foreach ($tree as $key => $page){\n if(isset($page['title']) && isset($page['url'])){\n $options['url='.$page['url'].'&type=pages_plugin'] = $page['title'];\n }\n }\n return $options;\n }", "public function getLinksForMenu() : array\n {\n return $this->db->query(\"SELECT page_title, page_link FROM pages\");\n }", "function frg_list_pages_with_intro( $args ) {\n\n global $post;\n\n if ( $post->post_parent ) {\n $grandfather = array_reverse( get_post_ancestors( $post->ID ) )[0];\n $is_current_page_item = false;\n } else {\n $grandfather = $post->ID;\n $is_current_page_item = true;\n }\n\n ?><li class=\"page_item page-item-<?php echo $grandfather; ?><?php if ($is_current_page_item) echo \" current_page_item\"; ?>\">\n <a href=\"<?php echo the_permalink($grandfather); ?>\"><?php echo get_the_title($grandfather) ?> Intro</a>\n </li><?php\n\n wp_list_pages( $args );\n}", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "public function pages()\n {\n return $this->hasMany(Page::class, 'wiki_id', 'id');\n }", "public function getPages() {\r\n\t$pages = array();\r\n\tforeach ($this->pages as $key => $page) {\r\n\t $page = $this->getPage($key);\r\n\t if ($page != FALSE)\r\n\t\t$pages[$key] = $page;\r\n\t}\r\n\treturn $pages;\r\n }", "public function getPages()\n {\n return $this->getPosts();\n }", "public function getlinks()\n {\n $links = array();\n\n if (Content_Util::contentHasPageCreateAccess()) {\n $links[] = array(\n 'url' => ModUtil::url('Content', 'admin', 'newPage'),\n 'text' => $this->__('Add new page'),\n 'class' => 'z-icon-es-new');\n }\n if (SecurityUtil::checkPermission('Content::', '::', ACCESS_EDIT)) {\n $links[] = array(\n 'url' => ModUtil::url('Content', 'admin', 'main'),\n 'text' => $this->__('Page list'),\n 'class' => 'z-icon-es-edit',\n 'links' => array(\n array('url' => ModUtil::url('Content', 'user', 'sitemap'),\n 'text' => $this->__('Sitemap')),\n array('url' => ModUtil::url('Content', 'user', 'extlist'),\n 'text' => $this->__('Extended')),\n array('url' => ModUtil::url('Content', 'user', 'pagelist'),\n 'text' => $this->__('Complete')),\n array('url' => ModUtil::url('Content', 'user', 'categories'),\n 'text' => $this->__('Category list')),\n ));\n }\n\n return $links;\n }", "public function get_pages() {\n $pages = get_pages();\n $pages_options = array();\n if ( $pages ) {\n foreach ( $pages as $page ) {\n $pages_options[ $page->ID ] = $page->post_title;\n }\n }\n\n return $pages_options;\n }", "public function buildmenu()\n {\n $pages = Page::where('ispublished', 1)->where('ischild', '0')->get();\n foreach ($pages as $page) \n {\n if ($page->issection!=0)//checking if an object has subpages\n {\n if (Page::where('parent_id', $page->id)->get())\n {\n $children = Page::where('parent_id', $page->id)->get();\n }\n $count=0;\n foreach ($children as $child)//building array of subpages\n {\n if (Page::find($child->id))\n {\n if (Page::find($child->id)->published!=1)\n {\n unset($children[$count]);\n\n }\n }\n $count++;\n }\n $page->children = $children;\n }\n }\n return $pages;\n }", "public static function sitemap () {\n\t\t$res = self::query ('id')\n\t\t\t->order ('id asc')\n\t\t\t->fetch_orig ();\n\t\t\n\t\t$urls = array ();\n\t\tforeach ($res as $item) {\n\t\t\t$urls[] = '/wiki/' . $item->id;\n\t\t}\n\t\treturn $urls;\n\t}", "public function getBreadcrumbs();", "public function getChildrenForQUISite()\n {\n $Project = $this->getProject();\n\n // start\n try {\n $startId = $this->getAttribute('startId');\n\n if (Utils::isSiteLink($startId)) {\n $Site = Utils::getSiteByLink($startId);\n } else {\n $Site = $Project->get((int)$startId);\n }\n } catch (QUI\\Exception $Exception) {\n QUI\\System\\Log::addWarning($Exception->getMessage());\n\n return [];\n }\n\n return $this->getChildren($Site);\n }", "function get_page_hierarchy(&$pages, $page_id = 0)\n {\n }", "function pages($translation=null) {\r\n if(strlen($translation)==0){\r\n $translation=\"pages\";\r\n }\r\n return \"<a href=\\\"javascript:void(0)\\\">\".$this->pages.\" \".ucfirst($translation).\"</a>\";\r\n }", "public function pages()\n {\n $modular = [];\n\n foreach ($this->items as $path => $slug) {\n $page = $this->pages->get($path);\n if ($page !== null && !$page->isModule()) {\n $modular[$path] = $slug;\n }\n }\n $this->items = $modular;\n\n return $this;\n }", "function newPage($title,$pageslug='',$sbar=true) {\r\n\tglobal $WebPagesList;\r\n\tif( $pageslug=='' ) {\r\n\t\t$pageslug = $title;\r\n\t\t$pageslug = strtolower( $pageslug );\r\n\t\t$pageslug = str_replace( array(',',\"'\",'?','/','*','(',')','@','!','&','='),'',$pageslug );\r\n\t\t$pageslug = str_replace( array(' '),'-', $pageslug );\r\n\t}\r\n\treturn array( 'title'=>$title, 'inSidebar'=>$sbar, 'order'=>(count($WebPagesList)+1), 'pageslug'=>$pageslug );\r\n}", "private function getPages()\n {\n $directory = __DIR__.'/Page/';\n // remove .. and . folder in unix\n $pageFolders = array_diff(scandir($directory), array('..', '.'));\n\n return $pageFolders;\n }", "public function getPages()\n\t{\n\t\treturn $this->dashletdefs['pages'];\n\t}", "public function pages()\n {\n return $this->hasMany('App\\Models\\HistoryPage', 'history_id');\n }", "function getPagesLinks()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$lang =& JFactory::getLanguage();\n\n\t\t// Build the page navigation list\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\n\t\t$itemOverride = false;\n\t\t$listOverride = false;\n\n\t\t$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists($chromePath))\n\t\t{\n\t\t\trequire_once ($chromePath);\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) {\n\t\t\t\t$itemOverride = true;\n\t\t\t}\n\t\t\tif (function_exists('pagination_list_render')) {\n\t\t\t\t$listOverride = true;\n\t\t\t}\n\t\t}\n\n\t\t// Build the select list\n\t\tif ($data->all->base !== null) {\n\t\t\t$list['all']['active'] = true;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\n\t\t} else {\n\t\t\t$list['all']['active'] = false;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\n\t\t}\n\n\t\tif ($data->start->base !== null) {\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\n\t\t} else {\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\n\t\t}\n\t\tif ($data->previous->base !== null) {\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\n\t\t} else {\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array(); //make sure it exists\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null) {\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\n\t\t\t} else {\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null) {\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\n\t\t} else {\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\n\t\t}\n\t\tif ($data->end->base !== null) {\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\n\t\t} else {\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\n\t\t}\n\n\t\tif($this->total > $this->limit){\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\n\t\t}\n\t\telse{\n\t\t\treturn '';\n\t\t}\n\t}", "function fullPageTitle() {\n\t\t$title = htmlspecialchars($this->getTitlePage(), ENT_COMPAT, \"UTF-8\");\n\t\t$separator = ' | ';\n\t\t$parents = $this->parents();\n\t\tfor ($i=0; $i<sizeof($parents)-1; $i++) {\n\t\t\t$oneParent = $parents[$i];\n\t\t\t$title .= $separator;\n\t\t\t$title .= htmlspecialchars($oneParent->getTitlePage(), ENT_COMPAT, \"UTF-8\");\n\t\t}\n\t\treturn $title;\n\t}", "function &MWX__get_pages($args = '') {\n global $wpdb;\n\n $defaults = array(\n 'child_of' => 0, 'sort_order' => 'ASC',\n 'sort_column' => 'post_title', 'hierarchical' => 1,\n 'exclude' => '', 'include' => '',\n 'meta_key' => '', 'meta_value' => '',\n 'authors' => '', 'parent' => -1, 'exclude_tree' => '',\n 'number' => '', 'offset' => 0, 'status' => 'publish'\n );\n\n $r = wp_parse_args( $args, $defaults );\n extract( $r, EXTR_SKIP );\n $number = (int) $number;\n $offset = (int) $offset;\n\n if ($status == 'all' || $status == 'All' || $status == 'ALL') $statusquery = '';\n else $statusquery = $wpdb->prepare(\" AND post_status = '\". $status .\"'\");\n\n\n $cache = array();\n $key = md5( serialize( compact(array_keys($defaults)) ) );\n if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) {\n if ( is_array($cache) && isset( $cache[ $key ] ) ) {\n $pages = apply_filters('get_pages', $cache[ $key ], $r );\n return $pages;\n }\n }\n\n if ( !is_array($cache) )\n $cache = array();\n\n $inclusions = '';\n if ( !empty($include) ) {\n $child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include\n $parent = -1;\n $exclude = '';\n $meta_key = '';\n $meta_value = '';\n $hierarchical = false;\n $incpages = preg_split('/[\\s,]+/',$include);\n if ( count($incpages) ) {\n foreach ( $incpages as $incpage ) {\n if (empty($inclusions))\n $inclusions = $wpdb->prepare(' AND ( ID = %d ', $incpage);\n else\n $inclusions .= $wpdb->prepare(' OR ID = %d ', $incpage);\n }\n }\n }\n if (!empty($inclusions))\n $inclusions .= ')';\n\n $exclusions = '';\n if ( !empty($exclude) ) {\n $expages = preg_split('/[\\s,]+/',$exclude);\n if ( count($expages) ) {\n foreach ( $expages as $expage ) {\n if (empty($exclusions))\n $exclusions = $wpdb->prepare(' AND ( ID <> %d ', $expage);\n else\n $exclusions .= $wpdb->prepare(' AND ID <> %d ', $expage);\n }\n }\n }\n if (!empty($exclusions))\n $exclusions .= ')';\n\n $author_query = '';\n if (!empty($authors)) {\n $post_authors = preg_split('/[\\s,]+/',$authors);\n\n if ( count($post_authors) ) {\n foreach ( $post_authors as $post_author ) {\n //Do we have an author id or an author login?\n if ( 0 == intval($post_author) ) {\n $post_author = get_userdatabylogin($post_author);\n if ( empty($post_author) )\n continue;\n if ( empty($post_author->ID) )\n continue;\n $post_author = $post_author->ID;\n }\n\n if ( '' == $author_query )\n $author_query = $wpdb->prepare(' post_author = %d ', $post_author);\n else\n $author_query .= $wpdb->prepare(' OR post_author = %d ', $post_author);\n }\n if ( '' != $author_query )\n $author_query = \" AND ($author_query)\";\n }\n }\n\n $join = '';\n $where = \"$exclusions $inclusions \";\n if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) {\n $join = \" LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )\";\n\n // meta_key and meta_value might be slashed\n $meta_key = stripslashes($meta_key);\n $meta_value = stripslashes($meta_value);\n if ( ! empty( $meta_key ) )\n $where .= $wpdb->prepare(\" AND $wpdb->postmeta.meta_key = %s\", $meta_key);\n if ( ! empty( $meta_value ) )\n $where .= $wpdb->prepare(\" AND $wpdb->postmeta.meta_value = %s\", $meta_value);\n\n }\n\n // here we call on the existing join condition used for posts\n $join = MWX__join ($join);\n\n if ( $parent >= 0 )\n $where .= $wpdb->prepare(' AND post_parent = %d ', $parent);\n\n // here we call on the existing where clause used for posts\n $where = MWX__where ($where);\n\n $query = \"SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page'$statusquery) $where \";\n $query .= $author_query;\n $query .= \" ORDER BY \" . $sort_column . \" \" . $sort_order ;\n\n if ( !empty($number) )\n $query .= ' LIMIT ' . $offset . ',' . $number;\n\n //echo $query;\n\n $pages = $wpdb->get_results($query);\n\n if ( empty($pages) ) {\n $pages = apply_filters('get_pages', array(), $r);\n return $pages;\n }\n\n // Update cache.\n update_page_cache($pages);\n\n if ( $child_of || $hierarchical )\n $pages = & get_page_children($child_of, $pages);\n\n if ( !empty($exclude_tree) ) {\n $exclude = array();\n\n $exclude = (int) $exclude_tree;\n $children = get_page_children($exclude, $pages);\n $excludes = array();\n foreach ( $children as $child )\n $excludes[] = $child->ID;\n $excludes[] = $exclude;\n $total = count($pages);\n for ( $i = 0; $i < $total; $i++ ) {\n if ( in_array($pages[$i]->ID, $excludes) )\n unset($pages[$i]);\n }\n }\n\n $cache[ $key ] = $pages;\n wp_cache_set( 'get_pages', $cache, 'posts' );\n\n $pages = apply_filters('get_pages', $pages, $r);\n\n return $pages;\n}", "function get_page_by_title($page_title, $output = \\OBJECT, $post_type = 'page')\n {\n }", "public function getChildLinks()\n {\n return $this->child_links;\n }", "public function get_pages()\n\t{\n\t\treturn $this->_EE->db->select(array('heading', 'short_name'))\n\t\t\t ->get('exp_dd_doc_sections')\n\t\t\t ->result_array();\n\t}", "abstract protected function getPageTitle(): string;", "public function pages()\n {\n \treturn $this->hasMany( Page::class );\n }", "function simple_pages_navigation($parentId = 0, $sort = 'order', $requiresIsPublished = true)\n{\n $html = '';\n $childPageLinks = simple_pages_get_links_for_children_pages($parentId, $sort, $requiresIsPublished);\n if ($childPageLinks) {\n $html .= '<div class=\"simple-pages-navigation\">' . \"\\n\";\n $html .= nav($childPageLinks);\n $html .= '</div>' . \"\\n\";\n }\n return $html;\n}", "public function getChilds();", "public function provideTestSelfLinks() {\n\n\t\tyield [\n\t\t\t'Self link to page without display title, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page]]',\n\t\t\t'Snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lower case page title, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[snake Page]]',\n\t\t\t'snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, fragment, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page#Fragment]]',\n\t\t\t'Snake Page#Fragment'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, fragment only, no link text',\n\t\t\t'Snake Page',\n\t\t\t'[[#Fragment]]',\n\t\t\t'#Fragment'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, page name link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|Snake Page]]',\n\t\t\t'Snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, page name with underscores link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|Snake_Page]]',\n\t\t\t'Snake_Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[snake Page|Snake Page]]',\n\t\t\t'Snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'[[snake Page|snake Page]]',\n\t\t\t'snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|snake Page]]',\n\t\t\t'snake Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, other link text',\n\t\t\t'Snake Page',\n\t\t\t'[[Snake Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page without display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'[[snake Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\n\t\t// self link to content page with display title\n\n\t\tyield [\n\t\t\t'Self link to page with display title, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lower case page title, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page]]',\n\t\t\t'sable Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, fragment, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page#Fragment]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, fragment only, no link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[#Fragment]]',\n\t\t\t'#Fragment'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, page name link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|Sable Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, page name with underscores link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|Sable_Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name, page name link text',\n\t\t\t'Test Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page|Sable Page]]',\n\t\t\t'Zebra'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name, lowercase page name link text',\n\t\t\t'Test Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page|sable Page]]',\n\t\t\t'sable Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|sable Page]]',\n\t\t\t'sable Page'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, other link text',\n\t\t\t'Sable Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[Sable Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\n\t\tyield [\n\t\t\t'Self link to page with display title, lowercase page name, other link text',\n\t\t\t'Test Page',\n\t\t\t'{{DISPLAYTITLE:Zebra}}[[sable Page|Coyote]]',\n\t\t\t'Coyote'\n\t\t];\n\t}", "public static function find_all()\n\t{\n\t\t# TODO: return WikirPage instances\n\t\treturn file_list_dir(option('pages_dir'));\n\t}", "function listAllPages() {\n $PAGES_PATH = $_SERVER['DOCUMENT_ROOT'] . '/pages';\n //Ignore '.', '..', and '.gitkeep' in the returned directory array:\n $files = array_diff(scandir($PAGES_PATH), array('.', '..', '.gitkeep'));\n\n //ignore if there are no pages\n if ($files) {\n foreach($files as $file) {\n $pageName = substr($file, 0, strrpos($file, \".\"));\n echo '<li class=\"pages-menu-item\"><a href=\"/pages/' . $pageName . '.php\" id=\"pages-menu-' . $pageName . '\" style=\"text-decoration: none; color: #FFFFFF;\">' . $pageName . '</a></li>';\n }\n }\n }", "function block_core_page_list_nest_pages($current_level, $children)\n {\n }", "public function Children()\n {\n return $this->Root->childrenOfSection($this->URLSegment);\n }", "public function getPagesAction()\r\n {\r\n $modelPage = $this->getServiceLocator()->get('DotsPages\\Db\\Model\\Page');\r\n $query = $this->getRequest()->getQuery()->toArray();\r\n $pages = $modelPage->getAllLikeTitle('%' . $query['term'] . '%');\r\n $data = array();\r\n foreach($pages as $page){\r\n $data[] = array(\r\n 'id'=>$page->id,\r\n 'label'=>$page->title,\r\n 'value'=>$page->title,\r\n );\r\n }\r\n return $this->jsonResponse($data);\r\n }", "private function get_children($parent, $level = 0) {\r\n \t\t$pages = ORM::factory('page')->where('parent_id', $parent)->orderby('display_order','asc')->find_all();\r\n\r\n \t\t// display each child\r\n \t\tforeach ($pages as $page) {\r\n \t\t// indent and display the title of this child\r\n \t\t$this->page_array[] = array($page,$level);\r\n \t\t$this->get_children($page->id, $level+1); \r\n \t\t}\r\n\t}", "function get_pages_by_menu($the_menu) {\n $menu_name = $the_menu;\n\n if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {\n $menu = wp_get_nav_menu_object( $locations[ $menu_name ] );\n $menu_items = wp_get_nav_menu_items($menu->term_id);\n foreach ($menu_items as $key => $menu_item ) {\n \n $page_id = $menu_item->object_id;\n $title = $menu_item->title;\n $url = $menu_item->url;\n $slug = get_the_slug( $menu_item->object_id );\n \n //$content_list .= get_template_part('content', 'program');\n\n //$content = get_post_field( 'post_content', $page_id);\n\n $args = array( 'p' => $page_id, 'post_type' => 'page' );\n $loop = new WP_Query( $args );\n while ( $loop->have_posts() ) : $loop->the_post(); ?>\n <?php $content_list .= get_template_part( 'content', $slug ); ?>\n <?php\n endwhile;\n wp_reset_postdata();\n }\n return $content_list;\n }\n}", "function section_pages($atts)\n{\n\textract( shortcode_atts( array(\n\t\t'jumplink' => '',\n\t\t'linkname' => '',\n\t), $atts ) );\n\n\tglobal $post;\n\t$ID = $post->ID;\n\t$thispage = '<li><a href=\"#'.$jumplink.'\">'.$linkname.'</a></li>';\n\t$pages = wp_list_pages('title_li=&sort_column=menu_order&depth=1&child_of='.$ID.'&echo=0');\n\treturn $thispage.$pages;\n}", "public static function generate(): array\n {\n /** @var \\Nails\\Common\\Service\\PDODatabase $oDb */\n $oDb = Factory::service('PDODatabase');\n /** @var \\Nails\\Cms\\Model\\Page $oPageModel */\n $oPageModel = Factory::model('Page', Constants::MODULE_SLUG);\n $aRoutes = [];\n\n $oPages = $oDb->query(\n 'SELECT id, published_slug FROM ' . $oPageModel->getTableName() . ' WHERE is_published = 1;'\n );\n\n while ($oRow = $oPages->fetch(PDO::FETCH_OBJ)) {\n $aRoutes[$oRow->published_slug] = 'cms/render/page/' . $oRow->id;\n }\n\n // --------------------------------------------------------------------------\n\n /**\n * Make a route for each slug history item, don't overwrite any existing route\n * Doing them second and checking (instead of letting the real pages overwrite\n * the key) in an attempt to optimise, the router takes the first route it comes\n * across so, the logic is that the \"current\" slug is the one which is getting\n * hit most often, so place it first, if a legacy slug is used (in theory less\n * often) then the router can work a little harder.\n **/\n\n $oSlugs = $oDb->query('\n SELECT sh.slug, sh.page_id\n FROM ' . Config::get('NAILS_DB_PREFIX') . 'cms_page_slug_history sh\n JOIN ' . Config::get('NAILS_DB_PREFIX') . 'cms_page p ON p.id = sh.page_id\n WHERE\n p.is_deleted = 0\n AND p.is_published = 1\n ');\n\n while ($oRow = $oSlugs->fetch(PDO::FETCH_OBJ)) {\n if (!isset($aRoutes[$oRow->slug])) {\n $aRoutes[$oRow->slug] = 'cms/render/legacy_slug/' . $oRow->page_id;\n }\n }\n\n return $aRoutes;\n }", "private function parents() {\n return array_map(array($this, 'page_info_from_id'), $this->parent_ids());\n }", "public function get_page_arguments() {\n\t\treturn [\n\t\t\t$this->get_parent_slug(),\n\t\t\t$this->get_page_title(),\n\t\t\t$this->get_title(),\n\t\t\t$this->get_capability(),\n\t\t\t$this->get_slug(),\n\t\t\t$this->get_render_func() ?: [ $this, 'render_page' ],\n\t\t];\n\t}", "public function getPagePath();", "public function pages() {\n\t\t// Build the MindTouch API URL to fetch the pages.\n\t\t$url = \"pages\";\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function getAllPagesUrl() {\n return $this->getUrl('adminhtml/mzeis_documentation_list/allPages');\n }", "function buildMenuHierarchy(): array\n{\n $menu = queryDB(\n \"SELECT * FROM pages WHERE parent_page_id IS NULL AND published = 1 ORDER BY menu_priority ASC\"\n )->fetchAll();\n\n foreach ($menu as $i => $parentPage) {\n $menu[$i][\"children\"] = queryDB(\n \"SELECT * FROM pages WHERE parent_page_id = ? AND published = 1 ORDER BY menu_priority ASC\",\n $parentPage['id']\n )->fetchAll();\n }\n\n return $menu;\n}", "public function setSubpages() {\n $sendbadgeTemp = new SendBadgeTemp();\n $settingTemp = new SettingsTemp();\n $userTemp = new UserTemp();\n $badgesTemp = new BadgesTemp();\n $singleBadgesTemp = new SingleBadgeTemp();\n\t\t$staticPagesTemp = new StaticPagesTemp();\n\n $this->subpages = array(\n // ## Badges ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Badges',\n 'menu_title' => 'Badges',\n 'capability' => 'manage_options',\n 'menu_slug' => 'edit.php?post_type=' . self::POST_TYPE_BADGES,\n 'callback' => ''\n ),\n // ## Fields ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Fields of education',\n 'menu_title' => 'Fields of education',\n 'capability' => 'manage_options',\n 'menu_slug' => 'edit-tags.php?taxonomy=' . self::TAX_FIELDS . '&post_type=' . self::POST_TYPE_BADGES,\n 'callback' => ''\n ),\n // ## Levels ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Levels',\n 'menu_title' => 'Levels',\n 'capability' => 'manage_options',\n 'menu_slug' => 'edit-tags.php?taxonomy=' . self::TAX_LEVELS . '&post_type=' . self::POST_TYPE_BADGES,\n 'callback' => ''\n ),\n // ## Send Badges ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Send Badges',\n 'menu_title' => 'Send Badges',\n 'capability' => WPUser::CAP_SELF,\n 'menu_slug' => self::PAGE_SEND_BADGE,\n 'callback' => array($sendbadgeTemp, 'main')\n ),\n // ## All Badges ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'All Badges',\n 'menu_title' => 'All Badges',\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_BADGES,\n 'callback' => array($badgesTemp, 'main')\n ),\n // ## User ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'User',\n 'menu_title' => 'User',\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_PROFILE,\n 'callback' => array($userTemp, 'main')\n ),\n // ## Settings ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Settings',\n 'menu_title' => 'Settings',\n 'capability' => 'manage_options',\n 'menu_slug' => self::PAGE_SETTINGS,\n 'callback' => array($settingTemp, 'main')\n ),\n\t\t\t\n\t\t\t// ## About us ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'About us',\n 'menu_title' => 'About us',\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_ABOUT,\n 'callback' => array($staticPagesTemp, 'aboutTab')\n ),\n\t\t\t\n // ## Single Badge ##\n array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Badge',\n 'menu_title' => null,\n 'capability' => 'read',\n 'menu_slug' => self::PAGE_SINGLE_BADGES,\n 'callback' => array($singleBadgesTemp, 'main')\n ),\n\t\t\t\n\n );\n\n\n // ## Restrict Access ##\n // Be careful HERE, this sub-page is created only for rcp-restrict-post-type\n $this->subpages[] = array(\n 'parent_slug' => self::SLUG_PLUGIN,\n 'page_title' => 'Restrict Access',\n 'menu_title' => 'Restrict Access',\n 'capability' => 'manage_options',\n 'menu_slug' => 'admin.php?page=rcp-restrict-post-type-' . self::POST_TYPE_BADGES,\n 'callback' => ''\n );\n }" ]
[ "0.6774894", "0.6751045", "0.65878326", "0.6485927", "0.6336978", "0.6332378", "0.63045114", "0.62785727", "0.6269282", "0.6233091", "0.62106895", "0.6143181", "0.6141816", "0.6137188", "0.61356294", "0.6126929", "0.61257195", "0.61252743", "0.6109096", "0.60968757", "0.60910404", "0.604256", "0.60259867", "0.59814376", "0.5958753", "0.59476095", "0.59401095", "0.5924817", "0.5915449", "0.58995414", "0.58957255", "0.5895638", "0.5886877", "0.5879402", "0.58779424", "0.5870405", "0.5861004", "0.58522785", "0.5851401", "0.5844138", "0.58354044", "0.5825677", "0.5824157", "0.5797625", "0.5792833", "0.57724893", "0.5752122", "0.5736883", "0.57211614", "0.5718133", "0.5712872", "0.57127273", "0.5703065", "0.56880504", "0.5680791", "0.56795925", "0.5672621", "0.5649266", "0.5640977", "0.5632669", "0.56180143", "0.5611901", "0.559942", "0.559614", "0.5587087", "0.55786794", "0.557092", "0.5567408", "0.5563904", "0.55527425", "0.55516", "0.5544039", "0.55435157", "0.5540093", "0.55399984", "0.5530502", "0.55246866", "0.55001444", "0.5498405", "0.54912776", "0.5487124", "0.5470435", "0.54693294", "0.5467604", "0.5455185", "0.54524267", "0.54446554", "0.54361296", "0.54294467", "0.5425597", "0.5420895", "0.5420647", "0.5418009", "0.5416285", "0.5411698", "0.54067516", "0.5392358", "0.53889686", "0.5388161", "0.538511" ]
0.6148176
11
Find possible parents of a page for select box
function getListThreaded($skipId = null, $alias = 'title') { $parentPages = $this->findAll(null, null, "{$this->name}.lft ASC", null, 1, 0); // Array for form::select $selectBoxData = array(); $skipLeft = false; $skipRight = false; if (empty($parentPages)) return $selectBoxData; $rightNodes = array(); foreach ($parentPages as $key => $page) { $level = 0; // Check if we should remove a node from the stack while (!empty($rightNodes) && ($rightNodes[count($rightNodes) - 1] < $page[$this->name]['rght'])) { array_pop($rightNodes); } $level = count($rightNodes); $dashes = ''; if ($level > 0) { $dashes = str_repeat('&nbsp;', $level) . '-'; } if ($skipId == $page[$this->name]['id']) { $skipLeft = $page[$this->name]['lft']; $skipRight = $page[$this->name]['rght']; } else { if (!($skipLeft && $skipRight && $page[$this->name]['lft'] > $skipLeft && $page[$this->name]['rght'] < $skipRight)) { $alias = hsc($page[$this->name]['title']); if (!empty($dashes)) $alias = "$dashes $alias"; $selectBoxData[$page[$this->name]['id']] = $alias; } } $rightNodes[] = $page[$this->name]['rght']; } return $selectBoxData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSelectableParents()\n {\n $roles = $this->all();\n $tree = $this->findChildren($roles, 0, 1);\n\n //recursively go trough the array and delete....\n\n $trimmed_tree = $this->removeTreeNode($tree, $this->id);\n return $trimmed_tree;\n\n\n\n\n }", "private function parents() {\n return array_map(array($this, 'page_info_from_id'), $this->parent_ids());\n }", "function get_field_parents($field_name, $id)\n{\n global $post;\n\n for($i=1; ; $i++) {\n $field_value = get_field($field_name, $id);\n\n if($field_value) {\n // Field data was found, return it!\n return $field_value;\n break;\n\n } else {\n\n // No field data was found\n if($id == $post->post_parent){\n // Current page is top parent\n break;\n } else {\n // Current page doesnt have a value, check parent page\n $id = $post->post_parent;\n $field_value = get_field($field_name, $id);\n return $field_value;\n break;\n }\n\n }\n\n }\n\n}", "function parent_dropdown($default_page = 0, $parent_page = 0, $level = 0, $post = \\null)\n {\n }", "function page_parent($id_only=false) {\n\t\t\t$id = 'parent_id';\n\t\t\tif($id_only) {\n\t\t\t\treturn $id;\n\t\t\t}\n\t\t\treturn 'jQuery(\"#'.$id.' option:selected\").val()';\n\t\t}", "public function getParents() {}", "public function getParents()\n {\n \t$currentPos = trim($this->getPosition());\n \tif($currentPos === '' || $currentPos === '1')\n \t\treturn array($this);\n \t\n \t$posArray = array();\n \t$length = strlen($currentPos);\n \tfor($i = 0; $i < ($length - 1) / self::POS_LENGTH_PER_LEVEL ; $i++)\n \t{\n \t\t$posArray[] = trim(substr($currentPos, 0, ($i * self::POS_LENGTH_PER_LEVEL) + 1));\n \t}\n \treturn self::getAllByCriteria('rootId = ? and position in (' . implode(',', array_fill(0, count($posArray), '?')) . ')', array_merge(array($this->getRoot()->getId()), $posArray), false, null, DaoQuery::DEFAUTL_PAGE_SIZE, array('position' => 'asc'));\n }", "public function get_parent_pages(){\n\n\t\t\t\t$selectissue=\"SELECT * FROM `pages` WHERE `page_parent_id`='0' AND `page_id`!='25' AND `page_id`!='26'\";\n\t\t\t\t$issueresult = mysqli_query($this->db,$selectissue) or die(mysqli_connect_errno().\"Data cannot inserted\");\n \t\treturn $issueresult;\n\t\t}", "function _prepare_parents_for_select ($skip_id = 0, $parent_id = 0, $level = 0) {\n\t\t$f = __FUNCTION__;\n\t\t$forums = array();\n\t\t// Prepare categories for select box\n\t\tforeach ((array)$this->_forum_parents[$parent_id] as $_forum_id => $_cat_id) {\n\t\t\tif ($_forum_id == $skip_id) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Add category (with prefix: 'c_')\n\t\t\tif (!isset($forums['c_'.$_cat_id])) {\n\t\t\t\t$forums['cat_'.$_cat_id] = $this->_forum_cat_names[$_cat_id];\n\t\t\t}\n\t\t\t// Add current forum\n\t\t\t$forums[$_forum_id] = str_repeat($this->_text_level_filler, $level). $this->_text_forum_divider. module('forum')->_forums_array[$_forum_id]['name'];\n\t\t\t// Try to find sub-forums\n\t\t\tforeach ((array)$this->$f($skip_id, $_forum_id, $level + 1) as $_sub_id => $_sub_name) {\n\t\t\t\t$forums[$_sub_id] = $_sub_name;\n\t\t\t}\n\t\t}\n\t\treturn $forums;\n\t}", "public function get_parents(){\n\t\treturn $this->master->parent_list_construct();\n\t}", "public function getParents();", "protected function getRecursiveSelectOptions() {}", "function five_get_ancestors(){\n\t\t\n\t\tglobal $wpdb;\n\t\t$result = $wpdb->get_results(\"SELECT ID, post_title, guid FROM $wpdb->posts WHERE post_type = 'page' AND post_parent = 0 AND post_status = 'publish'\");\n\t\treturn $result;\n\t\t}", "public function get_parents($request) {\n $doc = $this->get_doc( $request['id'] );\n\n if ( is_wp_error($doc) ) {\n return $doc;\n }\n\n // forcefully set the context\n $request['context'] = 'sidebar';\n\n $ancestors = [];\n $root = $parent = false;\n\n if ($doc->post_parent) {\n $ancestors = get_post_ancestors($doc->ID);\n $root = count($ancestors) - 1;\n $parent = $ancestors[$root];\n } else {\n $parent = $doc->ID;\n }\n\n $docs = get_pages( [\n 'order' => 'menu_order',\n 'child_of' => $parent,\n 'post_type' => 'docs',\n ] );\n\n $result = [];\n\n // add the parent by-default as the first element\n $parent_doc = ($parent == $doc->ID) ? $doc : get_post($parent);\n\n if ($parent_doc) {\n $data = $this->prepare_item_for_response($parent_doc, $request);\n $result[] = $this->prepare_response_for_collection($data);\n }\n\n // now, process the child\n foreach ($docs as $key => $doc) {\n $data = $this->prepare_item_for_response($doc, $request);\n $data = $this->set_pagination($data, $doc, $request);\n\n $result[] = $this->prepare_response_for_collection($data);\n }\n\n $response = rest_ensure_response($result);\n\n return $response;\n }", "function galleryParentSelectList( &$row ) {\r\n $database =& JFactory::getDBO();\r\n\r\n $id = '';\r\n if ( $row->id ) {\r\n $id = \" AND id != $row->id\";\r\n }\r\n\r\n // get a list of the menu items\r\n // excluding the current menu item and its child elements\r\n $query = \"SELECT *\"\r\n . \" FROM #__rsgallery2_galleries\"\r\n . \" WHERE published != -2\"\r\n . $id\r\n . \" ORDER BY parent, ordering\"\r\n ;\r\n $database->setQuery( $query );\r\n \r\n $mitems = $database->loadObjectList();\r\n\r\n // establish the hierarchy of the menu\r\n $children = array();\r\n\r\n if ( $mitems ) {\r\n // first pass - collect children\r\n foreach ( $mitems as $v ) {\r\n $pt = $v->parent;\r\n $list = @$children[$pt] ? $children[$pt] : array();\r\n array_push( $list, $v );\r\n $children[$pt] = $list;\r\n }\r\n }\r\n\r\n // second pass - get an indent list of the items\r\n $list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0 );\r\n\r\n // assemble menu items to the array\r\n $mitems = array();\r\n $mitems[] = JHTMLSelect::option( '0', JText::_('Top Gallery') );\r\n\r\n foreach ( $list as $item ) {\r\n $mitems[] = JHTMLSelect::option( $item->id, '&nbsp;&nbsp;&nbsp;'. $item->treename );\r\n }\r\n\r\n $output = JHTML::_(\"select.genericlist\", $mitems, 'parent', 'class=\"inputbox\" size=\"10\"', 'value', 'text', $row->parent );\r\n\r\n return $output;\r\n}", "public static function menu(){\n $sql = \"select * from pageweb where id_parent = 1 AND menu = 1 ORDER BY ordre\";\n $parents = DB::get_sql_tab($sql);\n for($i=0;$i<count($parents);$i++) {\n $sql2 = \"select * from pageweb where id_parent = '\".$parents[$i][\"id\"].\"'AND menu = 1\";\n $enfants = DB::get_sql_tab($sql2);\n $parents[$i][\"enfants\"] = $enfants;\n }\n return $parents;\n }", "public function findParents($selector) {\r\n\t\t$parents = array();\r\n\t\t$cur = $this->getParent();\r\n\t\twhile($cur) {\r\n\t\t\tif ($cur->matchSelector($selector)) {\r\n\t\t\t\t$parents[] = $cur;\r\n\t\t\t}\r\n\t\t\t$cur = $cur->getParent();\r\n\t\t}\r\n\t\treturn $parents;\r\n\t}", "function get_admin_page_parent($parent_page = '')\n {\n }", "function find_parents($term,$type)\n{\n\topenConn();\n\n\tswitch($type)\n\t{\n\t\tcase 'o':\n\t\t\t$query=\"SELECT p from locality WHERE o = '$term'\";\n\t\t\t$query_result=mysql_query($query);\n\t\t\t$num=mysql_num_rows($query_result);\n\t\t\t$loc[0] = mysql_result($query_result,0);\n\t\tbreak;\n\n\t\tcase 'm':\n\t\t\t$query=\"SELECT * from locality WHERE m = '$term'\";\n\t\t\t$query_result=mysql_query($query);\n\t\t\t$num=mysql_num_rows($query_result);\n\t\t\t$loc[0] = mysql_result($query_result,0,p);\n\t\t\t$loc[1] = mysql_result($query_result,0,o);\n\t\tbreak;\n\n\t\tcase 't':\n\t\t\t$query=\"SELECT * from locality WHERE t = '$term'\";\n\t\t\t$query_result=mysql_query($query);\n\t\t\t$num=mysql_num_rows($query_result);\n\t\t\t$loc[0] = mysql_result($query_result,0,p);\n\t\t\t$loc[1] = mysql_result($query_result,0,o);\n\t\t\t$loc[2] = mysql_result($query_result,0,m);\n\t\tbreak;\n\t}\n\t\t\t\n\n\tmysql_close();\n\treturn $loc;\n}", "function smarty_function_select_page_populate_options($page, $value, $user, $skip, &$options, $indent = '') {\n if(instance_of($skip, 'Page') && $skip->getId() == $page->getId()) {\n return;\n } // if\n \n $attributes = $value == $page->getId() ? array('selected' => true) : null;\n $options[] = option_tag($indent . $page->getName(), $page->getId(), $attributes);\n \n $subpages = $page->getSubpages($user->getVisibility());\n if(is_foreachable($subpages)) {\n foreach($subpages as $subpage) {\n smarty_function_select_page_populate_options($subpage, $value, $user, $skip, $options, $indent . '- ');\n } // foreach\n } // if\n }", "public function parentsOptions($language = null) {\n $conditions = !empty($language) ? ['status' => 1, 'type' => 'help', 'parent_id IS NULL', 'language' => $language] : ['status' => 1, 'type' => 'help', 'parent_id IS NULL'];\n $options = $this->find('list', ['keyField' => 'id', 'valueField' => 'title'])\n ->where($conditions)\n ->order(['lft'=>' DESC', 'rght'=>' ASC'])\n ->toArray();\n return $options;\n }", "public function get_parent();", "private function parentsSqlStatement()\n\t{\n\t\tif($this->stmt_parents == NULL) {\n\t\t\t$sql = \"SELECT parent_id\n\t\t\t\t\tFROM user_site_template_div\n\t\t\t\t\tWHERE id = :id\n\t\t\t\t\tAND template_id = :template_id\n\t\t\t\t\tAND site_id = :site_id\n\t\t\t\t\tAND parent_id <> 0\n\t\t\t\t\tLIMIT 1\";\n\t\t\treturn $this->_db->prepare($sql);\n\t\t} else {\n\t\t\treturn $this->stmt_parents;\n\t\t}\n\t}", "public function getParents()\n {\n return $this->Parents_->filter(function ($persona) {\n return $persona->approved;\n })->pluckNamed('Parent');\n }", "function getParentPageID () {return $this->getFieldValue ('parent_page_id');}", "private static function getParents(SiteTree $page)\n {\n $parents = array();\n\n $parent = $page->parent();\n\n while ($parent && $parent->exists()) {\n array_push($parents, $parent);\n // Keep looping\n $parent = $parent->parent();\n }\n\n return $parents;\n }", "private function check_for_no_recursion() {\n $parent_id=$this->navi_parent_page_id;\n if($parent_id=='0') return true;\n for($i=0;$parent_id!='0'&&$i<20;$i++) {\n if(strpos($parent_id,'s')===0) {\n $parent_id=substr($parent_id,1);\n if($parent_id==$this->page_id) return false;\n\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"pages\")->prepare(\"SELECT\n navi_parent_page_id\n FROM\n u235_pages_html\n WHERE\n page_id=:page_id AND\n site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':page_id', $parent_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('120'/*.$e->getMessage()*/);}\n\n /** @noinspection PhpUndefinedVariableInspection PhpUndefinedMethodInspection */\n if(!$qr=$stm->fetch(PDO::FETCH_OBJ)) return false;\n $parent_id=$qr->navi_parent_page_id;\n if($parent_id=='0') return true;\n }\n elseif(strpos($parent_id,'p')===0) {\n $parent_id=substr($parent_id,1);\n if($parent_id==$this->page_id) return false;\n\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"uPage\")->prepare(\"SELECT\n navi_parent_page_id\n FROM\n u235_pages\n WHERE\n page_id=:page_id AND\n site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':page_id', $parent_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('130'/*.$e->getMessage()*/);}\n\n /** @noinspection PhpUndefinedVariableInspection PhpUndefinedMethodInspection */\n if(!$qr=$stm->fetch(PDO::FETCH_OBJ)) return false;\n $parent_id=$qr->navi_parent_page_id;\n if($parent_id=='0') return true;\n }\n else return true;\n }\n return false;\n }", "public function getParents() {\n\t\tif ($this->_parents === null) {\n\t\t\t$this->_parents = array();\n\t\t\t$command = 'show --pretty=\"format:%P\" '.$this->hash;\n\t\t\tforeach(explode(' ',$this->branch->repository->run($command)) as $commitHash) {\n\t\t\t\tif (!empty($commitHash)) {\n\t\t\t\t\t$this->_parents[$commitHash] = $this->branch->getCommit($commitHash);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->_parents;\n\t}", "function GetPossibleParents($parentid = 0, $prefix = '')\n\t{\n\t\t$parents = array();\n\t\t$sql = 'SELECT * FROM pages WHERE parentid=' . (int)$parentid;\n\t\tif ($this->id)\n\t\t{\t$sql .= ' AND NOT pageid=' . $this->id;\n\t\t}\n\t\t$sql .= ' ORDER BY pageorder';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\tif (!$this->subpages[$row['pageid']])\n\t\t\t\t{\t$parents[$row['pageid']] = $prefix . $this->InputSafeString($row['pagetitle']);\n\t\t\t\t\tif ($children = $this->GetPossibleParents($row['pageid'], '-&nbsp;' . $prefix))\n\t\t\t\t\t{\tforeach ($children as $pid=>$ptitle)\n\t\t\t\t\t\t{\t$parents[$pid] = $ptitle;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $parents;\n\t\t\n\t}", "function get_all_menu_selected_by_parent($params) {\n $sql = \"SELECT a.*, b.role_id, b.role_tp\n FROM com_menu a\n LEFT JOIN (SELECT * FROM com_role_menu WHERE role_id = ?) b ON a.nav_id = b.nav_id\n WHERE portal_id = ? AND parent_id = ?\n ORDER BY nav_no ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "function get_parent($type) {\n $relationships = get_field('post_detail_page_relationship', 'option');\n $parent = null;\n foreach ($relationships as $relationship) {\n if ($relationship['post_type'] === $type) {\n return $relationship['detail_page'];\n }\n }\n}", "private function getParentFilter() {\n if($this->parent_filter === false) {\n $project_objects = DB::execute(\"SELECT id, LOWER(type) AS 'type' FROM \" . TABLE_PREFIX . \"project_objects WHERE project_id = ?\", $this->object->getId());\n if($project_objects) {\n $parents_by_type = array();\n \n foreach($project_objects as $project_object) {\n $type = $project_object['type'];\n \n if(isset($parents_by_type[$type])) {\n $parents_by_type[$type][] = $project_object['id'];\n } else {\n $parents_by_type[$type] = array($project_object['id']);\n } // if\n } // foreach\n \n foreach($parents_by_type as $type => $ids) {\n $parents_by_type[$type] = DB::prepare('(parent_type = ? AND parent_id IN (?))', $type, $ids);\n } // foreach\n \n $subtasks = DB::execute(\"SELECT id, LOWER(type) AS 'type' FROM \" . TABLE_PREFIX . 'subtasks WHERE ' . implode(' OR ', $parents_by_type));\n if($subtasks) {\n foreach($subtasks as $subtask) {\n $type = $subtask['type'];\n\n if(isset($parents_by_type[$type])) {\n $parents_by_type[$type][] = $subtask['id'];\n } else {\n $parents_by_type[$type] = array($subtask['id']);\n } // if\n } // foreach\n \n foreach($parents_by_type as $type => $ids) {\n if(is_array($ids)) {\n $parents_by_type[$type] = DB::prepare('(parent_type = ? AND parent_id IN (?))', $type, $ids);\n } // if\n } // foreach\n } // if\n \n $this->parent_filter = implode(' OR ', $parents_by_type);\n } else {\n $this->parent_filter = '';\n } // if\n } // if\n \n return $this->parent_filter;\n }", "static function get_dropdown_options()\n {\n $rows = ORM::factory('actor')->where('parent_id=0')->orderby('actor')->find_all();\n \n foreach ($rows as $row){\n $hijos = array();\n $_t = ORM::factory('actor')->where('parent_id',$row->id)->orderby('actor')->select_list('id','actor');\n\n foreach($_t as $_id => $_n) {\n\n $_hijos = ORM::factory('actor')->where('parent_id',$_id)->orderby('actor')->select_list('id','actor');\n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_hijos);\n \n /* \n foreach($_hijos as $_idn => $_nn) {\n $_h[] = array('id' => $_idn, 'n' => $_nn, 'h' => ORM::factory('actor')->where('parent_id',$_idn)->select_list('id','actor'));\n }\n \n $hijos[] = array('id' => $_id, 'n' => $_n, 'h' => $_h);\n */\n }\n \n $opts[] = array('id' => $row->id, 'n' => $row->actor, 'h' => $hijos);\n }\n return $opts;\n }", "function acf_get_field_ancestors($field)\n{\n}", "public function possibleParents($id)\n {\n $prts = array(\"\" => \"-\");\n foreach (StaticPage::model()->findAll() as $p) {\n if ($p->id == $id) continue;\n $prts[$p->id] = $p->title;\n }\n return $prts;\n }", "function restrict_manage_posts() {\n\t\tglobal $post;\n\t\tif ( 'location' != get_query_var( 'post_type' ) )\n\t\t\treturn;\n\t\t$post_parent = isset( $_GET['post_parent'] ) ? $_GET['post_parent'] : '';\n\t\techo wp_dropdown_pages( array(\n\t\t\t'echo' => 0,\n\t\t\t'name' => 'post_parent',\n\t\t\t'post_type' => 'locationregion',\n\t\t\t'selected' => $post_parent,\n\t\t\t'show_option_none' => __( 'View all locations', 'loc' ),\n\t\t\t'option_none_value' => ''\n\t\t) );\n\t}", "public function dropdown_tree() {\n $args = func_get_args();\n list($key, $value, $parent) = $args;\n\n $result = $this->db->select(array($key, $value, $parent))->get($this->_table())->result();\n\n $options = array();\n foreach ($result as $row) {\n $options[] = array(\n 'id'=>$row->{$key},\n 'name'=>$row->{$value},\n 'parent'=>$row->{$parent},\n );\n }\n return $options;\n }", "function get_sub_page_menu($pagename) {\n \n $make_page_subpage_pages = \"\";\n $is_already_subpage = false;\n $conn = get_db_connection(MAIN_DB_HOST, MAIN_DB_DATABASE_NAME, MAIN_DB_USER, MAIN_DB_PASS);\n $stmt = $conn->prepare(\"SELECT \".MAIN_DB_PREFIX.\"navi_name.id, \".MAIN_DB_PREFIX.\"navi_name.name, \".MAIN_DB_PREFIX.\"text.text, \".MAIN_DB_PREFIX.\"navi.place\n FROM \".MAIN_DB_PREFIX.\"navi_name \n INNER JOIN \".MAIN_DB_PREFIX.\"text ON \".MAIN_DB_PREFIX.\"navi_name.parent_id=\".MAIN_DB_PREFIX.\"text.parent_id\n INNER JOIN \".MAIN_DB_PREFIX.\"navi ON \".MAIN_DB_PREFIX.\"navi.id=\".MAIN_DB_PREFIX.\"text.parent_id\n WHERE \".MAIN_DB_PREFIX.\"navi.place = 'standart' GROUP BY \".MAIN_DB_PREFIX.\"navi_name.name;\");\n $stmt->execute();\n // set the resulting array to associative\n if ($stmt->rowCount() > 0) {\n $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);\n foreach($stmt->fetchAll() as $row) {\n if ($pagename == $row['name']) {\n $make_page_subpage_pages .= \"<option value='\".$row['name'].\"' selected>\".$row['name'].\"</option>\";\n $is_already_subpage = true;\n }\n else {\n $make_page_subpage_pages .= \"<option value='\".$row['name'].\"'>\".$row['name'].\"</option>\";\n }\n }\n if (!$is_already_subpage) {\n $make_page_subpage_pages = '<option value=\"standart\" selected>Hoved menu</option>'.$make_page_subpage_pages;\n }\n else {\n $make_page_subpage_pages = '<option value=\"standart\">Hovedmenu</option>'.$make_page_subpage_pages;\n }\n\n } \n \n return '<div class=\"input-group\">\n <select class=\"form-control\" name=\"sub_page\" id=\"sub_page\">\n '.$make_page_subpage_pages.'\n </select>\n </div>';\n \n}", "function getParent();", "public function getParents()\n\t{\n\t\tif ($this->get('parents'))\n\t\t{\n\t\t\treturn $this->get('parents');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->setParents();\n\t\t}\n\t}", "public function ddl_parent($var)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$search = \"SELECT DISTINCT parent_id, label_id\r\n\t\t\t\t\t\t\tFROM parents where label='\".$var.\"';\";\r\n\t\t\t\t$resultq = mysqli_query($link, $search);\r\n\t\t\t\t$sow = array();\r\n\t\t\t\t$sow_arr = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($resultq)) {\t\r\n\t\t\t\t\t$sow['parent_id'] =$row[0];\r\n\t\t\t\t\t$sow['label_id'] =$row[1];\r\n\t\t\t\t\t$sow_arr[] = $sow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $sow_arr;\r\n\t\t}", "function walk_page_dropdown_tree(...$args)\n {\n }", "function create_selection_list_wiki_page_tree($select = null, $id = null, $breadcrumbs = '', $include_orphans = true, $use_compound_list = false, $ins_format = false)\n{\n if (is_null($id)) {\n $id = db_get_first_id();\n }\n\n if ($GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'COUNT(*)') > 1000) {\n return new Tempcode();\n }\n\n $wiki_seen = array();\n $title = get_translated_text($GLOBALS['SITE_DB']->query_select_value('wiki_pages', 'title', array('id' => $id)));\n $out = _create_selection_list_wiki_page_tree($wiki_seen, $select, $id, $breadcrumbs, $title, $use_compound_list, $ins_format);\n\n if ($include_orphans) {\n if (!db_has_subqueries($GLOBALS['SITE_DB']->connection_read)) {\n $wiki_seen = array(db_get_first_id());\n get_wiki_page_tree($wiki_seen, is_null($id) ? null : intval($id)); // To build up $wiki_seen\n $where = '';\n foreach ($wiki_seen as $seen) {\n if ($where != '') {\n $where .= ' AND ';\n }\n $where .= 'p.id<>' . strval($seen);\n }\n\n $orphans = $GLOBALS['SITE_DB']->query('SELECT p.id,p.title FROM ' . get_table_prefix() . 'wiki_pages p WHERE ' . $where . ' ORDER BY add_date DESC', intval(get_option('general_safety_listing_limit'))/*reasonable limit*/, null, false, true);\n } else {\n $orphans = $GLOBALS['SITE_DB']->query('SELECT p.id,p.title FROM ' . get_table_prefix() . 'wiki_pages p WHERE p.id<>' . strval(db_get_first_id()) . ' AND NOT EXISTS(SELECT * FROM ' . get_table_prefix() . 'wiki_children WHERE child_id=p.id) ORDER BY add_date DESC', intval(get_option('general_safety_listing_limit'))/*reasonable limit*/);\n }\n\n foreach ($orphans as $i => $orphan) {\n $orphans[$i]['_title'] = get_translated_text($orphan['title']);\n }\n if (count($orphans) < intval(get_option('general_safety_listing_limit'))) {\n sort_maps_by($orphans, '_title');\n }\n\n foreach ($orphans as $orphan) {\n if (!has_category_access(get_member(), 'wiki_page', strval($orphan['id']))) {\n continue;\n }\n\n $title = $orphan['_title'];\n $out->attach(form_input_list_entry($ins_format ? (strval($orphan['id']) . '!' . $title) : strval($orphan['id']), false, do_lang('WIKI_ORPHANED') . ' > ' . $title));\n }\n }\n\n return $out;\n}", "function theme_haarlem_pages_get_widget_selector(ElggEntity $container, $depth = 0) {\n\n\tif (empty($container) || !elgg_instanceof($container)) {\n\t\treturn false;\n\t}\n\tif ($depth == 0) {\n\t\t$ordered = elgg_get_entities(array(\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'page_top',\n\t\t\t'container_guid' => $container->getGUID(),\n\t\t\t'limit' => false,\n\t\t));\n\t} else {\n\t\t$ordered = elgg_get_entities_from_metadata(array(\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'page',\n\t\t\t'metadata_name' => 'parent_guid',\n\t\t\t'metadata_value' => $container->getGUID(),\n\t\t\t'limit' => false,\n\t\t));\n\t}\n\n\tif (empty($ordered)) {\n\t\treturn false;\n\t}\n\n\t$result = array();\n\n\tforeach ($ordered as $order => $page) {\n\t\t// add this page\n\t\t$result[$page->getGUID()] = trim(str_repeat('-', $depth) . ' ' . $page->title);\n\t\t// invalidate cache for OOM\n\t\t// @todo find a better way for this\n\t\t_elgg_invalidate_cache_for_entity($page->getGUID());\n\n\t\t// append children\n\t\t$children = theme_haarlem_pages_get_widget_selector($page, $depth + 1);\n\t\tif (!empty($children)) {\n\t\t\t$result += $children;\n\t\t\t\t\n\t\t\tunset($children);\n\t\t}\n\t}\n\n\tunset($ordered);\n\n\treturn $result;\n}", "function menu_select($start_id,$direction,$number_levels,$only_active,$menu_only,$exclude_subseiten)\n{\n//$start_id ist die ID, von der weg geprüft werden soll.\n//$direction ist entweder \"up\" oder \"down\".\n//$numer_levels ist ein numerischer Wert, der nur bei \"down\" relevanz hat. Er gibt an, wie viele Ebenen durchsucht werden sollen.\n//$only active ist enteder \"1\" oder was anderes. Nur wenn es \"1\" ist, werden nur die aktiven Einträge druchsucht. \n//$menu_only ist entweder \"1\" oder \"2\" oder was anderes. Nur wenn es \"1\" ist, werden nur die Menüeinträge gezeigt. Wenn es \"2\" ist, werden nur jene Einträge wieder gegeben, die selbst kein Meunü sind.\n//Aufrufen durch: print_r(menu_select('46','down','1','',''));\n\tunset($GLOBALS['menu_select_siblings']);\n\tunset($GLOBALS['menu_select_parent']);\n\tif($only_active==\"1\"){$search_append_string=\"and (active_startdate<=now() or active_startdate='0000-00-00') and (active_enddate>=now() or active_enddate='0000-00-00') and active='A'\";}\n\tif($menu_only==\"1\"){$search_append_string=$search_append_string.\" and display='1'\";}\n\tif($exclude_subseiten==\"1\"){$search_append_string=$search_append_string.\" and search_type not like '%Subseiten%'\";}\n\n\t$i=-1;\n\tif(function_exists('menu_select_siblings')){unset ($menu_select_siblings);} else\n\t{\n\t\tfunction menu_select_siblings($parent_id,$number_levels,$i,$search_append_string,$menu_only)\n\t\t{\n\t\t\t$i=$i+1;\n\t\t\tif($i<$number_levels or $number_levels==0 or $number_levels==\"\")\n\t\t\t{\n\t\t\t\tglobal $menu_select_siblings;\n\t\t\t\t$sibling_query=mysql_query(\"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\") or die (\"sibling_query: \".mysql_error());\n\t\t\t\techo $parent_id;\n\t\t\t\tif($parent_id==3) {echo \"hh\";echo \"select id, description, display from menu where parent_id=$parent_id $search_append_string order by sort\";}\n\t\t\t\t\n\t\t\t\twhile($sibling_query_result=mysql_fetch_assoc($sibling_query))\n\t\t\t\t{\n\t\t\t\t\tif(($menu_only==2 and $sibling_query_result['display']==0) or $menu_only!=2){//if the selector menu only is set to 2, only those items are recorded that are actually NOT menus.\n\t\t\t\t\t\t$menu_select_siblings['id'][] = $sibling_query_result['id'];\n\t\t\t\t\t\t$menu_select_siblings['description'][] = $sibling_query_result['description'];\n\t\t\t\t\t\t$menu_select_siblings['googleurl'][] = find_googleurl($sibling_query_result['id']);\t\t\t\n\t\t\t\t\t\t$menu_select_siblings['level_down'][] = $i;\t\n\t\t\t\t\t}\n\t\t\t\t\tmenu_select_siblings($sibling_query_result['id'],$number_levels,$i,$search_append_string,$menu_only);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn($menu_select_siblings);\n\t\t}\n\t}\n\t\n\tif(function_exists('menu_select_parents')){} else\n\t{\n\t\tfunction menu_select_parents($sibling_id, $only_active_string)\n\t\t{\tif($sibling_id==\"\" or $sibling_id==\"0\" or !$sibling_id){} else\n\t\t\t{\n\t\t\t\tglobal $menu_select_parent;\n\t\t\t\t$parent_query=mysql_query(\"select id, parent_id, description from menu where id=$sibling_id $search_append_string order by sort\") or die (\"parent_query: \".mysql_error());\n\t\t\t\twhile($parent_query_result=mysql_fetch_assoc($parent_query))\n\t\t\t\t{\n\t\t\t\t\tif($parent_query_result[id]==0){break;}\n\t\t\t\t\t$menu_select_parent['id'][] = $parent_query_result['id'];\n\t\t\t\t\t$menu_select_parent['description'][] = $parent_query_result['description'];\n\t\t\t\t\t$menu_select_parent['googleurl'][] = find_googleurl($parent_query_result['id']);\t\t\t\n\t\t\t\t\tmenu_select_parents($parent_query_result[parent_id],$search_append_string);\n\t\t\t\t}\n\t\t\t\treturn($menu_select_parent);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif($direction==\"up\"){return(menu_select_parents($start_id,$search_append_string));}\n\telseif($direction==\"down\"){return(menu_select_siblings($start_id,$number_levels,$i,$search_append_string,$menu_only));}\n}", "public function admin_getParents() {\n\t\tif (empty($this->request->data[$this->modelClass]['menu_id'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->set('json', $this->{$this->modelClass}->getParents($this->request->data[$this->modelClass]['menu_id']));\n\t}", "function get_Parent_list($result, $parent_list){\n\t\tglobal $parent_list;\n\t\tif($result){\n\t\t\twhile ($row = mysql_fetch_array($result, MYSQL_NUM)) {\n\t\t\t$parent_list[]=$row[0];\n\t\t\t$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'pages.pid',\t\t\t \t\t\t\t\t\t\t// SELECT ...\n\t\t\t\t'pages',\t\t\t\t\t\t\t\t\t// FROM ...\n\t\t\t\t'pages.uid = '.$row[0].\n\t\t\t\t$this->cObj->enableFields('pages'),\n\t\t\t\t'', \t\t\t\t\t\t\t\t\t\t// GROUP BY...\n\t\t\t\t'', \t\t\t\t\t\t\t\t\t\t// ORDER BY...\n\t\t\t\t'' \t\t\t\t\t\t\t\t\t\t\t// LIMIT to 10 rows, starting with number 5 (MySQL compat.)\n\t\t\t\t);\n\t\t\t$this->get_parent_list($res2, $liste);\n\t\t\t}\n\t\t}\n\t\treturn $parent_list;\n\t}", "public function get_parents()\n {\n $hierarchy = array();\n $hierarchy[] = $this;\n\n $d = dirname($this->path);\n while (strlen($d) >= strlen(App::config('src_path')))\n {\n $hierarchy[] = new folder($d);\n $d = dirname($d);\n }\n\n return array_reverse($hierarchy);\n }", "function getParentCategories(){\n\t\t$categoryId = JRequest::getInt('category_id', 0);\n\t\t$parents = array();\t\t\n\t\twhile ( true ){\n\t\t\t$sql = \"SELECT id, name, parent FROM #__eb_categories WHERE id = \".$categoryId.\" AND published=1\";\n\t\t\t$this->_db->setQuery( $sql );\n\t\t\t$row = $this->_db->loadObject();\n\t\t\tif ($row){\n\t\t\t\t$sql = 'SELECT COUNT(*) FROM #__eb_categories WHERE parent='.$row->id.' AND published = 1 ';\n\t\t\t\t$this->_db->setQuery($sql) ;\n\t\t\t\t$total = $this->_db->loadResult();\n\t\t\t\t$row->total_children = $total ;\t\t\t\t\n\t\t\t\t$parents[] = $row ;\n\t\t\t\t$categoryId = $row->parent ;\t\t\t\t\n\t\t\t} else {\t\t\t\t\t\t\t\n\t\t\t \tbreak;\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn $parents ;\t\n\t}", "public function getGrandparent() {\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_var(\"SELECT parent FROM pages WHERE guid = (SELECT parent FROM pages where guid = '{$this->guid}')\"); \n\t\t\treturn $data;\n\t\t}", "function CreateHierarchyDropdown($current = '', $parent = '', $name = 'parent_id', $allowcurrent = 0, $use_perms = 0, $ignore_current = 0, $allow_all = false)\n\t{\n\t\t$result = '';\n\t\t$userid = -1;\n\n\t\t$allcontent =& ContentOperations::GetAllContent();\n\n\t\tif ($allcontent !== FALSE && count($allcontent) > 0)\n\t\t{\n\t\t\tif( $use_perms )\n\t\t\t {\n\t\t\t $userid = get_userid();\n\t\t\t }\n\t\t\tif( ($userid > 0 && check_permission($userid,'Manage All Content')) || \n\t\t\t $userid == -1 ||\n\t\t\t $parent == -1 )\n\t\t\t {\n\t\t\t $result .= '<option value=\"-1\">'.lang('none').'</option>';\n\t\t\t }\n\t\t\t$curhierarchy = '';\n\n\t\t\tforeach ($allcontent as $one)\n \t\t\t{\n\t\t\t $value = $one->Id();\n\t\t\t if ($value == $current)\n\t\t\t {\n\t\t\t // Grab hierarchy just in case we need to check children\n\t\t\t // (which will always be after)\n\t\t\t $curhierarchy = $one->Hierarchy();\n\t\t\t \n\t\t\t if( !$allowcurrent )\n\t\t\t\t{\n\t\t\t\t // Then jump out. We don't want ourselves in the list.\n\t\t\t\t continue;\n\t\t\t\t}\n\t\t\t $value = -1;\n\t\t\t }\n\n\t\t\t // If it doesn't have a valid link...\n\t\t\t // don't include it.\n\t\t\t if( !$allow_all && !$one->HasUsableLink() )\n\t\t\t {\n\t\t\t continue;\n\t\t\t }\n\n\t\t\t // If it's a child of the current, we don't want to show it as it\n\t\t\t // could cause a deadlock.\n\t\t\t if (!$allowcurrent && \n\t\t\t $curhierarchy != '' && \n\t\t\t strstr($one->Hierarchy() . '.', $curhierarchy . '.') == $one->Hierarchy() . '.')\n\t\t\t {\n\t\t\t continue;\n\t\t\t }\n\n // If we have a valid userid... only include pages where this user\n // has write access... or is an admin user... or has appropriate permission.\n\t\t\t if( $userid > 0 && $one->Id() != $parent)\n\t\t\t {\n\t\t\t if( !check_permission($userid,'Manage All Content') && \n\t\t\t\t !check_authorship($userid,$one->Id()) )\n\t\t\t\t{\n\t\t\t\t continue;\n\t\t\t\t}\n\t\t\t }\t\t\t\t\n\n\t\t\t // Don't include content types that do not want children either...\n\t\t\t if (!$one->WantsChildren()) continue;\n\t\t\t {\n\t\t\t $result .= '<option value=\"'.$value.'\"';\n\t\t\t \n\t\t\t // Select current parent if it exists\n\t\t\t if ($one->Id() == $parent)\n\t\t\t {\n\t\t\t\t$result .= ' selected=\"selected\"';\n\t\t\t }\n\t\t\t \n\t\t\t if( ($value == -1) && ($ignore_current == 0) )\n\t\t\t {\n\t\t\t\t$result .= '>'.$one->Hierarchy().'. - '.$one->Name().' ('.lang('invalid').')</option>';\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t$result .= '>'.$one->Hierarchy().'. - '.$one->Name().'</option>';\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\n\t\t}\n\n\t\tif( !empty($result) )\n\t\t\t{\n\t\t\t\t$result = '<select name=\"'.$name.'\">'.$result.'</select>';\n\t\t\t}\n\n\t\treturn $result;\n\t}", "public function getParentSelectorName();", "public function getParents($field = null)\n\t{\n\t\t$criteria = craft()->elements->getCriteria($this->elementType);\n\t\t$criteria->parentOf($this);\n\t\t$criteria->parentField($field);\n\t\treturn $criteria;\n\t}", "public function all_parent()\r\n\t{\r\n\t\t$query = $this->db->select('*')->get('menu')->result_array(); \r\n\t \treturn $query;\r\n\t}", "public function ddl_parentdetails()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$search = \"SELECT DISTINCT parent_id, label_id, label\r\n\t\t\t\t\t\t\tFROM parents\";\r\n\t\t\t\t$resultq = mysqli_query($link, $search);\r\n\t\t\t\t$sow = array();\r\n\t\t\t\t$sow_arr = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($resultq)) {\t\r\n\t\t\t\t\t$sow['parent_id'] =$row[0];\r\n\t\t\t\t\t$sow['label_id'] =$row[1];\r\n\t\t\t\t\t$sow['label'] =$row[2];\r\n\t\t\t\t\t$fsow_arr[] = $sow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $fsow_arr;\r\n\t\t}", "function locationregion_meta_box() {\n\t\tglobal $post;\n\t\techo wp_dropdown_pages( array(\n\t\t\t'echo' => 0,\n\t\t\t'name' => 'parent_id',\n\t\t\t'post_type' => 'locationregion',\n\t\t\t'selected' => $post->post_parent,\n\t\t\t'show_option_none' => __( '–– None ––', 'loc' ),\n\t\t\t'option_none_value' => 0\n\t\t) );\n\t\twp_nonce_field( 'update_location_locationregion', '_nonce_location_locationregion' );\n\t}", "public function getParentCategoryChild() {\r\n\t\t$childList = '<select id=\"Category[]\" class=\"form-control category sm-width-box tdtab\" name=\"Category[]\">';\r\n\t\t$childList .= '<option value=\"0\" > Select Sub Category</option>'; \r\n\t\tif(isset($_POST['parentid'])){ \r\n\t\t\t$childCat = getCategoryParentChild($_POST['parentid']); \r\n\t\t\t$i=0;\r\n\t\t\tif(isset($childCat) && $childCat != ''){\r\n\t\t\t\tforeach($childCat as $val){\r\n\t\t\t\t\t$childList .= '<option value=\"'.$val->id.'\" > '.$val->title.' </option>';\r\n\t\t\t\t\t$i += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($_POST['parentid'] == 235){\r\n\t\t\t\t$childList .= '<option value=\"addnew\" > Add New Customer </option>';\r\n\t\t\t}\r\n\t\t\t$childList .= '</select>'; \t\t\r\n\t\t}else{\r\n\t\t\t$childList .= '</select>';\t\r\n\t\t}\r\n\t\t//$childList .= '<input class=\"linkRefrence\" type=\"hidden\" value=\"\" name=\"linkRefrence[]\">';\r\n\t\t//$childList .= '<div class=\"input-group drop-downs srch-div\">';\r\n\t\t//$childList .= '<input type=\"textbox\" placeholder=\"Chris\" name=\"linkbankstatment\" required=\"required\" class=\"form-control linkbankstatment\">';\r\n\t\t//$childList .= '<span class=\"glyphicon glyphicon-search ico\" aria-hidden=\"true\"></span>';\r\n\t\t//$childList .= '<div class=\"div-position\" id=\"clientList\" style=\"display:none\">';\r\n\t\t//$childList .= '<ul id=\"clientUl\">';\r\n\t\t//$childList .= '</ul>';\r\n\t\t//$childList .= '</div>';\r\n\t\t//$childList .= '</div>';\r\n\t\techo $childList;\r\n\t}", "function getClientDropdown2()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->parentname]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "private function prepareMenuContentSelectBox() {\r\n\t\t$query = $this->closureModel->getStructureAsBreadcrumbsPath()->fetchPairs(\"id\", \"path\");\r\n\t\treturn $query;\r\n\t}", "function getParentSelectorName() ;", "public function getMenuParents()\n {\n return $this->db->select('*')->from('admin_menu')->where('parent',0)->get()->result_array();\n }", "public function parents ($selector = null) { \r\n\t\t\r\n\t\t$list = new XDTNodeList();\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\twhile (!$node->isSameNode($node->ownerDocument)) {\r\n\t\t\t\t$node = $node->parentNode;\r\n\t\t\t\t\r\n\t\t\t\tif (!($node instanceof DOMElement)) continue;\r\n\t\t\t\t\r\n\t\t\t\t$list->add($node);\r\n\t\t\t}\r\n\t\t\t\r\n\t\tif (!isset($selector)) return $list;\r\n\t\t\r\n\t\t$this->xml_query = $list;\r\n\t\treturn $this->select($selector, null, XDT::SELECT_FILTER);\r\n\t}", "public function getParents()\n {\n return $this->parents;\n }", "static function parentSelector($e, $parent_id, $selfId)\n\t{\n\t\t$h = \"<label for=parent>Родитель</label>\\n<select name='_parent'>\";\n\t\t$h .= \"<option value=''>без родителя</option>\\n\";\n\t\t$m = new Message();\n\t\t$m->action = \"load\";\n\t\t$m->urn = 'urn-'.$e->name;\n\t\t$m->order = $e->defaultorder;\n\t\t// $m->_parent = 'NULL';\n\t\t//$m->_parent = $parent_id;\n\t\t//if ($e->has_field('ordered')) $m->order = array('ordered'=>'ASC');\n\t\t$ds = $m->deliver();\n\t\t$ds->treesort(); // TREESORT\n\t\t/*\n\t\tforeach ($ds as $p)\n\t\t{\n\t\t\t$sel = '';\n\t\t\tif ($parent_id == $p->id) $sel = 'SELECTED';\n\t\t\t$h .= \"<option data-type='treeroot' $sel value='{$p->id}'>{$p->title}</option>\\n\";\n\t\t}\n\t\t*/\n\t\t$h .= dataset2htmloptions($ds, array(\"urn-{$e->name}-{$parent_id}\"),0, $selfId);\n\t\t$h .= \"</select>\";\n\t\treturn \"<div style='margin: 5px; border: 0px solid red;'>\" . $h . \"</div>\\n\";\n\t}", "protected function getParentPageID(){\n if( $this->displayBeneath == self::DISPLAY_PAGES_BENEATH_CURRENT ){\n return Page::getCurrentPage()->getCollectionID();\n }\n return $this->parentPageID;\n }", "public function getParentPages($pageID){\n\t\t\t#we don't want getRecordByID to return JSON\n\t\t\t$tempAjax = $this->ajax;\n\t\t\t$this->ajax = false;\n\t\t\t\n\t\t\t#first time through our $pageID is numeric\n\t\t\tif(is_numeric($pageID)) $pageID = array($pageID);\n\t\t\t\n\t\t\t$tempPage = $this->getRecordByID($pageID[0]);\n\t\t\t$tp = mysqli_fetch_assoc($tempPage);\n\t\t\t#change back to what it was\n\t\t\t$this->ajax = $tempAjax;\n\n\t\t\t#not a root page\n\t\t\tif(is_numeric($tp[\"parentPageID\"])){\n\t\t\t\t$tempArray = array($tp[\"parentPageID\"]);\n\t\t\t\t$tempMerged = array_merge($tempArray,$pageID);\n\t\t\t\treturn $this->getParentPages($tempMerged);\n\t\t\t}\n\t\t\t#return root page\n\t\t\telse{\n\t\t\t\treturn $pageID;\n\t\t\t}\n\t\t}", "function _wswwpx_page_get_child_ids ( $parent = 0 ) {\n\tglobal $wpdb;\n\tif ( $parent > 0 ) {\n\t\t// Get the ID of the parent.\n\n\t\t$results = $wpdb->get_results(\"\n\t \t\t\t\t\t\t\tSELECT ID\n\t \t\t\t\t\t\t\t\t FROM $wpdb->posts\n\t \t\t\t\t\t\t\t\t WHERE post_parent = $parent\", ARRAY_N );\n \t\tif ($results) {\n\t\t\tforeach ($results AS $r) {\n\t\t\t \tforeach ($r AS $v) {\n\t\t\t \t\t$result[] = $v;\n\t\t\t \t}\n\t\t\t }\n\t\t} else {\n\t\t\t$result = false;\n\t\t}\n\t} else {\n\t\t// ... or set a zero result.\n\t\t$pages = get_pages();\n\t\tforeach ($pages AS $page) {\n\t\t\t$result[]=$page->ID;\n\t\t}\n//\t\t$result = 0;\n\t}\n\t//\n\treturn $result;\n}", "function getClientDropdown()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->compid]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "public function getParentMenuArr() {}", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "protected function getAllParents()\n {\n if ($this->params('parent')) {\n return [\n $this->params('parent') => $this->params('idParent'),\n ];\n } else {\n return [\n $this->params('parent1') => $this->params('idParent1'),\n $this->params('parent2') => $this->params('idParent2'),\n $this->params('parent3') => $this->params('idParent3'),\n ];\n }\n }", "private function getParentsFilter() : string\n {\n return empty($this->parent) ? '' : ' AND \\'' . $this->parent . '\\' in parents';\n }", "public function getAncestors();", "function get_ancestors($object_id = 0, $object_type = '', $resource_type = '')\n {\n }", "private function find_parent($rows, $parent)\r\n {\r\n foreach($rows as $k => $row)\r\n {\r\n if ($row['id'] == $parent){\r\n\t\t\t\t// found parent\r\n $this->config['path'][] = $row['name'];\r\n\t\t\t\t// has parent, then find next\r\n if(!empty($row['parent_id']))\r\n {\r\n $this->config['slug'] = $row['slug'];\r\n $this->find_parent($rows, $row['parent_id']);\r\n }\r\n }\r\n }\r\n }", "public function parentOf($parent){\n\t\t/*$parents = func_get_args();\n\t\tforeach($parents as $parent){\n\t\t\tif(!in_array($parent, $this->_parentOf)){\n\t\t\t\t$this->_parentOf[] = $parent;\n\t\t\t}\n\t\t}*/\n\t}", "public function get_no_parents ()\r\n\t{\r\n\t\t$this->db->select('id, title, menu_id');\r\n\t\t$this->db->where('parent_id', 0); \r\n\t\t$pages = parent::get();\r\n\t\t// Return key => value pair array\r\n\t\t$array = array(\r\n\t\t\t0 => 'Top Level'\r\n\t\t);\r\n\t\tif (count($pages)) {\r\n\t\t\tforeach ($pages as $page) {\r\n\t\t\t $array[$page->id] = $page->title;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $array;\r\n\t}", "public function getParentSelectorName() {}", "function wp_find_hierarchy_loop($callback, $start, $start_parent, $callback_args = array())\n {\n }", "public function getParents()\n {\n return Menu::where('locale', getCurrentSessionAppLocale())\n ->where(function ($query){\n $query->whereNull('parent_slug')\n ->orWhere('parent_slug', '');\n })\n ->orderBy('menu_order', 'asc')\n ->get();\n }", "function acf_walk_select_input($choices = array(), $values = array(), $depth = 0)\n{\n}", "function _create_selection_list_wiki_page_tree(&$wiki_seen, $select, $id, $breadcrumbs, $title, $use_compound_list = false, $ins_format = false)\n{\n $wiki_seen[] = $id;\n\n $sub_breadcrumbs = ($breadcrumbs == '') ? ($title . ' > ') : ($breadcrumbs . $title . ' > ');\n\n $rows = $GLOBALS['SITE_DB']->query_select('wiki_children', array('*'), array('parent_id' => $id), 'ORDER BY title', intval(get_option('general_safety_listing_limit'))/*reasonable limit*/);\n $compound_list = strval($id) . ',';\n $_below = new Tempcode();\n foreach ($rows as $i => $myrow) {\n if (!in_array($myrow['child_id'], $wiki_seen)) {\n if (!has_category_access(get_member(), 'wiki_page', strval($myrow['child_id']))) {\n continue;\n }\n\n if (is_null($myrow['title'])) {\n $temp_rows = $GLOBALS['SITE_DB']->query_select('wiki_pages', array('title'), array('id' => $myrow['child_id']), '', 1);\n $myrow['title'] = get_translated_text($temp_rows[0]['title']);\n $rows[$i]['title'] = $myrow['title'];\n $GLOBALS['SITE_DB']->query_update('wiki_children', array('title' => $myrow['title']), array('parent_id' => $id, 'child_id' => $myrow['child_id']));\n }\n $below = _create_selection_list_wiki_page_tree($wiki_seen, $select, $myrow['child_id'], $sub_breadcrumbs, $myrow['title'], $use_compound_list, $ins_format);\n if ($use_compound_list) {\n list($below, $_compound_list) = $below;\n $compound_list .= $_compound_list;\n }\n $_below->attach($below);\n }\n }\n\n /*$out = form_input_list_entry(strval($id), ($select == $id), do_template('WIKI_LIST_TREE_LINE', array('_GUID' => 'd9d4a951df598edd3f08f87be634965b', 'BREADCRUMBS' => $breadcrumbs, 'TITLE' => $title, 'ID' => $id)));\n $out = '<option value=\"' . (!$use_compound_list ? $id : $compound_list) . '\">' . $breadcrumbs . escape_html($title) . '</option>' . \"\\n\";\n $out .= $_below;*/\n $out = form_input_list_entry(((!$use_compound_list) ? strval($id) : $compound_list) . ($ins_format ? ('!' . $title) : ''), false, $breadcrumbs . $title);\n $out->attach($_below);\n\n if ($use_compound_list) {\n return array($out, $compound_list);\n } else {\n return $out;\n }\n}", "function Ancestors($page) {\n\n\t\t$breadcrumbs = array();\n\n\t\tif ( $page->URLSegment == 'home' )\n\t\t\treturn $breadcrumbs;\n\n\t\t//Debug::Log( 'Ancestors: ' . $page->ID . ' - ' .$page->MenuTitle . ' has parent ' . $page->ParentID );\n\n\t\t// Add ancestor pages to the array\n\t\tif ( $page->ParentID )\n\t\t\t$breadcrumbs += $this->Ancestors( $page->Parent() );\n\n\t\t// Add the page to the array\n\t\tif ( get_class($page) != 'SubmenuHolder' )\n\t\t\t$breadcrumbs[] = $page;\n\n\t\treturn $breadcrumbs;\n\t}", "function kilman_get_parent ($question) {\n global $DB;\n $qid = $question->id;\n $parent = array();\n $dependquestion = $DB->get_record('kilman_question', ['id' => $question->dependquestionid],\n 'id, position, name, type_id');\n if (is_object($dependquestion)) {\n $qdependchoice = '';\n switch ($dependquestion->type_id) {\n case QUESRADIO:\n case QUESDROP:\n case QUESCHECK:\n $dependchoice = $DB->get_record('kilman_quest_choice', ['id' => $question->dependchoiceid], 'id,content');\n $qdependchoice = $dependchoice->id;\n $dependchoice = $dependchoice->content;\n\n $contents = kilman_choice_values($dependchoice);\n if ($contents->modname) {\n $dependchoice = $contents->modname;\n }\n break;\n case QUESYESNO:\n switch ($question->dependchoiceid) {\n case 0:\n $dependchoice = get_string('yes');\n $qdependchoice = 'y';\n break;\n case 1:\n $dependchoice = get_string('no');\n $qdependchoice = 'n';\n break;\n }\n break;\n }\n // Qdependquestion, parenttype and qdependchoice fields to be used in preview mode.\n $parent [$qid]['qdependquestion'] = 'q'.$dependquestion->id;\n $parent [$qid]['qdependchoice'] = $qdependchoice;\n $parent [$qid]['parenttype'] = $dependquestion->type_id;\n // Other fields to be used in Questions edit mode.\n $parent [$qid]['position'] = $question->position;\n $parent [$qid]['name'] = $question->name;\n $parent [$qid]['content'] = $question->content;\n $parent [$qid]['parentposition'] = $dependquestion->position;\n $parent [$qid]['parent'] = $dependquestion->name.'->'.$dependchoice;\n }\n return $parent;\n}", "public function getParentCategory() {\r\n\t\t$postID = $_POST['id'];\r\n\t\t$parentList = '<select id=\"ExpenseCategory[]\" class=\"form-control xxx ExpenseCategory exParentCat\" name=\"ExpenseParentCategory[]\">';\r\n\t\t$parentList .= '<option value=\"-1\" > Select Sub Category</option>'; \r\n\t\t$parentCat = getCategoryParent($_POST['CatType']); \r\n\t\tif( !empty( $parentCat ))\r\n\t\t{\r\n\t\t\tforeach($parentCat as $val){\r\n\t\t\t\tif( getCategoryParentId($postID) == $val->id)\r\n\t\t\t\t\t$parentList .= '<option value=\"'.$val->id.'\" selected=\"selected\"> '.$val->title.' </option>';\r\n\t\t\t\telse\t\r\n\t\t\t\t\t$parentList .= '<option value=\"'.$val->id.'\" > '.$val->title.' </option>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$parentList .= '</select>'; \r\n\t\techo $parentList; \r\n\t}", "private function getNodeParents(&$node)\n\t{\n\t\t// It is already checked in the caller whether this $node is a context with Practices\n\t\t// pointing to it, that is not the case since this function is called.\n\t\n\t\t// Is $node an IE with Part-of, skosembroader or Context prop?\n\t\t$query = \"[[Category:Intentional Element]][[{$node->getName()}]]|?\".PARTOFPROPERTY.\"|?\".SKOSEMBROADERPROPERTY.\"|?\".CONTEXTPROPERTY;\n\t\t//FIXME: SKOSEMBROADER should be SKOSBROADER, but will not work in printout section, use page selection part, possibly reversed query for the prop? prop::thispage?\n\t\t$result = $this->askAPI->ask($query);\n\t\tif(count($result['query']['results']) > 0){\n\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\n\t\t\t/* EXPERIMENTAL! JIRA EMT-276 Background: if there are contexts (of this IE $node), they \n\t\t\t * should be prefered (before taking partofs and skosembroaders into account) \n\t\t\t * TODO WME: discuss with HdB*/\n\t\t\t$parents = $this->getNodesFromQueryResult($result[CONTEXTPROPERTY]);\n\t\t\t\n\t\t\tif(count($parents) == 0){\t\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[PARTOFPROPERTY]);\n\t\t\t}\n\t\t\tif(count($parents) == 0){\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[SKOSEMBROADERPROPERTY]);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//not an IE and no practices pointing to it, is it a context which has a supercontext?\n\t\t\t$query = \"[[Category:Context]][[{$node->getName()}]]|?\".SUPERCONTEXTPROPERTY;\n\t\t\t$result = $this->askAPI->ask($query);\n\t\t\tif(count($result['query']['results']) > 0){\n\t\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\t$parents = $this->getNodesFromQueryResult($result[SUPERCONTEXTPROPERTY]);\n\t\t\t}\n\t\t\telse{\t//no: is it a practice which has a part-of?\n\t\t\t\t//NB add contextproperty for breadcrumb fixing, see below\n\t\t\t\t$query = \"[[Category:Practice]][[{$node->getName()}]]|?\".PARTOFPROPERTY.\"|?\".CONTEXTPROPERTY;\n\t\t\t\t$result = $this->askAPI->ask($query);\n\t\t\t\tif(count($result['query']['results']) > 0){\n\t\t\t\t\t$result = $result['query']['results'][$node->getName()]['printouts'];\n\t\t\t\t\t//breadcrumb fixing: if this node has breadcrumb value \"practice\" then replace it by a list \n\t\t\t\t\t//of Context property values (there may be more than one Context value, isn't it?)\n\t\t\t\t\tif($node->getBreadCrumb() == \"practice\")\n\t\t\t\t\t\t$node->setBreadCrumb($this->getNodesFromQueryResult($result[CONTEXTPROPERTY]));\n\t\t\t\t\t$parents = $this->getNodesFromQueryResult($result[PARTOFPROPERTY], \"practice\");\n\t\t\t\t}\n\t\t\t\t// else: NO PARENTS FOUND\n\t\t\t}\n\t\t}\n\t\treturn $parents;\t//return array with parent elements found\n\t}", "function dbQuerySectionIdSet()\n {\n $resultset = $this->dbQuery(\"SELECT id, mtitle FROM section ORDER BY mtitle\");\n\n $parents[0] = 'Root';\n\n if (isset ($resultset))\n {\n foreach ($resultset as $key => $val)\n {\n $parents[$val['id']] = stripslashes($val['mtitle']);\n }\n }\n\n return $parents;\n }", "function showParentCategoriesForSearch( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tcategory_title asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "function _erpal_book_helper_get_menu_parents($router_item) {\n $crm_global = _erpal_basic_helper_has_context(ERPAL_CONTEXT_BOOK_GLOBAL, $router_item);\n \n if ($crm_global) {\n return 'books/books';\n }\n}", "function navegacao_paginas_internas() { \n\n // creditos: http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-child-pages-for-a-parent-page-in-wordpress/\n \n global $post; \n // $pai = wp_get_post_parent_id( $post->ID );\n $parent_post = wp_get_post_parent_id($post->ID);\n $parent_name = get_the_title($parent_post);\n $parent_link = get_the_permalink($parent_post);\n \n if ( is_page() && $post->post_parent )\n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0&depth=1' );\n else\n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0&depth=1' );\n\n if ( $childpages ) {\n $string = '<div class=\"navegacao-interna\">Mais sobre <a href=\"'.$parent_link.'\">'.$parent_name.'</a>:&nbsp; '.$childpages.'</div>';\n }\n \n return $string;\n \n}", "function getParentText();", "public function getParent()\n {\n return 'choice';\n }", "public function get_admin_module_parents()\n\t{\n\t\t$this->db->where(array('module_user' => 1, 'module_parent' => 0));\n\t\t$this->db->order_by('module_position');\n\t\treturn $this->db->get('module');\n\t}", "public function getParentBranch(Request $request)\n {\n $tree_id = $request->input('tree');\n $id = $request->input('id');\n\n return view('admin.research._branch_select', [\n 'tree' => Tree::find($tree_id),\n 'research' => Research::find($id),\n 'prereq_branches' => Research::orderBy('name')->where('id', '!=', $id)->where('tree_id', $tree_id)->pluck('name', 'id')->toArray()\n ]);\n }", "function getChildRubrique_article($idRubrique,$niveau,$rub_selected)\n{\n\t$req = mysql_query(\"SELECT * FROM RUBRIQUE WHERE id_mere=\".$idRubrique);\n\t$niveau++;\n\twhile ($rubrique=mysql_fetch_array($req)) {\n\t\tif($rubrique['id_rubrique']!=null){\n\t\t\t$selected = \"\";\n\t\t\tif($rub_selected == $rubrique['id_rubrique'])\n\t\t\t\t$selected = \"selected='selected'\";\n\t\t\techo \"<option value='\".$rubrique['id_rubrique'].\"'\".$selected.\">\";\n\t\t\tfor($i=0;$i<$niveau;$i++){\n\t\t\t\techo \"----\";\n\t\t\t}\n\t\t\techo \">\";\n\t\t\techo $rubrique['titreFR_rubrique'].\"</option>\";\n\t\t\tgetChildRubrique_article($rubrique[0],$niveau,$rub_selected);\n\t\t}\n\t}\n}", "function kilman_get_parent_positions ($questions) {\n $parentpositions = array();\n foreach ($questions as $question) {\n foreach ($question->dependencies as $dependency) {\n $dependquestion = $dependency->dependquestionid;\n if (isset($dependquestion) && $dependquestion != 0) {\n $childid = $question->id;\n $parentpos = $questions[$dependquestion]->position;\n\n if (!isset($parentpositions[$childid])) {\n $parentpositions[$childid] = $parentpos;\n }\n if (isset ($parentpositions[$childid]) && $parentpos > $parentpositions[$childid]) {\n $parentpositions[$childid] = $parentpos;\n }\n }\n }\n }\n return $parentpositions;\n}", "public function getParentClasses(string $class);", "public function getPageFolders();", "function get_select($parent = NULL, $nothing_value = NULL)\n\t{\n \t\t$data = array();\n\t\t\n\t\tif ( ! is_null($nothing_value))\n\t\t\t$data = array('' => $nothing_value);\n\n\t\tif ( ! is_null($parent))\n\t\t\t$this->{$this->db_group}->where('parent', $parent);\n\n \t\t$this->{$this->db_group}->order_by('ordering', 'ASC');\n\t\t\t\n\t\t$query = $this->{$this->db_group}->get($this->table);\n\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result_array();\n\t\t\t\n\t\t\tforeach($result as $item)\n\t\t\t{\n\t\t\t\t$data[$item['id_type']] = $item['title'];\n\t\t\t}\n\t\t}\t\t\t\n\n\t\treturn $data;\n\t}", "function _wswwpx_page_get_ancestor_ids ( $child = 0, $inclusive=true, $topdown=true ) {\n \tif ( $child && $inclusive ) $ancestors[] = $child;\n \twhile ($parent = _wswwpx_page_get_parent_id ( $child ) ) {\n \t\t$ancestors[] = $parent;\n \t\t$child = $parent;\n \t}\n \t//\tIf there are ancestors, test for resorting, and apply\n \tif ($ancestors && $topdown) krsort($ancestors);\n\tif ( !$ancestors ) $ancestors[] = 0;\n \t//\n \treturn $ancestors;\n }", "public function getParentMenuItem() {}" ]
[ "0.65439755", "0.64416367", "0.6376704", "0.6268239", "0.6172778", "0.6162202", "0.6142517", "0.6124593", "0.6118205", "0.6088184", "0.6065478", "0.6009062", "0.587701", "0.5870825", "0.58507276", "0.58234084", "0.57657063", "0.57542336", "0.5638678", "0.5595661", "0.557677", "0.55720484", "0.5566457", "0.5543531", "0.5537922", "0.5536662", "0.55333835", "0.5531712", "0.5526642", "0.55223346", "0.5504137", "0.547065", "0.5464978", "0.5457604", "0.5447323", "0.5439186", "0.54353535", "0.54352176", "0.54015666", "0.5395571", "0.5391694", "0.5357139", "0.5353072", "0.5341732", "0.5327627", "0.5325499", "0.53032625", "0.53021294", "0.52939963", "0.5281399", "0.5267905", "0.5267667", "0.52663857", "0.52635837", "0.5263463", "0.52622527", "0.5257801", "0.5257685", "0.5240808", "0.5234118", "0.52332586", "0.52243257", "0.5220033", "0.5210919", "0.5206953", "0.52062404", "0.51990646", "0.5193807", "0.5174496", "0.51707435", "0.51695263", "0.5159076", "0.5152104", "0.51477885", "0.5138664", "0.51384723", "0.51382595", "0.51320434", "0.5128291", "0.5124092", "0.5122692", "0.5115743", "0.5109707", "0.5109364", "0.5106678", "0.5104516", "0.51045114", "0.510053", "0.50970614", "0.5085265", "0.50793725", "0.5072672", "0.50715524", "0.507046", "0.5062596", "0.5059618", "0.5059073", "0.50525576", "0.5047653", "0.50414354", "0.5037433" ]
0.0
-1
Mark a page(s) as published
function publish($ids) { if (!is_array($ids)) { $ids = array(intval($ids)); } $ids = join(', ', $ids); $this->query("UPDATE {$this->useTable} SET draft = 0 WHERE id IN ($ids)"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function has_published_pages()\n {\n }", "public function setPublished()\n\t{\n\t\t$this->published_at = $this->published_at ? $this->published_at : Carbon::now();\n\t\t$this->save();\n\t}", "public function setPublished( $published );", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published);", "public function setPublished($published) {\n\t\t$this->published = $published;\n\t}", "function block_core_calendar_update_has_published_posts()\n {\n }", "function publish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\t/* This method formerly updated the published_date, but that was removed in \n\t\t * favor of giving manual control of the published_date to the author\n\t\t * $this->saveField('published_date', date('Y-m-d', time()).' 00:00:00') */\n\t\treturn $this->saveField('is_published', 1);\n\t}", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "function isPublished(){\n\t\tif($this->isPublished == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isPublished()\n {\n if (\n $this->getStatus() === PageStatus::PUBLISHED ||\n ($this->getStatus() === PageStatus::SCHEDULED &&\n $this->getPublishedAt() < new \\DateTime())\n ) {\n return true;\n } else {\n return false;\n }\n }", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function isPublished();", "public function publish(Page $page)\n {\n $status = ((int)$page->status > 0) ? 0 : 1;\n $action = ((int)$page->status > 0) ? 'Un Published' : 'Published';\n $page->status = $status;\n $page->save();\n return response()->json([\n 'status' => 'success',\n 'message' => 'Page successfully '.$action.'.',\n ]);\n }", "public function isPublished()\n {\n if(!strcmp($this->getStatus(), 'approved')) {\n return true;\n }\n\n return false;\n }", "public function updatePublishedAt() {\n\t\tif (!$this->private && !$this->published_at) {\n\t\t\t$this->published_at = $this->updated_at;\n\t\t}\n\t}", "public function isPublished(): bool\n {\n $publishedStatus = ['publish'];\n\n return in_array($this->status, $publishedStatus);\n }", "function block_core_calendar_has_published_posts()\n {\n }", "public function isPublished()\n {\n return $this->publish_status == Status::PUBLISHED;\n }", "public function isPublished()\n {\n return $this->postID > 0;\n }", "public function setPublish($publish)\n {\n $this->publish = (bool) $publish;\n }", "function isPublished() {\n\t\tif ($this->status == 'published') {\n\t\t\t$now = time();\n\t\t\tif ($this->datePublish <= $now) {\n\t\t\t\tif ($this->dateUnpublish > $now || $this->dateUnpublish == null) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function testIndexWhenPageSetPublic()\n {\n\n // Add a private page.\n $page = $this->_simplePage(false);\n\n // Set the page public.\n $page->is_published = true;\n $page->save();\n\n // Should add a Solr document.\n $this->_assertRecordInSolr($page);\n\n }", "public function hasPublished() {\n return $this->_has(14);\n }", "public function isPublished()\n {\n return $this->status == static::PUBLISHED;\n }", "public function hasPublished() {\n return $this->_has(6);\n }", "public static function publish($id = 0) {\n global $database;\n global $session;\n //get this sort id\n $obj = static::find_by_id($id);\n if ($obj->publish == 0) {\n //update records id\n $sql = \"UPDATE \" . static::$table_name . \" SET publish=1 WHERE id = \" . $database->escape_value($obj->id);\n // Run Queries\n $database->query($sql);\n }\n }", "public function isPublished()\n {\n return ($this->published == 1);\n }", "public function isPublishedField()\n {\n return $this->get('check_publish') == 1;\n }", "public function testPublished()\n {\n $feed = $this->eventFeed;\n\n // Assert that all entry's have an Atom Published object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getPublished() instanceof Zend_Gdata_App_Extension_Published);\n }\n\n // Assert one of the entry's Published dates\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"published\", \"text\", \"2007-05-09T16:44:38.000Z\");\n }", "function publish( )\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$db\t\t= &JFactory::getDBO();\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid, array(0));\n\n\t\t$publish = ( $this->getTask() == 'publish' ? 1 : 0 );\n\t\t$client = JRequest::getWord( 'filter_client', 'site' );\n\n\t\tif (count( $cid ) < 1)\n\t\t{\n\t\t\t$action = $publish ? JText::_( 'publish' ) : JText::_( 'unpublish' );\n\t\t\tJError::raiseError(500, JText::_( 'Selecione um evento para '.$action ) );\n\t\t}\n\n\t\t$cids = implode( ',' , $cid );\n\n\t\t$query = 'UPDATE #__p22eventos_palestras SET aprovado = '.(int) $publish\n\t\t. ' WHERE id IN ( '.$cids.' )'\n\t\t;\n\t\t$db->setQuery( $query );\n\n\t\tif ( !$db->query() )\n\t\t{\n\t\t\tJError::raiseError(500, $db->getErrorMsg() );\n\t\t}\n\n\t\t$idevento = JRequest::getInt( 'idevento' );\n\n\t\t$link = 'index.php?option=com_p22evento&task=avaliacao&idevento=' . intval( $idevento ) . '#div_palestra_' . $cid[0];\n\t\t$this->setRedirect( $link );\n\t}", "public function isPublished()\n {\n return $this->attribute('state') == self::STATUS_PUBLISHED;\n }", "public function getAllPublished();", "function unpublish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->saveField('is_published', 0);\n\t}", "public function isPublished()\n {\n return $this->published_at->lte(Carbon::now());\n }", "public function future_to_published($post) {\n\t\t\n\t\tdefine(\"WPU_JUST_POSTED_{$postID}\", TRUE);\n\t\t$this->handle_new_post($post->ID, $post, true);\n\t}", "public function publish($id)\n\t{\n\t\t$pub = Tender::find($id);\n\t\t$pub->update(['is_published'=>($pub->is_published)?0:1]);\n\t\treturn Redirect::route('tenders.admin');\n\n\t}", "private function isPageInPublishedData( $page )\n\t{\n\t\tif ( isset( $page ) === false )\n\t\t{\n\t\t\t$page = $this->request['file'];\n\t\t}\n\n\t\treturn in_array( $page, $this->site['pages'] );\n\t}", "public function SetPublished(\n $in_published_search\n // The value to set. It can be:\n // - -1 Search for ONLY unpublished meetings\n // - 0 Search for published and unpublished meetings.\n // - 1 Search for ONLY published meetings.\n ) {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->_published_search = $in_published_search;\n }", "public function togglePublished()\n {\n if ($this->isActive()) {\n $this->is_published = false;\n } else {\n $this->is_published = true;\n }\n\n return $this->save();\n }", "public function actionSchedulePublish()\n {\n $this->publishUnpublishSchedule(Story::STATUS_PUBLISHED, Story::STATUS_SCHEDULE);\n }", "public function published()\n {\n $published = [];\n\n foreach ($this->items as $path => $slug) {\n $page = $this->pages->get($path);\n if ($page !== null && $page->published()) {\n $published[$path] = $slug;\n }\n }\n $this->items = $published;\n\n return $this;\n }", "public function isPublished()\n {\n if ($this->getStatus() === self::PUBLISHED) {\n return true;\n }\n\n if ($this->getStatus() === self::SCHEDULED) {\n return $this->getPublishedAt() <= new \\DateTime();\n }\n\n return false;\n }", "public function isPublished()\n {\n # code...\n return !is_null($this->published_at) && $this->published_at < today();\n }", "function check_and_publish_future_post($post)\n {\n }", "public function publishedPage()\n\t{\n\t\treturn $this->hasOne(Page::class, 'revision_id')->where('version', Page::STATE_PUBLISHED);\n\t}", "public function pages_awaiting_publishing()\n {\n if(isset($this->pages_awaiting_publishing)) return $this->pages_awaiting_publishing;\n $this->pages_awaiting_publishing = 0;\n \n $events_to_publish = array();\n $result = $this->mysqli_slave->query(\"SELECT he.resource_id, max(he.id) max FROM harvest_events he GROUP BY he.resource_id\");\n while($result && $row=$result->fetch_assoc())\n {\n $harvest_event = new HarvestEvent($row['max']);\n if(!$harvest_event->published_at) $events_to_publish[] = $harvest_event->id;\n }\n \n $result = $this->mysqli_slave->query(\"SELECT COUNT(DISTINCT(tc.id)) count FROM harvest_events_hierarchy_entries hehe JOIN hierarchy_entries he ON (hehe.hierarchy_entry_id=he.id) JOIN taxon_concepts tc ON (he.taxon_concept_id=tc.id) WHERE hehe.harvest_event_id IN (\".implode($events_to_publish, \",\").\") AND tc.published=0 AND tc.vetted_id=\". Vetted::find(\"trusted\"));\n if($result && $row=$result->fetch_assoc()) $this->pages_awaiting_publishing = $row['count'];\n return $this->pages_awaiting_publishing;\n }", "protected function hasAccessOnPublished()\n\t{\n\t\treturn $this->User->hasAccess($GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . '::published', 'alexf');\t\t\n\t}", "public function setPublishedAt($publishedAt): void\n {\n $this->_publishedAt = $publishedAt;\n }", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "private function updatePublishOnDate()\n {\n $this->owner->PublishOnDate = $this->owner->DesiredPublishDate;\n // Remove the DesiredPublishDate.\n $this->owner->DesiredPublishDate = null;\n }", "public function publish();", "public function publish();", "function publish()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid);\n\n\t\tif (count( $cid ) < 1) {\n\t\t\tJError::raiseError(500, JText::_( 'Select an item to publish' ) );\n\t\t}\n\n\t\t$model = $this->getModel('weblink');\n\t\tif(!$model->publish($cid, 1)) {\n\t\t\techo \"<script> alert('\".$model->getError(true).\"'); window.history.go(-1); </script>\\n\";\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks' );\n\t}", "public function onPublishPage($data) {\n return $this->worker()->onPublishPage($data);\n }", "private function publishToggle(Request $request){\n\t\t$class ='\\App\\\\'.$request->class;\n\t\t$data = $class::find($request->id);\n\t\t$data->published = !$data->published;\n\t\t$data->save();\n\t}", "public function publish()\n {\n $this->published = true;\n\n return $this;\n }", "public function getAllPublished()\n {\n $result = $this->getManyBy('status', 'publish');\n\n return $result;\n }", "public function published($id) {\n $affected_row = Property::where('id', $id)\n ->update(['publication_status' => 1]);\n\n if (!empty($affected_row)) {\n return redirect('/setting/properties')->with('message', 'Published successfully.');\n }\n return redirect('/setting/properties')->with('exception', 'Operation failed !');\n }", "function publish($cid = array(), $publish = 1)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (count( $cid ))\n\t\t{\n\t\t\t// This is already done by controller task / caller but redo\n\t\t\t$cid = ArrayHelper::toInteger($cid);\n\t\t\t$cid_list = implode(',', $cid);\n\n\t\t\t$query = 'UPDATE #__' . $this->records_dbtbl\n\t\t\t\t. ' SET published = ' . (int) $publish\n\t\t\t\t. ' WHERE id IN ('. $cid_list .')'\n\t\t\t\t. ' AND ( checked_out = 0 OR checked_out IS NULL OR ( checked_out = ' . (int) $user->get('id'). ' ) )'\n\t\t\t;\n\t\t\t$this->_db->setQuery( $query );\n\t\t\t$this->_db->execute();\n\t\t}\n\t\treturn $cid;\n\t}", "public function publishadmin(){\n $post = Products::where('id', \\request(\"id\"))->first();\n $post->published = $post->published==\"unpublished\"?\"Publish\":\"unpublished\";\n $post->save();\n return redirect(route('voyager.h-products.index'));\n }", "public static function published()\n {\n // return self::where('published',1)->get();\n return self::where('published',true);\n }", "public function publish($ids, $state)\n {\n $ids = array_intersect($ids, $this->getItems(true));\n\n try {\n Db::query(\"UPDATE \" . $this->table\n . \"\\n SET published = '\" . (int)$state . \"'\"\n . \"\\n WHERE id IN (\" . implode(',', $ids) . \") \");\n } catch (\\Exception $e) {\n return false;\n }\n\n return true;\n }", "public function mark_pubdates() {\n \n // what's our pubdate going to be?\n $pubdate = date('Y-m-d');\n echo '<pre>'; echo $pubdate; echo '</pre>';\n \n // get everything \"new\"\n $cutoff = strtotime('-36 hours');\n $nodes = [];\n $q = 'SELECT nid, title FROM {node_field_data} ';\n $q .= 'WHERE created > :cutoff ';\n $args = [':cutoff' => $cutoff];\n $result = db_query($q, $args);\n while ($r = $result->fetchAssoc()) {\n $nodes[$r['nid']] = $r['title'];\n }\n echo '<pre>'; var_dump($nodes); echo '</pre>';\n \n // loop through those\n foreach ($nodes as $id => $title) {\n echo $title . ' (' . $id . ') ';\n \n $node = \\Drupal\\node\\Entity\\Node::load($id);\n \n $node_pubdate = $node->get('field_publish_date')->getString();\n echo $node_pubdate . ' ';\n if ($node_pubdate == '') {\n // set the pubdate\n echo 'SETTING';\n $node->set('field_publish_date', $pubdate);\n $node->save();\n }\n echo '<br />';\n \n }\n \n \n exit;\n \n }", "private function set_files_by_published()\n\t\t{\n\t\t\t$this->files = Filesystem::ls(PATH_POSTS, '*.*.*.*.NULL.*.*.*.*.*.*', 'xml', false, false, true);\n\t\t\t$this->files_count = count( $this->files );\n\t\t}", "public function shouldBePublished()\n {\n return $this->publish;\n }", "public function isPublished()\n\t{\n\t\treturn ($this->get('published') == self::STATE_PUBLISHED);\n\t}", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 0 ){\n\t\t\t\t\tupdate_option('blog_public', 1);\n\t\t\t\t}\n\t\t\t}", "public function givenAPublished($event);", "function block_core_calendar_update_has_published_posts() {\n\tglobal $wpdb;\n\t$has_published_posts = (bool) $wpdb->get_var( \"SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1\" );\n\tupdate_option( 'wp_calendar_block_has_published_posts', $has_published_posts );\n\treturn $has_published_posts;\n}", "public function testIsPublishScheduled()\n {\n $page = SiteTree::create();\n $page->Title = 'My page';\n $page->PublishOnDate = '2010-01-01 00:00:00';\n $page->AllowEmbargoedEditing = false;\n $page->write();\n\n $this->assertFalse($page->getIsPublishScheduled());\n\n $page->PublishOnDate = '2016-02-01 00:00:00';\n DBDatetime::set_mock_now('2016-01-16 00:00:00');\n $this->assertTrue($page->getIsPublishScheduled());\n\n DBDatetime::set_mock_now('2016-02-16 00:00:00');\n $this->assertFalse($page->getIsPublishScheduled());\n }", "function wp_publish_post($post)\n {\n }", "public function onBeforePublish() {\n if (false == $this->owner->ShowInSearch)\n {\n if ($this->owner->isPublished())\n {\n $liveRecord = \\Versioned::get_by_stage(get_class($this->owner), 'Live')->byID($this->owner->ID);\n if ($liveRecord->ShowInSearch != $this->owner->ShowInSearch)\n {\n $this->doDeleteDocument();\n }\n }\n }\n }", "function set_public_status(){\n\t\t\t\tif (get_option( 'blog_public' ) == 1 ){\n\t\t\t\t\tupdate_option('blog_public', 0);\n\t\t\t\t}\n\t\t\t}", "function test_has_published_pages_when_nav_menus_created_posts() {\n\t\tforeach ( get_pages() as $page ) {\n\t\t\twp_delete_post( $page->ID, true );\n\t\t}\n\t\t$this->assertFalse( $this->manager->has_published_pages() );\n\n\t\twp_set_current_user( $this->factory()->user->create( array( 'role' => 'editor' ) ) );\n\t\t$this->manager->nav_menus->customize_register();\n\t\t$setting_id = 'nav_menus_created_posts';\n\t\t$setting = $this->manager->get_setting( $setting_id );\n\t\t$this->assertInstanceOf( 'WP_Customize_Filter_Setting', $setting );\n\t\t$auto_draft_page = $this->factory()->post->create( array( 'post_type' => 'page', 'post_status' => 'auto-draft' ) );\n\t\t$this->manager->set_post_value( $setting_id, array( $auto_draft_page ) );\n\t\t$setting->preview();\n\t\t$this->assertTrue( $this->manager->has_published_pages() );\n\t}", "public function setPublishDate($value) : Page\n {\n $this->validateDate('PublishDate', $value);\n\n if ($this->data['publish_date'] !== $value) {\n $this->data['publish_date'] = $value;\n $this->setModified('publish_date');\n }\n\n return $this;\n }", "public function setIsPublished($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (boolean) $v;\n\t\t}\n\n\t\tif ($this->is_published !== $v || $this->isNew()) {\n\t\t\t$this->is_published = $v;\n\t\t\t$this->modifiedColumns[] = PostPeer::IS_PUBLISHED;\n\t\t}\n\n\t\treturn $this;\n\t}", "function publish($publish = true) {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t$model = $this->getDefaultModel();\n\n\t\t// set ids or just one id\n\t\t$id = KRequest::getInt('id');\n\t\t$ids = KRequest::getString('ids');\n\n\t\t// The system takes in 'id' or 'ids'. In either case, we make an array $ids for looping later\n\t\tif(!empty($ids)) {\n\t\t\t$ids = explode(',', $ids);\n\t\t}\n\t\telseif($id){\n\t\t\t$ids = [$id];\n\t\t}\n\t\telse $ids = [];\n\n\t\t// Cast all IDs to int for sanitation\n\t\tforeach ($ids as &$id) {\n\t\t\t$id = intval($id);\n\t\t}\n\t\tunset($id);\n\n\t\t$model->publish($ids, $publish);\n\n\t\t$this->purgeCache();\n\t\t$this->display();\n\n\t}", "public function hasPublishedTag() {\n return $this->_has(1);\n }", "function published($i, $value, $prefix='')\n\t{\n\t\t$images\t= array(-2 => 'components/com_members/media/images/icon-16-trash.png', 0 => 'images/publish_x.png', 1 => 'images/tick.png');\n\t\t$alts\t= array(-2 => 'Trash', 0 => 'Unpublished', 1 => 'Published');\n\t\t$img \t= JArrayHelper::getValue($images, $value, $images[0]);\n\t\t$task \t= $value == 1 ? 'unpublish' : 'publish';\n\t\t$alt \t= JArrayHelper::getValue($alts, $value, $images[0]);\n\t\t$action = $value == 1 ? JText::_('Unpublish Item') : JText::_('Publish item');\n\n\t\t$href = '\n\t\t<a href=\"javascript:void(0);\" onclick=\"return listItemTask(\\'cb'. $i .'\\',\\''. $prefix.$task .'\\')\" title=\"'. $action .'\">\n\t\t<img src=\"'. $img .'\" border=\"0\" alt=\"'. $alt .'\" /></a>';\n\n\t\treturn $href;\n\t}" ]
[ "0.71139246", "0.687771", "0.67618763", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6747875", "0.6667724", "0.6507065", "0.6504608", "0.6497351", "0.64960593", "0.6478948", "0.64309466", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6410635", "0.6355425", "0.63114566", "0.63102156", "0.62989604", "0.6244158", "0.6165948", "0.61627454", "0.61514413", "0.6102173", "0.609908", "0.60802203", "0.60590273", "0.60501593", "0.6041988", "0.60299534", "0.5972564", "0.59688336", "0.59465", "0.5925717", "0.5891449", "0.5881798", "0.58440137", "0.58327127", "0.58128196", "0.58016485", "0.57961935", "0.5792254", "0.5789686", "0.57837504", "0.5779987", "0.5764388", "0.5748604", "0.57288986", "0.57255703", "0.57105917", "0.5702558", "0.56999797", "0.5699768", "0.56935924", "0.56935924", "0.56933284", "0.5690553", "0.5690185", "0.5683606", "0.5677164", "0.56754184", "0.56610024", "0.5641645", "0.56405693", "0.56404585", "0.5633904", "0.5628706", "0.5626633", "0.5598744", "0.5585887", "0.557623", "0.5575028", "0.55703974", "0.55626607", "0.5550426", "0.5539459", "0.55062205", "0.55021983", "0.5482674", "0.5477893", "0.5473751", "0.5472929" ]
0.0
-1
Search title and content fields
function search($query) { $query = Sanitize::escape($query); $fields = null; $titleResults = $this->find( 'all', array( 'conditions' => "{$this->name}.title LIKE '%$query%' and {$this->name}.draft=0", 'fields' => $fields ) ); $contentResults = array(); if (empty($titleResults)) { $titleResults = array(); $contentResults = $this->find( 'all', array( 'conditions' => "MATCH ({$this->name}.content) AGAINST ('$query')", 'fields' => $fields ) ); } else { $alredyFoundIds = join(', ', Set::extract($titleResults, '{n}.' . $this->name . '.id')); $notInQueryPart = ''; if (!empty($alredyFoundIds)) { $notInQueryPart = " AND {$this->name}.id NOT IN ($alredyFoundIds) AND {$this->name}.draft=0"; } $contentResults = $this->find( 'all', array( 'conditions' => "MATCH ({$this->name}.content) AGAINST ('$query')$notInQueryPart", 'fields' => $fields ) ); } if (!is_array(($contentResults))) { $contentResults = array(); } $results = array_merge($titleResults, $contentResults); return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ccontent_search()\n\t{\n\t\t$post_data = linput_post();\n\t\t$table = llang_table('content');\n\t\t$cols = array('body', 'name');\n\t\t$keywords = $post_data['keywords'];\n\n\t\tif (strlen($keywords) >= 3)\n\t\t{\n\t\t\t$data['content'] = lcrud_search($table, $cols, $keywords, 'AND `published`=\\'1\\' ORDER BY `updated` DESC');\n\n\t\t\tfor ($i = 0; $i < count($data['content']); $i++)\n\t\t\t{\n\t\t\t\t$data['content'][$i]['title'] = $data['content'][$i]['name'];\n\t\t\t\t$data['content'][$i]['link'] = mcategories_read_path($data['content'][$i]['link'], false);\n\t\t\t}\n\n\t\t\tif (!count($data['content'])) hmessage_set(l('No results.'));\n\n\t\t\tlloader_load_view('search', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['content'] = array();\n\t\t\thmessage_set(l('Keyword must be at least 3 characters long'));\n\t\t\tlloader_load_view('search', $data);\n\t\t}\n\t}", "public function searchSubContent()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set branch to search to a variable.\n $branch = $this->getSearchBranch();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields, $branch);\n }", "function test_field_specific_search_on_post_title() {\n\n\t\t// Single word. Two matching entries should be found.\n\t\t$search_string = \"Jamie's\";\n\t\t$field_key = 'yi6yvm';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\n\t\t// Single word. No entries should be found.\n\t\t$search_string = 'TextThatShouldNotBeFound';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "public function search();", "public function search();", "public function search(){}", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "function searchByTitle($title){\n $name = $title['search'];\n return db()->QUERY(\"SELECT * FROM posts WHERE title LIKE '%$name%' ORDER BY title\");\n }", "function test_general_entries_search_on_post_title() {\n\t\t$search_string = \"Jamie's\";\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\t}", "public function searchItem($title) {\n \n //Create Database conexion\n }", "function contentSearch(&$searchObj, &$searchResObj) {\r\n\ttry {\r\n\t\t$pdo = new PDO(DBCONNSTRING, DBUSER,DBPASS);\r\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n\t\t$sql = \"SELECT Title, Message, PostID FROM travelpost WHERE Message LIKE '%$searchObj->searchField%'\";\r\n\t\t\r\n\t\t$result = $pdo->query($sql);\r\n\t\t\r\n\t\t$count = 0;\r\n\t\twhile ($row = $result->fetch()) {\r\n\t\t\t$searchResObj[$count] = new searchResult();\r\n\t\t\t\r\n\t\t\t$searchResObj[$count]->searchTitle = $row['Title'];\r\n\t\t\t$searchResObj[$count]->searchMessage = $row['Message'];\r\n\t\t\t$searchResObj[$count]->searchPostID = $row['PostID'];\r\n\r\n\t\t\t$count++;\r\n\t\t}\r\n\t}\r\n\tcatch (PDOexception $e) {\r\n\t\tERROR_PAGE();\r\n\t}\r\n\t\r\n}", "public function search()\n\t{\n\t\t\n\t}", "public function getSearch();", "private function getSearch() {\n\t\tif( $_SESSION['privilege'] != 'anon' ) {\n\n\t\t\t// If NOT anon then IS logged in so set userID to SESSION['id'] \n\t\t\t$userID = $_SESSION['id'];\n\n\t\t} else {\n\t\t\t\n\t\t\t// For this function default $userID to non-exitent user # 0 \n\t\t\t$userID = 0;\n\n\t\t}\n\n\t\t// Set search term per input OR blank\n\n\t\tif( !isset($_POST['search'])) {\n\t\t\t$_POST['search'] = \"\";\n\t\t}\n\t\t\n\t\tif(strlen($_POST['search']) === 0) {\n\t\t\t$searchTerm = \"\";\n\n\t\t} else {\n\t\t\t$result = $_POST['search'];\n\t\t\t$searchTerm = strtolower($result);\n\t\t}\n\n\t\t$this->data['searchTerm'] = $searchTerm;\n\n\t\t$sql = \"SELECT posts.id, title AS score_title, intro AS score_intro, article AS score_article\n\t\t\tFROM posts\n\t\t\tWHERE\n\t\t\t\t(title LIKE '%$searchTerm%' OR \n\t\t\t\tintro LIKE '%$searchTerm%' OR\n\t\t\t\tarticle LIKE '%$searchTerm%')\";\n\n\t\tif( $_SESSION['privilege'] != 'admin' ) {\n\n\t\t\t$sql .= \" AND (user_id = $userID\n\t\t\t\t\tOR status = 'Approved')\t\n\t\t\t\t\tORDER BY score_title ASC\";\n\t\t\n\t\t} else {\n\n\t\t\t$sql .= \" ORDER BY score_title ASC\";\t\n\n\t\t}\t\t\n\t\n\t\t$result = $this->dbc->query($sql);\n\n\t\tif( !$result || $result->num_rows == 0) {\n\t\t\t$this->data['searchResults'] = \"No results\";\n\t\t} else {\n\t\t\t$this->data['searchResults'] = $result->fetch_all(MYSQLI_ASSOC);\n\t\t}\n\t}", "function search() {}", "function test_general_entries_search_on_post_content() {\n\t\t$search_string = 'Different';\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'post-entry-2' ) );\n\t}", "function postingSearchHandler() {\n global $inputs;\n\n $keyword = $inputs['keyword'];\n $res = getAll(\"SELECT a.*,c.name \n FROM posting a \n INNER JOIN member_posting b \n ON a.id = b.posting_id\n INNER JOIN member c \n ON c.id = b.member_id \n WHERE a.title LIKE '%$keyword%' OR a.content LIKE '%$keyword%'\");\n \n formatOutput(true, 'success',$res);\n}", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "public function search() {\n include 'views/search-form.php';\n }", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "public function searchTitle($title) {\n try {\n // escape quotes\n $checkTitle = str_replace(\"'\", \"''\", $title);\n // search the database, using wildcards\n $sql = \"SELECT * FROM books WHERE title LIKE '%$checkTitle%' ORDER BY author\";\n $stmt = $this->conn->query($sql);\n \n // fetch results as numeric array\n $result = $stmt->setFetchMode(PDO::FETCH_NUM);\n // show results in a list of update forms\n echo \"<br /><div id='searchResult'><h3>Title: -$title-</h3><ul>\";\n while ($row = $stmt->fetch()) {\n // call result form function\n $this->echoResultForm($row);\n }\n echo \"</ul></div>\";\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }", "function test_field_specific_search_frm_item_metas() {\n\n\t\t// Single word. One matching entry should be found.\n\t\t$search_string = 'Jamie';\n\t\t$field_key = 'text-field';\n\t\t$items = self::generate_and_run_field_specific_query( 'all_field_types', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'jamie_entry_key' ) );\n\n\t\t// Multiple words. Two matching entries should be found.\n\t\t$search_string = 'Jamie Rebecca Wahlin';\n\t\t$field_key = 'p3eiuk';\n\t\t$items = self::generate_and_run_field_specific_query( 'all_field_types', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// Single word. No matching entries should be found.\n\t\t$search_string = 'TextThatWillNotBeFound';\n\t\t$field_key = 'text-field';\n\t\t$items = self::generate_and_run_field_specific_query( 'all_field_types', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in field ' . $field_key;\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "function sql_search_relative_titles($mastertitle,$field2check) {\n $db = GetGlobal('db');\t\n\t $lan = $lang?$lang:getlocal();\n\t $itmname = $lan?'itmname':'itmfname';\n\t $itmdescr = $lan?'itmdescr':'itmfdescr';\n\t\t$remarks = 'itmremark';\t\n\t\t$sqlout = null;\t\t\n\t\n\t $mt = explode(' ',trim($mastertitle));\n //print_r($mt);\n $sSQL = \"select \".$this->getmapf('code').\" from products where \"; //whole words...\n\t\t \t\t\n\t foreach ($mt as $i=>$lex) {\n\t\t\n\t\t if (($la = trim($lex)) && (strlen($la)>4)) {//words max than 4 chars\n\t\t\n\t\t $ulex = strtoupper($lex);\n\t\t $dlex = strtolower($lex);\n \n\t\t $sqlout[$lex] = \"$itmname like '%$lex%' \";// or $itmdescr like '%$lex%' or $remarks like '%$lex%'\";// or \"; //as is\n\t\t //$sSQL .= \"$itmname like '% $ulex %' or $itmdescr like '% $ulex %' or $remarks like '% $ulex %' or \"; //upper case\t\t\n\t\t //$sSQL .= \"$itmname like '% $dlex %' or $itmdescr like '% $dlex %' or $remarks like '% $dlex %'\"; //lower case\t\t\n\t\t \n\t\t }//if lex\n\t\t} \n\t\t\n //print_r($sqlout); \n\t\tif ($sqlout) {\n\t\t $sSQL .= implode(' or ',$sqlout);\t\t \n\t\t return ($sSQL);\n\t\t}\n\t\telse\n\t\t return null;\n\t}", "public function search(){\n\n $title = $_GET['searchinput'];\n \n\n $posts = News::where([ \n ['title', 'LIKE', '%' . $title . '%'],\n \n ])->get();\n\n return view('pages.Search', compact('posts'));\n\n }", "public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }", "public function search(){\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$this->title = 'Search Media';\r\n\t\t$this->list = $this->Results();\r\n\t\treturn $this->renderWith(array('Media_results','App'));\r\n\t}", "function Search()\n{\n\tglobal $txt, $settings, $context;\n\n\t// Search may be disabled if they're softly banned.\n\tsoft_ban('search');\n\n\t// Is the load average too high to allow searching just now?\n\tif (!empty($context['load_average']) && !empty($settings['loadavg_search']) && $context['load_average'] >= $settings['loadavg_search'])\n\t\tfatal_lang_error('loadavg_search_disabled', false);\n\n\tloadLanguage('Search');\n\tloadTemplate('Search');\n\n\t// Popup mode?\n\tif (AJAX)\n\t{\n\t\twetem::load('search_ajax');\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tisAllowedTo('search_posts');\n\n\t// Link tree....\n\t// !!! If we've come back here because of an error, we're going to have: Site > Search > Search Results > Search in the linktree. Is this what we want?\n\tadd_linktree($txt['search'], '<URL>?action=search');\n\n\t// This is hard coded maximum string length.\n\t$context['search_string_limit'] = 100;\n\n\t$context['require_verification'] = we::$is_guest && !empty($settings['search_enable_captcha']) && empty($_SESSION['ss_vv_passed']);\n\tif ($context['require_verification'])\n\t{\n\t\tloadSource('Subs-Editor');\n\t\t$verificationOptions = array(\n\t\t\t'id' => 'search',\n\t\t);\n\t\t$context['require_verification'] = create_control_verification($verificationOptions);\n\t\t$context['visual_verification_id'] = $verificationOptions['id'];\n\t}\n\n\t// If you got back from search2 by using the linktree, you get your original search parameters back.\n\tif (isset($_REQUEST['params']))\n\t{\n\t\t// Due to IE's 2083 character limit, we have to compress long search strings\n\t\t$temp_params = base64_decode(str_replace(array('-', '_', '.'), array('+', '/', '='), $_REQUEST['params']));\n\t\t// Test for gzuncompress failing\n\t\t$temp_params2 = @gzuncompress($temp_params);\n\t\t$temp_params = explode('|\"|', !empty($temp_params2) ? $temp_params2 : $temp_params);\n\n\t\t$context['search_params'] = array();\n\t\tforeach ($temp_params as $i => $data)\n\t\t{\n\t\t\t@list ($k, $v) = explode('|\\'|', $data);\n\t\t\t$context['search_params'][$k] = $v;\n\t\t}\n\t\tif (!empty($context['search_params']['brd']))\n\t\t\tloadSource('Search2');\n\t\t$context['search_params']['brd'] = empty($context['search_params']['brd']) ? array() : wedge_ranged_explode(',', $context['search_params']['brd']);\n\t}\n\n\tif (isset($_REQUEST['search']))\n\t\t$context['search_params']['search'] = un_htmlspecialchars($_REQUEST['search']);\n\n\tif (isset($context['search_params']['search']))\n\t\t$context['search_params']['search'] = westr::htmlspecialchars($context['search_params']['search']);\n\tif (isset($context['search_params']['userspec']))\n\t\t$context['search_params']['userspec'] = htmlspecialchars($context['search_params']['userspec']);\n\tif (!empty($context['search_params']['searchtype']))\n\t\t$context['search_params']['searchtype'] = 2;\n\tif (!empty($context['search_params']['minage']))\n\t\t$context['search_params']['minage'] = (int) $context['search_params']['minage'];\n\tif (!empty($context['search_params']['maxage']))\n\t\t$context['search_params']['maxage'] = (int) $context['search_params']['maxage'];\n\n\t$context['search_params']['show_complete'] = !empty($context['search_params']['show_complete']);\n\t$context['search_params']['subject_only'] = !empty($context['search_params']['subject_only']);\n\n\t// Load the error text strings if there were errors in the search.\n\tif (!empty($context['search_errors']))\n\t{\n\t\tloadLanguage('Errors');\n\t\t$context['search_errors']['messages'] = array();\n\t\tforeach ($context['search_errors'] as $search_error => $dummy)\n\t\t{\n\t\t\tif ($search_error === 'messages')\n\t\t\t\tcontinue;\n\n\t\t\t$context['search_errors']['messages'][] = $txt['error_' . $search_error];\n\t\t}\n\t}\n\n\t// Find all the boards this user is allowed to see.\n\t$request = wesql::query('\n\t\tSELECT b.id_cat, c.name AS cat_name, b.id_board, b.name, b.child_level\n\t\tFROM {db_prefix}boards AS b\n\t\t\tLEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)\n\t\tWHERE {query_see_board}\n\t\t\tAND redirect = {string:empty_string}\n\t\tORDER BY b.board_order',\n\t\tarray(\n\t\t\t'empty_string' => '',\n\t\t)\n\t);\n\t$context['num_boards'] = wesql::num_rows($request);\n\t$context['boards_check_all'] = true;\n\t$context['categories'] = array();\n\twhile ($row = wesql::fetch_assoc($request))\n\t{\n\t\t// This category hasn't been set up yet...\n\t\tif (!isset($context['categories'][$row['id_cat']]))\n\t\t\t$context['categories'][$row['id_cat']] = array(\n\t\t\t\t'id' => $row['id_cat'],\n\t\t\t\t'name' => $row['cat_name'],\n\t\t\t\t'boards' => array()\n\t\t\t);\n\n\t\t// Set this board up, and let the template know when it's a child, so it can indent them.\n\t\t$context['categories'][$row['id_cat']]['boards'][$row['id_board']] = array(\n\t\t\t'id' => $row['id_board'],\n\t\t\t'name' => $row['name'],\n\t\t\t'child_level' => $row['child_level'],\n\t\t\t'selected' => (empty($context['search_params']['brd']) && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']) && !in_array($row['id_board'], we::$user['ignoreboards'])) || (!empty($context['search_params']['brd']) && in_array($row['id_board'], $context['search_params']['brd']))\n\t\t);\n\n\t\t// If a board wasn't checked that probably should have been, ensure the board selection is selected!\n\t\tif (!$context['categories'][$row['id_cat']]['boards'][$row['id_board']]['selected'] && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']))\n\t\t\t$context['boards_check_all'] = false;\n\t}\n\twesql::free_result($request);\n\n\t// Now, let's sort the list of categories into the boards for templates that like that.\n\t$temp_boards = array();\n\tforeach ($context['categories'] as $category)\n\t{\n\t\t$temp_boards[] = array(\n\t\t\t'name' => $category['name'],\n\t\t\t'child_ids' => array_keys($category['boards'])\n\t\t);\n\t\t$temp_boards = array_merge($temp_boards, array_values($category['boards']));\n\n\t\t// Include a list of boards per category for easy toggling.\n\t\t$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);\n\t}\n\n\t$max_boards = ceil(count($temp_boards) / 2);\n\tif ($max_boards == 1)\n\t\t$max_boards = 2;\n\n\t// Now, alternate them so they can be shown left and right ;).\n\t$context['board_columns'] = array();\n\tfor ($i = 0; $i < $max_boards; $i++)\n\t{\n\t\t$context['board_columns'][] = $temp_boards[$i];\n\t\tif (isset($temp_boards[$i + $max_boards]))\n\t\t\t$context['board_columns'][] = $temp_boards[$i + $max_boards];\n\t\telse\n\t\t\t$context['board_columns'][] = array();\n\t}\n\n\tif (!empty($_REQUEST['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $_REQUEST['topic'];\n\t\t$context['search_params']['show_complete'] = true;\n\t}\n\tif (!empty($context['search_params']['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $context['search_params']['topic'];\n\n\t\t$context['search_topic'] = array(\n\t\t\t'id' => $context['search_params']['topic'],\n\t\t\t'href' => '<URL>?topic=' . $context['search_params']['topic'] . '.0',\n\t\t);\n\n\t\t$request = wesql::query('\n\t\t\tSELECT ms.subject\n\t\t\tFROM {db_prefix}topics AS t\n\t\t\t\tINNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)\n\t\t\t\tINNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)\n\t\t\tWHERE t.id_topic = {int:search_topic_id}\n\t\t\t\tAND {query_see_board}\n\t\t\t\tAND {query_see_topic}\n\t\t\tLIMIT 1',\n\t\t\tarray(\n\t\t\t\t'search_topic_id' => $context['search_params']['topic'],\n\t\t\t)\n\t\t);\n\n\t\tif (wesql::num_rows($request) == 0)\n\t\t\tfatal_lang_error('topic_gone', false);\n\n\t\tlist ($context['search_topic']['subject']) = wesql::fetch_row($request);\n\t\twesql::free_result($request);\n\n\t\t$context['search_topic']['link'] = '<a href=\"' . $context['search_topic']['href'] . '\">' . $context['search_topic']['subject'] . '</a>';\n\t}\n\n\t$context['page_title'] = $txt['search'];\n}", "public function search($search);", "public function getSearchText();", "function search()\n\t{}", "function search()\n\t{}", "public function search()\n {\n auth_admin();\n $s_title = myUrlEncode(trim($this->input->post('s_title')));\n redirect($this->path_uri . '/main/a' . $s_title);\n }", "function search_job()\r\n{\r\n\tglobal $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;\r\n \r\n /*\r\n\t// GET JOB FIELDS\r\n\t$jobfields = $database->database_query(\"SELECT jobfield_id, jobfield_type, jobfield_options FROM se_jobfields WHERE jobfield_type<>'5'\");\r\n\t$jobvalue_query = \"se_jobs.job_title LIKE '%$search_text%' OR se_jobs.job_body LIKE '%$search_text%'\";\r\n \r\n\t// LOOP OVER JOB FIELDS\r\n\twhile($jobfield_info = $database->database_fetch_assoc($jobfields)) {\r\n \r\n\t // TEXT FIELD OR TEXTAREA\r\n\t if($jobfield_info[jobfield_type] == 1 | $jobfield_info[jobfield_type] == 2) {\r\n\t if($jobvalue_query != \"\") { $jobvalue_query .= \" OR \"; }\r\n\t $jobvalue_query .= \"se_jobvalues.jobvalue_\".$jobfield_info[jobfield_id].\" LIKE '%$search_text%'\";\r\n\r\n\t // RADIO OR SELECT BOX\r\n\t } elseif($jobfield_info[jobfield_type] == 3 | $jobfield_info[jobfield_type] == 4) {\r\n\t // LOOP OVER FIELD OPTIONS\r\n\t $options = explode(\"<~!~>\", $jobfield_info[jobfield_options]);\r\n\t for($i=0,$max=count($options);$i<$max;$i++) {\r\n\t if(str_replace(\" \", \"\", $options[$i]) != \"\") {\r\n\t $option = explode(\"<!>\", $options[$i]);\r\n\t $option_id = $option[0];\r\n\t $option_label = $option[1];\r\n\t if(strpos($option_label, $search_text)) {\r\n\t if($jobvalue_query != \"\") { $jobvalue_query .= \" OR \"; }\r\n\t $jobvalue_query .= \"se_jobvalues.jobvalue_\".$jobfield_info[jobfield_id].\"='$option_id'\";\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t}\r\n */\r\n \r\n /*\r\n $field = new se_field(\"job\");\r\n $text_columns = $field->field_index(TRUE);\r\n \r\n if( !is_array($text_columns) )\r\n $text_columns = array();\r\n */\r\n \r\n\t// CONSTRUCT QUERY\r\n $sql = \"\r\n SELECT\r\n se_jobs.job_id,\r\n se_jobs.job_title,\r\n se_jobs.job_body,\r\n se_jobs.job_photo,\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n FROM\r\n se_jobs\r\n LEFT JOIN\r\n se_users\r\n ON se_jobs.job_user_id=se_users.user_id\r\n LEFT JOIN\r\n se_levels\r\n ON se_users.user_level_id=se_levels.level_id\r\n LEFT JOIN\r\n se_jobvalues\r\n ON se_jobs.job_id=se_jobvalues.jobvalue_job_id\r\n WHERE\r\n (se_jobs.job_search=1 || se_levels.level_job_search=0)\r\n \";\r\n \r\n /*\r\n $sql .= \" && (MATCH (`job_title`, `job_body`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n if( !empty($text_columns) )\r\n $sql .= \" || MATCH (`\".join(\"`, `\", $text_columns).\"`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n $sql .= \")\";\r\n */\r\n \r\n $text_columns[] = 'job_title';\r\n $text_columns[] = 'job_body';\r\n $sql .= \" && MATCH (`\".join(\"`, `\", $text_columns).\"`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n \r\n\t// GET TOTAL ENTRIES\r\n $sql2 = $sql . \" LIMIT 201\";\r\n $resource = $database->database_query($sql2) or die($database->database_error().\" <b>SQL was: </b>{$sql2}\");\r\n\t$total_entries = $database->database_num_rows($resource);\r\n\r\n\t// IF NOT TOTAL ONLY\r\n\tif( $t==\"job\" )\r\n {\r\n\t // MAKE JOB PAGES\r\n\t $start = ($p - 1) * $results_per_page;\r\n\t $limit = $results_per_page+1;\r\n \r\n\t // SEARCH JOBS\r\n $sql3 = $sql . \" ORDER BY job_id DESC LIMIT {$start}, {$limit}\";\r\n $resource = $database->database_query($sql3) or die($database->database_error().\" <b>SQL was: </b>{$sql3}\");\r\n \r\n\t while( $job_info=$database->database_fetch_assoc($resource) )\r\n {\r\n\t // CREATE AN OBJECT FOR AUTHOR\r\n\t $profile = new se_user();\r\n\t $profile->user_info['user_id'] = $job_info['user_id'];\r\n\t $profile->user_info['user_username'] = $job_info['user_username'];\r\n\t $profile->user_info['user_photo'] = $job_info['user_photo'];\r\n\t $profile->user_info['user_fname'] = $job_info['user_fname'];\r\n\t $profile->user_info['user_lname'] = $job_info['user_lname'];\r\n\t $profile->user_displayname();\r\n \r\n\t // IF EMPTY TITLE\r\n\t if( !trim($job_info['job_title']) )\r\n $job_info['job_title'] = SE_Language::get(589);\r\n \r\n $job_info['job_body'] = cleanHTML($job_info['job_body'], '');\r\n \r\n\t // IF BODY IS LONG\r\n\t if( strlen($job_info['job_body'])>150 )\r\n $job_info['job_body'] = substr($job_info['job_body'], 0, 147).\"...\";\r\n \r\n\t // SET THUMBNAIL, IF AVAILABLE\r\n $thumb_path = NULL;\r\n if( !empty($job_info['job_photo']) )\r\n {\r\n $job_dir = se_job::job_dir($job_info['job_id']);\r\n $job_photo = $job_info['job_photo'];\r\n $job_thumb = substr($job_photo, 0, strrpos($job_photo, \".\")).\"_thumb\".substr($job_photo, strrpos($job_photo, \".\"));\r\n \r\n if( file_exists($job_dir.$job_thumb) )\r\n $thumb_path = $job_dir.$job_thumb;\r\n elseif( file_exists($job_dir.$job_photo) )\r\n $thumb_path = $job_dir.$job_photo;\r\n }\r\n \r\n if( !$thumb_path )\r\n $thumb_path = \"./images/icons/file_big.gif\";\r\n \r\n \r\n $result_url = $url->url_create('job', $job_info['user_username'], $job_info['job_id']);\r\n $result_name = 6400137;\r\n $result_desc = 6400138;\r\n \r\n \r\n\t $results[] = array(\r\n 'result_url' => $result_url,\r\n\t\t\t\t'result_icon' => $thumb_path,\r\n\t\t\t\t'result_name' => $result_name,\r\n\t\t\t\t'result_name_1' => $job_info['job_title'],\r\n\t\t\t\t'result_desc' => $result_desc,\r\n\t\t\t\t'result_desc_1' => $url->url_create('profile', $job_info['user_username']),\r\n\t\t\t\t'result_desc_2' => $profile->user_displayname,\r\n\t\t\t\t'result_desc_3' => $job_info['job_body']\r\n );\r\n \r\n unset($profile);\r\n\t }\r\n \r\n\t // SET TOTAL RESULTS\r\n\t $total_results = $total_entries;\r\n\t}\r\n\r\n\t// SET ARRAY VALUES\r\n\tSE_Language::_preload_multi(6400137, 6400138, 6400139);\r\n\tif( $total_entries>200 )\r\n $total_entries = \"200+\";\r\n \r\n\t$search_objects[] = array(\r\n 'search_type' => 'job',\r\n 'search_lang' => 6400139,\r\n 'search_total' => $total_entries\r\n );\r\n}", "private function setSearchstring(){\n $search_req = $this->main->getArrayFromSearchString($_GET['content_search']);\n\n $searchstring = '';\n\n foreach($search_req as $key => $val){\n if(strlen($val) > 0){\n $searchstring .= \"`name` LIKE '%\".DB::quote($val).\"%' OR \";\n };\n };\n\n $searchstring .= \"`name` LIKE '%\".DB::quote($_GET['content_search']).\"%'\";\n\n return $searchstring;\n }", "public function testSearchFindTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->waitForText('Buscar:')\n ->keys(\"input[type='Search']\", 'super')\n ->waitForText('Exibindo 1 até 2 de 2 registros')\n ->assertSee('Batman vs Superman: A Origem da Justiça')\n ->assertSee('Dragon Ball Super: Broly');\n });\n }", "public function search($query);", "function titleSearch(&$searchObj, &$searchResObj) {\r\n\ttry {\r\n\t\t$pdo = new PDO(DBCONNSTRING, DBUSER,DBPASS);\r\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n\t\t$sql = \"SELECT Title, Message, PostID FROM travelpost WHERE Title LIKE '%$searchObj->searchField%'\";\r\n\t\t\r\n\t\t$result = $pdo->query($sql);\r\n\t\t\r\n\t\t$count = 0;\r\n\t\twhile ($row = $result->fetch()) {\r\n\t\t\t$searchResObj[$count] = new searchResult();\r\n\t\t\t\r\n\t\t\t$searchResObj[$count]->searchTitle = $row['Title'];\r\n\t\t\t$searchResObj[$count]->searchMessage = $row['Message'];\r\n\t\t\t$searchResObj[$count]->searchPostID = $row['PostID'];\r\n\r\n\t\t\t$count++;\r\n\t\t}\r\n\t}\r\n\tcatch (PDOexception $e) {\r\n\t\tERROR_PAGE();\r\n\t}\r\n\t\r\n}", "public static function search($search){\n return empty($search) ? static::query()\n :static::where('id','like', '%'.$search.'%')\n ->orwhere('title','like', '%'.$search.'%')\n ->orwhere('body','like', '%'.$search.'%');\n }", "public function search()\n {\n\n $q = input::get('q');\n if($q !=\"\"){\n $search = DB::table('postad')\n ->where('title','LIKE','%'.$q.'%')\n ->orWhere('description','LIKE','%'.$q.'%')\n ->get();\n\n if(count($search)>0){\n return view('basic.search')->withDetails($search)->withQuery($q);\n }\n else{\n return Redirect::back()->with('search', ['Result Not Found']);\n }\n }\n else{\n return Redirect::back();\n } \n }", "public function actionSearch()\n {\n $search=new SiteSearchForm;\n\n if(isset($_POST['SiteSearchForm']))\n {\n $search->attributes=$_POST['SiteSearchForm'];\n $_GET['searchString']=$search->keyword;\n }\n else\n $search->keyword=$_GET['searchString'];\n\n if($search->validate())\n {\n\n $criteria=new CDbCriteria;\n $criteria->condition='status='.Post::STATUS_PUBLISHED.' AND t.publishTime<'.time();// MFM 1.1 migration Post to t.publishTime\n $criteria->order='createTime DESC';\n\n $criteria->condition.=' AND contentshort LIKE :keyword';\n $criteria->params=array(':keyword'=>'%'.CHtml::encode($search->keyword).'%');\n\n $postCount=Post::model()->count($criteria);\n $pages=new CPagination($postCount);\n $pages->pageSize=Yii::app()->params['postsPerPage'];\n $pages->applyLimit($criteria);\n\n $posts=Post::model()->findAll($criteria);\n }\n\n $this->pageTitle=Yii::t('lan','Search Results').' \"'.CHtml::encode($_GET['searchString']).'\"';\n $this->render('search',array(\n 'posts'=>($posts)?$posts:array(),\n 'pages'=>$pages,\n 'search'=>$search,\n ));\n }", "public function search()\n {\n $cats = Category::where('status',1)->get();\n $item = request()->input('search');\n $posts = Post::where('status', 1)->where('title', 'like', \"%$item%\")->orWhere('text', 'like', \"%$item%\")->get();\n return View('main.search', compact('cats', 'posts'));\n }", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function indexAction() {\n \t$form = new ContentSearchForm();\n \t$form->submit->setLabel('Search content');\n $this->view->form = $form;\n $params = $this->getCleaner()->array_cleanup($this->_getAllParams());\n $search = new Pas_Solr_Handler();\n $search->setCore('beocontent');\n $search->setFields(array(\n 'id', 'title', 'section', \n 'publishState', 'created', 'updated', \n 'type', 'createdBy', 'updatedBy'\n ));\n if($this->getRequest()->isPost() && $form->isValid($this->_request->getPost())\n && !is_null($this->_getParam('submit'))){\n if ($form->isValid($form->getValues())) {\n $params = $this->getCleaner()->array_cleanup($form->getValues());\n $this->_helper->Redirector->gotoSimple('index','content','admin',$params);\n } else {\n $form->populate($form->getValues());\n $params = $form->getValues();\n }\n } else {\n $form->populate($this->_getAllParams());\n }\n if(!isset($params['q']) || $params['q'] == ''){\n $params['q'] = '*';\n }\n $params['type'] = 'sitecontent';\n $search->setParams($params);\n $search->execute();\n $this->view->paginator = $search->createPagination();\n $this->view->contents = $search->processResults();\n }", "public function contents()\n\t{\n\t\tglobal $db, $ws;\n\n\t\t$result='';\n\t\t$albumsfound='';\n\t\t$photosfound='';\n\n\t\tif(!isset($_POST['search'])||(empty($_POST['search']))){\n\t\t\treturn '<h1 class=\"\">Enter keyword to search, and try again.</h1>';\n\t\t}\n\n\t\t$search=filter_var($_POST['search'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\n\t\t$q=$db->query(\"SELECT *,\n\t\t IFNULL(\n\t\t (SELECT `filename` FROM `photos` WHERE `photos`.`aid`=`albums`.`aid`\n\t\t ORDER BY `phid` DESC LIMIT 1), '') AS `photo`\n\t\t FROM `albums` WHERE (`name` LIKE '\".$search.\"%' OR `name` LIKE '%\".$search.\"%') \");\n\t\tif($db->num_rows($q)>0){\n\t\t\twhile($a=$db->fetch_array($q)){\n\t\t\t\t$albumsfound.=$ws->albumPreview(0, $a['aid'], $a['uid'], $a['photo'], $a['name'], $a['created']);\n\t\t\t}\n\t\t}else{\n\t\t\t$albumsfound.='<h2 class=\"errormsg\">We didn&lsquo;t find any albums with that keyword</h2>';\n\t\t}\n\n\t\t$q=$db->query(\"SELECT * FROM `photos` WHERE (`name` LIKE '\".$search.\"%' OR `name` LIKE '%\".$search.\"%') \");\n\t\tif($db->num_rows($q)>0){\n\t\t\twhile($a=$db->fetch_array($q)){\n\t\t\t\t$photosfound.=$ws->photoPreview(0, $a['phid'], $a['uid'], $a['filename'], $a['name'], $a['created'],$a['aid']);\n\t\t\t}\n\t\t}else{\n\t\t\t$photosfound.='<h2 class=\"errormsg\">We didn&lsquo;t find any photos with that keyword</h2>';\n\t\t}\n\n\t\t$result.='\n\t\t<div id=\"search-results\">\n\t\t\t<div id=\"search-results-albums\">\n\t\t\t\t<h1 class=\"search-results-title\">Found albums:</h1>\n\t\t\t\t<div class=\"search-results-items\">\n\t\t\t\t\t'.$albumsfound.'\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div id=\"search-results-photos\">\n\t\t\t\t<h1 class=\"search-results-title\">Found photos:</h1>\n\t\t\t\t<div class=\"search-results-items\">\n\t\t\t\t\t'.$photosfound.'\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>';\n\n\n\t\treturn $result;\n\t}", "public function getSearchFields();", "function bb_search_wp($q ) {\r\n\t\r\n\tglobal $wp_posts,$bbdb, $bb;\r\n\t\r\n\tif ($bb->wp_table_prefix)\t$wp_posts = $bbdb->get_results(\"SELECT * FROM \" . $bb->wp_table_prefix . \"posts WHERE (post_title LIKE '%$q%') OR (post_content LIKE '%$q%')\");\r\n\t\t\r\n}", "public function action_search()\n\t{\n\t\t$price_min = array();\n\t\tfor ($i=100000; $i<=10000000; $i += 100000) {\n\t\t\t$price_min[$i] = '$ '.number::humanReadable($i);\n\t\t\tif ($i >= 1000000) $i += 400000;\n\t\t}\n\t\t$price_max = $price_min;\n\t\tarr::unshift($price_min, '', 'Minimum');\n\t\tarr::unshift($price_max, '', 'Maximum');\n\n\t\t// Setting types\n\t\t$types = ORM::factory('type')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($types, '', '-- Select --');\n\t\t\n\t\t// Setting cities\n\t\t$cities = ORM::factory('city')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($cities, '', '-- Select --');\n\t\t\n\t\t$this->template->content = new View('admin/property/search');\n\t\t$this->template->content->title = 'Property Search';\n\t\t$this->template->content->types = $types;\n\t\t$this->template->content->cities = $cities;\n\t\t$this->template->content->price_min = $price_min;\n\t\t$this->template->content->price_max = $price_max;\n\t\t$this->template->content->post = array('type_id' => '', 'city_id' => '', 'pmin' => '', 'pmax' => '');\n\n\t\tif ( ! empty($_GET))\n\t\t{\n\t\t\t$this->template->content->results = new View('admin/property/read');\n\t\t\t$this->template->content->results->title = 'Search Results';\n\t\t\t$this->action_index(TRUE);\n\t\t}\n\t}", "function _admin_search_query()\n {\n }", "public function search()\n {\n $data['resultList'] = $this->ReviewModel->searchForReview($this->input->post('searchtxt'));\n $data['body'] = 'results';\n $this->load->view('template', $data);\n }", "public function search($q);", "function display_search_field() {\n return $this->display_field(0, 'asearchtemplate');\n }", "public function search($params)\n {\n $this->load($params);\n\n if (!$this->validate())\n {\n new BadRequestHttpException(\\Yii::t('app', 'The provided search string is invalid'));\n }\n\n $query = ContentSource::find();\n\n // STATUS DELETED, DO NOT DISPLAY.\n $query->where([ 'not like', 'status', self::STATUS_DELETED ]);\n\n // If USER IS GUEST\n if (\\Yii::$app->user->isGuest)\n {\n $query->andWhere([ 'not like', 'status', self::STATUS_DRAFT ]);\n $query->andWhere([ 'not like', 'status', self::STATUS_PRIVATE_CONTENT ]);\n }\n // NOT VALIDATED USERS AND DRAFT HANDLES.\n else\n {\n /** @var User $user */\n $user = \\Yii::$app->user->getIdentity();\n if ($user->status == User::STATUS_AWAITING_VALIDATION || $user->status == User::STATUS_INVALIDATED)\n {\n $query->andWhere([ 'not like', 'status', self::STATUS_PRIVATE_CONTENT ]);\n }\n if ($user->role == User::ROLE_USER)\n {\n $query->andWhere([ 'not like', 'status', self::STATUS_DRAFT ]);\n }\n }\n\n // LOOK THROUGH THE SLUGS.\n $query->innerJoin(\"content_slug\", \"content_source.id = content_slug.content_id\")\n ->where([ 'content_slug.language' => \\Yii::$app->language ])\n ->filterWhere([ 'like', 'content_slug.title', $this->searchString ])\n ->orFilterWhere([ 'like', 'content_slug.slug', $this->searchString ]);\n\n $query2 = (new Query())->select(\"content_source.*\")\n ->from(\"content_source\")\n ->innerJoin(\"content_component\", \"content_component.content_id = content_source.id\")\n ->innerJoin(\"component_field\", \"content_component.id = component_field.component_id\")\n ->where([ 'content_component.language' => \\Yii::$app->language ])\n ->filterWhere([ 'like', 'component_field.text', $this->searchString ]);\n\n $query->union($query2);\n\n $pageSize = isset($params[ 'per-page' ]) ? intval($params[ 'per-page' ]) : 20;\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [ 'pageSize' => $pageSize, ],\n ]);\n\n $dataProvider->sort->attributes[ 'title' ] = [\n 'asc' => [ 'content_slug.title' => SORT_ASC ],\n 'desc' => [ 'content_slug.title' => SORT_DESC ],\n ];\n\n $dataProvider->sort->attributes[ 'slug' ] = [\n 'asc' => [ 'content_slug.slug' => SORT_ASC ],\n 'desc' => [ 'content_slug.slug' => SORT_DESC ],\n ];\n\n return $dataProvider;\n }", "public function getElementTitle(array $args){\r\n\t $args = Utility_Functions::argsToArray($args);\r\n\t $args = Utility_Functions::cleanArgsValue($args);\r\n\t \r\n\t $searchFor = $args[\"text\"];\r\n\t $typeArr = explode(\"-\", $args[\"type\"]);\r\n\t\r\n\t $type = trim($typeArr[0]);\r\n\t \r\n\t if($type == 1){\r\n\t $model = new Table_BlogArticles();\r\n\t }else{\r\n\t $model = new Table_Receipts();\r\n\t } \r\n\t\r\n\t $foundData = $model->selectAutocomplete(array(\"title\" => array(\" like \" => \"%$searchFor%\")), null);\r\n\t\r\n\t echo $this->_toJson($foundData->toArray());\r\n\t}", "public function searchTitleActionGet()\n {\n $title = \"Search for a movie by title\";\n $searchTitle = $this->app->request->getGet(\"searchTitle\");\n\n $this->app->db->connect();\n\n if ($searchTitle) {\n $sql = \"SELECT * FROM movie WHERE title LIKE ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$searchTitle]);\n }\n\n $this->app->page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle,\n ]);\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function action_search()\n\t{\n\t\t$price_min = array();\n\t\tfor ($i=100000; $i<=10000000; $i += 100000) {\n\t\t\t$price_min[$i] = '$ '.number::humanReadable($i);\n\t\t\tif ($i >= 1000000) $i += 400000;\n\t\t}\n\t\t$price_max = $price_min;\n\t\tarr::unshift($price_min, '', 'Minimum');\n\t\tarr::unshift($price_max, '', 'Maximum');\n\n\t\t// Setting types\n\t\t$types = ORM::factory('type')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($types, '', '-- Select --');\n\t\t\n\t\t// Setting cities\n\t\t$cities = ORM::factory('city')->find_all()->as_array('id', 'name');\n\t\tarr::unshift($cities, '', '-- Select --');\n\t\t\n\t\t$this->template->content = new View('admin/property/search');\n\t\t$this->template->content->title = ucwords($this->_type).' Search';\n\t\t$this->template->content->types = $types;\n\t\t$this->template->content->cities = $cities;\n\t\t$this->template->content->price_min = $price_min;\n\t\t$this->template->content->price_max = $price_max;\n\t\t$this->template->content->post = array('type_id' => '', 'city_id' => '', 'pmin' => '', 'pmax' => '');\n\n\t\tif ( ! empty($_GET))\n\t\t{\n\t\t\t$this->template->content->results = new View('admin/property/read');\n\t\t\t$this->template->content->results->title = 'Search Results';\n\t\t\t$this->action_index(TRUE);\n/*\t\t\t$this->template->content->results->data = Model_Property::get_list(0, 1, false, 'desc');*/\n\t\t}\n\t}", "public function search()\n {\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('text',$this->text,true);\n $criteria->compare('author_id',$this->author_id);\n $criteria->compare('editor_id',$this->editor_id);\n $criteria->compare('crated_at',$this->crated_at,true);\n $criteria->compare('edited_at',$this->edited_at,true);\n $criteria->compare('publish_at',$this->publich_at,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "private function _indexItemTitleField()\n {\n $this->db->query(<<<SQL\n ALTER TABLE {$this->db->prefix}neatline_records\n ADD FULLTEXT (item_title, title, body, slug);\nSQL\n);\n }", "function the_search_query()\n {\n }", "function voyage_mikado_get_search() {\n\n\t\tif(voyage_mikado_active_widget(false, false, 'mkd_search_opener')) {\n\n\t\t\t$search_type = voyage_mikado_options()->getOptionValue('search_type');\n\n\t\t\tvoyage_mikado_load_search_template();\n\n\t\t}\n\t}", "function search( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_SEARCH,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}", "public function search(Request $request)\n {\n // the search function for getting a title based on query\n $key = trim($request->get('q'));\n $titles = Title::query()\n ->where('title', 'like', \"%{$key}%\")\n ->orderBy('created_at', 'desc')\n ->get(); //paginate(10)->onBothSides(1);\n\n\n //get the recent 5 titles\n $recent_titles = Title::query()\n ->orderBy('created_at', 'desc')\n ->take(5)\n ->get();\n\n return view('search', [\n 'key' => $key,\n 'titles' => $titles,\n 'recent_titles' => $recent_titles\n ]);\n }", "public function search()\n\t{\n\n\t\t$searchQuery = $this->input->get('query');\n\n\t\t$data['sectionName'] = 'Search Result for ' . ucwords($searchQuery);\n\n\t\t//GET PARENT CATEGORY TITLE\n\t\t$data['categories'] = $this->category->getParentCategory();\n\t\t$data['searchQuery'] = $searchQuery;\n\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('templates/navbar', $data);\n\t\t$this->load->view('pages/home/search-result', $data);\n\t\t$this->load->view('pages/home/autoload-search');\n\t\t$this->load->view('templates/footer', $data);\n\t}", "function onIndexSearch(&$field, &$post, &$item)\n\t{\n\t\tif ( !in_array($field->field_type, self::$field_types) ) return;\n\t\tif ( !$field->issearch ) return;\n\t\t\n\t\tFlexicontentFields::onIndexSearch($field, $post, $item, $required_properties=array('url'), $search_properties=array('title','author','description','videotype'), $properties_spacer=' ', $filter_func=null);\n\t\treturn true;\n\t}", "abstract public function getFieldsSearchable();", "public static function search () {\n\t\trequire_once ('apps/wiki/lib/markdown.php');\n\t\trequire_once ('apps/wiki/lib/Functions.php');\n\n\t\t$pages = self::query ()\n\t\t\t->fetch_orig ();\n\t\t\n\t\tforeach ($pages as $i => $page) {\n\t\t\t$url = 'wiki/' . $page->id;\n\t\t\tif (! Search::add (\n\t\t\t\t'wiki/' . $page->id,\n\t\t\t\tarray (\n\t\t\t\t\t'title' => str_replace ('-', ' ', $page->id),\n\t\t\t\t\t'text' => wiki_parse_body ($page->body),\n\t\t\t\t\t'url' => '/wiki/' . $page->id\n\t\t\t\t)\n\t\t\t)) {\n\t\t\t\treturn array (false, $i);\n\t\t\t}\n\t\t}\n\t\treturn array (true, count ($pages));\n\t}", "function search() {\n // ...\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function search($title=null)\n {\n\n // $products = QueryBuilder::for(Product::class)->allowedFilters(['title'])->get();\n\n $products = Product::where([\"title\"=>$title])->orWhere([\"description\"=>$title])->orWhere([\"type\"=>$title])->get();\n return view('show_products',['products'=>$products]);\n }", "public function search(Request $request)\n {\n $query = $request->input('search');\n // Returns an array of articles that have the query string located somewhere within\n // our articles titles. Paginates them so we can break up lots of search results.\n $contacts = DB::table('contacts')->where('name', 'LIKE', '%' . $query . '%')->paginate(200);\n $contactsName=Contact::lists('name','id')->all();\n return view('admin.fields.search', ['contacts' => $contacts ,'contactsName' => $contactsName]);\n // returns a view and passes the view the list of articles and the original query.\n }", "abstract public function searchFields(): array;", "public function search(Request $request)\n {\n $search = $request->input;\n $results = '';\n\n // MySql handles case sensitive from lower case string with LIKE\n if (env('DB_CONNECTION') !== 'pgsql') {\n $results = DB::table('movies')\n ->where('title', 'LIKE', \"%$search%\")\n ->get();\n } else {\n // PgSql needs ILIKE to match case insensitive\n $results = DB::table('movies')\n ->where('title', 'ILIKE', \"%$search%\")\n ->get();\n }\n\n return $results;\n\n // // If we wantet to search content (e.g. description) as well we could continue with\n // ->orwhere('description', 'LIKE', \"%$search%\")\n }", "public function search($title)\n {\n return Posts::where('title', 'LIKE', '%' . $title . '%')->get();\n }", "function launchpad_search_flexible_where($q) {\n\tglobal $wpdb;\n\t\n\t// We only want to do this on a search page.\n\tif(is_search()) {\n\t\t// Get the post types so we can find out what flexible types there are.\n\t\t$types = launchpad_get_post_types();\n\t\t\n\t\t// This keeps up with what flexible types we have already considered.\n\t\t$used_flex = array();\n\t\t$used_meta = array();\n\t\t\n\t\t// If we have post types.\n\t\tif($types) {\n\t\t\n\t\t\t// Loop the post types.\n\t\t\tforeach($types as $type) {\n\t\t\t\t\n\t\t\t\t// If the type has flexible content.\n\t\t\t\tif(isset($type['flexible'])) {\n\t\t\t\t\t\n\t\t\t\t\t// Loop the flexible content.\n\t\t\t\t\tforeach($type['flexible'] as $flex_name => $flex_value) {\n\t\t\t\t\t\n\t\t\t\t\t\t// If we haven't used the flexible content, add it to the query.\n\t\t\t\t\t\t// Unfortunately, the WHERE is already pretty populated by now.\n\t\t\t\t\t\t// We can't just shove this onto the end. So, we use the post_title\n\t\t\t\t\t\t// part of the WHERE as a template and use preg_replace trickery\n\t\t\t\t\t\t// to put the right stuff in the right place.\n\t\t\t\t\t\tif(!in_array($flex_name, $used_flex)) {\n\t\t\t\t\t\t\t$used_flex[] = $flex_name;\n\t\t\t\t\t\t\t$q = preg_replace(\"/(\\($wpdb->posts.post_title LIKE '(%.*?%)'\\))/\", '$1 OR (launchpad_search_' . $flex_name . '.meta_value LIKE \"$2\")', $q);\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\t// If the type has metabox content.\n\t\t\t\tif(isset($type['metaboxes'])) {\n\t\t\t\t\t\n\t\t\t\t\t// Loop the metabox content.\n\t\t\t\t\tforeach($type['metaboxes'] as $meta_name => $meta_value) {\n\t\t\t\t\t\n\t\t\t\t\t\t// If we haven't used the metabox content, add it to the query.\n\t\t\t\t\t\t// Unfortunately, the WHERE is already pretty populated by now.\n\t\t\t\t\t\t// We can't just shove this onto the end. So, we use the post_title\n\t\t\t\t\t\t// part of the WHERE as a template and use preg_replace trickery\n\t\t\t\t\t\t// to put the right stuff in the right place.\n\t\t\t\t\t\tif(!in_array($meta_name, $used_meta)) {\n\t\t\t\t\t\t\t$used_meta[] = $meta_name;\n\t\t\t\t\t\t\t$q = preg_replace(\"/(\\($wpdb->posts.post_title LIKE '(%.*?%)'\\))/\", '$1 OR (launchpad_search_' . $meta_name . '.meta_value LIKE \"$2\")', $q);\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}\n\treturn $q;\n}", "function genesis_do_search_title() {\n\n\t$title = sprintf( '<div class=\"archive-description\"><h1 class=\"archive-title\">%s %s</h1></div>', apply_filters( 'genesis_search_title_text', __( 'Search results for: ', 'genesis' ) ), get_search_query() );\n\n\techo apply_filters( 'genesis_search_title_output', $title ) . \"\\n\";\n\n}", "public function getSearch(Request $request)\n {\n $search = DB::table('posts')->orWhere('seo_title', 'like', '%' . $request->seo_title . '%')\n ->orderBy('id', 'desc')->get();\n // ->where([\n // ['name','like','%' . $request->content . '%'],\n // ['title','like','%' . $request->content . '%']\n // ])\n \n return view('frontend.products.search',compact('search'));\n }", "public function search()\n {\n // General for all pages\n $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get();\n // General END\n $search_word = \"\";\n $active_tab = 0;\n return view('backEnd.search', compact(\"GeneralWebmasterSections\", \"search_word\", \"active_tab\"));\n }", "public function searchPageAction(){\n // Get entity Manager\n $em = $this->get('doctrine')->getManager();\n\n\t$searchTxt = $_POST['search'];\n\n\n\t$films = $em->createQuery('SELECT f FROM VideotechBundle:Film f\n\t \t\t\t\t WHERE f.title like :search')\n ->setParameter('search', '%' . $searchTxt . '%')\n\t\t ->execute();\n\n\n $categories = $em->createQuery('SELECT c FROM VideotechBundle:Category c\n\t \t\t\t\t WHERE c.name like :search')\n ->setParameter('search', '%' . $searchTxt . '%')\n\t\t ->execute();\n\n // Render display\n return $this->render('@Videotech/Film/search.twig', array(\n \"films\" => $films,\n\t \"categories\" => $categories\n ));\n }", "public function actionSearch() {\n $postSearch = new Search;\n if (isset($_POST['Search'])) {\n $postSearch->attributes = $_POST['Search'];\n $keyWord = $postSearch->keyWord;\n $criteria = new CDbCriteria;\n $criteria->distinct = true;\n if (strlen($keyWord) > 0) {\n $searchCondition = '';\n if ($postSearch->searchByName) {\n $searchCondition = 'd.title like :keyWord';\n }\n if ($postSearch->searchByContent) {\n if ($searchCondition == '') {\n $searchCondition = 'd.content like :keyWord';\n } else {\n $searchCondition = ' OR d.content like :keyWord';\n }\n }\n if (!$postSearch->searchByName && !$postSearch->searchByContent) {\n $searchCondition = 'd.title like :keyWord OR d.content like :keyWord';\n }\n if ($searchCondition != '') {\n $searchCondition = ' AND (' . $searchCondition . ')';\n }\n $criteria->join = ' INNER JOIN post_detail d ON t.id=d.post_id ' . $searchCondition;\n $criteria->params = array(':keyWord' => '%' . $keyWord . '%');\n }\n $dataProvider = new CActiveDataProvider('Post', array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n ),\n ));\n $postSearch = new Search;\n $this->render('list', array(\n 'postSearch' => $postSearch,\n 'dataProvider' => $dataProvider,\n ));\n }\n }", "public function search() {\n if (!isset($this->params['searchText'])) {\n DooUriRouter::redirect(Doo::conf()->APP_URL);\n return FALSE;\n }\n $blog = new News();\n\n $data['title'] = $this->__('Search results');\n $data['body_class'] = 'index_news';\n $data['selected_menu'] = 'news';\n $data['left'] = PlayerHelper::playerLeftSide();\n $data['right'] = PlayerHelper::playerRightSide();\n\n $list = array();\n $this->appendCategories($list, $news, false);\n\n //crumb adding\n $this->addCrumb($this->__('Search results'));\n $list['crumb'] = $this->getCrumb();\n\n $totalResults = $news->getSearchTotal(urldecode($this->params['searchText']));\n $pager = $this->appendPagination($list, new stdClass(), $totalResults > 0 ? $totalResults : 1, MainHelper::site_url('news/search/' . urlencode($this->params['searchText'])));\n\n $list['hideHeader'] = true;\n $list['searchText'] = urldecode($this->params['searchText']);\n $list['resultCount'] = $totalResults;\n $list['newsList'] = $news->getSearch(urldecode($this->params['searchText']), $pager->limit);\n\n $data['content'] = $this->renderBlock('news/searchResults', $list);\n\n $data['footer'] = MainHelper::bottomMenu();\n $data['header'] = MainHelper::topMenu();\n $this->render3Cols($data);\n }", "public function searchTitle(Request $request)\n {\n // $posts = Post::where('title', 'LIKE', '%'. $request->get('title') . '%')->get(); \n $posts = Post::where('title', 'LIKE', '%'. $request->get('title') . '%')->paginate(3);\n \n $data = array('posts'=>$posts);\n return view('posts.search', $data);\n }", "public function searchContent($searchTerm = '*', $filters = array(), $fields = array(), $sort = array(array('_score' => 'desc'), array('date_revised' => 'desc')), $options = array())\n {\n #$this->getServiceLocator()->get('Logger')->debug('searchTerm called');\n\n $filterObjects = array();\n foreach ($filters as $filterKey => $filterValue) {\n switch ($filterKey) {\n case '_id':\n if (is_array($filterValue)) {\n $elasticaFilterId = new \\Elastica\\Filter\\Ids(null, $filterValue);\n } else {\n $elasticaFilterId = new \\Elastica\\Filter\\Ids(null, array($filterValue));\n }\n $filterObjects[] = $elasticaFilterId;\n break;\n case 'start_date':\n case 'end_date':\n break;\n case 'body':\n case 'headline':\n $elasticaQuery = new \\Elastica\\Query\\QueryString($filterKey . ':' . \\Elastica\\Util::escapeTerm($filterValue));\n $elasticaFilter = new \\Elastica\\Filter\\Query($elasticaQuery);\n $elasticaFilter->setName($filterKey);\n $filterObjects[] = $elasticaFilter;\n break;\n case 'pub_code':\n if (isset($filterValue['all_markets'])) {\n if (isset($filterValue['hide_bloomberg'])) {\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm('pub_code', 'bloomberg');\n $marketFilter = new \\Elastica\\Filter\\BoolNot($termFilter);\n } else {\n $marketFilter = $termFilter;\n }\n } else {\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm('pub_code', $filterValue['market_code']);\n if (!isset($filterValue['hide_bloomberg'])) {\n $termFilter2 = new \\Elastica\\Filter\\Term();\n $termFilter2->setTerm('pub_code', 'bloomberg');\n $marketFilter = new \\Elastica\\Filter\\BoolOr();\n $marketFilter->addFilter($termFilter);\n $marketFilter->addFilter($termFilter2);\n } else {\n $marketFilter = $termFilter;\n }\n }\n \n if (!empty($marketFilter)) {\n $filterObjects[] = $marketFilter;\n }\n break;\n case 'pub_bloomberg':\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm('pub_id', $filterValue);\n $termFilter2 = new \\Elastica\\Filter\\Term();\n $termFilter2->setTerm('pub_code', 'bloomberg');\n $mktFilter = new \\Elastica\\Filter\\BoolOr();\n $mktFilter->addFilter($termFilter);\n $mktFilter->addFilter($termFilter2);\n $filterObjects[] = $mktFilter;\n break;\n default:\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm($filterKey, $filterValue);\n $filterObjects[] = $termFilter;\n break;\n }\n }\n\n if (!empty($filters['start_date']) || !empty($filters['end_date'])) {\n $elasticaFilterDate = new \\Elastica\\Filter\\Range();\n $filterOptions = array();\n $elasticaFilterDate->setName('range_dates');\n\n if (!empty($filters['start_date'])) {\n $startDate = new \\DateTime($filters['start_date']);\n $filterOptions['gte'] = $startDate->format('c');\n }\n if (!empty($filters['end_date'])) {\n $endDate = new \\DateTime($filters['end_date'] . '23:59:59');\n $filterOptions['lte'] = $endDate->format('c');\n }\n $elasticaFilterDate->addField('date_created', $filterOptions);\n $filterObjects[] = $elasticaFilterDate;\n }\n\n $elasticaQuery = new \\Elastica\\Query();\n\n // Create the actual search object with some data.\n $searchTermSend = (!empty($searchTerm) && ($searchTerm != '*')) ? \\Elastica\\Util::escapeTerm($searchTerm) : '*';\n // unescape phrases\n $searchTermSend = str_replace('\\\"', '\"', $searchTermSend);\n // capitalize booleans\n $searchTermSend = str_replace(' and ', ' AND ', $searchTermSend);\n $searchTermSend = str_replace(' or ', ' OR ', $searchTermSend);\n\n $elasticaQueryString = new \\Elastica\\Query\\QueryString($searchTermSend);\n $elasticaQueryString->setUseDisMax(true);\n $elasticaQueryString->setAutoGeneratePhraseQueries(true);\n if (isset($options['queryfields'])) {\n $elasticaQueryString->setFields($options['queryfields']);\n }\n // this doesn't work right... elasticsearch returns empty fields instead\n // of what we requested\n #if (!empty($fields)) {\n # $elasticaQuery->setFields($fields);\n #}\n if (isset($options['default_operator'])) {\n $elasticaQueryString->setDefaultOperator($options['default_operator']);\n }\n\n if (!empty($filterObjects)) {\n if (count($filterObjects) == 1) {\n $elasticaQuery->setFilter($filterObjects[0]);\n } else {\n $elasticaFilterAnd = new \\Elastica\\Filter\\BoolAnd();\n foreach ($filterObjects as $filter) {\n $elasticaFilterAnd->addFilter($filter);\n }\n $elasticaQuery->setFilter($elasticaFilterAnd);\n }\n }\n\n if (!isset($options['no_facets'])) {\n $facets = array();\n if (!empty($options['facets'])) {\n $facets = $options['facets'];\n } else {\n // These are the default facets\n $facets = array(\n 'pub_name' => array(\n 'field' => 'pub_name',\n 'type' => 'terms',\n ),\n );\n }\n if (!empty($facets)) {\n foreach ($facets as $facetName => $facetOptions) {\n if (!isset($facetOptions['type']) || empty($facetOptions['type'])) {\n $facetOptions['type'] = 'terms';\n }\n if (!isset($facetOptions['size']) || empty($facetOptions['size'])) {\n $facetOptions['size'] = 100;\n }\n if (!isset($facetOptions['order']) || empty($facetOptions['order'])) {\n $facetOptions['order'] = 'count';\n }\n if (!isset($facetOptions['field']) || empty($facetOptions['field'])) {\n // required\n $this->getServiceLocator()->get('Logger')->err(\"Skipping facet $facetName because no field defined\");\n continue;\n }\n switch ($facetOptions['type']) {\n case 'terms':\n $elasticaFacet = new \\Elastica\\Facet\\Terms($facetName);\n $elasticaFacet->setSize($facetOptions['size']);\n $elasticaFacet->setOrder($facetOptions['order']);\n $elasticaFacet->setField($facetOptions['field']);\n // now we need to apply our query to the facet so we only\n // get facet values that are within our results\n if (!empty($filterObjects)) {\n if (count($filterObjects) == 1) {\n $elasticaFacet->setFilter($filterObjects[0]);\n } else {\n $elasticaFilterAnd = new \\Elastica\\Filter\\BoolAnd();\n foreach ($filterObjects as $filter) {\n $elasticaFilterAnd->addFilter($filter);\n }\n $elasticaFacet->setFilter($elasticaFilterAnd);\n }\n }\n $elasticaQuery->addFacet($elasticaFacet);\n $elasticaFacet->setGlobal(false);\n break;\n default:\n # unhandled facet type\n $this->getServiceLocator()->get('Logger')->err(\"Unhandled facet type {$facetOptions['type']}\");\n break;\n }\n }\n }\n }\n\n if (!empty($sort)) {\n $elasticaQuery->setSort($sort);\n }\n\n $elasticaQuery->setQuery($elasticaQueryString);\n\n return $this->search($elasticaQuery, '\\Services\\Elastica\\ResultSet\\Video', $options);\n }", "public function search(){\n if(isset($_POST['text_search'])){\n $title = trim($this->input->post('text_search') , ' ');\n $data = $this->base_model->search_data('deal' , 'customer' , 'deal.* , customer.fullname , unit.name' ,'deal.customer_id = customer.id' , 'left' , array('customer.fullname'=>$title) , NULL , array('deal.id' , 'DESC') , NULL , array('unit','deal.money_id = unit.id'));\n echo json_encode($data);\n }else{\n show_404();\n }\n }", "public function search()\n {\n $post = post::where('title','like','%'.request('search').'%')->get();\n return view('resultes')\n ->with('tags' , tag::all() ) \n \n \n \n ->with('posts' , $post)\n\n ->with('title' , 'Result : '. request('search'))\n \n ->with('categories' , Category::take(5)->get() ) \n ->with('query' , request('search') ) ;\n }", "public function search() {\n\t\t$this->form_validation->set_data($this->input->get());\n\t\t$this->form_validation->set_rules('search', 'Search term', 'required|trim|min_length[3]',array('min_length' => 'The Search term must be at least 3 characters long.'));\n\t\t$this->form_validation->set_error_delimiters('<p class = \"error search-error\">', '</p>\n\t\t\t');\n \t\t// If search fails\n\t\tif ($this->form_validation->run() === FALSE) {\n\t\t\treturn $this->index();\n\t\t} else {\n\t\t\t$expression = $this->input->get('search');\n\t\t\t$posts_count = $this->Posts_model->search_count($expression);\n\t\t\t$query_string_segment = 'page';\n\t\t\t$config = $this->_initPagination(\"/posts/search\", $posts_count, $query_string_segment);\n\t\t\t$data = $this->Static_model->get_static_data();\n\t\t\t$data['pages'] = $this->Pages_model->get_pages();\n\t\t\t$data['categories'] = $this->Categories_model->get_categories();\n //use limit and offset returned by _initPaginator method\n\t\t\t$data['posts'] = $this->Posts_model->search($expression, $config['limit'], $config['offset']);\n\t\t\t$data['expression'] = $expression;\n\t\t\t$data['posts_count'] = $posts_count;\n\t\t\t$this->load->view('partials/header', $data);\n\t\t\t$this->load->view('search');\n\t\t\t$this->load->view('partials/footer');\n\t\t}\n\t}", "public function searchByTitle($search)\n {\n $entityManager = $this->getEntityManager();\n $queryBuilder = $entityManager->createQueryBuilder();\n $queryBuilder\n ->select('bp')\n ->from('App:BlogPost', 'bp')\n ->where('bp.title LIKE :search OR bp.category LIKE :search OR bp.writer LIKE :search')->setParameter('search', '%'.$search.'%');\n\n return $queryBuilder->getQuery()->getResult();\n }", "public function search() {\n$blogposts = BlogPost::search($_POST['search']);\n require_once('views/blogs/search.php');\n}", "function sopac_search_form_basic() {\n\n $locum = sopac_get_locum('locum');\n $locum_cfg = $locum->locum_config;\n $getvars = sopac_parse_get_vars();\n\n $actions = sopac_parse_uri();\n if ($actions[0] == \"search\") {\n if ($actions[3]) {\n $actions[2] = $actions[2] . \"/\" . $actions[3];\n urlencode($actions[2]);\n }\n $search_query = $actions[2];\n $stype_selected = $actions[1] ? 'cat_' . $actions[1] : 'cat_keyword';\n }\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg[format_groups] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n\n $stypes = array(\n 'cat_keyword' => t('Keyword'),\n 'cat_title' => t('Title'),\n 'cat_author' => t('Author'),\n 'cat_series' => t('Series'),\n 'cat_tags' => t('Tags'),\n 'cat_reviews' => t('Reviews'),\n 'cat_subject' => t('Subject'),\n 'cat_callnum' => t('Call Number'),\n );\n\n $sortopts = array(\n 'relevance' => t('Relevance'),\n 'newest' => t('Newest First'),\n 'oldest' => t('Oldest First'),\n );\n\n $sformats = array('' => 'Everything');\n foreach ($locum_cfg['format_groups'] as $sfmt => $sfmt_codes) {\n $sformats[preg_replace('/,[ ]*/', '|', trim($sfmt_codes))] = ucfirst($sfmt);\n }\n if (is_null($prompt)) {\n $prompt = t('Enter your keywords');\n }\n\n // Initialize the form\n $form = array(\n '#attributes' => array('class' => 'search-form'),\n '#validate' => array('sopac_search_catalog_validate'),\n '#submit' => array('sopac_search_catalog_submit'),\n );\n // Start creating the basic search form\n $form['inline'] = array(\n '#prefix' => '<div class=\"basic-search-inline\">',\n '#suffix' => '</div>'\n );\n $form['inline']['search_query'] = array(\n '#type' => 'textfield',\n '#default_value' => $search_query,\n '#size' => 25,\n '#maxlength' => 255,\n '#attributes' => array('x-webkit-speech' => 'true'),\n );\n $form['inline']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Search'),\n );\n\n $form['filters'] = array(\n '#prefix' => '<div id=\"filters\">',\n '#suffix' => '</div>'\n );\n $form['filters']['search_type'] = array(\n '#type' => 'select',\n '#title' => t('Search By'),\n '#default_value' => $stype_selected,\n '#options' => $stypes,\n );\n $form['filters']['search_format'] = array(\n '#type' => 'select',\n '#title' => t('Material'),\n '#default_value' => $_GET['search_format'],\n '#selected' => $_GET['search_format'],\n '#options' => $sformats,\n );\n $form['filters']['limit_avail'] = array(\n '#type' => 'select',\n '#title' => 'On Shelf At',\n '#options' => array_merge(array('' => '--', 'any' => \"Any Location\"), $locum_cfg['branches']),\n '#default_value' => $getvars['limit_avail'],\n );\n $form['advanced'] = array(\n '#value' => '<div class=\"basic-search-links\">' .\n l(\"Advanced Search\", variable_get('sopac_url_prefix', 'cat/seek') . '/advanced') .\n '&nbsp;|&nbsp;' .\n l(\"Search Tips\", variable_get('sopac_url_prefix', 'cat/seek') . '/tips') .\n '</div>',\n );\n\n return $form;\n}", "public function search()\n\t{\n\t\treturn self::extraSearch($this);\n\t}", "function contacts_search_query( $query ) {\n $custom_fields = array(\n // put all the meta fields you want to search for here\n \"first_name\",\n \"last_name\",\n \"email\",\n \"mobile_phone\",\n \"home_phone\",\n \"business_phone\",\n \"other_phone\",\n \"company\",\n \"title\",\n \"notes\"\n\n );\n $searchterm = $query->query_vars['s'];\n\n // we have to remove the \"s\" parameter from the query, because it will prevent the posts from being found\n $query->query_vars['s'] = \"\";\n\n if ($searchterm != \"\") {\n $meta_query = array('relation' => 'OR');\n foreach($custom_fields as $cf) {\n array_push($meta_query, array(\n 'key' => $cf,\n 'value' => $searchterm,\n 'compare' => 'LIKE'\n ));\n }\n $query->set(\"meta_query\", $meta_query);\n };\n}", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function search($params = []);", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id,true);\n $criteria->compare('content_id',$this->content_id,true);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('alias',$this->alias,true);\n $criteria->compare('text',$this->text,true);\n $criteria->compare('user_created',$this->user_created);\n $criteria->compare('user_edited',$this->user_edited);\n $criteria->compare('rec_created',$this->rec_created,true);\n $criteria->compare('rec_modified',$this->rec_modified,true);\n \n //$criteria->condition='is_external=0';\n\n \treturn new CActiveDataProvider(get_class($this), array(\n \t\t'criteria'=>$criteria,\n \t\t'sort'=>array(\n \t\t\t'defaultOrder'=>'rec_created desc',\n \t\t),\n \t\t'pagination'=>array(\n \t\t\t'pageSize'=>30\n \t\t),\n \t));\n }", "public static function search() {\n if(isset($_GET['q']) AND !empty($_GET['q'])) {\n $q = htmlspecialchars($_GET['q']);\n $contacts = \\Phonebook\\Models\\ContactsModel::findByNameAndNum($q);\n return $contacts;\n } else {\n $q = Null;\n $contacts = \\Phonebook\\Models\\ContactsModel::findByEmptySearch($q);\n return $contacts;\n }\n echo $this->templates->render('home');\n }", "public function searchResult()\r\n {\r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Search Results\");\r\n \r\n // Getting all the categories\r\n $categoryList = $this->Category->getCategoryList();\r\n \r\n // Passing the categories list to views\r\n $this->set('categoryList', $categoryList);\r\n \r\n // initialising the variable\r\n $whereCondition = '';\r\n $search_keyword = '';\r\n // if any search keyword then setting into variable.\r\n if (isset($this->data['Product']['keywords']) && !empty($this->data['Product']['keywords']))\r\n {\r\n $search_keyword = $this->data['Product']['keywords'];\r\n \r\n if(!empty($whereCondition))\r\n {\r\n $whereCondition .= \" AND \";\r\n }\r\n \r\n $whereCondition .= \" (Product.product_name LIKE '%\".$search_keyword.\"%') OR (Product.product_desc LIKE '%\".$search_keyword.\"%') \";\r\n }\r\n \r\n $conditions[] = $whereCondition;\r\n \r\n // Getting the products and categories list agianst search criteria\r\n $productList = $this->Product->getSearchResults($conditions);\r\n \r\n // Passing for first product images by default.\r\n $this->set('productList', $productList);\r\n \r\n // Passing the search keywords to views\r\n $this->set('search_keyword', $search_keyword);\r\n \r\n }", "public function search()\n {\n return view('blog::blog.search');\n }", "public function searchAction() {\n parent::searchAction();\n }", "function select_search($searchText)\n{\n $query =\n \"SELECT * FROM posts WHERE `title` LIKE '%$searchText' OR\n `information` LIKE '%$searchText'\";\n $result = DB::get()->query($query);\n return $result;\n}", "public function wpcd_app_meta_or_title_search( $query ) {\n\n\t\tglobal $typenow;\n\n\t\t$post_type = 'wpcd_app';\n\t\t$title = $query->get( '_meta_or_title' );\n\t\tif ( is_admin() && $typenow === $post_type && $query->is_search() && $title ) {\n\t\t\tadd_filter(\n\t\t\t\t'get_meta_sql',\n\t\t\t\tfunction( $sql ) use ( $title ) {\n\t\t\t\t\tglobal $wpdb;\n\n\t\t\t\t\t// Only run once.\n\t\t\t\t\tstatic $nr = 0;\n\t\t\t\t\tif ( 0 !== $nr++ ) {\n\t\t\t\t\t\treturn $sql;\n\t\t\t\t\t}\n\n\t\t\t\t\t$server_meta_search = \"{$wpdb->postmeta}.meta_key = 'parent_post_id' AND {$wpdb->postmeta}.meta_value IN ( SELECT P.ID FROM {$wpdb->posts} AS P LEFT JOIN {$wpdb->postmeta} AS PM on PM.post_id = P.ID WHERE P.post_type = 'wpcd_app_server' and P.post_status = 'private' and ( ( PM.meta_key = 'wpcd_server_provider' AND PM.meta_value LIKE '\" . esc_sql( '%' . $wpdb->esc_like( $title ) . '%' ) . \"' ) OR ( PM.meta_key = 'wpcd_server_ipv4' AND PM.meta_value LIKE '\" . esc_sql( '%' . $wpdb->esc_like( $title ) . '%' ) . \"' ) OR ( PM.meta_key = 'wpcd_server_region' AND PM.meta_value LIKE '\" . esc_sql( '%' . $wpdb->esc_like( $title ) . '%' ) . \"' ) OR ( PM.meta_key = 'wpcd_server_name' AND PM.meta_value LIKE '\" . esc_sql( '%' . $wpdb->esc_like( $title ) . '%' ) . \"' ) ) )\";\n\n\t\t\t\t\t// Modified WHERE.\n\t\t\t\t\t$sql['where'] = sprintf(\n\t\t\t\t\t\t' AND ( (%s) OR (%s) OR (%s) ) ',\n\t\t\t\t\t\t$wpdb->prepare( \"{$wpdb->posts}.post_title LIKE '%%%s%%'\", $title ),\n\t\t\t\t\t\tmb_substr( $sql['where'], 5, mb_strlen( $sql['where'] ) ),\n\t\t\t\t\t\t$server_meta_search\n\t\t\t\t\t);\n\n\t\t\t\t\treturn $sql;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "public function PressSearch()\n {\n $term = trim(request()->input('search'));\n $press = Press::where('title', 'like', '%' . $term . '%')\n ->orWhere('content', 'like', '%' . $term . '%')\n ->orderBy('date', 'desc')\n ->get();\n\n return view('pages.press.index', [\n 'title' => 'Search',\n 'press' => $press\n ]);\n }" ]
[ "0.72183716", "0.70303917", "0.67699736", "0.6767789", "0.6767789", "0.6734254", "0.67186576", "0.65807337", "0.65126055", "0.6484028", "0.64552015", "0.6444967", "0.6430597", "0.64257157", "0.63807803", "0.6352992", "0.6330596", "0.6320153", "0.63171023", "0.62858206", "0.62800455", "0.62705106", "0.6259885", "0.622698", "0.62192696", "0.620402", "0.6203659", "0.6197278", "0.6193555", "0.617078", "0.617078", "0.6170329", "0.61699325", "0.61592114", "0.6151435", "0.61314", "0.61261356", "0.6123189", "0.6119302", "0.6109769", "0.6101721", "0.60994107", "0.6095898", "0.6074403", "0.6070542", "0.60671425", "0.6057616", "0.6054281", "0.60540515", "0.60516685", "0.60293597", "0.6025994", "0.602552", "0.6014447", "0.6006959", "0.5996922", "0.5966932", "0.5966311", "0.5961536", "0.5955577", "0.59541196", "0.59500855", "0.5949848", "0.59478617", "0.5945702", "0.5945202", "0.5944593", "0.5944593", "0.59342974", "0.59267753", "0.5919724", "0.5907558", "0.59050655", "0.59032315", "0.5900265", "0.58998656", "0.589745", "0.5895076", "0.58931565", "0.58859646", "0.5885336", "0.5885165", "0.5880108", "0.5874277", "0.5865079", "0.58638597", "0.5860244", "0.58600885", "0.58547366", "0.5844924", "0.58408684", "0.58339345", "0.5832258", "0.5830859", "0.58308375", "0.58294415", "0.58258736", "0.58237886", "0.5821202", "0.5820517" ]
0.6775688
2
Return Global variables for use in templates.
static public function get_template_global_variables() { return array ( "FacebookConnectURL" => "connect_url", "FacebookLoginURL" => "login_url", "FacebookDisconnectURL" => "disconnect_url" ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_template_global_variables()\n {\n return [\n 'FoxyStripe' => 'current_foxystripe_setting',\n ];\n }", "public static function get_template_global_variables()\n {\n return [\n 'TemplateConfig' => 'current_template_config',\n ];\n }", "public function getGlobals();", "public function getGlobals();", "public function getUserDefinedGlobals()\n {\n if(file_exists(realpath(__DIR__.'/../../../../config/twig.php'))){\n $this->config = require_once realpath(__DIR__.'/../../../../config/twig.php');\n }elseif (file_exists(realpath(__DIR__ . '/../config/twig.php'))){\n $this->config = require_once realpath(__DIR__ . '/../config/twig.php');\n }\n return $this->config['twig_global'];\n }", "function fiorello_mikado_get_global_variables() {\n\t\t$global_variables = array();\n\n\t\t$global_variables['mkdfAddForAdminBar'] = is_admin_bar_showing() ? 32 : 0;\n\t\t$global_variables['mkdfElementAppearAmount'] = -100;\n\t\t$global_variables['mkdfAjaxUrl'] = esc_url( admin_url( 'admin-ajax.php' ) );\n\n\t\t$global_variables = apply_filters( 'fiorello_mikado_filter_js_global_variables', $global_variables );\n\n\t\twp_localize_script( 'fiorello-mikado-modules', 'mkdfGlobalVars', array(\n\t\t\t'vars' => $global_variables\n\t\t) );\n\t}", "public function getGlobals()\n {\n return [\n 'snippets' => new SnippetsTwig($this->flextype)\n ];\n }", "public function getGlobals()\n {\n global $APPLICATION;\n\n return array(\n 'APPLICATION' => $APPLICATION,\n 'LANG' => LANG,\n 'POST_FORM_ACTION_URI' => POST_FORM_ACTION_URI,\n 'DEFAULT_TEMPLATE_PATH' => self::DEFAULT_TEMPLATE_PATH,\n '_REQUEST' => $_REQUEST,\n 'SITE_SERVER_NAME' => SITE_SERVER_NAME,\n '_SESSION' => $_SESSION\n );\n }", "public function getGlobals()\n\t{\n\t\treturn array(\n\t\t\t'uri' => $this->app->get('uri'),\n\t\t\t'uri.base.path' => $this->app->get('uri.base.path')\n\t\t);\n\t}", "private function globals() {\n global $pagesArray;\n \n $xml = XML2Array::createArray(file_get_contents(GSDATAOTHERPATH.'website.xml'));\n \n // turn PRETTYURLS into boolean\n if ($xml['item']['PRETTYURLS']=='') $xml['item']['PRETTYURLS'] = false;\n else $xml['item']['PRETTYURLS'] = true;\n \n // globals array\n $globals = array(\n 'sitename' => $xml['item']['SITENAME']['@cdata'],\n 'siteurl' => $xml['item']['SITEURL']['@cdata'],\n 'template' => $xml['item']['TEMPLATE']['@cdata'],\n 'pages' => $pagesArray,\n 'permalink' => $xml['item']['PERMALINK'],\n 'prettyurls' => $xml['item']['PRETTYURLS'],\n );\n return $globals;\n }", "function getTemplateVars() {\n return array();\n }", "public function getGlobals() {\r\n\t\treturn [\r\n 'REQUEST' => [\r\n\t\t\t\t'url' => Response::$url\r\n\t\t\t],\r\n 'SESSION' => (isset($_SESSION)) ? $_SESSION : [],\r\n 'SERVER' => $_SERVER,\r\n 'INPUT' => App::$input,\r\n 'ENV' => App::$env\r\n ];\r\n }", "public function getGlobals()\n {\n }", "public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }", "public function getGlobals()\n {\n return self::$globalsCache;\n }", "protected static function initializeGlobalVariables() {}", "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 }", "public function getTemplateVariables()\n {\n return self::$templateVariables;\n }", "public function getTemplateVars(){\n\t\t\treturn $this->template_vars;\n\t\t}", "public function getTemplateVars(){\n\n return $this->template_vars;\n\n }", "public static function fromGlobals() {}", "public function getVars()\r\n {\r\n return $this->_smarty->getTemplateVars();\r\n }", "function getTemplateVars() {\n return $this->templateVars;\n }", "public function getGlobals()\n {\n return array();\n }", "public function getGlobals()\n {\n return array();\n }", "public function getGlobals()\n {\n $locales = $this->registry->getRegisteredLocales();\n\n try {\n $locale = $this->requestStack->getCurrentRequest()->getLocale();\n } catch (\\Exception $e) {\n $locale = current($locales);\n }\n\n return [\n '_locale' => $locale,\n '_locales' => $locales\n ];\n }", "public static function getVars()\n {\n if (is_null(static::$vars)) {\n static::$vars = static::buildRepository(true);\n }\n\n return static::$vars;\n }", "public static function fromGlobals() : PageVariables {\n\t\t\treturn new PageVariables(\n\t\t\t\t$_COOKIE ?? [],\n\t\t\t\t$_ENV ?? [],\n\t\t\t\t$_FILES ?? [],\n\t\t\t\t$_GET ?? [],\n\t\t\t\t$_POST ?? [],\n\t\t\t\t$_REQUEST ?? [],\n\t\t\t\t$_SERVER ?? [],\n\t\t\t\t$_SESSION ?? []\n\t\t\t);\n\t\t}", "public function getTemplateVariables(): array;", "public function &getVars() {\n return $this->app->getVars();\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}", "public function getVars() {\r\n return $this->VARS;\r\n }", "protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\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 static function getDefaultGlobals(){\n\t\treturn Array(\n\t\t);\n\t}", "private function fn_register_common_variables() {\n\t\t$current_user = wp_get_current_user();\n\t\t//perhaps we don't need this variable. still, lets continue with this.\n\t\t$this->app_data['swpmvc_current_user'] = $current_user;\n\t\t$this->app_data['inline_js'] = '';\n\t}", "public function getGlobals()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('globals');\n }", "private function setup_globals() {\r\n\t\t/** Versions **********************************************************/\r\n\r\n\t\t$this->version = '0.3-alpha';\r\n\t\t$this->db_version = '1';\r\n\r\n\t\t/** Paths *************************************************************/\r\n\r\n\t\t$this->file = __FILE__;\r\n\t\t$this->basename = apply_filters( 'atcf_plugin_basenname', plugin_basename( $this->file ) );\r\n\t\t$this->plugin_dir = apply_filters( 'atcf_plugin_dir_path', plugin_dir_path( $this->file ) );\r\n\t\t$this->plugin_url = apply_filters( 'atcf_plugin_dir_url', plugin_dir_url ( $this->file ) );\r\n\r\n\t\t$this->template_url = apply_filters( 'atcf_plugin_template_url', 'crowdfunding/' );\r\n\r\n\t\t// Includes\r\n\t\t$this->includes_dir = apply_filters( 'atcf_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );\r\n\t\t$this->includes_url = apply_filters( 'atcf_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );\r\n\r\n\t\t// Languages\r\n\t\t$this->lang_dir = apply_filters( 'atcf_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );\r\n\r\n\t\t/** Misc **************************************************************/\r\n\r\n\t\t$this->domain = 'atcf'; \r\n\t}", "public function getGlobalJSVariables($globalVariables) {\n\t\t$global_variables['mkdfLogoAreaHeight'] = $this->logoAreaHeight;\n\t\t$global_variables['mkdfMenuAreaHeight'] = 0;\n\n\t\treturn $globalVariables;\n\t}", "public static function getDefaultVars(){\n\t\treturn Array(\n\t\t\t//--whether to output debug messages for this class\n\t\t\t'debug'=> false\n\t\t\t,'contentRelativePath'=> '_content'\n\t\t\t,'host'=> ($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['PWD']\n\t\t\t,'webRoot'=> ($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : $_SERVER['PWD']\n\t\t\t,'wpRelativePath'=> '_wp'\n\t\t\t,'protocol'=> (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) ? 'https' : 'http'\n\t\t);\n\t}", "public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }", "public function getTemplateVariables()\n\t{\n\t\treturn array_merge($this->template_variables, [\n\t\t\t'options' => $this->getOptions(),\n\t\t\t'column' => $this->getColumn(),\n\t\t\t'key' => $this->getKey(),\n\t\t\t'status' => $this\n\t\t]);\n\t}", "private function registerTwigGlobals()\n {\n $files = array_merge(\n glob( $this->getThemeDirectory().'*.yaml' ),\n glob( $this->getContentPath().'*.yaml')\n );\n\n # Get the *.yaml files (either from content or from the theme):\n foreach( $files as $yaml )\n {\n if( substr(basename($yaml), 0, 1) != '_' )\n {\n $this->addTwigGlobal(\n Utils::removeExtension($yaml),\n Yaml::parseFile($yaml)\n );\n }\n }\n\n # Now add additional useful vars:\n $this->addTwigGlobal('theme_dir', $this->config->get('site.url').$this->config->get('site.dir').$this->config->get('dirs.view').'/'.$this->config->get('site.theme').'/');\n $this->addTwigGlobal('base_url', $this->config->get('site.url').$this->config->get('site.dir'));\n }", "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 getGlobals()\n {\n if (!$this->runtimeInitialized && !$this->extensionInitialized) {\n return $this->initGlobals();\n }\n if (null === $this->globals) {\n $this->globals = $this->initGlobals();\n }\n return $this->globals;\n }", "public function getVars()\n {\n return [\n 'get' => $this->get,\n 'session' => $this->session,\n ];\n }", "protected function context() {\n return ArrayHelper::filter($GLOBALS, $this->logVars);\n }", "public function globalData() {\n $globalData = array();\n\n $this->db->select('*');\n $this->db->from('settings');\n $result = $this->db->get();\n foreach ($result->result_array() as $value) {\n $global[$value['setting_name']] = $value['setting_value'];\n }\n return $global;\n }", "public function getVars() {\n return array();\n }", "public function getGetVariables() {}", "public function vars()\n {\n return array_merge(parent::vars(), [\n 'user' => (string) $this->key->sysuser ? $this->key->sysuser->name : 'sitepilot',\n 'key' => (string) $this->key->key\n ]);\n }", "public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }", "public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }", "protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }", "public function defined_constant() {\n define( 'TS_VERSION', self::version );\n define( 'TS_FILE', __FILE__ );\n define( 'TS_PATH', __DIR__ );\n define( 'TS_URL', plugins_url( '', TS_FILE ) );\n define( 'TS_ASSETS', TS_URL .'/assets' );\n }", "public function getGetVariables();", "public function getHeaderFooterVariables() {\n\t\t$vars = $this->request->getVars();\n\n\t\tunset(\n\t\t\t$vars['url'],\n\t\t\t$vars['flushtoken'],\n\t\t\t$vars['flush']\n\t\t);\n\n\t\tif (isset($vars['page']) && strpos($vars['page'], '§ion=') !== false) {\n\t\t\t$parts = explode('§', $vars['page']);\n\t\t\t$vars['page'] = $parts[0];\n\t\t\t$vars['section'] = str_replace('ion=', '', $parts[1]);\n\t\t}\n\n\t\t$string = '';\n\n\t\tforeach ($vars as $key => $value) {\n\t\t\t$string .= '<strong style=\"color: red;\">$' . $key . '</strong> => ' . $value . '<br>';\n\t\t}\n\n\t\t$htmlString = DBHTMLText::create();\n\t\t$htmlString->setValue($string);\n\n\t\t$vars['all_variables'] = $htmlString;\n\n\t\treturn $vars;\n\t}", "static function getLangVars()\n\t{\n\t\treturn array(\"pc_vacc\", \"pc_hacc\");\n\t}", "public function getGlobalSettings()\n {\n return $this->postRequest('GetGlobalSettings');\n }", "function return_globals() {\r\n foreach ($GLOBALS as $k => $v) {\r\n\tif ($k !== 'GLOBALS')\r\n\t $arr[$k] = $v;\r\n }\r\n return @json_encode($arr);\r\n}", "function getVars() {\n return $this->vars;\n }", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "public function getStaticVariables() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->getStaticVariables();\n } else {\n return parent::getStaticVariables();\n }\n }", "function prepare_vars_for_template_usage()\n {\n }", "public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function getGlobals()\n {\n $hostname = $this->container->get('request')->getHost();\n $host = $this->container->get('doctrine.orm.entity_manager')->getRepository('SandboxWebsiteBundle:Host')\n ->findOneBy(['name' => $hostname]);\n return array('host' => $host);\n }", "public function getVars()\n {\n return $this->_variables;\n }", "static function getLangVars()\n\t{\n\t\treturn array(\"pc_mob\");\n\t}", "public function get_var() {\r\n\t\treturn $this->header_vars;\r\n\t}", "function wp_templating_constants()\n {\n }", "private function define_global_constants() {\n\t\tif ( !defined( 'PAULUS_APP_DIR' ) ) {\n\t\t\tdefine( 'PAULUS_APP_DIR', $this->app_base_path . DIRECTORY_SEPARATOR );\n\t\t}\n\t\tif ( !defined( 'PAULUS_EXTERNAL_LIB_DIR' ) ) {\n\t\t\tdefine( 'PAULUS_EXTERNAL_LIB_DIR', $this->app_base_path . '/../vendor' );\n\t\t}\n\t}", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "protected function getEnvironmentVariablesThatICareAbout()\n {\n return array(\n 'shell',\n 'tmpdir',\n 'user',\n 'pwd',\n 'lang',\n 'editor',\n 'home',\n );\n }", "function getSessionSettings(){\n\t\t\t$this->Init();\n\n\t\t\treturn array(\n\t\t\t\t\t\t\"lang\"=>$this->get(\"global/language\",LANG),\n\t\t\t\t\t\t\"color\"=>$this->get(\"global/theme_color\",THEME_COLOR)\n\t\t\t\t);\n\t\t}", "function getGlobalErrors()\n{\n global $system_errors;\n return $system_errors;\n}", "public function getVariables()\n {\n $variables = $this->getVariablesForPart($this->tempDocumentMainPart);\n\n foreach ($this->tempDocumentHeaders as $headerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($headerXML));\n }\n\n foreach ($this->tempDocumentFooters as $footerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($footerXML));\n }\n\n return array_unique($variables);\n }", "public function getScssVariables() {\n\t\treturn [\n\t\t\t'color-primary' => '#745bca'\n\t\t];\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 get_email_template_variables()\n\t{\n\t\t$user_data = $this->user_loader->get_user($this->get_data('from_user_id'));\n\n\t\treturn array(\n\t\t\t'AUTHOR_NAME'\t\t\t\t=> htmlspecialchars_decode($user_data['username']),\n\t\t\t'SUBJECT'\t\t\t\t\t=> htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),\n\n\t\t\t'U_VIEW_MESSAGE'\t\t\t=> generate_board_url() . '/ucp.' . $this->php_ext . \"?i=pm&mode=view&p={$this->item_id}\",\n\t\t);\n\t}", "public function getTemplateVars()\n {\n $cart = $this->context->cart;\n $total = $this->trans(\n '%amount% (tax incl.)',\n [\n '%amount%' => Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH)),\n ]\n );\n\n return [\n 'totalAmount' => $total,\n ];\n }", "public function dumpGlobalPrefs()\n\t{\n\t\treturn $this->global_prefs;\n\t}", "function woo_globals() {\n\n\t// Featured dimensions\n\t$GLOBALS['align_feat'] = 'alignleft'; if (get_option('woo_align_feat')) $GLOBALS['align_feat'] = get_option('woo_align_feat');\n\t$GLOBALS['thumb_width_feat'] = '200'; if (get_option('woo_thumb_width_feat')) $GLOBALS['thumb_width_feat'] = get_option('woo_thumb_width_feat');\n\t$GLOBALS['thumb_height_feat'] = '200'; if (get_option('woo_thumb_height_feat')) $GLOBALS['thumb_height_feat'] = get_option('woo_thumb_height_feat');\n\n\t// Thumbnail dimensions\n\t$GLOBALS['align'] = 'alignleft'; if (get_option('woo_align')) $GLOBALS['align'] = get_option('woo_align');\n\t$GLOBALS['thumb_width'] = '200'; if (get_option('woo_thumb_width')) $GLOBALS['thumb_width'] = get_option('woo_thumb_width');\n\t$GLOBALS['thumb_height'] = '200'; if (get_option('woo_thumb_height')) $GLOBALS['thumb_height'] = get_option('woo_thumb_height');\n\n\t// Featured Tags\n\t$GLOBALS['feat_tags_array'] = array();\n\n\t// Duplicate posts\n\t$GLOBALS['shownposts'] = array();\n\n\t// Video Category\n\tglobal $wpdb;\n\t$video_cat = get_option('woo_video_category');\n\t$GLOBALS[video_id] = $wpdb->get_var(\"SELECT term_id FROM $wpdb->terms WHERE name = '$video_cat'\");\n}", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "protected function getReactVariables()\n {\n $variables = [\n 'module' => $this->getModuleName(),\n ];\n\n return $variables;\n }", "private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }", "protected function initVars() {\n\n\t\t}", "public function getVars()\n\t{\n\t\treturn $this->requestVars;\n\t}", "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 getVars()\n {\n return $this->vars;\n }", "function qodef_re_set_global_map_variables() {\n \t\n \tif( qodef_re_theme_installed() ) {\n\t\t\t$global_map_variables = array();\n\t\t\n\t\t\t$global_map_variables['mapStyle'] = json_decode(bridge_qode_get_meta_field_intersect('real_estate_map_style'));\n\t\t\t$global_map_variables['scrollable'] = bridge_qode_options()->getOptionValue('real_estate_maps_scrollable') == 'yes' ? true : false;\n\t\t\t$global_map_variables['draggable'] = bridge_qode_options()->getOptionValue('real_estate_maps_draggable') == 'yes' ? true : false;\n\t\t\t$global_map_variables['streetViewControl'] = bridge_qode_options()->getOptionValue('real_estate_maps_street_view_control') == 'yes' ? true : false;\n\t\t\t$global_map_variables['zoomControl'] = bridge_qode_options()->getOptionValue('real_estate_maps_zoom_control') == 'yes' ? true : false;\n\t\t\t$global_map_variables['mapTypeControl'] = bridge_qode_options()->getOptionValue('real_estate_maps_type_control') == 'yes' ? true : false;\n\t\t\n\t\t\t$global_map_variables = apply_filters('qodef_re_filter_js_global_map_variables', $global_map_variables);\n\t\t\n\t\t\twp_localize_script('bridge-default', 'qodefMapsVars', array(\n\t\t\t\t'global' => $global_map_variables\n\t\t\t));\n\t\t}\n }", "public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}", "function getPrisijungimas(){\n global $prisijungimas;\n return $prisijungimas;\n}", "function getPrisijungimas(){\n global $prisijungimas;\n return $prisijungimas;\n}", "public function _static(){\n\t\t$data['base'] = $this->base;\n\t\t$data['css'] = $this->css;\n\t\t$data['js'] = $this->js;\n\t\t$data['img'] = $this->img;\n\t\t$data['less'] = $this->less;\n\t\n\t\treturn $data;\n\t}", "public function getVars()\n {\n return $this->vars;\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVariables()\n {\n return $this->variables;\n }" ]
[ "0.8152529", "0.814563", "0.7395513", "0.7395513", "0.7341268", "0.73349106", "0.7307145", "0.7288892", "0.72833073", "0.7258923", "0.7258572", "0.7245442", "0.7208314", "0.71917146", "0.714222", "0.7090933", "0.70851", "0.7043076", "0.69130445", "0.6877768", "0.6867696", "0.6858789", "0.68562204", "0.680026", "0.680026", "0.6767038", "0.6699289", "0.66804147", "0.6591297", "0.64996123", "0.64988416", "0.6486554", "0.6477317", "0.6455026", "0.6451291", "0.6439937", "0.6425249", "0.64214253", "0.63959265", "0.6375326", "0.63568", "0.6351971", "0.63429743", "0.6328921", "0.6321187", "0.6262051", "0.6251718", "0.6240851", "0.62083906", "0.6205895", "0.62042636", "0.6187351", "0.6183087", "0.6167328", "0.61613864", "0.61585087", "0.615493", "0.61397785", "0.61246973", "0.6114824", "0.6099905", "0.60916454", "0.60913163", "0.6090126", "0.608348", "0.6082475", "0.607166", "0.60702896", "0.6068774", "0.6053649", "0.6044166", "0.60388947", "0.60347986", "0.60283625", "0.6026286", "0.60014015", "0.600009", "0.599215", "0.5991109", "0.59852463", "0.59662986", "0.5965147", "0.59500456", "0.59452367", "0.59452367", "0.5931268", "0.5928889", "0.5923943", "0.59234136", "0.5919749", "0.59186697", "0.59151024", "0.59131473", "0.5911546", "0.5911546", "0.59109753", "0.58999693", "0.58999693", "0.5899274", "0.5899274" ]
0.7806888
2
Returns a URL for logged in users to connect their Facebook accounts
static public function connect_url() { return Controller::join_links("facebook", "connect"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function login_url() {\n\t\t$facebook = FacebookApp::get()->first();\n\t\tif($facebook && $facebook->EnableFacebookLogin == 1)\n\t\t\treturn Controller::join_links(\"facebook\", \"login\");\n\t\treturn false;\n\t}", "public function getLoginURL(){\r\n\t\treturn $this->facebook_obj->getLoginURL($this->getParamsForLogin());\r\n\t}", "public static function GetLoginURL()\n\t{\n\t\tinclude 'config.php';\n\t\t\n\t\t$params = array();\n\t\t$params['scope'] = $facebookSettings['scope'];\n\t\t$params['redirect_uri'] = $facebookSettings['loginRedirect'];\n\t\t\n\t\treturn self::GetFB()->getLoginUrl($params);\n\t}", "public function facebookUrl()\r\n\t{\r\n\t\treturn Mage::getBaseDir(\"media\") . DS . \"ezloginlite\" . DS. \"facebook\" . DS;\r\n\t}", "public function login_url()\n\t{\n\t\treturn $this->login_url = $this->_facebook->getLoginUrl(\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'scope'\t\t\t=> $this->_config->get('scope'),\n\t\t\t\t'redirect_uri'\t=> $this->_config->get('redirect_uri'),\n\t\t\t\t'display'\t\t=> $this->_config->get('display'),\n\t\t\t));\n\t}", "public function getLogin()\n\t{\n\t\tsession_start();\n\t\tFacebookSession::setDefaultApplication(env('FACEBOOK_CLIENT_ID'), env('FACEBOOK_CLIENT_SECRET'));\n\t\t\n\t\t$helper = new FacebookRedirectLoginHelper('http://startpage.com/facebook/update');\n\t\t$loginUrl = $helper->getLoginUrl();\n\n\t\treturn $loginUrl . 'user_posts';\n\t}", "public function getFacebookUrl()\n {\n return $this->facebook_url;\n }", "public function login_url()\n {\n return $this->login_url = urldecode($this->fb->getLoginUrl(array(\n 'scope' => $this->config->scope,\n 'redirect_uri' => $this->config->redirect_uri,\n 'display' => $this->config->display,\n )));\n }", "public function getOauthUri(): string\r\n {\r\n return 'https://www.facebook.com/dialog/oauth?';\r\n }", "public function getUrl() {\n\t\t//$url = \"https://www.facebook.com/dialog/oauth?client_id=\".$this->appId.\"&redirect_uri=\".$this->redirectUrl.\"&scope=\".$this->permission.\"&state=\".$_SESSION['state'];\n\t\treturn $this->redirectUrl;\n\t}", "public function getLoginUrl();", "public function loginWithFacebookAction()\n {\n \t$this->view->disable();\n \t$helper = $this->fbRedirectLoginHelper;\n \t$scope = array('public_profile', 'email', 'user_friends');\n \treturn $this->response->redirect($helper->getLoginUrl(), true);\n }", "public function facebook ()\n {\n return Socialite::driver('facebook')->redirect();\n\n }", "public function facebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function getUserInfoUri(string $token = ''): string\r\n {\r\n return 'https://graph.facebook.com/me?';\r\n }", "public function log_user_into_facebook()\n {\n // TODO: Parameterise redirect_url and scope values\n $login_config = array(\n \"redirect_uri\" => \"http://sociable.local/account/facebooklogin\",\n \"scope\" => \"user_birthday, read_stream, user_location, publish_stream, email, read_friendlists, publish_checkins, user_education_history, user_work_history\"\n );\n $login_url = self::getLoginUrl($login_config);\n header('Location: ' . $login_url, true);\n exit;\n }", "public function facebookRedirect(){\n $github_user = Socialite::driver('facebook')->redirect();\n }", "public function fbConnect($force = false)\r\n \t{\r\n \t\tif (!$this->_client->getUser() OR $force)\r\n\t\t{\r\n\t\t\treturn $this->_client->getLoginUrl($this->_requestParams);\r\n\t\t}\r\n\t\treturn true;\r\n \t}", "public function facebookLogin() {\n\t\t$this->autoRender = false;\n\n\t\t// config of facebook\n\t\t// app_id => app id from facebook app, app_secret => app secret from facebook app, default_graph_version\n\t\t$fb = new Facebook\\Facebook([\n\t\t\t'app_id' => '1038913562917167',\n\t\t\t'app_secret' => 'c0df3e628a09c24f972985ad47dee466',\n\t\t\t'default_graph_version' => 'v2.10',\n\t\t]);\n\n\t\t$helper = $fb->getRedirectLoginHelper();\n\n\t\t$permissions = ['email']; // Optional permissions\n\t\t$loginUrl = $helper->getLoginUrl('http://myanants.com/user/fbcallback', $permissions);\n\t\t$this->redirect($loginUrl);\n\n\t}", "function action_get_app_login_url(){\n \n $company = DB::table('User')\n ->join('Company', 'User.companyid', '=', 'Company.companyid')\n ->where('User.username', '=', Input::get('username'))\n ->or_where('User.email', '=', Input::get('username'))\n ->get('Company.name');\n \n return 'https://' . $company[0]->name . '.fdback.com/login';\n \n }", "public function getAuthUrl();", "public function redirectToFacebook()//redirects user to facebook authentication\n {\n return Socialite::driver('facebook')->redirect();\n }", "function redirect($facebook){\r\n\t\t$loginUrl = $facebook->getLoginUrl(array(\r\n\t\t\t\"canvas\" =>1,\r\n\t\t\t\"fbconnect\" =>0,\r\n\t\t\t'req_perms' => \"email,publish_stream,user_hometown,user_location,user_photos,friends_photos,\r\n\t\t\t\t\tuser_photo_video_tags,friends_photo_video_tags,user_videos,video_upload,friends_videos\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,user_hometown,user_location\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,status_update,user_hometown,\r\n\t\t\t//\t\t\t\tuser_location,user_photos,friends_photos,user_photo_video_tags,friends_photo_video_tags\"\r\n\t\t));\r\n\r\n\t\t /*echo \"<script type='text/javascript'>top.location.href = '$loginUrl';</script>\";*/\r\n\t\t echo \"loginUrl: \" . $loginUrl;\r\n\t}", "public function getAccountLogin_url()\n {\n return $this->getBrowser()->getCurrentURL();\n }", "public function facebook()\n {\n return facebook()->login();\n }", "function bones_login_url() { echo bloginfo('url'); }", "public function get_login_url() {\n\n $callbackurl = self::callback_url();\n $params = array_merge(\n [\n 'client_id' => $this->clientid,\n 'response_type' => 'code',\n 'redirect_uri' => $callbackurl->out(false),\n 'state' => $this->returnurl->out_as_local_url(false),\n 'scope' => $this->scope,\n ],\n $this->get_additional_login_parameters()\n );\n\n return new moodle_url($this->auth_url(), $params);\n }", "protected function login_url($params = array())\t{\n\t\t$scope = static::$scope;\n\t\treturn $this->instagram->getLoginUrl($scope);\n\t}", "public static function callback_url() {\n global $CFG;\n\n return new moodle_url('/admin/oauth2callback.php');\n }", "public function triggerFacebookLogin() {\n return Redirect::to( Facebook::getLoginUrl() );\n }", "public function login()\n\t{\n\t\tif (empty($this->_callbackURL))\n\t\t{\n\t\t\tthrow new Exception('No data for social login: Callback URL');\n\t\t}\n\n\t\t$oAuth = $this->_getTWOAuth();\n\t\t$tokenCredentials = $oAuth->getRequestToken($this->_callbackURL);\n\t\t$oauthRedirectUrl = $oAuth->getAuthorizeURL($tokenCredentials);\n\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_NAME, $tokenCredentials['oauth_token']);\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_SECRET_NAME, $tokenCredentials['oauth_token_secret']);\n\n\t\treturn $oauthRedirectUrl;\n\t}", "public function generateLoginUrl(): string\n {\n // This is why we 'fake' the username to a uniqid, to use the test system's token storage.\n return sprintf(\n '%s/login/%s',\n $this->accountEndpoint,\n $this->generateToken(\"login\" . uniqid())\n );\n }", "function getLoginLogoutUrlLinks() {\r\n $facebook = $this->facebook;\r\n $user = $this->user;\r\n if ($user) {\r\n $this->logInLogOutLink = $facebook->getLogoutUrl();\r\n echo ' <strong><em>You are not Connected.</em></strong>';\r\n } else {\r\n $this->logInLogOutLink = $facebook->getLoginUrl(\r\n array(\r\n 'scope' => 'email,offline_access,publish_stream,user_photos,offline_access',\r\n 'redirect_uri' => $pageURL\r\n )\r\n );\r\n echo \"<a href='$this->logInLogOutLink'>Facebook Login</a>\";\r\n }\r\n }", "static public function disconnect_url() {\n\t\treturn Controller::join_links(\"facebook\", \"disconnect\");\n\t}", "public static function facebook()\n {\n return 'facebook';\n }", "public function facebook(){\n\t\t// get redirect URL\n\t\t$requestUrl = $this->input->get(\"redirect\");\n\t\t\n\t\t// perform Facebook login\n\t\t$res = false;\n\t\ttry {\n\t\t\t$res = $this->login_util->loginFacebook($this->config->item('facebook_app_id'), $this->config->item('facebook_secret'), $requestUrl);\n\t\t} catch (Exception $e){\n\t\t\t$this->display_login($requestUrl, $e->getMessage());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($res){\n\t\t\t// redirect to the request URL\n\t\t\tredirect($requestUrl, 'refresh');\n\t\t} else {\n\t\t\t// If we reached here, then login has failed\n\t\t\t$this->display_login($requestUrl);\n\t\t}\n\t}", "public function redirectToFacebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToFacebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function loginView(LaravelFacebookSdk $fb) {\n $login_url = $fb->getLoginUrl(['email']);\n\n // Obviously you'd do this in blade :)\n echo '<a href=\"' . $login_url . '\">Login with Facebook</a>';\n }", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "public function _getAuthorizationUrl()\n {\n // Generate new authorization url\n $helper = $this->_getProvider()->getRedirectLoginHelper();\n $permissions = ['email', 'public_profile'];\n return $helper->getLoginUrl(APP_URL.'/app/modules/coinstackapp-facebookoauth/src/actions/callback.php', $permissions);\n }", "private function _getLoginUrl(){\r\n\t\t\r\n\t\t$settings = $this->getConnectionSettings();\r\n\t\t\r\n\t\t$base = $this->_loginInstance['production'];\r\n\t\tif ($settings['type'] !== 'production')\r\n\t\t\t$base = $this->_loginInstance['sandbox'];\r\n\t\t\r\n\t\treturn $base . $this->_authUri;\r\n\t}", "public function redirectToFacebookProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function getLoginUrl() {\n $url = CURL::urljoin($this->authorization_uri, array(\n 'client_id' => $this->client_id,\n 'scope' => $this->scope,\n 'response_type' => 'code',\n 'redirect_uri' => $this->getConnectUrl(),\n 'state' => $this->state,\n 'display' => 'popup',\n ));\n return $url;\n }", "function pfk_login_url() { echo bloginfo('url'); }", "public function getLoginUrl() {\n return $this->client->createAuthUrl();\n }", "public function redirectToFacebook()\n {\n \treturn Socialite::driver('facebook')->redirect();\n }", "public function redirectToFacebook()\n {\n return Socialite::driver($this->facebookProvider)->stateless()->redirect();\n }", "public function index()\n\t{\n\t\t$facebook = new Facebook(Config::get('facebook'));\n\t $params = array(\n\t 'redirect_uri' => url('/login/fb/callback'),\n\t 'scope' => 'email',\n\t );\n\t return Redirect::to($facebook->getLoginUrl($params));\n\t}", "function requestUserLogInFromFacebook (){\n\t\tinclude ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/requestUserLogInFromFacebook.fb.inc.php');\n\t}", "public function getProfileLink()\n\t{\n\t\treturn site_url('profile/' . $this->hash);\n\t}", "public function getLoginUrl()\n\t{\n\t\treturn \"$this->authorizationBaseUrl?client_id=$this->clientId&redirect_uri=$this->redirectUri&scope=$this->scope\";\n\t}", "public function getLoginURL()\n {\n return Config::get('URL') . 'auth/google/';\n }", "public function urlAuthorize() {\n return $this->host . '/oauth/authorize';\n }", "public function getLoginUrl()\n {\n $url = sprintf(\"%s/authorize?response_type=code&client_id=%s&state=%s\",\n $this->client->getBaseUrl(),\n $this->client->getConfig('client_id'),\n md5(uniqid())\n );\n\n return $url;\n }", "public function generateUserTokenUrl(AccountInterface $account);", "public function link() {\n return isset($this->_adaptee->user_info['user_username']) ? \"profile.php?user=\".$this->_adaptee->user_info['user_username'] : null;\n }", "public function get_endpoint_login_url() {\n\t\treturn $this->endpoint_login;\n\t}", "public function woo_slg_linkedin_auth_url() {\n\t\t\t\n\t\t\t//Remove unused scope for login\n\t\t\t\n\t\t\t$scope\t= array( 'r_emailaddress', 'r_liteprofile' );\n\t\t\t\n\t\t\t//load linkedin class\n\t\t\t$linkedin = $this->woo_slg_load_linkedin();\n\t\t\t\n\t\t\t//check linkedin loaded or not\n\t\t\tif( !$linkedin ) return false;\n\t\t\t\n\t\t\t//Get Linkedin config\n\t\t\t$config\t= $this->linkedinconfig;\n\t\t\t\n\t\t\ttry {//Prepare login URL\n\t\t\t\t$preparedurl\t= $this->linkedin->getAuthorizeUrl( $config['appKey'], $config['callbackUrl'], $scope );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\t$preparedurl\t= '';\n\t }\n\t \n\t\t\treturn $preparedurl;\n\t\t}", "public function getUrl() {\n return $this->getProfileUri();\n }", "public function urlUserDetails(AccessToken $token) {\n return $this->host . '/api';\n }", "function authFacebook($next='',$cancel_url='')\n {\n global $global;\n\n require_once dirname(__FILE__).'/lib/fbapi/facebook.php';\n\n //$facebook=new Facebook($api_key,$secret);\n $facebook = new Facebook(array(\n 'appId' => $global->app_id,\n 'secret' => $global->app_secret,\n 'cookie' => true));\n\n $global->facebook=$facebook;\n $session = $facebook->getSession();\n\n try\n {\n $global->fbme = $facebook->api('/me'); \n } \n catch (FacebookApiException $e) \n {\n $global->fbme = false;\n error_log($e);\n //echo $e->getMessage();\n } \n\n if ($global->fbme == false) \n {\n $params['canvas'] =1;\n $params['fbconnect'] = 0;\n $params['req_perms'] = 'publish_stream, email';\n\n //$params['next'] = $global->link->createLink('index.php',array('instid'=>$global->instid));\n //'cancel_url' => $appurl \n\n $login_url = $facebook->getLoginUrl($params);\n\n echo '<script>top.location=\"' . $login_url . '\";</script>';\n //header(\"Location:$login_url\");\n exit();\n }\n\n return true;\n }", "public function facebook()\n {\n return $this->auth('Facebook');\n }", "public function getSocialPage()\n {\n $result = null;\n if (isset($this->userInfo['screen_name'])) {\n $result = 'http://vk.com/' . $this->userInfo['screen_name'];\n }\n return $result;\n }", "public function redirectToFacebook()\n\t{\n\t return Socialize::with('facebook')->redirect();\n\t}", "protected function getLoginUrl(): string\n {\n return $this->urlGenerator->generate(self::LOGIN_ROUTE);\n }", "public function getUserAuthorizationUrl()\n {\n return $this->getAuthorizeUrl();\n }", "function logInUserFromFacebook () {\n include ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/logIn.fb.controller.php');\n }", "function profileUrl()\r\n {\r\n return \"/user/show/{$this->id}\";\r\n }", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "function bones_login_url() { return home_url(); }", "public function get_login_url() {\n\n $returnurl = new moodle_url('/repository/repository_callback.php');\n $returnurl->param('callback', 'yes');\n $returnurl->param('repo_id', $this->id);\n $returnurl->param('sesskey', sesskey());\n $returnurl->param('reloadparentpage', true);\n\n $url = new moodle_url($this->client->createAuthUrl());\n $url->param('state', $returnurl->out_as_local_url(false));\n return '<a target=\"repo_auth\" href=\"'.$url->out(false).'\">'.get_string('connectyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "private function _authRedirect() {\n $options = array('scope' => $this->settings['permissions']);\n if (!empty($this->settings['appUrl'])) {\n $options['redirect_uri'] = $this->settings['appUrl'];\n }\n $url = $this->facebook->getLoginUrl($options);\n echo \"<script type=\\\"text/javascript\\\">top.location.href = '$url';</script>\";\n exit;\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function handleFacebookCallback()\n {\n \n $user = Socialite::driver('facebook')->user();\n\n \n }", "function get_profile_home_url()\r\n {\r\n return $this->get_url(array(self :: PARAM_ACTION => self :: ACTION_BROWSE_PROFILES));\r\n }", "abstract protected function auth_url();", "public function redirect()\n {\n return SocialLogin::driver('facebook')->redirect();\n }", "public function connect()\n {\n $this->setupRequest(\n [\n 'scope' => 'non-expiring',\n 'display' => 'popup',\n 'response_type' => 'code',\n ],\n ['client_secret']\n );\n\n return $this->buildRequestUrl('connect');\n }", "public function redirectToProvider() {\n return Socialite::driver('facebook')->redirect();\n }", "public function get_user_authorization_url()\n\t{\n\t\tif ($this->auth_oauth_response != SPOAuthClient::OAUTH_USER_AUTH || !$this->oauth_token)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn $this->auth_url_userauth . (strpos($this->auth_url_userauth, \"?\") === false ? \"?oauth_token=\" : \"&oauth_token=\") . rawurlencode($this->oauth_token);\n\t}", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function getProfileUrl()\n\t\t{\n\t\t return $this->profileUrl;\n\t\t}", "public function fbcallback() {\n\t\t$this->autoRender = false;\n\n\n\t\t$fb = new Facebook\\Facebook([\n\t\t\t'app_id' => '1038913562917167',\n\t\t\t'app_secret' => 'c0df3e628a09c24f972985ad47dee466',\n\t\t\t'default_graph_version' => 'v2.10',\n\t\t]);\n\n\t\t$helper = $fb->getRedirectLoginHelper();\n\t\t$accessToken = $helper->getAccessToken();\n\n\t\tdebug($accessToken);\n\n\t\tif (isset($_GET['state'])) {\n\t\t\tdebug($_GET['state']);\n\t\t}\n\n\t\ttry {\n\t\t\t$accessToken = $helper->getAccessToken();\n\t\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\t\t// When Graph returns an error\n\t\t\techo 'Graph returned an error: ' . $e->getMessage();\n\t\t\texit;\n\t\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t\t// When validation fails or other local issues\n\t\t\techo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t\texit;\n\t\t}\n\n\t\tif (! isset($accessToken)) {\n\t\t\tif ($helper->getError()) {\n\t\t\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t\t\techo \"Error: \" . $helper->getError() . \"\\n\";\n\t\t\t\techo \"Error Code: \" . $helper->getErrorCode() . \"\\n\";\n\t\t\t\techo \"Error Reason: \" . $helper->getErrorReason() . \"\\n\";\n\t\t\t\techo \"Error Description: \" . $helper->getErrorDescription() . \"\\n\";\n\t\t\t\tvar_dump($helper->getError());\n\t\t\t} else {\n\t\t\t\theader('HTTP/1.0 400 Bad Request');\n\t\t\t\techo 'Bad request';\n\t\t\t}\n\t\t\texit;\n\t\t}\n\n\t\t// Logged in\n\t\techo '<h3>Access Token</h3>';\n\t\tvar_dump($accessToken->getValue());\n\n\t\t// The OAuth 2.0 client handler helps us manage access tokens\n\t\t$oAuth2Client = $fb->getOAuth2Client();\n\n\t\t// Get the access token metadata from /debug_token\n\t\t$tokenMetadata = $oAuth2Client->debugToken($accessToken);\n\t\techo '<h3>Metadata</h3>';\n\t\tvar_dump($tokenMetadata);\n\n\t\t// Validation (these will throw FacebookSDKException's when they fail)\n\t\t$tokenMetadata->validateAppId('1038913562917167'); // Replace {app-id} with your app id\n\t\t\n\t\t// If you know the user ID this access token belongs to, you can validate it here\n\t\t//$tokenMetadata->validateUserId('123');\n\t\t$tokenMetadata->validateExpiration();\n\n\t\tif (! $accessToken->isLongLived()) {\n\t\t\t// Exchanges a short-lived access token for a long-lived one\n\t\t\ttry {\n\t\t\t\t$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);\n\t\t\t} catch (Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t\t\techo \"<p>Error getting long-lived access token: \" . $helper->getMessage() . \"</p>\\n\\n\";\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tvar_dump($accessToken->getValue());\n\t\t}\n\n\t\t$_SESSION['fb_access_token'] = (string) $accessToken;\n\t\tdebug($_SESSION['fb_access_token'] );\n\t\t$this->log($_SESSION['fb_access_token'] );\n\n\t\t// User is logged in with a long-lived access token.\n\t\t// You can redirect them to a members-only page.\n\t\t//header('Location: https://example.com/members.php');\n\t}", "function obdiy_login_url() { return home_url( '/' ); }", "public static function GetFacebookProfileLink($userID)\n\t{\n\t\treturn \"http://www.facebook.com/${userID}\";\n\t}", "public function joinTokenUrl()\n {\n return sprintf('%s?applicationId=%s', $this->site, $this->token);\n }", "function getUser($redirectURL,$fbPermissions = array()){\n\t// echo \"<pre>\";\n\t// print_r($redirectURL);die;\n\t\t$helper = parent::getRedirectLoginHelper();\n\n\t\t\t\n\t\t// Try to get access token\n\t\ttry {\n\t\t if(isset($_SESSION['facebook_access_token'])){\n\t\t $accessToken = $_SESSION['facebook_access_token'];\n\t\t }else{\n\t\t $accessToken = $helper->getAccessToken($redirectURL);\n\n\t\t }\n\t\t} catch(FacebookResponseException $e) {\n\t\t echo 'Graph returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t} catch(FacebookSDKException $e) {\n\t\t\t\n\t\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t}\n\t\tif(!empty($accessToken)){\n\t\t try {\n\t\t $profileRequest = parent::get('/me?fields=name,first_name,last_name,email,link,gender,locale,picture,friends',$accessToken);\n\t\t $fbUserProfile = $profileRequest->getGraphNode()->asArray();\n\t\t } catch(FacebookResponseException $e) {\n\t\t echo 'Graph returned an error: ' . $e->getMessage();\n\t\t session_destroy();\n\n\t\t header(\"Location: ./\");\n\t\t exit;\n\t\t } catch(FacebookSDKException $e) {\n\t\t \n\t\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t }\n\t\t \treturn $fbUserProfile;\n\t\t }else{\n\t\t $loginURL = $helper->getLoginUrl($redirectURL, $fbPermissions);\n\t\t \t\treturn $loginURL;\n\t\t }\n\t}", "public function getSenderUrl()\n {\n if (count($this->sender()->first()) > 0)\n return URL::to('/profile/'.$this->sender()->first()->username);\n else\n return URL::to('#');\n }", "public function getConnectUrl() {\n return $this->redirect_url;\n }", "public function logout_url() \n\t{\n\t\treturn $this->logout_url = urldecode($this->fb->getLogoutUrl(array(\n\t\t\t'next' => $this->config->next,\n\t\t)));\n }", "public function getProfileUrl()\n {\n return $this->ProfileUrl;\n }", "public function getFacebookLogin($auth = NULL)\n {\n if ($auth == 'auth') {\n try {\n Hybrid_Endpoint::process();\n } catch (Exception $e) {\n return Redirect::to('fbauth');\n }\n return;\n }\n try {\n // create a HybridAuth object\n $socialAuth = new Hybrid_Auth(app_path() . '/config/packages/hybridauth/fbauth.php');\n // authenticate with Google\n $provider = $socialAuth->authenticate(\"Facebook\");\n // fetch user profile\n $userProfile = $provider->getUserProfile();\n } catch (Exception $e) {\n // exception codes can be found on HybBridAuth's web site\n return $e->getMessage();\n }\n // access user profile data\n echo \"Connected with: <b>{$provider->id}</b><br />\";\n echo \"As: <b>{$userProfile->displayName}</b><br />\";\n echo \"<pre>\" . print_r($userProfile, true) . \"</pre><br />\";\n\n // logout\n //$provider->logout();\n }" ]
[ "0.76212835", "0.7248789", "0.7133725", "0.69577545", "0.6945127", "0.6885505", "0.6881639", "0.6876044", "0.68355554", "0.677314", "0.6623878", "0.65806276", "0.65580374", "0.65437037", "0.65159124", "0.6508603", "0.6496274", "0.6483534", "0.6470449", "0.63961726", "0.63930553", "0.6366852", "0.63666695", "0.632157", "0.6290257", "0.62661296", "0.6261508", "0.624468", "0.62444466", "0.6242887", "0.62400204", "0.62284386", "0.6225486", "0.62139434", "0.6210828", "0.62092483", "0.62044513", "0.62044513", "0.61999404", "0.6196087", "0.61919063", "0.61856216", "0.6181356", "0.6167622", "0.61672807", "0.61564636", "0.61563843", "0.6145529", "0.61380136", "0.61164427", "0.6093499", "0.6085543", "0.6075322", "0.6068583", "0.60677826", "0.60638964", "0.6042388", "0.6038131", "0.6035308", "0.60110354", "0.6010839", "0.60089606", "0.60015416", "0.5988371", "0.5987497", "0.5974935", "0.59728795", "0.5972302", "0.5959864", "0.5954912", "0.5946688", "0.594107", "0.5936551", "0.59266233", "0.59197265", "0.59197265", "0.59197265", "0.59197265", "0.59197265", "0.59197265", "0.59185845", "0.59164286", "0.59145254", "0.5907706", "0.59073454", "0.5903854", "0.58975244", "0.58937335", "0.58937335", "0.5891467", "0.588252", "0.5879819", "0.587809", "0.5871584", "0.5868404", "0.5857505", "0.5853588", "0.5844851", "0.58353543", "0.58338153" ]
0.7928876
0
Returns a URL for users to login with their facebook accounts.
static public function login_url() { $facebook = FacebookApp::get()->first(); if($facebook && $facebook->EnableFacebookLogin == 1) return Controller::join_links("facebook", "login"); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function GetLoginURL()\n\t{\n\t\tinclude 'config.php';\n\t\t\n\t\t$params = array();\n\t\t$params['scope'] = $facebookSettings['scope'];\n\t\t$params['redirect_uri'] = $facebookSettings['loginRedirect'];\n\t\t\n\t\treturn self::GetFB()->getLoginUrl($params);\n\t}", "public function getLoginURL(){\r\n\t\treturn $this->facebook_obj->getLoginURL($this->getParamsForLogin());\r\n\t}", "public function login_url()\n\t{\n\t\treturn $this->login_url = $this->_facebook->getLoginUrl(\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'scope'\t\t\t=> $this->_config->get('scope'),\n\t\t\t\t'redirect_uri'\t=> $this->_config->get('redirect_uri'),\n\t\t\t\t'display'\t\t=> $this->_config->get('display'),\n\t\t\t));\n\t}", "public function login_url()\n {\n return $this->login_url = urldecode($this->fb->getLoginUrl(array(\n 'scope' => $this->config->scope,\n 'redirect_uri' => $this->config->redirect_uri,\n 'display' => $this->config->display,\n )));\n }", "static public function connect_url() {\n\t\treturn Controller::join_links(\"facebook\", \"connect\");\n\t}", "public function loginWithFacebookAction()\n {\n \t$this->view->disable();\n \t$helper = $this->fbRedirectLoginHelper;\n \t$scope = array('public_profile', 'email', 'user_friends');\n \treturn $this->response->redirect($helper->getLoginUrl(), true);\n }", "public function getLogin()\n\t{\n\t\tsession_start();\n\t\tFacebookSession::setDefaultApplication(env('FACEBOOK_CLIENT_ID'), env('FACEBOOK_CLIENT_SECRET'));\n\t\t\n\t\t$helper = new FacebookRedirectLoginHelper('http://startpage.com/facebook/update');\n\t\t$loginUrl = $helper->getLoginUrl();\n\n\t\treturn $loginUrl . 'user_posts';\n\t}", "public function facebookUrl()\r\n\t{\r\n\t\treturn Mage::getBaseDir(\"media\") . DS . \"ezloginlite\" . DS. \"facebook\" . DS;\r\n\t}", "public function facebookLogin() {\n\t\t$this->autoRender = false;\n\n\t\t// config of facebook\n\t\t// app_id => app id from facebook app, app_secret => app secret from facebook app, default_graph_version\n\t\t$fb = new Facebook\\Facebook([\n\t\t\t'app_id' => '1038913562917167',\n\t\t\t'app_secret' => 'c0df3e628a09c24f972985ad47dee466',\n\t\t\t'default_graph_version' => 'v2.10',\n\t\t]);\n\n\t\t$helper = $fb->getRedirectLoginHelper();\n\n\t\t$permissions = ['email']; // Optional permissions\n\t\t$loginUrl = $helper->getLoginUrl('http://myanants.com/user/fbcallback', $permissions);\n\t\t$this->redirect($loginUrl);\n\n\t}", "public function get_login_url() {\n\n $callbackurl = self::callback_url();\n $params = array_merge(\n [\n 'client_id' => $this->clientid,\n 'response_type' => 'code',\n 'redirect_uri' => $callbackurl->out(false),\n 'state' => $this->returnurl->out_as_local_url(false),\n 'scope' => $this->scope,\n ],\n $this->get_additional_login_parameters()\n );\n\n return new moodle_url($this->auth_url(), $params);\n }", "public function getLoginUrl();", "public function log_user_into_facebook()\n {\n // TODO: Parameterise redirect_url and scope values\n $login_config = array(\n \"redirect_uri\" => \"http://sociable.local/account/facebooklogin\",\n \"scope\" => \"user_birthday, read_stream, user_location, publish_stream, email, read_friendlists, publish_checkins, user_education_history, user_work_history\"\n );\n $login_url = self::getLoginUrl($login_config);\n header('Location: ' . $login_url, true);\n exit;\n }", "function action_get_app_login_url(){\n \n $company = DB::table('User')\n ->join('Company', 'User.companyid', '=', 'Company.companyid')\n ->where('User.username', '=', Input::get('username'))\n ->or_where('User.email', '=', Input::get('username'))\n ->get('Company.name');\n \n return 'https://' . $company[0]->name . '.fdback.com/login';\n \n }", "public function loginView(LaravelFacebookSdk $fb) {\n $login_url = $fb->getLoginUrl(['email']);\n\n // Obviously you'd do this in blade :)\n echo '<a href=\"' . $login_url . '\">Login with Facebook</a>';\n }", "public function login()\n\t{\n\t\tif (empty($this->_callbackURL))\n\t\t{\n\t\t\tthrow new Exception('No data for social login: Callback URL');\n\t\t}\n\n\t\t$oAuth = $this->_getTWOAuth();\n\t\t$tokenCredentials = $oAuth->getRequestToken($this->_callbackURL);\n\t\t$oauthRedirectUrl = $oAuth->getAuthorizeURL($tokenCredentials);\n\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_NAME, $tokenCredentials['oauth_token']);\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_SECRET_NAME, $tokenCredentials['oauth_token_secret']);\n\n\t\treturn $oauthRedirectUrl;\n\t}", "public function generateLoginUrl(): string\n {\n // This is why we 'fake' the username to a uniqid, to use the test system's token storage.\n return sprintf(\n '%s/login/%s',\n $this->accountEndpoint,\n $this->generateToken(\"login\" . uniqid())\n );\n }", "public function facebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function getFacebookUrl()\n {\n return $this->facebook_url;\n }", "public function facebook ()\n {\n return Socialite::driver('facebook')->redirect();\n\n }", "public function triggerFacebookLogin() {\n return Redirect::to( Facebook::getLoginUrl() );\n }", "public function facebook(){\n\t\t// get redirect URL\n\t\t$requestUrl = $this->input->get(\"redirect\");\n\t\t\n\t\t// perform Facebook login\n\t\t$res = false;\n\t\ttry {\n\t\t\t$res = $this->login_util->loginFacebook($this->config->item('facebook_app_id'), $this->config->item('facebook_secret'), $requestUrl);\n\t\t} catch (Exception $e){\n\t\t\t$this->display_login($requestUrl, $e->getMessage());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($res){\n\t\t\t// redirect to the request URL\n\t\t\tredirect($requestUrl, 'refresh');\n\t\t} else {\n\t\t\t// If we reached here, then login has failed\n\t\t\t$this->display_login($requestUrl);\n\t\t}\n\t}", "public function facebook()\n {\n return facebook()->login();\n }", "public function redirectToFacebook()//redirects user to facebook authentication\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function facebookRedirect(){\n $github_user = Socialite::driver('facebook')->redirect();\n }", "public function getOauthUri(): string\r\n {\r\n return 'https://www.facebook.com/dialog/oauth?';\r\n }", "public function getUrl() {\n\t\t//$url = \"https://www.facebook.com/dialog/oauth?client_id=\".$this->appId.\"&redirect_uri=\".$this->redirectUrl.\"&scope=\".$this->permission.\"&state=\".$_SESSION['state'];\n\t\treturn $this->redirectUrl;\n\t}", "function redirect($facebook){\r\n\t\t$loginUrl = $facebook->getLoginUrl(array(\r\n\t\t\t\"canvas\" =>1,\r\n\t\t\t\"fbconnect\" =>0,\r\n\t\t\t'req_perms' => \"email,publish_stream,user_hometown,user_location,user_photos,friends_photos,\r\n\t\t\t\t\tuser_photo_video_tags,friends_photo_video_tags,user_videos,video_upload,friends_videos\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,user_hometown,user_location\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,status_update,user_hometown,\r\n\t\t\t//\t\t\t\tuser_location,user_photos,friends_photos,user_photo_video_tags,friends_photo_video_tags\"\r\n\t\t));\r\n\r\n\t\t /*echo \"<script type='text/javascript'>top.location.href = '$loginUrl';</script>\";*/\r\n\t\t echo \"loginUrl: \" . $loginUrl;\r\n\t}", "protected function login_url($params = array())\t{\n\t\t$scope = static::$scope;\n\t\treturn $this->instagram->getLoginUrl($scope);\n\t}", "public function index()\n\t{\n\t\t$facebook = new Facebook(Config::get('facebook'));\n\t $params = array(\n\t 'redirect_uri' => url('/login/fb/callback'),\n\t 'scope' => 'email',\n\t );\n\t return Redirect::to($facebook->getLoginUrl($params));\n\t}", "private function _getLoginUrl(){\r\n\t\t\r\n\t\t$settings = $this->getConnectionSettings();\r\n\t\t\r\n\t\t$base = $this->_loginInstance['production'];\r\n\t\tif ($settings['type'] !== 'production')\r\n\t\t\t$base = $this->_loginInstance['sandbox'];\r\n\t\t\r\n\t\treturn $base . $this->_authUri;\r\n\t}", "public function getLoginUrl() {\n $url = CURL::urljoin($this->authorization_uri, array(\n 'client_id' => $this->client_id,\n 'scope' => $this->scope,\n 'response_type' => 'code',\n 'redirect_uri' => $this->getConnectUrl(),\n 'state' => $this->state,\n 'display' => 'popup',\n ));\n return $url;\n }", "public function getLoginUrl()\n\t{\n\t\treturn \"$this->authorizationBaseUrl?client_id=$this->clientId&redirect_uri=$this->redirectUri&scope=$this->scope\";\n\t}", "public function fbConnect($force = false)\r\n \t{\r\n \t\tif (!$this->_client->getUser() OR $force)\r\n\t\t{\r\n\t\t\treturn $this->_client->getLoginUrl($this->_requestParams);\r\n\t\t}\r\n\t\treturn true;\r\n \t}", "public function redirectToFacebookProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "protected function getLoginUrl(): string\n {\n return $this->urlGenerator->generate(self::LOGIN_ROUTE);\n }", "public function redirectToFacebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToFacebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToFacebook()\n {\n \treturn Socialite::driver('facebook')->redirect();\n }", "public function getLoginURL()\n {\n return Config::get('URL') . 'auth/google/';\n }", "public function get_login_url() {\n\n $returnurl = new moodle_url('/repository/repository_callback.php');\n $returnurl->param('callback', 'yes');\n $returnurl->param('repo_id', $this->id);\n $returnurl->param('sesskey', sesskey());\n $returnurl->param('reloadparentpage', true);\n\n $url = new moodle_url($this->client->createAuthUrl());\n $url->param('state', $returnurl->out_as_local_url(false));\n return '<a target=\"repo_auth\" href=\"'.$url->out(false).'\">'.get_string('connectyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "public function getAccountLogin_url()\n {\n return $this->getBrowser()->getCurrentURL();\n }", "public function getLoginUrl()\n {\n $url = sprintf(\"%s/authorize?response_type=code&client_id=%s&state=%s\",\n $this->client->getBaseUrl(),\n $this->client->getConfig('client_id'),\n md5(uniqid())\n );\n\n return $url;\n }", "public function getLoginUrl() {\n return $this->client->createAuthUrl();\n }", "public function redirectToFacebook()\n {\n return Socialite::driver($this->facebookProvider)->stateless()->redirect();\n }", "public function woo_slg_linkedin_auth_url() {\n\t\t\t\n\t\t\t//Remove unused scope for login\n\t\t\t\n\t\t\t$scope\t= array( 'r_emailaddress', 'r_liteprofile' );\n\t\t\t\n\t\t\t//load linkedin class\n\t\t\t$linkedin = $this->woo_slg_load_linkedin();\n\t\t\t\n\t\t\t//check linkedin loaded or not\n\t\t\tif( !$linkedin ) return false;\n\t\t\t\n\t\t\t//Get Linkedin config\n\t\t\t$config\t= $this->linkedinconfig;\n\t\t\t\n\t\t\ttry {//Prepare login URL\n\t\t\t\t$preparedurl\t= $this->linkedin->getAuthorizeUrl( $config['appKey'], $config['callbackUrl'], $scope );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\t$preparedurl\t= '';\n\t }\n\t \n\t\t\treturn $preparedurl;\n\t\t}", "function pfk_login_url() { echo bloginfo('url'); }", "public function loginViaFacebook()\n { \n $userFB = $this->facebook->getUserFromRedirect();\n $userDB = User::where('facebook_id', $userFB->getId())->first();\n\n if (! is_null($userDB)) {\n // User already exists, check \"first time visit\" state (old)\n if ($userDB->old == 0) {\n $userDB->update(['old' => 1]);\n $userDB->save();\n }\n //Authenticate user\n Auth::loginUsingId($userDB->id);\n return redirect('/welcome');\n }\n // User not found in database, create it\n $this->createAndLoginUser($userFB);\n return redirect('/welcome');\n }", "function _getLoginUrl($request) {\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t// Adicionadas opções sobre sexo e país na página de login\n\t\t$countryDao =& DAORegistry::getDAO('CountryDAO');\n\t\t$countries =& $countryDao->getCountries();\n\t\t$templateMgr->assign_by_ref('countries', $countries);\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$templateMgr->assign('genderOptions', $userDao->getGenderOptions());\n\t\treturn $request->url(null, 'login', 'signIn');\n\t}", "public function get_endpoint_login_url() {\n\t\treturn $this->endpoint_login;\n\t}", "public function login()\r\n {\r\n $helper = $this->facebook->getRedirectLoginHelper();\r\n $loginUrl = $helper->getLoginUrl(app_url('/facebook/callback'));\r\n\r\n // Redirect to facebook login page.\r\n header('location: ' . $loginUrl);\r\n exit;\r\n }", "public function facebookLogin(Request $request)\n {\n $appId = env('FACEBOOK_APP_ID');\n $redirectUri = url('/login/facebook/callback');\n $scope = 'public_profile,email';\n\n $url = 'https://www.facebook.com/v2.8/dialog/oauth?client_id=' . $appId . '&redirect_uri=' . $redirectUri . '&scope=' . $scope;\n return redirect($url);\n }", "public static function facebook()\n {\n return 'facebook';\n }", "public static function callback_url() {\n global $CFG;\n\n return new moodle_url('/admin/oauth2callback.php');\n }", "public function generateUserTokenUrl(AccountInterface $account);", "public function getAuthUrl();", "private function getCallbackUrl($provider)\n {\n return $this->url->getUrl('clean_checkout/social/authenticate', ['_query' => ['provider' => $provider]]);\n }", "public function getLoginURI() {\n return '/oauth/google/login/';\n }", "public function getLoginUrl()\n {\n return 'https://oauth.vk.com/authorize'\n . '?client_id=' . urlencode($this->getAppId())\n . '&scope=' . urlencode(implode(',', $this->getScope()))\n . '&redirect_uri=' . urlencode($this->getRedirectUri())\n . '&response_type=' . urlencode($this->getResponceType())\n . '&v=' . urlencode(self::VERSION);\n }", "function bones_login_url() { echo bloginfo('url'); }", "function redirectUserToLogin($facebook,$scope,$app_url){\n $loginUrl = $facebook->getLoginUrl(array(\n 'scope' => $scope,\n 'redirect_uri' => $app_url,\n ));\n\n print('<script> top.location.href=\\'' . $loginUrl . '\\'</script>');\n exit();\n}", "public function redirectToFacebook()\n\t{\n\t return Socialize::with('facebook')->redirect();\n\t}", "public function getUserInfoUri(string $token = ''): string\r\n {\r\n return 'https://graph.facebook.com/me?';\r\n }", "public function buildLoginUrl(Request $request): string;", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "public function facebook()\n {\n return $this->auth('Facebook');\n }", "public function getLoginUrl($options) {\n\t\t$query = array(\n\t\t\t'client_id' => $this->client_id,\n\t\t\t'redirect_uri' => $this->callback_url,\n\t\t\t'response_type' => 'code'\n\t\t\t);\n\n\t\t$query = array_merge($query, $options);\n\n\t\treturn $this->authorize_url . '?' . http_build_query($query);\n\t}", "public function redirect()\n {\n return SocialLogin::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function getFacebookLogin($auth = NULL)\n {\n if ($auth == 'auth') {\n try {\n Hybrid_Endpoint::process();\n } catch (Exception $e) {\n return Redirect::to('fbauth');\n }\n return;\n }\n try {\n // create a HybridAuth object\n $socialAuth = new Hybrid_Auth(app_path() . '/config/packages/hybridauth/fbauth.php');\n // authenticate with Google\n $provider = $socialAuth->authenticate(\"Facebook\");\n // fetch user profile\n $userProfile = $provider->getUserProfile();\n } catch (Exception $e) {\n // exception codes can be found on HybBridAuth's web site\n return $e->getMessage();\n }\n // access user profile data\n echo \"Connected with: <b>{$provider->id}</b><br />\";\n echo \"As: <b>{$userProfile->displayName}</b><br />\";\n echo \"<pre>\" . print_r($userProfile, true) . \"</pre><br />\";\n\n // logout\n //$provider->logout();\n }", "public function login()\n {\n\n $data = array('loginUrl'=>'');\n\n if( !isset($_SESSION['accessToken']) || empty($_SESSION['accessToken']) )\n {\n $helper = $this->fb->getRedirectLoginHelper();\n\n $permissions = ['user_posts']; // Optional permissions\n $loginUrl = $helper->getLoginUrl('http://localhost:8000/logincallback',$permissions);\n\n $data['loginUrl'] = htmlspecialchars($loginUrl);\n\n }\n\n return $data;\n\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->scopes([\n 'email',\n 'public_profile',\n ])->redirect();\n }", "public function redirectToProvider() {\n return Socialite::driver('facebook')->redirect();\n }", "public function loginWithFacebook() {\n\t $code = Input::get( 'code' );\n\n\t // get fb service\n\t $fb = OAuth::consumer( 'Facebook' );\n\n\t // check if code is valid\n\n\t // if code is provided get user data and sign in\n\t if ( !empty( $code ) ) {\n\n\n\t // This was a callback request from facebook, get the token\n\t $token = $fb->requestAccessToken( $code );\n\n\t // Send a request with it\n\t $result = json_decode( $fb->request( '/me' ), true );\n\n\t if(!empty($token)){\n \n try{\n // Find the user using the user id\n $user = Sentry::findUserByLogin($result['email']);\n \n // Log the user in\n Sentry::login($user, false);\n \n return Redirect::to('http://127.0.0.1/lipzo/thong-tin-ca-nhan');\n }\n catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n {\n // Register the user\n $user = Sentry::register(array(\n 'activated' => 1,\n 'email' => $result['email'],\n 'password' => Hash::make(uniqid(time())),\n 'first_name' => $result['name'],\n 'permissions'=>array(\n\t\t\t\t\t\t\t'user'=>1\n\t\t\t\t\t\t)\n //'avatar' => $result['picture'],\n //'country' => (!empty($result['location'])) ? $result['location'] : false\n ));\n \n \n Sentry::login($user, false);\n \n return Redirect::to('http://127.0.0.1/lipzo/thong-tin-ca-nhan');\n }\n \n }\n\t \n\t //Var_dump\n\t //display whole array().\n\t //dd($result);\n\n\t }\n\t // if not ask for permission first\n\t else {\n\t // get fb authorization\n\t $url = $fb->getAuthorizationUri();\n\n\t // return to facebook login url\n\t return Redirect::to( (string)$url );\n\t }\n\n\t}", "public function action_fb() {\n\t\n\t$fb = Facebook::instance();\n\n\n\tif ($fb->check_login() == false) {\n\t //user has not yet authenticated via facebook\n\t $fbl_params = array(\"scope\" => \"email\");\n\t $loginurl = $fb->getLoginUrl($fbl_params);\n\t Response::redirect($loginurl) and die();\n\t} else {\n\t //facebook authentication successful.\n\t $user_profile = $fb->api('/me');\n\t //and we know the user's email\n\t $fb_mail = $user_profile[\"email\"];\n\n\t //and the user's facebook ID\n\t $fb_id = $user_profile[\"id\"];\n\n\t $auth = Auth::instance();\n\n\t //simpleauth does not have a method for \n\t //checking if username is taken\n\t //hence we do a direct DB select.\n\t $fb_sql_user = DB::select(\"id\")\n\t\t ->from(\"users\")\n\t\t ->where(\"username\", \"=\", \"FB@\" . $fb_mail)\n\t\t ->execute()\n\t\t ->as_array();\n\n\t if (count($fb_sql_user) == 0) {\n\t\t//we don't have the user in the local DB yet\n\t\t//let us create a local user\n\t\t//coining a specific username,\n\t\t//assigning a random password\t\t\n\t\t$user_id = $auth->create_user(\"FB@\" . $fb_mail, hash(\"sha256\", mt_rand(0, mt_getrandmax())), $fb_mail, 1, array(\n\t\t \"facebook_id\" => $fb_id,\n\t\t \"verified\" => true)\n\t\t);\n\t } else {\n\t\t//we have the user. Let's log the user in\n\t\t$user_id = $fb_sql_user[0][\"id\"];\n\t }\n\n\t $auth->force_login($user_id);\n\t Response::redirect(\"/\");\n\t}\n }", "function spartan_login_url() {\n\n\treturn home_url();\n\n}", "public function loginWithFacebook() {\n\t $code = Input::get( 'code' );\n\t // get fb service\n\t $fb = OAuth::consumer( 'Facebook' );\n\n\t // check if code is valid\n\n\t // if code is provided get user data and sign in\n\t if ( !empty( $code ) ) {\n\t // This was a callback request from facebook, get the token\n\t $token = $fb->requestAccessToken( $code );\n\t // Send a request with it\n\t $result = json_decode( $fb->request( '/me' ), true );\n\t $message = 'Your unique facebook user id is: ' . $result['id'] . ' and your name is ' . $result['name'];\n\t echo $message. \"<br/>\";\n\t //Var_dump\n\t //display whole array().\n\t dd($result);\n\t }\n\t // if not ask for permission first\n\t else {\n\t // get fb authorization\n\t $url = $fb->getAuthorizationUri();\n\t // return to facebook login url\n\t return Redirect::to( (string)$url );\n\t }\n\t}", "public function _getAuthorizationUrl()\n {\n // Generate new authorization url\n $helper = $this->_getProvider()->getRedirectLoginHelper();\n $permissions = ['email', 'public_profile'];\n return $helper->getLoginUrl(APP_URL.'/app/modules/coinstackapp-facebookoauth/src/actions/callback.php', $permissions);\n }", "public function facebookLogin($state, $facebook_id, $access_token, $facebook_user)\n {\n\n if ($this->getMember()->getId()) {\n return $state->redirect;\n } else {\n $user = $this->getAuthTable()->fetchByFbId($facebook_id);\n\n // user is null try to check is there user wich FB email\n if (!$user) {\n try {\n $user = $this->getAuthTable()->getBy(array(\"email\" => $facebook_user['email']));\n if ($user) {\n $this->getAuthTable()->connectSocialAccount(\n $user->getId(),\n $facebook_id,\n \"facebook\",\n $access_token\n );\n }\n } catch (\\Exception $e) {\n $user = false;\n }\n }\n //if user exists then check is inactive otherwise login\n if ($user) {\n // Connect the account so we can retrieve a session\n $this->getAuthTable()->connectSocialAccount(\n $user->getId(),\n $facebook_id,\n \"facebook\",\n $access_token\n );\n if($user->getShowGetPointsPopup() == 0) {\n $user->setShowGetPointsPopup(1);\n $user = $this->getAuthTable()->save($user);\n $result = \"/?action=registration\";\n } else {\n $result = \"/\";\n }\n\n $this->loginMember($user);\n\n return $result;\n } else {\n //if no user and no email then signUp him as new user to iPoints\n return $this->facebookSignup($state, $facebook_id, $access_token, $facebook_user);\n }\n }\n }", "public function facebookAccountCallback()\n {\n try {\n $social_user = Socialite::driver($this->facebookProvider)->fields(['name', 'first_name', 'last_name', 'email'])->stateless()->user();\n if (!$social_user) {\n return redirect('/login')->with('error', trans('messages.something_wrong'));\n }\n\n $email = $social_user->email;\n if ($email == null) {\n $email = $social_user->id . '@facebook.com';\n }\n $name = $social_user->name;\n\n $user = User::where('facebook_id', $social_user->id)->orWhere('email', $email)->first();\n if ($user) {\n if ($user->facebook_id == null) {\n $user->facebook_id = $social_user->id;\n $user->save();\n }\n } else {\n $first_name = $name;\n if (isset($social_user->user['first_name']) && $social_user->user['first_name']) {\n $first_name = $social_user->user['first_name'];\n }\n $last_name = null;\n if (isset($social_user->user['last_name']) && $social_user->user['last_name']) {\n $last_name = $social_user->user['last_name'];\n }\n\n $request = [\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'email' => $email,\n 'facebook_id' => $social_user->id,\n ];\n $user = $this->create($request);\n }\n Auth::login($user);\n return redirect()->route($this->redirectTo);\n\n } catch (Exception $e) {\n return redirect('/login')->with('error', trans('messages.something_wrong'));\n }\n }", "public function facebookCallback(){\n $facebook_user = Socialite::driver('facebook')->user();\n $user = $this->FacebookuserFindOrCreate($facebook_user);\n Auth::login($user , true);\n return redirect()->route('home')->with('user',$user);\n\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')\n ->scopes(['user_birthday'])\n ->redirect();\n }", "public function getLoginUrl($params = array())\n {\n $this->establishCSRFTokenState();\n $currentUrl = $this->getUrlGenerator()->getCurrentUrl();\n\n // if 'scope' is passed as an array, convert to space separated list\n $scopeParams = isset($params['scope']) ? $params['scope'] : null;\n if ($scopeParams) {\n //if scope is an array\n if (is_array($scopeParams)) {\n $params['scope'] = implode(' ', $scopeParams);\n } elseif (is_string($scopeParams)) {\n //if scope is a string with ',' => make it to an array\n $params['scope'] = str_replace(',', ' ', $scopeParams);\n }\n }\n\n return $this->getUrlGenerator()->getUrl(\n 'www',\n 'uas/oauth2/authorization',\n array_merge(\n array(\n 'response_type' => 'code',\n 'client_id' => $this->getAppId(),\n 'redirect_uri' => $currentUrl, // possibly overwritten\n 'state' => $this->getState(),\n ),\n $params\n )\n );\n }", "public function redirectToProvider() {\n\n return \\Socialite::driver('facebook')->scopes(['email', 'public_profile'])->redirect();\n }", "function authFacebook($next='',$cancel_url='')\n {\n global $global;\n\n require_once dirname(__FILE__).'/lib/fbapi/facebook.php';\n\n //$facebook=new Facebook($api_key,$secret);\n $facebook = new Facebook(array(\n 'appId' => $global->app_id,\n 'secret' => $global->app_secret,\n 'cookie' => true));\n\n $global->facebook=$facebook;\n $session = $facebook->getSession();\n\n try\n {\n $global->fbme = $facebook->api('/me'); \n } \n catch (FacebookApiException $e) \n {\n $global->fbme = false;\n error_log($e);\n //echo $e->getMessage();\n } \n\n if ($global->fbme == false) \n {\n $params['canvas'] =1;\n $params['fbconnect'] = 0;\n $params['req_perms'] = 'publish_stream, email';\n\n //$params['next'] = $global->link->createLink('index.php',array('instid'=>$global->instid));\n //'cancel_url' => $appurl \n\n $login_url = $facebook->getLoginUrl($params);\n\n echo '<script>top.location=\"' . $login_url . '\";</script>';\n //header(\"Location:$login_url\");\n exit();\n }\n\n return true;\n }", "public function redirectToProvider()\n {\n \n return Socialite::driver('facebook')->redirect();\n }", "function bones_login_url() { return home_url(); }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "function obdiy_login_url() { return home_url( '/' ); }", "public function getLoginUrl()\n {\n return $this->_customerUrl->getLoginUrl();\n }", "public function login(Request $request)\n {\n $loginUrl = $this->service->generateFacebookLogin();\n $memberID = $request->query('member_id');\n\n $url = sprintf('%s&state=%s', $loginUrl, $memberID);\n return response('<a href=\"'. $url .'\">Log in with Facebook!</a>');\n }", "private function _authRedirect() {\n $options = array('scope' => $this->settings['permissions']);\n if (!empty($this->settings['appUrl'])) {\n $options['redirect_uri'] = $this->settings['appUrl'];\n }\n $url = $this->facebook->getLoginUrl($options);\n echo \"<script type=\\\"text/javascript\\\">top.location.href = '$url';</script>\";\n exit;\n }", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "function logInUserFromFacebook () {\n include ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/logIn.fb.controller.php');\n }", "function loginWithFacebook()\n {\n /*\n // Create our Application instance (replace this with your appId and secret).\n $facebook = new Facebook(array(\n 'appId' => FACEBOOK_LOGIN_APP_ID,\n 'secret' => FACEBOOK_LOGIN_APP_SECRET,\n ));\n\n $this->view->facebook_login_url = $facebook->getLoginUrl(array(\n 'redirect_uri' => URL . 'login/loginWithFacebook'\n ));\n // TODO: this is duplicate !?!??!\n */\n\n // run the login() method in the login-model, put the result in $login_successful (true or false)\n $login_model = $this->loadModel('Login');\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = $login_model->loginWithFacebook();\n\n // check login status\n if ($login_successful) {\n // if YES, then move user to dashboard/index\n // please note: this is a browser-redirection, not a rendered view\n header('location: ' . URL . 'dashboard/index');\n } else {\n // if NO, then show the login/index (login form) again\n $this->view->render('login/index');\n }\n }", "public function loginWithFacebook() {\n\t $code = Input::get( 'code' );\n\n\t // get fb service\n\t $fb = OAuth::consumer( 'Facebook' );\n\t //$fb = OAuth::consumer('Facebook','http://url.to.redirect.to');\n\t // check if code is valid\n\t \n\t // if code is provided get user data and sign in\n\t if ( !empty( $code ) ) {\n\n\t // This was a callback request from google, get the token\n\t $token = $fb->requestAccessToken( $code );\n\n\t // Send a request with it\n\t $result = json_decode( $fb->request( '/me' ), true );\n\n\t // $message = 'Your unique facebook user id is: ' . $result['id'] . ' and your name is ' . $result['name'];\n\t // echo $message. \"<br/>\";\n\t $id = $result['id'];\n\t $first_name = isset($result['first_name'])?$result['first_name']:'';\n\t $last_name = isset($result['last_name']) ? $result['last_name'] : '';\n\t $site = 'fb'; \n\t $email = isset($result['email']) ? $result['email'] : '';\n \n $data = $result;\n\t\t return self::socialMediaLogin($email, $first_name, $last_name, $id, $site, $data);\n\t\t //Var_dump\n\t //display whole array().\n\t // dd($result);\n\n\t }\n\t // if not ask for permission first\n\t else { \n\t // get fb authorization\n\t $url = $fb->getAuthorizationUri(); \n\t // return to facebook login url\n\t //return Response::make()->header( 'Location', (string)$url);\n\n\t return Redirect::to(htmlspecialchars_decode($url));\n\t }\n\n\t}" ]
[ "0.7643123", "0.75614494", "0.74745053", "0.733766", "0.7313974", "0.7090495", "0.7045158", "0.7040429", "0.6914003", "0.68349594", "0.6789818", "0.67384154", "0.6703494", "0.66237485", "0.6601222", "0.6591256", "0.6576827", "0.6573013", "0.65680456", "0.6565774", "0.65538615", "0.6553408", "0.65310717", "0.65236497", "0.6493771", "0.6489836", "0.6431216", "0.6389207", "0.6389071", "0.6378374", "0.63758576", "0.6372066", "0.6364919", "0.63590944", "0.63211507", "0.63206977", "0.63206977", "0.6243388", "0.62427294", "0.6218001", "0.6210225", "0.62085235", "0.6196825", "0.61888313", "0.61881673", "0.61355007", "0.6126916", "0.6115847", "0.6110237", "0.6099883", "0.60864425", "0.6077971", "0.60771513", "0.60671115", "0.6060474", "0.60382086", "0.6037943", "0.6035569", "0.60320014", "0.602841", "0.6022309", "0.6020606", "0.60038567", "0.6002465", "0.5998045", "0.5984834", "0.5968677", "0.59575945", "0.59575945", "0.59575945", "0.59575945", "0.59575945", "0.59575945", "0.5957184", "0.59420943", "0.5938729", "0.5935174", "0.59243983", "0.5923747", "0.59194684", "0.5917097", "0.5913862", "0.5913476", "0.59069717", "0.5896889", "0.58949673", "0.58905935", "0.5882843", "0.58820957", "0.58817744", "0.58710176", "0.5864539", "0.5860996", "0.5858934", "0.5851232", "0.5842549", "0.5841546", "0.58406097", "0.58351773", "0.58255637" ]
0.7957775
0
Return a URL to allow users to disassociate their Facebook accounts.
static public function disconnect_url() { return Controller::join_links("facebook", "disconnect"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLogoutURL(){\r\n\t\treturn $this->facebook_obj->getLogoutURL(array('next' => Config::$url));\r\n\t}", "public function get_log_out_URL(){\n\t\tif(isset($_SESSION[FB_ACCESS_TOKEN]))\n\t\t\treturn $this->facebookLogin->get_Facebook_Logout_URL();\n\t\telse\n\t\t\treturn LOGOUT_URL;\n\t}", "public static function GetLogoutURL()\n\t{\n\t\tinclude 'config.php';\n\t\t\n\t\t$params = array();\n\t\t$params['next'] = $facebookSettings['logoutRedirect'];\n\t\t\n\t\treturn self::GetFB()->getLogoutUrl($params);\n\t}", "public function logout_url() \n\t{\n\t\treturn $this->logout_url = urldecode($this->fb->getLogoutUrl(array(\n\t\t\t'next' => $this->config->next,\n\t\t)));\n }", "public function fbDisconnect()\r\n \t{\r\n \t\t// no session exists to disconnect\r\n \t\tif (!$this->_client->getUser())\r\n \t\t{\r\n \t\t\treturn true;\r\n \t\t}\r\n \t\treturn $this->_client->getLogoutUrl();\r\n \t}", "function getDeleteUrl() {\n return assemble_url('people_company_user_delete', array(\n 'company_id' => $this->getCompanyId(),\n 'user_id' => $this->getId(),\n ));\n }", "public function getUnRegisterUrl()\n {\n return $this->UnRegisterUrl;\n }", "public function unlinkAccount()\n {\n }", "public function revokeAuthorisation() {\n $socialAccount = SocialAccount::findOneByUserIdAndSocialNetworkName(\n Auth::id(),\n $this->getSocialNetworkName()\n );\n\n if (isset($socialAccount)) $socialAccount->delete();\n\n return Redirect::to( action('ProfileController@index'));\n }", "public function unlinkFacebook() {\n $this->setFacebookId(NULL);\n $this->setFbTokenExpireDate(NULL);\n $this->setAccessToken(NULL);\n }", "public function getRemoveUrl()\n\t{\n\t\t$query = array_merge(\n\t\t\tarray($this->getFacet()->getName() => null),\n\t\t\t$this->unwantedUrlParameters\n\t\t);\n\n\t\treturn Mage::getUrl('*/*', array(\n\t\t\t'_current' => true,\n\t\t\t'_use_rewrite' => true,\n\t\t\t'_query' => $query\n\t\t));\n\t}", "function getLoginLogoutUrlLinks() {\r\n $facebook = $this->facebook;\r\n $user = $this->user;\r\n if ($user) {\r\n $this->logInLogOutLink = $facebook->getLogoutUrl();\r\n echo ' <strong><em>You are not Connected.</em></strong>';\r\n } else {\r\n $this->logInLogOutLink = $facebook->getLoginUrl(\r\n array(\r\n 'scope' => 'email,offline_access,publish_stream,user_photos,offline_access',\r\n 'redirect_uri' => $pageURL\r\n )\r\n );\r\n echo \"<a href='$this->logInLogOutLink'>Facebook Login</a>\";\r\n }\r\n }", "public function getLogoutUrl($params = array()) {\r\n\t\t$params = array_merge ( array ('access_token' => $this->get_access_token (), 'next' => $this->getCurrentUrl () ), $params );\r\n\t\treturn self::$BD_OAUTH2_ENDPOINTS ['logout'] . '?' . http_build_query ( $params, '', '&' );\r\n\t}", "public function getUnsubcribeUrl() {\n\t\treturn $this->getEmailActionLink(\"email/unsubscribeWeeklyNews\");\n\t}", "function getDeleteUrl() {\n \treturn assemble_url('people_company_delete', array('company_id' => $this->getId()));\n }", "function getDeleteAvatarUrl() {\n \treturn assemble_url('people_company_user_delete_avatar', array(\n \t 'company_id' => $this->getCompanyId(),\n \t 'user_id' => $this->getId(),\n \t));\n }", "public function getLogoutURL()\n {\n return Config::get('URL') . 'logout/';\n }", "function get_publication_deleting_url($profile)\r\n {\r\n return $this->get_url(array(self :: PARAM_ACTION => self :: ACTION_DELETE_PUBLICATION, self :: PARAM_PROFILE_ID => $profile->get_id()));\r\n }", "public function socialUnlinkAction($social) {\n //get the logged in user object\n $user = $this->getUser();\n //get the entity manager\n $em = $this->getDoctrine()->getManager();\n //get the user social account object\n $socialAccounts = $user->getSocialAccounts();\n if ($social == 'facebook') {\n //unlink the facebook account data\n $socialAccounts->unlinkFacebook();\n }\n if ($social == 'twitter') {\n //unlink the facebook account data\n $socialAccounts->unlinkTwitter();\n }\n if ($social == 'linkedin') {\n //unlink the linkedin account data\n $socialAccounts->unlinkLinkedIn();\n }\n //check if we still need the object\n if (!$socialAccounts->isNeeded()) {\n //remove the object\n $em->remove($socialAccounts);\n }\n //save the changes\n $em->flush();\n //set a success flag in the session\n $this->getRequest()->getSession()->getFlashBag()->set('success', $this->get('translator')->trans('Unlinked successfully'));\n //redirect the user to the edit page\n return $this->redirect($this->generateUrl('user_edit'));\n }", "function getDismissUrl() {\n \treturn assemble_url('reminder_dismiss', array('reminder_id' => $this->getId()));\n }", "protected function defaultCancelUrl()\n {\n return Url::to($this->user->loginUrl);\n }", "static private function getDeletionLink($hash) {\r\n\t\treturn System::getFullDomain().'login.php?delete='.$hash;\r\n\t}", "public function getBaseRevokeTokenUrl()\n {\n return \"https://$this->dataCenter.adobesign.com/oauth/revoke\";\n }", "public function getUnsubscribeUrl() : string\n\t{\n\t\t$utils = $this->getUtilsObj();\n\n\t\treturn $utils->getUnsubscribeUrl($this);\n\t}", "public function get_revoke_url() {\n\n $url = new moodle_url('/repository/repository_callback.php');\n $url->param('callback', 'yes');\n $url->param('repo_id', $this->id);\n $url->param('revoke', 'yes');\n $url->param('reloadparentpage', true);\n $url->param('sesskey', sesskey());\n return '<a target=\"_blank\" href=\"'.$url->out(false).'\">'.get_string('revokeyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "function PointFinder_Social_Facebook_Logout() {\n\t/*if(PFASSIssetControl('setup4_membersettings_facebooklogin','','0') == 1){\n\t\t$setup4_membersettings_facebooklogin_appid = PFASSIssetControl('setup4_membersettings_facebooklogin_appid','','');\n\t\t$setup4_membersettings_facebooklogin_secretid = PFASSIssetControl('setup4_membersettings_facebooklogin_secretid','','');\n\t\t\n\t\tif ($setup4_membersettings_facebooklogin_appid != '' && $setup4_membersettings_facebooklogin_secretid != '') {\n\t\t\t$facebook = new Facebook(array(\n\t\t\t'appId' => $setup4_membersettings_facebooklogin_appid,\n\t\t\t'secret' => $setup4_membersettings_facebooklogin_secretid,\n\t\t\t'cookie' => true\n\t\t\t));\n\t\t\t$facebook->destroySession();\n\t\t}\n\t}*/\n}", "function get_unsubscribe_url( $customer ) {\n\t\tif ( ! $customer ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->is_exempt_from_unsubscribing() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$url = add_query_arg([\n\t\t\t'aw-action' => 'unsubscribe',\n\t\t\t'workflow' => $this->get_id(),\n\t\t\t'customer_key' => urlencode( $customer->get_key() ),\n\t\t], wc_get_page_permalink('myaccount') );\n\n\t\treturn apply_filters( 'automatewoo_unsubscribe_url', $url, $this->get_id(), $customer );\n\t}", "public function getBaseRevokeTokenUrl()\n {\n return 'https://oauth.accounting.sage.com/revoke';\n }", "public function log_user_out_of_facebook()\n {\n // TODO: Parameterise redirect_url and scope values\n $logout_config = array(\n \"next\" => \"http://sociable.local/\"\n );\n $logout_url = self::getLogOutUrl($logout_config);\n\n // Unset the session\n $_SESSION = array();\n session_destroy();\n\n // Log the user out\n header('Location: ' . $logout_url, true);\n exit;\n }", "public function get_cancel_url() {\n\t\t$cancel_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'subscription' => $this->get_id(),\n\t\t\t\t'key' => $this->get_key(),\n\t\t\t\t'action' => 'cancel',\n\t\t\t), home_url()\n\t\t);\n\n\t\treturn $cancel_url;\n\t}", "function getUnarchiveUrl() {\n return assemble_url('people_company_archive', array('company_id' => $this->getId(), 'set_value' => false));\n }", "public function logout()\r\n {\r\n $helper = $this->facebook->getRedirectLoginHelper();\r\n $logoutUrl = $helper->getLogoutUrl($_SESSION['facebook_access_token'], app_url('/facebook'));\r\n\r\n // Redirect to facebook logout page.\r\n header('location: ' . $logoutUrl);\r\n exit;\r\n }", "function getUnsubscribeUrl($object) {\n return assemble_url('project_object_unsubscribe_user', array(\n 'project_id' => $object->getProjectId(),\n 'object_id' => $object->getId(),\n 'user_id' => $this->getId(),\n ));\n }", "function get_publication_deleting_url($personal_message)\r\n {\r\n return $this->get_url(array(\r\n self :: PARAM_ACTION => self :: ACTION_DELETE_PUBLICATION,\r\n self :: PARAM_PERSONAL_MESSAGE_ID => $personal_message->get_id()));\r\n }", "public function cancelUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'cancel',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "public function getRevokeAccessTokenUrl() {\n return Mage::helper('adminhtml')->getUrl('adminhtml/aw_vidtest_authsub/revoke', array('api_model_code' => $this->getApiModelCode()));\n }", "public function get_plugin_deactivation_link( $plugin ) {\n\t\treturn wp_nonce_url( admin_url( 'admin-post.php?action=' . self::ACTION_PLUGIN_DEACTIVATE . '&plugin=' . urlencode( $plugin ) ), 'deactivate-' . $plugin );\n\t}", "public function getNotMeUrl()\n\t{\n\t\treturn $this->getEmailActionLink('email/errorSendEmail');\n\t}", "public function unregisterAction()\n {\n $connectionIds = Mage::app()->getRequest()->getParam('shopgate_connection_ids');\n if ($connectionIds && !is_array($connectionIds)) {\n $connectionIds = array($connectionIds);\n }\n\n $results = array();\n foreach ($connectionIds as $connection_id) {\n $results[] = Mage::getModel('shopgate/shopgate_connection')\n ->load($connection_id)\n ->unregister();\n }\n\n $hasErrors = false;\n foreach ($results as $result) {\n if (count($result->getErrors())) {\n $hasErrors = true;\n foreach ($result->getErrors() as $msg) {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shopgate')->__($msg));\n }\n ShopgateLogger::getInstance()->log(\n \"Unregister OAuth Shop Connection has failed \\\"\" . (string)$connectionIds . \"\\\"\",\n ShopgateLogger::LOGTYPE_ERROR\n );\n }\n }\n\n if (!$hasErrors) {\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('shopgate')->__('The connection/s have been removed successfully')\n );\n }\n\n $redirect = $this->getUrl('*/*/manage');\n\n $this->getResponse()->setRedirect($redirect);\n $this->getResponse()->sendResponse();\n }", "public function signOut();", "static public function connect_url() {\n\t\treturn Controller::join_links(\"facebook\", \"connect\");\n\t}", "public function destroy()\n {\n $user = \\App\\User::find((Auth::user()->id));\n\n $user->delete();\n \n return redirect()->action('SearchController@getTopAdvertisements')->with('status', 'Account deleted!');\n }", "public function getDeleteUrl()\n {\n return $this->getUrl('*/*/delete', ['id' => $this->getModelId()]);\n }", "public function getDeleteUrl()\n {\n return $this->getUrl('*/*/delete', array('id' => $this->getRequest()->getParam('id')));\n }", "function cover_logout_url($next_url=null) {\n return _cover_session_url(COVER_LOGOUT_URL, $next_url);\n}", "public function getCancelUrl() {\n return $this->getReturnUrl();\n }", "public function callBackUrl()\r\n\t{\r\n\t\treturn Mage::getUrl('ezloginlite/social/callBack');\r\n\t}", "public function disconnect() {\n if ( ! empty( $_GET['disconnect'] ) ) {\n update_option( self::INSTAGRAM_CODE, '' );\n update_option( self::INSTAGRAM_USER_ID, '' );\n update_option( self::INSTAGRAM_TOKEN, '' );\n update_option( self::INSTAGRAM_TOKEN_LONG_LIVED, '' );\n update_option( self::INSTAGRAM_TOKEN_LONG_LIVED_TIME, '' );\n update_option( self::FACEBOOK_CODE, '' );\n update_option( self::FACEBOOK_TOKEN, '' );\n update_option( self::CONNECTION_TYPE, '' );\n }\n\n return '';\n }", "private function getCallbackUrl($provider)\n {\n return $this->url->getUrl('clean_checkout/social/authenticate', ['_query' => ['provider' => $provider]]);\n }", "public function deleteAccountAction() {\n //get the request object\n $request = $this->getRequest();\n //check if form is posted\n if ($request->getMethod() == 'POST') {\n //get the session object\n $session = $request->getSession();\n //get the user object from the firewall\n $user = $this->getUser();\n //set the delete flag\n $user->setEnabled(FALSE);\n //get the entity manager\n $em = $this->getDoctrine()->getManager();\n //get the social accounts object\n $socialAccounts = $user->getSocialAccounts();\n //remove the social accounts object if exist\n if ($socialAccounts) {\n $em->remove($socialAccounts);\n }\n //save the changes\n $em->flush();\n //logout the user\n $this->get('security.context')->setToken(null);\n //invalidate the current user session\n $session->invalidate();\n //set the success flag\n $session->getFlashBag()->set('success', $this->get('translator')->trans('Your account has been deleted'));\n //redirect to the login page\n return $this->redirect($this->generateUrl('login'));\n }\n return $this->render('ObjectsUserBundle:User:delete_account.html.twig');\n }", "public function getConfirmUrl() {\n\t\treturn $this->getEmailActionLink('email/emailConfirm');\n\t}", "public function getActivationUrl() {\n\t\t$activationUrl = '/registration/activation';\n\t\tif (isset ( $this->profile )) {\n\t\t\t$params ['key'] = $this->activationKey;\n\t\t\t$params ['email'] = $this->profile->email;\n\t\t\t\n\t\t\treturn Yii::app ()->controller->createAbsoluteUrl ( $activationUrl, $params );\n\t\t}\n\t}", "public function getClientDeletionURL($id)\n\t{\n\t\treturn $this->baseURL . \"/action/confirm/\" . $id;\n\t}", "public function register_deactivation();", "public function unconfirmed_account() {\n \n // Check if the current user is admin and if session exists\n $this->check_session();\n \n if ( $this->user_status == 1 ) {\n \n redirect('/user/app/dashboard');\n \n }\n \n // Show unconfirmed account page\n $this->load->view('user/unconfirmed-account');\n \n }", "public function delete() {\n\t\t$url = UserUrl::where('id', request()->id)->firstOrFail();\n\t\t$url->delete();\n\t\treturn redirect('/dashboard');\n\t}", "public function getLogoutUrl( $params=array() ) \n {\n $session = $this->getSession();\n return $this->getUrl(\n 'www',\n 'logout.php',\n array_merge( array(\n 'api_key' => $this->getAppId(),\n 'next' => URL_PUBLIC . 'logout/',\n 'session_key' => $session['session_key'],\n ), $params)\n );\n }", "public function deleteImageRedirectPath(): string\n {\n return auth('rocXolid')->user()->is($this)\n ? route('rocXolid.auth.profile')\n : $this->getControllerRoute('show');\n }", "public static function Destroy()\n\t{\n\t\tif(self::$fb != null)\n\t\t{\n\t\t\tself::GetFB()->destroySession();\n\t\t\tself::$fb = null;\n\t\t}\n\t\tself::deleteFacebookCookies();\n\t}", "static public function login_url() {\n\t\t$facebook = FacebookApp::get()->first();\n\t\tif($facebook && $facebook->EnableFacebookLogin == 1)\n\t\t\treturn Controller::join_links(\"facebook\", \"login\");\n\t\treturn false;\n\t}", "public function destroy()\n {\n Auth::user()->delete();\n session()->flash('flash_message', __('auth.account_deleted'));\n\n return redirect()->route('home');\n }", "public function &setExternalLogoutUrl($value);", "public function getUrl() {\n\t\t//$url = \"https://www.facebook.com/dialog/oauth?client_id=\".$this->appId.\"&redirect_uri=\".$this->redirectUrl.\"&scope=\".$this->permission.\"&state=\".$_SESSION['state'];\n\t\treturn $this->redirectUrl;\n\t}", "public function logout() {\n $this->_disconnect_user();\n redirect(base_admin_url('identification'), 'refresh');\n }", "function whatsappmvl_deactivation() {\n\n // clear the permalinks to remove our post type's rules from the database\n flush_rewrite_rules();\n}", "function drush_pm_signup_signup_endpoint_delete($name) {\n $endpoint = SignupEndpoint::loadByName($name);\n if ($endpoint !== FALSE) {\n $endpoint->delete();\n drush_log(dt(\"Signup endpoint @name deleted\", array('@name' => $name)), 'ok');\n }\n else {\n drush_set_error(dt(\"Signup endpoint @name does not exist\", array('@name' => $name)));\n }\n}", "function the_champ_unlink(){\r\n\tif(isset($_POST['provider'])){\r\n\t\tglobal $user_ID;\r\n\t\t$linkedAccounts = get_user_meta($user_ID, 'thechamp_linked_accounts', true);\r\n\t\t$primarySocialNetwork = get_user_meta($user_ID, 'thechamp_provider', true);\r\n\t\tif($linkedAccounts || $primarySocialNetwork){\r\n\t\t\t$socialNetworkToUnlink = sanitize_text_field($_POST['provider']);\r\n\t\t\t$linkedAccounts = maybe_unserialize($linkedAccounts);\r\n\t\t\t$currentSocialId = get_user_meta($user_ID, 'thechamp_current_id', true);\r\n\t\t\tif($primarySocialNetwork == $socialNetworkToUnlink){\r\n\t\t\t\tif($currentSocialId == get_user_meta($user_ID, 'thechamp_social_id', true)){\r\n\t\t\t\t\tdelete_user_meta($user_ID, 'thechamp_current_id');\r\n\t\t\t\t}\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_social_id');\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_provider');\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_large_avatar');\r\n\t\t\t\tdelete_user_meta($user_ID, 'thechamp_avatar');\r\n\t\t\t}else{\r\n\t\t\t\tif($currentSocialId == $linkedAccounts[$socialNetworkToUnlink]){\r\n\t\t\t\t\tdelete_user_meta($user_ID, 'thechamp_current_id');\r\n\t\t\t\t}\r\n\t\t\t\tunset($linkedAccounts[$socialNetworkToUnlink]);\t\r\n\t\t\t\tupdate_user_meta($user_ID, 'thechamp_linked_accounts', maybe_serialize($linkedAccounts));\r\n\t\t\t}\r\n\t\t\tthe_champ_ajax_response(array('status' => 1, 'message' => ''));\r\n\t\t}\r\n\t}\r\n\tdie;\r\n}", "public function getLogoutUrl(FacebookSession $session, $next)\n {\n if ($session->getAccessToken()->isAppSession()) {\n throw new FacebookSDKException(\n 'Cannot generate a Logout URL with an App Session.', 722\n );\n }\n $params = array(\n 'next' => $next,\n 'access_token' => $session->getToken()\n );\n return 'https://www.facebook.com/logout.php?' . http_build_query($params, null, '&');\n }", "public function providerUrl($provider)\n {\n return Socialite::driver($provider)->stateless()->redirect()->getTargetUrl();\n }", "public function getAskDeletionUser($id){\n return $this->rootUrl().$id.'/supprimerUser';\n }", "protected function getConfirmEmailUrl()\n {\n $hash = base64_encode($this->user->password_hash);\n $email = $this->person->email;\n $baseUrl = NotificationUtil::getApplicationBaseUrl();\n $confirmEmailUrl = $baseUrl . $this->getValidateUrl() . '?hash=' . $hash . '&email=' . $email;\n return $confirmEmailUrl;\n }", "public static function logoffURL($target = null)\n {\n $class = self::loadDelegationClass();\n \n return call_user_func($class.'::logoffURL', $target);\n }", "public function getCancelUrl()\n {\n // TODO: Implement getCancelUrl() method.\n }", "function getResetApiKeyUrl() {\n return assemble_url('people_company_user_api_reset_key', array(\n 'company_id' => $this->getCompanyId(),\n 'user_id' => $this->getId(),\n ));\n }", "function get_logout_url() {\r\n $logout_url = ( '' != wpc_client_get_slug( 'login_page_id' ) ) ? add_query_arg( array( 'logout' => 'true' ), wpc_client_get_slug( 'login_page_id' ) ) : wp_logout_url();\r\n return $logout_url;\r\n }", "public function logout() {\n\t\t$this->facebook->destroy_session();\n\t\t// Remove user data from session\n\t\t$this->session->sess_destroy();\n\t\t// Redirect to login page\n redirect('/user_authentication');\n }", "public function getLogoutUrl()\n {\n if (array_key_exists(\"logoutUrl\", $this->_propDict)) {\n return $this->_propDict[\"logoutUrl\"];\n } else {\n return null;\n }\n }", "public function getAfterLoginUrl() {\n\t\tswitch ($this->getModule()) {\n\t\t\tcase RublonMagentoModule::ADMIN:\n\t\t\t\treturn Mage::helper(\"adminhtml\")->getUrl('adminhtml');\n\t\t\tcase RublonMagentoModule::CONNECT:\n\t\t\t\treturn $this->getMagentoConnectUrl();\n\t\t\tdefault:\n\t\t\t\treturn Mage::getUrl('customer/account');\n\t\t}\n\t}", "function deconnect()\r\n\t{ \r\n\t\tHybrid_Auth::expireStorage();\r\n\r\n\t\treturn TRUE;\r\n\t}", "public function getCreateAccountUrl()\n {\n $url = $this->getData('create_account_url');\n if (is_null($url)) {\n $url = $this->helper('customer')->getRegisterUrl();\n }\n return $url;\n }", "public function getForgotPasswordUrl()\n {\n return $this->helper('customer')->getForgotPasswordUrl();\n }", "static function logoutLink() {\n return ( \"<td>\" . self::genericLink(\"reg=deact\",l(\"Log out\")).\"</td>\" );\n }", "function logout_url()\n{\n // Add a logout query string parameter\n $params = $_GET;\n $params['logout'] = '';\n\n // Add logout param to current page URL.\n $logout_url = htmlspecialchars($_SERVER['PHP_SELF']) . '?' . http_build_query($params);\n\n return $logout_url;\n}", "protected function _getCancelUrl()\n {\n return $this->getUrl('*/*/cancel', array('agreement' => $this->_getBillingAgreement()->getAgreementId()));\n }", "public function getHomeUrlWithoutScheme()\n {\n return preg_replace('#^https?://#', '', rtrim($this->url, '/'));\n }", "public function getDeleteUrl()\n {\n return $this->getUrl('*/*/delete', ['id' => $this->getTemplateId()]);\n }", "public function getURL()\n {\n return Config::get('URL') . 'auth/unl/';\n }", "public function destroy(Social $social)\n {\n // Storage::disk('public')->delete(\"$social->logo\");\n Social::destroy($social->id);\n return redirect(self::ROUTE);\n }", "public function destroy($id)\n {\n $link = Social_link::find($id);\n $link->delete();\n toastr()->success('Social link Deleted successfully!');\n return redirect()->back();\n }", "public function destroy()\n\t{\n\t\tAuth::logout();\n\t\treturn Redirect::intended(\"/login\");\n\t}", "public function getMessageDeleteUrl(): string\n {\n return $this->getUrl('webforms/message/delete');\n }", "public function actionUnsubscribe()\n {\n $uid = craft()->request->getQueryStringWithoutPath();\n $uid = substr($uid,0,-1);\n // get PC model based on string\n $PrayerCornerRecord = PrayerCornerRecord::model()->findByAttributes(array('uid' => $uid));\n // if PC record exists\n if (count($PrayerCornerRecord)) {\n\n $entryId = $PrayerCornerRecord->entryId;\n // get entry record\n $entry = craft()->entries->getEntryById($entryId);\n // delete record\n $PrayerCornerRecord->delete();\n craft()->userSession->setFlash('message', 'You have unsubscribed from notifications!');\n // log unsubscribe\n PrayerCornerPlugin::log(\n 'User (' . $PrayerCornerRecord->email . ') has successfully unsubscribed from ' . $entry->title,\n LogLevel::Info,\n true\n );\n // redirect user\n $this->redirect($entry->getUrl());\n } else {\n // log error\n PrayerCornerPlugin::log(\n 'Erroneous unsubscribe link followed (' . $uid. ')',\n LogLevel::Info,\n true\n );\n // redirect user to site root\n $this->redirect( craft()->getSiteUrl() );\n }\n\n }", "public function destroy()\n {\n Auth::logout();\n Session::flush();\n\n// if (config('jwtauth')) {\n// $token = JWTAuth::parseToken();\n// $token->invalidate();\n// }\n\n return Redirect::to('https://' . Request::server('SERVER_NAME') . config('shibboleth.idp_logout'));\n }", "public function signoutAction()\n {\n $this->auth->logout();\n $this->response->redirect();\n }", "public function getDeletionUser($id){\n return $this->rootUrl().$id.'/confirmSuppressionUser';\n }", "public function deregisterDestination($request);", "function getDeleteLogoUrl() {\n return assemble_url('people_company_delete_logo', array('company_id' => $this->getId())); \n }", "public function destroy()\n {\n $userId = Helper::getIdFromUrl('user');\n \n if ((Helper::checkUrlIdAgainstLoginId($userId)) !== 'super-admin') {\n Usermodel::load()->destroy($userId);\n } else { \n View::render('errors/403.view', [\n 'message' => 'You cannot delete yourself!',\n ]);\n }\n }", "public function destroy()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $usuario = parent::showImgUser($id);\n if($id && $token)\n {\n if($usuario->img_usuario != 'assets/uploud/profile/default.svg')\n {\n unlink($usuario->img_usuario);\n }\n parent::deleteUser($id,$token);\n }\n }", "public function unconfirmedTask()\n\t{\n\t\t$xprofile = User::getInstance();\n\t\t$email_confirmed = $xprofile->get('activation');\n\n\t\t// Incoming\n\t\t$return = Request::getString('return', urlencode('/'));\n\n\t\t// Check if the email has been confirmed\n\t\tif ($email_confirmed == 1 || $email_confirmed == 3)\n\t\t{\n\t\t\tApp::redirect(urldecode($return));\n\t\t}\n\n\t\t// Check if the user is logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$return = base64_encode(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task, false, true));\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=com_users&view=login&return=' . $return, false),\n\t\t\t\tLang::txt('COM_MEMBERS_REGISTER_ERROR_LOGIN_TO_CONFIRM'),\n\t\t\t\t'warning'\n\t\t\t);\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_UNCONFIRMED'))\n\t\t\t->set('email', $xprofile->get('email'))\n\t\t\t->set('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}" ]
[ "0.65225893", "0.6388669", "0.636367", "0.63306195", "0.63095576", "0.62887615", "0.6283927", "0.6189685", "0.596363", "0.59509325", "0.5794324", "0.577498", "0.57664245", "0.5744816", "0.5740486", "0.57153845", "0.5695704", "0.5684772", "0.5667853", "0.5626614", "0.55863154", "0.5581347", "0.5566035", "0.5556032", "0.5542814", "0.5540408", "0.55084836", "0.5497449", "0.5496263", "0.5491437", "0.5458419", "0.5414481", "0.5406542", "0.5394212", "0.5388277", "0.53754884", "0.5363235", "0.5331283", "0.5309174", "0.5298047", "0.5293027", "0.5282695", "0.5279126", "0.5278034", "0.52780193", "0.5276924", "0.5272415", "0.5270149", "0.5260299", "0.52517873", "0.5242268", "0.52416855", "0.5218944", "0.5204586", "0.5202537", "0.51992", "0.51923287", "0.51874816", "0.5176362", "0.516125", "0.5155258", "0.51545644", "0.5145671", "0.5145604", "0.514449", "0.5135773", "0.5133366", "0.513317", "0.5132559", "0.51315", "0.513028", "0.51269835", "0.5117745", "0.51119393", "0.5110496", "0.5108238", "0.5104799", "0.51024836", "0.5095785", "0.5095222", "0.50923413", "0.5083544", "0.50775963", "0.50749373", "0.50719416", "0.50636375", "0.50630873", "0.5056521", "0.50489295", "0.504762", "0.50453204", "0.504033", "0.50387", "0.5038139", "0.5034847", "0.50330967", "0.5027758", "0.50185645", "0.50182474", "0.5018136" ]
0.7648933
0
Setup a default Facebook app
public function requireDefaultRecords() { $facebook = FacebookApp::get()->count(); if(!$facebook) { $facebook = FacebookApp::create(); $facebook->write(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function facebookAppId()\r\n\t{\r\n\t\treturn Mage::getStoreConfig('ezfacebook/facebook/appid');\r\n\t}", "function facebook_instance()\r\n{\r\n\tglobal $settings;\r\n\t\r\n\treturn new Facebook(array(\r\n\t\t'appId' => $settings['facebook_app_id'],\r\n\t\t'secret' => $settings['facebook_app_secret'],\r\n\t));\r\n}", "private function connectApps()\n {\n $fb = new \\Facebook\\Facebook([\n 'app_id' => $this->appID,\n 'app_secret' => $this->appSecret,\n 'default_graph_version' => $this->defaultGraphVersion,\n ]);\n\n try {\n $token = $fb->getCanvasHelper()->getAccessToken();\n } catch (FacebookSDKException $e) {\n throw new HttpException(\n 500,\n 'Facebook Access Token returned an error: ' . $e->getMessage()\n );\n }\n\n if ($token == null) {\n $helper = $fb->getRedirectLoginHelper();\n $scope = ['email', 'user_likes', 'publish_actions'];\n $loginUrl = $helper->getLoginUrl('https://apps.facebook.com/' . $this->appID, $scope);\n\n echo '<script>window.top.location.href = \"' . $loginUrl . '\"</script>';\n } else {\n $fb->setDefaultAccessToken($token);\n }\n $this->session->set('access_token', $token);\n $this->session->set('fb', $fb);\n\n return $fb;\n }", "private static function init_facebook() {\n // Facebook is a custom setup.\n $record = (object) [\n 'name' => 'Facebook',\n 'image' => 'https://facebookbrand.com/wp-content/uploads/2016/05/flogo_rgb_hex-brc-site-250.png',\n 'baseurl' => '',\n 'loginscopes' => 'public_profile email',\n 'loginscopesoffline' => 'public_profile email',\n 'showonloginpage' => true\n ];\n\n $issuer = new issuer(0, $record);\n return $issuer;\n }", "public static function facebook()\n {\n return 'facebook';\n }", "public function facebookLogin() {\n\t\t$this->autoRender = false;\n\n\t\t// config of facebook\n\t\t// app_id => app id from facebook app, app_secret => app secret from facebook app, default_graph_version\n\t\t$fb = new Facebook\\Facebook([\n\t\t\t'app_id' => '1038913562917167',\n\t\t\t'app_secret' => 'c0df3e628a09c24f972985ad47dee466',\n\t\t\t'default_graph_version' => 'v2.10',\n\t\t]);\n\n\t\t$helper = $fb->getRedirectLoginHelper();\n\n\t\t$permissions = ['email']; // Optional permissions\n\t\t$loginUrl = $helper->getLoginUrl('http://myanants.com/user/fbcallback', $permissions);\n\t\t$this->redirect($loginUrl);\n\n\t}", "public function __construct() {\n $this->fb = new Facebook([\n 'app_id' => Config::FB_APP_ID,\n 'app_secret' => Config::FB_APP_SECRET,\n 'default_graph_version' => Config::FB_DEFAULT_GRAPH_VERSION,\n ]);\n }", "public function __construct( $app ) {\r\n // Make sure we have the app they're talking about\r\n if ( !array_key_exists( $app, $this->apps ) )\r\n throw new InvalidParametersException( _('You entered an invalid facebook application name') );\r\n\r\n // Get facebook\r\n\t\tlibrary('facebook/facebook');\r\n\r\n\t\t// Create our Application instance (replace this with your appId and secret).\r\n\t\t$this->facebook = new Facebook(array(\r\n\t\t\t'appId' => $this->apps[$app]['id'],\r\n\t\t\t'secret' => $this->apps[$app]['secret'],\r\n\t\t\t'cookie' => true,\r\n\t\t));\r\n\r\n $this->id = $this->apps[$app]['id'];\r\n $this->secret = $this->apps[$app]['secret'];\r\n\t}", "public function __construct(){\n\n $this->facebook = new Facebook(array(\n\n 'appId' => self::APP_ID,\n\n 'secret' => self::APP_SECRET,\n\n ));\n\n }", "public function facebookUrl()\r\n\t{\r\n\t\treturn Mage::getBaseDir(\"media\") . DS . \"ezloginlite\" . DS. \"facebook\" . DS;\r\n\t}", "protected function initSdk() {\n\n $class_name = '\\Facebook\\Facebook';\n if (!class_exists($class_name)) {\n throw new SocialApiException(sprintf('The PHP SDK for Facebook could not be found. Class: %s.', $class_name));\n }\n /* @var \\Drupal\\social_auth_facebook\\Settings\\FacebookAuthSettings $settings */\n $settings = $this->settings;\n\n if ($this->validateConfig($settings)) {\n // All these settings are mandatory.\n $facebook_settings = [\n 'app_id' => $settings->getAppId(),\n 'app_secret' => $settings->getAppSecret(),\n 'default_graph_version' => 'v' . $settings->getGraphVersion(),\n 'persistent_data_handler' => $this->persistentDataHandler,\n 'http_client_handler' => $this->getHttpClient(),\n ];\n\n return new Facebook($facebook_settings);\n }\n\n return FALSE;\n }", "public function __construct()\n {\n $oConfig = oxRegistry::getConfig();\n\n $aFbConfig[\"appId\"] = $oConfig->getConfigParam(\"sFbAppId\");\n $aFbConfig[\"secret\"] = $oConfig->getConfigParam(\"sFbSecretKey\");\n $aFbConfig[\"cookie\"] = true;\n\n BaseFacebook::__construct($aFbConfig);\n }", "public function facebookAppSecret()\r\n\t{\r\n\t\treturn Mage::getStoreConfig('ezfacebook/facebook/appsec');\r\n\t}", "function facebook_init() {\n include ('facebook.class.php');\n}", "protected function init()\n\t{\n\t\t$this->db = MySQL::factory(DB_HOST, DB_NAME, DB_USER, DB_PASS);\n\t\tFacebookSession::setDefaultApplication(FB_APP_ID, FB_APP_SECRET);\n\t}", "public function setAppId($value);", "abstract public function createApplication();", "function facebook_app_token()\r\n{\r\n\tglobal $settings;\r\n\r\n\treturn $settings['facebook_app_id'] . '|' . $settings['facebook_app_secret'];\r\n}", "public function getApp();", "public function getAppId();", "public function setDefaultAppName($name)\n\t{\n\t\t$this->_defaultAppName = $name;\n\t}", "function get_fb_instance() {\n\n global $fb_appid, $fb_secret;\n\n //if (!$_SESSION['fb_instance']) {\n \n Facebook::$CURL_OPTS[CURLOPT_CAINFO] = 'D:\\Workspace\\xampplite\\htdocs\\FantaProject\\facebook\\fb_ca_chain_bundle.crt';\n Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;\n Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;\n\n $tmp_fb = new Facebook(array(\n 'appId' => $fb_appid,\n 'secret' => $fb_secret,\n 'cookie' => true,\n ));\n $_SESSION['fb_instance'] = $tmp_fb;\n\n //}\n\n return $_SESSION['fb_instance'];\n}", "public function getApp()\n\t{\n\t\tif(! self::$_app){\n\t\t if ($this->scopes) $this->config['oauth']['scopes'] = $this->scopes;\n\t\t\tself::$_app = Factory::officialAccount($this->config);\n\t\t}\n\t\treturn self::$_app;\n\t}", "public static function factory() \n {\n return new FacebookAuth();\n }", "public function indexAction()\n {\n\t\t$fb = new stdClass();\n\t\t$bootstrap = $this->getInvokeArg('bootstrap');\n\t\t$aConfig = $bootstrap->getOptions();\n\t\t$fb->_app_id = $aConfig['my']['facebook']['app_id'];\n\t\t$fb->_api_key = $aConfig['my']['facebook']['api_key'];\n\t\t$fb->_secret = $aConfig['my']['facebook']['secret'];\n\t\t///////////////////////////////////////////////////////////////\n\t\t\t\t\n\t\tfunction parse_signed_request($signed_request, $secret) {\n\t\t\tlist($encoded_sig, $payload) = explode('.', $signed_request, 2); \n\t\t\t\n\t\t\t// decode the data\n\t\t\t$sig = base64_url_decode($encoded_sig);\n\t\t\t$data = json_decode(base64_url_decode($payload), true);\n\t\t\t\n\t\t\tif (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {\n\t\t\t\terror_log('Unknown algorithm. Expected HMAC-SHA256');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\t// check sig\n\t\t\t$expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);\n\t\t\tif ($sig !== $expected_sig) {\n\t\t\t\terror_log('Bad Signed JSON signature!');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tfunction base64_url_decode($input) {\n\t\t\treturn base64_decode(strtr($input, '-_', '+/'));\n\t\t}\n\t\t\n\t\tif ($_REQUEST) {\n\t\t\t//INSTANTIATE NEW OBJECTS\n\t\t\t$pssFacebook = new Zend_Db_Table('facebook');\n\t\t\t$pssUser = new Zend_Db_Table('users');\n\t\t\t$flag = NULL;\n\t\t\t//MAKE RESPONSE OBJECT\n\t\t\t$response = parse_signed_request($_REQUEST['signed_request'], $fb->_secret);\n\t\t\t/*\n\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\tif($pssUserRow)\n\t\t\t{\n\t\t\t\t$flag = 'pre-existing user';\n\t\t\t}\n\t\t\t$select = $pssFacebook->select()->where('email = ?', $response['registration']['email']);\n\t\t\t$pssFBRow = $pssFacebook->fetchRow($select);\n\t\t\t*/\n\t\t\t$auth = Zend_Auth::getInstance();\n\t\t\tif($auth->hasIdentity())\n\t\t\t{\n\t\t\t\t$identity = $auth->getIdentity();\n\t\t\t\t$data = array();\n\t\t\t\t$data['user_id'] = $identity->id;\n\t\t\t\t$data['oauth_token'] = $response['oauth_token']; $data['fb_id'] = $response['user_id'];\n\t\t\t\t$data['name'] = $response['registration']['name']; $data['email'] = $response['registration']['email']; $data['password'] = md5($response['registration']['password']);\n\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t$pssFacebook->insert($data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\t\tif($pssUserRow)\n\t\t\t\t{\n\t\t\t\t\t$flag = 'pre-existing user';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$select = $pssFacebook->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t\t$pssFBRow = $pssFacebook->fetchRow($select);\n\t\t\t\t\tif($pssFBRow)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$array = explode('/', $response['registration']['birthday']);\n\t\t\t\t\t\t$birthday = $array[2] . '-' . $array[0] . '-' . $array[1];\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data['email'] = $response['registration']['email']; $data['name'] = $response['registration']['name'];\n\t\t\t\t\t\t$data['birthday'] = $birthday;\n\t\t\t\t\t\t$data['password'] = md5($response['registration']['password']);\n\t\t\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t\t\t$pssUser->insert($data);\n\t\t\t\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data['oauth_token'] = $response['oauth_token']; $data['user_id'] = $pssUserRow->id; $data['fb_id'] = $response['user_id'];\n\t\t\t\t\t\t$data['name'] = $response['registration']['name']; $data['email'] = $response['registration']['email']; $data['password'] = md5($response['registration']['password']);\n\t\t\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t\t\t$pssFacebook->insert($data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_redirect('/default/index/index');\n\t\t /*\n\t\t echo '<pre>';\n\t\t print_r($response);\n\t\t echo '</pre>';\n\t\t */\n\t\t \n\t\t} else {\n\t\t echo '$_REQUEST is empty';\n\t\t}\n }", "protected function registerFacebookSdk()\n {\n $this->app->singleton(\\App\\Utils\\FacebookSdk::class, function () {\n $proxyConfig = app('config')->get('facebook-sdk.proxy');\n if ($proxyConfig['is_open'] && !empty($proxyConfig['host']) && !empty($proxyConfig['port'])) {\n $client = new \\GuzzleHttp\\Client([\n 'timeout' => 120,\n 'curl' => [\n CURLOPT_PROXY => $proxyConfig['host'],\n CURLOPT_PROXYPORT => $proxyConfig['port']\n ],\n ]);\n } else {\n $client = new \\GuzzleHttp\\Client(['timeout' => 120]);\n }\n\n $config = app('config')->get('facebook-sdk.facebook_config');\n\n\n// static::$_clientinstance = new \\App\\Utils\\Facebook([\n// 'app_id' => '663043711013811',\n// 'app_secret' => '25faf0192fcc33270c0df783e2a1f902',\n// //'app_id' => '643785509628922',\n// //'app_secret' => '88c97a5ac648dfc605302380ee8ccf0a',\n// 'default_graph_version' => 'v9.0',\n// 'http_client_handler' => new FGuzzle6HttpClient($client),\n// 'persistent_data_handler' => new \\App\\Utils\\FSessionDLaravelDataHandler()\n// ]);\n\n $config['http_client_handler'] = new \\App\\Utils\\FGuzzle6HttpClient($client);\n $config['persistent_data_handler'] = new \\App\\Utils\\FSessionDLaravelDataHandler();\n\n return new \\App\\Utils\\FacebookSdk($config);\n });\n\n $this->app->alias(\\App\\Utils\\FacebookSdk::class, 'FacebookSdk');\n }", "function __construct(){\n // Start connection to Facebook Server\n $appID = APP_FB_ID;\n $appIDSecret = APP_FB_SECRET;\n\t\t$this->fb = new Facebook\\Facebook([\n\t\t 'app_id' => $appID,\n\t\t 'app_secret' => $appIDSecret,\n\t\t 'default_graph_version' => 'v5.0',\n\t\t // . . .\n\t\t ]);\n\t}", "private function __construct()\r\n\t{\t\t\r\n\t\t$this->m_fb = new Facebook(array(\r\n\t\t\t'appId' => '198517920178057',\r\n\t\t\t'secret' => '52e29c0fd4f0e233db6120e4b0189a37'\r\n\t\t));\r\n\t}", "public function testComAdobeGraniteAuthOauthImplFacebookProviderImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.auth.oauth.impl.FacebookProviderImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public function testGetApp() { \n\t\t$siteConfig = SiteConfig::current_site_config();\n\t\t$siteConfig->TwitterConsumerKey = \"testkey\";\n\t\t$siteConfig->TwitterConsumerSecret = \"testsecret\";\n\t\t$siteConfig->write();\n\t\t\n\t\t$twitter = TwitterApp::curr();\n\t\t$this->assertInstanceOf(\"Twitter\", $twitter, \"Unable to fetch Twitter App.\");\n\t}", "public function testComAdobeCqSocialConnectOauthImplFacebookProviderImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.connect.oauth.impl.FacebookProviderImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public function createApplication()\n {\n }", "public function action_facebook($callback = null)\n\t{\n\t\t$facebook = new Facebook(array(\n\t\t\t'appId'=> Config::get('facebook.appid'),\n\t\t\t'secret'=> Config::get('facebook.appsecret')\n\t\t));\n\t\t\n\t\tif($callback == 'callback')\n\t\t{\n\t\t\tif(Input::get('code'))\n\t\t\t{\n\t\t\t\t$token = $facebook->getAccessToken();\n\t\t\t\t$fb = $facebook->api('/me');\n\t\t\t\t\n\t\t\t\tif(Auth::check())\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tDB::table('passports')->where('id', '=', Auth::user()->id)->update(array('fbid'=>$fb['id']));\n\t\t\t\t\t\n\t\t\t\t\treturn Redirect::to('settings/apps');\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tif($check = DB::table('passports')->where('fbid', '=', $fb['id'])->first(array('id', 'username')))\n\t\t\t\t\t{\n\t\t\t\t\t\t//Facebook ID matched a user in our DB. Log in the user\n\t\t\t\t\t\tAuth::login($check->id);\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn Redirect::to('user/'.$check->username);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//SET Session\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Facebook ID DID NOT match a user in our DB. Save as a new member and generate a password to be sent in the email.\n\t\t\t\t\t\t//Generate random password for the user\n\t\t\t\t\t\t$randomPassword = Str::random(8);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Make sure the username is not taken. If it is, add 3 random numbers on the end of it.\n\t\t\t\t\t\tif(DB::table('passports')->where('username', '=', $fb['username'])->count() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fb['username'] = $fb['username'].Str::random(3, 'num');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Prepare user data\n\t\t\t\t\t\t$newuser = array(\n\t\t\t\t\t\t\t'id'=> null,\n\t\t\t\t\t\t\t'fbid'=> $fb['id'],\n\t\t\t\t\t\t\t'username'=> $fb['username'],\n\t\t\t\t\t\t\t'password'=> md5($randomPassword),\n\t\t\t\t\t\t\t'email'=> $fb['email'],\n\t\t\t\t\t\t\t'first_name'=> $fb['first_name'],\n\t\t\t\t\t\t\t'last_name'=> $fb['last_name'],\n\t\t\t\t\t\t\t'social_status'=> 'Gaian Addict',\n\t\t\t\t\t\t\t'country'=> Utilities::country_code_to_country($_SERVER['HTTP_CF_IPCOUNTRY']),\n\t\t\t\t\t\t\t'city'=> '',\n\t\t\t\t\t\t\t'role'=> 1,\n\t\t\t\t\t\t\t'points'=> 0,\n\t\t\t\t\t\t\t'challenges'=> 0,\n\t\t\t\t\t\t\t'stn'=> 1,\n\t\t\t\t\t\t\t'reg_date'=> time(),\n\t\t\t\t\t\t\t'timezone'=> '',\n\t\t\t\t\t\t\t'avatar'=> ''\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Save user data in Database\n\t\t\t\t\t\t$id = DB::table('passports')->insert_get_id($newuser);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Log in user\n\t\t\t\t\t\tAuth::login($id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Send an email regarding the signup + let the user know of the password.\n\t\t\t\t\t\t$mail = new Mailer();\n\t\t\t\t\t\t$mail->setFrom('Gaian.me', 'mail@gaian.me');\n\t\t\t\t\t\t$mail->addRecipient(null, $newuser['email']);\n\t\t\t\t\t\t$mail->fillSubject('Gaian.me Account');\n\t\t\t\t\t\t$mail->fillMessage(\"Welcome to Gaian.me!\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"We are very happy that you decided to join our community and we hope that you have a great time on our website.\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Since you signed up using facebook, we setup a password for you so you can also sign in using the simple Sign In form.\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Your password is: \".$randomPassword.\"\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"However, you can always sign in using the facebook log in button.\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"We have forums where fellow gaians hang out or ask for help installing themes or customizing their computer in general, so you might want to check that out:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t URL::to('forum').\"\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Happy contributing!\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Best,\\nThe Gaian.me Team\");\n\t\t\t\t\t\t$mail->send();\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn Redirect::to('user/'.$newuser['username']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//CODE IS NOT SET\n\t\t\t\treturn Redirect::to('/');\n\t\t\t}\n\t\t} else {\n\t\t\t$args = array(\n\t\t\t\t'scope'=> Config::get('facebook.scope'),\n\t\t\t\t'redirect_uri'=> URL::to(Config::get('facebook.redirectpath'))\n\t\t\t);\n\t\t\t$uri = $facebook->getLoginUrl($args);\n\t\t\treturn Redirect::to($uri);\n\t\t}\n\t\n\t}", "private function initApps()\n {\n\n // Run app specfic functions\n\n /* @var $app \\Core\\Amvc\\App\\Abstractapp */\n foreach ($this->apps as $app) {\n\n // Call additional Init() methods in apps\n if (method_exists($app, 'Init')) {\n $app->Init();\n }\n\n switch ($app->getName()) {\n case 'Core':\n\n $config = $this->config->getStorage('Core');\n\n // Create home url\n $type = $this->user->isGuest() ? 'guest' : 'user';\n $route = $config->get('home.' . $type . '.route');\n $params = parse_ini_string($config->get('home.' . $type . '.params'));\n\n $config->set('url.home', $app->url($route, $params));\n\n break;\n }\n }\n }", "public function getDefaultApp()\n {\n return APPPATH;\n }", "public function __construct()\n {\n\n $this->baseUrl = \"https://facebook.com\";\n }", "public function facebook()\n\t{\n\t\tif ( ! $this->_facebook)\n\t\t{\n\t\t\tKohana::load(Kohana::find_file('vendor/facebook-php-sdk', 'facebook'));\n\n\t\t\t$this->_facebook = new Facebook(array(\n\t\t\t\t'appId' => Kohana::$config->load('facebook.app_id'),\n\t\t\t\t'secret' => Kohana::$config->load('facebook.app_secret'),\n\t\t\t));\n\t\t}\n\n\t\treturn $this->_facebook;\n\t}", "public function facebook(){\n\t\t// get redirect URL\n\t\t$requestUrl = $this->input->get(\"redirect\");\n\t\t\n\t\t// perform Facebook login\n\t\t$res = false;\n\t\ttry {\n\t\t\t$res = $this->login_util->loginFacebook($this->config->item('facebook_app_id'), $this->config->item('facebook_secret'), $requestUrl);\n\t\t} catch (Exception $e){\n\t\t\t$this->display_login($requestUrl, $e->getMessage());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($res){\n\t\t\t// redirect to the request URL\n\t\t\tredirect($requestUrl, 'refresh');\n\t\t} else {\n\t\t\t// If we reached here, then login has failed\n\t\t\t$this->display_login($requestUrl);\n\t\t}\n\t}", "public function setFacebook($fb)\n {\n\t$this->fb = $fb;\n }", "public function facebook() {\n\n\t \n\t\t$fb = new Facebook\\Facebook([\n\t\t 'app_id' => '144053429274589',\n\t\t 'app_secret' => '4ef6916e238aff3b6726dac08b853135',\n\t\t 'default_graph_version' => 'v2.4',\n\t\t 'default_access_token' => 'CAACDBA17B90BAKI0aOXR1vF5zDtZCOKPbWSXopnvvNpBTHZARXVhUVrZBAXn4CB1ZBgsyk13ZA38uZAWoffwchukfajiIOG7cYrNEEAm0CdlHgwDRWeBuD0OZCfT6PB6U2vsE3O45jTgx0YTc24TXEqyZC1ZBIjc9GxD3aSv6WAyIWsZCpAcbnxYPNCdL389FxaRsZD', // optional\n\t\t]);\t \n\t\t\t \n\ttry {\n\t $response = $fb->get('/me?fields=id,name,email');\n\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t echo 'Graph returned an error: ' . $e->getMessage();\n\t exit;\n\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t exit;\n\t}\n\n\t\n\t$me = $response->getGraphUser();\n\t$name = $me['name'];\n\t$email = $me['email'];\n\t$u_name = preg_replace('/@.*$/', '', $me['email']);\n\t$user = new User();\n\t$user->name \t\t\t\t= $name ;\n\t$user->type \t\t\t\t= 'general';\n\t$user->register_type \t\t= 'facebook';\n\t$user->username \t\t\t= $u_name;\t\t\t\n\t$user->email \t\t\t\t= $email;\n\t$user->password \t\t\t= bcrypt($u_name);\n\t$user->save();\n\t\n\t$lastInsertedId= $user->id; \n\t\n\t$profile = new Profile();\n\t$profile = $user->profile()->save($profile);\t\t\t\n\t$credentials = array(\n\t\t'email' => $email,\n\t\t'password' => $u_name\n\t);\n\n\tif (Auth::attempt($credentials)) {\n\t\t\t//return Redirect::to('home');\n\t\t\treturn redirect()->intended('home');\n\t}\n\n\t\n\n\t//echo '<pre>'; print_r($new_name);\n\t//echo 'Logged in as ' . $me['email'];\t \n\t \n\t \n\t }", "protected static function getConfiguredApps() {}", "public function getAppId()\n {\n }", "function app($name = null)\n {\n return null === $name ? App::make('app') : App::make($name);\n }", "protected function setUpDatabase($app)\n {\n $app['db']->connection()->getSchemaBuilder()->create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('email');\n $table->string('avatar');\n });\n include_once __DIR__.'/../database/migrations/create_social_providers_table.php.stub';\n\n (new \\CreateSocialProvidersTable())->up();\n\n User::create(['email' => $this->userEmail, 'avatar' => '']);\n $app[config('social-auth.models.social')]->create(['slug' => 'facebook', 'label' => 'Facebook']);\n $app[config('social-auth.models.social')]->create(['slug' => 'google', 'label' => 'Google+']);\n }", "protected function loadTwoFactorApp(string $appId) {\n\t\tif (!OC_App::isAppLoaded($appId)) {\n\t\t\tOC_App::loadApp($appId);\n\t\t}\n\t}", "function facebook_enabled()\r\n{\r\n\tglobal $settings;\r\n\t\r\n\treturn !empty($settings['facebook_app_id']) && !empty($settings['facebook_app_secret']);\r\n}", "function setAppId($value)\n {\n $this->_props['AppId'] = $value;\n }", "public function setApp($app)\n {\n $this->app = $app;\n }", "public function setAppName($name)\n\t{\n\t\t$this->_appName = $name;\n\t}", "public function init()\n\t\t{\n\t\t\t\t$fb_session = new Container('fbloginbase');\t\t\n\t\t\t\t$uId = $fb_session->offsetGet('uid'); \n\t\t\t\tif(!$uId)\n\t\t\t\treturn $this->redirect()->toRoute('application', array('controller' => 'index', 'action'=>'index'));\n\t\t}", "public function init($start = true) {\n App::import('Vendor', 'Facebook', array('file' => 'facebook' . DS .'facebook.php'));\n $this->facebook = new Facebook(array(\n 'appId' => $this->settings['appId'],\n 'secret' => $this->settings['secret'],\n ));\n \n if ($start) {\n $user = $this->facebook->getUser();\n if ($user) {\n $this->me = $this->api('/me');\n $this->uid = $user;\n\n $this->controller->set('facebookSession', $this->session);\n $this->controller->set('me', $this->me);\n } else {\n $this->_authRedirect();\n }\n }\n }", "public function getAppId(): string;", "public function facebook()\n {\n return $this->auth('Facebook');\n }", "final private function __construct(){\n\t\tself::$graph=new Facebook(array(\n\t\t\t\t\t'appId'=>self::$config['appId'],\n\t\t\t\t\t'secret'=>self::$config['secret'],\n\t\t\t\t\t'cookie'=>self::$config['cookie'],\n\t\t\t\t\t'domain'=>self::$config['domain'],\n\t\t\t\t\t'fileUpload'=>self::$config['fileUpload'],\n\t\t\t\t));\n\t}", "function register_facebook( $wp_customize ) {\n\t// Facebook section\n\t$wp_customize->add_section( 'facebook', array(\n\t\t'title' => esc_html__( 'Facebook', 'phoenixdigi' ),\n\t\t'priority' => 600,\n\t) );\n\n\t// Facebook SDK JS.\n\t$wp_customize->add_setting( 'include_fb_sdk_js' , array(\n\t\t'default' => pdvn_get_option_default( 'include_fb_sdk_js' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'include_fb_sdk_js', array(\n\t\t'type' => 'checkbox',\n\t\t'section' => 'facebook',\n\t\t'label' => esc_html__( 'Nhúng Facebook SDK Js?', 'phoenixdigi' ),\n\t) );\n\n\t// Facebook App ID.\n\t$wp_customize->add_setting( 'facebook_app_id' , array(\n\t\t'default' => pdvn_get_option_default( 'facebook_app_id' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'facebook_app_id', array(\n\t\t'type' => 'text',\n\t\t'section' => 'facebook',\n\t\t'label' => esc_html__( 'Facebook App ID', 'phoenixdigi' ),\n\t) );\n\n\t// Facebook Language.\n\t$wp_customize->add_setting( 'fb_language', array(\n\t\t'default' => pdvn_get_option_default( 'fb_language' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'fb_language', array(\n\t\t'type' => 'select',\n\t\t'section' => 'facebook',\n\t\t'label' => esc_html__( 'Sử dụng ngôn ngữ Facebook', 'phoenixdigi' ),\n\t\t'choices' => array(\n\t\t\t'vi_VN' => esc_html__( 'Tiếng Việt', 'phoenixdigi' ),\n\t\t\t'en_US' => esc_html__( 'English', 'phoenixdigi' ),\n\t\t),\n\t) );\n}", "public function familyFacebook () {\n }", "public function getFacebookApplicationConfigurationOnly(ContainerBuilder $container);", "function index()\n {\n // TODO: put this into the model as it is data handling\n // Create our Application instance (replace this with your appId and secret).\n $facebook = new Facebook(array(\n 'appId' => FACEBOOK_LOGIN_APP_ID,\n 'secret' => FACEBOOK_LOGIN_APP_SECRET,\n ));\n\n $this->view->facebook_login_url = $facebook->getLoginUrl(array(\n 'redirect_uri' => URL . 'login/loginWithFacebook'\n ));\n\n // show the view\n $this->view->render('login/index');\n }", "public function setAppId($val)\n {\n $this->_propDict[\"appId\"] = $val;\n return $this;\n }", "protected static function _requireFacebookApi(){\n\t\trequire_once static::_getApiPath();\n\t}", "function ghactivity_app_settings_callback() {\n\techo '<p>';\n\tprintf(\n\t\t__( 'To use the plugin, you will need to create a new personal access token on GitHub first. <a href=\"%1$s\">click here</a> to create a token. You only need to check the first \"repo\" checkbox.', 'ghactivity' ),\n\t\tesc_url( 'https://github.com/settings/tokens/new' )\n\t);\n\techo '<br/>';\n\t_e( 'Once you created your app, copy the access token value below. You will also want to enter your GitHub username.', 'ghactivity' );\n\techo '</p>';\n}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\tif (ACTION == 'facebook_page')\n\t\t{\n\t\t\t$this->baseURL = THIS_URL . \"/podhawk/custom/plugins/facebook_plugin/index.php\";\n\t\t}\n\t\telseif (ACTION == 'facebook_apptab')\n\t\t{\n\t\t\t$this->baseURL = 'apptab.php';\n\t\t}\n\t}", "protected function __construct() \n {\n include Kohana::find_file('vendor', 'facebook');\n\n // Load configuration \"config/facebook\"\n $this->config = Kohana::$config->load('facebook');\n\n // Create new Facebook object\n $this->fb = new Facebook(array(\n 'appId' => $this->config->appId,\n 'secret' => $this->config->secret,\n 'cookie' => $this->config->cookie,\n 'session_type' => $this->config->session_type,\n ));\n\n try {\n $this->me = $this->fb->api('/' . $this->fb->getUser(), 'GET');\n } catch (FacebookApiException $e) {\n // Do nothing.\n }\n }", "function insert_fb_in_head()\r\n{\r\n global $post;\r\n if (!is_singular()) //if it is not a post or a page\r\n return;\r\n\r\n if ($excerpt = $post->post_excerpt)\r\n {\r\n $excerpt = strip_tags($post->post_excerpt);\r\n }\r\n else\r\n {\r\n $excerpt = get_bloginfo('description');\r\n }\r\n\r\n echo '<meta property=\"fb:app_id\" content=\"YOUR APPID\"/>'; //<-- this is optional\r\n echo '<meta property=\"og:title\" content=\"' . get_the_title() . '\"/>';\r\n echo '<meta property=\"og:description\" content=\"' . $excerpt . '\"/>';\r\n echo '<meta property=\"og:type\" content=\"article\"/>';\r\n echo '<meta property=\"og:url\" content=\"' . get_permalink() . '\"/>';\r\n echo '<meta property=\"og:site_name\" content=\"' . get_bloginfo() . '\"/>';\r\n\r\n echo '<meta name=\"twitter:title\" content=\"' . get_the_title() . '\"/>';\r\n echo '<meta name=\"twitter:card\" content=\"summary\" />';\r\n echo '<meta name=\"twitter:description\" content=\"' . $excerpt . '\" />';\r\n echo '<meta name=\"twitter:url\" content=\"' . get_permalink() . '\"/>';\r\n\r\n if (!has_post_thumbnail($post->ID))\r\n {\r\n //the post does not have featured image, use a default image\r\n $default_image = \"https://www.absolutefencinggear.com/shopping/images/Not_available.jpg\"; //<--replace this with a default image on your server\r\n echo '<meta property=\"og:image\" content=\"' . $default_image . '\"/>';\r\n echo '<meta name=\"twitter:image\" content=\"' . $default_image . '\"/>';\r\n }\r\n else\r\n {\r\n $thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium');\r\n echo '<meta property=\"og:image\" content=\"' . esc_attr($thumbnail_src[0]) . '\"/>';\r\n echo '<meta name=\"twitter:image\" content=\"' . esc_attr($thumbnail_src[0]) . '\"/>';\r\n }\r\n}", "static public function CreateApp($app_name, $init=true) {\r\n \t$path = TII_PATH_ROOT._.'apps'._.strtolower($app_name)._.'application.php';\r\n\t\tif (! file_exists($path)) throw new Exception (Tii::Out('Application \"%s\" could not be found at: %s', $app_name, $path));\r\n \t\r\n\t\tinclude $path;\r\n\t\t\r\n\t\tif (! class_exists($app_name)) throw new Exception(Tii::Out('Application class for \"%s\" does not exist.',$app_name));\r\n\t\t\r\n\t\t\r\n self::$_apps[] = self::$_App = new $app_name();\r\n \r\n if($init) self::$_App->Init();\r\n\t\t\r\n\t\treturn self::$_App;\r\n }", "function jfb_admin_page()\r\r\n{\r\r\n global $jfb_name, $jfb_version;\r\r\n global $opt_jfb_api_key, $opt_jfb_api_sec, $opt_jfb_email_to, $opt_jfb_delay_redir, $jfb_homepage;\r\r\n global $opt_jfb_ask_perms, $opt_jfb_req_perms, $opt_jfb_hide_button, $opt_jfb_mod_done;\r\r\n global $opt_jfb_buddypress, $opt_jfb_valid, $opt_jfb_fulllogerr;\r\r\n ?>\r\r\n <div class=\"wrap\">\r\r\n <h2>WP-FB AutoConnect Options</h2>\r\r\n <?php\r\r\n \r\r\n //Show a warning if they're using a naughty other plugin\r\r\n if( class_exists('Facebook') )\r\r\n {\r\r\n jfb_auth($jfb_name, $jfb_version, 3, \"API WARNING!! Facebook already detected.\" );\r\r\n ?><div class=\"error\"><p><strong>Warning:</strong> Another plugin has included the Facebook API throughout all of Wordpress. I suggest you contact that plugin's author and ask them to include it only in pages where it's actually needed.<br /><br />Things may work fine as-is, but *if* the API version included by the other plugin is older than the one required by WP-FB AutoConnect, it's possible that the login process could fail.</p></div><?php\r\r\n }\r\r\n \r\r\n //Update options\r\r\n if( isset($_POST['main_opts_updated']) )\r\r\n {\r\r\n //When saving the main options, make sure the key and secret are valid.\r\r\n if( !class_exists('Facebook') )\r\r\n {\r\r\n if(version_compare('5', PHP_VERSION, \"<=\")) require_once('facebook-platform/validate_php5.php');\r\r\n else require_once('facebook-platform/validate_php4.php');\r\r\n }\r\r\n $fbValid = jfb_validate_key($_POST[$opt_jfb_api_key], $_POST[$opt_jfb_api_sec]);\r\r\n if( $fbValid ):\r\r\n if( method_exists($fbValid->api_client, 'admin_getAppProperties') )\r\r\n {\r\r\n $appInfo = $fbValid->api_client->admin_getAppProperties(array('app_id', 'application_name'));\r\r\n if( is_array($appInfo) )\r\r\n {\r\r\n $message = '\"' . $appInfo['application_name'] . '\" (ID ' . sprintf(\"%.0f\", $appInfo['app_id']) . ')';\r\r\n }\r\r\n else if( $appInfo->app_id )\r\r\n { //Why does this happen? Presumably because another plugin includes a different version of the API that uses objects instead of arrays\r\r\n $message = '\"' . $appInfo->application_name . '\" (ID ' . sprintf(\"%.0f\", $appInfo->app_id) . ')';\r\r\n jfb_auth($jfb_name, $jfb_version, 3, \"BUG Object instead of array (appInfo = \" . print_r($appInfo, true) . \")\" );\r\r\n }\r\r\n else\r\r\n {\r\r\n $message = \"Key \" . $_POST[$opt_jfb_api_key];\r\r\n jfb_auth($jfb_name, $jfb_version, 3, \"BUG Unknown instead of array (getAppProperties returns: \" . print_r($appInfo, true) . \")\" );\r\r\n ?><div class=\"error\"><p><strong>Warning:</strong> Facebook failed to retrieve your Application's properties! The plugin is very unlikely to work until it's fixed.<br /><br />I've thus far not been able to determine the exact cause of this extremely rare problem, but my best guess is that you've made a mistake somewhere in your configuration. If you see this warning and figure out how to fix it, please let me know <b><a href=\"<?php echo $jfb_homepage ?>\">here</a></b> so I can clarify my setup instructions.</p></div><?php\r\r\n }\r\r\n }\r\r\n else\r\r\n {\r\r\n $message = \"Key \" . $_POST[$opt_jfb_api_key];\r\r\n jfb_auth($jfb_name, $jfb_version, 3, \"BUG Undefined (no getAppProperties())\");\r\r\n }\r\r\n update_option( $opt_jfb_valid, 1 );\r\r\n if( get_option($opt_jfb_api_key) != $_POST[$opt_jfb_api_key] )\r\r\n jfb_auth($jfb_name, $jfb_version, 2, \"SET: \" . $message );\r\r\n ?><div class=\"updated\"><p><strong>Main Options saved for <?php echo $message ?></strong></p></div><?php\r\r\n else:\r\r\n update_option( $opt_jfb_valid, 0 );\r\r\n $message = \"ERROR: Facebook could not validate your session key and secret! Are you sure you've entered them correctly?\";\r\r\n jfb_auth($jfb_name, $jfb_version, 3, $message );\r\r\n ?><div class=\"updated\"><p><?php echo $message ?></p></div><?php\r\r\n endif;\r\r\n \r\r\n //We'll update the options either way - but if jfb_valid isn't set, the plugin won't show a Facebook button.\r\r\n update_option( $opt_jfb_api_key, $_POST[$opt_jfb_api_key] );\r\r\n update_option( $opt_jfb_api_sec, $_POST[$opt_jfb_api_sec] );\r\r\n update_option( $opt_jfb_ask_perms, $_POST[$opt_jfb_ask_perms] );\r\r\n update_option( $opt_jfb_req_perms, $_POST[$opt_jfb_req_perms] );\r\r\n if( $_POST[$opt_jfb_email_to] ) update_option( $opt_jfb_email_to, get_bloginfo('admin_email') );\r\r\n else update_option( $opt_jfb_email_to, 0 );\r\r\n }\r\r\n if( isset($_POST['debug_opts_updated']) )\r\r\n {\r\r\n update_option( $opt_jfb_buddypress, !$_POST[$opt_jfb_buddypress] );\r\r\n update_option( $opt_jfb_delay_redir, $_POST[$opt_jfb_delay_redir] );\r\r\n update_option( $opt_jfb_hide_button, $_POST[$opt_jfb_hide_button] );\r\r\n update_option( $opt_jfb_fulllogerr, $_POST[$opt_jfb_fulllogerr] ); \r\r\n ?><div class=\"updated\"><p><strong><?php _e('Debug Options saved.', 'mt_trans_domain' ); ?></strong></p></div><?php\r\r\n }\r\r\n if( isset($_POST['mod_rewrite_update']) )\r\r\n {\r\r\n add_action('generate_rewrite_rules', 'jfb_add_rewrites');\r\r\n add_filter('mod_rewrite_rules', 'jfb_fix_rewrites');\r\r\n global $wp_rewrite;\r\r\n $wp_rewrite->flush_rules();\r\r\n update_option( $opt_jfb_mod_done, true );\r\r\n ?><div class=\"updated\"><p><strong><?php _e('HTACCESS Updated.', 'mt_trans_domain' ); ?></strong></p></div><?php \r\r\n }\r\r\n if( isset($_POST['remove_all_settings']) )\r\r\n {\r\r\n delete_option($opt_jfb_api_key);\r\r\n delete_option($opt_jfb_api_sec);\r\r\n delete_option($opt_jfb_email_to);\r\r\n delete_option($opt_jfb_delay_redir);\r\r\n delete_option($opt_jfb_ask_perms);\r\r\n delete_option($opt_jfb_req_perms);\r\r\n delete_option($opt_jfb_hide_button);\r\r\n delete_option($opt_jfb_mod_done);\r\r\n delete_option($opt_jfb_valid);\r\r\n delete_option($opt_jfb_buddypress);\r\r\n delete_option($opt_jfb_fulllogerr);\r\r\n ?><div class=\"updated\"><p><strong><?php _e('All plugin settings have been cleared.' ); ?></strong></p></div><?php\r\r\n }\r\r\n ?>\r\r\n \r\r\n To allow your users to login with their Facebook accounts, you must first setup a Facebook Application for your website:<br /><br />\r\r\n <ol>\r\r\n <li>Visit <a href=\"http://www.facebook.com/developers/createapp.php\" target=\"_lnk\">www.facebook.com/developers/createapp.php</a></li>\r\r\n <li>Type in a name (i.e. the name of your website). This is the name your users will see on the Facebook login popup.</li>\r\r\n <li>Copy the API Key and Secret to the boxes below.</li>\r\r\n <li>Click the \"Connect\" tab (back on Facebook) and under \"Connect URL\" enter the URL to your website (with a trailing slash). Note: http://example.com/ and http://www.example.com/ are <i>not</i> the same.</li>\r\r\n <li>Click the \"Advanced\" tab and enter your site's domain under \"Email Domain\" (i.e. example.com). This is only required if you want to access your users' email addresses (optional).</li>\r\r\n <li>Click \"Save Changes\" (on Facebook).</li>\r\r\n <li>Click \"Save\" below.</li>\r\r\n </ol>\r\r\n <br />That's it! Now you can add this plugin's <a href=\"<?php echo admin_url('widgets.php')?>\">sidebar widget</a>, or if you're using BuddyPress, a Facebook button will be automatically added to its built-in login panel.<br /><br />\r\r\n For more complete documentation and help, visit the <a href=\"<?php echo $jfb_homepage?>\">plugin homepage</a>.<br />\r\r\n \r\r\n <br />\r\r\n <hr />\r\r\n \r\r\n <h3>Development</h3>\r\r\n Many hours have gone into making this plugin as versatile and easy to use as possible, far beyond my own personal needs. Although I offer it to you freely, please keep in mind that each hour spent extending and supporting it was an hour that could've also gone towards income-generating work. If you find it useful, a small donation would be greatly appreciated :)\r\r\n <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\r\r\n <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" />\r\r\n <input type=\"hidden\" name=\"hosted_button_id\" value=\"T88Y2AZ53836U\" />\r\r\n <input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\" />\r\r\n <img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\" />\r\r\n </form>\r\r\n <hr />\r\r\n \r\r\n <h3>Main Options</h3>\r\r\n <form name=\"formMainOptions\" method=\"post\" action=\"\">\r\r\n <b>Facebook:</b><br />\r\r\n <input type=\"text\" size=\"40\" name=\"<?php echo $opt_jfb_api_key?>\" value=\"<?php echo get_option($opt_jfb_api_key) ?>\" /> API Key<br />\r\r\n <input type=\"text\" size=\"40\" name=\"<?php echo $opt_jfb_api_sec?>\" value=\"<?php echo get_option($opt_jfb_api_sec) ?>\" /> API Secret<br /><br />\r\r\n <br /><b>E-Mail:</b><br />\r\r\n <input type=\"checkbox\" name=\"<?php echo $opt_jfb_ask_perms?>\" value=\"1\" <?php echo get_option($opt_jfb_ask_perms)?'checked=\"checked\"':''?> /> ASK the user for permission to get their email address<br />\r\r\n <input type=\"checkbox\" name=\"<?php echo $opt_jfb_req_perms?>\" value=\"1\" <?php echo get_option($opt_jfb_req_perms)?'checked=\"checked\"':''?> /> REQUIRE user for permission to get their email address<br />\r\r\n <br /><b>Notification:</b><br />\r\r\n <input type=\"checkbox\" name=\"<?php echo $opt_jfb_email_to?>\" value=\"1\" <?php echo get_option($opt_jfb_email_to)?'checked=\"checked\"':''?> /> Send all event logs to <i><?php echo get_bloginfo('admin_email')?></i><br />\r\r\n <input type=\"hidden\" name=\"main_opts_updated\" value=\"1\" />\r\r\n <div class=\"submit\"><input type=\"submit\" name=\"Submit\" value=\"Save\" /></div>\r\r\n </form>\r\r\n <hr />\r\r\n \r\r\n <h4>Mod Rewrite Rules</h4>\r\r\n <?php\r\r\n if (get_option($opt_jfb_mod_done))\r\r\n echo \"It looks like your htaccess has already been updated. If you're having trouble with autologin links, make sure the file is writable and click the Update button again.\";\r\r\n else\r\r\n echo \"In order to use this plugin's autologin shortcut links (i.e. www.example.com/autologin/5), your .htaccess file needs to be updated. Click the button below to update it now.<br /><br />Note that this is an advanced feature and won't be needed by most users; see the plugin's homepage for documentation.\"\r\r\n ?>\r\r\n <form name=\"formMainOptions\" method=\"post\" action=\"\">\r\r\n <input type=\"hidden\" name=\"mod_rewrite_update\" value=\"1\" />\r\r\n <div class=\"submit\"><input type=\"submit\" name=\"Submit\" value=\"Update Now\" /></div>\r\r\n </form>\r\r\n <hr />\r\r\n \r\r\n <h4>Debug Options</h4>\r\r\n <form name=\"formDebugOptions\" method=\"post\" action=\"\">\r\r\n <input type=\"checkbox\" name=\"<?php echo $opt_jfb_delay_redir?>\" value=\"1\" <?php echo get_option($opt_jfb_delay_redir)?'checked=\"checked\"':''?> /> Delay redirect after login (Not for production sites!)<br />\r\r\n <input type=\"checkbox\" name=\"<?php echo $opt_jfb_hide_button?>\" value=\"1\" <?php echo get_option($opt_jfb_hide_button)?'checked=\"checked\"':''?> /> Hide Facebook Button<br />\r\r\n <input type=\"checkbox\" name=\"<?php echo $opt_jfb_buddypress?>\" value=\"1\" <?php echo !get_option($opt_jfb_buddypress)?'checked=\"checked\"':''?> /> Disable BuddyPress filters<br />\r\r\n <input type=\"checkbox\" name=\"<?php echo $opt_jfb_fulllogerr?>\" value=\"1\" <?php echo get_option($opt_jfb_fulllogerr)?'checked=\"checked\"':''?> /> Show full log on error<br /> \r\r\n <input type=\"hidden\" name=\"debug_opts_updated\" value=\"1\" />\r\r\n <div class=\"submit\"><input type=\"submit\" name=\"Submit\" value=\"Save\" /></div>\r\r\n </form>\r\r\n <hr />\r\r\n \r\r\n <h4>Delete All Plugin Options</h4>\r\r\n <form name=\"formDebugOptions\" method=\"post\" action=\"\">\r\r\n <input type=\"hidden\" name=\"remove_all_settings\" value=\"1\" />\r\r\n <div class=\"submit\"><input type=\"submit\" name=\"Submit\" value=\"Delete\" /></div>\r\r\n </form>\r\r\n \r\r\n </div><?php\r\r\n}", "public function getAppId()\n {\n if (array_key_exists(\"appId\", $this->_propDict)) {\n return $this->_propDict[\"appId\"];\n } else {\n return null;\n }\n }", "public function fb()\n\t\t{\n\t\t$facebook = new Facebook(array(\n\t\t 'appId' => $this->config->item('App_ID'),\n\t\t 'secret' => $this->config->item('App_Secret'),\n\t\t 'cookie' => true\n\t\t));\n\t\t\n\t\tif(isset($_GET['logout'])) \n\t\t{\n\t\t\t$url = 'https://www.facebook.com/logout.php?next=' . urlencode('http://demo.phpgang.com/facebook_login_graph_api/') .\n\t\t\t '&access_token='.$_GET['tocken'];\n\t\t\tsession_destroy();\n\t\t\theader('Location: '.$url);\n\t\t}\n\t\tif(isset($_GET['fbTrue']))\n\t\t{\n\t\t\t$token_url = \"https://graph.facebook.com/oauth/access_token?\"\n\t\t\t . \"client_id=\".$this->config->item('App_ID').\"&redirect_uri=\" . urlencode($this->config->item('callback_url'))\n\t\t\t . \"&client_secret=\".$this->config->item('App_Secret').\"&code=\" . $_GET['code']; \n\t\t\n\t\t\t $response = file_get_contents($token_url);\n\t\t\t $params = null;\n\t\t\t parse_str($response, $params);\n\t\t\n\t\t\t $graph_url = \"https://graph.facebook.com/me?access_token=\" \n\t\t\t . $params['access_token'];\n\t\t\n\t\t\t $user = json_decode(file_get_contents($graph_url));\n\t\t\t $extra = \"<a href='index.php?logout=1&tocken=\".$params['access_token'].\"'>Logout</a><br>\"; \n\t\t\t \n\t\t\t// $content = $user;\n\t\t\t $content=array();\n\t\t\t $content['id'] = $user->id;\n\t\t\t $content['email'] = $user->email;\n\t\t\t $content['first_name'] = $user->first_name;\n\t\t\t $content['gender'] = $user->gender;\n\t\t\t $content['last_name'] = $user->last_name;\n\t\t\t $content['locale'] = $user->locale;\n\t\t\t $content['name'] = $user->name;\n\t\t\t $content = $this->session->set_userdata(\"fb_data\",$content);\n\t\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$content = '<a href=\"https://www.facebook.com/dialog/oauth?client_id='.$this->config->item('App_ID').'&redirect_uri='.$this->config->item('callback_url').'&scope=email,user_likes,publish_stream\"><img src=\"'.base_url().'images/login_facebook.jpg\" alt=\"Sign in with Facebook\"/></a>';\n\t\t}\n\t \n\t\t $data[\"facebook_data\"] = $content;\n\t\t $data[\"item\"] = \"Fb login\";\n\t\t $data[\"master_title\"] = \"Fb login | \".$this->config->item('sitename');\n\t\t $data[\"master_body\"] = \"register\";\n\t\t debug($data);die;\n\t\t $this->load->theme('home_layout',$data);\n\t\t}", "public function bootstrap($app);", "function loginWithFacebook()\n {\n /*\n // Create our Application instance (replace this with your appId and secret).\n $facebook = new Facebook(array(\n 'appId' => FACEBOOK_LOGIN_APP_ID,\n 'secret' => FACEBOOK_LOGIN_APP_SECRET,\n ));\n\n $this->view->facebook_login_url = $facebook->getLoginUrl(array(\n 'redirect_uri' => URL . 'login/loginWithFacebook'\n ));\n // TODO: this is duplicate !?!??!\n */\n\n // run the login() method in the login-model, put the result in $login_successful (true or false)\n $login_model = $this->loadModel('Login');\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = $login_model->loginWithFacebook();\n\n // check login status\n if ($login_successful) {\n // if YES, then move user to dashboard/index\n // please note: this is a browser-redirection, not a rendered view\n header('location: ' . URL . 'dashboard/index');\n } else {\n // if NO, then show the login/index (login form) again\n $this->view->render('login/index');\n }\n }", "public function facebook()\r\n\t{\r\n\t\treturn (bool) Mage::getStoreConfig('ec/facebook/enable');\r\n\t}", "public function setUseAppName($use_appname) \n \t{\n \t\t$this->use_appname = $use_appname;\n \t}", "function register()\n {\n // Create our Application instance (necessary to request Facebook data)\n $facebook = new Facebook(array(\n 'appId' => FACEBOOK_LOGIN_APP_ID,\n 'secret' => FACEBOOK_LOGIN_APP_SECRET,\n ));\n\n $redirect_url_after_facebook_auth = URL . 'login/registerwithfacebook';\n // hard to explain, read the Facebook PHP SDK for more\n // basically, when the user clicks the Facebook register button, the following arguments will be passed\n // to Facebook: In this case a request for getting the email (not shown by default btw) and the URL\n // when facebook will send the user after he/she has authenticated\n $this->view->facebook_login_url = $facebook->getLoginUrl(array(\n 'scope' => 'email',\n 'redirect_uri' => $redirect_url_after_facebook_auth\n ));\n\n $this->view->render('login/register');\n }", "function authFacebook($next='',$cancel_url='')\n {\n global $global;\n\n require_once dirname(__FILE__).'/lib/fbapi/facebook.php';\n\n //$facebook=new Facebook($api_key,$secret);\n $facebook = new Facebook(array(\n 'appId' => $global->app_id,\n 'secret' => $global->app_secret,\n 'cookie' => true));\n\n $global->facebook=$facebook;\n $session = $facebook->getSession();\n\n try\n {\n $global->fbme = $facebook->api('/me'); \n } \n catch (FacebookApiException $e) \n {\n $global->fbme = false;\n error_log($e);\n //echo $e->getMessage();\n } \n\n if ($global->fbme == false) \n {\n $params['canvas'] =1;\n $params['fbconnect'] = 0;\n $params['req_perms'] = 'publish_stream, email';\n\n //$params['next'] = $global->link->createLink('index.php',array('instid'=>$global->instid));\n //'cancel_url' => $appurl \n\n $login_url = $facebook->getLoginUrl($params);\n\n echo '<script>top.location=\"' . $login_url . '\";</script>';\n //header(\"Location:$login_url\");\n exit();\n }\n\n return true;\n }", "public function setFacebook($facebook)\n {\n if (substr($facebook, 0, 1) !== '/') {\n throw new \\InvalidArgumentException('Facebook name must start with /', 1357530471);\n }\n\n $this->facebook = $facebook;\n }", "function culturefeed_search_ui_add_facebook_share() {\n\n $fb_app_id = variable_get('culturefeed_search_ui_fb_app_id', '');\n if (!empty($fb_app_id)) {\n drupal_add_js(drupal_get_path('module', 'culturefeed') . '/js/facebook_share.js');\n drupal_add_js(array('culturefeed' => array('fbAppId' => $fb_app_id)), 'setting');\n }\n\n}", "protected function __construct()\n\t{\n\t\t// Load config\n\t\t$this->_config = Kohana::$config->load('facebook');\n\t\t\n\t\tinclude Kohana::find_file('vendor', 'facebook/facebook');\t\t\n\t\t// Create Facebook object\n\t\t$this->_facebook = new Facebook(\n\t\t\tarray(\n\t\t\t\t'appId' => $this->_config->get('appId'),\n\t\t\t\t'secret' => $this->_config->get('secret'),\n\t\t\t\t'cookie' => $this->_config->get('cookie')\n\t\t\t)\n\t\t);\n\n\t\ttry\n\t\t{\n\t\t\t$this->_me = $this->_facebook->api('/me');\n\t\t\t$this->_user = $this->_facebook->getUser();\n\t\t}\n\t\tcatch (FacebookApiException $e)\n\t\t{\n\t\t\t// Do nothing.\n\t\t}\n\t\t\n\t\t$this->login_url = '';\n\t}", "function getFbInstance() {\n static $instance;\n if ( ! isset($instance)) {\n // load vendor files\n App::import('Vendor', 'facebook/src/facebook');\n $settings = array(\n 'appId' => Configure::read('fbAppId'),\n 'secret' => Configure::read('fbAppSecret'), \n 'cookie' => true\n );\n $instance = new Facebook($settings);\n }\n return $instance;\n }", "public function facebook ()\n {\n return Socialite::driver('facebook')->redirect();\n\n }", "function create_sp_app( $name, $sysuserid, $runtime, $domains, $wordpress ) {\n\ttry {\n\t\t$app = sp()->app_create( $name, $sysuserid, $runtime, $domains, $wordpress );\n\t\twait_for_serverpilot_action( $app->actionid );\n\t\treturn $app;\n\t} catch ( \\ServerPilotException $e ) {\n\t\treturn new \\WP_Error( $e->getCode(), $e->getMessage() );\n\t}\n}", "public function facebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function set_appname()\n\t{\n\t\t$appname = (string) ee()->config->item('newrelic_app_name');\n\n\t\t// -------------------------------------------\n\t\t//\tHidden Configuration Variable\n\t\t//\t- newrelic_app_name => Change application name that appears in\n\t\t//\t the New Relic dashboard\n\t\t// -------------------------------------------*/\n\t\tif ( ! empty($appname))\n\t\t{\n\t\t\t$appname .= ' - ';\n\t\t}\n\n\t\t// -------------------------------------------\n\t\t//\tHidden Configuration Variable\n\t\t//\t- newrelic_include_version_number => Whether or not to include the version\n\t\t// number with the application name\n\t\t// -------------------------------------------*/\n\t\t$version = (ee()->config->item('newrelic_include_version_number') == 'y') ? ' v'.APP_VER : '';\n\n\t\tnewrelic_set_appname($appname.APP_NAME.$version);\n\t}", "public function testFactory()\n {\n $factory = new FaceBookClientFactory('app_id', 'app_secret', 'v2.9');\n\n Assert::assertInstanceOf(Facebook::class, $factory->getFacebookClient());\n }", "public function action_fb() {\n\t\n\t$fb = Facebook::instance();\n\n\n\tif ($fb->check_login() == false) {\n\t //user has not yet authenticated via facebook\n\t $fbl_params = array(\"scope\" => \"email\");\n\t $loginurl = $fb->getLoginUrl($fbl_params);\n\t Response::redirect($loginurl) and die();\n\t} else {\n\t //facebook authentication successful.\n\t $user_profile = $fb->api('/me');\n\t //and we know the user's email\n\t $fb_mail = $user_profile[\"email\"];\n\n\t //and the user's facebook ID\n\t $fb_id = $user_profile[\"id\"];\n\n\t $auth = Auth::instance();\n\n\t //simpleauth does not have a method for \n\t //checking if username is taken\n\t //hence we do a direct DB select.\n\t $fb_sql_user = DB::select(\"id\")\n\t\t ->from(\"users\")\n\t\t ->where(\"username\", \"=\", \"FB@\" . $fb_mail)\n\t\t ->execute()\n\t\t ->as_array();\n\n\t if (count($fb_sql_user) == 0) {\n\t\t//we don't have the user in the local DB yet\n\t\t//let us create a local user\n\t\t//coining a specific username,\n\t\t//assigning a random password\t\t\n\t\t$user_id = $auth->create_user(\"FB@\" . $fb_mail, hash(\"sha256\", mt_rand(0, mt_getrandmax())), $fb_mail, 1, array(\n\t\t \"facebook_id\" => $fb_id,\n\t\t \"verified\" => true)\n\t\t);\n\t } else {\n\t\t//we have the user. Let's log the user in\n\t\t$user_id = $fb_sql_user[0][\"id\"];\n\t }\n\n\t $auth->force_login($user_id);\n\t Response::redirect(\"/\");\n\t}\n }", "public function facebook()\n {\n return facebook()->login();\n }", "public static function create() {\n self::$appLoader = new AppLoader(self::DEFAULT_FOLDER);\n self::$appLoader->loadApps();\n }", "public function getOwnerApp();", "public function setApplicationName($app_name) \n\t{\n\t\t$this->application_name = $app_name;\n\t}", "static public function getDefaultApplicationName( )\n {\n return\n empty(self::$_defaultApplication)\n ? self::DEFAULT_APPLICATION\n : self::$_defaultApplication;\n }", "function getApplication();", "public static function instance($name = 'default', array $config = NULL)\n\t{\n\t\tif ( ! isset(FBAPI::$instances[$name]))\n\t\t{\n\t\t\tif ($config === NULL)\n\t\t\t{\n\t\t\t\t// Load the configuration for this database\n\t\t\t\t$config = Kohana::config('fbapi')->$name;\n\t\t\t}\n\n\t\t\tif ( ! isset($config['app_id']))\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('FBAPI Application Id not defined in :name configuration',\n\t\t\t\t\tarray(':name' => $name));\n\t\t\t}\n\n\t\t\t// Create the database connection instance\n\t\t\tnew FBAPI($name, $config);\n\t\t}\n\n\t\treturn FBAPI::$instances[$name];\n\t}", "public function bootstrap($app){ \n /**\n * Check when this application contain f2ngin module config\n */\n if($app->hasModule('f2ngin')){\n\n $module = $app->getModule('f2ngin');\n\n // Set alias for @f2ngin for easy use path \n Yii::setAlias(\"@f2ngin\",\"@vendor/johnitvn/yii2-f2ngin/src\");\n\n // Config internationalisation\n if (!isset(Yii::$app->get('i18n')->translations['user*'])) {\n Yii::$app->get('i18n')->translations['user*'] = [\n 'class' => PhpMessageSource::className(),\n 'basePath' => __DIR__ . '/messages',\n ];\n }\n\n // config for web application\n if ($app instanceof \\yii\\web\\Application) {\n $this->bootstrapWebApp($app,$module);\n }\n }\n\n\n // config for console application\n if ($app instanceof \\yii\\console\\Application) {\n $this->bootstrapConsoleApp($app);\n }\n\n }", "function GET_APP_ID(){\n return \"7d0df388-f064-48eb-9092-27fbbf0a438e\";\n}", "public abstract function getApplication();", "public function __construct($appId = null)\n {\n $this\n ->setAppId($appId);\n }", "public static function getNewApp()\r\n {\r\n return new App();\r\n }", "public function getApplication();", "public function getApplication();", "public function getApplication();", "public function getApplication();", "public function getApplication();" ]
[ "0.6366262", "0.6142396", "0.6097376", "0.60842925", "0.6034297", "0.591252", "0.5863162", "0.5761693", "0.57455254", "0.5712274", "0.5689433", "0.56876326", "0.5661608", "0.56552696", "0.5598725", "0.55864817", "0.5583034", "0.5568322", "0.55638903", "0.5550729", "0.55376476", "0.5531145", "0.55208504", "0.5517102", "0.5508919", "0.5496257", "0.54698324", "0.5462148", "0.5448918", "0.5443505", "0.5431296", "0.5405991", "0.53794116", "0.5375273", "0.53511244", "0.53475314", "0.5333842", "0.53329444", "0.5326273", "0.52805305", "0.5269", "0.5259438", "0.5241536", "0.5237652", "0.5228", "0.5215174", "0.5214182", "0.5206637", "0.51945573", "0.51889294", "0.5188093", "0.51815885", "0.51686573", "0.5161694", "0.51490587", "0.5145123", "0.51412916", "0.5131216", "0.5130079", "0.5128738", "0.512774", "0.51254416", "0.5117393", "0.51108783", "0.51072305", "0.51006573", "0.5098932", "0.5093132", "0.5073746", "0.5072272", "0.50707626", "0.5070308", "0.50669026", "0.50667816", "0.50644624", "0.5064326", "0.5062345", "0.5048982", "0.50435823", "0.50371796", "0.50344104", "0.50326496", "0.50319654", "0.50259674", "0.50088567", "0.50082266", "0.50038815", "0.49992853", "0.49900523", "0.49803537", "0.49777052", "0.49755964", "0.49747214", "0.4973247", "0.4972663", "0.49583212", "0.495404", "0.495404", "0.495404", "0.495404", "0.495404" ]
0.0
-1
Creates and returns an instance of Facebook if the Consumer key & secret are set.
public function getFacebook() { if($this->facebook) { return $this->facebook; } if($this->FacebookConsumerKey && $this->FacebookConsumerSecret) { return $this->facebook = new Facebook(array( "appId" => $this->FacebookConsumerKey, "secret" => $this->FacebookConsumerSecret )); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function facebook_instance()\r\n{\r\n\tglobal $settings;\r\n\t\r\n\treturn new Facebook(array(\r\n\t\t'appId' => $settings['facebook_app_id'],\r\n\t\t'secret' => $settings['facebook_app_secret'],\r\n\t));\r\n}", "public static function factory() \n {\n return new FacebookAuth();\n }", "function getFbInstance() {\n static $instance;\n if ( ! isset($instance)) {\n // load vendor files\n App::import('Vendor', 'facebook/src/facebook');\n $settings = array(\n 'appId' => Configure::read('fbAppId'),\n 'secret' => Configure::read('fbAppSecret'), \n 'cookie' => true\n );\n $instance = new Facebook($settings);\n }\n return $instance;\n }", "public function facebook()\n\t{\n\t\tif ( ! $this->_facebook)\n\t\t{\n\t\t\tKohana::load(Kohana::find_file('vendor/facebook-php-sdk', 'facebook'));\n\n\t\t\t$this->_facebook = new Facebook(array(\n\t\t\t\t'appId' => Kohana::$config->load('facebook.app_id'),\n\t\t\t\t'secret' => Kohana::$config->load('facebook.app_secret'),\n\t\t\t));\n\t\t}\n\n\t\treturn $this->_facebook;\n\t}", "protected function getFacebookApi(): Facebook\n {\n if (!$this->facebookApi) {\n /** @var FacebookDeveloperSettings $settings */\n $settings = FacebookDeveloperSettings::singleton();\n $this->facebookApi = new Facebook([\n 'app_id' => $settings->facebookAppId,\n 'app_secret' => $settings->facebookAppSecret,\n 'default_graph_version' => $settings->facebookApiVersion,\n ]);\n }\n return $this->facebookApi;\n }", "protected function initSdk() {\n\n $class_name = '\\Facebook\\Facebook';\n if (!class_exists($class_name)) {\n throw new SocialApiException(sprintf('The PHP SDK for Facebook could not be found. Class: %s.', $class_name));\n }\n /* @var \\Drupal\\social_auth_facebook\\Settings\\FacebookAuthSettings $settings */\n $settings = $this->settings;\n\n if ($this->validateConfig($settings)) {\n // All these settings are mandatory.\n $facebook_settings = [\n 'app_id' => $settings->getAppId(),\n 'app_secret' => $settings->getAppSecret(),\n 'default_graph_version' => 'v' . $settings->getGraphVersion(),\n 'persistent_data_handler' => $this->persistentDataHandler,\n 'http_client_handler' => $this->getHttpClient(),\n ];\n\n return new Facebook($facebook_settings);\n }\n\n return FALSE;\n }", "public static function getGraphAPIObject($use_cookie = true) {\r\n\t\treturn new Facebook(array(\r\n\t\t\t'appId' => Config::$third_party['facebook']['app_id'],\r\n\t\t\t'secret' => Config::$third_party['facebook']['app_secret']\r\n\t\t));\r\n\t}", "protected function __construct() \n {\n include Kohana::find_file('vendor', 'facebook');\n\n // Load configuration \"config/facebook\"\n $this->config = Kohana::$config->load('facebook');\n\n // Create new Facebook object\n $this->fb = new Facebook(array(\n 'appId' => $this->config->appId,\n 'secret' => $this->config->secret,\n 'cookie' => $this->config->cookie,\n 'session_type' => $this->config->session_type,\n ));\n\n try {\n $this->me = $this->fb->api('/' . $this->fb->getUser(), 'GET');\n } catch (FacebookApiException $e) {\n // Do nothing.\n }\n }", "public static function instance($name = 'default', array $config = NULL)\n\t{\n\t\tif ( ! isset(FBAPI::$instances[$name]))\n\t\t{\n\t\t\tif ($config === NULL)\n\t\t\t{\n\t\t\t\t// Load the configuration for this database\n\t\t\t\t$config = Kohana::config('fbapi')->$name;\n\t\t\t}\n\n\t\t\tif ( ! isset($config['app_id']))\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('FBAPI Application Id not defined in :name configuration',\n\t\t\t\t\tarray(':name' => $name));\n\t\t\t}\n\n\t\t\t// Create the database connection instance\n\t\t\tnew FBAPI($name, $config);\n\t\t}\n\n\t\treturn FBAPI::$instances[$name];\n\t}", "public function __construct(){\n\n $this->facebook = new Facebook(array(\n\n 'appId' => self::APP_ID,\n\n 'secret' => self::APP_SECRET,\n\n ));\n\n }", "public function __construct() {\n $this->fb = new Facebook([\n 'app_id' => Config::FB_APP_ID,\n 'app_secret' => Config::FB_APP_SECRET,\n 'default_graph_version' => Config::FB_DEFAULT_GRAPH_VERSION,\n ]);\n }", "private static function init_facebook() {\n // Facebook is a custom setup.\n $record = (object) [\n 'name' => 'Facebook',\n 'image' => 'https://facebookbrand.com/wp-content/uploads/2016/05/flogo_rgb_hex-brc-site-250.png',\n 'baseurl' => '',\n 'loginscopes' => 'public_profile email',\n 'loginscopesoffline' => 'public_profile email',\n 'showonloginpage' => true\n ];\n\n $issuer = new issuer(0, $record);\n return $issuer;\n }", "public function __construct()\n {\n $oConfig = oxRegistry::getConfig();\n\n $aFbConfig[\"appId\"] = $oConfig->getConfigParam(\"sFbAppId\");\n $aFbConfig[\"secret\"] = $oConfig->getConfigParam(\"sFbSecretKey\");\n $aFbConfig[\"cookie\"] = true;\n\n BaseFacebook::__construct($aFbConfig);\n }", "public static function instance($type = 'default', $config = array()){\n\t\tif(!isset(self::$instances[$type])OR!(self::$instances[$type] instanceof self)){\n\t\t\tself::$config=array_merge(/* Kohana::config('facebook') */ Kohana::$config->load('facebook')->as_array(), $config);\n\t\t\tself::$instances[$type]=new self();\n\t\t}\n\t\treturn self::$instances[$type];\n\t}", "public function getFaceBookObject() {\n if (is_object($this->object) == false) {\n $this->object = new \\Facebook(array(\n 'appId' => $this->settings['API']['appId'],\n 'secret' => $this->settings['API']['secret']\n ));\n }\n return $this->object;\n }", "private function __construct()\r\n\t{\t\t\r\n\t\t$this->m_fb = new Facebook(array(\r\n\t\t\t'appId' => '198517920178057',\r\n\t\t\t'secret' => '52e29c0fd4f0e233db6120e4b0189a37'\r\n\t\t));\r\n\t}", "protected function __construct()\n\t{\n\t\t// Load config\n\t\t$this->_config = Kohana::$config->load('facebook');\n\t\t\n\t\tinclude Kohana::find_file('vendor', 'facebook/facebook');\t\t\n\t\t// Create Facebook object\n\t\t$this->_facebook = new Facebook(\n\t\t\tarray(\n\t\t\t\t'appId' => $this->_config->get('appId'),\n\t\t\t\t'secret' => $this->_config->get('secret'),\n\t\t\t\t'cookie' => $this->_config->get('cookie')\n\t\t\t)\n\t\t);\n\n\t\ttry\n\t\t{\n\t\t\t$this->_me = $this->_facebook->api('/me');\n\t\t\t$this->_user = $this->_facebook->getUser();\n\t\t}\n\t\tcatch (FacebookApiException $e)\n\t\t{\n\t\t\t// Do nothing.\n\t\t}\n\t\t\n\t\t$this->login_url = '';\n\t}", "function get_fb_instance() {\n\n global $fb_appid, $fb_secret;\n\n //if (!$_SESSION['fb_instance']) {\n \n Facebook::$CURL_OPTS[CURLOPT_CAINFO] = 'D:\\Workspace\\xampplite\\htdocs\\FantaProject\\facebook\\fb_ca_chain_bundle.crt';\n Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;\n Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;\n\n $tmp_fb = new Facebook(array(\n 'appId' => $fb_appid,\n 'secret' => $fb_secret,\n 'cookie' => true,\n ));\n $_SESSION['fb_instance'] = $tmp_fb;\n\n //}\n\n return $_SESSION['fb_instance'];\n}", "public function facebook()\n {\n return $this->auth('Facebook');\n }", "final private function __construct(){\n\t\tself::$graph=new Facebook(array(\n\t\t\t\t\t'appId'=>self::$config['appId'],\n\t\t\t\t\t'secret'=>self::$config['secret'],\n\t\t\t\t\t'cookie'=>self::$config['cookie'],\n\t\t\t\t\t'domain'=>self::$config['domain'],\n\t\t\t\t\t'fileUpload'=>self::$config['fileUpload'],\n\t\t\t\t));\n\t}", "public function __construct($fb_app_id, $fb_app_secret, $access_token) {\n $this->facebook = new Facebook(array(\n 'appId' => $fb_app_id,\n 'secret' => $fb_app_secret\n ));\n\n if ($access_token !== null) {\n // Setting new access token\n $this->facebook->setAccessToken($access_token);\n }\n\n $this->validateAccessToken();\n }", "public function __construct($appId = null, $appSecret = null)\r\n \t{\r\n \t\t$appId = (null !== $appId) ? $appId : FACEBOOK_API_APPID;\r\n \t\t$appSecret = (null !== $appSecret) ? $appSecret : FACEBOOK_API_APPSECRET;\r\n\r\n \t\t// build credentials\r\n \t\t$credentials = new API\\Credentials(array\r\n \t\t(\r\n \t\t\t'appId' => $appId,\r\n \t\t\t'secret' => $appSecret,\r\n \t\t));\r\n\r\n \t\t$credentials->setCookieSupport(true);\r\n \t\t$credentials->setBaseDomain($_SERVER['HTTP_HOST']);\r\n \t\t$credentials->setFileUploadSupport(true);\r\n\r\n \t\t// build api client\r\n \t$this->_client = new API\\Client\\PhpSession($credentials);\r\n \t$this->_credentials = $credentials;\r\n \t}", "function fbComments_getFbApi() {\n\tglobal $fbc_options;\n\t\n\t$fbApiCredentials = array(\n\t\t'appId'\t => $fbc_options['appId'],\n\t\t'secret' => $fbc_options['appSecret']\n\t);\n\n\treturn new Facebook($fbApiCredentials);\n}", "function __construct(){\n // Start connection to Facebook Server\n $appID = APP_FB_ID;\n $appIDSecret = APP_FB_SECRET;\n\t\t$this->fb = new Facebook\\Facebook([\n\t\t 'app_id' => $appID,\n\t\t 'app_secret' => $appIDSecret,\n\t\t 'default_graph_version' => 'v5.0',\n\t\t // . . .\n\t\t ]);\n\t}", "public static function getApiInstance(){\n\t\treturn static::$_facebookApiInstance;\n\t}", "public function testFactory()\n {\n $factory = new FaceBookClientFactory('app_id', 'app_secret', 'v2.9');\n\n Assert::assertInstanceOf(Facebook::class, $factory->getFacebookClient());\n }", "function facebook_init() {\n include ('facebook.class.php');\n}", "protected function getAuth_Provider_Oauth_Service_FacebookService()\n {\n return $this->services['auth.provider.oauth.service.facebook'] = new \\phpbb\\auth\\provider\\oauth\\service\\facebook(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "private function connectApps()\n {\n $fb = new \\Facebook\\Facebook([\n 'app_id' => $this->appID,\n 'app_secret' => $this->appSecret,\n 'default_graph_version' => $this->defaultGraphVersion,\n ]);\n\n try {\n $token = $fb->getCanvasHelper()->getAccessToken();\n } catch (FacebookSDKException $e) {\n throw new HttpException(\n 500,\n 'Facebook Access Token returned an error: ' . $e->getMessage()\n );\n }\n\n if ($token == null) {\n $helper = $fb->getRedirectLoginHelper();\n $scope = ['email', 'user_likes', 'publish_actions'];\n $loginUrl = $helper->getLoginUrl('https://apps.facebook.com/' . $this->appID, $scope);\n\n echo '<script>window.top.location.href = \"' . $loginUrl . '\"</script>';\n } else {\n $fb->setDefaultAccessToken($token);\n }\n $this->session->set('access_token', $token);\n $this->session->set('fb', $fb);\n\n return $fb;\n }", "final protected function __construct($name, array $config)\n\t{\n\t\t// Set the instance name\n\t\t$this->_instance = $name;\n\n\t\t// Store the config locally\n\t\t$this->_config = $config;\n\n\t\t// Store the database instance\n\t\tFBAPI::$instances[$name] = $this;\n\t\t\n\t\tif ( ! class_exists('Facebook', FALSE))\n\t\t{\n\t\t\t// Load Facebook SDK \n\t\t\trequire_once Kohana::find_file('vendor', 'facebook/src/facebook');\n\t\t}\n\t\t\n\t\t// Create our Application instance.\n\t\t$this->_facebook = new Facebook(array(\n\t\t\t'appId' => $this->_config['app_id'],\n\t\t\t'secret' => $this->_config['app_secret'],\n\t\t\t'cookie' => true,\n\t\t));\n\t}", "public static function create(FacebookResponse $response)\n {\n $data = $response->getDecodedBody();\n\n if (!isset($data['error']['code']) && isset($data['code'])) {\n $data = ['error' => $data];\n }\n\n $code = isset($data['error']['code']) ? $data['error']['code'] : null;\n $message = isset($data['error']['message']) ? $data['error']['message'] : 'Unknown error from Graph.';\n\n if (isset($data['error']['error_subcode'])) {\n switch ($data['error']['error_subcode']) {\n // Other authentication issues\n case 458:\n case 459:\n case 460:\n case 463:\n case 464:\n case 467:\n return new static($response, new FacebookAuthenticationException($message, $code));\n // Video upload resumable error\n case 1363030:\n case 1363019:\n case 1363037:\n case 1363033:\n case 1363021:\n case 1363041:\n return new static($response, new FacebookResumableUploadException($message, $code));\n }\n }\n\n switch ($code) {\n // Login status or token expired, revoked, or invalid\n case 100:\n case 102:\n case 190:\n return new static($response, new FacebookAuthenticationException($message, $code));\n\n // Server issue, possible downtime\n case 1:\n case 2:\n return new static($response, new FacebookServerException($message, $code));\n\n // API Throttling\n case 4:\n case 17:\n case 32:\n case 341:\n case 613:\n return new static($response, new FacebookThrottleException($message, $code));\n\n // Duplicate Post\n case 506:\n return new static($response, new FacebookClientException($message, $code));\n }\n\n // Missing Permissions\n if ($code == 10 || ($code >= 200 && $code <= 299)) {\n return new static($response, new FacebookAuthorizationException($message, $code));\n }\n\n // OAuth authentication error\n if (isset($data['error']['type']) && $data['error']['type'] === 'OAuthException') {\n return new static($response, new FacebookAuthenticationException($message, $code));\n }\n\n // All others\n return new static($response, new FacebookOtherException($message, $code));\n }", "public function __construct( $app ) {\r\n // Make sure we have the app they're talking about\r\n if ( !array_key_exists( $app, $this->apps ) )\r\n throw new InvalidParametersException( _('You entered an invalid facebook application name') );\r\n\r\n // Get facebook\r\n\t\tlibrary('facebook/facebook');\r\n\r\n\t\t// Create our Application instance (replace this with your appId and secret).\r\n\t\t$this->facebook = new Facebook(array(\r\n\t\t\t'appId' => $this->apps[$app]['id'],\r\n\t\t\t'secret' => $this->apps[$app]['secret'],\r\n\t\t\t'cookie' => true,\r\n\t\t));\r\n\r\n $this->id = $this->apps[$app]['id'];\r\n $this->secret = $this->apps[$app]['secret'];\r\n\t}", "public function __construct($appId = null, $appSecret = null)\r\r\n {\r\r\n $this->appId = FacebookSession::_getTargetAppId($appId);\r\r\n $this->appSecret = FacebookSession::_getTargetAppSecret($appSecret);\r\r\n\r\r\n $this->instantiateSignedRequest();\r\r\n }", "private static function GetFB($reload=false)\n\t{\n\t\tif(self::$fb == null || $reload)\n\t\t{\n\t\t\tinclude 'config.php';\n\t\t\t\n\t\t\tself::$fb = new Facebook(array(\n\t\t\t\t'appId' => $facebookSettings['appId'],\n\t\t\t\t'secret' => $facebookSettings['secret']\n\t\t\t));\n\t\t}\n\t\t\n\t\treturn self::$fb;\n\t}", "protected function _getOAuth () {\n\n\t\t$callback = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$encrypter = new \\Dropbox\\OAuth\\Storage\\Encrypter(self::encrypter_secret);\n\t\t$storage = new \\Dropbox\\OAuth\\Storage\\Session($encrypter);\n\n\t\t// spoof storage using token stored with plugin\n\t\tif ($this->is_authorized()) {\n\t\t\t$storage->set($this->_plugin->setting(self::token_setting), 'access_token');\n\t\t}\n\n\t\t$OAuth = new \\Dropbox\\OAuth\\Consumer\\Curl(self::consumer_key, self::consumer_secret, $storage, $callback);\n\n\t\treturn $OAuth;\n\t}", "public function __construct() {\n header('P3P:CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"');\n $config = array(\n 'appId' => FBConfig::appID(),\n 'secret' => FBConfig::appSecret());\n parent::__construct($config);\n return ($this->getUser());\n }", "public static function newFactory()\n {\n return \\Database\\Factories\\DeployAccessTokenFactory::new();\n }", "static public function instance(){\n\t\tif (!self::$instance){\n\t\t\t$className = __CLASS__;\n\t\t\tself::$instance = new $className (self::$account_id , self::$secret_key , self::$sandbox);\n\t\t}\n\t\treturn self::$instance;\n\t}", "public function __construct(Facebook $facebook)\n {\n $this->facebook = $facebook;\n $this->avatarManager = new Avatar(new Options, $this->facebook);\n }", "public static function create(string $consumerKey, string $consumerSecret): self\n {\n return new self(\n new Curl(),\n new Authorizer(new Consumer($consumerKey, $consumerSecret))\n );\n }", "public function facebook()\n {\n return facebook()->login();\n }", "public function oauthFacebook() {\n\n\t // get data from input\n\t $code = Input::get('code');\n\n\t // get fb service\n\t $fb = OAuth::consumer('Facebook');\n\n\t // if code is provided get user data and sign in\n\t if ( !empty($code) ) {\n\n\t // This was a callback request from facebook, get the token\n\t $token = $fb->requestAccessToken($code);\n\n\t // Send a request with it\n\t $response = json_decode($fb->request('/me'), true);\n\n\t // Check if user has already registered with\n\t // this social network.\n\t $user_id = $this->getUserIdGivenSocialId('facebook', (string)$response['id']);\n\n\t // If they do exist, sign them in and return\n\t // them to the the page they came from.\n\t if($user_id) {\n\n\t \tAuth::login($user_id); \t\n\t\t\t\treturn Redirect::back();\n\n\t\t\t// else, store the user's social data in a session\n\t\t\t// variable and have them create a new username\n\t\t\t// and password\n\t\t\t} else {\n\t\t\t\t// create session variable\n\t\t\t\t$this->packSocialData('facebook', $response['id'], null, $response['email'], $response['gender'], 1);\n\t\t\t\treturn Redirect::to('users/create');\n\t\t }\n\t \n\t }\n\t // if not ask for permission first\n\t else {\n\t // get fb authorization\n\t $url = $fb->getAuthorizationUri();\n\n\t // return to facebook login url\n\t return Redirect::to((string)$url);\n\t }\n\t}", "public static function getInstance()\n {\n if (self::$_instance == null) {\n self::$_instance = new self(APP_KEY, APP_SECRET, APP_ID, APP_NAME);\n }\n\n return self::$_instance;\n }", "public function getFacebook()\n {\n return $this->facebook;\n }", "public function get_facebook() {\r\n return $this->facebook;\r\n }", "public static function instance($config = array())\n\t{\n\t\t$config = Kohana::config('furi');\n\n\t\t// Check for 'auto' driver and adjust configuration\n\t\tif ( strtolower($config->driver == 'auto') )\n\t\t{\n\t\t\tif ( function_exists('curl_init') )\n\t\t\t{\n\t\t\t\t$config->driver = 'cURL';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$config->driver = 'Stream';\n\t\t\t}\n\t\t}\n\n\t\t$driver = 'Furi_Driver_' . $config->driver;\n\n\t\tif( ! is_object(self::$instance))\n\t\t{\n\t\t\tif ( ! Kohana::auto_load($driver) )\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('core.driver_not_found', $config['driver'], get_class($this));\n\t\t\t}\n\t\t\t\n\t\t\tself::$instance = new $driver($config->as_array());\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public function facebook() {\n\n\t \n\t\t$fb = new Facebook\\Facebook([\n\t\t 'app_id' => '144053429274589',\n\t\t 'app_secret' => '4ef6916e238aff3b6726dac08b853135',\n\t\t 'default_graph_version' => 'v2.4',\n\t\t 'default_access_token' => 'CAACDBA17B90BAKI0aOXR1vF5zDtZCOKPbWSXopnvvNpBTHZARXVhUVrZBAXn4CB1ZBgsyk13ZA38uZAWoffwchukfajiIOG7cYrNEEAm0CdlHgwDRWeBuD0OZCfT6PB6U2vsE3O45jTgx0YTc24TXEqyZC1ZBIjc9GxD3aSv6WAyIWsZCpAcbnxYPNCdL389FxaRsZD', // optional\n\t\t]);\t \n\t\t\t \n\ttry {\n\t $response = $fb->get('/me?fields=id,name,email');\n\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t echo 'Graph returned an error: ' . $e->getMessage();\n\t exit;\n\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t exit;\n\t}\n\n\t\n\t$me = $response->getGraphUser();\n\t$name = $me['name'];\n\t$email = $me['email'];\n\t$u_name = preg_replace('/@.*$/', '', $me['email']);\n\t$user = new User();\n\t$user->name \t\t\t\t= $name ;\n\t$user->type \t\t\t\t= 'general';\n\t$user->register_type \t\t= 'facebook';\n\t$user->username \t\t\t= $u_name;\t\t\t\n\t$user->email \t\t\t\t= $email;\n\t$user->password \t\t\t= bcrypt($u_name);\n\t$user->save();\n\t\n\t$lastInsertedId= $user->id; \n\t\n\t$profile = new Profile();\n\t$profile = $user->profile()->save($profile);\t\t\t\n\t$credentials = array(\n\t\t'email' => $email,\n\t\t'password' => $u_name\n\t);\n\n\tif (Auth::attempt($credentials)) {\n\t\t\t//return Redirect::to('home');\n\t\t\treturn redirect()->intended('home');\n\t}\n\n\t\n\n\t//echo '<pre>'; print_r($new_name);\n\t//echo 'Logged in as ' . $me['email'];\t \n\t \n\t \n\t }", "public function facebook() {\n\n // Uncomment to debug. Re-comment before committing!\n // $debug_fb = true;\n\n if (!$fb_user = $this->_facebook_verify($_REQUEST['code'])) {\n if ($debug_fb && isset($_SESSION['fb_user'])) {\n $fb_user = $_SESSION['fb_user'];\n } else {\n header('Location: /');\n return false;\n }\n }\n\n $user = user::i(user::findOne(array('fb_uid' => $fb_user['id'])));\n\n if (!$user->exists()) {\n $_SESSION['fb_user'] = $fb_user;\n $__more_style = array('fb_register');\n $__more_script = array('fb_register');\n $__body_class = \"header-bare\";\n require_once 'tpl/register_facebook.php';\n } else {\n\n if ($user->fb_access_token != $fb_user['access_token']) {\n $user->fb_access_token = $fb_user['access_token'];\n $user->save();\n }\n\n $user->login();\n header('Location: '.$_REQUEST['redirect']);\n }\n\n return true;\n\n }", "public function getFacebook()\n\t{\n\t\treturn $this->facebook;\n\t}", "public function getFacebook()\n {\n return $this->facebook;\n }", "public static function factory()\n {\n return new self;\n }", "function __construct($appId, $appSecret) {\n $this->appId = $appId;\n $this->appSecret = $appSecret;\n }", "public function __construct()\n\t{\n\t\t//call parent's constuctor\n\t\tparent::__construct();\n\t\t\n\t\t//oc: fix for ie8\n\t\theader('p3p: CP=\"NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM\"');\n\n\t\t//oc: prepare facebook library\n\t\t$this->_fb_config\t= array(\n\t \t'appId' => $this->config->item('facebook_app_id'),\n \t\t\t'secret' => $this->config->item('facebook_app_secret'),\n\t\t\t'cookie' => true,\n\t\t);\n\t\t\n\t\t$this->load->library('facebook', $this->_fb_config);\n\t\t$this->_signedRequest \t= $this->facebook->getSignedRequest();\n\t\t\n\t\t\n\t\t//oc: appData\n\t\tif( !empty($this->_signedRequest) && !empty($this->_signedRequest['app_data']) ){\n\t\t\t$this->_appData = json_decode(urldecode($this->_signedRequest['app_data']));\t\t\t\n\t\t\t\t\t\t\n\t\t}\n\t\t//oc: access token\n\t\tif(isset($this->_appData->access_token)){\n\t\t\t$this->_access_token = $this->_appData->access_token;\n\t\t\t$this->session->set_userdata('oauth_token', $this->_appData->access_token );\n\t\t}\n\t\t//+++++++++++++++++++++++++++++++++++++++++\n\t\t//oc: oAuth at front of app\n\t\t//+++++++++++++++++++++++++++++++++++++++++\n\n\t\t//get the login url in case we don't have auth yet.\n\t\t$url = base_url().\"redirect/\";\n\t\tif($this->input->get_post('tid')) $url.= $this->input->get_post('tid');\n\t\t\n\t\t$authParams = array(\t'redirect_uri' => $url,\n\t\t\t\t\t\t\t\t'scope'=>'publish_stream,user_photos,user_likes,user_photo_video_tags'\n\t\t);\n\t\t$this->_loginUrl = $this->facebook->getLoginUrl($authParams);\n\t\t\n\t\t$this->_fb_config['login_url'] = $this->_loginUrl;\n\t\t\n\t\t//try and get the auth token from facebook first.\n\t\t$this->_access_token = $this->facebook->getAccessToken();\n\t\t\n\t\t//if the facebook didn't give the token check for it in the signed request. \n\t\t//else if the signed request didn't have it try and get it from the cookie.\n\t\tif( !isset($this->_access_token) && isset($this->_signedRequest['oauth_token']) )\n\t\t\t$this->_access_token \t= $this->_signedRequest['oauth_token'];\n\t\telse\n\t\t\t$this->_access_token\t= $this->session->userdata('oauth_token');\n\t\t\n\t\t//if we have an auth token save it to the cookie.\n\t\tif( !empty($this->_access_token) )\n\t\t\t$this->session->set_userdata('oauth_token', $this->_access_token);\n\t\t\n\t\t//+++++++++++++++++++++++++++++++++++++++++\n\t\t//oc: oAuth END\n\t\t//+++++++++++++++++++++++++++++++++++++++++\n\n\t\t\n\t\t\n\t\t//oc: like status\n\t\tif( isset($this->_signedRequest['page'][\"liked\"]) ){\n\t\t\t$this->_likeStatus = $this->_signedRequest[\"page\"][\"liked\"];\n\t\t\t$this->session->set_userdata('like_status', $this->_likeStatus);\n\t\t} else {\n\t\t\t$this->_likeStatus = $this->session->userdata('like_status');\n\t\t}\n\n\t\t//oc: tid\n\t\t$this->_tid\t= $this->input->get(\"tid\");\n\t\tif (!$this->_tid) $this->_tid = 0;\n\t\tif(count($this->_appData) > 0 && isset($this->_appData->tid))\t$this->_tid\t= $this->_appData->tid;\n\t\t\n \t\t//oc: determine if we need to worry about this nonsense (like gate).\n \t\t$this->_isLocal = (ENVIRONMENT != \"production\" && ENVIRONMENT != \"cfm_staging\");\n\t\t\n \t\t$this->_fb_config['like_status']\t= $this->_likeStatus;\n \t\t$this->_fb_config['like_url'] \t\t= $this->config->item('facebook_like_url'); \n \t\t\n \t\t\n\t\t//oc: data for the view\n\t\t$this->_viewData\t= array(\n\t\t\t'cdn'\t\t=> base_url(),\n//oc: this loads preloader\n\t\t\t//'swf'\t\t=> \"Sharp.swf\",\n\t\t\t'swf'\t\t=> \"SharpPreloader.swf\",\n\t\t\t'gaId'\t\t=> $this->config->item('GOOGLE_ANALYTICS_ID'),\n\t \t'appId' \t=> $this->config->item('facebook_app_id'),\n \t\t\t'secret' \t=> $this->config->item('facebook_app_secret'),\n\t\t\t'appData'\t=> $this->_appData,\n\t\t\t'login_url'\t=> $this->_loginUrl,\t\t\n\t\t\t'likeStatus'=> $this->_likeStatus,\n\t\t\t'tid'\t\t=> $this->_tid,\n\t\t\t'hashtag'\t=> $this->config->item('twitter_hashtag'),\n\t\t\t'defaultVid'=> $this->config->item('default_video')\n\t\t);\n\t}", "protected function initFacebookSession()\n\t{\n\t\ttry {\n\t\t\t$helper = new FacebookRedirectLoginHelper(ROOT_URL);\n\t\t\t$this->fb = $helper->getSessionFromRedirect();\n\t\t} catch(\\Exception $ex) {\n\t\t\t// When validation fails or other local issues\n\t\t}\n\t\tif (!$this->fb) {\n\t\t\t// next try from canvas\n\t\t\ttry {\n\t\t\t\t$helper = new FacebookCanvasLoginHelper();\n\t\t\t\t$this->fb = $helper->getSession();\n\t\t\t} catch(\\Exception $ex) {\n\t\t\t\t// When validation fails or other local issues\n\t\t\t}\n\t\t}\n\t\tif (!$this->fb) {\n\t\t\t// next try from JS\n\t\t\ttry {\n\t\t\t\t$helper = new FacebookJavaScriptLoginHelper();\n\t\t\t\t$this->fb = $helper->getSession();\n\t\t\t} catch(\\Exception $ex) {\n\t\t\t\t// When validation fails or other local issues\n\t\t\t}\n\t\t}\n\t\t// finally fall back to an existing session, if we have one\n\t\tif (!$this->fb && !empty($_SESSION['fb_token'])) {\n\t\t\ttry {\n\t\t\t\t$this->fb = new FacebookSession($_SESSION['fb_token']);\n\t\t\t\t$this->fb->validate();\n\t\t\t} catch(\\Exception $ex) {\n\t\t\t\t// When validation fails or other local issues\n\t\t\t}\n\t\t}\n\t\tif ($this->fb) {\n\t\t\t// Logged in\n\t\t\ttry {\n\t\t\t\t$_SESSION['fb_token'] = $this->fb->getToken();\n\t\t\t\t$user_profile = (new FacebookRequest(\n\t\t\t\t\t$this->fb, 'GET', '/me'\n\t\t\t\t\t))->execute()->getGraphObject(GraphUser::className());\n\t\t\t\t$this->fb_uid = $user_profile->getId();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$this->fb = null;\n\t\t\t}\n\t\t}\n\t\tif (!$this->fb) {\n\t\t\tsession_destroy();\n\t\t}\n\t}", "public static function factory() {\n\t\tstatic $instance = false;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function manageFacebookCallback() {\n\t\tLog::info('FacebookService::manageFacebookCallback', Input::all());\n\n\t\tsession_start();\n\t\tFacebookSession::setDefaultApplication(Config::get('facebook')['appId'], Config::get('facebook')['secret']);\n\t\t$helper = new FacebookRedirectLoginHelper(Config::get('local-config')['host'].'/login/fb/callback');\n\t\ttry {\n\t\t\t$session = $helper->getSessionFromRedirect();\n\t\t\tif ($session) {\n\t\t\t \t$me = (new FacebookRequest($session, 'GET', '/me'))->execute()->getGraphObject(GraphUser::className())->asArray();\n\t\t\t \t$uid = $me['id'];\n\t\t\t\tif ($uid == 0) \n\t\t\t\t\treturn Utils::returnError('facebook_error', null);\n\t\t\t\tif (!array_key_exists('email', $me) || $me['email'] == null)\n\t\t\t\t\treturn Utils::returnError('email_access_forbidden', null);\n\t\t\t\t$facebook_profile = FacebookProfile::where('uid', $uid)->first();\t\t\n\t\t\t\tif ($facebook_profile != Null) \n\t\t\t\t\treturn Utils::returnSuccess(\"facebook_profile_exists\", array(\"user_id\"=>$facebook_profile->user_id));\n\n\t\t\t\t$user = User::where('email', $me['email'])->first(); //TODO: check if email exists!!!\n\t\t\t\tif ($user!=Null) //a user with the email associated with this facebook account already exist\n\t\t\t\t{\n\t\t\t\t\t$user->confirmed = 1;\n\t\t\t\t\t$user->save();\n\t\t\t\t\tFacebookProfile::create(array(\"user_id\"=>($user->id), \"uid\"=>$uid, \"access_token\"=>$session->getAccessToken() ));\n\t\t\t\t\treturn Utils::returnSuccess(\"facebook_profile_added\", array(\"user_id\"=>$user->id));\t\t\t\n\t\t\t\t}\n\t\t\t\t$user = UserFactory::createConfirmedUser($me['email'], $me['name']);\n\t\t\t\tFacebookProfile::create(array(\"user_id\"=>($user->id), \"uid\"=>$uid, \"access_token\"=>$session->getAccessToken() ));\n\t\t\t\treturn Utils::returnSuccess(\"new_user_created\", array(\"user_id\"=>$user->id));\n\t\t\t}\n\t\t} catch(Exception $ex) {\n\t\t\treturn Utils::returnError('facebook_error', array('message' => $ex->getMessage()));\n\t\t}\t\t\n\t\treturn Utils::returnError('facebook_error', array('message'=>''));\n\t}", "public static function factory() {\n\t\tstatic $instance = false;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\t\treturn $instance;\n\t}", "function __construct($consumer_key,$consumer_secret)\r\n\t{\r\n\t\t$this->consumer_key = $consumer_key;\r\n\t\t$this->consumer_secret = $consumer_secret;\r\n\t\t\r\n\t\t/* if registered, get user tokens from session*/\r\n\t\t$this->atoken = $_SESSION['oauth_access_token'];\r\n\t\t$this->atoken_secret = $_SESSION['oauth_access_token_secret'];\r\n\t}", "public function setFacebook($facebook)\n {\n $this->facebook = $facebook;\n\n return $this;\n }", "public function getFacebook()\n\t{\n\t\treturn $this->fb;\n\t}", "public static function createInstance()\n {\n return new self();\n }", "public static function getInstance()\n {\n if (self::$_instance == null) {\n self::$_instance = new self(APP_ID, APP_KEY, APP_NAME);\n }\n\n return self::$_instance;\n }", "public static function create() {\n return new self();\n }", "protected function __construct() {\n $this->hacConfig = false;\n $config = new FacebookConfig();\n $this->loadConfig($config->getConfig());\n }", "public function __construct($redirectUrl, $appId = null, $appSecret = null)\n {\n $this->appId = FacebookSession::_getTargetAppId($appId);\n $this->appSecret = FacebookSession::_getTargetAppSecret($appSecret);\n $this->redirectUrl = $redirectUrl;\n }", "public function facebook()\n {\n return $this->hasOne('App\\FacebookAccount');\n }", "public function __construct(array $config = [])\n {\n if(!count($config)) {\n $sysConfig = Factory::getConfig();\n $config = [\n 'app_id' => $sysConfig->social->facebook->appID,\n 'app_secret' => $sysConfig->social->facebook->appSecret,\n 'permissions' => $sysConfig->social->facebook->permissions,\n 'default_graph_version' => $sysConfig->social->facebook->defaultGraphVersion ? $sysConfig->social->facebook->defaultGraphVersion : 'v2.2',\n ];\n }\n parent::__construct($config);\n }", "public static function create() {\n\t\treturn new self();\n\t}", "public static function factory(array $config = [])\n {\n // Use explicitly configured credentials, if provided\n if (isset($config['key']) && isset($config['secret'])) {\n return new self(\n $config['key'],\n $config['secret'],\n isset($config['token']) ? $config['token'] : null,\n isset($config['expires']) ? $config['expires'] : null\n );\n }\n\n // Use credentials from environment variables, if available\n $key = getenv(self::ENV_KEY);\n $secret = getenv(self::ENV_SECRET);\n\n if ($key & $secret) {\n return new self($key, $secret);\n }\n\n // Use credentials from the ~/.aws/credentials INI file, if available\n $home = self::getHomeDir();\n if ($home && file_exists(\"{$home}/.aws/credentials\")) {\n return self::fromIni(null, \"{$home}/.aws/credentials\");\n }\n\n // Use IAM Instance Profile credentials, if hosted on Amazon EC2\n return new InstanceProfileCredentials($config);\n }", "public static function factory() {\n\t\tstatic $instance;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public function isFacebook()\n {\n return $this->getFacebook();\n }", "protected function registerFacebookSdk()\n {\n $this->app->singleton(\\App\\Utils\\FacebookSdk::class, function () {\n $proxyConfig = app('config')->get('facebook-sdk.proxy');\n if ($proxyConfig['is_open'] && !empty($proxyConfig['host']) && !empty($proxyConfig['port'])) {\n $client = new \\GuzzleHttp\\Client([\n 'timeout' => 120,\n 'curl' => [\n CURLOPT_PROXY => $proxyConfig['host'],\n CURLOPT_PROXYPORT => $proxyConfig['port']\n ],\n ]);\n } else {\n $client = new \\GuzzleHttp\\Client(['timeout' => 120]);\n }\n\n $config = app('config')->get('facebook-sdk.facebook_config');\n\n\n// static::$_clientinstance = new \\App\\Utils\\Facebook([\n// 'app_id' => '663043711013811',\n// 'app_secret' => '25faf0192fcc33270c0df783e2a1f902',\n// //'app_id' => '643785509628922',\n// //'app_secret' => '88c97a5ac648dfc605302380ee8ccf0a',\n// 'default_graph_version' => 'v9.0',\n// 'http_client_handler' => new FGuzzle6HttpClient($client),\n// 'persistent_data_handler' => new \\App\\Utils\\FSessionDLaravelDataHandler()\n// ]);\n\n $config['http_client_handler'] = new \\App\\Utils\\FGuzzle6HttpClient($client);\n $config['persistent_data_handler'] = new \\App\\Utils\\FSessionDLaravelDataHandler();\n\n return new \\App\\Utils\\FacebookSdk($config);\n });\n\n $this->app->alias(\\App\\Utils\\FacebookSdk::class, 'FacebookSdk');\n }", "public function fb_connect() {\n\n $profile = $this->params['profile'];\n $merchant_id = $this->params['merchant_id'];\n $account_dbobj = $this->params['account_dbobj'];\n\n $fb_user = new FbUser($account_dbobj);\n $fb_user->findOne('id='.$merchant_id);\n $fb_user->setAbount($pofile['about']);\n $fb_user->setBio($profile['bio']);\n $fb_user->setBirthday($profile['birthday']);\n $fb_user->setEducation($profile['education']);\n $fb_user->setEmail($profile['email']);\n $fb_user->setFirstName($profile['first_name']);\n $fb_user->setGender($profile['gender']);\n $fb_user->setExternalId($profile['external_id']);\n $fb_user->setLastName($profile['last_name']);\n $fb_user->setLink($profile['link']);\n $fb_user->setLocale($profile['locale']);\n $fb_user->setName($profile['name']);\n $fb_user->setQuotes($profile['quotes']);\n $fb_user->setTimezone($profile['timezone']);\n $fb_user->setUpdatedTime($profile['setUpdatedTime']);\n $fb_user->setUsername($profile['username']);\n $fb_user->setVerified($profile['verified']);\n $fb_user->setWork($profile['work']);\n $fb_user->save();\n\n $merchant = new Merchant($account_dbobj);\n BaseMapper::saveAssociation($merchant, $fb_user, $account_dbobj);\n\n $this->status = 0;\n }", "public function testComAdobeCqSocialConnectOauthImplFacebookProviderImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.connect.oauth.impl.FacebookProviderImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public function action_facebook($callback = null)\n\t{\n\t\t$facebook = new Facebook(array(\n\t\t\t'appId'=> Config::get('facebook.appid'),\n\t\t\t'secret'=> Config::get('facebook.appsecret')\n\t\t));\n\t\t\n\t\tif($callback == 'callback')\n\t\t{\n\t\t\tif(Input::get('code'))\n\t\t\t{\n\t\t\t\t$token = $facebook->getAccessToken();\n\t\t\t\t$fb = $facebook->api('/me');\n\t\t\t\t\n\t\t\t\tif(Auth::check())\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tDB::table('passports')->where('id', '=', Auth::user()->id)->update(array('fbid'=>$fb['id']));\n\t\t\t\t\t\n\t\t\t\t\treturn Redirect::to('settings/apps');\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tif($check = DB::table('passports')->where('fbid', '=', $fb['id'])->first(array('id', 'username')))\n\t\t\t\t\t{\n\t\t\t\t\t\t//Facebook ID matched a user in our DB. Log in the user\n\t\t\t\t\t\tAuth::login($check->id);\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn Redirect::to('user/'.$check->username);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//SET Session\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Facebook ID DID NOT match a user in our DB. Save as a new member and generate a password to be sent in the email.\n\t\t\t\t\t\t//Generate random password for the user\n\t\t\t\t\t\t$randomPassword = Str::random(8);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Make sure the username is not taken. If it is, add 3 random numbers on the end of it.\n\t\t\t\t\t\tif(DB::table('passports')->where('username', '=', $fb['username'])->count() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fb['username'] = $fb['username'].Str::random(3, 'num');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Prepare user data\n\t\t\t\t\t\t$newuser = array(\n\t\t\t\t\t\t\t'id'=> null,\n\t\t\t\t\t\t\t'fbid'=> $fb['id'],\n\t\t\t\t\t\t\t'username'=> $fb['username'],\n\t\t\t\t\t\t\t'password'=> md5($randomPassword),\n\t\t\t\t\t\t\t'email'=> $fb['email'],\n\t\t\t\t\t\t\t'first_name'=> $fb['first_name'],\n\t\t\t\t\t\t\t'last_name'=> $fb['last_name'],\n\t\t\t\t\t\t\t'social_status'=> 'Gaian Addict',\n\t\t\t\t\t\t\t'country'=> Utilities::country_code_to_country($_SERVER['HTTP_CF_IPCOUNTRY']),\n\t\t\t\t\t\t\t'city'=> '',\n\t\t\t\t\t\t\t'role'=> 1,\n\t\t\t\t\t\t\t'points'=> 0,\n\t\t\t\t\t\t\t'challenges'=> 0,\n\t\t\t\t\t\t\t'stn'=> 1,\n\t\t\t\t\t\t\t'reg_date'=> time(),\n\t\t\t\t\t\t\t'timezone'=> '',\n\t\t\t\t\t\t\t'avatar'=> ''\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Save user data in Database\n\t\t\t\t\t\t$id = DB::table('passports')->insert_get_id($newuser);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Log in user\n\t\t\t\t\t\tAuth::login($id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Send an email regarding the signup + let the user know of the password.\n\t\t\t\t\t\t$mail = new Mailer();\n\t\t\t\t\t\t$mail->setFrom('Gaian.me', 'mail@gaian.me');\n\t\t\t\t\t\t$mail->addRecipient(null, $newuser['email']);\n\t\t\t\t\t\t$mail->fillSubject('Gaian.me Account');\n\t\t\t\t\t\t$mail->fillMessage(\"Welcome to Gaian.me!\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"We are very happy that you decided to join our community and we hope that you have a great time on our website.\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Since you signed up using facebook, we setup a password for you so you can also sign in using the simple Sign In form.\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Your password is: \".$randomPassword.\"\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"However, you can always sign in using the facebook log in button.\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"We have forums where fellow gaians hang out or ask for help installing themes or customizing their computer in general, so you might want to check that out:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t URL::to('forum').\"\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Happy contributing!\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Best,\\nThe Gaian.me Team\");\n\t\t\t\t\t\t$mail->send();\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn Redirect::to('user/'.$newuser['username']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//CODE IS NOT SET\n\t\t\t\treturn Redirect::to('/');\n\t\t\t}\n\t\t} else {\n\t\t\t$args = array(\n\t\t\t\t'scope'=> Config::get('facebook.scope'),\n\t\t\t\t'redirect_uri'=> URL::to(Config::get('facebook.redirectpath'))\n\t\t\t);\n\t\t\t$uri = $facebook->getLoginUrl($args);\n\t\t\treturn Redirect::to($uri);\n\t\t}\n\t\n\t}", "function &getConsumer() {\n $store = getStore();\n $consumer =& new Auth_OpenID_Consumer($store);\n return $consumer;\n}", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public function getApp()\n\t{\n\t\tif(! self::$_app){\n\t\t if ($this->scopes) $this->config['oauth']['scopes'] = $this->scopes;\n\t\t\tself::$_app = Factory::officialAccount($this->config);\n\t\t}\n\t\treturn self::$_app;\n\t}", "public function FacebookserFindOrCreate($facebook_user){\n $user = User::where('facebook_id',$facebook_user->id)->first();\n\n if ($user){\n $user = new User;\n $user->name = $facebook_user->getName();\n $user->email = $facebook_user->getEmail();\n $user->github_id = $facebook_user->getid();\n }\n return $user;\n }" ]
[ "0.792079", "0.78750944", "0.749932", "0.73303646", "0.6874606", "0.68550384", "0.6796952", "0.66617537", "0.6572197", "0.64454466", "0.6423624", "0.63234943", "0.632176", "0.62983805", "0.627861", "0.6223618", "0.6189025", "0.613789", "0.6135563", "0.6088896", "0.60311866", "0.5970832", "0.5856511", "0.5828169", "0.5786555", "0.5711132", "0.56439024", "0.5635565", "0.562618", "0.5602943", "0.5592851", "0.5584296", "0.5462118", "0.54553413", "0.54362136", "0.54227334", "0.53855175", "0.5367535", "0.5337544", "0.5337451", "0.5328192", "0.52959806", "0.52910143", "0.5289982", "0.52689976", "0.5268794", "0.5252127", "0.52243614", "0.5213849", "0.5210034", "0.5173535", "0.51501673", "0.51474655", "0.5145403", "0.51444936", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5142565", "0.5129807", "0.51262796", "0.5122781", "0.51161987", "0.5111824", "0.51061416", "0.510192", "0.50828975", "0.5075731", "0.5073517", "0.5060431", "0.50540954", "0.5052542", "0.5050818", "0.5047598", "0.5009655", "0.49928835", "0.4992232", "0.49869272", "0.49821478", "0.49765277", "0.4969683", "0.49681357", "0.496602" ]
0.7287245
4
Returns the parameters to pass to Facebook>getLoginUrl()
public function getLoginUrlParams() { return array( "scope" => array_values($this->config()->get("permissions")) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLoginURL(){\r\n\t\treturn $this->facebook_obj->getLoginURL($this->getParamsForLogin());\r\n\t}", "public function login_url()\n\t{\n\t\treturn $this->login_url = $this->_facebook->getLoginUrl(\n\t\t\tarray\n\t\t\t( \n\t\t\t\t'scope'\t\t\t=> $this->_config->get('scope'),\n\t\t\t\t'redirect_uri'\t=> $this->_config->get('redirect_uri'),\n\t\t\t\t'display'\t\t=> $this->_config->get('display'),\n\t\t\t));\n\t}", "public function login_url()\n {\n return $this->login_url = urldecode($this->fb->getLoginUrl(array(\n 'scope' => $this->config->scope,\n 'redirect_uri' => $this->config->redirect_uri,\n 'display' => $this->config->display,\n )));\n }", "public static function GetLoginURL()\n\t{\n\t\tinclude 'config.php';\n\t\t\n\t\t$params = array();\n\t\t$params['scope'] = $facebookSettings['scope'];\n\t\t$params['redirect_uri'] = $facebookSettings['loginRedirect'];\n\t\t\n\t\treturn self::GetFB()->getLoginUrl($params);\n\t}", "public function getLoginUrl();", "static public function login_url() {\n\t\t$facebook = FacebookApp::get()->first();\n\t\tif($facebook && $facebook->EnableFacebookLogin == 1)\n\t\t\treturn Controller::join_links(\"facebook\", \"login\");\n\t\treturn false;\n\t}", "public function getUrl() {\n\t\t//$url = \"https://www.facebook.com/dialog/oauth?client_id=\".$this->appId.\"&redirect_uri=\".$this->redirectUrl.\"&scope=\".$this->permission.\"&state=\".$_SESSION['state'];\n\t\treturn $this->redirectUrl;\n\t}", "public function getLoginUriWithParams()\n {\n $params = array(\n 'response_type' => 'code',\n 'redirect_uri' => $this->redirectUri,\n 'client_id' => $this->clientId,\n 'api_key' => $this->apiKey,\n );\n\n $uriWithParams = $this->baseUrl . http_build_query($params);\n\n return $uriWithParams;\n }", "public function getLoginUrl()\n\t{\n\t\treturn \"$this->authorizationBaseUrl?client_id=$this->clientId&redirect_uri=$this->redirectUri&scope=$this->scope\";\n\t}", "public function getLoginUrl() {\n $url = CURL::urljoin($this->authorization_uri, array(\n 'client_id' => $this->client_id,\n 'scope' => $this->scope,\n 'response_type' => 'code',\n 'redirect_uri' => $this->getConnectUrl(),\n 'state' => $this->state,\n 'display' => 'popup',\n ));\n return $url;\n }", "protected function login_url($params = array())\t{\n\t\t$scope = static::$scope;\n\t\treturn $this->instagram->getLoginUrl($scope);\n\t}", "public function getLoginUrl()\n {\n return 'https://oauth.vk.com/authorize'\n . '?client_id=' . urlencode($this->getAppId())\n . '&scope=' . urlencode(implode(',', $this->getScope()))\n . '&redirect_uri=' . urlencode($this->getRedirectUri())\n . '&response_type=' . urlencode($this->getResponceType())\n . '&v=' . urlencode(self::VERSION);\n }", "public function getLoginUrl() {\n return $this->client->createAuthUrl();\n }", "static public function connect_url() {\n\t\treturn Controller::join_links(\"facebook\", \"connect\");\n\t}", "public function get_login_url() {\n\n $callbackurl = self::callback_url();\n $params = array_merge(\n [\n 'client_id' => $this->clientid,\n 'response_type' => 'code',\n 'redirect_uri' => $callbackurl->out(false),\n 'state' => $this->returnurl->out_as_local_url(false),\n 'scope' => $this->scope,\n ],\n $this->get_additional_login_parameters()\n );\n\n return new moodle_url($this->auth_url(), $params);\n }", "public function getLoginUrl()\n {\n $url = sprintf(\"%s/authorize?response_type=code&client_id=%s&state=%s\",\n $this->client->getBaseUrl(),\n $this->client->getConfig('client_id'),\n md5(uniqid())\n );\n\n return $url;\n }", "public function getAccountLogin_url()\n {\n return $this->getBrowser()->getCurrentURL();\n }", "public function getAuthParams() {\n\t\t$settings = array_filter($this->settings['facebook'], function($k){\n\t\t\treturn !is_null($k) OR $k == true;\n\t\t});\n\n\t\tif(isset($settings['scope']) && is_array($settings['scope'])){\n\t\t\t$settings['scope'] = implode(',', $settings['scope']);\n\t\t}\n\n\t\treturn $settings;\n\t}", "public function getCallbackUrl()\n {\n return $this->getParameter('callbackUrl');\n }", "public function getUrlParameters() {\n\t\t$parameters = $this->parameters;\n\t\tif ($this->profile) {\n\t\t\t$parameters['profile'] = $this->profile;\n\t\t}\n\t\treturn $parameters;\n\t}", "public function getAuthUrl();", "public function getLoginUrl()\n {\n return $this->_customerUrl->getLoginUrl();\n }", "public function getFacebookUrl()\n {\n return $this->facebook_url;\n }", "public function getLogin()\n\t{\n\t\tsession_start();\n\t\tFacebookSession::setDefaultApplication(env('FACEBOOK_CLIENT_ID'), env('FACEBOOK_CLIENT_SECRET'));\n\t\t\n\t\t$helper = new FacebookRedirectLoginHelper('http://startpage.com/facebook/update');\n\t\t$loginUrl = $helper->getLoginUrl();\n\n\t\treturn $loginUrl . 'user_posts';\n\t}", "private function url_params()\n {\n return \"?user={$this->login}&password={$this->password}&answer=json\";\n }", "public function getOauthUri(): string\r\n {\r\n return 'https://www.facebook.com/dialog/oauth?';\r\n }", "public function getLoginUrl()\n {\n if (array_key_exists(\"loginUrl\", $this->_propDict)) {\n return $this->_propDict[\"loginUrl\"];\n } else {\n return null;\n }\n }", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "public function getAdditionalParams()\n {\n return oxRegistry::get(\"oxUtilsUrl\")->processUrl('', false);\n }", "public function getLoginURL()\n {\n return Config::get('URL') . 'auth/google/';\n }", "public function get_additional_login_parameters() {\n return [];\n }", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "private function _getLoginUrl(){\r\n\t\t\r\n\t\t$settings = $this->getConnectionSettings();\r\n\t\t\r\n\t\t$base = $this->_loginInstance['production'];\r\n\t\tif ($settings['type'] !== 'production')\r\n\t\t\t$base = $this->_loginInstance['sandbox'];\r\n\t\t\r\n\t\treturn $base . $this->_authUri;\r\n\t}", "public function getLoginUrl($params = array())\n {\n $this->establishCSRFTokenState();\n $currentUrl = $this->getUrlGenerator()->getCurrentUrl();\n\n // if 'scope' is passed as an array, convert to space separated list\n $scopeParams = isset($params['scope']) ? $params['scope'] : null;\n if ($scopeParams) {\n //if scope is an array\n if (is_array($scopeParams)) {\n $params['scope'] = implode(' ', $scopeParams);\n } elseif (is_string($scopeParams)) {\n //if scope is a string with ',' => make it to an array\n $params['scope'] = str_replace(',', ' ', $scopeParams);\n }\n }\n\n return $this->getUrlGenerator()->getUrl(\n 'www',\n 'uas/oauth2/authorization',\n array_merge(\n array(\n 'response_type' => 'code',\n 'client_id' => $this->getAppId(),\n 'redirect_uri' => $currentUrl, // possibly overwritten\n 'state' => $this->getState(),\n ),\n $params\n )\n );\n }", "public function get_url_params()\n {\n }", "public function _getAuthorizationUrl()\n {\n // Generate new authorization url\n $helper = $this->_getProvider()->getRedirectLoginHelper();\n $permissions = ['email', 'public_profile'];\n return $helper->getLoginUrl(APP_URL.'/app/modules/coinstackapp-facebookoauth/src/actions/callback.php', $permissions);\n }", "public function buildLoginUrl(Request $request): string;", "public function getLoginUrl($options) {\n\t\t$query = array(\n\t\t\t'client_id' => $this->client_id,\n\t\t\t'redirect_uri' => $this->callback_url,\n\t\t\t'response_type' => 'code'\n\t\t\t);\n\n\t\t$query = array_merge($query, $options);\n\n\t\treturn $this->authorize_url . '?' . http_build_query($query);\n\t}", "abstract public function getAuthUrlComponents();", "public function getLoginRedirect()\n {\n return [\"/\"];\n }", "public function getConnectUrl() {\n return $this->redirect_url;\n }", "public function getLoginPageUri()\n {\n return $this->login_page_uri;\n }", "public function login()\n {\n\n $data = array('loginUrl'=>'');\n\n if( !isset($_SESSION['accessToken']) || empty($_SESSION['accessToken']) )\n {\n $helper = $this->fb->getRedirectLoginHelper();\n\n $permissions = ['user_posts']; // Optional permissions\n $loginUrl = $helper->getLoginUrl('http://localhost:8000/logincallback',$permissions);\n\n $data['loginUrl'] = htmlspecialchars($loginUrl);\n\n }\n\n return $data;\n\n }", "public function getRedirectUrl(): string;", "public function woo_slg_linkedin_auth_url() {\n\t\t\t\n\t\t\t//Remove unused scope for login\n\t\t\t\n\t\t\t$scope\t= array( 'r_emailaddress', 'r_liteprofile' );\n\t\t\t\n\t\t\t//load linkedin class\n\t\t\t$linkedin = $this->woo_slg_load_linkedin();\n\t\t\t\n\t\t\t//check linkedin loaded or not\n\t\t\tif( !$linkedin ) return false;\n\t\t\t\n\t\t\t//Get Linkedin config\n\t\t\t$config\t= $this->linkedinconfig;\n\t\t\t\n\t\t\ttry {//Prepare login URL\n\t\t\t\t$preparedurl\t= $this->linkedin->getAuthorizeUrl( $config['appKey'], $config['callbackUrl'], $scope );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\t$preparedurl\t= '';\n\t }\n\t \n\t\t\treturn $preparedurl;\n\t\t}", "private function getRedirectUrl()\n {\n return $this->getConfigData('url');\n }", "protected function getLoginUrl(): string\n {\n return $this->urlGenerator->generate(self::LOGIN_ROUTE);\n }", "public function getCallbackUrl()\r\n {\r\n return $this->callback_url;\r\n }", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "public function getCallbackUrl()\n {\n return $this->callbackUrl;\n }", "public function getAccessTokenURL() {\n\t\treturn $this->selectedEndpoint['access_token_url'];\n\t}", "public function get_endpoint_login_url() {\n\t\treturn $this->endpoint_login;\n\t}", "function _getLoginUrl($request) {\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t// Adicionadas opções sobre sexo e país na página de login\n\t\t$countryDao =& DAORegistry::getDAO('CountryDAO');\n\t\t$countries =& $countryDao->getCountries();\n\t\t$templateMgr->assign_by_ref('countries', $countries);\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$templateMgr->assign('genderOptions', $userDao->getGenderOptions());\n\t\treturn $request->url(null, 'login', 'signIn');\n\t}", "private function get_redirect_uri() {\n\t\treturn self::OAUTH2_CALLBACK_URI;\n\t}", "public function getAuthUrl ()\n {\n\n $url = 'https://oauth.vk.com/authorize?client_id='.$this->client_id.'&scope=photos,friends&redirect_uri='.$this->redirect_uri.'&response_type=code&v=5.0';\n return $url;\n }", "public function getRedirectUrl()\n {\n }", "public function getCallbackUrl()\n {\n return $this->callback_url;\n }", "public function getRedirectUrl()\r\n {\r\n return \"{$this->data['redirect_url']}?session={$this->data['session']}\";\r\n }", "public function get_callback_url(){\n\t\treturn $this->callback_url;\n\t}", "public function getLoginURI() {\n return '/oauth/google/login/';\n }", "public function getLoginUrl(array $params = [])\n {\n $default_params = [\n 'scope' => $this->scope,\n 'audience' => $this->audience,\n 'response_mode' => $this->responseMode,\n 'response_type' => $this->responseType,\n 'redirect_uri' => $this->redirectUri,\n ];\n\n $auth_params = array_replace( $default_params, $params );\n $auth_params = array_filter( $auth_params );\n\n if (empty( $auth_params['state'] )) {\n $auth_params['state'] = $this->stateHandler->issue();\n } else {\n $this->stateHandler->store($auth_params['state']);\n }\n\n return $this->authentication->get_authorize_link(\n $auth_params['response_type'],\n $auth_params['redirect_uri'],\n null,\n null,\n $auth_params\n );\n }", "public function getAccessTokenUrl()\n {\n if (! $this->accessTokenUrl && $this->siteUrl) {\n return rtrim($this->siteUrl, '/') . '/access_token';\n }\n return $this->accessTokenUrl;\n }", "public function getURLQuery() {\n\t\t$query = array();\n\t\tif (Request::getGET('type') == 'login-confirmation') {\n\t\t\t$query['type'] = 'login-confirmation';\n\t\t\tif (Request::getGET('mode') == 'iframe')\n\t\t\t\t$query['mode'] = 'iframe';\n\t\t}\n\t\treturn $query;\n\t}", "public function getURLLogin() {\r\n $this->initGoogleClient();\r\n $url = $this->client->createAuthUrl();\r\n Log::message(Language::getMessage('log', 'debug_google_get_url', array('url' => $url)), 2);\r\n return $url;\r\n }", "public function getLoginPageUriValue()\n {\n return $this->readWrapperValue(\"login_page_uri\");\n }", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function getRedirectUri();", "public function getRedirectUri();", "private function getCallbackUrl($provider)\n {\n return $this->url->getUrl('clean_checkout/social/authenticate', ['_query' => ['provider' => $provider]]);\n }", "public static function callback_url() {\n global $CFG;\n\n return new moodle_url('/admin/oauth2callback.php');\n }", "public function get_url_get_parameters() {\r\n\t\treturn $this->url_get_parameters;\r\n\t}", "public function getTokenUrl();", "public function getLoginUrl(){\n\t\t\t\t\t$this->connection = new TwitterOAuth($this->consumer_key , $this->consumer_secret);\n\t\t\t\t\t$request_token = $this->connection->getRequestToken($this->consumer_callback); \n\t\t\t\t\n\t\t\t\t\t// if request_token exists then get the token and secret and store in the session\n\t\t\t\t\tif($request_token){\n\t\t\t\t\n\t\t\t\t\t\t$token = $request_token['oauth_token'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$_SESSION['request_token'] = $token ;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$_SESSION['request_token_secret'] = $request_token['oauth_token_secret'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the login url from getauthorizeurl method\n\t\t\t\t\n\t\t\t\t\t\treturn $login_url = $this->connection->getAuthorizeURL($token);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t\t}", "public function getRedirectParams() { return $this->_redirectParams; }", "public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}", "function redirect($facebook){\r\n\t\t$loginUrl = $facebook->getLoginUrl(array(\r\n\t\t\t\"canvas\" =>1,\r\n\t\t\t\"fbconnect\" =>0,\r\n\t\t\t'req_perms' => \"email,publish_stream,user_hometown,user_location,user_photos,friends_photos,\r\n\t\t\t\t\tuser_photo_video_tags,friends_photo_video_tags,user_videos,video_upload,friends_videos\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,user_hometown,user_location\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,status_update,user_hometown,\r\n\t\t\t//\t\t\t\tuser_location,user_photos,friends_photos,user_photo_video_tags,friends_photo_video_tags\"\r\n\t\t));\r\n\r\n\t\t /*echo \"<script type='text/javascript'>top.location.href = '$loginUrl';</script>\";*/\r\n\t\t echo \"loginUrl: \" . $loginUrl;\r\n\t}", "public function getRedirectUri(): string;", "public function getUrlParams() {\n\t\t\n\t\t$consumerParams = $this->getConsumerParams();\n\t\t$params = array();\n\t\t\n\t\tif (!empty($consumerParams)) {\n\t\t\t$wrapper = RublonSignatureWrapper::wrap(\n\t\t\t\t$this->getRublon()->getSecretKey(),\n\t\t\t\t$consumerParams\n\t\t\t);\n\t\t\t$params[self::FIELD_CONSUMER_PARAMS] = $wrapper;\n\t\t}\n\t\t\n\t\treturn $params;\n\t\t\n\t}", "public function facebookUrl()\r\n\t{\r\n\t\treturn Mage::getBaseDir(\"media\") . DS . \"ezloginlite\" . DS. \"facebook\" . DS;\r\n\t}", "public function get_login_url() {\n\n $returnurl = new moodle_url('/repository/repository_callback.php');\n $returnurl->param('callback', 'yes');\n $returnurl->param('repo_id', $this->id);\n $returnurl->param('sesskey', sesskey());\n $returnurl->param('reloadparentpage', true);\n\n $url = new moodle_url($this->client->createAuthUrl());\n $url->param('state', $returnurl->out_as_local_url(false));\n return '<a target=\"repo_auth\" href=\"'.$url->out(false).'\">'.get_string('connectyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "function getLoginLogoutUrlLinks() {\r\n $facebook = $this->facebook;\r\n $user = $this->user;\r\n if ($user) {\r\n $this->logInLogOutLink = $facebook->getLogoutUrl();\r\n echo ' <strong><em>You are not Connected.</em></strong>';\r\n } else {\r\n $this->logInLogOutLink = $facebook->getLoginUrl(\r\n array(\r\n 'scope' => 'email,offline_access,publish_stream,user_photos,offline_access',\r\n 'redirect_uri' => $pageURL\r\n )\r\n );\r\n echo \"<a href='$this->logInLogOutLink'>Facebook Login</a>\";\r\n }\r\n }", "public function get_auth_url()\r\n\t{\r\n\t\treturn PicasaAPI::$QUERY_URLS['auth'];\r\n\t}", "function fsl_gauth_getauthurl()\n\t{\n\t\n\t$gClient = new Google_Client();\n $gClient->setApplicationName('Login');\n $gClient->setClientId(option('clientId'));\n $gClient->setClientSecret(option('clientSecret'));\n $gClient->setRedirectUri(option('redirectURL')); \n\t//\t$gClient->setHd(option('hd')); \n $google_oauthV2 = new Google_Oauth2Service($gClient);\n $authUrl = $gClient->createAuthUrl();\n return $authUrl;\n}", "public function login()\n\t{\n\t\tif (empty($this->_callbackURL))\n\t\t{\n\t\t\tthrow new Exception('No data for social login: Callback URL');\n\t\t}\n\n\t\t$oAuth = $this->_getTWOAuth();\n\t\t$tokenCredentials = $oAuth->getRequestToken($this->_callbackURL);\n\t\t$oauthRedirectUrl = $oAuth->getAuthorizeURL($tokenCredentials);\n\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_NAME, $tokenCredentials['oauth_token']);\n\t\t$this->_app['session']->set(self::SOCIAL_TOKEN_SECRET_NAME, $tokenCredentials['oauth_token_secret']);\n\n\t\treturn $oauthRedirectUrl;\n\t}", "abstract protected function getTokenUrl();", "public function getUrl() {\n $url = $this->request->get_normalized_http_url() . '?';\n $url .= http_build_query($this->request->get_parameters(), '', '&');\n\n return $url;\n }", "function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->redirect_url;\r\n\t}", "protected function getRedirectUrl()\n\t{\n if ($customURL = $this->input->getBase64('returnurl', ''))\n {\n $customURL = base64_decode($customURL);\n }\n\n $url = !empty($customURL) ? $customURL : 'index.php?option='\n . $this->container->componentName\n . '&view='\n . $this->container->inflector->pluralize($this->view)\n . $this->getItemidURLSuffix(); // e.g. '&Itemid=123' or an empty string if no Itemid\n\n return $url;\n }", "public function fbConnect($force = false)\r\n \t{\r\n \t\tif (!$this->_client->getUser() OR $force)\r\n\t\t{\r\n\t\t\treturn $this->_client->getLoginUrl($this->_requestParams);\r\n\t\t}\r\n\t\treturn true;\r\n \t}", "public function url() {\n if (empty($this->parameters)) {\n return $this->url;\n }\n\n return $this->url . '?' . http_build_query($this->parameters);\n }", "public function getFormActionUrl()\n {\n return $this->_customerUrl->getLoginPostUrl();\n }", "public function getRedirectUrl() {\n return (string) $this->getValue('redirect_url');\n }", "public function getLogoutURL(){\r\n\t\treturn $this->facebook_obj->getLogoutURL(array('next' => Config::$url));\r\n\t}", "abstract public function getAuthorizeUrl(): string;", "public function get_redirect_uri() {\n\t\treturn $this->redirect_uri;\n\t}" ]
[ "0.79769963", "0.7607471", "0.76037455", "0.7530712", "0.74724346", "0.70852387", "0.70010793", "0.6886439", "0.6831059", "0.6826939", "0.6791701", "0.6791419", "0.6683526", "0.66791666", "0.6652469", "0.6631571", "0.6618973", "0.6601239", "0.6587395", "0.6542964", "0.653787", "0.64723533", "0.64684975", "0.64566344", "0.6449173", "0.6435971", "0.6433915", "0.6426581", "0.6404662", "0.6346141", "0.6326358", "0.6301844", "0.6300958", "0.6300958", "0.6300958", "0.6300958", "0.6300958", "0.6290651", "0.62808436", "0.6261542", "0.6258776", "0.6246652", "0.62447214", "0.6214921", "0.61987007", "0.61661273", "0.61306465", "0.6125793", "0.61170465", "0.6093748", "0.60584545", "0.6055859", "0.6046068", "0.6042565", "0.6034816", "0.6023325", "0.6018211", "0.60058105", "0.6004812", "0.6000758", "0.5998777", "0.59887767", "0.59824854", "0.59799623", "0.5966961", "0.5959387", "0.5952637", "0.59517145", "0.59460527", "0.5939405", "0.59336627", "0.5931942", "0.5931942", "0.5927625", "0.59268963", "0.592217", "0.59206015", "0.59040546", "0.59033", "0.5897336", "0.58920866", "0.5874524", "0.58581674", "0.58545005", "0.5814363", "0.5798332", "0.5787277", "0.57773495", "0.5771398", "0.5764161", "0.5762448", "0.5750655", "0.57434285", "0.5737843", "0.5734143", "0.57335067", "0.57275695", "0.5710486", "0.57083464", "0.57080394" ]
0.7768422
1
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.
protected function setUp() { $container = include 'config/container.php'; InsideConstruct::setContainer($container); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "protected function setUp()\n {\n $this->fixture = new Record();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }", "protected function setUp()\n {\n\t global $sys_datacite_username, $sys_datacite_password, $sys_datacite_url ;\n\n\t $this->client = new DataCiteClient($sys_datacite_username, $sys_datacite_password);\n $this->client->setDataciteUrl($sys_datacite_url);\n }", "protected function setUp()\n {\n $this->fixture = new Configuration();\n }", "public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "protected function setUp() {\n\n $this->client = new Client(['base_uri' => getenv('API_ADDR')]);\n $this->locIDs = $this->insertTestLocations();\n reuse_generateXML();\n }", "protected function setUp(): void\n {\n $servername = '18.222.31.30';\n $username = 'phpclient';\n $password = 'leftoverkillerphp';\n $dbname = 'leftover_killer';\n self::$RecipeModel = new GetRecipeDetails($servername, $username, $password, $dbname);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "protected function setUp() {\n parent::setUp ();\n $this->storage = new Storage();\r\n $this->connectDB();\r\n $this->cleanDB();\r\n $this->createUser();\n $this->storage->connect($this->dbh);\n }", "protected function setUp() {\r\n\t\tparent::setUp ();\r\n\t\t$this->storage = new Storage ( );\r\n\t\t$this->connectDB();\r\n\t\t$this->cleanDB ();\r\n\t\t$this->createUser ();\r\n\t\t$this->storage->connect ( $this->dbh );\n\t}", "public function setUp() {\n $this->fixture= new FreeTdsLookup($this->getClass()->getPackage()->getResourceAsStream('freetds.conf'));\n }", "public static function setUpBeforeClass(): void\r\n {\r\n self::$MemoryTestAsset = new MemoryTestAsset();\r\n\r\n self::$clients = self::$MemoryTestAsset->getClients();\r\n self::$ClientsStorage = self::$MemoryTestAsset->getClientsStorage();\r\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "protected function setUp()\n {\n parent::setUp();\n $config = new LocalConfiguration();\n $this->local = new Local($config);\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t\n\t\t// Set up fixture\n\t\tif($fixtureFile) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\t// This code is a bit misplaced; we want some way of the whole session being reinitialised...\n\t\t\tVersioned::reading_stage(null);\n\n\t\t\tsingleton('DataObject')->flushCache();\n\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// We have to disable validation while we import the fixtures, as the order in\n\t\t\t// which they are imported doesnt guarantee valid relations until after the\n\t\t\t// import is complete.\n\t\t\t$validationenabled = DataObject::get_validation_enabled();\n\t\t\tDataObject::set_validation_enabled(false);\n\t\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t\t$this->fixture->saveIntoDatabase();\n\t\t\tDataObject::set_validation_enabled($validationenabled);\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new ControllerFixture([\n\t\t\t'module' => 'module',\n\t\t\t'controller' => 'controller',\n\t\t\t'action' => 'action',\n\t\t\t'args' => [100, 25]\n\t\t]);\n\n\t\t// Used by throwError()\n\t\tTiton::router()->initialize();\n\t}", "protected function setUp(): void\n {\n \tparent::setUp();\n\n \t$this->authorize();\n\n \t$this->loadFixtures([\n \t\t'product'=>ProductFixture::class\n \t]);\n }", "protected function setUp()\n {\n $this->fixture = new NamespaceDescriptor();\n }", "public function setUp()\n {\n $this->fixture = new Finder();\n }", "protected function setUp(): void\n {\n $this->fixture = new TestSubjectDescriptor();\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// i18n needs to be set to the defaults or tests fail\n\t\ti18n::set_locale(i18n::default_locale());\n\t\ti18n::set_date_format(null);\n\t\ti18n::set_time_format(null);\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\t\t\n\t\tif(class_exists('RootURLController')) RootURLController::reset();\n\t\tif(class_exists('Translatable')) Translatable::reset();\n\t\tVersioned::reset();\n\t\tDataObject::reset();\n\t\tif(class_exists('SiteTree')) SiteTree::reset();\n\t\tHierarchy::reset();\n\t\tif(Controller::has_curr()) Controller::curr()->setSession(new Session(array()));\n\t\t\n\t\t$this->originalTheme = SSViewer::current_theme();\n\t\t\n\t\tif(class_exists('SiteTree')) {\n\t\t\t// Save nested_urls state, so we can restore it later\n\t\t\t$this->originalNestedURLsState = SiteTree::nested_urls();\n\t\t}\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';\n\n\t\t// Set up fixture\n\t\tif($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5) != strtolower(sprintf('%stmpdb', $prefix))) {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t\t\n\t\t\tself::empty_temp_db();\n\t\t\t\n\t\t\tforeach($this->requireDefaultRecordsFrom as $className) {\n\t\t\t\t$instance = singleton($className);\n\t\t\t\tif (method_exists($instance, 'requireDefaultRecords')) $instance->requireDefaultRecords();\n\t\t\t\tif (method_exists($instance, 'augmentDefaultRecords')) $instance->augmentDefaultRecords();\n\t\t\t}\n\n\t\t\tif($fixtureFile) {\n\t\t\t\t$pathForClass = $this->getCurrentAbsolutePath();\n\t\t\t\t$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);\n\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($fixtureFiles as $fixtureFilePath) {\n\t\t\t\t\t// Support fixture paths relative to the test class, rather than relative to webroot\n\t\t\t\t\t// String checking is faster than file_exists() calls.\n\t\t\t\t\t$isRelativeToFile = (strpos('/', $fixtureFilePath) === false || preg_match('/^\\.\\./', $fixtureFilePath));\n\t\t\t\t\tif($isRelativeToFile) {\n\t\t\t\t\t\t$resolvedPath = realpath($pathForClass . '/' . $fixtureFilePath);\n\t\t\t\t\t\tif($resolvedPath) $fixtureFilePath = $resolvedPath;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$fixture = new YamlFixture($fixtureFilePath);\n\t\t\t\t\t$fixture->saveIntoDatabase();\n\t\t\t\t\t$this->fixtures[] = $fixture;\n\n\t\t\t\t\t// backwards compatibility: Load first fixture into $this->fixture\n\t\t\t\t\tif($i == 0) $this->fixture = $fixture;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->logInWithPermission(\"ADMIN\");\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t\tEmail::send_all_emails_to(null);\n\t\t\n\t\t// Preserve memory settings\n\t\t$this->originalMemoryLimit = ini_get('memory_limit');\n\t}", "public function setUp(): void\n {\n $this->fixture = new Finder();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.7594359", "0.71718794", "0.6927686", "0.6909226", "0.6890869", "0.6883452", "0.68154573", "0.6802897", "0.6753053", "0.67515224", "0.67450434", "0.6732158", "0.6713064", "0.6706926", "0.6701315", "0.6682986", "0.6682986", "0.6682986", "0.6682986", "0.6682986", "0.66785055", "0.66771275", "0.667283", "0.6669966", "0.6647645", "0.6646131", "0.66456515", "0.6636818", "0.66186833", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66166425", "0.66163033", "0.66163033", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087", "0.6616087" ]
0.0
-1
Tears down the fixture, for example, closes a network connection. This method is called after a test is executed.
protected function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "public function teardown()\n {\n }", "public function _after(TestCase $test)\n {\n $this->unloadFixtures();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }", "protected function tearDown(): void\n {\n self::$driver->close();\n }", "public function tearDown()\n\t{\n\t\tm::close();\n\t}", "protected function tearDown()\n {\n if ($this->databaseTester !== null) {\n if (method_exists($this, 'getTearDownOperation')) {\n $this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n $this->getDatabaseTester()->onTearDown();\n }\n\n $this->databaseTester = null;\n\n set_time_limit(0);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "function teardown() {\n // close database connection\n $this->conn = null;\n }", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown(): void\n {\n $this->closeDatabase();\n }", "protected function tearDown() {\n\t\tm::close();\n\t}", "public function tearDown()\n\t{\n\t\t$this->beforeApplicationDestroyed(function () {\n\t\t\tDB::disconnect();\n\t\t});\n\t\n\t\t\tparent::tearDown();\n\t\t\t// \t\tMockery::close();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}", "protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown(): void\n {\n $client = $this->getProvidedData()[0] ?? null;\n if ($client instanceof Client) {\n $this->logout($client);\n }\n }", "public function teardown()\n {\n parent::teardown();\n }", "protected function doTearDown(): void\n {\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "public function teardown() {\n m::close();\n }", "public function tearDownFixtures()\n {\n if (is_array($this->_fixtures)) {\n /** @var ActiveRecordFixture $object */\n foreach ($this->_fixtures as $object) {\n $object->cleanup();\n }\n }\n }", "protected function tearDown()\n {\n // Make sure any test entities created are deleted\n foreach ($this->testEntities as $entity)\n {\n // Second param is a 'hard' delete which actually purges the data\n $this->entityLoader->delete($entity, true);\n }\n }", "public function teardown()\n {\n m::close();\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->tearDownTheTestEnvironment();\n }", "protected function tearDown() {\r\n\t\tunset ( $this->configReader );\r\n\t}", "protected function tearDown() {\n\t\t$this->sql->Disconnect(__FILE__, __LINE__);\n\t\tsqlsolution_unlink_sqlite($this->sql);\n\t\t$this->sql = null;\n\t}", "protected function tearDown()\n {\n parent::tearDown();\n\n $this->em->close();\n $this->em = null; // avoid memory leaks\n }", "protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }", "public function tearDown() {\n\n\t\tparent::tearDown();\n\t\tMockery::close();\n\t}", "public function tearDown()\n {\n $this->stop();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n unset($this->helper);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function tearDown()\n\t{\n\t\tunset($this->stub);\n\t}", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\"DROP TABLE IF EXISTS `MySQLdatabase`;\");\n\n\t\tunset($GLOBALS[\"errstr\"]);\n\t\tunset($GLOBALS[\"stuckerror\"]);\n\t }", "protected function tearDown()\n {\n $this->local = null;\n parent::tearDown();\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\n parent::tearDown ();\n }", "protected function tearDown()\n {\n $this->kernel->shutdown();\n $this->kernel = null;\n parent::tearDown();\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tearDown()\n\t{\n\t\t\\Orchestra\\Core::shutdown();\n\n\t\tunset($this->user);\n\t\tunset($this->stub);\n\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n parent::tearDown();\n\n if ((bool) getenv('CLEANUP_TEST_DOCKER_SECRETS')) {\n DockerSecretFile::cleanup();\n }\n }", "protected function tearDown()\n\t{\n\t\t$this->restoreFactoryState();\n\t}", "protected function tearDown()\n {\n $this->dataCollector = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($_SERVER['RouteManagerTest@callback']);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(){\n\t\t$this->container->get('doctrine')->getConnection()->close();\n\t\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }", "public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }", "protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }", "public function tearDown()\n {\n $this->deleteAdminUserFixture();\n }", "public function tearDown()\n {\n $this->flushModelEventListeners();\n parent::tearDown();\n unset($this->app);\n\n /*\n * Restore environment\n */\n if (file_exists(base_path($this->envTestingFile())) && file_exists(base_path('.env.backup'))) {\n $this->restoreEnvironment();\n }\n }", "public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }", "protected function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t\tFragseizeObj::release( $this->uid );\n\t}", "protected function tearDown()\n {\n $this->client = null;\n }", "public function tearDown() \n {\n $this->flushSession();\n \n $this->inactiveUser->delete();\n $this->basicUser->delete();\n $this->contactManager->delete();\n $this->projectManager->delete();\n $this->administrator->delete();\n\n parent::tearDown();\n Mockery::close();\n }", "public function tearDown() {\n // tests using these functions.\n \\mod_forum\\subscriptions::reset_forum_cache();\n\n $this->messagesink->clear();\n $this->messagesink->close();\n unset($this->messagesink);\n\n $this->mailsink->clear();\n $this->mailsink->close();\n unset($this->mailsink);\n }", "public function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\t$this->databaseTester = NULL;\n\t}", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "protected function tearDown()\n {\n $this->helper = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n $this->client = null;\n }", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "public static function tearDownAfterClass(): void\n {\n if (file_exists(static::$ou)) {\n unlink(static::$ou);\n }\n }", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "protected function tearDown()\r\n {\r\n $application = new Application(self::$kernel);\r\n $application->setAutoExit(false);\r\n\r\n $options = array('command' => 'doctrine:database:drop', '--force' => true);\r\n $application->run(new ArrayInput($options));\r\n\r\n parent::tearDown();\r\n\r\n $this->em->close();\r\n $this->em = null;\r\n }", "protected function tearDown()\n {\n $this->deleteTemporaryFiles();\n }", "protected function tearDown()\n {\n parent::tearDown();\n if (!is_null($this->em)) {\n $this->em->getConnection()->close();\n }\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "public function tearDown()\n {\n Resistance::reset();\n }", "protected function tearDown()\n {\n $this->clock = NULL;\n }", "public function tearDown()\n\t{\n\t\tMockery::close();\n\t}", "protected function tearDown()\n\t{\n\t\tparent::tearDown ();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t}" ]
[ "0.7305884", "0.72363096", "0.72212136", "0.7186411", "0.7185969", "0.7147698", "0.7139477", "0.71342164", "0.71195495", "0.71028876", "0.70804775", "0.7078321", "0.7076728", "0.7052231", "0.7047989", "0.7032463", "0.70217025", "0.7014006", "0.7001004", "0.7000039", "0.69995433", "0.6991728", "0.69898546", "0.69807404", "0.6958304", "0.6955536", "0.6955027", "0.6945766", "0.69373125", "0.6933293", "0.6927992", "0.69251347", "0.6922546", "0.6918061", "0.6908894", "0.69087523", "0.6905898", "0.6899333", "0.68918276", "0.68891054", "0.68891054", "0.68891054", "0.6888888", "0.6888771", "0.6882498", "0.68618613", "0.6861339", "0.6858051", "0.6858051", "0.6858051", "0.6858051", "0.6858051", "0.685378", "0.6851667", "0.685154", "0.685154", "0.685154", "0.6851015", "0.6843794", "0.68388164", "0.6837794", "0.68329906", "0.6829558", "0.68285316", "0.6811144", "0.6809712", "0.6806901", "0.6805895", "0.68057334", "0.68022907", "0.68001854", "0.6791959", "0.6791082", "0.67882854", "0.6778513", "0.6774182", "0.6769384", "0.6768997", "0.6767362", "0.6767255", "0.6760927", "0.6760927", "0.6760927", "0.6760927", "0.6760927", "0.6760927", "0.67590916", "0.675906", "0.6756342", "0.6754024", "0.67538404", "0.67526543", "0.67526543", "0.67526543", "0.67526543", "0.67526543", "0.67526543", "0.67504245", "0.67485857", "0.6748052", "0.6747746" ]
0.0
-1
for the closing html / This function contructs the title of the specific view.
function __construct($title = "Default") { $this->_title = $title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function renderTitle()\n\t{\n\t\treturn '<h1 class=\"block-new-title\">' . $this->title . '</h1>';\n\t}", "protected function renderPageTitle() {}", "public function get_document_title_template()\n {\n }", "function _block_template_render_title_tag()\n {\n }", "public function restoration_title($title) {\n\t\techo '<h2>'.$title.'</h2>';\n\t}", "abstract protected function getTitle();", "private function _generateTitle()\n {\n $title = '';\n foreach ($this->_contents as $content)\n {\n $title = ('' == $title) ? $content->myGetSeoTitleTag() : $content->myGetSeoTitleTag().' | '.$title;\n }\n return $title;\n }", "function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}", "public function title();", "public function title();", "public function getTitle()\n {\n return \"\"; // Should be updated by children classes\n }", "public function title($title) {\n return $this->view->title = $title;\n }", "private function setTitle()\n {\n $this->title = $this->start_date;\n\n if ($this->start_date != $this->end_date) {\n $this->title .= ' - '.$this->end_date;\n }\n }", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "function getTitle() ;", "public function get_title()\n {\n }", "function generate_content(&$title)\n {\n $title = $this->title;\n }", "public function get_title()\n {\n }", "public function get_title();", "public static function title();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public abstract function getTitle();", "abstract public function getTitle();", "abstract public function getTitle();", "abstract public function getTitle();", "protected function view_getPageTitle() {\n return 'HalloPizza';\n }", "public function titleCallback() {\r\n return [\r\n '#markup' => $this->t('The title of this page is dynamically changed by the title callback for this route defined in menu_example.routing.yml.'),\r\n ];\r\n }", "public function title() {\n return \"{$this->venuename} ({$this->id})\";\n }", "public function after_the_title() {\n\t\techo '</div>';\n\t}", "protected function regeneratePageTitle() {}", "private function generate_title()\r\n\t\t{\r\n\t\t\treturn $this->c_title;\r\n\t\t}", "function get_title() \t{\n \t\treturn $this->title;\t\n \t}", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function _wp_render_title_tag()\n {\n }", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "private function titleTab($title = \"\"){\n \t$title .= \"\";\n \treturn $title;\n }", "function get_title()\n {\n }", "function set_title($title) \r\n\t{\r\n\t\t//$this->title = $title;\r\n\t\t$this->data['title_for_layout'] = $title;\r\n\t\t$this;\r\n\t}", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function protected_title_format()\n {\n }", "public function title(){\n if (func_num_args() > 0){\n $this->title = func_get_arg(0);\n }\n \n return $this->title;\n }", "public function buildTitle()\r\n\t{\r\n\t\t$data\t= '<h1>' . t( 'intouch.admin.title', t( 'intouch.admin.title.' . $this->action . '.' . $this->task ) ) . '</h1>';\r\n\t\treturn $data;\r\n\t}", "function shoestrap_empty_page_title() {}", "abstract public function getActionTitle();", "public function render()\n {\n return view('components.common.top-title');\n }", "public function getMetaTitle();", "protected function page_title() {\n?>\n\t\t<h2>\n\t\t\t<?php echo __( 'Marketplace Add-ons', APP_TD ); ?>\n\t\t\t<a href=\"https://marketplace.appthemes.com/\" class=\"add-new-h2\"><?php _e( 'Browse Marketplace', APP_TD ); ?></a>\n\t\t\t<a href=\"https://www.appthemes.com/themes/\" class=\"add-new-h2\"><?php _e( 'Browse Themes', APP_TD ); ?></a>\n\t\t</h2>\n<?php\n\t}", "public function getTitle() {\n\t\treturn '';\n\t}", "private function appendMasterTitle(){\r\n\t\t$title = $this->head->GetTitle() != null ? $this->head->GetTitle() . \" | \" : \"\";\r\t\t$titleExtension = \"\";\r\t\tif(empty($this->langService) || $this->langService->IsDefaultSelected()){\r\t\t\t$titleExtension = $this->CI->config->item(\"zt_site_title\") . \" - \" . $this->CI->config->item(\"zt_site_slogan\");\t\r\t\t} else {\r\t\t\t$titleExtension = $this->CI->config->item(\"zt_site_title\") . \" - \" . $this->CI->config->item(\"zt_site_slogan_\" . $this->langService->GetLangCode());\r\t\t}\r\r\t\t$title .= $titleExtension;\r\n\t\treturn $this->head->SetTitle($title);\r\n\t}", "function title(){\n\t\t\techo $mytitle= \"Profile. Car Parking Website\";\n\t\t\t\n\t\t}", "public function generateContent()\n {\n parent::generateContent();\n $pathArray = $this->currentPageStrategy->getCurrentPagePath();\n $titleString = '';\n foreach ($pathArray as $page) {\n /** @var $page Page */\n\n $titleString .= ' - ' . (($t = $page->getTitle()) == '_404' ? 'Siden blev ikke fundet' : $t);\n }\n\n return $titleString;\n }", "public function loadPageTitle()\n \t\t{\n echo \"<title>Add Item</title>\";\n }", "function __handler()\n {\n $this->view('index')->title('Main page');\n }", "function minorite_views_pre_render(&$view) {\n $view->set_title(t($view->get_title()));\n}", "static function title($content='') {\n\t\treturn self::tag('title', false, strip_tags($content));\n\t}", "protected function makeTitle()\n {\n $this->setY($this->layout['titleMarginTop']);\n $this->setFont('', 'B', $this->layout['titleFontSize']);\n $this->write($this->layout['titleCellHeight'], $this->content['title']);\n $this->setFont('', '', $this->layout['fontSize']);\n }", "protected function addHtmlTitle($viewName = '')\r\n {\r\n $data = array();\r\n $keyName = 'title';\r\n $values = array();\r\n\r\n if (isset($this->yamlConfig['all']['metas'][$keyName]))\r\n {\r\n $values = is_array($this->yamlConfig['all']['metas'][$keyName]) ? $this->yamlConfig['all']['metas'][$keyName] : array($this->yamlConfig['all']['metas'][$keyName]);\r\n }\r\n \r\n if ($viewName && isset($this->yamlConfig[$viewName]['metas'][$keyName]))\r\n {\r\n $values = array_merge($values, is_array($this->yamlConfig[$viewName]['metas'][$keyName]) ? $this->yamlConfig[$viewName]['metas'][$keyName] : array($this->yamlConfig[$viewName]['metas'][$keyName]));\r\n }\r\n $values = array_reverse(array_filter($values));\r\n \r\n foreach ($values as $part) {\r\n \r\n $data[] = sprintf(\" \\$response->getTitle()->unshift('%s');\", str_replace('\\'', '\\\\\\'', preg_replace('/&amp;(?=\\w+;)/', '&', htmlspecialchars($part, ENT_QUOTES, sfConfig::get('sf_charset')))));\r\n }\r\n \r\n return implode(\"\\n\", $data).\"\\n\";\r\n }", "function title($title, $tabs = 2)\n{\n /**\n * Add a title into the html file.\n *\n * Args:\n * $title (str): the title to add\n * $tabs (int): number of tabs for indentation, default is 2\n */\n start_tag('title', Tab($tabs), false) ;\n echo $title ;\n close_tag('title', '', true) ;\n}", "public function get_title() { return $this->title; }", "function getTitle();", "function getTitle();", "public function getTitle()\n {\n return P4Cms_Navigation::expandMacros(parent::getTitle(), $this);\n }", "abstract public static function title(): string;", "function title()\n {\n // TRANS: Page title for revising a question\n return _m('Revise answer');\n }", "abstract protected function getTitle(): string;", "public function __invoke($title, $subTitle = '')\n {\n $escapeHtml = $this->getView()->plugin('escapeHtml');\n $title = $escapeHtml($title);\n $html = '<div class=\"page-header\">\n <h1>' . $title . '\n <small>' . $subTitle . '</small>\n </h1>\n</div>';\n\n return $html;\n }" ]
[ "0.6719923", "0.6619914", "0.6559236", "0.6539286", "0.65304154", "0.6517653", "0.64956313", "0.64174056", "0.6400705", "0.6400705", "0.63820285", "0.6362772", "0.6359092", "0.63445693", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.6344505", "0.634301", "0.634301", "0.6339754", "0.6338356", "0.63375616", "0.6337215", "0.63309544", "0.63195515", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.631474", "0.6295177", "0.62943", "0.62943", "0.62943", "0.6274221", "0.6273576", "0.6272238", "0.62658995", "0.6251414", "0.6249936", "0.6244393", "0.62417823", "0.62417823", "0.62417823", "0.62417823", "0.62417823", "0.62417823", "0.62417823", "0.62406874", "0.6195876", "0.6192756", "0.61867297", "0.61863214", "0.6181912", "0.6181912", "0.6181912", "0.6181854", "0.61714154", "0.6160247", "0.6147559", "0.6119359", "0.611811", "0.6117852", "0.6104241", "0.6078034", "0.6070746", "0.60702986", "0.60531163", "0.60438937", "0.60263515", "0.60260975", "0.6019776", "0.60158753", "0.60102904", "0.6008978", "0.6002264", "0.6002264", "0.60000616", "0.5996088", "0.5995092", "0.59835285", "0.5982646" ]
0.0
-1
end construct / This function adds the requested html elements to the document head section.
function addHeadElement($include) { $this->_headSection .= $include . "\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildHeadMarkup(){\n\n echo file_get_contents(\"head/home.html\");\n\n $this->head_script_tags = \"\";\n\n foreach( $this->head_scripts as $value ){\n\n $this->head_script_tags .= \"<script src=\\\"\" . $value . \"\\\"></script>\";\n\n }\n\n $this->head = file_get_contents(\"head/home.html\").$this->head_script_tags.\"</head>\";\n\n }", "function initialize () {\n $this->set_openingtag ( \"<HEAD[attributes]>\" );\n\t $this->set_closingtag ( \"</HEAD>\" );\n }", "public function head_add($html) {\n\t\tif (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t$this->_head[] .= $html;\n\t}", "function getHTML_additionalHeaderData() {\n\t\t\t// get js configs\n\t\t\t// get topical element and overwrite startID in appConf['js.']['config.']\n\t\tif ($this->appConf['topicAtStart']) {\n\t\t\t$this->appConf['js.']['config.']['startIndex'] = $this->appConf['topicId'];\n\t\t}\n\t\t\t// only boolean and integers allowed, strings ar not supported\n\t\tif (is_array($this->appConf['js.']['config.'])) {\n\t\t\t$configArray = array();\n\t\t\tforeach ($this->appConf['js.']['config.'] as $key => $val) {\n\t\t\t\t$configArray[] = trim($key) . ': ' . trim($val);\n\t\t\t}\n\t\t\t$config = implode(', ',$configArray);\n\t\t}\n\t\t\t// additional headers as css & js\n\t\t$GLOBALS['TSFE']->additionalHeaderData['contentcoverflow'] .= '\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['core.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['more.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['mod.']['file'] . '\"></script>\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->appConf['css.']['file'] . '\" />\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t/* <![CDATA[ */\n\t\t\t\tvar myMooFlowPage = {\n\t\t\t\t\tstart: function(){\n\t\t\t\t\t\tvar mf = new MooFlow($(\\'MooFlow\\'), {\n\t\t\t\t\t\t\t' . $config . ',\n\t\t\t\t\t\t\t\\'onClickView\\': function(obj){\n\t\t\t\t\t\t\t\tmyMooFlowPage.link(obj);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\\'onStart\\': function(){\n\t\t\t\t\t\t\t\tthis.autoPlay = this.auto.periodical(this.options.interval, this);\n\t\t\t\t\t\t\t\tthis.isAutoPlay = true;\n\t\t\t\t\t\t\t\tthis.fireEvent(\\'autoPlay\\');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\n\t\t\t\t\tlink: function(result){\n\t\t\t\t\t\tif (result.target == \"_blank\") {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\twindow.addEvent(\\'domready\\', myMooFlowPage.start);\n\n\t\t\t\t/* ]]> */\n\t\t\t</script>\n\t\t';\n\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 setHead($tagName,$attributes,$inner = '',$index = ''){\r\n\t\t$this->head($index,$tagName,$attributes,$inner);\r\n\t}", "function start_head($extra = '')\n{\n /**\n * Starting the HTML head section\n *\n * Args:\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n start_tag('head', Tab(1), true, $extra) ;\n}", "private function _renderXhtmlHead() {\r\n\t\t\r\n?>\r\n\t<head>\r\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n\t\t<title><?php echo \"$this->_title\"; ?></title>\r\n\t\t<link rel=\"shortcut icon\" href=\"favicon.png\" type=\"image/png\" />\r\n<?php\r\n\r\n\t\t$this->_stylesheets->render();\r\n\t\t$this->_scripts->render();\r\n\t\t$this->_keywords->render();\r\n\r\n\t\tif (isset($this->_description)) {\r\n?>\r\n\t\t<meta name=\"description\" content=\"<?php echo \"$this->_description\"; ?>\" />\r\n<?php\r\n\r\n\t\t}\r\n\r\n?>\r\n\t</head>\r\n<?php\r\n\t\t\r\n\t}", "public function head()\n {\n return <<<HTML\n<title>$this->title</title>\n<!-- Meta Tags -->\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"keywords\" content=\"josh benner, developer, javascript, api, web app, designer, linkedin scraper\">\n<meta name=\"author\" content=\"Josh Benner\">\n<meta name=\"description\" content=\"Web Apps, personal projects, and lots of data; The professional website of Josh Benner\">\n\n<!-- DOWNLOAD AND HOST BOOTSTRAP LOCALLY-->\n<!-- Stylesheets -->\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\"></script>\n<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js\"></script>\n<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css\">\n<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\">\n<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../lib/css/normalize.css\">\n<link rel=\"stylesheet\" href=\"../lib/css/main.css\">\nHTML;\n }", "function head($coment, $tag, $attribute, $inner=''){\r\n\t\tif(!$tag){\r\n\t\t\t$this->Head[$coment] = '';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$n = '';\r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\t\t\r\n\t\tif($coment === null || $coment === '') $coment = 'sys_'.count($this->Head);\r\n\t\t\r\n\t\tif($tag == 'title' && !$inner){\r\n\t\t\t$inner = ' ';\r\n\t\t}\r\n\t\tif($tag == 'script'){\r\n\t\t\t$attribute['type'] = 'text/javascript';\r\n\t\t\tif($inner == '') $inner = ' ';\r\n\t\t\t\r\n\t\t\tif(isset($attribute['src'])){\r\n\t\t\t $attribute['src'] = str_replace('ROOT_VIRTUAL',$GLOBALS['BASIC']->ini_get('root_virtual'),$attribute['src']);\r\n\t\t\t}\r\n\t\t\tif($inner && $inner != ' ' && isset($attribute['src'])){\r\n\t\t\t\t$att = $attribute; unset($att['src']);\r\n\t\t\t\t$this->Head[$coment.'_inner'] = $n.$this->create($tag,$att,$inner);\r\n\t\t\t\t$inner = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($tag == 'style'){\r\n\t\t\tif(isset($attribute['href'])) $tag = 'link';\r\n\t\t}\r\n\t\tif($tag == 'link'){\r\n\t\t\t$attribute['rel'] = 'stylesheet';\r\n\t\t\t$attribute['type'] = 'text/css';\r\n\t\t\t\r\n\t\t\tif(isset($attribute['href'])){\r\n\t\t\t $attribute['href'] = str_replace('ROOT_VIRTUAL',$GLOBALS['BASIC']->ini_get('root_virtual'),$attribute['href']);\r\n\t\t\t}\r\n\t\t\t$n = \"\\n\";\r\n\t\t}\r\n\t\t\r\n\t\t$this->Head[$coment] = $n.$this->create($tag,$attribute,$inner);\r\n\t}", "function beerfamily_html_head_alter(&$head_elements) {\n \n // текущий url \n $current_uri = $_SERVER['REDIRECT_URL'];\n \n // цикл по meta-tags\n foreach ($head_elements as $key => $element) {\n\n \t\t// если страница главная, переопределяем canonical\n\t\tif (($current_uri == '') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n\t\t// если страница главная, переопределяем shortlink\n\t\tif (($current_uri == '') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n\n\t\t// если страница главная, переопределяем canonical\n\t\tif (($current_uri == '/') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n\t\t// если страница главная, переопределяем shortlink\n\t\tif (($current_uri == '/') && isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'shortlink') {\n\t\t\t$head_elements[$key]['#attributes']['href'] = 'http://beerfamily.ru/';\n } \n \n }\n\n // получаем тип ноды\t \n $node = menu_get_object();\n $node->type;\n\n // если нода не news то не индексируем сущность\n if ( ($current_uri != \"/news\") && ($node->type != \"news\") ) {\n\t \n\t $head_elements[1000][\"#tag\"] = 'link';\n\t $head_elements[1000]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1000]['#attributes']['hreflang'] = 'ru';\n\t $head_elements[1000]['#attributes']['href'] = 'http://beerfamily.ru'.$current_uri;\n\t $head_elements[1000]['#type'] = 'html_tag';\n\n\t $head_elements[1001][\"#tag\"] = 'link';\n\t $head_elements[1001]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1001]['#attributes']['hreflang'] = 'en-us';\n\t $head_elements[1001]['#attributes']['href'] = 'http://beerfamily.ru/en'.$current_uri;\n\t $head_elements[1001]['#type'] = 'html_tag';\n\n\t $head_elements[1002][\"#tag\"] = 'link';\n\t $head_elements[1002]['#attributes']['rel'] = 'alternate';\n\t $head_elements[1002]['#attributes']['hreflang'] = 'zh-cn';\n\t $head_elements[1002]['#attributes']['href'] = 'http://beerfamily.ru/cn'.$current_uri;\n\t $head_elements[1002]['#type'] = 'html_tag';\n\n }\n\n // получаем текущий язык\n if (strpos($current_uri,'en/') != \"\") $lang = 'en';\n if (strpos($current_uri,'cn/') != \"\") $lang = 'cn';\n \n // если нода news и язык en или cn то не индексируем сущность\n if ( ($node->type == \"news\") && ( ($lang == 'en') || ($lang == 'cn') )) {\n\t \n\t $head_elements[1003][\"#tag\"] = 'meta';\n\t $head_elements[1003]['#attributes']['name'] = 'robots';\n\t $head_elements[1003]['#attributes']['content'] = 'nofollow';\n\t $head_elements[1003]['#type'] = 'html_tag'; \n \n }\n \n // переопределяем description\n\n // если нода beers и язык не en и не cn пишем description для страницы Пива\n \n if ( ($node->type == \"beer\") && ( $lang != 'en') && ($lang != 'cn') ){\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить пиво '.$node->title.' оптом и в розницу. Описание, крепость, плотность пива.';\n\t $head_elements[1004]['#type'] = 'html_tag'; \t \n }\n \n switch ($current_uri) {\n case '':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#attributes']['content'] = 'Официальный сайт ресторанной группы Beer Family Project холдинга ReCa в Санкт-Петербурге. История и описание компании.';\n\t $head_elements[1004]['#type'] = 'html_tag'; \t \n\t break;\n\t \n case '/restaurants':\t \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Список пивных ресторанов и баров в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/jager-haus':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть немецких пивных ресторанов Jager в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/karlovy-pivovary':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть чешских пивных ресторанов Karlovy Pivovary в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t \n\tcase '/restaurants/kriek':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть бельгийских пивных ресторанов Kriek в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\n\tcase '/restaurants/ivandamaria':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть гастробаров Иван да Марья в центре Санкт-Петербурга от группы компаний Beer Family Project. Описание ресторана русской кухни, меню и фотографии, расположение ресторанов на карте.';\n\t break;\n\t\n\tcase '/restaurants/beer-family-restaurant':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть ресторанов Beer Family на Невском проспекте Санкт-Петербурга от группы компаний Beer Family Project. Описание, меню и фотографии, расположение ресторана на карте.';\n\t break;\n\t \n\tcase '/about':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'История компании Beer Family Project';\n\t break;\n \n\tcase '/beers':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить импортное пиво оптом. Большой ассортимент пива разных сортов! Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\n case '/distribution':\n\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Дистрибуция пива в Санкт-Петербурге. Компании-дистрибьюторы пива';\n\t break;\n\n\tcase '/franchise':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Хотите открыть пивной ресторан или пивной бар по франшизе? Станьте новым членом нашей дружной семьи Beer Family Project с франшизой наших концептов! ';\n\t break;\n\n case '/restaurants':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Сеть ресторанов Beer Family Project: Kriek, Karlovy Pivovary, Jager, Иван да Марья';\n\t break;\n\n case '/news':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Новости компании Beer Family Project';\n\t break;\n\n case '/jobs':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Вакансии компании Beer Family Project. ';\n\t break;\n\n case '/partners':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Партнеры компании Beer Family Project. ';\n\t break;\n \n\tcase '/beers/chehiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее чешское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n \n case '/beers/irlandiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее ирландское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\n case '/beers/angliya': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее английское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/shotlandiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее шотландское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/germaniya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее немецкое пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/belgiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее бельгийское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/kraftovoe-pivo': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'В компании Beer Family Project вы можете купить бутылочное и разливное крафтовое пиво. Звоните! ☎️ 8 (812) 337-58-95 ';\n\t break;\n\t\n\tcase '/beers/cidry': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящий сидр оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/avstriya': \n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее австрийское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t\n\tcase '/beers/italiya':\n\t $head_elements[1004][\"#tag\"] = 'meta';\n\t $head_elements[1004]['#attributes']['name'] = 'description';\n\t $head_elements[1004]['#type'] = 'html_tag'; \n\t $head_elements[1004]['#attributes']['content'] = 'Купить настоящее итальянское пиво оптом или в розницу, кегах или бутылках в компании Beer Family Project. Звоните! ☎️ 8 (812) 337-58-95';\n\t break;\n\t \n }\n \n // добавляем meta для постраничных\n if ($_GET['page'] >= 1){\n\t if ( ( $lang != 'en') && ($lang != 'cn') ){\n\t\t $head_elements[1005][\"#tag\"] = 'meta';\n\t\t $head_elements[1005]['#attributes']['name'] = 'robots';\n\t\t $head_elements[1005]['#type'] = 'html_tag'; \n\t\t $head_elements[1005]['#attributes']['content'] = 'noindex, follow';\n\t }\n }\n \n}", "function html_head_from_all_pagest()\r\n{\r\n $ht_head = '\r\n <!DOCTYPE html>\r\n <html lang=\"en\">\r\n <head>\r\n <meta charset=\"UTF-8\">\r\n <title>Кредитный калькулятор</title>\r\n <link rel=\"stylesheet\" href=\"css/style.css\">\r\n <script src=\"http://code.jquery.com/jquery-1.7.1.min.js\"></script>\r\n <script src=\"js/script.js\"></script> \r\n <style>\r\n body{\r\n font-family: \"Segoe UI Light\";\r\n }\r\n #tr{\r\n \r\n font-size: x-large;\r\n }\r\n \r\n span {\r\n font-weight: 700;\r\n font-size: large;\r\n }\r\n </style> \r\n </head>';\r\n echo $ht_head;\r\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}", "public function head() {\r\n return <<<HTML\r\n <meta charset=\"utf-8\">\r\n <title>$this->title</title>\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <link href=\"steampunked.css\" type=\"text/css\" rel=\"stylesheet\" />\r\n\r\nHTML;\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 }", "function generate_page_head ( $titre, $description, $tags, $res_segments ){\n\t\t$html = \"<html lang='fr'>\n\t<head>\n\t\t<title>\".$titre.\"</title>\n\t\t<link rel='shortcut icon' type='image/png' href='img/favicon.png'>\n\t\t<link rel='stylesheet' type='text/css' href='lib/site.css'>\n\t\t<link href='http://fonts.googleapis.com/css?family=Oleo+Script' rel='stylesheet' type='text/css'>\n\t\t<meta charset='utf-8'>\n\t\t<meta name='description' content='\".$description.\"'>\n\t\t<meta name='keywords' content='\".$tags.\"'>\";\n\t\t\n\t\t// If page has segments\n\t\t//$html .= sizeof($res_segments);\n\t\tif ( $res_segments != \"\" ){\n\t\t\t\n\t\t\t// List all elements involved in page\n\t\t\twhile ( $row = getLine ( $res_segments ) )\t$tab_elm[$row['element']] = 1;\n\t\t\t\n\t\t\t// Include each element css file in html head\n\t\t\tforeach ( $tab_elm as $elm=>$v )\t$html .= \"\n\t\t\t<link rel='stylesheet' type='text/css' href='lib/$elm/$elm.css'>\";\n\t\t}\n\t\t\t\n\t\t// Generate site's structure : header & nav sections\n\t\t$html .= \"\n\t</head><body>\n\t\t<div id='back'>\n\t\t\t<center><div id='wrapper'>\";\n\t\t$html .= \"\n\t\t\t\t\".generate_site_header();\n\t\treturn $html;\n\t}", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[attributes]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "protected function setHeadTags()\n {\n $strTagClose = ($GLOBALS['objPage']->outputFormat == 'xhtml')\n ? ' />'\n : '>';\n\n // Add rel=\"prev\" and rel=\"next\" links (see #3515)\n if ($this->hasPrevious()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"prev\" href=\"' .\n $this->linkToPage($this->intPage - 1) .\n '\"' . $strTagClose;\n }\n if ($this->hasNext()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"next\" href=\"' .\n $this->linkToPage($this->intPage + 1) .\n '\"' . $strTagClose;\n }\n }", "function HTML_StartHead(){\n\t\techo \"<!DOCTYPE html>\\n\";\n\t\techo \"<html>\\n\";\n\t\techo \"<head>\\n\";\n}", "public function addHeader(){\n$this->page.= <<<EOD\n<html>\n<head>\n</head>\n<title>\n$this->title\n</title>\n<body>\n<h1 align=\"center\">\n$this->title\n</h1>\nEOD;\n}", "function head()\r\n{\r\n\t\t?>\r\n\t\t<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />\r\n\t\t<meta name=\"generator\" content=\"Adobe GoLive\" />\r\n\t\t<!--<meta name=\"keywords\" content=\"engagement rings, loose diamonds, hatton garden, diamond rings, earrings, wedding rings, diamonds, diamond rings hatton garden\"/>-->\r\n\t\t<meta name=\"author\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"language\" content=\"EN\"/>\r\n\t\t<meta name=\"Classification\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"copyright\" content=\"www.marcpierrediamonds.co.uk\"/>\r\n\t\t<meta name=\"robots\" content=\"index, follow\"/>\r\n\t\t<meta name=\"revisit-after\" content=\"7 days\"/>\r\n\t\t<meta name=\"document-classification\" content=\"Marcpierre Diamonds\"/>\r\n\t\t<meta name=\"document-type\" content=\"Public\"/>\r\n\t\t<meta name=\"document-rating\" content=\"Safe for Kids\"/>\r\n\t\t<meta name=\"document-distribution\" content=\"Global\"/>\r\n\t\t<meta name=\"robots\" content=\"noodp\" />\r\n\t\t<meta name=\"GOOGLEBOT\" content=\"NOODP\" />\r\n\t\t<!--[if IE 6]>\r\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"<?php echo DIR_WS_SITE?>css/iecss.css\" />\r\n\t\t<![endif]-->\r\n\t\t<!--[if lt IE 7.]>\r\n\t\t\t<script defer type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>javascript/pngfix.js\"></script>\r\n\t\t<![endif]-->\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>js/boxOver.js\"></script>\r\n\t\t<script type=\"text/javascript\" src=\"<?php echo DIR_WS_SITE?>control/js/jquery-1.2.6.min.js\"></script>\r\n\t\t<link href=\"<?=DIR_WS_SITE_CSS?>style.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\">\r\n\t\t<?\r\n\t\t\r\n\t\t\r\n\t\t\r\n}", "private function _print_html_head()\n\t{\n\t\t$output = \"<head>\\n\";\n\t\t$output .= \"<title>{$this->title}</title>\\n\";\n\t\t$output .= $this->_print_html_head_metatags();\n\t\t$output .= $this->_print_html_head_javascript();\n\t\t$output .= $this->_print_html_head_css();\n\t\t$output .= \"</head>\\n<body>\\n\";\n\t\t\n\t\treturn $output;\n\t}", "public function __construct() {\n $this->html = new HtmlElm( \"html\" );\n $head = new HtmlElm( \"head\" );\n $meta = new EmptyHtmlElm( \"meta\" );\n $this->head = $head->append( $meta->attr( \"http-equiv\", \"Content-Type\" )->attr( \"content\", \"text/html;charset=utf-8\" ) );\n $this->body = new HtmlElm( \"body\" );\n }", "function headOptimization()\r\n\t{\r\n\t\t\r\n\t\techo \"<meta name='description' content='\".$this->PageDescription().\"' />\";\r\n\t\techo \"<meta name='keywords' content='\".$this->PageKeywords().\"' />\";\r\n\t\techo \"<title>\".$this->PageTitle().\"</title>\";\r\n\t\r\n\t}", "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 v2_mumm_html_head_alter(&$head_elements) {\n $url = explode('/', current_path());\n if ($url[0] == 'gallery-photo') {\n unset($head_elements['metatag_og:title_0']);\n unset($head_elements['metatag_og:url_0']);\n }\n if(isset($head_elements['metatag_canonical']) && $head_elements['metatag_canonical']['#type'] =='html_tag'){\n $head_elements['metatag_canonical']['#value'] = urldecode($head_elements['metatag_canonical']['#value']);\n }\n}", "private static final function getEndHTMLHeadContainer () {\r\n // Return the <HTML><head> container;\r\n return new FileContent (FORM_TP_DIR . _S . 'frm_web_html_head_body.tp');\r\n }", "public function head() {\n\t\t$html = parent::head();\n\n\t\t$root = $this->course->root;\n $stepTag = $this->assignment->tag;\n\n $html .= <<<HTML\n<base href=\"$root/$stepTag/\" />\n\nHTML;\n\n\t\tif($this->file !== false) {\n\t\t\t/*\n\t\t\t * Transfer everything between <head> and </head>\n\t\t\t * except for the line automatically included by\n\t\t\t * the template\n\t\t\t */\n\n\t\t\t// Read until we get to <head>\n\t\t\twhile(($line = fgets($this->file)) != false) {\n\t\t\t\tif(stristr($line, '<head>')) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$code = $this->codeStart();\n\n\t\t\t// Read until </head>\n\t\t\twhile(($line = fgets($this->file)) != false) {\n\t\t\t\tif(stristr($line, '</head>')) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif(stristr($line, 'course.css') ||\n stristr($line, 'site.css') ||\n\t\t\t\t\tstristr($line, 'class.css') ||\n\t\t\t\t\tstristr($line, 'course.min.js') ||\n\t\t\t\t\tstristr($line, 'step/step.js') ||\n\t\t\t\t\tstristr($line, 'step/step.css') ||\n\t\t\t\t\tstristr($line, 'js/jquery') ||\n\t\t\t\t\tstristr($line, 'lib/js/video-js') ||\n\t\t\t\t\tstristr($line, 'video.css') ||\n\t\t\t\t\tstristr($line, '<title>')) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$code .= $line;\n\t\t\t}\n\n\t\t\t// This block of code does an eval on the header lines of\n\t\t\t// the page and saves the results into a string\n\t\t\tob_start();\n\t\t\teval($code);\n\t\t\t$html .= ob_get_contents();\n\t\t\tob_end_clean();\n\t\t}\n\n\t\treturn $html;\n }", "function addHead()\n\t{\n\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser();\n\t\t$input = $app->input;\n\n\t\t$responsive = $this->getParam('responsive', 1);\n\t\t$navtype = $this->getParam('navigation_type', 'joomla');\n\t\t$navtrigger = $this->getParam('navigation_trigger', 'hover');\n\t\t$offcanvas = $this->getParam('navigation_collapse_offcanvas', 0) || $this->getParam('addon_offcanvas_enable', 0);\n\t\t$legacycss = $this->getParam('legacy_css', 0);\n\t\t$frontedit = in_array($input->getCmd('option'), array('com_media', 'com_config'))\t//com_media or com_config\n\t\t\t\t\t\t\t\t\t\t|| in_array($input->getCmd('layout'), array('edit'))\t\t\t\t\t\t\t\t//edit layout\n\t\t\t\t\t\t\t\t\t\t|| (version_compare(JVERSION, '3.2', 'ge') && $user->id && $app->get('frontediting', 1) && \n\t\t\t\t\t\t\t\t\t\t\t\t($user->authorise('core.edit', 'com_modules') || $user->authorise('core.edit', 'com_menus')));\t//frontediting\n\n\t\t// LEGACY COMPATIBLE\n\t\tif($legacycss){\n\t\t\t$this->addCss('legacy-grid');\t//legacy grid\n\t\t\t$this->addStyleSheet(T3_URL . '/fonts/font-awesome/css/font-awesome.css'); //font awesome 3\n\t\t}\n\n\t\t// FRONTEND EDITING\n\t\tif($frontedit){\n\t\t\t$this->addCss('frontend-edit');\n\t\t}\n\n\t\t// BOOTSTRAP CSS\n\t\t$this->addCss('bootstrap', false);\n\n\t\t// TEMPLATE CSS\n\t\t$this->addCss('template', false);\n\n\t\tif (!$responsive && $this->responcls) {\n\t\t\t$this->addCss('non-responsive'); //no responsive\n\n\t\t\t$nonrespwidth = $this->getParam('non_responsive_width', '970px');\n\t\t\tif(preg_match('/^(-?\\d*\\.?\\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/', $nonrespwidth, $match)){\n\t\t\t\t$nonrespwidth = $match[1] . (!empty($match[2]) ? $match[2] : 'px');\n\t\t\t}\n\t\t\t$this->addStyleDeclaration('.container {width: ' . $nonrespwidth . ' !important;}');\n\t\t\n\t\t} else if(!$this->responcls){\n\t\t\t\n\t\t\t// BOOTSTRAP RESPONSIVE CSS\n\t\t\t$this->addCss('bootstrap-responsive');\n\t\t\t\n\t\t\t// RESPONSIVE CSS\n\t\t\t$this->addCss('template-responsive');\n\t\t}\n\n\t\t// add core megamenu.css in plugin\n\t\t// deprecated - will extend the core style into template megamenu.less & megamenu-responsive.less\n\t\t// to use variable overridden in template\n\t\tif($navtype == 'megamenu'){\n\n\t\t\t// If the template does not overwrite megamenu.less & megamenu-responsive.less\n\t\t\t// We check and included predefined megamenu style in base\n\t\t\tif(!is_file(T3_TEMPLATE_PATH . '/less/megamenu.less')){\n\t\t\t\t$this->addStyleSheet(T3_URL . '/css/megamenu.css');\n\n\t\t\t\tif ($responsive && !$this->responcls){\n\t\t\t\t\t$this->addStyleSheet(T3_URL . '/css/megamenu-responsive.css');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// megamenu.css override in template\n\t\t\t$this->addCss('megamenu');\n\t\t}\n\n\t\t// Add scripts\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\n\t\t\tJHtml::_('jquery.framework');\n\t\t} else {\n\t\t\t$scripts = @$this->_scripts;\n\t\t\t$jqueryIncluded = 0;\n\t\t\tif (is_array($scripts) && count($scripts)) {\n\t\t\t\t//simple detect for jquery library. It will work for most of cases\n\t\t\t\t$pattern = '/(^|\\/)jquery([-_]*\\d+(\\.\\d+)+)?(\\.min)?\\.js/i';\n\t\t\t\tforeach ($scripts as $script => $opts) {\n\t\t\t\t\tif (preg_match($pattern, $script)) {\n\t\t\t\t\t\t$jqueryIncluded = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$jqueryIncluded) {\n\t\t\t\t$this->addScript(T3_URL . '/js/jquery-1.8.3' . ($this->getParam('devmode', 0) ? '' : '.min') . '.js');\n\t\t\t\t$this->addScript(T3_URL . '/js/jquery.noconflict.js');\n\t\t\t}\n\t\t}\n\n\t\tdefine('JQUERY_INCLUED', 1);\n\n\n\t\t// As joomla 3.0 bootstrap is buggy, we will not use it\n\t\t$this->addScript(T3_URL . '/bootstrap/js/bootstrap.js');\n\t\t// a jquery tap plugin\n\t\t$this->addScript(T3_URL . '/js/jquery.tap.min.js');\n\n\t\t// add css/js for off-canvas\n\t\tif ($offcanvas && ($this->responcls || $responsive)) {\n\t\t\t$this->addCss('off-canvas', false);\n\t\t\t$this->addScript(T3_URL . '/js/off-canvas.js');\n\t\t}\n\n\t\t$this->addScript(T3_URL . '/js/script.js');\n\n\t\t//menu control script\n\t\tif ($navtrigger == 'hover') {\n\t\t\t$this->addScript(T3_URL . '/js/menu.js');\n\t\t}\n\n\t\t//reponsive script\n\t\tif ($responsive && !$this->responcls) {\n\t\t\t$this->addScript(T3_URL . '/js/responsive.js');\n\t\t}\n\n\t\t//some helper javascript functions for frontend edit\n\t\tif($frontedit){\n\t\t\t$this->addScript(T3_URL . '/js/frontend-edit.js');\n\t\t}\n\n\t\t//check and add additional assets\n\t\t$this->addExtraAssets();\n\t}", "private function renderHead() {\n\t\t\n\t\t\t$this->outputLine('<head>');\n\t\t\t\n\t\t\tif ($this->_title != '') {\n\t\t\t\t$this->outputLine('\t<title>' . $this->_title . '</title>');\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('\t<base href=\"' . $this->_base . '\" />');\n\t\t\t\n\t\t\t$this->outputLine('\t<meta http-equiv=\"content-type\" content=\"' . $this->_contentType . '\" />');\n\t\t\t\n\t\t\t//Meta\n\t\t\tforeach ($this->_meta as $meta) {\n\t\t\t\t$this->outputLine('\t<meta name=\"' . $meta->name . '\" content=\"' . $meta->content . '\" />');\n\t\t\t}\n\t\t\t\n\t\t\t//CSS\n\t\t\tforeach ($this->_css as $css) {\n\t\t\t\t$this->outputLine(\"\t\" . $css);\n\t\t\t}\n\t\t\t\n\t\t\t//JS\n\t\t\tforeach ($this->_js as $js) {\n\t\t\t\t$this->outputLine(\"\t\" . $js);\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('</head>');\n\t\t\n\t\t}", "function druplex_html_head_alter(&$head_elements) {\n $head_elements['system_meta_content_type']['#attributes'] = array(\n\t 'charset' => 'UTF-8'\n );\n}", "private function get_document_head( $html ) {\n\t\t$head_html = $html;\n\n\t\t// Find the opening `<head>` tag.\n\t\t$head_start = strpos( $html, '<head' );\n\t\tif ( false === $head_start ) {\n\t\t\t// Didn't find it. Return the original HTML.\n\t\t\treturn $html;\n\t\t}\n\n\t\t// Find the closing `</head>` tag.\n\t\t$head_end = strpos( $head_html, '</head>' );\n\t\tif ( false === $head_end ) {\n\t\t\t// Didn't find it. Find the opening `<body>` tag.\n\t\t\t$head_end = strpos( $head_html, '<body' );\n\n\t\t\t// Didn't find it. Return the original HTML.\n\t\t\tif ( false === $head_end ) {\n\t\t\t\treturn $html;\n\t\t\t}\n\t\t}\n\n\t\t// Extract the HTML from opening tag to the closing tag. Then add the closing tag.\n\t\t$head_html = substr( $head_html, $head_start, $head_end );\n\t\t$head_html .= '</head>';\n\n\t\treturn $head_html;\n\t}", "function isfnet_html_head_alter(&$head_elements) {\n $head_elements['system_meta_content_type']['#attributes'] = array(\n 'charset' => 'utf-8'\n );\n\n}", "function includeHead($title, $endFlag = 1) {\n\t\techo '<head>\n\t\t\t<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\">\n\t\t\t<meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\">\n\t\t\t<meta http-equiv=\"Content-Style-Type\" content=\"text/css\">\n\t\t\t<meta name=\"robots\" content=\"noindex, nofollow\">\n\t\t\t<title>Ujama Community | '.$title.'</title>\n\t\t\t<link rel=\"shortcut icon\" href=\"ico/favicon.ico\" type=\"image/x-icon\">\n\t\t\t<link rel=\"stylesheet\" href=\"css/mangoo.css\" />\n\t\t\t<link rel=\"stylesheet\" href=\"ico/font-awesome/css/font-awesome.min.css\">\n\t\t\t<link rel=\"stylesheet\" href=\"jquery/jquery-ui-1.11.4/jquery-ui.min.css\">\n\t\t\t<script src=\"jquery/jquery-2.2.1.min.js\"></script>\n\t\t\t<script src=\"jquery/jquery-ui-1.11.4/jquery-ui.min.js\"></script>\n\t\t\t<script>\n\t\t\t\t$(function() {\n\t\t\t\t\t$(\"#datepicker, #datepicker2, #datepicker3\").datepicker({\n\t\t\t\t\t\tshowOtherMonths: true,\n\t\t\t\t\t\tselectOtherMonths: true,\n\t\t\t\t\t\tdateFormat: \\'dd.mm.yy\\',\n\t\t\t\t\t\tchangeMonth: true,\n\t\t\t\t\t\tchangeYear: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t';\n\t\tif ($endFlag == 1) echo '</head>';\n\t}", "protected function insertScriptElements() {\n\t\t$base = $this->doc->createElement('base');\n\t\t$base->setAttribute('href', WP_Insights_Utils::url_get_base($this->record['url']));\n\t\t$ini_comm = $this->doc->createComment(\" begin wpi tracking code \");\n\t\t$end_comm = $this->doc->createComment(\" end wpi tracking code \");\n\t\t$api_comm = $this->doc->createComment(\" load wpi drawing API \");\n\t\t// point to (smt) aux functions\n\t\t//$js_aux = $this->doc->createExternalScript($this->auxjspath);\n\t\t$js_replayer = $this->doc->createExternalScript($this->js_replayer_path);\n\t\t$js_create = $this->doc->createExternalScript($this->js_create_path);\n\t\t// and peppy selector library\n\t\t//$js_selector = $this->doc->createExternalScript($this->selectorjspath);\n\t\t// rebuild parsed page\n\t\t$head = $this->doc->getElementsByTagName('head');\n\t\tforeach ($head as $h) {\n\t\t\t// loading order is crucial!\n\t\t\t$h->insertBefore($base, $h->firstChild);\n\t\t\t$h->appendChild($ini_comm);\n\t\t\t$h->appendChild($js_create);\n\t\t\t$h->appendChild($js_replayer);\n\t\t\t$h->appendChild($this->js_user_data);\n\t\t\t/*$h->appendChild($js_selector);\n\t\t\tif (isset($js_widget)) $h->appendChild($js_widget);\n\t\t\t$h->appendChild($api_comm);\n\t\n\t\t\tif ($this->api == \"js\") {\n\t\t\t\t$h->appendChild($this->js_graphics);\n\t\t\t\t$h->appendChild($this->js_json);\n\t\t\t} else if ($this->api == \"swf\") {\n\t\t\t\t$h->appendChild($this->js_swfobject);\n\t\t\t\t$h->appendChild($this->css_swf);\n\t\t\t}*/\n\t\t\t$h->appendChild($end_comm);\n\t\t}\n\t\t// append tracking script at the end of the page body\n\t\t/*$body = $this->doc->getElementsByTagName('body');\n\t\tforeach ($body as $b) {\n\t\t\tif ($this->api == \"js\") {\n\t\t\t\t$b->appendChild($this->js_replay);\n\t\t\t\t$b->appendChild($this->js_options);\n\t\t\t} else if ($this->api == \"swf\") {\n\t\t\t\t$b->appendChild($this->js_swf);\n\t\t\t}\n\t\t}*/\n\t}", "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 base_html_head_alter(&$head_elements) {\n $head_elements['system_meta_content_type']['#attributes'] = array(\n 'charset' => 'utf-8',\n );\n}", "public function GetHtmlHeadIncludes()\n {\n return array();\n }", "function start($title,$author=\"\",$description=\"\",$keyword=\"\",$copyright=\"\",$index=\"ALL\",$lang=\"\",$last_modified=\"\",$frames=\"\",$expires=\"\",$contact_email=\"\")\n{\n\t$return = \"<html\";\n if($lang == \"\")\n {\n $return .= \"><head>\";\n }\n else {\n $return .= ' lang=\"'.$lang.'\"><head>';\n }\n if ($title == \"\")\n {\n }\n else {\n $return .= \"<title>\".$title.\"</title>\";\n }\n $return .= '<meta charset=\"utf-8\"/>';\n if ($author ==\"\")\n {\n }\n else {\n $return .= '<meta name=\"author\" content=\"'.$author.'\"/><meta name=\"web_author\" content=\"'.$author.'\"/>';\n }\n if($description==\"\")\n {\n }\n else {\n $return .= '<meta name=\"description\" content=\"'.$description.'\"/>';\n }\n if ($index == \"\")\n {\n }\n else {\n $return .= '<meta name=\"robots\" content=\"'.$index.'\"/>';\n }\n if ($copyright == \"\")\n {\n }\n else {\n $return .= '<meta name=\"copyright\" content=\"'.$copyright.'\"/>';\n }\n $return .= '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>';\n if ($contact_email == \"\")\n {\n }\n else {\n $return .= '<meta name=\"contact\" content=\"'.$contact_email.'\"/>';\n }\n if ($lang == \"\")\n {\n }\n else {\n $return .= '<meta http-equiv=\"content-language\" content=\"'.$lang.'\"/>';\n }\n if ($last_modified == \"\")\n {\n }\n else {\n $return .= '<meta http-equiv=\"last-modified\" content=\"'.$last_modified.'\"/>';\n }\n if ($expires == \"\")\n {\n }\n else {\n $return .= '<meta http-equiv=\"expires\" content=\"'.$expires.'\"/>';\n }\n $return .= $frames.'</head>';\n echo $return;\n}", "function add_head_tag($tag)\n {\n $this->addHeadTag($tag);\n }", "function initialize () {\n $this->set_openingtag(\"<BODY[attributes]>\");\n\t $this->set_closingtag(\"</BODY>\");\n }", "public function admin_head()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $head_content = $this->standard_head(true).\"\\n\"; // We start with the standard stuff.\n \n $head_content .= \"<!-- Also Added by the BMLT plugin 3.X. -->\\n<meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=EmulateIE7\\\" />\\n<meta http-equiv=\\\"Content-Style-Type\\\" content=\\\"text/css\\\" />\\n<meta http-equiv=\\\"Content-Script-Type\\\" content=\\\"text/javascript\\\" />\\n\";\n $options = $this->getBMLTOptions(1); // All options contain the admin key.\n $key = $options['google_api_key'];\n \n // Include the Google Maps API V3 files.\n $head_content .= '<script type=\"text/javascript\" src=\"https://maps.google.com/maps/api/js?key='.$key.'\"></script>'; // Load the Google Maps stuff for our map.\n \n if (function_exists('plugins_url')) {\n $head_content .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"';\n \n $url = $this->get_plugin_path();\n \n $head_content .= htmlspecialchars($url);\n \n $head_content .= 'admin_styles.css\" />';\n \n $head_content .= '<script type=\"text/javascript\" src=\"';\n \n $head_content .= htmlspecialchars($url);\n \n $head_content .= 'admin_javascript.js\"></script>';\n } else {\n echo \"<!-- BMLTPlugin ERROR (head)! No plugins_url()! -->\";\n }\n \n $head_content .= \"\\n<!-- End Also Added by the BMLT plugin 3.X. -->\\n\";\n echo $head_content;\n }", "public function getHtmlHeadSection()\n\t{\n\t\t$paths = $this->m_common->getPathInfo();\n\t\t$file_paths = $paths[$this->m_common->m_env];\n\t\t\n\t\t$paths = $this->m_common->getPathInfo();\n\t\t$file_paths = $paths[$this->m_common->m_env];\n\t\t\n\t\t$sql = \"SELECT alias FROM common_Views WHERE LOWER( controller_name ) = '\" . strtolower( $this->m_active_controller_name ) . \"'\";\n\t\t$result = $this->m_common->m_db->query( $sql, __FILE__, __LINE__ );\n\t\t$row = $this->m_common->m_db->fetchRow( $result );\n\t\t$alias = $row[0];\n\t\t\n\t\t$sql = \"SELECT value FROM common_Settings WHERE LOWER( title ) = 'site-name'\";\n\t\t$result = $this->m_common->m_db->query( $sql, __FILE__, __LINE__ );\n\t\t$row = $this->m_common->m_db->fetchRow( $result );\n\t\t$site = $row[0];\n\t\t\n\t\t$return = '\n\t\t<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\" >\n\t\t\n\t\t<head>\n\t\t\n\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" >\n\t\t\t<link rel=\"icon\" type=\"image/png\" href=\"/images/favicon.ico\" />\n\t\t\t<title>' . $alias . ' - ' . $site . '</title>\n\t\t\t\n\t\t\t<link rel=\"stylesheet\" href=\"' . $file_paths['css_ex'] . '/jquery-ui-1.8.1.custom.css\" type=\"text/css\" />\n\t\t\t<link rel=\"stylesheet\" href=\"' . $file_paths['css_ex'] . '/960_grid.css\" type=\"text/css\" />\n\t\t\t<link rel=\"stylesheet\" href=\"' . $file_paths['css'] . '/common.css\" type=\"text/css\" />\n\t\t\t\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_ex'] . '/jquery-1.4.2.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_ex'] . '/jquery-ui-1.8.1.custom.min.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_ex'] . '/jquery.hotkeys.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js'] . '/jquery.common.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_nerd'] . '/jquery.halfnerd.mail.js\"></script>\n\t\t\t\n\t\t</head>\n\t\t';\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "function asu_brand_head_inject() {\n $settings = asu_brand_get_block_settings();\n $cache_id = 'asu_brand:head';\n \n $head_output = asu_brand_get_cached_content($cache_id, $settings->head_path);\n\n // Inject header javascript into <head> and set the weight to a high negative value.\n $asu_sso_signedin = $settings->js_settings['asu_sso_signedin'];\n $asu_sso_signinurl = $settings->js_settings['asu_sso_signinurl'];\n $asu_sso_signouturl = $settings->js_settings['asu_sso_signouturl'];\n $inline_script = <<<EOL\n <script type=\"text/javascript\">\n <!--//--><![CDATA[//><!--\n var ASUHeader = ASUHeader || {};\n ASUHeader.user_signedin = $asu_sso_signedin;\n ASUHeader.signin_url = \"$asu_sso_signinurl\";\n ASUHeader.signout_url = \"$asu_sso_signouturl\";\n //--><!]]>\n </script>\nEOL;\n \n // TODO: If asu.edu/asuthemes/x/headers/default.shtml and asu.edu/asuthemes/x/js/asu_header.js\n // get updated we can remove the first drupal_add_html_head() and $inline_script above.\n drupal_add_js(array('asu_brand' => $settings->js_settings), 'setting');\n drupal_add_js(drupal_get_path('module', 'asu_brand') . '/asu_brand.js', array());\n drupal_add_html_head(array('#type' => 'markup', '#markup' => $inline_script, '#weight' => -100), 'asu_brand_head_js');\n drupal_add_html_head(array('#type' => 'markup', '#markup' => $head_output, '#weight' => -99), 'asu_brand_head');\n}", "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 initialize () {\n $this->set_openingtag ( \"<TFOOT[attributes]>\" );\n\t$this->set_closingtag ( \"</TFOOT>\" );\n }", "function add_wp_head() {\n }", "private static final function getHTMLHeadContainer () {\r\n // Return the <HTML><head> container;\r\n $containerHTMLHead = new FileContent (FORM_TP_DIR . _S . 'frm_web_html_head_container.tp');\r\n return $containerHTMLHead->doToken ('[%BASE_HREF_URL%]', DOCUMENT_HOST);\r\n }", "function initialize () {\n $this->set_openingtag(\"<!DOCTYPE html><HTML[attributes]>\");\n \t$this->set_closingtag(\"</HTML>\");\n }", "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}", "protected function showBeginHTML(): self {\n echo <<<HTML\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>{$this->getTitle()}</title>\n <meta name=\"keywords\" content=\"{$this->getKeywords()}\">\n <meta name=\"description\" content=\"{$this->getDescription()}\">\n <meta name=\"author\" content=\"Dmitri Serõn\">\n <link rel=\"stylesheet\" href=\"/assets/css/styles.css\">\n</head>\n<body>\nHTML;\n\n return $this;\n }", "function dw2_insert_head($flux) {\r\n\t\t$flux.= \"\\n\".'<script type=\"text/javascript\" src=\"'._DIR_PLUGIN_DW2.'dw2_fermepop.js\"></script>'.\"\\n\";\r\n\t\t$flux.= \"\\n\".'<link rel=\"stylesheet\" type=\"text/css\" href=\"'._DIR_PLUGIN_DW2.'dw2_public_styles.css\" />'.\"\\n\";\r\n\t\treturn $flux;\r\n\t}", "function generateHead(){\n $title = $this->getTitle();\n echo \"<!DOCTYPE html>\n <html lang='en'>\n <head>\n <meta charset='UTF-8'>\n <meta name='viewport' content='width=device-width, initial-scale=1.0'>\n <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css'>\n <link href='https://cdn.quilljs.com/1.3.6/quill.snow.css' rel='stylesheet'>\n <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>\n <script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js'></script>\n <script src='https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js'></script>\n <link rel='stylesheet' href='static/styles/styles.css'>\n <title>$title</title>\n </head>\n <body>\";\n }", "public function init()\n {\n $this->view->headScript()->exchangeArray(array());\n $this->view->headScript()->appendFile('http://code.jquery.com/jquery.js','text/javascript');\n $this->view->headScript()->appendFile('http://code.jquery.com/ui/1.10.2/jquery-ui.js','text/javascript');\n $this->view->headScript()->appendFile($this->view->baseUrl('/js/bootstrap.min.js'),'text/javascript');\n $this->view->headLink()->exchangeArray(array());\n $this->view->headLink()->appendStylesheet('http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css'); \n $this->view->headLink()->appendStylesheet($this->view->baseUrl('/css/bootstrap.min.css')); \n //$this->view->headLink()->appendStylesheet($this->view->baseUrl('/css/bootstrap-responsive.min.css')); \n $this->view->headLink()->appendStylesheet($this->view->baseUrl('/css/planner.css')); \n $this->view->doctype('XHTML1_STRICT');\n $this->view->headMeta()->exchangeArray(array());\n $this->view->headMeta()\n ->appendName('keywords', 'Homepage')\n ->appendHttpEquiv('viewport','width=device-width, initial-scale=1.0')\n ->appendHttpEquiv('pragma', 'no-cache')\n ->appendHttpEquiv('Cache-Control', 'no-cache')\n ->appendHttpEquiv('Content-Type','text/html; charset=UTF-8')\n ->appendHttpEquiv('Content-Language', 'en-UK')\n ->appendHttpEquiv('X-UA-Compatible', 'IE=edge,chrome=1');\n \n \n }", "function onBeforeRender()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\tif($app->isAdmin()) return true;\n\t\t$doc = JFactory::getDocument();\n\t\tif($doc->getType() != 'html') return true;\n\t\t$content = $this->params->get('headtags');\n\t\t$config = JFactory::getConfig();\n\t\t$content = str_replace('%SITENAME%',$config->get( 'sitename' ),$content);\n\t\tJFactory::getDocument()->addCustomTag(PHP_EOL.'<!-- { gjheqadtag insert -->'.PHP_EOL.$content.PHP_EOL.'<!-- gjheqadtag insert } -->'.PHP_EOL);\n\t}", "function fragmention_insert_head($flux) {\n\t$flux = fragmention_insert_head_css($flux);\n\t$flux .= '<script type=\"text/javascript\" src=\"'.find_in_path('js/fragmention.js').'\"></script>'.\"\\n\";\n\treturn $flux;\n}", "public function pageHead($title, $otherLinks=\"\")\n {\n $head = \"<head>\\n\";\n\t\t $head .= \"<meta name='viewport' content='width=device-width, \"\n . \"initial-scale=1.0'>\\n\"\n . \"<title>$title</title>\\n\"\n . \"<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>\\n\"\n . \"<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>\\n\"\n . \"<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script>\\n\"\n . \"$otherLinks\";\n\n $head .= \"</head>\\n\";\n $this->sBody .= $head.\"<body>\\n\";\n\n }", "public function standard_head($in_text = null) ///< This is the page content text.\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->ajax_router();\n $load_head = false; // This is a throwback. It prevents the GM JS from being loaded if there is no directly specified settings ID.\n $head_content = \"<!-- Added by the BMLT plugin 3.0. -->\\n<meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=EmulateIE7\\\" />\\n<meta http-equiv=\\\"Content-Style-Type\\\" content=\\\"text/css\\\" />\\n<meta http-equiv=\\\"Content-Script-Type\\\" content=\\\"text/javascript\\\" />\\n<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n \n $support_mobile = $this->cms_get_page_settings_id($in_text, true);\n \n if ($support_mobile) {\n $mobile_options = $this->getBMLTOptions_by_id($support_mobile);\n } else {\n $support_mobile = null;\n }\n \n $options = $this->getBMLTOptions_by_id($this->cms_get_page_settings_id($in_text));\n\n if ($support_mobile && is_array($mobile_options) && count($mobile_options)) {\n $mobile_url = $_SERVER['PHP_SELF'].'?BMLTPlugin_mobile&bmlt_settings_id='.$support_mobile;\n\n if (isset($this->my_http_vars['WML'])) {\n $mobile_url .= '&WML='.intval($this->my_http_vars['WML']);\n }\n if (isset($this->my_http_vars['simulate_smartphone'])) {\n $mobile_url .= '&simulate_smartphone';\n }\n ob_end_clean();\n header(\"location: $mobile_url\");\n die();\n }\n \n $this->my_http_vars['start_view'] = $options['bmlt_initial_view'];\n \n $this->load_params();\n \n $root_server_root = $options['root_server'];\n \n $url = $this->get_plugin_path();\n \n $head_content .= \"\\n\".'<style type=\"text/css\">'.\"\\n\";\n $temp = self::stripFile('styles.css', $options['theme']);\n if ($temp) {\n $image_dir_path = $this->get_plugin_path() . '/themes/' . $options['theme'] . '/images/';\n $temp = str_replace('##-IMAGEDIR-##', $image_dir_path, $temp);\n $head_content .= \"\\t$temp\\n\";\n }\n $temp = self::stripFile('nouveau_map_styles.css', $options['theme']);\n if ($temp) {\n $image_dir_path = $this->get_plugin_path() . '/themes/' . $options['theme'] . '/images/';\n $temp = str_replace('##-IMAGEDIR-##', $image_dir_path, $temp);\n $head_content .= \"\\t$temp\\n\";\n }\n \n $head_content .= self::stripFile('table_styles.css') . \"\\n\";\n $head_content .= self::stripFile('quicksearch.css') . \"\\n\";\n \n $dirname = dirname(__FILE__) . '/themes';\n $dir = new DirectoryIterator($dirname);\n\n foreach ($dir as $fileinfo) {\n if (!$fileinfo->isDot()) {\n $fName = $fileinfo->getFilename();\n\n $temp = self::stripFile(\"table_styles.css\", $fName);\n if ($temp) {\n $image_dir_path = $this->get_plugin_path() . '/themes/' . $fName . '/images/';\n $temp = str_replace('##-IMAGEDIR-##', $image_dir_path, $temp);\n $head_content .= \"\\t$temp\\n\";\n }\n \n $temp = self::stripFile(\"quicksearch.css\", $fName);\n if ($temp) {\n $head_content .= \"\\t$temp\\n\";\n }\n }\n }\n \n $head_content .= '</style>';\n $head_content .= \"\\n\".'<style type=\"text/css\">'.\"\\n\";\n \n $head_content .= \"\\n/* Responsiveness */\\n\";\n \n $head_content .= self::stripFile('responsiveness.css');\n \n $head_content .= '</style>'.\"\\n\";\n\n if ($root_server_root) {\n $root_server = $root_server_root.\"/client_interface/xhtml/index.php\";\n \n $additional_css = '.bmlt_container * {margin:0;padding:0;text-align:center }';\n \n if ($options['additional_css']) {\n $additional_css .= $options['additional_css'];\n }\n \n if ($additional_css) {\n $head_content .= '<style type=\"text/css\">'.preg_replace(\"|\\s+|\", \" \", $additional_css).'</style>';\n }\n }\n \n $head_content .= '<script type=\"text/javascript\">';\n \n $head_content .= self::stripFile('javascript.js');\n\n if ($this->get_shortcode($in_text, 'bmlt_quicksearch')) {\n $head_content .= self::stripFile('quicksearch.js') . (defined('_DEBUG_MODE_') ? \"\\n\" : '');\n }\n \n if ($this->get_shortcode($in_text, 'bmlt_map')) {\n $head_content .= self::stripFile('map_search.js');\n }\n \n if ($this->get_shortcode($in_text, 'bmlt_mobile')) {\n $head_content .= self::stripFile('fast_mobile_lookup.js');\n }\n \n $head_content .= '</script>';\n \n return $head_content;\n }", "public function add_to_head($data)\n\t{\n\t\t// Deprecated for scripts. Let's encourage good practices. This will\n\t\t// also let us move jquery in the future.\n\t\tif (strpos($data, '<script') !== FALSE)\n\t\t{\n\t\t\tee()->load->library('logger');\n\t\t\tee()->logger->deprecated('2.8', 'CP::add_to_foot() for scripts');\n\t\t}\n\n\t\t$this->its_all_in_your_head[] = $data;\n\t}", "static function head($content='') {\n\t\t$content = self::meta('charset') . $content; //auto-prepend charset because it's always needed\n\t\treturn self::tag('head', false, $content);\n\t}", "public function beforeLoad($html)\n {\n $count = 0;\n\n // We try first to detect an existing <head> node.\n $result = preg_replace(\n self::HTML_GET_HEAD_OPENING_TAG_PATTERN,\n self::HTML_GET_HEAD_OPENING_TAG_REPLACEMENT,\n $html,\n 1,\n $count\n );\n\n if (is_string($result)) {\n $html = $result;\n }\n\n // If no <head> was found, we look for the <html> tag instead.\n if ($count < 1) {\n $result = preg_replace(\n self::HTML_GET_HTML_OPENING_TAG_PATTERN,\n self::HTML_GET_HTML_OPENING_TAG_REPLACEMENT,\n $html,\n 1,\n $count\n );\n\n if (is_string($result)) {\n $html = $result;\n }\n }\n\n // Finally, we just prepend the head with the required http-equiv charset.\n if ($count < 1) {\n $html = '<head>' . self::HTTP_EQUIV_META_TAG . '</head>' . $html;\n }\n\n return $html;\n }", "public function admin_head()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->admin_ajax_handler();\n \n $head_content = $this->standard_head(); // We start with the standard stuff.\n \n $head_content .= '<script type=\"text/javascript\" src=\"https://maps.google.com/maps/api/js?sensor=false\"></script>'; // Load the Google Maps stuff for our map.\n \n $head_content .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"';\n \n $url = $this->get_plugin_path();\n \n $head_content .= htmlspecialchars($url);\n \n $head_content .= 'admin_styles.css\" />';\n \n $head_content .= '<script type=\"text/javascript\" src=\"';\n \n $head_content .= htmlspecialchars($url);\n \n if (!defined('_DEBUG_MODE_')) {\n $head_content .= 'js_stripper.php?filename=';\n }\n \n $head_content .= 'admin_javascript.js\"></script>';\n \n return $head_content;\n }", "function xhtml_head_start($type) {\n\n $xhtmloptions['encoding'] = \"iso-8859-1\"; /* Western Europe */\n $xhtmloptions['language'] = \"en\";\n \n // You Will Need this here to not confuse some PHP systems\n // - Some do not have the <?php requirement turned on.\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"\".$xhtmloptions['encoding'].\"\\\"?>\\n\";\n\n if ($type == 0) {\n\techo \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 \n Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\n\";\n }\n elseif ($type == 1) {\n\techo \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Frameset//EN\\\"\n \t \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\\\">\\n\";\n }\n elseif ($type == 2) {\n\techo \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Strict//EN\\\"\n \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\\\">\\n\";\n }\n else {\n\t// NOTE: Error Handling Code Here\n }\n\n\t// NOTE: add language option for function\n echo \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" \n xml:lang=\\\"\".$xhtmloptions[\"language\"].\"\\\" \n lang=\\\"\".$xhtmloptions['language'].\"\\\">\\n\";\n echo \"<head>\\n\";\n}", "function atwork_html_head_alter(&$head_elements) {\n\n // remove the Drupal favicon link -- put the favicon.ico and apple-touch-icon.png in root dir of site!\n if (isset($head_elements['drupal_add_html_head_link:shortcut icon:'.$GLOBALS['base_url'].'/misc/favicon.ico'])) {\n unset($head_elements['drupal_add_html_head_link:shortcut icon:'.$GLOBALS['base_url'].'/misc/favicon.ico']);\n }\n\n // reset the meta charset for html5-y-ness.\n if (isset($head_elements['system_meta_content_type'])) {\n if (isset($head_elements['system_meta_content_type']['#attributes']['http-equiv'])) {\n unset($head_elements['system_meta_content_type']['#attributes']['http-equiv']);\n }\n if (isset($head_elements['system_meta_content_type']['#attributes']['content'])) {\n unset($head_elements['system_meta_content_type']['#attributes']['content']);\n }\n $head_elements['system_meta_content_type']['#attributes']['charset'] = 'utf-8';\n } else {\n $head_elements['system_meta_content_type']['#attributes']['charset'] = 'utf-8';\n }\n\n // While we are at it, remove the Drupal generator tag.\n // We are an intranet, Drupal cannot check our site for stats sadly (firewalled).\n if (isset($head_elements['system_meta_generator'])) {\n unset($head_elements['system_meta_generator']);\n }\n\n // gww.gov.bc.ca doesn't really have an RSS feed in the classic sense right now (policy issues). :( Remove this.\n // TODO: hardcode an RSS feed (with icon) on the site somewhere?\n if (isset($head_elements['drupal_add_html_head_link:alternate:' . $GLOBALS['base_url'] . '/rss.xml'])) {\n unset($head_elements['drupal_add_html_head_link:alternate:' . $GLOBALS['base_url'] . '/rss.xml']);\n }\n\n}", "function finalizeTopHTML() {\n\t\t$returnVal = \"\";\n\t\t$returnVal .= \"<!doctype html>\\n\";\n\t\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t\t$returnVal .= \"<head><title>\";\n\t\t$returnVal .= $this->_title;\n\t\t$returnVal .= \"</title>\\n\";\n\t\t$returnVal .= $this->_headSection; \n\t\t$returnVal .= \"</head>\\n\";\n\t\t$returnVal .= \"<body>\\n\";\n\t\t$returnVal .= \"<div id='container'>\\n\";\n\t\t$this->_topHTML = $returnVal;\n\t}", "public function form_head_html() {\n\n\t\t$settings = $this->form_data['settings'];\n\n\t\t$title = ! empty( $settings['conversational_forms_title'] ) ? $settings['conversational_forms_title'] : '';\n\t\t$description = ! empty( $settings['conversational_forms_description'] ) ? $settings['conversational_forms_description'] : '';\n\n\t\tif ( empty( $title ) && empty( $description ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$settings['form_title'] = $title;\n\t\t$settings['form_desc'] = $description;\n\n\t\t\\wpforms()->frontend->head( \\array_merge( $this->form_data, array( 'settings' => $settings ) ), null, true, true, array() );\n\t}", "function initialize () {\n $this->set_openingtag(\"<HEADER[attributes]>\");\n\t $this->set_closingtag(\"</HEADER>\");\n }", "function addWpHead($unused) {\r\n\t}", "public function standard_head_html() {\n $output = parent::standard_head_html();\n $output .= '<link href=\\\"https://fonts.googleapis.com/css?family=Roboto|Nova+Mono|Roboto+Mono|Tinos\\\" rel=\\\"stylesheet\\\">';\n\n return $output;\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}", "function initialize () {\n $this->set_openingtag ( \"<H1[attributes]>\" );\n\t$this->set_closingtag ( \"</H1>\" );\n }", "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 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 }", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\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}", "public function wp_head() {\n\t\t$lt_ie9 = apply_filters('sofa_load_lt_ie9', \n'<script src=\"'. $this->plugin_dir_url .'/js/html5shiv.js\" type=\"text/javascript\"></script>\n<script src=\"'. $this->plugin_dir_url .'/js/selectivizr-min.js\" type=\"text/javascript\"></script>\n<script src=\"'. $this->plugin_dir_url .'/js/PIE.js\" type=\"text/javascript\"></script>');\n\t\t?>\n<!--[if lt IE 9]>\n<?php echo $lt_ie9 ?>\n<![endif]-->\n\t\t<?php\n\t}", "private function normalize_html_head(){\n\n foreach ( (new HEAD_Section_Normalizer())->as_array() as $result)\n {\n\n }\n\n }", "function initialize () {\n $this->set_openingtag(\"<DIV[attributes]>[content]\");\n\t$this->set_closingtag(\"</DIV>\");\n }", "public function renderHead(&$output)\n {\n\t$html='';\n\tforeach($this->metaTags as $meta)\n\t\t$html.=CHtml::metaTag($meta['content'],null,null,$meta).\"\\n\";\n\tforeach($this->linkTags as $link)\n\t\t$html.=CHtml::linkTag(null,null,null,null,$link).\"\\n\";\n\tforeach($this->cssFiles as $url=>$media)\n\t\t$html.=CHtml::cssFile($url,$media).\"\\n\";\n\tforeach($this->css as $css)\n\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\tif($this->enableJavaScript)\n\t{\n if(isset($this->scriptFiles[self::POS_HEAD]))\n {\n\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n $html.=CHtml::scriptFile($scriptFile).\"\\n\";\n }\n\n if(isset($this->scripts[self::POS_HEAD]))\n\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n }\n\n if($html!=='')\n {\n\t\t$count=0;\n\t\t//$output=preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is','<###head###>$1',$output,1,$count);\n $output=preg_replace('/(<\\\\/title\\s*>)|(<\\\\/head\\s*>)/is','$1<###head###>$2',$output,1,$count);\n\t\tif($count)\n //$output=str_replace('<###head###>',$html,$output);\n $output=str_replace('<###head###>',\"\\n\".$html,$output); \n\t\telse\n $output=$html.$output;\n }\n }", "private function _print_html_head_metatags()\n\t{\n\t\treturn \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset={$this->charset}\\\" />\\n\";\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 initialize () {\n $this->set_openingtag(\"<STYLE[attributes]>\");\n\t $this->set_closingtag(\"</STYLE>\");\n }", "function HTMLheaders($body) {\n$title = GetLangVar('title');\necho \"\n<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>\n<html lang='pt'>\n<head>\n <title>$title</title>\n <meta name='title' content='\".$metatitle.\"' >\n <meta http-equiv='Content-Type' content=\\\"text/html; charset='UTF-8'\\\">\n <meta name='google-site-verification' content='sBY5TPzoJ09tOWC6GGacC8LouyYCSS8ObhOybnFn84k' >\n <meta name='url' content='\".$metaurl.\"' >\n <meta name='robots' content='all' />\n <meta name='language' content='pt-br' />\n <meta name='description' content='\".$metadesc.\"'>\n <meta name='keywords' content='\".$metakeyw.\"' >\n <meta name='autor' content='Alberto Vicentini - INPA' >\n <meta name='company' content='\".$metacompany.\"' >\n <meta name='revisit-after' content='30' >\n <meta http-equiv='imagetoolbar' content='no' >\n <link href='css/geral.css' rel='stylesheet' type='text/css' >\n <link rel='stylesheet' type='text/css' media='screen' href='css/Stickman.MultiUpload.css' >\n <link rel='stylesheet' type='text/css' href='css/cssmenu.css' >\n <link rel='stylesheet' type='text/css' media='screen' href='css/autosuggest.css' >\n <link rel='stylesheet' type='text/css' media='screen' href='javascript/tabber/tabber.css' >\n <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"dhtmlxconnector/dhtmlxTabbar/dhtmlxtabbar.css\\\">\n <link rel='stylesheet' type='text/css' href='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid.css' >\n <link rel='stylesheet' type='text/css' href='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid_pgn_bricks.css' >\n <link rel='stylesheet' type='text/css' href='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_hmenu.css' >\n <link rel='stylesheet' type='text/css' href='javascript/fileuploader.css' >\n <link rel='stylesheet' href='magiczoomplus/magiczoomplus/magiczoomplus.css' type='text/css' media='screen' >\n <script type='text/javascript' src='javascript/ajax_framework.js'></script>\n <script type='text/javascript' src='javascript/jquery-latest.js'></script>\n <script type='text/javascript'>\n $(document).ready(function(){\n $('.toggle_container').hide();\n $('h2.trigger').click(function(){\n $(this).toggleClass('active').next().slideToggle('slow');\n });\n });\n </script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxcommon.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxTabbar/dhtmlxtabbar.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxTabbar/dhtmlxcontainer.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgridcell.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid_pgn.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxConnector_php/codebase/connector.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid_export.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_link.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_clist.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_hmenu.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_ssc.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_mcol.js'></script>\n\n <script type='text/javascript' src='javascript/sorttable/common.js'></script>\n <script type='text/javascript' src='javascript/sorttable/css.js'></script>\n <script type='text/javascript' src='javascript/sorttable/standardista-table-sorting.js'></script>\n <script type='text/javascript' src='javascript/mootools.js'></script>\n <script type='text/javascript' src='javascript/teste.js'></script>\n <script type='text/javascript' src='javascript/Stickman.MultiUpload.js'></script>\n <script type='text/javascript' src='css/cssmenuCore.js'></script>\n <script type='text/javascript' src='css/cssmenuAddOns.js'></script>\n <script type='text/javascript' src='css/cssmenuAddOnsItemBullet.js'></script>\n <script src='magiczoomplus/magiczoomplus/magiczoomplus.js' type='text/javascript'></script>\n</head>\";\nif (!empty($body)) {\n\techo \"\n<body \".$body.\">\n<div>\";\n} else {\n\techo \"\n<body >\n<div>\";\n}\nif (!isset($_SESSION['userid'])) {\n\techo \"\n<h1>$title</h1>\";\n} else {\n\techo \"\n<h3>\".GetLangVar('title').\"</h3>\";\n}\nMenu($title);\necho \"\n<!--////////////////-->\n<!--FIM DO CABECALHO-->\n<!--////////////////-->\n</div>\n<div id='container'>\n<br>\";\n}", "public function testHeadElementAutomaticallyCreated() {\n\t\t$document = new HTMLDocument(Helper::HTML);\n\t\t$this->assertInstanceOf(Element::class, $document->head);\n\t}", "function launchpad_add_head_modifications() {\n\tglobal $site_options, $wp_query, $post;\n\t\n\t$add_this_id = $site_options['add_this_id'];\n\t\n\t$ajax = '';\n\tif(isset($site_options['ajax_page_loads']) && $site_options['ajax_page_loads'] === true) {\n\t\t$ajax = 'true';\n\t}\n\t\n\tif(is_singular()) {\n\t\t$use_id = $post ? $post->ID : 0;\n\t} else {\n\t\t$page_by_path = get_page_by_path(trim($_SERVER['REQUEST_URI'], '/'));\n\t\tif($page_by_path) {\n\t\t\t$use_id = $page_by_path->ID;\n\t\t} else {\n\t\t\t$use_id = $post ? $post->ID : 0;\n\t\t}\n\t}\n\t\n\t$excerpt = launchpad_seo_excerpt(32, false, $use_id);\n\n\t?>\n\t\n\t\t<!--[if lt IE 9]><script src=\"//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js\"></script><![endif]-->\n\t\t\n\t\t<link rel=\"icon\" href=\"/images/icons/favicon.png\">\n\t\t<link rel=\"icon\" href=\"/images/icons/favicon_2x.png\" media=\"(-webkit-min-device-pixel-ratio: 2)\">\n\t\t\n\t\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"<?php bloginfo('name') ?> RSS Feed\" href=\"/feed/\">\n\t\t<?php if(is_single() || is_page()) { ?>\n\t\t\n\t\t<link rel=\"canonical\" href=\"<?= get_permalink($use_id); ?>\">\n\t\t<?php } ?>\n\t\t\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\n\t\t<meta name=\"description\" content=\"<?php echo $excerpt; ?>\">\n\t\t<?php\n\t\t\n\t\tif(!get_option('blog_public')) {\n\t\t\techo '<meta name=\"robots\" content=\"noindex, nofollow\">';\t\t\t\n\t\t} else if(!$wp_query->is_single && !$wp_query->is_singular && !is_front_page()) {\n\t\t\techo '<meta name=\"robots\" content=\"noindex, follow\">';\n\t\t}\n\t\t\n\t\t?>\n\t\t<?php if(isset($site_options['fb_app_id']) && $site_options['fb_app_id']) { ?>\n\t\t\t<meta property=\"fb:app_id\" content=\"<?php echo $site_options['fb_app_id'] ?>\">\n\t\t<?php } ?>\n\t\t<?php if(isset($site_options['fb_admin_id']) && $site_options['fb_admin_id']) { ?>\n\t\t\t<?php foreach(explode(',', $site_options['fb_admin_id']) as $fb_admin_id) { ?>\n\t\t\t\t<meta property=\"fb:admins\" content=\"<?php echo trim($fb_admin_id) ?>\">\n\t\t\t<?php } ?>\n\t\t<?php } ?>\n\t\t<?php\n\t\t\t// Setting up Card names for Twitter & Facebook along with OG Meta\n\t\t\t$f_card_type = 'website';\n\t\t\t$t_card_type = 'summary';\n\t\t\tif(is_single() || is_singular()) {\n\t\t\t\t$f_card_type = 'article';\n\t\t\t}\n\t\t\tif((is_single() || is_singular()) && has_post_thumbnail()) {\n\t\t\t\t$t_card_type = 'summary_with_large_image';\n\t\t\t}\n\t\t?>\n\t\t\t<meta name=\"twitter:card\" content=\"<?= $t_card_type ?>\">\n\t\t\t<meta property=\"og:type\" content=\"<?= $f_card_type ?>\">\n\t\t\t<?php if(isset($site_options['twitter_card_username']) && $site_options['twitter_card_username']) { ?>\n\t\t\t\t<meta name=\"twitter:site\" content=\"@<?= $site_options['twitter_card_username'] ?>\">\n\t\t\t\t<meta name=\"twitter:creator\" content=\"@<?= $site_options['twitter_card_username'] ?>\">\n\t\t\t<?php } ?>\n\t\t\t<meta property=\"og:site_name\" content=\"<?php bloginfo('name') ?>\">\n\t\t\t<meta name=\"twitter:title\" property=\"og:title\" content=\"<?php launchpad_title(true); ?>\">\n\t\t\t<meta name=\"twitter:description\" property=\"og:description\" content=\"<?= $excerpt; ?>\">\n\t\t\t<meta name=\"twitter:url\" property=\"og:url\" content=\"<?= get_permalink($use_id); ?>\">\n\t\t<?php\n\t\t\tif(has_post_thumbnail()) {\n\t\t\t\t$thumbnail = get_post_thumbnail_id();\n\t\t\t\tif(!$thumbnail){\n\t\t\t\t\t// Default OG Image Fallback\n\t\t\t\t\t$thumbnail = $site_options['default_og_image'];\n\t\t\t\t}\n\t\t\t\t$thumbnail = wp_get_attachment_image_src($thumbnail, 'opengraph');\n\t\t\t\tif($thumbnail) {\n\t\t\t\t\t?>\n\t\t\t\t\t<meta property=\"og:image\" content=\"http://<?= $_SERVER['HTTP_HOST'] ?><?= $thumbnail[0] ?>\">\n\t\t\t\t\t<meta property=\"og:image:width\" content=\"<?= $thumbnail[1] ?>\">\n\t\t\t\t\t<meta property=\"og:image:height\" content=\"<?= $thumbnail[2] ?>\">\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t?>\n\t\t<?php if(defined('GA_ID') && GA_ID != '') { ?>\n\t\t\t<script id=\"google-analytics\">\n\t\t\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\t\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t\t\t\t})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\t\t\t\t\n\t\t\t\tga('create', '<?php echo GA_ID ?>', 'auto');\n\t\t\t\tga('send', 'pageview');\n\t\t\t</script>\n\t\t<?php \n\t\t\n\t\t}\n\t\n\t\tif(stristr($_SERVER['HTTP_HOST'], '.dev') !== false || stristr($_SERVER['HTTP_HOST'], '.git') !== false) {\n\t\t\techo \"<script>window.dev = true;</script>\\n\";\n\t\t}\n}", "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 headSpecial($body,$coment){\r\n\t\t$this->Head[$coment] = $body;\r\n\t}", "function start_html($extra = '')\n{\n /** Starting the HTML document */\n start_tag('html', '', true, $extra) ;\n}", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "function getHeadScriptTags($currentPath){\n echo <<<SCRIPT\n <!-- jQuery 1.11.3 -->\n <script type=\"text/javascript\" src =\"$currentPath/include/libs/jquery-1.11.3.min.js\"></script>\n <!-- Bootstrap 3.3.5 -->\n <!-- Latest compiled and minified CSS -->\n <link rel=\"stylesheet\" href=\"$currentPath/include/libs/bootstrap/bootstrap-3.3.5/css/bootstrap.min.css\">\n <!-- Latest compiled Bootstrap JavaScript -->\n <script type=\"text/javascript\" src=\"$currentPath/include/libs/bootstrap/bootstrap-3.3.5/js/bootstrap.min.js\"></script>\n <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesnt work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"$currentPath/include/libs/bootstrap/bootstrapForIE9/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"$currentPath/include/libs/bootstrap/bootstrapForIE9/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n <!-- font-Awesome 4.4.0 -->\n <link rel=\"stylesheet\" href=\"$currentPath/include/libs/font-awesome-4.4.0/css/font-awesome.min.css\">\n <link href=\"http://fonts.googleapis.com/css?family=Open+Sans\" rel=\"stylesheet\" type=\"text/css\">\nSCRIPT;\n}", "function lessie_html_head_alter(&$head_elements) {\r\n unset($head_elements['system_meta_generator']);\r\n}", "private function prepareDocument()\n {\n $document = JFactory::getDocument();\n $document->addStyleSheet(JURI::root() . \"media/com_progresstool/css/site.css\");\n $document->addScript(JURI::root() . \"media/com_progresstool/js/site/metrics.js\");\n }", "private function _addJavascript ()\n {\n $options = array ();\n\n if ($this->isTypeahead) {\n $options['documentReady'][] = 'init';\n if ($this->desc)\n $options['documentReady'][] = 'tooltip';\n }\n \n if ($this->selectable) {\n $options['documentReady'][] = 'selectable';\n if ($this->sortable) {\n $options['documentReady'][] = 'sortable';\n }\n }\n\n if ($this->clickable) {\n \t$options['documentReady'][] = 'click';\n }\n\n if (!empty ($options)) {\n $this->buildJS('thesaurus/', $options);\n }\n\n if ($this->selectable) {\n $this->_element->addDocumentReady($this->endJavascript);\n if (isset($this->required_items) && is_array ($this->required_items)) {\n foreach ($this->required_items as $item) {\n $this->_element->addDocumentReady(\"setRequiredItems_\" . $this->idfilter . \" ('$item');\");\n }\n }\n }\n }", "abstract protected function RenderHead();", "protected function addDocumentHeaderData()\n\t{\n\t\tJHtml::_('formbehavior.chosen', 'select');\n\t\t$document = JFactory::getDocument();\n\t\t$document->addScript(JURI::root() . '/components/com_tjreports/assets/js/tjrContentService.js');\n\t\t$document->addScript(JURI::root() . '/components/com_tjreports/assets/js/tjrContentUI.js');\n\t\t$document->addStylesheet(JURI::root() . '/components/com_tjreports/assets/css/tjreports.css');\n\t\t$document->addScriptDeclaration('tjrContentUI.base_url = \"' . Juri::base() . '\"');\n\t\t$document->addScriptDeclaration('tjrContentUI.root_url = \"' . Juri::root() . '\"');\n\t\tJText::script('JERROR_ALERTNOAUTHOR');\n\n\t\tif (method_exists($this->model, 'getScripts'))\n\t\t{\n\t\t\t$plgScripts = (array) $this->model->getScripts();\n\n\t\t\tforeach ($plgScripts as $script)\n\t\t\t{\n\t\t\t\t$document->addScript($script);\n\t\t\t}\n\t\t}\n\n\t\tif (method_exists($this->model, 'getStyles'))\n\t\t{\n\t\t\t$styles = (array) $this->model->getStyles();\n\n\t\t\tforeach ($styles as $style)\n\t\t\t{\n\t\t\t\t$document->addStylesheet($style);\n\t\t\t}\n\t\t}\n\t}", "public function __construct() {\r\n parent::__construct(\"head\");\r\n }", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "function getHead() {\n\n $out = \"\";\n\n if ($this->meta_keywords) array_push($this->head, \"<meta name='keywords' content='{$this->meta_keywords}' />\");\n if ($this->meta_description) array_push($this->head, \"<meta name='description' content='{$this->meta_description}' />\");\n\n foreach ($this->head as $string) {\n $out .= \" $string\\n\";\n }\n return \"\\n$out\\n\";\n }", "function painter_head() {\n\t\techo '<script>window.ideaspace_site_path = \"' . url('/') . '\";</script>';\n\n\t\techo '<script src=\"' . url('public/a-painter/vendor/aframe-input-mapping-component.js') . '\"></script>';\n echo '<script src=\"' . url('public/a-painter/build.js') . '\"></script>';\n echo '<script src=\"' . url('public/a-painter/vendor/aframe-teleport-controls.min.js') . '\"></script>';\n echo '<script src=\"' . url('public/a-painter/vendor/aframe-tooltip-component.min.js') . '\"></script>';\n echo '<link rel=\"stylesheet\" href=\"' . url('public/a-painter/css/main.css') . '\">';\n echo '<link rel=\"manifest\" href=\"' . url('public/a-painter/manifest.webmanifest') . '\">';\n}" ]
[ "0.72852397", "0.7087167", "0.69024575", "0.6890113", "0.6826593", "0.6809671", "0.67863977", "0.6750602", "0.6749531", "0.6738786", "0.6718956", "0.6712248", "0.67097646", "0.67047036", "0.6683756", "0.66802967", "0.6651625", "0.6630208", "0.66138643", "0.6593981", "0.65888673", "0.6553839", "0.65166056", "0.65093064", "0.650635", "0.6447441", "0.6445051", "0.6414952", "0.64124614", "0.64116037", "0.6363815", "0.6355116", "0.6349389", "0.63339466", "0.6323879", "0.6318976", "0.63058704", "0.62956184", "0.62953573", "0.6295253", "0.62769085", "0.62739927", "0.6268395", "0.6266401", "0.6255382", "0.6251118", "0.6246786", "0.6240669", "0.62406576", "0.6236204", "0.62324166", "0.62311864", "0.6227852", "0.6223986", "0.6223984", "0.6198923", "0.61986536", "0.61983925", "0.61914575", "0.61598045", "0.61548764", "0.6150764", "0.6143097", "0.6142825", "0.613995", "0.61154586", "0.61044425", "0.609754", "0.60975313", "0.6096628", "0.60938925", "0.608831", "0.6087662", "0.6075564", "0.6074006", "0.6066111", "0.60616493", "0.6061151", "0.6058095", "0.60576326", "0.6056925", "0.6051245", "0.6045339", "0.6043934", "0.60436785", "0.6033016", "0.6030877", "0.6007071", "0.600358", "0.6002936", "0.59976155", "0.59843874", "0.5984222", "0.59770054", "0.5975202", "0.596953", "0.5969341", "0.5968009", "0.59617287", "0.59565264" ]
0.6377587
30
end function addHeadElement Top HTML Header Section / This function creates the top html or beginning html code
function finalizeTopHTML() { $returnVal = ""; $returnVal .= "<!doctype html>\n"; $returnVal .= "<html lang=\"en\">\n"; $returnVal .= "<head><title>"; $returnVal .= $this->_title; $returnVal .= "</title>\n"; $returnVal .= $this->_headSection; $returnVal .= "</head>\n"; $returnVal .= "<body>\n"; $returnVal .= "<div id='container'>\n"; $this->_topHTML = $returnVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 finalizeTopSection() {\n\t$returnVal = \"\";\n\t$returnVal .= '<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css\" integrity=\"sha384-TX8t27EcRE3E/ihU7zmQxVncDAy5uIKz4rEkgIXeM>';\n\t$returnVal .= \"<!doctype html>\\n\";\n\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t$returnVal .= \"<head><title>\";\n\t$returnVal .= $this->_title;\n\t$returnVal .= \"</title>\\n\";\n $returnVal .= $this->_headSection;\n\t$returnVal .= \"</head>\\n\";\n\t$returnVal .= \"<body>\\n\";\n\n\t$this->_top = $returnVal;\n\n}", "public function addHeader(){\n$this->page.= <<<EOD\n<html>\n<head>\n</head>\n<title>\n$this->title\n</title>\n<body>\n<h1 align=\"center\">\n$this->title\n</h1>\nEOD;\n}", "function getHTML_additionalHeaderData() {\n\t\t\t// get js configs\n\t\t\t// get topical element and overwrite startID in appConf['js.']['config.']\n\t\tif ($this->appConf['topicAtStart']) {\n\t\t\t$this->appConf['js.']['config.']['startIndex'] = $this->appConf['topicId'];\n\t\t}\n\t\t\t// only boolean and integers allowed, strings ar not supported\n\t\tif (is_array($this->appConf['js.']['config.'])) {\n\t\t\t$configArray = array();\n\t\t\tforeach ($this->appConf['js.']['config.'] as $key => $val) {\n\t\t\t\t$configArray[] = trim($key) . ': ' . trim($val);\n\t\t\t}\n\t\t\t$config = implode(', ',$configArray);\n\t\t}\n\t\t\t// additional headers as css & js\n\t\t$GLOBALS['TSFE']->additionalHeaderData['contentcoverflow'] .= '\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['core.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['more.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['mod.']['file'] . '\"></script>\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->appConf['css.']['file'] . '\" />\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t/* <![CDATA[ */\n\t\t\t\tvar myMooFlowPage = {\n\t\t\t\t\tstart: function(){\n\t\t\t\t\t\tvar mf = new MooFlow($(\\'MooFlow\\'), {\n\t\t\t\t\t\t\t' . $config . ',\n\t\t\t\t\t\t\t\\'onClickView\\': function(obj){\n\t\t\t\t\t\t\t\tmyMooFlowPage.link(obj);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\\'onStart\\': function(){\n\t\t\t\t\t\t\t\tthis.autoPlay = this.auto.periodical(this.options.interval, this);\n\t\t\t\t\t\t\t\tthis.isAutoPlay = true;\n\t\t\t\t\t\t\t\tthis.fireEvent(\\'autoPlay\\');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\n\t\t\t\t\tlink: function(result){\n\t\t\t\t\t\tif (result.target == \"_blank\") {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\twindow.addEvent(\\'domready\\', myMooFlowPage.start);\n\n\t\t\t\t/* ]]> */\n\t\t\t</script>\n\t\t';\n\t}", "function get_html_header();", "function do_html_header($title)\r\n{\r\n?>\r\n <html>\r\n <head>\r\n <title><?=$title?></title>\r\n <? /* <style>\r\n body { font-family: Arial, Helvetica, sans-serif; font-size: 13px }\r\n li, td { font-family: Arial, Helvetica, sans-serif; font-size: 13px }\r\n hr { color: #3333cc; width:300; text-align:left; }\r\n a { color: #000000 }\r\n </style> \r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> */?>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"css/style.css\" />\r\n </head>\r\n <body>\r\n<!-- <img src=\"top_1.gif\" alt=\"Selena logo\" border=0\r\n align=left valign=bottom height = 82 width = 350><br>\r\n <h1>&nbsp;</h1><br> <hr>-->\r\n\r\n<?\r\n if($title)\r\n do_html_heading($title);\r\n}", "protected function bodyHeader() {\n echo str_repeat(\"\\t\",1) . \"<body>\\n\";\n echo str_repeat(\"\\t\",2) . \"<div id=\\\"page\\\">\\n\";\n echo str_repeat(\"\\t\",3) . \"<header>\\n\";\n echo str_repeat(\"\\t\",4) . \"<h1>Евиденција волонтера</h1>\\n\";\n echo str_repeat(\"\\t\",3) . \"</header>\\n\";\n }", "public function header() {\r\n $html = <<<HTML\r\n\r\n <header>\r\n <p class=\"welcomeScreen\" ><img src=\"images/title.png\" alt=\"\" ></p>\r\n <h1 class=\"welcomeScreen\">$this->title</h1>\r\n </header>\r\nHTML;\r\n return $html;\r\n }", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \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 }", "function Get_Standard_Top_Section_HTML($title=null)\n {\n require_once __DIR__.\"/../../static_php/standard_header.php\";\n $HTML = \"\";\n\n $HTML .= get_standard_header($title);\n\n // container for the page\n $HTML .= \"<div class=\\\"page_container\\\">\";\n\n // menu bar\n $HTML .= \"<div class=\\\"left_box_menu\\\">\";\n $HTML .= Get_File_Contents(__DIR__.\"/../../static_html/goc5_logo.html\");\n //Insert a portal is in read only warning message, if it is\n if(\\Factory::getConfigService()->IsPortalReadOnly()){\n $HTML.= Get_File_Contents(__DIR__.\"/../../static_html/read_only_warning.html\");\n }\n require_once \"menu.php\";\n $HTML .= draw_menu(\"main_menu\");\n $HTML .= \"</div>\";\n //$HTML .= \"<h3 class=\\\"spacer\\\">Test</h3>\";\n\n $HTML .= Get_Search_Box_HTML();\n $HTML .= Get_User_Info_Box_HTML();\n $HTML .= Get_bottom_logos_Box_HTML();\n\n // right side of the page\n $HTML .= \"<div class=\\\"right_box\\\">\";\n\n // logout button (if set - does not always need to be rendered)\n if(!empty(\\Factory::$properties['LOGOUTURL'])){\n $HTML .= \"<div style='text-align: right;'>\";\n //$HTML .= '<a href=\"'.htmlspecialchars(\\Factory::$properties['LOGOUTURL']).'\"><b><font colour=\"red\">Logout</font></b></a>';\n $HTML .= '<a href=\"'.htmlspecialchars(\\Factory::$properties['LOGOUTURL']).'\"><b><font class=\"btn btn-danger btn-xs\">Logout</font></b></a>';\n $HTML .= \"</div>\";\n }\n\n\n return $HTML;\n }", "public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }", "public function buildHeadMarkup(){\n\n echo file_get_contents(\"head/home.html\");\n\n $this->head_script_tags = \"\";\n\n foreach( $this->head_scripts as $value ){\n\n $this->head_script_tags .= \"<script src=\\\"\" . $value . \"\\\"></script>\";\n\n }\n\n $this->head = file_get_contents(\"head/home.html\").$this->head_script_tags.\"</head>\";\n\n }", "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}", "private function createHeader() {\r\n\t\t$headerHtml = $this->getHeaderHtml();\r\n\t\t//Guardo el archivo del header\r\n\t\t$htmlPath = $this->localTmpFolder . $this->fileName . '_currentHeader' . '.html';\r\n\t\t$fh = fopen($htmlPath, 'w');\r\n\t\tfwrite($fh, $headerHtml);\r\n\t\tfclose($fh);\r\n\t\treturn $headerHtml;\r\n\t}", "function HTML_StartHead(){\n\t\techo \"<!DOCTYPE html>\\n\";\n\t\techo \"<html>\\n\";\n\t\techo \"<head>\\n\";\n}", "function newsroom_elated_get_header_top() {\n\n $params = array(\n 'column_widths' => '33-33-33',\n 'show_header_top' => newsroom_elated_options()->getOptionValue('top_bar') == 'yes' ? true : false,\n 'top_bar_in_grid' => newsroom_elated_options()->getOptionValue('top_bar_in_grid') == 'yes' ? true : false\n );\n\n $params = apply_filters('newsroom_elated_header_top_params', $params);\n\n newsroom_elated_get_module_template_part('templates/parts/header-top', 'header', '', $params);\n }", "private static final function getEndHTMLHeadContainer () {\r\n // Return the <HTML><head> container;\r\n return new FileContent (FORM_TP_DIR . _S . 'frm_web_html_head_body.tp');\r\n }", "public function getHtmlHeadSection()\n\t{\n\t\t$paths = $this->m_common->getPathInfo();\n\t\t$file_paths = $paths[$this->m_common->m_env];\n\t\t\n\t\t$paths = $this->m_common->getPathInfo();\n\t\t$file_paths = $paths[$this->m_common->m_env];\n\t\t\n\t\t$sql = \"SELECT alias FROM common_Views WHERE LOWER( controller_name ) = '\" . strtolower( $this->m_active_controller_name ) . \"'\";\n\t\t$result = $this->m_common->m_db->query( $sql, __FILE__, __LINE__ );\n\t\t$row = $this->m_common->m_db->fetchRow( $result );\n\t\t$alias = $row[0];\n\t\t\n\t\t$sql = \"SELECT value FROM common_Settings WHERE LOWER( title ) = 'site-name'\";\n\t\t$result = $this->m_common->m_db->query( $sql, __FILE__, __LINE__ );\n\t\t$row = $this->m_common->m_db->fetchRow( $result );\n\t\t$site = $row[0];\n\t\t\n\t\t$return = '\n\t\t<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\" >\n\t\t\n\t\t<head>\n\t\t\n\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" >\n\t\t\t<link rel=\"icon\" type=\"image/png\" href=\"/images/favicon.ico\" />\n\t\t\t<title>' . $alias . ' - ' . $site . '</title>\n\t\t\t\n\t\t\t<link rel=\"stylesheet\" href=\"' . $file_paths['css_ex'] . '/jquery-ui-1.8.1.custom.css\" type=\"text/css\" />\n\t\t\t<link rel=\"stylesheet\" href=\"' . $file_paths['css_ex'] . '/960_grid.css\" type=\"text/css\" />\n\t\t\t<link rel=\"stylesheet\" href=\"' . $file_paths['css'] . '/common.css\" type=\"text/css\" />\n\t\t\t\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_ex'] . '/jquery-1.4.2.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_ex'] . '/jquery-ui-1.8.1.custom.min.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_ex'] . '/jquery.hotkeys.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js'] . '/jquery.common.js\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"' . $file_paths['js_nerd'] . '/jquery.halfnerd.mail.js\"></script>\n\t\t\t\n\t\t</head>\n\t\t';\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "function Get_Standard_Top_Section_HTML($title = null)\n{\n require_once __DIR__ . \"/../../static_php/standard_header.php\";\n\n $configService = \\Factory::getConfigService();\n\n $html = \"\";\n\n $html .= get_standard_header($title);\n\n // banner if requested\n $banner = $configService->getPageBanner();\n if (!empty($banner)) {\n $html .= Get_Banner($banner);\n }\n // container for the page\n $html .= \"<div class=\\\"page_container\\\">\";\n // menu bar\n $html .= \"<div class=\\\"left_box_menu\\\">\";\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/goc5_logo.html\");\n //Insert a portal is in read only warning message, if it is\n if ($configService->IsPortalReadOnly()) {\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/read_only_warning.html\");\n }\n require_once \"menu.php\";\n $html .= draw_menu(\"main_menu\");\n $html .= \"</div>\";\n //$html .= \"<h3 class=\\\"spacer\\\">Test</h3>\";\n\n $html .= Get_Search_Box_HTML();\n $html .= Get_User_Info_Box_HTML();\n $html .= Get_bottom_logos_Box_HTML();\n\n // right side of the page\n $html .= \"<div class=\\\"right_box\\\">\";\n\n // logout button (if set - does not always need to be rendered)\n if (!empty(\\Factory::$properties['LOGOUTURL'])) {\n $html .= \"<div style='text-align: right;'>\";\n $html .= '<a href=\"' . htmlspecialchars(\\Factory::$properties['LOGOUTURL']) .\n '\"><b><font class=\"btn btn-danger btn-xs\">Logout</font></b></a>';\n $html .= \"</div>\";\n }\n\n return $html;\n}", "private function displayHeader()\n {\n\n $html = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">' . \"\\n\";\n $html .= '<html xmlns=\"http://www.w3.org/1999/xhtml\">';\n $html .= '<head>' . \"\\n\";\n\n //Meta tags\n $html .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />' . \"\\n\";\n $html .= '<meta name=\"description\" content=\"' . $this->pageInfo['pageDescription'] . '\" />' . \"\\n\";\n $html .= '<meta name=\"keywords\" content=\"jobs, freelance, work, design, freedom, choice, new zealand, quality\" />' . \"\\n\";\n $html .= '<link rel=\"icon\" type=\"image/png\" href=\"images/volition-icon.png\" />' . \"\\n\";\n\n //Stylesheets\n $html .= '<!-- Stylesheets -->' . \"\\n\";\n $html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles.css\" />' . \"\\n\";\n $html .= '<!--[if lt IE 9]>' . \"\\n\";\n $html .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"css/ie.css\" />' . \"\\n\";\n $html .= '<![endif]-->' . \"\\n\";\n\n //Scripts\n //$html .= '<script type=\"text/javascript\" src=\"js/window.js\"></script>'.\"\\n\";\n\n //Page title\n $html .= '<title>Volition | ' . $this->pageInfo['pageTitle'] . '</title>' . \"\\n\";\n $html .= '</head>' . \"\\n\";\n $html .= '<body>' . \"\\n\";\n\n //Header\n $html .= '<div id=\"header\">' . \"\\n\";\n\n //Control buttons\n\n $html .= '<div id=\"headerImg\"><a href=\"index.php?page=home\"></a></div>' . \"\\n\";\n\n if ($this->model->userLoggedIn) {\n $html .= '<p class=\"controlButton\"><a href=\"index.php?page=logout\">Logout</a></p>' . \"\\n\";\n $html .= '<p class=\"userControl\">You are logged in as ' . $_SESSION['userName'] . '</p>' . \"\\n\";\n } else {\n $html .= '<p class=\"controlButton\"><a href=\"index.php?page=login\">Login</a></p>' . \"\\n\";\n $html .= '<p class=\"controlButton\"><a href=\"index.php?page=register\">Register</a></p>' . \"\\n\";\n }\n\n $html .= '<form id=\"searchForm\" method=\"post\" action=\"index.php?page=search\">';\n if ($_POST['searchInput']) {\n $html .= '<input type=\"text\" name=\"searchInput\" id=\"searchInput\" value=\"' . $_POST['searchInput'] . '\" />';\n } else {\n $html .= '<input type=\"text\" name=\"searchInput\" id=\"searchInput\" value=\"Search...\" />';\n }\n $html .= '<input type=\"submit\" class=\"submit\" name=\"searchSubmit\" id=\"searchSubmit\" value=\"Go\" />';\n $html .= '</form>';\n\n //Navbar\n $html .= $this->displayNav();\n\n $html .= '</div>' . \"\\n\";\n //Content tags\n $html .= '<div id=\"container\">' . \"\\n\";\n $html .= '<div id=\"content\" >' . \"\\n\";\n\n return $html;\n\n }", "function do_html_header($title)\r\n{\r\n?>\r\n <html>\r\n <head>\r\n <title><?=$title?></title>\r\n <style>\r\n body { font-family: Arial, Helvetica, sans-serif; font-size: 13px }\r\n li, td { font-family: Arial, Helvetica, sans-serif; font-size: 13px }\r\n hr { color: #3333cc; width=300; text-align=left}\r\n a { color: #000000 }\r\n </style>\r\n </head>\r\n <body>\r\n <img src=\"marcador.gif\" alt=\"PHPbookmark logo\" border=0\r\n align=left valign=bottom height = 50 width = 150>\r\n <h1>&nbsp;CompartElinks</h1>\r\n <hr>\r\n<?\r\n if($title)\r\n do_html_heading($title);\r\n}", "public function show_head() {\n \n $output = '<head>';\n \n if( empty( $this->title ) ) {\n $this->title = \"No Title Available\";\n } \n\n $output .= '<title>' . $this->title . '</title>';\n $output .= $this->get_header_elements();\n $output .= \"\\n</head>\";\n\n echo $output;\n }", "function start_head($extra = '')\n{\n /**\n * Starting the HTML head section\n *\n * Args:\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n start_tag('head', Tab(1), true, $extra) ;\n}", "public function get_header_html()\n\t{\n\t return '';\n\t}", "private function _print_html_head()\n\t{\n\t\t$output = \"<head>\\n\";\n\t\t$output .= \"<title>{$this->title}</title>\\n\";\n\t\t$output .= $this->_print_html_head_metatags();\n\t\t$output .= $this->_print_html_head_javascript();\n\t\t$output .= $this->_print_html_head_css();\n\t\t$output .= \"</head>\\n<body>\\n\";\n\t\t\n\t\treturn $output;\n\t}", "function head($coment, $tag, $attribute, $inner=''){\r\n\t\tif(!$tag){\r\n\t\t\t$this->Head[$coment] = '';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$n = '';\r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\t\t\r\n\t\tif($coment === null || $coment === '') $coment = 'sys_'.count($this->Head);\r\n\t\t\r\n\t\tif($tag == 'title' && !$inner){\r\n\t\t\t$inner = ' ';\r\n\t\t}\r\n\t\tif($tag == 'script'){\r\n\t\t\t$attribute['type'] = 'text/javascript';\r\n\t\t\tif($inner == '') $inner = ' ';\r\n\t\t\t\r\n\t\t\tif(isset($attribute['src'])){\r\n\t\t\t $attribute['src'] = str_replace('ROOT_VIRTUAL',$GLOBALS['BASIC']->ini_get('root_virtual'),$attribute['src']);\r\n\t\t\t}\r\n\t\t\tif($inner && $inner != ' ' && isset($attribute['src'])){\r\n\t\t\t\t$att = $attribute; unset($att['src']);\r\n\t\t\t\t$this->Head[$coment.'_inner'] = $n.$this->create($tag,$att,$inner);\r\n\t\t\t\t$inner = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($tag == 'style'){\r\n\t\t\tif(isset($attribute['href'])) $tag = 'link';\r\n\t\t}\r\n\t\tif($tag == 'link'){\r\n\t\t\t$attribute['rel'] = 'stylesheet';\r\n\t\t\t$attribute['type'] = 'text/css';\r\n\t\t\t\r\n\t\t\tif(isset($attribute['href'])){\r\n\t\t\t $attribute['href'] = str_replace('ROOT_VIRTUAL',$GLOBALS['BASIC']->ini_get('root_virtual'),$attribute['href']);\r\n\t\t\t}\r\n\t\t\t$n = \"\\n\";\r\n\t\t}\r\n\t\t\r\n\t\t$this->Head[$coment] = $n.$this->create($tag,$attribute,$inner);\r\n\t}", "function setHead($tagName,$attributes,$inner = '',$index = ''){\r\n\t\t$this->head($index,$tagName,$attributes,$inner);\r\n\t}", "public function renderHeadSection()\n\t{\n\t\treturn \"\";\n\t}", "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}", "function _goTop () {\n\t\t$this->_roof[\"dtd\"] =$this->_dtd[$this->_doctype];\n\t\t$this->_roof[\"dtd\"].=\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" lang=\\\"\".$this->_lang.\"\\\" xml:lang=\\\"\".$this->_lang.\"\\\">\\n<head>\\n<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=\".$this->_enc[$this->_lang].\"\\\" />\\n\";\n\t\t$this->_roof[\"dtd\"].=\"<title>\".$this->_title.\"</title>\\n\";\n\t\t@ob_end_flush();\n\t}", "private function generate_html_header()\n {\n $header = \"<!DOCTYPE html> <html lang=\\\"en\\\"> <head> <meta charset=\\\"UTF-8\\\"> <title>Test statistics</title> <style> table{ border: 1px solid black; margin: 10px 20px; } thead{ background-color:lightgray; } .status{ width: 180px; } #stats{font-size:23px;} .test-name{ min-width: 400px; padding-left: 20px; color:blue; text-decoration: underline; } h1,p{ margin-left: 20px; } .success{ background: lawngreen; } .failed{ background: red; } #detail{ margin-left: 20px; } #input{ min-height: 250px; width: 300px; } #parse_output{ min-height: 400px; width: 500px; } #detail{ display: none; } .status_text_pass{ color:green; font-size: 25px; } .status_text_failed{ color:red; font-size:25px; } </style> </head> <body> <h1>Test statistics</h1><p id=\\\"stats\\\">Success: <span id=\\\"correct\\\"></span>/<span id=\\\"all\\\"></span></p> <p>For test detail click on test name</p> <table> <thead> <tr> <th>Test Name</th> <th>Pass/Fail</th> </tr> </thead> <tbody> </tbody> </table> <div id=\\\"detail\\\"> <h2><span id=\\\"test_name\\\"></span> detail</h2> <h3 id=\\\"status_text\\\"></h3><h3>Input:</h3> <textarea disabled id=\\\"input\\\"></textarea> <h3>Parse output:</h3> <textarea disabled id=\\\"parse_output\\\"></textarea> <h3>Interpret input</h3><span id=\\\"interpret_input\\\"></span> <h3>Reference output</h3><span id=\\\"ref_output\\\"></span> <h3>Interpret output</h3><span id=\\\"interpret_output\\\"></span> <h3>Reference return code:</h3> <span id=\\\"ref_return_code\\\"></span> <h3>Parse return code:</h3> <span id=\\\"parse_return_code\\\"></span> <h3>Interpret return code:</h3> <span id=\\\"interpret_return_code\\\"></span> </div> </body> <script> var tests = [\";\n return $header;\n }", "private function renderHead() {\n\t\t\n\t\t\t$this->outputLine('<head>');\n\t\t\t\n\t\t\tif ($this->_title != '') {\n\t\t\t\t$this->outputLine('\t<title>' . $this->_title . '</title>');\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('\t<base href=\"' . $this->_base . '\" />');\n\t\t\t\n\t\t\t$this->outputLine('\t<meta http-equiv=\"content-type\" content=\"' . $this->_contentType . '\" />');\n\t\t\t\n\t\t\t//Meta\n\t\t\tforeach ($this->_meta as $meta) {\n\t\t\t\t$this->outputLine('\t<meta name=\"' . $meta->name . '\" content=\"' . $meta->content . '\" />');\n\t\t\t}\n\t\t\t\n\t\t\t//CSS\n\t\t\tforeach ($this->_css as $css) {\n\t\t\t\t$this->outputLine(\"\t\" . $css);\n\t\t\t}\n\t\t\t\n\t\t\t//JS\n\t\t\tforeach ($this->_js as $js) {\n\t\t\t\t$this->outputLine(\"\t\" . $js);\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('</head>');\n\t\t\n\t\t}", "private function _renderXhtmlHead() {\r\n\t\t\r\n?>\r\n\t<head>\r\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n\t\t<title><?php echo \"$this->_title\"; ?></title>\r\n\t\t<link rel=\"shortcut icon\" href=\"favicon.png\" type=\"image/png\" />\r\n<?php\r\n\r\n\t\t$this->_stylesheets->render();\r\n\t\t$this->_scripts->render();\r\n\t\t$this->_keywords->render();\r\n\r\n\t\tif (isset($this->_description)) {\r\n?>\r\n\t\t<meta name=\"description\" content=\"<?php echo \"$this->_description\"; ?>\" />\r\n<?php\r\n\r\n\t\t}\r\n\r\n?>\r\n\t</head>\r\n<?php\r\n\t\t\r\n\t}", "protected function _build_header(){\n\t\t$html = '';\n\t\t\n\t\t$html .= '<div class=\"container-narrow marginTop60\">';\r\n\t\t$html .= '<a href=\"'.home_url('/').'\">';\r\n\t\t$html .= '<img src=\"'.get_header_image().'\" height=\"'.get_custom_header()->height .'\"\r\n\t\twidth=\"'.get_custom_header()->width.'\" alt=\"\" class=\"marginTop40 marginBottom20\"\r\n\t\talign=\"center\"/>\r\n\t\t</a>';\r\n\t\t$html .= '<p class=\"centerText\">'.get_bloginfo('description').'</p>';\r\n\t\t$html .= '<hr class=\"marginBottom20 width50\">';\r\n\t\t$html .= '</div>';\n\t\t\n\t\techo $html;\n\t}", "function Header() \n { \n\n list($r, $b, $g) = $this->xheadercolor; \n $this->setY(10); // shouldn't be needed due to page margin, but helas, otherwise it's at the page top \n $this->SetFillColor($r, $b, $g); \n $this->SetTextColor(0 , 0, 0); \n $this->Cell(0,20, '', 0,1,'C', 1); \n $this->Text(15,26,$this->xheadertext ); \n }", "function addHeader($title)\n {\n $this->page .= <<<EOD\n<html>\n<head>\n<title>$title</title>\n</head>\n<body>\n<h1 align=\"center\">$title</h1>\nEOD;\n }", "abstract public function header();", "public function head() {\n\t\t$html = parent::head();\n\n\t\t$root = $this->course->root;\n $stepTag = $this->assignment->tag;\n\n $html .= <<<HTML\n<base href=\"$root/$stepTag/\" />\n\nHTML;\n\n\t\tif($this->file !== false) {\n\t\t\t/*\n\t\t\t * Transfer everything between <head> and </head>\n\t\t\t * except for the line automatically included by\n\t\t\t * the template\n\t\t\t */\n\n\t\t\t// Read until we get to <head>\n\t\t\twhile(($line = fgets($this->file)) != false) {\n\t\t\t\tif(stristr($line, '<head>')) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$code = $this->codeStart();\n\n\t\t\t// Read until </head>\n\t\t\twhile(($line = fgets($this->file)) != false) {\n\t\t\t\tif(stristr($line, '</head>')) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif(stristr($line, 'course.css') ||\n stristr($line, 'site.css') ||\n\t\t\t\t\tstristr($line, 'class.css') ||\n\t\t\t\t\tstristr($line, 'course.min.js') ||\n\t\t\t\t\tstristr($line, 'step/step.js') ||\n\t\t\t\t\tstristr($line, 'step/step.css') ||\n\t\t\t\t\tstristr($line, 'js/jquery') ||\n\t\t\t\t\tstristr($line, 'lib/js/video-js') ||\n\t\t\t\t\tstristr($line, 'video.css') ||\n\t\t\t\t\tstristr($line, '<title>')) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$code .= $line;\n\t\t\t}\n\n\t\t\t// This block of code does an eval on the header lines of\n\t\t\t// the page and saves the results into a string\n\t\t\tob_start();\n\t\t\teval($code);\n\t\t\t$html .= ob_get_contents();\n\t\t\tob_end_clean();\n\t\t}\n\n\t\treturn $html;\n }", "function giveheader($title=\"Collabor8r: Encouraging Interdisciplinary Collaboration\", $canonicalurl=\"http://collabor8r.com/\"){\n\theader('Content-Type: text/html; charset=utf-8');\n\t//Put in the DOCTYPE\n\t//include the needed javascripts\n\t//include the needed stylesheets\n\n\t$headdiv=getheaddiv();\n\techo <<<END\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n\t<head>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/collabor8r.css\" />\n\t\t<script type=\"text/javascript\" src=\"/js/md5.js\"></script>\n\t\t<script type=\"text/javascript\" src=\"/js/r8r.js\"></script>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <link rel=\"canonical\" href=\"$canonicalurl\" />\n\t\t<title>$title</title>\n\t</head>\n\t<body>\n $headdiv\n <div class=\"bigwrap\">\n\t\t\t<div id=\"contentdiv\" class=\"content\">\n\t\t\t\t<noscript>\n\t\t\t\t\tPlease turn on Javascript to Collabor8.\n\t\t\t\t</noscript>\nEND;\n}", "public function Header() {\r\n $this->varcave->logger->debug('Create PDF top header');\r\n\t\tif ($this->noheader){\r\n\t\t\treturn true;\r\n\t\t}\r\n // Logo\r\n\t\t$this->setFont($this->font, 'BI', 8, '', 'false');\r\n\t\t$this->Image($this->headerImg,4,4,170);\r\n\t\t\r\n\t\t//text box after header image\r\n\t\t$this->RoundedRect(172,4,35,10,3.5,'D');\r\n\t\t$this->SetXY(173,5);\r\n\t\t$this->cell(0,3, LNE::pdf_caveRef . ': ' . $this->cavedata['caveRef'],0);\r\n\t\t$this->SetXY(173,9);\r\n\t\t//If pagegroup is on set group page number, or set a global PDF page number \r\n\t\tif ( $this->pagegroups == false )\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page. ': '. $this->getAliasNumPage() . '/' . $this->getAliasNbPages(),0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page .': '. $this->getPageGroupAlias(). '-'.$this->getPageNumGroupAlias() ,0);\r\n\t\t}\r\n\t\t\r\n }", "protected function getHeadTag() {\r\n\t\t$headTagContent = '';\r\n\t\tif (count($this->profile) > 0) {\r\n\t\t\t$headTagContent .= sprintf(' profile=\"%s\"', implode(',', $this->profile));\r\n\t\t}\r\n\t\tif (count($this->prefix) > 0) {\r\n\t\t\tforeach ($this->prefix as $k => $v) {\r\n\t\t\t\t$data[$k] = sprintf('%s: %s', $k, $v);\r\n\t\t\t}\r\n\t\t\t$headTagContent .= sprintf(' prefix=\"%s\"', implode(' ', $data));\r\n\t\t}\r\n\t\tif (!empty($headTagContent)) {\r\n\t\t\treturn sprintf('<head%s >', $headTagContent);\r\n\t\t}\r\n\t}", "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 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 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 getHead() {\n return '';\n // return $this->document->getHead();\n }", "public function themeHeader($end) {\n $domain = $this->getSiteURL();\n \n // front-end only\n if ($end == 'front') {\n // url base\n echo \"\\n\".'<base href=\"'.$this->getSiteURL().'\">';\n }\n echo \"\\n\".'<!-- The Matrix '.self::VERSION.'-->'.\"\\n\";\n // css\n echo ' <!--css-->'.\"\\n\";\n foreach (glob(GSPLUGINPATH.self::FILE.'/css/*.css') as $css) {\n echo ' <link rel=\"stylesheet\" href=\"'.str_replace(GSROOTPATH, $domain, $css).'\"/>'.\"\\n\";\n }\n echo ' <!--/css-->'.\"\\n\";\n \n // js\n echo ' <!--js-->'.\"\\n\";\n $javascript = glob(GSPLUGINPATH.self::FILE.'/js/*.js');\n natsort($javascript);\n \n foreach ($javascript as $js) {\n echo ' <script src=\"'.str_replace(GSROOTPATH, $domain, $js).'\" type=\"text/javascript\"></script>'.\"\\n\";\n }\n echo ' <!--/js-->'.\"\\n\";\n echo '<!--/The Matrix '.self::VERSION.'-->'.\"\\n\";\n }", "function write_header($date, $title, $this_page)\r\n\t{\r\n\t\tprint(\"<head>\\n\");\r\n\t\tprint(\" <link rel=\\\"icon\\\" href=\\\"./common_files/favicon.ico\\\" type=\\\"image/x-icon\\\">\\n\");\r\n\t\tprint(\"\t<link rel=\\\"shortcut icon\\\" href=\\\"./common_files/favicon.ico\\\" type=\\\"image/x-icon\\\">\\n\");\r\n\t\tprint(\"\t<meta http-equiv=\\\"Pragma\\\" content=\\\"no-cache\\\">\\n\");\r\n\t\tprint(\"\t<meta http-equiv=\\\"refresh\\\" content=\\\"1800\\\">\\n\");\r\n\t\tprint(\"\t<title>$title</title>\\n\");\r\n\t\tprint(\"\t<link rel=stylesheet href=\\\"./common_files/arm-style.css\\\" type=\\\"text/css\\\">\\n\");\r\n\t\tprint(\"\t<meta name=\\\"orgcode\\\" content=\\\"682\\\">\\n\");\r\n\t\tprint(\"\t<meta name=\\\"rno\\\" content=\\\"Joseph.B.Gurman.1\\\">\\n\");\r\n\t\tprint(\"\t<meta name=\\\"content-owner\\\" content=\\\"Peter.T.Gallagher.1\\\">\\n\");\r\n\t\tprint(\"\t<meta name=\\\"webmaster\\\" content=\\\"Amy.E.Skowronek.1\\\">\\n\");\r\n\t\tprint(\" <script type=\\\"text/javascript\\\" src=\\\"./common_files/slider.js\\\"></script>\");\r\n\t\tprint(\" <script type=\\\"text/javascript\\\" src=\\\"./common_files/warning.js\\\"></script>\");\r\n\t\tprint(\" <script type=\\\"text/javascript\\\" src=\\\"./function_table.js\\\"></script>\");\r\n\t\tprint(\"\t<script language=JavaScript1.2>\\n\");\r\n\t\t\twrite_jscript($date, $this_page);\r\n\t\tprint(\"\t</script>\\n\");\r\n\t print(\"<script language=\\\"JavaScript\\\" src=\\\"./common_files/global.js\\\"></script>\\n\");\r\n\t\t\r\n\t\t//TODO: Clean calendar files and tests (DPS, 27/Aug/'10)\r\n\t\tprint(\"\t<!-- link calendar files -->\\n\");\r\n\t print(\"<script language=\\\"JavaScript\\\" src=\\\"./common_files/tigra_calendar/calendar_eu.js\\\"></script>\\n\");\r\n\t print(\"<link rel=\\\"stylesheet\\\" href=\\\"./common_files/tigra_calendar/calendar.css\\\">\\n\");\r\n\r\n\t \r\n\t\t//TODO: Clean transition table files (DPS, 31/Aug/'10)\r\n\t\t//From: http://www.gayadesign.com/diy/animated-tabbed-content-with-jquery/\r\n\t\tprint(\"<script type=\\\"text/javascript\\\" src=\\\"./common_files/tabbedContent/js/jquery-1.4.4.min.js\\\"></script>\\n\");\r\n\t print(\"<script type=\\\"text/javascript\\\" src=\\\"./common_files/tabbedContent/js/tabbedContent.js\\\"></script>\\n\");\r\n\t\tprint(\"<link href=\\\"./common_files/tabbedContent/css/tabbedContent.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\" />\\n\");\r\n\r\n\t\t//Inclusion of lightbox2\r\n//\t\tprint(\"<script type=\\\"text/javascript\\\" src=\\\"./common_files/js/prototype.js\\\"></script>\\n\");\r\n//\t\tprint(\"<script type=\\\"text/javascript\\\" src=\\\"./common_files/js/scriptaculous.js?load=effects,builder\\\"></script>\\n\");\r\n//\t\tprint(\"<script type=\\\"text/javascript\\\" src=\\\"./common_files/js/lightbox.js\\\"></script>\\n\");\r\n//\t\tprint(\"<link rel=\\\"stylesheet\\\" href=\\\"./common_files/css/lightbox.css\\\" type=\\\"text/css\\\" media=\\\"screen\\\" />\\n\");\r\n\r\n\t\t//Inclusion of jq-lightbox\r\n\t\t//print(\"<script type=\\\"text/javascript\\\" src=\\\"./common_files/js/jqlightbox/jquery.js\\\"></script>\\n\");\r\n//\t\tprint(\"<script type=\\\"text/javascript\\\" src=\\\"./common_files/js/jqlightbox/jquery.lightbox-0.5.js\\\"></script>\\n\");\r\n//\t\tprint(\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"./common_files/css/jqlightbox/jquery.lightbox-0.5.css\\\" media=\\\"screen\\\" />\\n\");\r\n\t\t\r\n//\t\tprint(\"<script type=\\\"text/javascript\\\">\\n\");\r\n//\t\tprint(\"\t$(function test() {\\n\");\r\n//\t\tprint(\"\t$('a[@rel*=lightbox]').lightBox();\\n\");\r\n//\t\tprint(\"\t});\\n\");\r\n//\t\tprint(\"</script>\\n\");\r\n\r\n\t\t//Incluiding ticker js\r\n\t\tprint(\"<link href=\\\"./ticker/jquery_news_ticker/styles/ticker-style.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\" />\\n\");\r\n\t\tprint(\"<script src=\\\"./ticker/jquery_news_ticker/includes/jquery.ticker.js\\\" type=\\\"text/javascript\\\"></script>\\n\");\r\n\r\n\t\t//Inclusion of colorbox (using same version of jquery.\r\n\t\tprint(\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"./common_files/js/colorbox/colorbox/colorbox.css\\\" media=\\\"screen\\\" />\\n\");\r\n\t\tprint(\"<script src=\\\"./common_files/js/colorbox/colorbox/jquery.colorbox.js\\\"></script>\\n\");\r\n\t\tprint(\"<script>\\n\");\r\n\t\tprint(\"\t$(document).ready(function(){\\n\");\r\n\t\tprint(\" \t\t$(\\\"a[rel='lightbox']\\\").colorbox({transition:\\\"fade\\\"});\\n\");\r\n\t\tprint(\"\t});\\n\");\r\n\t\tprint(\"</script>\\n\");\r\n\t\tinclude(\"globals.php\");\r\n\t\t\r\n\t\t//Inclusion of form \r\n \t\tprint(\" <script type=\\\"text/javascript\\\">\\n\");\r\n \t\tprint(\" //<![CDATA[ \\n\");\r\n \t\tprint(\" $(window).load(function(){\\n\");\r\n\t\tprint(\" $(function() {\\n\");\r\n\t\tprint(\" $('input.cal_box').each(function() {\\n\");\r\n \t\tprint(\" $.data(this, 'default', this.value);\\n\");\r\n\t\tprint(\" }).css(\\\"color\\\",\\\"white\\\")\\n\");\r\n\t\tprint(\" .focus(function() {\\n\");\r\n\t\tprint(\" if (!$.data(this, 'edited')) {\\n\");\r\n\t\tprint(\" this.value = \\\"YYYYMMDD \");\r\n\t\tprint($date);\r\n\t\tprint(\"\\\";\\n\");\r\n\t\tprint(\" $(this).css(\\\"color\\\",\\\"white\\\");\\n\");\r\n\t\tprint(\" }\\n\");\r\n//\t\tprint(\" }).change(function() {\\n\");\r\n//\t\tprint(\" $.data(this, 'edited', this.value != \"\");\\n\");\r\n//\t\tprint(\" }).blur(function() {\\n\");\r\n//\t\tprint(\" if (!$.data(this, 'edited')) {\\n\");\r\n//\t\tprint(\" this.value = $.data(this, 'default');\\n\");\r\n//\t\tprint(\" $(this).css(\\\"color\\\",\\\"gray\\\");\\n\");\r\n//\t\tprint(\" }\\n\");\r\n\t\tprint(\" });\\n\");\r\n\t\tprint(\" });\\n\");\r\n\t\tprint(\" });\\n\");\r\n\t\tprint(\" //]]> \\n\");\r\n\t\tprint(\" </script> \\n\");\r\n\r\n\r\n\t\t//Inclusion of NOAA search form\r\n\t\t//Inclusion of form \r\n \t\tprint(\" <script type=\\\"text/javascript\\\">\\n\");\r\n \t\tprint(\" //<![CDATA[ \\n\");\r\n \t\tprint(\" $(window).load(function(){\\n\");\r\n\t\tprint(\" $(function() {\\n\");\r\n\t\tprint(\" $('input.ar_box').each(function() {\\n\");\r\n \t\tprint(\" $.data(this, 'default', this.value);\\n\");\r\n\t\tprint(\" }).css(\\\"color\\\",\\\"white\\\")\\n\");\r\n\t\tprint(\" .focus(function() {\\n\");\r\n\t\tprint(\" if (!$.data(this, 'edited')) {\\n\");\r\n\t\tprint(\" this.value = \\\"00000\\\";\\n\");\r\n\t\tprint(\" $(this).css(\\\"color\\\",\\\"white\\\");\\n\");\r\n\t\tprint(\" }\\n\");\r\n\r\n//\t\tprint(\" }).change(function() {\\n\");\r\n//\t\tprint(\" $.data(this, 'edited', this.value != \"\");\\n\");\r\n//\t\tprint(\" }).blur(function() {\\n\");\r\n//\t\tprint(\" if (!$.data(this, 'edited')) {\\n\");\r\n//\t\tprint(\" this.value = $.data(this, 'default');\\n\");\r\n//\t\tprint(\" $(this).css(\\\"color\\\",\\\"gray\\\");\\n\");\r\n//\t\tprint(\" }\\n\");\r\n\t\tprint(\" });\\n\");\r\n\t\tprint(\" });\\n\");\r\n\t\tprint(\" });\\n\");\r\n\t\tprint(\" //]]> \\n\");\r\n\t\tprint(\" </script> \\n\");\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t//Insert the cool Zoom Function. (Edit: P.A.Higgins 14-May-2009)\r\n\t\tif ($this_page == \"full_disk.php\")\r\n\t\t{\r\n\t\t\tprint(\"\t<script type='text/javascript' src='common_files/tjpzoom.js'></script>\\n\");\r\n\t\t\tprint(\"\t<script type='text/javascript' src='common_files/tjpzoom_config_default.js'></script>\\n\");\r\n\t\t\tprint(\"\t<script type='text/javascript'>\\n\");\r\n\t\t\tprint(\"\tfunction writeText(txt){document.getElementById('zoomtoggle').innerHTML=txt;}\\n\");\r\n\t\t\tprint(\"\t</script>\\n\");\r\n\t\t\tprint(\"\t<script type='text/javascript'>\\n\");\r\n\t\t\tprint(\"\t\tvar TJPzoomoffset='smart';\\n\");\r\n\t\t\tprint(\"\t\tvar zoomable=-1;\\n\");\r\n\t\t\tprint(\"\t</script>\\n\");\r\n\t\t}\r\n\t\tif (preg_match(\"/pop.php/\",$this_page,$rubbish))\r\n\t\t{\r\n\t\t\tprint(\"\t\t<meta http-equiv=\\\"Pragma\\\" content=\\\"no-cache\\\">\\n\");\r\n//\t\t\tprint(\"\t\t<meta http-equiv=\\\"refresh\\\" content=\\\"300\\\">\\n\");\r\n//\t\t\tprint(\"\t\t<title>$title ( Updates dynamically every 5-mins) </title>\\n\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif ($this_page == \"aurora_pop.php\")\r\n\t\t{\r\n\t\t\tprint(\"\t\t<link rel=\\\"stylesheet\\\" href=\\\"./common_files/js_gifplayer/aeplayer.css\\\" type=\\\"text/css\\\">\\n\");\r\n\t\t\tprint(\"\t\t<script type=\\\"text/javascript\\\" src=\\\"./common_files/js_gifplayer/menu.js\\\"></script>\\n\");\r\n\t\t\tprint(\"\t\t<script type=\\\"text/javascript\\\" src=\\\"./common_files/js_gifplayer/aeplayer.js\\\"></script>\\n\");\r\n\t\t\tprint(\"\t\t<script type=\\\"text/javascript\\\">\\n\");\r\n\t\t\tprint(\"\t\t\twindow.onload = function() {\\n\");\r\n\t\t\tprint(\"\t\t\t\taemenu.init(\\\"icmenu\\\", \\\"icact\\\");\\n\");\r\n\t\t\tprint(\"\t\t\t\taemenu.init(\\\"stmenu\\\", \\\"stact\\\");\\n\");\r\n\t\t\tprint(\"\t\t\t\taemenu.init(\\\"simenu\\\", \\\"siact\\\");\\n\");\r\n\t\t\tprint(\"\t\t\t\taemenu.init(\\\"abmenu\\\", \\\"abact\\\");\\n\");\r\n\t\t\tprint(\"\t\t\t\taep.makeAllPlayers();\\n\");\r\n\t\t\tprint(\"\t\t}\\n\");\r\n\t\t\tprint(\"\t\t</script>\\n\");\r\n\t\t\t\r\n\t\t}\r\n\r\n /* check the theme in a cookie */\r\n $theme = @$_COOKIE[\"theme\"];\r\n if (!$theme) { //we didn't set the cookie yet\r\n // select first key of the themes array in config.inc.php as default\r\n $theme_keys = array_keys($themes);\r\n $theme = $theme_keys[0]; \r\n }\r\n foreach ($themes as $skin => $url) {\r\n\t//var_dump($skin);\r\n echo \"<link type=\\\"text/css\\\" rel=\\\"\";\r\n if ($skin==$theme) {\r\n echo \"stylesheet\";\r\n } else {\r\n echo \"prefertch alternate stylesheet\";\r\n }\r\n echo \"\\\" href=\\\"$url\\\" title=\\\"$skin\\\"\";\r\n echo \" media=\\\"screen\\\" />\\n\";\r\n }\r\n\t\t\r\n\t\t$current_date = gmdate(\"Ymd\");\r\n\t\tif (strtotime($date) > strtotime($current_date))\r\n\t\t {\r\n\t\t print(\"<STYLE type=\\\"text/css\\\">\\n\");\r\n\t\t print(\".cal_box{ color: red}\\n\");\r\n\t\t print(\"</STYLE>\\n\");\r\n\t\t }\r\n\t\tprint(\"</head>\\n\");\r\n\t}", "function generate_page_head ( $titre, $description, $tags, $res_segments ){\n\t\t$html = \"<html lang='fr'>\n\t<head>\n\t\t<title>\".$titre.\"</title>\n\t\t<link rel='shortcut icon' type='image/png' href='img/favicon.png'>\n\t\t<link rel='stylesheet' type='text/css' href='lib/site.css'>\n\t\t<link href='http://fonts.googleapis.com/css?family=Oleo+Script' rel='stylesheet' type='text/css'>\n\t\t<meta charset='utf-8'>\n\t\t<meta name='description' content='\".$description.\"'>\n\t\t<meta name='keywords' content='\".$tags.\"'>\";\n\t\t\n\t\t// If page has segments\n\t\t//$html .= sizeof($res_segments);\n\t\tif ( $res_segments != \"\" ){\n\t\t\t\n\t\t\t// List all elements involved in page\n\t\t\twhile ( $row = getLine ( $res_segments ) )\t$tab_elm[$row['element']] = 1;\n\t\t\t\n\t\t\t// Include each element css file in html head\n\t\t\tforeach ( $tab_elm as $elm=>$v )\t$html .= \"\n\t\t\t<link rel='stylesheet' type='text/css' href='lib/$elm/$elm.css'>\";\n\t\t}\n\t\t\t\n\t\t// Generate site's structure : header & nav sections\n\t\t$html .= \"\n\t</head><body>\n\t\t<div id='back'>\n\t\t\t<center><div id='wrapper'>\";\n\t\t$html .= \"\n\t\t\t\t\".generate_site_header();\n\t\treturn $html;\n\t}", "function doHtmlHeader($title, $userKind='guest', $useJavaScript=false, $useGoogleMaps=false)\n// Prints an HTML header.\n{ if ($userKind == 'admin')\n $numLinks = \"sixLinks\";\n else if ($userKind == 'member')\n $numLinks = \"fiveLinks\";\n else\n $numLinks = \"fourLinks\";\n?>\n<!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n <meta http-equiv=\"content-language\" content=\"el\" />\n <link rel=\"stylesheet\" href=\"/styles/style.css\" type=\"text/css\" media=\"screen\" />\n <title><?php echo $title;?></title>\n <link rel=\"alternate\" type=\"application/rss+xml\" title=\"Mikres Aggelies RSS\" \n href=\"/phpFiles/createRssFile.php\" />\n<?php\n\n if ($useGoogleMaps) {\n echo '<script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=false\"></script>';\n }\n if ($useJavaScript)\n echo \"<script type='text/javascript' src='/javaScriptFiles/$useJavaScript'></script>\";\n\n echo ' </head>';\n if ($useGoogleMaps) \n echo '<body onload=\"initializeMap()\">';\n else\n echo '<body>';\n\n?>\n <div id=\"header\">\n <h1>Σπιτικές Αγγελίες</h1>\n <a type=\"application/rss+xml\" style=\"float:left\" href=\"/phpFiles/createRssFile.php\"><img src=\"/img/rss.gif\" /></a>\n <h2>ό,τι θέλετε, όταν το θέλετε</h2>\n </div>\n<?php\n\n if ($userKind != 'guest') {\n $username = $_SESSION['validUser'];\n echo '<div id=\"signedAs\">';\n echo 'Συνδεθήκατε σαν <a href=\"/phpFiles/profilePage.php?username='.$username.'\">'\n .'<b>'.$username.'</b></a>';\n if ($userKind == 'admin') \n echo ', administrator';\n echo '. <a href=\"/phpFiles/logoutPage.php\">(aποσύνδεση)</a>';\n echo '</div>';\n }\n\n?>\n <div id=\"navigation\">\n <ul>\n<?php\n\n echo \"<li class='$numLinks'><a href='/index.php'>Κεντρική Σελίδα</a></li>\";\n echo \"<li class='$numLinks'><a href='/phpFiles/searchPage.php'>Αναζήτηση</a></li>\";\n if ( $userKind != 'guest' ) {\n echo \"<li class='$numLinks'><a href='/phpFiles/newAdvertisementPage.php'>Καταχώρηση</a></li>\";\n echo \"<li class='$numLinks'><a href='/phpFiles/favoritesPage.php'>Αγαπημένα</a></li>\";\n if ( $userKind == 'admin' ) \n echo \"<li class='$numLinks'><a href='/phpFiles/adminPage.php'>Διαχείριση</a></li>\";\n }\n else \n echo \"<li class='$numLinks'><a href='/phpFiles/loginPage.php'>Εγγραφή / Σύνδεση</a></li>\";\n echo \"<li class='$numLinks'><a href='/phpFiles/aboutUs.php'>About us</a></li>\";\n\n?>\n </ul>\n </div>\n\n <div id=\"content\">\n<?php \n}", "protected function setHeadTags()\n {\n $strTagClose = ($GLOBALS['objPage']->outputFormat == 'xhtml')\n ? ' />'\n : '>';\n\n // Add rel=\"prev\" and rel=\"next\" links (see #3515)\n if ($this->hasPrevious()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"prev\" href=\"' .\n $this->linkToPage($this->intPage - 1) .\n '\"' . $strTagClose;\n }\n if ($this->hasNext()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"next\" href=\"' .\n $this->linkToPage($this->intPage + 1) .\n '\"' . $strTagClose;\n }\n }", "private function renderHead() {\n\t\t$head = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . PHP_EOL;\n\t\tif (!empty($this->stylesheets))\n\t\t\t$head .= implode(PHP_EOL, $this->stylesheets);\n\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$head .= $this->openTag('rss', array(\n\t\t\t\t\t\t\"version\" => \"2.0\",\n\t\t\t\t\t\t\"xmlns:content\" => \"http://purl.org/rss/1.0/modules/content/\",\n\t\t\t\t\t\t\"xmlns:atom\" => \"http://www.w3.org/2005/Atom\",\n\t\t\t\t\t\t\"xmlns:wfw\" => \"http://wellformedweb.org/CommentAPI/\")) . PHP_EOL;\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$head .= $this->openTag('rdf:RDF', array(\n\t\t\t\t\t\t\"xmlns:rdf\" => \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n\t\t\t\t\t\t\"xmlns\" => \"http://purl.org/rss/1.0/\",\n\t\t\t\t\t\t\"xmlns:dc\" => \"http://purl.org/dc/elements/1.1/\"\n\t\t\t\t\t)) . PHP_EOL;\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$head .= $this->openTag('feed', array(\"xmlns\" => \"http://www.w3.org/2005/Atom\")) . PHP_EOL;\n\t\t}\n\t\treturn $head;\n\t}", "public static function header_output() {\n\t\tob_start();\n\n\t\tif ( self::options( 'header_type' ) == 'navbar-fixed-top' ) {\n\t\t\techo 'body{padding-top: 50px;}';\n\t\t}\n\n\t\tif ( ! display_header_text() ) {\n\t\t\techo '#site-title,.site-description{position: absolute;clip: rect(1px, 1px, 1px, 1px);}';\n\t\t} else {\n\t\t\tself::generate_css( '#site-title', 'color', 'header_textcolor', '#' );\n\t\t}\n\t\t$extra_css = apply_filters( 'maketador_header_output', ob_get_clean() );\n\t\tif ( ! empty( $extra_css ) ) {\n\t\t\techo '<style type=\"text/css\">' . $extra_css . '</style>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}", "function getHead() {\n\n $out = \"\";\n\n if ($this->meta_keywords) array_push($this->head, \"<meta name='keywords' content='{$this->meta_keywords}' />\");\n if ($this->meta_description) array_push($this->head, \"<meta name='description' content='{$this->meta_description}' />\");\n\n foreach ($this->head as $string) {\n $out .= \" $string\\n\";\n }\n return \"\\n$out\\n\";\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 PrintHtmlHead () {\n\tGlobal $ISM, $str_font;\n\tGlobal $arr_win_dir, $arr_pozip, $arr_alm;\n\tGlobal $cDb;\n\t\n\tif (isset($cDb)) {\n\t\t$sWindowTitle = GetSetting ($cDb, 'windowtitle', '');\n\t} else {\n\t\t$sWindowTitle = '';\n\t}\n\t\n\theader(\"Content-Type: text/html; charset=UTF-8\");\n\theader(\"Pragma: no-cache\");\n\theader(\"Expires: 0\");\n\theader(\"Cache-Control: must-revalidate, post-check=0,pre-check=0\");\n\t\nprint <<<EOF\n<!DOCTYPE html>\n<html>\n<head>\n<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'>\n<meta name='viewport' content='user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width, height=device-height'>\n<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>\n<title>$sWindowTitle</title>\n\n<style type='text/css'>\n\nhtml, body { height: 100%; margin: 0; padding: 0; }\n\nBODY,TD,P,DIV,INPUT,SELECT,TEXTAREA {\n\tfont-family:$str_font;\n\tfont-size:12px;\n\twhite-space:nowrap;\n}\nA {\n\tcolor:#4444FF;\n\tcursor:pointer;\n\ttext-decoration:none;\n}\nA:hover {\n\ttext-decoration:underline;\n}\nINPUT,SELECT,TEXTAREA {\n\tcolor:#000000;\n\tbackground:#FFFFFF;\n\tpadding:2px;\n\tborder:1px solid #BBBBBB;\n}\nINPUT:-moz-read-only {\n\tbackground:#DDDDDD;\n\tborder:1px solid #DDDDDD;\n}\nINPUT:read-only {\n\tbackground:#DDDDDD;\n\tborder:1px solid #DDDDDD;\n}\n.TopCurtain {\n\nEOF;\n\techo (\"\tposition:fixed; top:\".($ISM?50:0).\"px; left:0; right:0; height:16px;\\n\");\nprint <<<EOF\n\tbackground:linear-gradient(rgba(0,0,0,0.1),rgba(0,0,0,0));\n\tpointer-events: none;\n}\n.ReadBorder {\n\tborder-width:3px;\n\tborder-style:solid;\n\tpadding:5px;\n\tborder-color:#FF8888;\n\tbackground:#FFEEEE;\n}\n.OrangeBorder {\n\tborder-width:3px;\n\tborder-style:solid;\n\tpadding:5px;\n\tborder-color:#FFBB88;\n\tbackground:#FFFFFF;\n}\n.OrangeFont {\n\tcolor:#EE6633;\n\tfont-weight:bold;\n}\n.TitleFont {\n\tcolor:#666666;\n\tfont-weight:bold;\n}\n.SubMenu {\n\tcolor:#444444;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tborder-radius:7px;\n}\n.SubMenu:hover {\n\tbackground:#DDDDDD;\n}\n.SubMenuSel {\n\tcolor:#444444;\n\tbackground:#FFFFFF;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tborder-radius:7px;\n}\n\n.msgPopupBox {\n\tz-index:3;\n\tdisplay: none;\n\tposition:fixed;\n\tmargin:0;\n\ttop:0;\n\tleft:0;\n\tright:0;\n\tbottom:0;\n\theight:100%;\n\twidth:100%;\n\tbackground-color:rgba(0,0,0,0.7);\n}\n.msgPopupInn {\n\tdisplay: table-cell;\n\tvertical-align: middle;\n\ttext-align:center;\n}\n.msgPopupTxt {\n\tdisplay:inline-block;\n\tcolor:#FFFFFF;\n\tborder:1px solid rgba(0,0,0,0.5);\n\tbox-shadow: 0 2px 10px 5px rgba(0,0,0,0.2);\n\tpadding:15px;\n\tborder-radius:10px;\n\ttext-align:center;\n\t\n\tbackground-color: #008800;\n\tbackground-image: linear-gradient(-45deg,\n\t\trgba(255, 255, 255, 0) 22.9%,\n\t\trgba(255, 255, 255, 0.1) 23%,\n\t\trgba(255, 255, 255, 0.1) 50%,\n\t\trgba(255, 255, 255, 0) 50.1%,\n\t\trgba(255, 255, 255, 0) 72.9%,\n\t\trgba(255, 255, 255, 0.1) 73%);\n\tbackground-size: 20px 20px;\n\t-webkit-background-size:20px 20px;\n\tbackground-repeat: repeat;\n}\n\n.mMenuLogin {\n\tpadding-left:6px;\n\tpadding-right:6px;\n\tpadding-top:4px;\n\tpadding-bottom:4px;\n\tmargin-right:10px;\n\tmargin-left:10px;\n\tfont-weight:bold;\n\tcolor:#FFFFFF;\n\tborder-radius:20px;\n\tborder:2px solid #FFFFFF;\n}\n.mMenuItem {\n\tcursor:pointer;\n\tpadding-top:12px;\n\tpadding-bottom:12px;\n\tpadding-left:16px;\n\tpadding-right:32px;\n\tfont-weight:bold;\n\tbackground:#FFFFFF;\n}\n.mMoveLast {\n\tbackground:rgba(255,255,255,0.7);\n\tborder-radius:10px;\n\tborder:1px solid rgba(0,0,0,0.5);\n\tcolor:rgba(0,0,0,0.5);\n}\n\n.windImg {\n\twidth:16px;\n\theight:16px;\n\tvertical-align:middle;\n}\n\n</style>\n\n<script type='text/javascript'>\n\nEOF;\necho (\"\tvar ism = \".($ISM?1:0).\";\\n\");\nprint <<<EOF\n\nvar gEcBusy=false;\n/*\nwindow.addEventListener('error', function(e) {\n\tif (gEcBusy) return;\n\tgEcBusy = true;\n\tif ((document.getElementById('map') != null) && (map.innerHTML == '')) {\n\t\t// MAP loading error\n\t\tmap.innerHTML = \"<table width='100%' height='100%'><tr><td align='center'><h3>Wait...</h3></td></tr></table>\";\n\t\tsetTimeout ('location.reload()',3000);\n\t} else\n\tif (document.getElementById('msgPopupTxt') != null) {\n\t\tvar msg = 'EC#'+e.lineno+':'+e.colno+'<p>'+e.message+'</p>';\n\t\tmsg += \"<input type='button' value='Close' onclick='MsgPopupHideGo()' class='pure-button'> <input type='button' value='Reload' onclick='location.reload()' class='pure-button'>\";\n\t\tMsgPopupError (msg, 0);\n\t} else {\n\t\talert ('EC#'+e.lineno+':'+e.colno+'\\\\n'+e.message);\n\t}\n\tPrintAll(e.target);\n}, true);\n*/\nwindow.onerror = function(emsg, url, eline, ecol, eerror) {\n\tif (gEcBusy) return true;\n\tgEcBusy = true;\n\tif ((document.getElementById('map') != null) && (map.innerHTML == '')) {\n\t\t// MAP loading error\n\t\tmap.innerHTML = \"<table width='100%' height='100%'><tr><td align='center'><h3>Wait...</h3></td></tr></table>\";\n\t\tsetTimeout ('location.reload()',3000);\n\t} else\n\tif (document.getElementById('msgPopupTxt') != null) {\n\t\tvar msg = '<p>EC#';\n\t\tmsg += eline ? eline : 'unknown';\n\t\tif (ecol) msg += ':' + ecol;\n\t\tmsg += '</p>';\n\t\tif (emsg) msg += '<p>'+emsg+'</p>';\n\t\tif ((emsg) && (eerror) && (emsg.indexOf(eerror) < 0)) msg += '<p>'+eerror+'</p>';\n\t\tif (url) msg += '<p>'+url+'</p>';\n\t\tmsg += \"<input type='button' value='Close' onclick='MsgPopupHideGo()' class='pure-button'> <input type='button' value='Reload' onclick='location.reload()' class='pure-button'>\";\n\t\tMsgPopupError (msg, 0);\n\t} else {\n\t\tvar msg = 'EC#';\n\t\tmsg += eline ? eline : 'unknown';\n\t\tif (ecol) msg += ':' + ecol;\n\t\tif (emsg) msg += '\\\\n'+emsg;\n\t\tif ((emsg) && (eerror) && (emsg.indexOf(eerror) < 0)) msg += '\\\\n'+eerror;\n\t\tif (url) msg += '\\\\n'+url;\n\t\talert (msg);\n\t}\n\treturn true;\n};\n\n// Prohibited area selection.\nfunction ReturnFalse () {\n\treturn false;\n}\nwindow.document.onselectstart = ReturnFalse;\nwindow.document.ondragstart = ReturnFalse;\nif (navigator.userAgent.indexOf('Firefox') >= 0) {\n\tvar eventNames = [\"mousedown\",\"mouseover\",\"mouseout\",\"mousemove\",\"mousedrag\",\"click\",\"dblclick\",\"keydown\",\"keypress\",\"keyup\"];\n\tfor(var i=0; i<eventNames.length; i++) {\n\t\twindow.addEventListener( eventNames[i], function(e) { window.event = e; }, true );\n\t}\n}\n\nfunction pwKeyCursor (npobj) {\n\tvar nplen = npobj.value.length;\n\tnpobj.setSelectionRange(nplen, nplen);\n}\nfunction pwKeyDown () {\n\tvar e = event || window.event;\n\tvar keycode = e.keyCode || e.charCode;\n\tif ((33 <= keycode) && (keycode <= 40)) {\n\t\tif (e.preventDefault) e.preventDefault(); else e.stop();\n\t}\n}\nfunction pwKeyPress (obj) {\n\tvar e = event || window.event;\n\tvar keycode = e.keyCode || e.charCode;\n\tif (keycode == 13) return;\n\tif (keycode == 8) return;\n\t\n\tvar npobj = obj;\n\tvar opobj = eval(obj.form.name+'.'+obj.name.slice(0, -1));\n\tnpobj.value += '*';\n\topobj.value += String.fromCharCode(keycode);\n\tif (e.preventDefault) e.preventDefault(); else e.stop();\n\tobj.blur();\n\tobj.focus();\n}\nfunction pwKeyUp (obj) {\n\tvar npobj = obj;\n\tvar opobj = eval(obj.form.name+'.'+obj.name.slice(0, -1));\n\tvar nplen = npobj.value.length;\n\tvar oplen = opobj.value.length;\n\tif (nplen < oplen) opobj.value = opobj.value.substr(0, nplen);\n\telse if (oplen < nplen) opobj.value += npobj.value.substr(oplen);\n\telse return;\n\tnpobj.value = '';\n\tfor (var i=0; i<nplen; i++) npobj.value += '*';\n\tobj.blur();\n\tobj.focus();\n}\n\nfunction PrintAll (obj) {\n\tvar msg = ''\n\tfor (propName in obj) try { msg += propName+'='+obj[propName]+'\\\\n'; } catch (err) { }\n\talert(msg);\n}\n\nfunction SetCookie(cKey, cValue) {\n\tdocument.cookie = cKey + '=' + escape(cValue);\n}\nfunction SetCookie(cKey, cValue, iValid) {\n\tvar date = new Date();\n\tdate.setDate(date.getDate() + iValid);\n\tdocument.cookie = cKey + '=' + escape(cValue) + ';expires=' + date.toGMTString();\n}\nfunction DelCookie(cKey) {\n\tvar date = new Date();\n\tdate.setDate(date.getDate() - 1);\n\tdocument.cookie = cKey + '=;expires=' + date.toGMTString();\n}\nfunction GetCookie(cKey, cDef) {\n\tvar cookies = document.cookie.split(\"; \");\n\tfor (var i = 0; i < cookies.length; i++) {\n\t\tvar keyValues = cookies[i].split(\"=\");\n\t\tif ((0 < keyValues.length) && (keyValues[0] == cKey)) return unescape(keyValues[1]);\n\t}\n\treturn cDef;\n}\n\nvar hMsgTimeout = null;\nfunction MsgPopupColor (msg, c, ms, ani) {\n\tif (hMsgTimeout != null) {\n\t\tclearTimeout(hMsgTimeout);\n\t\thMsgTimeout = null;\n\t}\n\t$('#msgPopupTxt').html(msg);\n\t$('#msgPopupTxt').css('background-color',c);\n\t$('#msgPopupBox').css('display','table');\n\tif (0 < ms) hMsgTimeout = setTimeout (MsgPopupHideGo,ms);\n\tif (ani) $('#msgPopupTxt').animate({zoom:'110%'},100).animate({zoom:'95%'},100).animate({zoom:'100%'},100);\n}\nfunction MsgPopupOnly (msg, ms) {\t// no animation\n\tMsgPopupColor (msg, '#008800', ms, false);\n}\nfunction MsgPopupShow (msg, ms) {\t// normal dialog box + popup animation\n\tMsgPopupColor (msg, '#008800', ms, true);\n}\nfunction MsgPopupError (msg, ms) {\t// error dialog box + popup animation\n\tMsgPopupColor ('<img src=\"img/attention.png\" style=\"vertical-align:top\"> '+msg, '#B81900', ms, true);\n}\nfunction MsgPopupHideGo () {\n\thMsgTimeout = null;\n\t$('#msgPopupBox').fadeOut();\n}\nfunction MsgPopupHide () {\n\tif (hMsgTimeout != null) {\n\t\tclearTimeout(hMsgTimeout);\n\t\tMsgPopupHideGo ();\n\t}\n}\n\nfunction js_number_format (num, decimals, zero) {\n\tif (typeof num != 'number') return '';\n\tnum = num.toFixed(decimals);\n\tvar reg = /(^[+-]?\\d+)(\\d{3})/;\n\tvar tmp = num.split('.');\n\tvar n = tmp[0];\n\tvar d = tmp[1];\n\tif (d) {\n\t\tvar l = d.length;\n\t\tif (zero === 0) {\n\t\t\twhile (0 < l) {\n\t\t\t\tif (d.charAt(l-1) != '0') break;\n\t\t\t\td = d.substring (0, --l);\n\t\t\t}\n\t\t}\n\t\td = (0<l) ? ('.' + d) : '';\n\t} else {\n\t\td = '';\n\t}\n\t\n\twhile(reg.test(n)) n = n.replace(reg, \"$1,$2\");\n\treturn n + d;\n}\n\nEOF;\n\techo (\"var arr_win_dir = [\");\n\tfor ($i=0; $i<sizeof($arr_win_dir); $i++) {\n\t\tif (0 < $i) echo (\",\");\n\t\techo (\"'$arr_win_dir[$i]'\");\n\t}\n\techo (\"];\\n\");\n\techo (\"var arr_pozip = [\");\n\tfor ($i=0; $i<sizeof($arr_pozip); $i++) {\n\t\tif (0 < $i) echo (\",\");\n\t\techo (\"'$arr_pozip[$i]'\");\n\t}\n\techo (\"];\\n\");\n\techo (\"var arr_alm = [\");\n\tfor ($i=0; $i<sizeof($arr_alm); $i++) {\n\t\tif(0 < $i) echo (\",\");\n\t\techo (\"'$arr_alm[$i]'\");\n\t}\n\techo (\"];\\n\");\nprint <<<EOF\n\nfunction js_item_format\t(val, dec, zero) {\n\tif ((0 <= dec) && (dec <= 9)) {\n\t\treturn js_number_format (val, dec, zero);\n\t}\n\tif (10 == dec) {\t// Special code: wind_direction\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 1) || (16 < val)) val = 1;\n\t\treturn arr_win_dir[val-1] + \" <img src='img/windd\"+val+\".png' class='windImg'>\";\n\t}\n\tif (11 == dec) {\t// Special code: pozip\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 0) || (1 < val)) val = 0;\n\t\treturn arr_pozip[val];\n\t}\n\tif (12 == dec) {\t// Special code: alm\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 0) || (3 < val)) val = 0;\n\t\treturn arr_alm[val];\n\t}\n\treturn val;\n}\n\nEOF;\n\tif ($ISM) {\nprint <<<EOF\n\nvar menuStatus = false;\nfunction mfc(action) {\n\tMenuClose(1);\n\tdocument.location = action;\n}\nfunction MenuClose (opt) {\n\tif (opt != 1) {\n\t\tmenuStatus = false;\n\t\t$('body,html').css({'overflow':'visible'});\n\t\t$('body').unbind('touchmove');\n\t\t$('#menuBack').fadeOut();\n\t}\n\tvar obj = $('#menuMenu');\n\tvar w = obj.width()+10;\n\tobj.animate({left:-w});\n}\nfunction MenuClick () {\n\tmenuStatus = true;\n\t$('body,html').css({'overflow':'hidden'});\n\t$('body').bind('touchmove', function(e){if(e.preventDefault)e.preventDefault();else e.stop()});\n\t$('#menuBack').fadeIn();\n\t\n\tvar obj = $('#menuMenu');\n\tvar w = obj.width()+10;\n\tobj.css({left:-w});\n\tobj.animate({left:0});\n}\nfunction MoveLastUp() {\n\t$('body').scrollTop(0);\n}\nfunction MoveLastDn() {\n\t$('body').scrollTop($(document).height());\n}\n\n// Call from Android APP.\nvar mMyLat = 0, mMyLng = 0;\nfunction SetLocation (lat, lng) {\n\tmMyLat = lat;\n\tmMyLng = lng;\n\tif (typeof OnMyLocation == 'function') OnMyLocation (false);\n}\n\nEOF;\n\t} else {\n\t\tif ($sWindowTitle != '') echo (\"try{parent.document.title='$sWindowTitle';}catch(err){}\\n\");\n\t}\n\techo (\"</script>\\n\");\n}", "function klippe_mikado_get_header_top() {\n\t\t$params = array(\n\t\t\t'show_header_top' => klippe_mikado_is_top_bar_enabled(),\n\t\t\t'show_header_top_background_div' => klippe_mikado_get_meta_field_intersect( 'header_type' ) == 'header-box' ? true : false,\n\t\t\t'top_bar_in_grid' => klippe_mikado_get_meta_field_intersect( 'top_bar_in_grid' ) == 'yes' ? true : false,\n\t\t\t'top_bar_skin' => klippe_mikado_get_meta_field_intersect( 'top_bar_skin' ),\n\t\t);\n\t\t\n\t\t$params = apply_filters( 'klippe_mikado_header_top_params', $params );\n\t\t\n\t\tklippe_mikado_get_module_template_part( 'templates/top-header', 'header/types/top-header', '', $params );\n\t}", "public function head() {\r\n return <<<HTML\r\n <meta charset=\"utf-8\">\r\n <title>$this->title</title>\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <link href=\"steampunked.css\" type=\"text/css\" rel=\"stylesheet\" />\r\n\r\nHTML;\r\n }", "public function Header()\n {\n // Set custom header and footer\n $this->setCustomHeader();\n\n if (array_key_exists($this->category, $this->categories)) {\n $title = $this->categories[$this->category]['name'];\n } else {\n $title = '';\n }\n\n $this->SetTextColor(0, 0, 0);\n $this->SetFont($this->currentFont, 'B', 18);\n\n if (0 < PMF_String::strlen($this->customHeader)) {\n $this->writeHTMLCell(0, 0, '', '', $this->customHeader);\n $this->Ln();\n $this->writeHTMLCell(0, 0, '', '', html_entity_decode($title, ENT_QUOTES, 'utf-8'), 0, 0, false, true, 'C');\n } else {\n $this->MultiCell(0, 10, html_entity_decode($title, ENT_QUOTES, 'utf-8'), 0, 'C', 0);\n $this->SetMargins(PDF_MARGIN_LEFT, $this->getLastH() + 5, PDF_MARGIN_RIGHT);\n }\n }", "public function generate_head()\n {\n $this->xml->openMemory();\n $this->xml->setIndent(true);\n $this->xml->startDocument(\"1.0\",\"UTF-8\");\n $this->xml->startElement(\"program\");\n $this->xml->writeAttribute(\"language\",\"IPPcode19\");\n }", "function H($num = 1, $title = '', $pref = 0, $extra = '')\n{\n /**\n * H tag - this is an HTML Document Header line.\n *\n * Args:\n * $num (int): the header number (1-6) default is 1\n * $title (str): the text in the header line\n * $pref (int): number of tabs for indentation, default is 0\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n Tab($pref) ;\n echo '<h' . $num ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' . $title ;\n close_tag('h' . $num, '', true) ;\n}", "public function prePageHeader();", "function Header(){\n\t\t}", "private function makeCalendarHead()\n\t{\n\t\tif(strlen($this->headerStr) < 1) {\n\t\t\t$head = \"\\t<tr>\\n\\t\\t<th colspan=\\\"7\\\" class=\\\"headerString\\\">\";\n\t\t\tif(!is_null($this->curDay)) {\n\t\t\t\t$head .= $this->curDayName.' the '.$this->curDayS.' of '.$this->curMonthName.', '.$this->curYear;\n\t\t\t} else {\n\t\t\t\t$head .= $this->curMonthName.', '.$this->curYear;\n\t\t\t}\n\t\t\t$head .= \"</th>\\n\\t</tr>\\n\";\n\t\t} else {\n\t\t\t$head = $this->headerStr;\n\t\t}\n\t\t\n\t\t$this->calWeekDays .= $head;\n\t\t$this->outArray['head'] = $head;\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}", "protected function _createHeaderContainer()\n\t{\n\t\tif ($this->_thead == null) {\n\t\t\t$this->_thead = new HtmlElement('thead');\n\t\t\t$this->addElement($this->_thead);\n\t\t}\t\t\n\t}", "public function head_add($html) {\n\t\tif (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t$this->_head[] .= $html;\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}", "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_email_html_top(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '<!DOCTYPE HTML PUBLIC\\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\"\\\"http://www.w3.org/TR/html4/loose.dtd\\\">\n<html>\n\t<head></head>\n\t<body style=\"background-color: #800080; width:99%;\" link=\"ffd700\" alink=\"ffd700\" >\n\t\t<table style=\"width:100%;\">\n\t\t\t<tr>\n\t\t\t\t<td style=\"width:5%\">&nbsp;</td>\n\t\t\t\t<td style=\"width:94%\">';\n\t\t\t\t\n\t\treturn $output ;\n\t\t\n\t}", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nXML Schemas continued..\nMAINHEADING;\n }", "public function Header() {\n $bMargin = $this->getBreakMargin();\n\n // Get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n\n // Disable auto-page-break\n $this->SetAutoPageBreak(false, 0);\n\n // Define the path to the image that you want to use as watermark.\n\t\tif($this->headerImage!='')\n\t\t{\n\t\t\t $header_logo = './'.$this->headerImage;\n\t\t\t \n\t\t}else{\n\t\t\t $header_logo = './assets/logo/Assetswatch.png';\n\t\t}\n\t\tif($this->watermarkImage!='')\n\t\t{\n\t\t\t$img_file = './'.$this->watermarkImage;\n\t\t}else{\n\t\t\t $img_file = './assets/logo/water-mark.png';\n\t\t}\n \n\t\t// echo $header_logo.\"<br>\";\n\t\t// echo $img_file.\"<br>\";\n\t\t // exit();\n // Render the image\n\t\t$this->Image($header_logo, 135,5, 55, 18, '', '', '', false, 300, '', false, false, 0);\n $this->Image($img_file, 53,100, '100px', '100px', '', '', '', false, 300, '', false, false, 0);\n\t\t\n\t\tif($this->headerContent!='')\n\t\t{\n\t\t\t$this->Cell(0, 10,$this->headerContent , 0, false, 'L', 0, '', 0, false, 'T', 'M');\n\t\t}else{\n\t\t\t$this->Cell(0, 10,'' , 0, false, 'C', 0, '', 0, false, 'T', 'M');\n\t\t}\n // Restore the auto-page-break status\n $this->SetAutoPageBreak($auto_page_break, $bMargin);\n\n // Set the starting point for the page content\n $this->setPageMark();\n }", "function Header()\n {\n\n\n //list($r, $b, $g) = $this->xheadercolor;\n $this->setY(5);\n //$this->SetFillColor($r, $b, $g);\n //$this->SetTextColor(0 , 0, 0);\n //$this->Cell(0,20, '', 0,1,'C', 1);\n //$this->Text(15,26,$this->xheadertext );\n \n \n // get the current page break margin\n $bMargin = $this->getBreakMargin();\n // get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n // disable auto-page-break\n $this->SetAutoPageBreak(false, 0);\n // set bacground image\n $img_file = WWW_ROOT.'/img/Resul_Agua.jpg';\n $this->Image($img_file, 0, 0, 216, 279, '', '', '', false, 300, '', false, false, 0);\n // restore auto-page-break status\n $this->SetAutoPageBreak($auto_page_break, $bMargin);\n // set the starting point for the page content\n $this->setPageMark();\n \n\n $this->writeHTML($this->xheadertext, true, false, true, false, '');\n\n // Transformacion para la rotacion de el numero de orden y el contenedor de la muestra\n $this->StartTransform();\n //$this->SetFont('freesans', '', 5);\n $this->SetFont('', '', 5);\n $this->Rotate(-90, 117, 117);\n //$tcpdf->Rect(39, 50, 40, 10, 'D');\n $this->Text(5, 30, 'Software Asistencial Médico \"SAM\" V.1.1 ® - https://samsalud.info ®');\n // Stop Transformation\n $this->StopTransform();\n\n // if ( $this->variable == 1 )\n // {\n // draw jpeg image x, y ancho, alto\n // $this->Image(WWW_ROOT.'/img/BORRADOR.png', 40, 60, 450, 250, '', '', '', true, 72);\n\n // restore full opacity\n $this->SetAlpha(0);\n // }\n\n }", "function generateHead(){\n $title = $this->getTitle();\n echo \"<!DOCTYPE html>\n <html lang='en'>\n <head>\n <meta charset='UTF-8'>\n <meta name='viewport' content='width=device-width, initial-scale=1.0'>\n <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css'>\n <link href='https://cdn.quilljs.com/1.3.6/quill.snow.css' rel='stylesheet'>\n <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>\n <script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js'></script>\n <script src='https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js'></script>\n <link rel='stylesheet' href='static/styles/styles.css'>\n <title>$title</title>\n </head>\n <body>\";\n }", "abstract protected function RenderHead();", "public function getHeader() {\n\t\t\tglobal $arConfig; \n\t\t\t$strHTML = \"\\n\\t\\t<title>\" . $this->strTitle . \"</title>\";\n\t\t\t$strHTML .= \"\\n\\t\\t<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />\"; \n\t\t\t$strHTML .= \"\\n\\t\\t<link rel=\\\"shortcut icon\\\" href=\\\"\" . fixPath(\"favicon.png\") . \"\\\" type=\\\"image/png\\\" />\"; \n\t\t\tforeach($this->arMeta as $strKey=>$strVal) {\n\t\t\t\t$strHTML .= \"\\n\\t\\t<meta name=\\\"\" . $strKey . \"\\\" content=\\\"\" . $strVal . \"\\\" />\"; \n\t\t\t} \n\t\t\tforeach($this->arCSS as $strFile=>$arData) {\n\t\t\t\t$strHTML .= \"\\n\\t\\t<link rel=\\\"stylesheet\\\" href=\\\"\" . $strFile . \"\\\" type=\\\"text/css\\\" media=\\\"\" . $arData[\"media\"] . \"\\\" />\"; \n\t\t\t} \n\t\t\tforeach($this->arJS as $strFile) {\n\t\t\t\t$strHTML .= \"\\n\\t\\t<script src=\\\"\" . $strFile . \"\\\"></script>\"; \n\t\t\t} \n\t\t\t$strHTML .= \"\\n\\t\\t<script>\n\t\t\t\tvar strRoot = \\\"\" . settings(\"domain\", \"root\") . \"\\\"; \n\t\t\t</script>\"; \n\t\t\t\n\t\t\t\n\t\t\treturn $strHTML; \n\t\t}", "function Header() {\n if(empty($this->title) || $this->PageNo() == 1) return;\n $oldColor = $this->TextColor;\n $this->SetTextColor(PDF_HEADER_COLOR['red'],\n PDF_HEADER_COLOR['green'],\n PDF_HEADER_COLOR['blue']);\n $x = $this->GetX();\n $y = $this->GetY();\n $this->SetY(10, false);\n $this->SetFont('', 'B');\n $this->Cell(0, 10, $this->title);\n $this->SetFont('', '');\n $this->SetXY($x, $y);\n $this->TextColor = $oldColor;\n }", "function educoAdminPrepareHead() {\n global $langs, $conf;\n\n $langs->load(\"educo@educo\");\n\n $h = 0;\n $head = array();\n\n $head[$h][0] = dol_buildpath(\"/educo/admin/setup.php\", 1);\n $head[$h][1] = $langs->trans(\"Settings\");\n $head[$h][2] = 'settings';\n $h++;\n $head[$h][0] = dol_buildpath(\"/educo/admin/about.php\", 1);\n $head[$h][1] = $langs->trans(\"About\");\n $head[$h][2] = 'about';\n $h++;\n\n // Show more tabs from modules\n // Entries must be declared in modules descriptor with line\n //$tabs = array(\n //\t'entity:+tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to add new tab\n //$tabs = array(\n //\t'entity:-tabname:Title:@educo:/educo/mypage.php?id=__ID__'\n //); // to remove a tab\n complete_head_from_modules($conf, $langs, $object, $head, $h, 'educo');\n\n return $head;\n}", "function print_html_top() {\r\n\t\techo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">' .\r\n\t\t\t\"\\n<html>\";\r\n\t}", "private static final function getHTMLHeadContainer () {\r\n // Return the <HTML><head> container;\r\n $containerHTMLHead = new FileContent (FORM_TP_DIR . _S . 'frm_web_html_head_container.tp');\r\n return $containerHTMLHead->doToken ('[%BASE_HREF_URL%]', DOCUMENT_HOST);\r\n }", "public function head() {\n\t\treturn '';\n\t}", "public static function end_header()\n\t{\n\t\treturn sprintf('</h%d>',\n\t\t\tmin(6, self::$nivel_cabecalho)\n\t\t);\n\t}", "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 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}", "public function Header() {\n // si la pagina es diferente de la 2\n // if (count($this->pages) !== 2) \n // {\n // Logo\n $image_file = K_PATH_IMAGES.'logoesen.jpg';\n $this->Image($image_file, 90, 5, 25, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);\n // Set font\n $this->SetFont('helvetica', 'B', 20);\n // Title\n //$this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M');\n // }\n }", "function showHTMLHeaderWithTitle($title = '') {\r\n\techo '<!DOCTYPE html>'; // započinje ispravan HTML blok koda\r\n\r\n\techo '<html lang=\"hr\">'; // postavlja jezik stranice na hrvatski\r\n\r\n\techo '<head>'; // započinje HEAD dio HTML stranice\r\n\r\n\techo '<meta charset=\"utf-8\">'; // postavlja kodiranje stranice na UTF-8\r\n\r\n\techo '<title>'; // započinje postavljanje naslova stranice koji se prikazuje u pregledniku kod bookmarka i u nazivu prozora ili taba\r\n\techo (isset($title) && !empty($title) ? $title.' :: ' : ''); // prikazuje naslov putem inline if-a, ako je postavljen\r\n\techo 'Bankomati'; // na kraju naslova uvijek doda naziv aplikacije Bankomati\r\n\techo '</title>';// završava postavljanje naslova stranice\r\n\r\n\techo '</head>'; // završava HEAD dio HTML stranice\r\n\r\n\techo '<body>'; // započinje BODY dio HTML stranice\r\n\t// prikazuje naslov kao heading (poglavlje stranice) putem običnog if-a, ako je postavljen\r\n\tif (\r\n\t\tisset($title) \r\n\t\t&& \r\n\t\t!empty($title)\r\n\t) {\r\n\t\techo '<h1>'; // započinje postavljanje headinga (poglavlja) stranice nivoa 1\r\n\t\techo $title;\r\n\t\techo '</h1>'; // završava postavljanje headinga (poglavlja) stranice nivoa 1\r\n\t}\r\n\techo '<hr/>'; // ispisuje horizontalku\r\n}", "function displayPageHeader($pageTitle)\r\n{\r\n $output = <<<ABC\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<head>\r\n \r\n <meta charset=\"UTF-8\" />\r\n <meta name=\"author\" content=\"Xin Tian\" />\r\n <meta name=\"description\" content=\"A site for shopping clothes\" />\r\n <meta name=\"keywords\" content=\"rainbow, clothes\" />\r\n <title>Rainbow $pageTitle</title>\r\n <link href=\"commonStyle.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n <link href=\"commonStyle1.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n</head>\r\n\r\n<body>\r\n<nav>\r\n \r\n <a style=\"font-size:45px\" id=\"homeTitleIn\" href=\"home.php\">RAINBOW</a>\r\n <a style=\"font-size:15px\" id=\"rightTitle1\" href=\"login.php\">Sign in</a>\r\n <a style=\"font-size:15px\" id=\"rightTitle2\" href=\"about.html\">About</a>\r\n <a style=\"font-size:15px\" id=\"bag\" href=\"shoppingCart.php\">ShoppingCart</a>\r\n \r\n </nav>\r\n\r\n \r\nABC;\r\n echo $output;\r\n}", "function bethel_do_header_right_top() {\n\tgenesis_widget_area ('header-right-top', array ('before' => '<div id=\"bethel-header-right-top\">', 'after' => '</div>'));\n}", "function build_html_table_top(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t<table style=\"border: 1px solid #FFFFFF; width:100%; table-layout: fixed;\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">Date Visited</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">IP Address</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">OS</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">Browser Name</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 8%;\"><font color=\"ffd700\">Browser Version</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Referer Page</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Request Page</font></th>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\n\t\treturn $output;\n\t\t\n\t}", "private function printHead()\n\t{\n\t\t$out = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\n\t\t$out .= $this->head . PHP_EOL;;\t\t\t\n\t\techo $out;\n\t}", "abstract protected function header();", "function add_head_tag($tag)\n {\n $this->addHeadTag($tag);\n }", "public function Header() {\n\t\t$x = 0;\n\t\t$dx = 0;\n\t\tif ($this->rtl) {\n\t\t\t$x = $this->w + $dx;\n\t\t} else {\n\t\t\t$x = 0 + $dx;\n\t\t}\n\n\t\t// print the fancy header template\n\t\tif($this->print_fancy_header){\n\t\t\t$this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false);\n\t\t}\n\t\tif ($this->header_xobj_autoreset) {\n\t\t\t// reset header xobject template at each page\n\t\t\t$this->header_xobjid = false;\n\t\t}\n\t\t\n\t\t$this->y = $this->header_margin;\n\t\t$this->SimpleHeader();\n\t\t//$tmpltBase = $this->MakePaginationTemplate();\n\t\t//echo $tmpltBase;die();\n\t\t//echo('trying to print header template: ');\n\t\t//$this->printTemplate($tmpltBase, $x, $this->y, 0, 0, '', '', false);\n\t\t//die();\n\t}", "function display_header() {}", "function lightseek_homepage_header() {\n\techo '<header class=\"entry-header\">';\n\t\tlightseek_post_header();\n\techo '</header>';\n}", "public function head() {\r\n return '';\r\n }", "function HTMLheaders($body) {\n$title = GetLangVar('title');\necho \"\n<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>\n<html lang='pt'>\n<head>\n <title>$title</title>\n <meta name='title' content='\".$metatitle.\"' >\n <meta http-equiv='Content-Type' content=\\\"text/html; charset='UTF-8'\\\">\n <meta name='google-site-verification' content='sBY5TPzoJ09tOWC6GGacC8LouyYCSS8ObhOybnFn84k' >\n <meta name='url' content='\".$metaurl.\"' >\n <meta name='robots' content='all' />\n <meta name='language' content='pt-br' />\n <meta name='description' content='\".$metadesc.\"'>\n <meta name='keywords' content='\".$metakeyw.\"' >\n <meta name='autor' content='Alberto Vicentini - INPA' >\n <meta name='company' content='\".$metacompany.\"' >\n <meta name='revisit-after' content='30' >\n <meta http-equiv='imagetoolbar' content='no' >\n <link href='css/geral.css' rel='stylesheet' type='text/css' >\n <link rel='stylesheet' type='text/css' media='screen' href='css/Stickman.MultiUpload.css' >\n <link rel='stylesheet' type='text/css' href='css/cssmenu.css' >\n <link rel='stylesheet' type='text/css' media='screen' href='css/autosuggest.css' >\n <link rel='stylesheet' type='text/css' media='screen' href='javascript/tabber/tabber.css' >\n <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"dhtmlxconnector/dhtmlxTabbar/dhtmlxtabbar.css\\\">\n <link rel='stylesheet' type='text/css' href='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid.css' >\n <link rel='stylesheet' type='text/css' href='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid_pgn_bricks.css' >\n <link rel='stylesheet' type='text/css' href='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_hmenu.css' >\n <link rel='stylesheet' type='text/css' href='javascript/fileuploader.css' >\n <link rel='stylesheet' href='magiczoomplus/magiczoomplus/magiczoomplus.css' type='text/css' media='screen' >\n <script type='text/javascript' src='javascript/ajax_framework.js'></script>\n <script type='text/javascript' src='javascript/jquery-latest.js'></script>\n <script type='text/javascript'>\n $(document).ready(function(){\n $('.toggle_container').hide();\n $('h2.trigger').click(function(){\n $(this).toggleClass('active').next().slideToggle('slow');\n });\n });\n </script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxcommon.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxTabbar/dhtmlxtabbar.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxTabbar/dhtmlxcontainer.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgridcell.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid_pgn.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxConnector_php/codebase/connector.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/dhtmlxgrid_export.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_link.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_clist.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_hmenu.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_ssc.js'></script>\n <script type='text/javascript' src='dhtmlxconnector/dhtmlxGrid/codebase/ext/dhtmlxgrid_mcol.js'></script>\n\n <script type='text/javascript' src='javascript/sorttable/common.js'></script>\n <script type='text/javascript' src='javascript/sorttable/css.js'></script>\n <script type='text/javascript' src='javascript/sorttable/standardista-table-sorting.js'></script>\n <script type='text/javascript' src='javascript/mootools.js'></script>\n <script type='text/javascript' src='javascript/teste.js'></script>\n <script type='text/javascript' src='javascript/Stickman.MultiUpload.js'></script>\n <script type='text/javascript' src='css/cssmenuCore.js'></script>\n <script type='text/javascript' src='css/cssmenuAddOns.js'></script>\n <script type='text/javascript' src='css/cssmenuAddOnsItemBullet.js'></script>\n <script src='magiczoomplus/magiczoomplus/magiczoomplus.js' type='text/javascript'></script>\n</head>\";\nif (!empty($body)) {\n\techo \"\n<body \".$body.\">\n<div>\";\n} else {\n\techo \"\n<body >\n<div>\";\n}\nif (!isset($_SESSION['userid'])) {\n\techo \"\n<h1>$title</h1>\";\n} else {\n\techo \"\n<h3>\".GetLangVar('title').\"</h3>\";\n}\nMenu($title);\necho \"\n<!--////////////////-->\n<!--FIM DO CABECALHO-->\n<!--////////////////-->\n</div>\n<div id='container'>\n<br>\";\n}", "public function admin_head()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $head_content = $this->standard_head(true).\"\\n\"; // We start with the standard stuff.\n \n $head_content .= \"<!-- Also Added by the BMLT plugin 3.X. -->\\n<meta http-equiv=\\\"X-UA-Compatible\\\" content=\\\"IE=EmulateIE7\\\" />\\n<meta http-equiv=\\\"Content-Style-Type\\\" content=\\\"text/css\\\" />\\n<meta http-equiv=\\\"Content-Script-Type\\\" content=\\\"text/javascript\\\" />\\n\";\n $options = $this->getBMLTOptions(1); // All options contain the admin key.\n $key = $options['google_api_key'];\n \n // Include the Google Maps API V3 files.\n $head_content .= '<script type=\"text/javascript\" src=\"https://maps.google.com/maps/api/js?key='.$key.'\"></script>'; // Load the Google Maps stuff for our map.\n \n if (function_exists('plugins_url')) {\n $head_content .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"';\n \n $url = $this->get_plugin_path();\n \n $head_content .= htmlspecialchars($url);\n \n $head_content .= 'admin_styles.css\" />';\n \n $head_content .= '<script type=\"text/javascript\" src=\"';\n \n $head_content .= htmlspecialchars($url);\n \n $head_content .= 'admin_javascript.js\"></script>';\n } else {\n echo \"<!-- BMLTPlugin ERROR (head)! No plugins_url()! -->\";\n }\n \n $head_content .= \"\\n<!-- End Also Added by the BMLT plugin 3.X. -->\\n\";\n echo $head_content;\n }", "function v2_mumm_html_head_alter(&$head_elements) {\n $url = explode('/', current_path());\n if ($url[0] == 'gallery-photo') {\n unset($head_elements['metatag_og:title_0']);\n unset($head_elements['metatag_og:url_0']);\n }\n if(isset($head_elements['metatag_canonical']) && $head_elements['metatag_canonical']['#type'] =='html_tag'){\n $head_elements['metatag_canonical']['#value'] = urldecode($head_elements['metatag_canonical']['#value']);\n }\n}" ]
[ "0.74177355", "0.72927105", "0.7132003", "0.7017262", "0.69321734", "0.6894451", "0.6887539", "0.6865145", "0.68378186", "0.68192357", "0.67524695", "0.67443466", "0.6742606", "0.6737936", "0.6710304", "0.6696011", "0.668724", "0.6662437", "0.6650457", "0.66434157", "0.6641544", "0.664069", "0.66401225", "0.66304225", "0.6622784", "0.66106325", "0.65959656", "0.6584754", "0.6554149", "0.6554007", "0.6552044", "0.6550284", "0.6539611", "0.6537185", "0.6516159", "0.6497849", "0.64962465", "0.64895135", "0.6480007", "0.6463736", "0.6457262", "0.6454079", "0.64489996", "0.64467144", "0.6445025", "0.6443767", "0.6442024", "0.6433247", "0.6432036", "0.64299476", "0.6409093", "0.6403732", "0.6402615", "0.6397905", "0.638732", "0.63867146", "0.6383201", "0.6378605", "0.6372971", "0.63648236", "0.636202", "0.6355315", "0.63528043", "0.6350263", "0.6341942", "0.6341841", "0.6336215", "0.632357", "0.63090795", "0.63072383", "0.6300299", "0.6298378", "0.6292631", "0.62895614", "0.6288123", "0.62868816", "0.628494", "0.6284188", "0.62829304", "0.6280648", "0.6280472", "0.6277784", "0.6277517", "0.6260403", "0.62540877", "0.6252251", "0.62499154", "0.62473255", "0.62453884", "0.6244397", "0.6237518", "0.62268746", "0.6226674", "0.62133557", "0.6208305", "0.620724", "0.618708", "0.6183127", "0.61785835", "0.6173548" ]
0.7201959
2
end finalizeTopHTML / This function returns the top html to the calling class.
function getTopHTML() { return $this->_topHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalizeTopHTML() {\n\t\t$returnVal = \"\";\n\t\t$returnVal .= \"<!doctype html>\\n\";\n\t\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t\t$returnVal .= \"<head><title>\";\n\t\t$returnVal .= $this->_title;\n\t\t$returnVal .= \"</title>\\n\";\n\t\t$returnVal .= $this->_headSection; \n\t\t$returnVal .= \"</head>\\n\";\n\t\t$returnVal .= \"<body>\\n\";\n\t\t$returnVal .= \"<div id='container'>\\n\";\n\t\t$this->_topHTML = $returnVal;\n\t}", "function finalizeTopSection() {\n\t$returnVal = \"\";\n\t$returnVal .= '<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css\" integrity=\"sha384-TX8t27EcRE3E/ihU7zmQxVncDAy5uIKz4rEkgIXeM>';\n\t$returnVal .= \"<!doctype html>\\n\";\n\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t$returnVal .= \"<head><title>\";\n\t$returnVal .= $this->_title;\n\t$returnVal .= \"</title>\\n\";\n $returnVal .= $this->_headSection;\n\t$returnVal .= \"</head>\\n\";\n\t$returnVal .= \"<body>\\n\";\n\n\t$this->_top = $returnVal;\n\n}", "function Get_Standard_Top_Section_HTML($title = null)\n{\n require_once __DIR__ . \"/../../static_php/standard_header.php\";\n\n $configService = \\Factory::getConfigService();\n\n $html = \"\";\n\n $html .= get_standard_header($title);\n\n // banner if requested\n $banner = $configService->getPageBanner();\n if (!empty($banner)) {\n $html .= Get_Banner($banner);\n }\n // container for the page\n $html .= \"<div class=\\\"page_container\\\">\";\n // menu bar\n $html .= \"<div class=\\\"left_box_menu\\\">\";\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/goc5_logo.html\");\n //Insert a portal is in read only warning message, if it is\n if ($configService->IsPortalReadOnly()) {\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/read_only_warning.html\");\n }\n require_once \"menu.php\";\n $html .= draw_menu(\"main_menu\");\n $html .= \"</div>\";\n //$html .= \"<h3 class=\\\"spacer\\\">Test</h3>\";\n\n $html .= Get_Search_Box_HTML();\n $html .= Get_User_Info_Box_HTML();\n $html .= Get_bottom_logos_Box_HTML();\n\n // right side of the page\n $html .= \"<div class=\\\"right_box\\\">\";\n\n // logout button (if set - does not always need to be rendered)\n if (!empty(\\Factory::$properties['LOGOUTURL'])) {\n $html .= \"<div style='text-align: right;'>\";\n $html .= '<a href=\"' . htmlspecialchars(\\Factory::$properties['LOGOUTURL']) .\n '\"><b><font class=\"btn btn-danger btn-xs\">Logout</font></b></a>';\n $html .= \"</div>\";\n }\n\n return $html;\n}", "function Get_Standard_Top_Section_HTML($title=null)\n {\n require_once __DIR__.\"/../../static_php/standard_header.php\";\n $HTML = \"\";\n\n $HTML .= get_standard_header($title);\n\n // container for the page\n $HTML .= \"<div class=\\\"page_container\\\">\";\n\n // menu bar\n $HTML .= \"<div class=\\\"left_box_menu\\\">\";\n $HTML .= Get_File_Contents(__DIR__.\"/../../static_html/goc5_logo.html\");\n //Insert a portal is in read only warning message, if it is\n if(\\Factory::getConfigService()->IsPortalReadOnly()){\n $HTML.= Get_File_Contents(__DIR__.\"/../../static_html/read_only_warning.html\");\n }\n require_once \"menu.php\";\n $HTML .= draw_menu(\"main_menu\");\n $HTML .= \"</div>\";\n //$HTML .= \"<h3 class=\\\"spacer\\\">Test</h3>\";\n\n $HTML .= Get_Search_Box_HTML();\n $HTML .= Get_User_Info_Box_HTML();\n $HTML .= Get_bottom_logos_Box_HTML();\n\n // right side of the page\n $HTML .= \"<div class=\\\"right_box\\\">\";\n\n // logout button (if set - does not always need to be rendered)\n if(!empty(\\Factory::$properties['LOGOUTURL'])){\n $HTML .= \"<div style='text-align: right;'>\";\n //$HTML .= '<a href=\"'.htmlspecialchars(\\Factory::$properties['LOGOUTURL']).'\"><b><font colour=\"red\">Logout</font></b></a>';\n $HTML .= '<a href=\"'.htmlspecialchars(\\Factory::$properties['LOGOUTURL']).'\"><b><font class=\"btn btn-danger btn-xs\">Logout</font></b></a>';\n $HTML .= \"</div>\";\n }\n\n\n return $HTML;\n }", "function top() {\n return '<div class=\"top\"><a href=\"#credits\">[Top]</a></div>';\n}", "function _goTop () {\n\t\t$this->_roof[\"dtd\"] =$this->_dtd[$this->_doctype];\n\t\t$this->_roof[\"dtd\"].=\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" lang=\\\"\".$this->_lang.\"\\\" xml:lang=\\\"\".$this->_lang.\"\\\">\\n<head>\\n<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=\".$this->_enc[$this->_lang].\"\\\" />\\n\";\n\t\t$this->_roof[\"dtd\"].=\"<title>\".$this->_title.\"</title>\\n\";\n\t\t@ob_end_flush();\n\t}", "function finalizeBottomHTML() {\n\t\t$returnVal = \"\";\n\t\t$returnVal .= \"</div>\\n\"; // Closes Container\n\t\t$returnVal .= \"</body>\\n\";\n\t\t$returnVal .= \"</html>\\n\";\n\t\t$this->_bottomHTML = $returnVal;\n\t}", "function build_email_html_top(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '<!DOCTYPE HTML PUBLIC\\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\"\\\"http://www.w3.org/TR/html4/loose.dtd\\\">\n<html>\n\t<head></head>\n\t<body style=\"background-color: #800080; width:99%;\" link=\"ffd700\" alink=\"ffd700\" >\n\t\t<table style=\"width:100%;\">\n\t\t\t<tr>\n\t\t\t\t<td style=\"width:5%\">&nbsp;</td>\n\t\t\t\t<td style=\"width:94%\">';\n\t\t\t\t\n\t\treturn $output ;\n\t\t\n\t}", "function build_html_table_top(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t<table style=\"border: 1px solid #FFFFFF; width:100%; table-layout: fixed;\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">Date Visited</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">IP Address</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">OS</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">Browser Name</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 8%;\"><font color=\"ffd700\">Browser Version</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Referer Page</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Request Page</font></th>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function writeTop() {}", "function print_html_top() {\r\n\t\techo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">' .\r\n\t\t\t\"\\n<html>\";\r\n\t}", "public function writeTop()\n {\n }", "public static function entries_top () \n {\n $html = null; \n\n load::view( 'admin/entries/top' );\n $html .= entries_top::form();\n \n return $html;\n }", "function printTop() {\n \n\tprint \n\t \n \"\t<!DOCTYPE html>\".\n \"\t<html lang='en'>\".\n \"\t<head>\".\n \" <meta charset='utf-8'>\".\n \"<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'> \".\n \" <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'></script> \".\n \" <script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script> \".\n \" <meta http-equiv='X-UA-Compatible' content='IE=edge'>\".\n \"<meta name='viewport' content='width=device-width, initial-scale=1'>\".\n \"<meta name='description' content=''>\".\n \" <meta name='author' content=''>\".\n \" <meta charset='UTF-8'>\".\n \"\t<title> Sitter Profile </title>\".\n \"</head>\".\n \n \"<body>\".\n \"<h1> Sitter Information : </h1>\".\t\n\t\n\t \"</body> \\n\".\n \"</html> \\n\";\n\t}", "function mainTop(){\n\t\techo \"<table align='center' cellpadding='0' cellspacing='0' width='\".$this->width.\"'>\\n<tr>\\n<td width='\".$this->width.\"' class='main-bg'>\\n\";\n\t}", "function get_html_pre_page_end();", "function to_the_top()\r\n{\r\n return \"\\n \"\r\n . \"<div style=\\\"text-align: right;\\\">\\n\"\r\n . \"<a href=\\\"#top\\\">\"\r\n . \"<img src=\\\"\".base_url().\"images/go-up.png\\\" \"\r\n . \"border=\\\"0\\\" style=\\\"vertical-align: middle;\\\"> \" . T_('go_up')\r\n . \"</a>\\n\"\r\n . \"</div>\\n\\n\";\r\n}", "abstract protected function getHtmlBody();", "static public function go_to_top_link() {\n\t\t$text = (self::$language === 'de' ? 'nach oben' : 'top');\n\t\treturn '<p class=\"center\">' . PHP_EOL\n\t\t . '\t<a href=\"#top\"><img alt=\"' . $text . '\" title=\"' . $text . '\" class=\"arrow_up {PNGCSS}\" src=\"{IMAGE_URL}/arrow_up.png\" width=\"15\" height=\"22\" /></a>' . PHP_EOL\n\t\t . '</p>' . PHP_EOL ;\n\t}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "public function getTop();", "function PrintHtmlHead () {\n\tGlobal $ISM, $str_font;\n\tGlobal $arr_win_dir, $arr_pozip, $arr_alm;\n\tGlobal $cDb;\n\t\n\tif (isset($cDb)) {\n\t\t$sWindowTitle = GetSetting ($cDb, 'windowtitle', '');\n\t} else {\n\t\t$sWindowTitle = '';\n\t}\n\t\n\theader(\"Content-Type: text/html; charset=UTF-8\");\n\theader(\"Pragma: no-cache\");\n\theader(\"Expires: 0\");\n\theader(\"Cache-Control: must-revalidate, post-check=0,pre-check=0\");\n\t\nprint <<<EOF\n<!DOCTYPE html>\n<html>\n<head>\n<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'>\n<meta name='viewport' content='user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width, height=device-height'>\n<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>\n<title>$sWindowTitle</title>\n\n<style type='text/css'>\n\nhtml, body { height: 100%; margin: 0; padding: 0; }\n\nBODY,TD,P,DIV,INPUT,SELECT,TEXTAREA {\n\tfont-family:$str_font;\n\tfont-size:12px;\n\twhite-space:nowrap;\n}\nA {\n\tcolor:#4444FF;\n\tcursor:pointer;\n\ttext-decoration:none;\n}\nA:hover {\n\ttext-decoration:underline;\n}\nINPUT,SELECT,TEXTAREA {\n\tcolor:#000000;\n\tbackground:#FFFFFF;\n\tpadding:2px;\n\tborder:1px solid #BBBBBB;\n}\nINPUT:-moz-read-only {\n\tbackground:#DDDDDD;\n\tborder:1px solid #DDDDDD;\n}\nINPUT:read-only {\n\tbackground:#DDDDDD;\n\tborder:1px solid #DDDDDD;\n}\n.TopCurtain {\n\nEOF;\n\techo (\"\tposition:fixed; top:\".($ISM?50:0).\"px; left:0; right:0; height:16px;\\n\");\nprint <<<EOF\n\tbackground:linear-gradient(rgba(0,0,0,0.1),rgba(0,0,0,0));\n\tpointer-events: none;\n}\n.ReadBorder {\n\tborder-width:3px;\n\tborder-style:solid;\n\tpadding:5px;\n\tborder-color:#FF8888;\n\tbackground:#FFEEEE;\n}\n.OrangeBorder {\n\tborder-width:3px;\n\tborder-style:solid;\n\tpadding:5px;\n\tborder-color:#FFBB88;\n\tbackground:#FFFFFF;\n}\n.OrangeFont {\n\tcolor:#EE6633;\n\tfont-weight:bold;\n}\n.TitleFont {\n\tcolor:#666666;\n\tfont-weight:bold;\n}\n.SubMenu {\n\tcolor:#444444;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tborder-radius:7px;\n}\n.SubMenu:hover {\n\tbackground:#DDDDDD;\n}\n.SubMenuSel {\n\tcolor:#444444;\n\tbackground:#FFFFFF;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tborder-radius:7px;\n}\n\n.msgPopupBox {\n\tz-index:3;\n\tdisplay: none;\n\tposition:fixed;\n\tmargin:0;\n\ttop:0;\n\tleft:0;\n\tright:0;\n\tbottom:0;\n\theight:100%;\n\twidth:100%;\n\tbackground-color:rgba(0,0,0,0.7);\n}\n.msgPopupInn {\n\tdisplay: table-cell;\n\tvertical-align: middle;\n\ttext-align:center;\n}\n.msgPopupTxt {\n\tdisplay:inline-block;\n\tcolor:#FFFFFF;\n\tborder:1px solid rgba(0,0,0,0.5);\n\tbox-shadow: 0 2px 10px 5px rgba(0,0,0,0.2);\n\tpadding:15px;\n\tborder-radius:10px;\n\ttext-align:center;\n\t\n\tbackground-color: #008800;\n\tbackground-image: linear-gradient(-45deg,\n\t\trgba(255, 255, 255, 0) 22.9%,\n\t\trgba(255, 255, 255, 0.1) 23%,\n\t\trgba(255, 255, 255, 0.1) 50%,\n\t\trgba(255, 255, 255, 0) 50.1%,\n\t\trgba(255, 255, 255, 0) 72.9%,\n\t\trgba(255, 255, 255, 0.1) 73%);\n\tbackground-size: 20px 20px;\n\t-webkit-background-size:20px 20px;\n\tbackground-repeat: repeat;\n}\n\n.mMenuLogin {\n\tpadding-left:6px;\n\tpadding-right:6px;\n\tpadding-top:4px;\n\tpadding-bottom:4px;\n\tmargin-right:10px;\n\tmargin-left:10px;\n\tfont-weight:bold;\n\tcolor:#FFFFFF;\n\tborder-radius:20px;\n\tborder:2px solid #FFFFFF;\n}\n.mMenuItem {\n\tcursor:pointer;\n\tpadding-top:12px;\n\tpadding-bottom:12px;\n\tpadding-left:16px;\n\tpadding-right:32px;\n\tfont-weight:bold;\n\tbackground:#FFFFFF;\n}\n.mMoveLast {\n\tbackground:rgba(255,255,255,0.7);\n\tborder-radius:10px;\n\tborder:1px solid rgba(0,0,0,0.5);\n\tcolor:rgba(0,0,0,0.5);\n}\n\n.windImg {\n\twidth:16px;\n\theight:16px;\n\tvertical-align:middle;\n}\n\n</style>\n\n<script type='text/javascript'>\n\nEOF;\necho (\"\tvar ism = \".($ISM?1:0).\";\\n\");\nprint <<<EOF\n\nvar gEcBusy=false;\n/*\nwindow.addEventListener('error', function(e) {\n\tif (gEcBusy) return;\n\tgEcBusy = true;\n\tif ((document.getElementById('map') != null) && (map.innerHTML == '')) {\n\t\t// MAP loading error\n\t\tmap.innerHTML = \"<table width='100%' height='100%'><tr><td align='center'><h3>Wait...</h3></td></tr></table>\";\n\t\tsetTimeout ('location.reload()',3000);\n\t} else\n\tif (document.getElementById('msgPopupTxt') != null) {\n\t\tvar msg = 'EC#'+e.lineno+':'+e.colno+'<p>'+e.message+'</p>';\n\t\tmsg += \"<input type='button' value='Close' onclick='MsgPopupHideGo()' class='pure-button'> <input type='button' value='Reload' onclick='location.reload()' class='pure-button'>\";\n\t\tMsgPopupError (msg, 0);\n\t} else {\n\t\talert ('EC#'+e.lineno+':'+e.colno+'\\\\n'+e.message);\n\t}\n\tPrintAll(e.target);\n}, true);\n*/\nwindow.onerror = function(emsg, url, eline, ecol, eerror) {\n\tif (gEcBusy) return true;\n\tgEcBusy = true;\n\tif ((document.getElementById('map') != null) && (map.innerHTML == '')) {\n\t\t// MAP loading error\n\t\tmap.innerHTML = \"<table width='100%' height='100%'><tr><td align='center'><h3>Wait...</h3></td></tr></table>\";\n\t\tsetTimeout ('location.reload()',3000);\n\t} else\n\tif (document.getElementById('msgPopupTxt') != null) {\n\t\tvar msg = '<p>EC#';\n\t\tmsg += eline ? eline : 'unknown';\n\t\tif (ecol) msg += ':' + ecol;\n\t\tmsg += '</p>';\n\t\tif (emsg) msg += '<p>'+emsg+'</p>';\n\t\tif ((emsg) && (eerror) && (emsg.indexOf(eerror) < 0)) msg += '<p>'+eerror+'</p>';\n\t\tif (url) msg += '<p>'+url+'</p>';\n\t\tmsg += \"<input type='button' value='Close' onclick='MsgPopupHideGo()' class='pure-button'> <input type='button' value='Reload' onclick='location.reload()' class='pure-button'>\";\n\t\tMsgPopupError (msg, 0);\n\t} else {\n\t\tvar msg = 'EC#';\n\t\tmsg += eline ? eline : 'unknown';\n\t\tif (ecol) msg += ':' + ecol;\n\t\tif (emsg) msg += '\\\\n'+emsg;\n\t\tif ((emsg) && (eerror) && (emsg.indexOf(eerror) < 0)) msg += '\\\\n'+eerror;\n\t\tif (url) msg += '\\\\n'+url;\n\t\talert (msg);\n\t}\n\treturn true;\n};\n\n// Prohibited area selection.\nfunction ReturnFalse () {\n\treturn false;\n}\nwindow.document.onselectstart = ReturnFalse;\nwindow.document.ondragstart = ReturnFalse;\nif (navigator.userAgent.indexOf('Firefox') >= 0) {\n\tvar eventNames = [\"mousedown\",\"mouseover\",\"mouseout\",\"mousemove\",\"mousedrag\",\"click\",\"dblclick\",\"keydown\",\"keypress\",\"keyup\"];\n\tfor(var i=0; i<eventNames.length; i++) {\n\t\twindow.addEventListener( eventNames[i], function(e) { window.event = e; }, true );\n\t}\n}\n\nfunction pwKeyCursor (npobj) {\n\tvar nplen = npobj.value.length;\n\tnpobj.setSelectionRange(nplen, nplen);\n}\nfunction pwKeyDown () {\n\tvar e = event || window.event;\n\tvar keycode = e.keyCode || e.charCode;\n\tif ((33 <= keycode) && (keycode <= 40)) {\n\t\tif (e.preventDefault) e.preventDefault(); else e.stop();\n\t}\n}\nfunction pwKeyPress (obj) {\n\tvar e = event || window.event;\n\tvar keycode = e.keyCode || e.charCode;\n\tif (keycode == 13) return;\n\tif (keycode == 8) return;\n\t\n\tvar npobj = obj;\n\tvar opobj = eval(obj.form.name+'.'+obj.name.slice(0, -1));\n\tnpobj.value += '*';\n\topobj.value += String.fromCharCode(keycode);\n\tif (e.preventDefault) e.preventDefault(); else e.stop();\n\tobj.blur();\n\tobj.focus();\n}\nfunction pwKeyUp (obj) {\n\tvar npobj = obj;\n\tvar opobj = eval(obj.form.name+'.'+obj.name.slice(0, -1));\n\tvar nplen = npobj.value.length;\n\tvar oplen = opobj.value.length;\n\tif (nplen < oplen) opobj.value = opobj.value.substr(0, nplen);\n\telse if (oplen < nplen) opobj.value += npobj.value.substr(oplen);\n\telse return;\n\tnpobj.value = '';\n\tfor (var i=0; i<nplen; i++) npobj.value += '*';\n\tobj.blur();\n\tobj.focus();\n}\n\nfunction PrintAll (obj) {\n\tvar msg = ''\n\tfor (propName in obj) try { msg += propName+'='+obj[propName]+'\\\\n'; } catch (err) { }\n\talert(msg);\n}\n\nfunction SetCookie(cKey, cValue) {\n\tdocument.cookie = cKey + '=' + escape(cValue);\n}\nfunction SetCookie(cKey, cValue, iValid) {\n\tvar date = new Date();\n\tdate.setDate(date.getDate() + iValid);\n\tdocument.cookie = cKey + '=' + escape(cValue) + ';expires=' + date.toGMTString();\n}\nfunction DelCookie(cKey) {\n\tvar date = new Date();\n\tdate.setDate(date.getDate() - 1);\n\tdocument.cookie = cKey + '=;expires=' + date.toGMTString();\n}\nfunction GetCookie(cKey, cDef) {\n\tvar cookies = document.cookie.split(\"; \");\n\tfor (var i = 0; i < cookies.length; i++) {\n\t\tvar keyValues = cookies[i].split(\"=\");\n\t\tif ((0 < keyValues.length) && (keyValues[0] == cKey)) return unescape(keyValues[1]);\n\t}\n\treturn cDef;\n}\n\nvar hMsgTimeout = null;\nfunction MsgPopupColor (msg, c, ms, ani) {\n\tif (hMsgTimeout != null) {\n\t\tclearTimeout(hMsgTimeout);\n\t\thMsgTimeout = null;\n\t}\n\t$('#msgPopupTxt').html(msg);\n\t$('#msgPopupTxt').css('background-color',c);\n\t$('#msgPopupBox').css('display','table');\n\tif (0 < ms) hMsgTimeout = setTimeout (MsgPopupHideGo,ms);\n\tif (ani) $('#msgPopupTxt').animate({zoom:'110%'},100).animate({zoom:'95%'},100).animate({zoom:'100%'},100);\n}\nfunction MsgPopupOnly (msg, ms) {\t// no animation\n\tMsgPopupColor (msg, '#008800', ms, false);\n}\nfunction MsgPopupShow (msg, ms) {\t// normal dialog box + popup animation\n\tMsgPopupColor (msg, '#008800', ms, true);\n}\nfunction MsgPopupError (msg, ms) {\t// error dialog box + popup animation\n\tMsgPopupColor ('<img src=\"img/attention.png\" style=\"vertical-align:top\"> '+msg, '#B81900', ms, true);\n}\nfunction MsgPopupHideGo () {\n\thMsgTimeout = null;\n\t$('#msgPopupBox').fadeOut();\n}\nfunction MsgPopupHide () {\n\tif (hMsgTimeout != null) {\n\t\tclearTimeout(hMsgTimeout);\n\t\tMsgPopupHideGo ();\n\t}\n}\n\nfunction js_number_format (num, decimals, zero) {\n\tif (typeof num != 'number') return '';\n\tnum = num.toFixed(decimals);\n\tvar reg = /(^[+-]?\\d+)(\\d{3})/;\n\tvar tmp = num.split('.');\n\tvar n = tmp[0];\n\tvar d = tmp[1];\n\tif (d) {\n\t\tvar l = d.length;\n\t\tif (zero === 0) {\n\t\t\twhile (0 < l) {\n\t\t\t\tif (d.charAt(l-1) != '0') break;\n\t\t\t\td = d.substring (0, --l);\n\t\t\t}\n\t\t}\n\t\td = (0<l) ? ('.' + d) : '';\n\t} else {\n\t\td = '';\n\t}\n\t\n\twhile(reg.test(n)) n = n.replace(reg, \"$1,$2\");\n\treturn n + d;\n}\n\nEOF;\n\techo (\"var arr_win_dir = [\");\n\tfor ($i=0; $i<sizeof($arr_win_dir); $i++) {\n\t\tif (0 < $i) echo (\",\");\n\t\techo (\"'$arr_win_dir[$i]'\");\n\t}\n\techo (\"];\\n\");\n\techo (\"var arr_pozip = [\");\n\tfor ($i=0; $i<sizeof($arr_pozip); $i++) {\n\t\tif (0 < $i) echo (\",\");\n\t\techo (\"'$arr_pozip[$i]'\");\n\t}\n\techo (\"];\\n\");\n\techo (\"var arr_alm = [\");\n\tfor ($i=0; $i<sizeof($arr_alm); $i++) {\n\t\tif(0 < $i) echo (\",\");\n\t\techo (\"'$arr_alm[$i]'\");\n\t}\n\techo (\"];\\n\");\nprint <<<EOF\n\nfunction js_item_format\t(val, dec, zero) {\n\tif ((0 <= dec) && (dec <= 9)) {\n\t\treturn js_number_format (val, dec, zero);\n\t}\n\tif (10 == dec) {\t// Special code: wind_direction\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 1) || (16 < val)) val = 1;\n\t\treturn arr_win_dir[val-1] + \" <img src='img/windd\"+val+\".png' class='windImg'>\";\n\t}\n\tif (11 == dec) {\t// Special code: pozip\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 0) || (1 < val)) val = 0;\n\t\treturn arr_pozip[val];\n\t}\n\tif (12 == dec) {\t// Special code: alm\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 0) || (3 < val)) val = 0;\n\t\treturn arr_alm[val];\n\t}\n\treturn val;\n}\n\nEOF;\n\tif ($ISM) {\nprint <<<EOF\n\nvar menuStatus = false;\nfunction mfc(action) {\n\tMenuClose(1);\n\tdocument.location = action;\n}\nfunction MenuClose (opt) {\n\tif (opt != 1) {\n\t\tmenuStatus = false;\n\t\t$('body,html').css({'overflow':'visible'});\n\t\t$('body').unbind('touchmove');\n\t\t$('#menuBack').fadeOut();\n\t}\n\tvar obj = $('#menuMenu');\n\tvar w = obj.width()+10;\n\tobj.animate({left:-w});\n}\nfunction MenuClick () {\n\tmenuStatus = true;\n\t$('body,html').css({'overflow':'hidden'});\n\t$('body').bind('touchmove', function(e){if(e.preventDefault)e.preventDefault();else e.stop()});\n\t$('#menuBack').fadeIn();\n\t\n\tvar obj = $('#menuMenu');\n\tvar w = obj.width()+10;\n\tobj.css({left:-w});\n\tobj.animate({left:0});\n}\nfunction MoveLastUp() {\n\t$('body').scrollTop(0);\n}\nfunction MoveLastDn() {\n\t$('body').scrollTop($(document).height());\n}\n\n// Call from Android APP.\nvar mMyLat = 0, mMyLng = 0;\nfunction SetLocation (lat, lng) {\n\tmMyLat = lat;\n\tmMyLng = lng;\n\tif (typeof OnMyLocation == 'function') OnMyLocation (false);\n}\n\nEOF;\n\t} else {\n\t\tif ($sWindowTitle != '') echo (\"try{parent.document.title='$sWindowTitle';}catch(err){}\\n\");\n\t}\n\techo (\"</script>\\n\");\n}", "protected function showEndHTML(): self {\n echo <<<HTML\n</body>\n</html>\nHTML;\n\n return $this;\n }", "function udesign_top_wrapper_top() {\r\n do_action('udesign_top_wrapper_top');\r\n}", "public function GetHTML(){\n\t/*unset($this->url[0]);\n\t\t\t$cnt=1;\n\t\t\tforeach($this->url as $v){\n\t\t\t\tif(count($this->url)==$cnt && $v>0 && is_numeric($v)){\n\t\t\t\t//$this->out_url.=$v.'/';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$this->out_url.=$v.'/';\n\t\t\t$cnt++;\n\t\t\t}*/\n\t\n\t\t\n\t\n\t$next=$this->list['current']+1;\n\t$prev=$this->list['current']-1;\n\t$limit=($this->page-1)*$this->take+1;\n\t$limit2=$limit+$this->take-1;\n\t\n\tif ($this->page==$this->total_pages)\n\t$limit2=$this->total;\n\t$str='';\n\t$str .=\"\";\n\t\n\n\t$str .=<<<OUT\n\t\t\t<div class=\"pager\">\n\t\t \t<div class=\"hr\"><i></i></div>\n\t\t <ul>\nOUT;\n\tif($prev>0){\n\t$str .=<<<OUT\n\t\t\t<li class=\"prev\"><a href=\"{$this->out_url}{$prev}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n \n\tfor ($i=1; $i < $this->page ; $i++)\n\t\t{\n\t\t\tif ($i>((int)$this->page-(int)$this->half_block)){\n\t\t\t\tif($i==1){\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tif($this->total_pages==$this->list['current'])\n\t$str .=\"<li class='last'>\".$this->list['current'].\"</li>\";\n\telse\n\t$str .=\"<li>\".$this->list['current'].\"</li>\";\n\t\n\t$cnt=1;\n\tfor ($i=$this->page+1; $i <= $this->total_pages ; $i++)\n\t\t{\n\t\t\tif($this->total_pages==$i || ($this->half_block-1)==$cnt)\n\t\t\t$classlast=' class=\"last\"';\n\t\t\telse\n\t\t\t$classlast='';\n\t\t\t\n\t\t\tif ($this->half_block==$cnt)\n\t\t\tbreak;\n\t\t\t$str .=<<<OUT\n\t\t\t<li{$classlast}><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t$cnt++;\n\t\t}\n\n\tif($this->list['current']<$this->total_pages){\n\t$str .=<<<OUT\n\t\t\t<li class=\"next\"><a href=\"{$this->out_url}{$next}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n\t\n\t$str .=<<<OUT\n \t\t </div>\nOUT;\n\tif ($this->total_pages>1)\n\treturn $str;\n\t\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}", "protected function showBeginHTML(): self {\n echo <<<HTML\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>{$this->getTitle()}</title>\n <meta name=\"keywords\" content=\"{$this->getKeywords()}\">\n <meta name=\"description\" content=\"{$this->getDescription()}\">\n <meta name=\"author\" content=\"Dmitri Serõn\">\n <link rel=\"stylesheet\" href=\"/assets/css/styles.css\">\n</head>\n<body>\nHTML;\n\n return $this;\n }", "function printBootstrapTop($myCssPath, $myTitle) {\n \nprint\n \"<!DOCTYPE html> \\n\".\n \"<html lang='en'>\\n\".\n \"<head> \\n\".\n\t\" <title>$myTitle</title> \\n\".\n\t\"\t<meta charset='utf-8'> \\n\".\n\t\"\t<meta name='viewport' content='width=device-width, initial-scale=1'> \\n\".\n\t\"\t<meta name='author' content='Alexander Solinger'> \\n\".\n \" <link rel='stylesheet' type='text/css' href='$myCssPath'> \\n\".\n \" <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'> \\n\".\n \" <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script> \\n\".\n \" <script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script> \\n\".\n \" <script src='./js/asg12.js'></script> \\n\".\n\t\"</head> \\n\".\n \"<body class='myBody'> \\n\" ;\n}", "public abstract function get_html();", "abstract public function getHtml();", "abstract function get_html();", "function udesign_body_top() {\r\n do_action('udesign_body_top');\r\n}", "public static function pageTop($title)\r\n {\r\n $appcss = WS_CSS . 'app.css';\r\n echo <<<pagetop\r\n <!doctype html>\r\n <html>\r\n <div class=\"page\">\r\n \r\n <head>\r\n <meta charset=\"utf-8\">\r\n <title>$title</title>\r\n <!-- Bootstrap Core CSS -->\r\n <link href=\"styles.css\" rel=\"stylesheet\">\r\n \r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\r\n <meta name=\"author\" content=\"Caleb Armentrout\">\r\n <meta name=\"description\" content=\"Everything you wanted to know about web programming\">\r\n <meta name=\"keywords\" content=\"xampp, php, mysql, html, web programming\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <!--[if lte IE 9]>\r\n <script src=\"http://html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\r\n <![endif]-->\r\n \r\n <!-- Embed fonts for the page -->\r\n <link href='https://fonts.googleapis.com/css?family=Miriam+Libre:400,700|Source+Sans+Pro:200,400,700,600,400italic,700italic' rel='stylesheet' type='text/css'>\r\n \r\n <!-- Latest compiled and minified CSS - get from getbootstrap.com-->\r\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\">\r\n \r\n <!-- Optional theme -->\r\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css\" integrity=\"sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp\" crossorigin=\"anonymous\">\r\n \r\n <!-- Latest compiled and minified JavaScript -->\r\n <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\" integrity=\"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\" crossorigin=\"anonymous\"></script>\r\n \r\n <link rel=\"stylesheet\" href=\"$appcss\">\r\n \r\n <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\r\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\r\n <!--[if lt IE 9]>\r\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\r\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\r\n <![endif]-->\r\n \r\n </head>\r\n <body class=\"home language-php\">\r\n \r\n <header class=\"navbar navbar-default navbar-fixed-top topnav\" role=\"banner\">\r\n <div class=\"container topnav\">\r\n <nav role=\"navigation\">\r\n <div class=\"container-fluid\">\r\n <!-- Brand and toggle get grouped for better mobile display -->\r\n <div class=\"navbar-header\">\r\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar-collapse-1\">\r\n <span class=\"sr-only\">Toggle navigation</span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n <span class=\"icon-bar\"></span>\r\n </button>\r\n <a class=\"navbar-brand topnav\" href=\"/\">Home</a>\r\n </div>\r\n \r\n <!-- Collect the nav links, forms, and other content for toggling -->\r\n <div class=\"collapse navbar-collapse\" id=\"navbar-collapse-1\">\t\t\t\t\t\t \r\n <ul class=\"nav navbar-nav navbar-right\">\r\n \r\n <li><a href=\"/createPost.php\">Create Post</a></li> \r\n <li><a href=\"/getPost.php\">Editing posts</a></li>\r\n <li><a href=\"/createLogin.php\">Create Login</a></li>\r\n <li><a href=\"/fileupload.php\">Upload Image</a></li>\r\n <li><a href=\"/login.php\"><i class=\"fa fa-sign-in fa-fw\"></i> Login</a></li>\t \r\n </ul>\t\t\t\t\t\t\r\n </div><!-- /.navbar-collapse -->\r\n </div><!-- /.container-fluid -->\r\n </nav>\r\n </div>\t\t\r\n </header>\r\n <div class=\"intro-header\">\r\n\t \t<h2>Web Development</h2>\r\n\t</div>\r\npagetop;\r\n }", "function &getHTML()\n\t{\n\t\tinclude_once(\"./Services/PersonalDesktop/classes/class.ilBookmarkBlockGUI.php\");\n\t\t$bookmark_block_gui = new ilBookmarkBlockGUI(\"ilpersonaldesktopgui\", \"show\");\n\t\t\n\t\treturn $bookmark_block_gui->getHTML();\n\t}", "protected static function displayHtmlBody()\n {\n $strServerUrlRequestContext = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' .\n \"{$_SERVER['HTTP_HOST']}/{$_SERVER['REQUEST_URI']}\";\n\n $strDateTimeContext = date('Y-m-d H:i:s');\n $strFilePathContext = self::$arrBacktrace['file'];\n $intLineContext = self::$arrBacktrace['line'];\n\n $strFileContent = file_get_contents(self::$strTemplateFile);\n $strHtmlContent = str_replace('@debugcontext', self::$prettyDebugContext, $strFileContent);\n $strHtmlContent = str_replace('@filepathcontext', $strFilePathContext, $strHtmlContent);\n $strHtmlContent = str_replace('@linecontext', $intLineContext, $strHtmlContent);\n $strHtmlContent = str_replace('@serverurlrequest', $strServerUrlRequestContext, $strHtmlContent);\n $strHtmlContent = str_replace('@datetimecontext', $strDateTimeContext, $strHtmlContent);\n\n $intExecutionTimeContext = microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n $strHtmlContent = str_replace('@executiontimecontext', $intExecutionTimeContext, $strHtmlContent);\n $intMemoryUsageContext = memory_get_peak_usage();\n $strHtmlContent = str_replace('@memoryusagecontext', $intMemoryUsageContext, $strHtmlContent);\n return $strHtmlContent;\n }", "function getBottomHTML() {\n\t\treturn $this->_bottomHTML;\n\t}", "function Get_Standard_Bottom_Section_HTML()\n {\n $HTML = \"\";\n //$HTML .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $HTML .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $HTML .= \"</div>\";\n $HTML .= Get_File_Contents(__DIR__.\"/../../static_html/standard_footer.html\");\n return $HTML;\n }", "protected function printOpenHtml()\n {\n echo '<HTML>';\n }", "function top() {\n\t\trequire ('views/partial/top.php');\n\t}", "public function top()\n {\n }", "public function getHTML()\r\n\t{\t\t\r\n\t\tglobal $tpl, $lng;\r\n\t\t\r\n\t\t$lng->loadLanguageModule(\"crs\");\r\n\t\t\r\n\t\tinclude_once \"Services/Container/classes/class.ilContainerStartObjectsContentTableGUI.php\";\r\n\t\t$tbl = new ilContainerStartObjectsContentTableGUI(\r\n\t\t\t\t$this->parent_gui, \r\n\t\t\t\t\"\", \r\n\t\t\t\t$this->start_object, \r\n\t\t\t\t$this->enable_desktop\r\n\t\t);\r\n\t\t$tpl->setContent(\r\n\t\t\t$this->getPageHTML().\r\n\t\t\t$tbl->getHTML()\r\n\t\t);\t\t\r\n\t}", "function getHTML()\n {\n $show = true;\n $HTML = \"\n <div class='$this->size own-padding'>\n <div class='panel col-sm-12'>\n <header id='$this->headID' class='panel-heading'>\n $this->title\n <div class='panel-actions'>\n <a id='$this->buttonID' class='btn-minimize'>\n <i class='fa'><span class='arrow_up'/></i>\n </a>\n </div>\n </header>\n\n <div id='$this->bodyID' class='panel-body'>\n $this->content\n </div>\n </div>\n </div>\n\";\n\n\n if( $this->content == \"\"){\n $HTML = \"\";\n Errorlist::publicAddError(4,1);\n $show = false;\n }\n\n if( $this->title == \"\"){\n Errorlist::publicAddError(5,1);\n }\n\n if( $this->size == \"\"){\n Errorlist::publicAddError(6,1);\n $HTML = \"\";\n $show = false;\n }\n\n if($show){\n InitJSObjects::initObject($this->panelID, 'Panel', \"'$this->headID','$this->bodyID','$this->buttonID'\");\n EventHandler::newEvent(\"$this->buttonID\", \"function(){ $this->panelID.minMax() }\", \"click\");\n }\n\n\n return $HTML;\n }", "function TopIndexPage2()\n{\n\techo('<td valign=\"top\"><table width=\"100%\" border=\"1\" class=\"deco\" bordercolor=\"#0099FF\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<td height=\"334\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"e6f3fc\">');\n\techo('<tr>');\n\techo('<td width=\"278\" height=\"336\" valign=\"top\"><table background=\"image/tintucsukien.jpg\" ');\n\techo('width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<tr>');\n\techo('<td width=\"30\" height=\"52\">&nbsp;</td>');\n\techo('<td width=\"212\">&nbsp;</td>');\n\techo('<td width=\"36\">&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"253\">&nbsp;</td>');\n\techo('<td valign=\"top\">');\n\t///////////////////////////////////CAC TIN MOI NHAT\n\t$str1=\"select * from news where approval=1 order by date desc,newsid desc\";\n\t$result=mysql_query($str1) or\n\tdie(mysql_error());\n\t$i=0;\n\t$s=\"\";\n\twhile ($row=mysql_fetch_array($result))\n\t{\n\t\t$i=$i+1;\n\t\t$s=$s.$row['title'];\n\t\techo(\"<img src='image/newspoint.jpg' />&nbsp;&nbsp;\");\n\t\techo(\"<a alt='\".$row['abstract'].\"' title='\".$row['abstract']);\n\t\techo(\"' href='newsdetail.php?newsid=\".$row['newsid'].\"&id=\".$row['newsgroup'].\"' class='newstitle\");\n\t\techo(template());echo(\"'>\".$row['title'].\"</a>\");\n\t\techo(\"<br>\");echo(\"<img class='newsline' src='image/newsline.jpg' />\");\n\t\techo(\"<br>\");\n\t\tif ((strlen($s)>250)) break;\n\t}\n\tmysql_free_result($result);\n\techo('&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"31\">&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\t\n\t\n\techo('</table></td>');\n\techo('<td width=\"15\">&nbsp;</td>');\n\techo('<td width=\"278\" valign=\"top\"><table background=\"image/lich.jpg\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<tr>');\n\techo('<td width=\"29\" height=\"52\">&nbsp;</td>');\n\techo('<td width=\"212\">&nbsp;</td>');\n\techo('<td width=\"37\">&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"253\">&nbsp;</td>');\n\techo('<td valign=\"top\">');\n\t///////////////////////////////////LICH CONG TAC TUAN\n\t$timestamp = time(); \n\tif (date('l',$timestamp)=='Monday')\n\t$start_date=date(\"Y-m-d\", strtotime(\"this monday\", $timestamp));\n\telse\n\t$start_date=date(\"Y-m-d\", strtotime(\"last monday\", $timestamp)); \n\t$end_date=$newdate = date(\"Y-m-d\",strtotime ( \"+6 day\" , strtotime ( $start_date ) ) );\n\t$str1=\"select * from timetable where approval=1 and date>='\";\n\t$str1.=$start_date.\"' and date<='\".$end_date.\"' order by date\";\n\t$result=mysql_query($str1) or\n\tdie(mysql_error());\n\t$i=0;\n\techo(\"<marquee height='230' onmouseover=this.stop() onmouseout=this.start() \");\n\techo(\"scrollamount='1' scrolldelay='80' truespeed='true' direction=up>\");\n\techo(\"<div class='topnews'>\");\n\t\n\t$s=\"\";$d=\"\";\n\twhile ($row=mysql_fetch_array($result))\n\t{\n\t\t$i=$i+1;\n\t\tif ($d!=$row['date'])\n\t\t{\n\t\t\tif (strlen($d)>0) $s.=\"<br><br>\";\n\t\t\t$s.=\"<a href='timetable.php' class='newstitlelink\".template().\"'>\";\n\t\t\t$s.=\"Ngày \".date ('d-m-Y',strtotime($row['date'])).\"</a>\";\n\t\t}\n\t\t$d=$row['date'];\n\t\t$s.=\"<br><img src='image/newspoint.jpg' />&nbsp;<a class='newstitle\".template().\"' href='timetable.php'>\";\n\t\t$s.=$row['task'].\" (\".$row['chairman'];\n\t\tif (strlen($row['chairman'])>0) $s.=\", \";\n\t\t$s.=$row['attendant'].\")</a>\";\n\t}\n\techo($s);\n\techo(\"</div></marquee>\");\t\t\t\t\n\tmysql_free_result($result);\n\techo('&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"31\">&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\t\n\techo('</table></td>');\n\techo('</tr>');\n\t\n\techo('</table></td>');\n\techo('</tr>');\n\techo('</table></td>');\n}", "public function printHTML()\n {\n\n $html = '<main style=\"margin-top:20px \">\n <div class=\"container-md\">';\n echo $_SESSION['error'];\n $html .= $this->errorHandler();\n\n if ($this->e == null) {\n $html .= $this->htmlFormHead();\n $html .= $this->htmlFavoriteGames();\n $html .= $this->htmlGameTime();\n }\n\n if ($this->e == \"updatePassword\") {\n $html .= $this->htmlFormUpdatePassword();\n }\n\n $html .= \"</div></main> \";\n\n echo $html;\n }", "static public function NavBarTop() {\n\t\t$show_back = (strlen(self::$prev_page) > 0);\n\t\t$show_home = (strlen(self::$first_page) > 0);\n\t\t$show_next = (strlen(self::$next_page) > 0);\n\n\t\tif (!$show_back && !$show_home && !$show_next) {\n\t\t\treturn null;\n\t\t}\n\n\t\techo '<div class=\"center\" style=\"margin-top:-12px;margin-bottom:-18px;height:30px;\">';\n\t\tif ($show_back) {\n\t\t\techo '<a href=\"', self::$prev_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" title=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" class=\"arrow_left {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_left.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"30\" />';\n\t\t}\n\t\tif ($show_home) {\n\t\t\techo '<a href=\"', self::$first_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Inhalt' : 'Content'), '\" title=\"', (self::isGerman() ? 'Inhalt' : 'Content'), '\" class=\"arrow_content {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_info.png\" width=\"30\" height=\"26\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"30\" />';\n\t\t}\n\t\tif ($show_next) {\n\t\t\techo '<a href=\"', self::$next_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" title=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" class=\"arrow_right {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_right.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"30\" />';\n\t\t}\n\t\techo '</div>';\n\t}", "public function finish_display ()\n {\n $this->_finish_body ();\n?>\n </body>\n</html>\n<?php\n }", "public function hookTop(){\n $settings = unserialize( Configuration::get($this->name.'_settings') );\n \n $this->context->smarty->assign(array(\n 'user' => $settings['user'],\n 'widget_id' => $settings['widget_id'],\n 'tweets_limit' => $settings['tweets_limit'],\n 'follow_btn' => $settings['follow_btn']\n ));\n \n return $this->display(__FILE__, $this->name.'_scroll.tpl');\n }", "function displayMain(){\n $data='<div class=\"about\"><h2>About this tool</h2>\n<p>Graber Transcriptdb is an attempt to create an integrated transcript database of all the organisms and annotations found in UCSC,MGI,ENSEMBL,UNIPROT,and EBI databases. \n The database generates unique transcript_id and exon_id for all redundant transcripts and exons from various annotations for a given organism version.We store the start cordinates using the zero-base standard and the end cordinates using the one-base standard.\nBut we display all the cordinates using the one-base. \n</p>\n<h2>You can use the tool as followed</h2>\n <ul><list>You have genomic regions of interest or a gene and you would like to extract overlaping functional features</li>\n <list>You have a file containing genomic regions of interest or a list of genes or transcripts and you would like to extract overlaping functional features</li>\n </ul>\n <p> Database updates are ran monthly to synchronize both our data and external data sources.\n</p><hr/><h2>Good Practices:</h2>';\n$data.=getXmlUrl(\"Good Practices\");\n$data.='</div>';\n return $data;\n}", "public function getHtml() {\r\n\r\n // get only the `Page` objects from all the items (for the View)\r\n $applicationPages = array_filter($this->getItems(), function($item) {\r\n return ($item instanceof Page);\r\n });\r\n\r\n // set the layout to the child items\r\n if (!$this->_layoutEnabled) {\r\n $this->_currentPage->disableLayout();\r\n }\r\n\r\n // get the HTML of the current page\r\n $currentPageHtml = $this->_currentPage ? $this->_currentPage->getHtml() : '';\r\n\r\n // get the Javascript if the layout enabled\r\n $currentPageJavascript = '';\r\n if (($jsCode = $this->getJavascript()) != '' && $this->_layoutEnabled) {\r\n $currentPageJavascript.= $jsCode;\r\n }\r\n\r\n // get the current page URL (for the View)\r\n $currentPageUrl = $this->_request->getUrlParam(0);\r\n if (is_null($currentPageUrl)) {\r\n $currentPageUrl = '';\r\n }\r\n\r\n // check if the layout is enabled, if no, just return the HTML of the current page\r\n if (!$this->_layoutEnabled) {\r\n\r\n // return only the inner page HTML\r\n return $currentPageHtml;\r\n } else {\r\n\r\n // load the application template\r\n ob_start();\r\n require APP_VIEW;\r\n return ob_get_clean();\r\n }\r\n }", "static public function insert_go_to_top_link() {\n\t\techo self::go_to_top_link();\n\t}", "public function top();", "function get_html()\n\t{\n\n\t// incrase views\n\n\t}", "public static function manager_inner () \n { \n $html = null;\n\n $top = self::manager_inner_top();\n $inner = self::manager_inner_center();\n $bottom = self::manager_inner_bottom();\n\n $html .= self::page_body( 'manager', $top, $inner, $bottom );\n\n return $html;\n }", "public function generate_html_header()\n\t\t{\n\t\t\techo '<script type=\"text/javascript\">\n\t\t\tvar '.$this->internal_id.'navig= 0;';\n\t\t\t\n\t\t\tif($this->event_functionCall_on_click_item != null)\n\t\t\t{\n\t\t\t\techo \"var \".$this->internal_id.\"call_clicked = '\".$this->event_functionCall_on_click_item.\"';\";\n\t\t\t}\n\t\t\tif($this->event_functionCall_on_new_item != null)\n\t\t\t{\n\t\t\t\techo \"var \".$this->internal_id.\"call_new_item = '\".$this->event_functionCall_on_new_item.\"';\";\n\t\t\t}\n\t\t\tif($this->event_functionCall_on_delete_item != null)\n\t\t\t{\n\t\t\t\techo \"var \".$this->internal_id.\"call_delete_item = '\".$this->event_functionCall_on_delete_item.\"';\";\n\t\t\t}\n\t\t\techo '</script>\n\t\t\t';\n\t\t\t\n\t\t\t// Build initial javascript function call of tree with hard coded focus ;)\n\t\t\techo '\n\t\t\t<script type=\"text/javascript\">\n\t\t\tfunction MagicTree_'.$this->internal_id.'()\n\t\t\t{\n\t\t\t\t//==================================================================\n\t\t\t\t// Setup Ajax configuration\n\t\t\t\t//==================================================================\n\t\t\t\tvar configuration = new Array();\t\n\t\t\t\t\n\t\t\t\tconfiguration[\"page\"] = mt_root_path+\"ajax/display.php\";\n\t\t\t\tconfiguration[\"delai_tentative\"] = 30000; // 30 seconds max\n\t\t\t\tconfiguration[\"max_tentative\"] = 2;\n\t\t\t\tconfiguration[\"type_retour\"] = false;\t\t// ReponseText\n\t\t\t\tconfiguration[\"param\"] = \"ssid=\"+ssid+\"&id=\"+\"'.$this->internal_id.'\";\n\t\t\t\n\t\t\t\tconfiguration[\"fonction_a_executer_reponse\"] = \"HTML_TreeReturn\";\n\t\t\t\tconfiguration[\"param_fonction_a_executer_reponse\"] = \"\\''.$this->internal_id.'\\',\\''.$this->myfocus.'\\',\\'0\\'\";\n\t\t\t\t\n\t\t\t\t// Do the call\n\t\t\t\tajax_call(configuration);\n\t\t\t\t//==================================================================\n\t\t\t}\n\t\t\t</script>\n\t\t\t';\n\t\t}", "protected function topnav()\n {\n $words = $this->getWords();\n $logged_in = APP_User::IsBWLoggedIn(\"NeedMore,Pending\");\n if (!$logged_in) {\n $request = PRequest::get()->request;\n if (!isset($request[0])) {\n $login_url = 'login';\n } else switch ($request[0]) {\n case 'login':\n case 'main':\n case 'start':\n $login_url = 'login';\n break;\n default:\n $login_url = 'login/'.htmlspecialchars(implode('/', $request), ENT_QUOTES);\n }\n } else {\n $username = isset($_SESSION['Username']) ? $_SESSION['Username'] : '';\n }\n\n if (class_exists('MOD_online')) {\n $who_is_online_count = MOD_online::get()->howManyMembersOnline();\n } else {\n // echo 'MOD_online not active';\n if (isset($_SESSION['WhoIsOnlineCount'])) {\n $who_is_online_count = $_SESSION['WhoIsOnlineCount']; // MOD_whoisonline::get()->whoIsOnlineCount();\n } else {\n $who_is_online_count = 0;\n }\n }\n\n require TEMPLATE_DIR . 'shared/roxpage/topnav.php';\n }", "protected abstract function generateHtmlBody() : string;", "public function getHTML()\n {\n $output = '<div class=\"ui negative icon message\"><i class=\"warning sign icon\"></i><div class=\"content\"><div class=\"header\">Fatal Error</div>';\n $output .= get_class($this).': '.$this->getMessage().\n ($this->getCode() ? ' <div class=\"ui small yellow label\">Code<div class=\"detail\">'.$this->getCode().'</div></div>' : '');\n $output .= '</div>'; // content\n $output .= '</div>';\n\n if ($this->params) {\n $output .= '<div class=\"ui top attached segment\">';\n $output .= '<div class=\"ui top attached label\">Exception Parameters</div>';\n $output .= '<ul class=\"list\">';\n\n foreach ($this->params as $key => $val) {\n $key = str_pad($key, 19, ' ', STR_PAD_LEFT);\n $output .= '<li><b>'.htmlentities($key).'</b>: '.htmlentities($this->toString($val)).'</li>';\n }\n\n $output .= '</ul>';\n $output .= '</div>';\n }\n\n $output .= '<div class=\"ui top attached segment\">';\n $output .= '<div class=\"ui top attached label\">Stack Trace</div>';\n $output .= '<table class=\"ui very compact small selectable table\">';\n $output .= '<thead><tr><th>File</th><th>Object</th><th>Method</th></tr></thead><tbody>';\n\n $in_atk = true;\n $escape_frame = false;\n\n foreach ($this->getMyTrace() as $call) {\n if (!isset($call['file'])) {\n $call['file'] = '';\n } elseif (\n $in_atk &&\n strpos($call['file'], '/data/src/') === false &&\n strpos($call['file'], '/core/src/') === false &&\n strpos($call['file'], '/dsql/src/') === false\n ) {\n $escape_frame = true;\n $in_atk = false;\n }\n\n $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);\n\n $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);\n\n if ($escape_frame) {\n $output .= \"<tr class='negative'><td>\".$file;\n } else {\n $output .= '<tr><td>'.$file;\n }\n $output .= ':'.$line.'</td><td>';\n\n if (isset($call['object'])) {\n $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;\n $output .= $name;\n } else {\n $output .= '-';\n }\n\n $output .= '</td><td>';\n\n if (isset($call['class'])) {\n $output .= $call['class'].'::';\n }\n\n if ($escape_frame) {\n $output .= $call['function'];\n $escape_frame = false;\n\n $args = [];\n foreach ($call['args'] as $arg) {\n $args[] = $this->toString($arg);\n }\n\n $output .= \"</td></tr><tr class='negative'><td colspan=2></td><td> (\".str_repeat(' ', 20).implode(', ', $args).')';\n } else {\n $output .= $call['function'].'()';\n }\n\n $output .= '</td></tr>';\n }\n\n $output .= '</tbody></table>';\n $output .= '</div>';\n\n if ($p = $this->getPrevious()) {\n $output .= '<div class=\"ui top attached segment\">';\n $output .= '<div class=\"ui top attached label\">Caused by Previous Exception:</div>';\n\n if ($p instanceof \\atk4\\core\\Exception) {\n $output .= $p->getHTML();\n } else {\n //$output .= \"\\033[1;31m\".get_class($p).': '.$p->getMessage().\"\\033[0;31m\".\n //($p->getCode() ? ' [code: '.$p->getCode().']' : '');\n\n $output .= '<div class=\"ui negative icon message\"><i class=\"warning sign icon\"></i><div class=\"content\"><div class=\"header\">Fatal Error</div>';\n $output .= get_class($p).': '.$p->getMessage().\n ($p->getCode() ? ' <div class=\"ui small yellow label\">Code<div class=\"detail\">'.$p->getCode().'</div></div>' : '');\n $output .= '</div>'; // content\n $output .= '</div>';\n }\n\n $output .= '</div>';\n }\n\n return $output;\n }", "public function printHtmlPage(){\n\n // Change the content headers to that of HTML\n header('Content-type: text/html; charset=utf8');\n\n // Include the HTML wrapper and collect output\n ob_start();\n require_once(LEGACY_MMRPG_ROOT_DIR.'markup/html-wrapper.php');\n $html_markup = ob_get_clean();\n\n // Print out the collected markup and exit\n echo($html_markup);\n exit();\n\n }", "function displayTagTopHtml(){\n echo\n '<!DOCTYPE html>\n <html lang=\"fr\">';\n}", "function getHTML_additionalHeaderData() {\n\t\t\t// get js configs\n\t\t\t// get topical element and overwrite startID in appConf['js.']['config.']\n\t\tif ($this->appConf['topicAtStart']) {\n\t\t\t$this->appConf['js.']['config.']['startIndex'] = $this->appConf['topicId'];\n\t\t}\n\t\t\t// only boolean and integers allowed, strings ar not supported\n\t\tif (is_array($this->appConf['js.']['config.'])) {\n\t\t\t$configArray = array();\n\t\t\tforeach ($this->appConf['js.']['config.'] as $key => $val) {\n\t\t\t\t$configArray[] = trim($key) . ': ' . trim($val);\n\t\t\t}\n\t\t\t$config = implode(', ',$configArray);\n\t\t}\n\t\t\t// additional headers as css & js\n\t\t$GLOBALS['TSFE']->additionalHeaderData['contentcoverflow'] .= '\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['core.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['more.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['mod.']['file'] . '\"></script>\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->appConf['css.']['file'] . '\" />\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t/* <![CDATA[ */\n\t\t\t\tvar myMooFlowPage = {\n\t\t\t\t\tstart: function(){\n\t\t\t\t\t\tvar mf = new MooFlow($(\\'MooFlow\\'), {\n\t\t\t\t\t\t\t' . $config . ',\n\t\t\t\t\t\t\t\\'onClickView\\': function(obj){\n\t\t\t\t\t\t\t\tmyMooFlowPage.link(obj);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\\'onStart\\': function(){\n\t\t\t\t\t\t\t\tthis.autoPlay = this.auto.periodical(this.options.interval, this);\n\t\t\t\t\t\t\t\tthis.isAutoPlay = true;\n\t\t\t\t\t\t\t\tthis.fireEvent(\\'autoPlay\\');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\n\t\t\t\t\tlink: function(result){\n\t\t\t\t\t\tif (result.target == \"_blank\") {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\twindow.addEvent(\\'domready\\', myMooFlowPage.start);\n\n\t\t\t\t/* ]]> */\n\t\t\t</script>\n\t\t';\n\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 }", "function tpps_details_top_callback() {\n print(tpps_details_top());\n}", "protected function _renderTop($mode = self::RENDER_TEXT, $position = NULL)\n\t{\n\t\tob_start();\n\t\tif ($mode == self::RENDER_HTML) {\n\t\t\tif ($position === 1) {\n?>\n<?php\n\t\t\t} else {\n?>\n<?php\n\t\t\t}\n?>\n<?php\n\n\t\t} else\n\t\tif ($mode == self::RENDER_TEXT) {\n\t\t\tif ($position === 1) {\n\t\t\t}\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "abstract public function generateHtml();", "protected function clearTopPage(): void\n {\n $this->owner->TopPageID = 0;\n }", "function newsroom_elated_get_header_top() {\n\n $params = array(\n 'column_widths' => '33-33-33',\n 'show_header_top' => newsroom_elated_options()->getOptionValue('top_bar') == 'yes' ? true : false,\n 'top_bar_in_grid' => newsroom_elated_options()->getOptionValue('top_bar_in_grid') == 'yes' ? true : false\n );\n\n $params = apply_filters('newsroom_elated_header_top_params', $params);\n\n newsroom_elated_get_module_template_part('templates/parts/header-top', 'header', '', $params);\n }", "function __construct($title=\"\")\n\t{\n\t\t//class constructor, this builds the top of the HTML page\n\t\t//each time the class is constructed\n\t\t$this->tag = \"<html>\";\n\t\t$this->tag = \"<HEAD>\";\n\t\t$this->tag = \"<title> $title </title>\";\n\t\t$this->tag .= \"</head> <body>\";\n\t\techo $this->tag;\n\t\treturn ;\n\t}", "public function get_header_html()\n\t{\n\t return '';\n\t}", "private function printBaseInterface()\n\t\t{\n?>\n\t\t<link rel='stylesheet' href='<?php echo $this->module_folder;?>app.css' type='text/css' media='screen' />\n\t\t<script type=\"text/javascript\" src=\"<?php echo $this->module_folder;?>app.class.js\" ></script>\n\t\t<div id=\"psp-wrapper\" class=\"fluid wrapper-psp\">\n\t\t\t<?php\n\t\t\t// show the top menu\n\t\t\tpspAdminMenu::getInstance()->make_active('monitoring|google_pagespeed')->show_menu();\n\t\t\t?>\n\t\t\t\n\t\t\t<!-- Page detail -->\n\t\t\t<div id=\"psp-pagespeed-detail\">\n\t\t\t\t<div id=\"psp-pagespeed-ajaxresponse\"></div>\n\t\t\t</div>\n\t\t\t\t\n\t\t\t<!-- Main loading box -->\n\t\t\t<div id=\"psp-main-loading\">\n\t\t\t\t<div id=\"psp-loading-overlay\"></div>\n\t\t\t\t<div id=\"psp-loading-box\">\n\t\t\t\t\t<div class=\"psp-loading-text\"><?php _e('Loading', 'psp');?></div>\n\t\t\t\t\t<div class=\"psp-meter psp-animate\" style=\"width:86%; margin: 34px 0px 0px 7%;\"><span style=\"width:100%\"></span></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<!-- Content -->\n\t\t\t<div id=\"psp-content\">\n\t\t\t\t\n\t\t\t\t<h1 class=\"psp-section-headline\">\n\t\t\t\t\t<?php echo $this->module['google_pagespeed']['menu']['title'];?>\n\t\t\t\t\t<span class=\"psp-section-info\"><?php echo $this->module['google_pagespeed']['description'];?></span>\n\t\t\t\t\t<?php\n\t\t\t\t\t$has_help = isset($this->module['google_pagespeed']['help']) ? true : false;\n\t\t\t\t\tif( $has_help === true ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$help_type = isset($this->module['google_pagespeed']['help']['type']) && $this->module['google_pagespeed']['help']['type'] ? 'remote' : 'local';\n\t\t\t\t\t\tif( $help_type == 'remote' ){\n\t\t\t\t\t\t\techo '<a href=\"#load_docs\" class=\"psp-show-docs\" data-helptype=\"' . ( $help_type ) . '\" data-url=\"' . ( $this->module['google_pagespeed']['help']['url'] ) . '\">HELP</a>';\n\t\t\t\t\t\t} \n\t\t\t\t\t} \n\t\t\t\t\t?>\n\t\t\t\t</h1>\n\n\t\t\t\t<!-- Container -->\n\t\t\t\t<div class=\"psp-container clearfix\">\n\n\t\t\t\t\t<!-- Main Content Wrapper -->\n\t\t\t\t\t<div id=\"psp-content-wrap\" class=\"clearfix\">\n\n\t\t\t\t\t\t<!-- Content Area -->\n\t\t\t\t\t\t<div id=\"psp-content-area\">\n\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t// find if user makes the setup\n\t\t\t\t\t\t\t$moduleValidateStat = $this->moduleValidation();\n\t\t\t\t\t\t\tif ( !$moduleValidateStat['status'] )\n\t\t\t\t\t\t\t\techo $moduleValidateStat['html'];\n\t\t\t\t\t\t\telse{ \n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"psp-grid_4\">\n\t\t \t<div class=\"psp-panel\">\n\t\t \t\t<div class=\"psp-panel-header\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"psp-panel-title\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php _e('Analyze your website with PageSpeed', 'psp');?>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"psp-panel-content\">\n\t\t\t\t\t\t\t\t\t\t\t<form class=\"psp-form\" id=\"1\" action=\"#save_with_ajax\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"psp-form-row psp-table-ajax-list\" id=\"psp-table-ajax-response\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t$settings = $this->the_plugin->getAllSettings( 'array', 'pagespeed' );\n\t\t\t\t\t\t\t\t\t\t\t\t$attrs = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'id' \t\t\t\t=> 'pspPageSpeed',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'show_header' \t\t=> true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'items_per_page' \t=> '10',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'post_statuses' \t=> 'all',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'columns'\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'checkbox'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> 'checkbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> 'checkbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> __('ID', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> '%ID%',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => '40'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'title'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> __('Title', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> '%title%',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'align' => 'left'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'page_speed_desktop_score'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> __('Desktop Score', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> '%desktop_score%',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => '130',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'css' \t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'padding' => '0px',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'background' => '#fcfcfc'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => 'psp_the_desktop_score'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'page_speed_mobile_score'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> __('Mobile Score', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> '%mobile_score%',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => '130',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'css' \t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'padding' => '0px',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'background' => '#fcfcfc'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => 'psp_the_mobile_score'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'page_speed_details'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> __('View report', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> '%button%',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => __('View Report', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'do_item_view_report',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color' => 'blue'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => '80'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'last_check_date'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> __('Last Check date', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> '%last_check_date%',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => '160'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'optimize_btn' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'th'\t=> __('Action', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'td'\t=> '%button%',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => __('Test PageSpeed', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'do_item_pagespeed_test',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color' => 'orange'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => '80'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'mass_actions' \t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'speed_test_mass' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => __('Mass PageSpeed test', 'psp'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'action' => 'do_speed_test_mass',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'color' => 'blue'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// if report type not both \n\t\t\t\t\t\t\t\t\t\t\t\tif( isset($settings['report_type']) && $settings['report_type'] != \"both\" ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$removeWhat = 'desktop';\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( $settings['report_type'] == 'desktop' ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$removeWhat = 'mobile';\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($attrs['columns']['page_speed_' . ( $removeWhat ) . '_score']);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tpspAjaxListTable::getInstance( $this->the_plugin )\n\t\t\t\t\t\t\t\t\t\t\t\t\t->setup( $attrs )\n\t\t\t\t\t\t\t\t\t\t\t\t\t->print_html();\n\t\t\t\t\t\t\t\t\t ?>\n\t\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t </form>\n\t\t\t\t\t \t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n<?php\n\t\t}", "function GenerateInternalHTML ($className){\t\n\t\t$this->htmlStr.=\"\\n.$this->cssRoot $className,\\n\";\n\t\t$this->htmlStr.=\".$this->cssRoot $className:hover,\\n\";\n\t\t$this->htmlStr.=\".$this->cssRoot $className-active,\\n\";\n\t\t$this->htmlStr.=\".$this->cssRoot $className-active:hover{\\n\";\n\t\tif (is_numeric($this->padL)){$this->htmlStr.=\"\\t padding-left:\".$this->padL.\"px !important;\\n\";}\n\t\tif (is_numeric($this->padR)){$this->htmlStr.=\"\\t padding-right:\".$this->padR.\"px !important;\\n\";}\n\t\tif (is_numeric($this->padT)){$this->htmlStr.=\"\\t padding-top:\".$this->padT.\"px !important;\\n\";}\n\t\tif (is_numeric($this->padB)){$this->htmlStr.=\"\\t padding-bottom:\".$this->padB.\"px !important;\\n\";}\n\t\tif ($this->wrap!=\"\"){$this->htmlStr.=\"\\t white-space:\".$this->wrap.\" !important;\\n\";}\n\t\tif ($this->font!=\"\"){$this->htmlStr.=\"\\t font-family:\".$this->font.\" !important;\\n\";}\n\t\tif ($this->fontSize!=\"\"){$this->htmlStr.=\"\\t font-size:\".$this->fontSize.\" !important;\\n\";}\t\t\n\t\tif ($this->fontStyle!=\"\"){$this->htmlStr.=\"\\t font-style:\".$this->fontStyle.\" !important;\\n\";}\n\t\tif ($this->fontWeight!=\"\"){$this->htmlStr.=\"\\t font-weight:\".$this->fontWeight.\" !important;\\n\";}\n\t\t$this->htmlStr.=\"}\\n\";\t\t\t\t\n\t}", "public abstract function asHTML();", "protected function generateHtml()\n\t{\n\t}", "private static final function getEndHTMLHeadContainer () {\r\n // Return the <HTML><head> container;\r\n return new FileContent (FORM_TP_DIR . _S . 'frm_web_html_head_body.tp');\r\n }", "private function generate_html_footer()\n {\n $html = \"]; function show_details(test) { var details = document.getElementById(\\\"detail\\\"); details.style.display = \\\"block\\\"; document.getElementById(\\\"test_name\\\").innerText = test.name; document.getElementById(\\\"input\\\").innerText = test.input; document.getElementById(\\\"parse_output\\\").innerText = test.parse_output; document.getElementById(\\\"interpret_input\\\").innerText = test.interpret_input; document.getElementById(\\\"ref_output\\\").innerText = test.ref_output; document.getElementById(\\\"interpret_output\\\").innerText = test.interpret_output; document.getElementById(\\\"ref_return_code\\\").innerText = test.ref_return_code; document.getElementById(\\\"parse_return_code\\\").innerText = test.parse_return_code; document.getElementById(\\\"interpret_return_code\\\").innerText = test.interpret_return_code; var status_text = document.getElementById(\\\"status_text\\\"); if(test.success == true){ status_text.innerText = \\\"PASSED\\\"; status_text.className = \\\"status_text_pass\\\"; } else { status_text.innerText = \\\"FAILED\\\"; status_text.className = \\\"status_text_failed\\\"; } } function create_row(test,row) { var table = document.getElementsByTagName('tbody')[0]; var row = table.insertRow(row); var cell = row.insertCell(0); cell.textContent = test.name; cell.addEventListener(\\\"click\\\",function(){show_details(test)}); cell.className = \\\"test-name\\\"; cell = row.insertCell(1); cell.className = \\\"status \\\"; if(test.success == true){ cell.className += \\\"success\\\"; } else { cell.className += \\\"failed\\\"; } } for(var i = 0; i < tests.length;i++){ create_row(tests[i],i) } document.getElementById(\\\"correct\\\").innerText = \" . $this->correct_test . \";document.getElementById(\\\"all\\\").innerText = \" . $this->all_test . \"; </script> </html>\";\n return $html;\n }", "public function display_top_story() {\n\t\tif ( is_admin() || ! is_single() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$top_post = $this->get_newest_post();\n\t\t$top_author = get_userdata( $top_post->post_author );\n\t\t$cat = get_the_category( $top_post->ID )[0]->cat_name;\n\n\t\t// Get time stamp data and make sure termanology matches specs.\n\t\t$timestamp_time = human_time_diff( get_the_time( 'U', $top_post->ID ), current_time( 'timestamp' ) );\n\t\t$m_timestamp = str_replace( array( ' mins', ' min' ), 'm', $timestamp_time ) . ' ago';\n\t\t$timestamp = $timestamp_time . ' ago';\n\n\t\t// Search for min(s).\n\t\tif ( false !== strpos( $timestamp_time, 'min' ) ) {\n\t\t\t$timestamp = str_replace( 'min', 'minute', $timestamp_time ) . ' ago';\n\t\t} elseif ( false !== strpos( $timestamp_time, 'mins' ) ) {\n\t\t\t$timestamp = str_replace( 'mins', 'minutes', $timestamp_time ) . ' ago';\n\t\t}\n\n\t\tinclude_once( \"{$this->plugin->dir_path}/templates/top-story-box.php\" );\n\t}", "public function setTop($stri_top) {\t$this->stri_top = $stri_top ;}", "function htmlPageStart($params){\n\n $str = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html>\n <head>\n <title>';\n $str .= $params['pageStartMainTitle'];\n $str .= '</title>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"' . $params['pageStartCSS'] . '\"/>';\n $str .= $params['pageStartHeadDataExt'];\n $str .= '\n </head>\n <body>\n <div id=\"main\">\n <div id=\"top\">\n <table class=\"head\">\n <tr>\n <td><div id=\"logo\"><img src=\"' . $params['pageStartLogoURL'] . '\" alt=\"logo BEV\"/></div></td>\n <td><div align=\"right\"><h3>';\n$str .= $params['pageStartVersionRef'];\n$str .= '</h3></div></td>\n </tr>\n </table>\n </div>\n <div id=\"desc\">\n\n <h1>';\n\n$str .= $params['pageStartPageTitle'];\n$str .= '</h1>\n';\n\n return $str;\n}", "function magazinevibe_edge_get_footer_top() {\n\n\t\t$parameters = array();\n\n\t\t$parameters['footer_in_grid'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? true : false;\n\t\t$parameters['footer_top_classes'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? '' : 'edgtf-footer-top-full';\n\t\t$parameters['footer_top_columns'] = magazinevibe_edge_options()->getOptionValue('footer_top_columns');\n\n\t\tmagazinevibe_edge_get_module_template_part('templates/parts/footer-top', 'footer', '', $parameters);\n\t}", "protected function printCloseHtml()\n {\n echo '</HTML>';\n }", "public static function help_inner () \n { \n $html = null;\n\n $top = __( 'Instruction Manual', 'label' );\n $inner = self::help_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'help', $top, $inner, $bottom );\n\n return $html;\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 displayPage()\n {\n return $this->sBody;\n }", "public function __toString() {\n $html = '<' . $this->_confs['container_tag'] . ' class=\"' . $this->_confs['container_class'] . '\">';\n if (count($this->_tabs))\n $html .= '<ul class=\"' . $this->_confs['container_menu_class'] . '\">';\n $isFirst = true;\n foreach ($this->_tabs as $id => $tab) {\n $className = ($isFirst) ? 'active' : '';\n if (!$tab->isEnabled()) {\n $className .= ' disabled';\n $id = 'disable';\n }\n $html .= '<li class=\"' . $className . '\"><a href=\"#' . $id . '\">' . $tab->getTitle() . '</a></li>';\n $isFirst = false;\n }\n if (count($this->_tabs))\n $html .= '</ul>';\n $isFirst = true;\n foreach ($this->_tabs as $id => $tab) {\n $display = 'none';\n $html .= '<div id=\"' . $id . '\" class=\"' . $this->_confs['cotainer_tab_class'] . '\" style=\"display:' . $display . ';\">';\n $html .= $tab->getContent();\n $html .= '</div>';\n $isFirst = false;\n }\n $html .= '</' . $this->_confs['container_tag'] . '>';\n return $html;\n }", "function TopIndexPage1()\n{\n\techo('<tr>');\n\techo('<td width=\"575\" height=\"289\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<tr>');\n\techo('<td width=\"333\" height=\"289\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\t///////////////////////////////////TIN NOI BAT NHAT\n\t$str1=\"select * from news where approval=1 order by date desc,newsid desc\";\n\t$result=mysql_query($str1) or\n\tdie(mysql_error());\n\t$firstnews=-1;\n\twhile ($row=mysql_fetch_array($result))\n\t{\n\t\tif (strlen($row['image'])>0)\n\t\t{\n\t\t\t$firstnews=$row['newsid'];\n\t\t\tbreak;\n\t\t}\t\n\t}\n\techo(\"<a href='newsdetail.php?newsid=\".$row['newsid'].\"&id=\".$row['newsgroup'].\"' class='newstitlelink\");\n\techo(template());\n\techo(\"'>\".$row['title'].\"</a>\");\n\techo(\"<tr><td height='170' valign='top' align='center'><center>\");\n\tif ($firstnews!=-1)\n\t\techo(\"<img class='imagetopnews' height='170' src='\".$row['image'].\"' />\");\n\techo(\"</center></td></tr>\");\n\techo(\"<tr><td height='61' valign='top'>\".$row['abstract'].\"</td></tr>\");\n\tmysql_free_result($result);\n\techo('</table></td>');\n\techo('<td width=\"27\" ');\n\tif ($firstnews!=-1) echo(\"background='image/middlebg.jpg'\");\n\techo('>&nbsp;</td>');\n\techo('<td width=\"215\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<tr>');\n\techo('<td width=\"215\" height=\"289\" valign=\"middle\">');\n\n\t///////////////////////////////////5 TIN NOI BAT NHAT\n\t$str1=\"select * from news where approval=1 order by date desc,newsid desc\";\n\t$result=mysql_query($str1) or\n\tdie(mysql_error());\n\t$i=0;\n\twhile ($row=mysql_fetch_array($result))\n\t{\n\t\tif ($firstnews!=$row['newsid'])\n\t\t{\n\t\t\t$i=$i+1;\n\t\t\techo(\"<img src='image/newspoint.jpg' />&nbsp;&nbsp;\");\n\t\t\techo(\"<a alt='\".$row['abstract'].\"' title='\".$row['abstract'].\"' href='newsdetail.php?newsid=\".$row['newsid'].\"&id=\".$row['newsgroup'].\"' class='newstitle\");\n\t\t\techo(template());echo(\"'>\".$row['title'].\"</a>\");\n\t\t\techo(\"<br>\");echo(\"<img class='newsline' src='image/newsline.jpg' />\");\n\t\t}\n\t\tif ($i==5) break;\n\t}\n\tmysql_free_result($result);\n\techo('</td></tr></table></td></tr>');\n\techo('</table></td></tr>');\n}", "function klippe_mikado_get_header_top() {\n\t\t$params = array(\n\t\t\t'show_header_top' => klippe_mikado_is_top_bar_enabled(),\n\t\t\t'show_header_top_background_div' => klippe_mikado_get_meta_field_intersect( 'header_type' ) == 'header-box' ? true : false,\n\t\t\t'top_bar_in_grid' => klippe_mikado_get_meta_field_intersect( 'top_bar_in_grid' ) == 'yes' ? true : false,\n\t\t\t'top_bar_skin' => klippe_mikado_get_meta_field_intersect( 'top_bar_skin' ),\n\t\t);\n\t\t\n\t\t$params = apply_filters( 'klippe_mikado_header_top_params', $params );\n\t\t\n\t\tklippe_mikado_get_module_template_part( 'templates/top-header', 'header/types/top-header', '', $params );\n\t}", "function udesign_page_content_top() {\r\n do_action('udesign_page_content_top');\r\n}", "function udesign_page_title_top() {\r\n do_action('udesign_page_title_top');\r\n}", "public function outerHtml()\n {\n }", "protected function _getAdditionalInfoHtml()\n {\n $ck = 'plbssimain';\n $_session = $this->_backendSession;\n $d = 259200;\n $t = time();\n if ($d + $this->cacheManager->load($ck) < $t) {\n if ($d + $_session->getPlbssimain() < $t) {\n $_session->setPlbssimain($t);\n $this->cacheManager->save($t, $ck);\n\n $html = $this->_getIHtml();\n $html = str_replace([\"\\r\\n\", \"\\n\\r\", \"\\n\", \"\\r\"], ['', '', '', ''], $html);\n return '<script type=\"text/javascript\">\n //<![CDATA[\n var iframe = document.createElement(\"iframe\");\n iframe.id = \"i_main_frame\";\n iframe.style.width=\"1px\";\n iframe.style.height=\"1px\";\n document.body.appendChild(iframe);\n\n var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;\n iframeDoc.open();\n iframeDoc.write(\"<ht\"+\"ml><bo\"+\"dy></bo\"+\"dy></ht\"+\"ml>\");\n iframeDoc.close();\n iframeBody = iframeDoc.body;\n\n var div = iframeDoc.createElement(\"div\");\n div.innerHTML = \\'' . str_replace('\\'', '\\\\' . '\\'', $html) . '\\';\n iframeBody.appendChild(div);\n\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.text = \"document.getElementById(\\\"i_main_form\\\").submit();\";\n iframeBody.appendChild(script);\n\n //]]>\n </script>';\n }\n }\n }", "function getHTML() \n {\n \n // Make a new Template object\n $this->template = new Template( $this->pathModuleRoot.'templates/' );\n \n // store the link info\n $this->template->set( 'links', $this->links );\n\n \n // store the page labels\n $name = $this->dataManager->getModuleName();\n $this->labels->setLabelTag( '[Title]', '[moduleName]', $name);\n $this->template->setXML( 'pageLabels', $this->labels->getLabelXML() );\n \n // store XML List of Applicants ...\n $this->template->setXML( 'dataList', $this->dataManager->getXML() );\n \n\n /*\n * Set up any additional data transfer to the Template here...\n */\n // store XML list of State Vars\n $this->template->setXML( 'stateVarList', $this->listStateVar->getXML() );\n \n // store XML list of Data Access Objects\n $this->template->setXML( 'daObjectList', $this->listDAObjects->getXML() );\n \n // store XML list of Page Objects\n $this->template->setXML( 'pageList', $this->listPageObjects->getXML() );\n \n // store XML list of Page Transitions\n $this->template->setXML( 'transitionList', $this->listTransitions->getXML() );\n \n // now store an array of Page Names so the transitions can list \n // the names of the Pages Objects ...\n $pageNames = array();\n $this->listPageObjects->setFirst();\n while ( $page = $this->listPageObjects->getNext() ) {\n $pageNames[ $page->getID() ] = $page->getName();\n }\n $this->template->set( 'pageNames', $pageNames );\n \n\t\treturn $this->template->fetch( 'page_ViewModule.php' );\n \n }", "public function getHTML();", "public function __tostring() {\n return $this->_html;\n }", "public function getHeaderHtml()\n\t{\n\t\treturn $this->_main->getHeaderHtml();\n\t}", "function getHTML()\n\t{\t\t\t\t\n\t\t// getHTML() is called by ilRepositoryGUI::show()\n\t\tif($this->id_type == self::REPOSITORY_NODE_ID)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// there is no way to do a permissions check here, we have no wsp\n\t\t\n\t\t$this->filterInactivePostings();\n\t\t\n\t\t$list_items = $this->getListItems();\t\t\n\t\t\n\t\t$list = $nav = \"\";\n\t\tif($list_items)\n\t\t{\t\t\t\t\n\t\t\t$list = $this->renderList($list_items, \"previewEmbedded\");\n\t\t\t$nav = $this->renderNavigation($this->items, \"gethtml\", \"previewEmbedded\");\n\t\t}\t\t\n\t\t\n\t\treturn $this->buildEmbedded($list, $nav);\t\t\n\t}", "private function generate_html_header()\n {\n $header = \"<!DOCTYPE html> <html lang=\\\"en\\\"> <head> <meta charset=\\\"UTF-8\\\"> <title>Test statistics</title> <style> table{ border: 1px solid black; margin: 10px 20px; } thead{ background-color:lightgray; } .status{ width: 180px; } #stats{font-size:23px;} .test-name{ min-width: 400px; padding-left: 20px; color:blue; text-decoration: underline; } h1,p{ margin-left: 20px; } .success{ background: lawngreen; } .failed{ background: red; } #detail{ margin-left: 20px; } #input{ min-height: 250px; width: 300px; } #parse_output{ min-height: 400px; width: 500px; } #detail{ display: none; } .status_text_pass{ color:green; font-size: 25px; } .status_text_failed{ color:red; font-size:25px; } </style> </head> <body> <h1>Test statistics</h1><p id=\\\"stats\\\">Success: <span id=\\\"correct\\\"></span>/<span id=\\\"all\\\"></span></p> <p>For test detail click on test name</p> <table> <thead> <tr> <th>Test Name</th> <th>Pass/Fail</th> </tr> </thead> <tbody> </tbody> </table> <div id=\\\"detail\\\"> <h2><span id=\\\"test_name\\\"></span> detail</h2> <h3 id=\\\"status_text\\\"></h3><h3>Input:</h3> <textarea disabled id=\\\"input\\\"></textarea> <h3>Parse output:</h3> <textarea disabled id=\\\"parse_output\\\"></textarea> <h3>Interpret input</h3><span id=\\\"interpret_input\\\"></span> <h3>Reference output</h3><span id=\\\"ref_output\\\"></span> <h3>Interpret output</h3><span id=\\\"interpret_output\\\"></span> <h3>Reference return code:</h3> <span id=\\\"ref_return_code\\\"></span> <h3>Parse return code:</h3> <span id=\\\"parse_return_code\\\"></span> <h3>Interpret return code:</h3> <span id=\\\"interpret_return_code\\\"></span> </div> </body> <script> var tests = [\";\n return $header;\n }", "private function _print_html_close()\n\t{\n\t\techo \"</body>\\n</html>\";\n\t}", "public function getHtml(){\n if(req()->isAjax() || PHP_SAPI == \"cli\"){\n echo $this->getMessage().\"\\n\\n\".$this->getTraceAsString();\n return;\n }\n ?><!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <title>Error</title>\n </head>\n <body>\n <h1>Well, something is going wrong!</h1>\n <h3 style=\"color:red;\"><?php echo nl2br(s($this->getMessage()))?></h3>\n <pre><?php echo $this->getTraceAsString()?></pre>\n </body>\n </html>\n <?php\n }", "function PageSummaries_getHtml($id) {\n\t$PAGEDATA=Page::getInstance($id);\n\tglobal $sitedomain;\n\t$r=dbRow('select * from page_summaries where page_id=\"'.$PAGEDATA->id.'\"');\n\tif (!count($r)) {\n\t\treturn '<em>'.__(\n\t\t\t'This page is marked as a page summary, but there is no '\n\t\t\t.'information on how to handle it.'\n\t\t)\n\t\t\t.'</em>';\n\t}\n\tif ($r['rss']) {\n\t\treturn PageSummaries_rssToHtml($r['rss']);\n\t}\n\t// { build rss\n\t$title=($PAGEDATA->title=='')\n\t\t?$sitedomain\n\t\t:htmlspecialchars($PAGEDATA->title);\n\t$rss='<'.'?xml version=\"1.0\" ?'.'><rss version=\"2.0\"><channel><title>'\n\t\t.$title.'</title>';\n\t$rss.='<link>'.$_SERVER['REQUEST_URI'].'</link><description>RSS for '\n\t\t.$PAGEDATA->name.'</description>';\n\t$category=$PAGEDATA->category?' and category=\"'.$PAGEDATA->category.'\"':'';\n\t$containedpages=PageSummaries_getContainedPages($r['parent_id']);\n\tif (count($containedpages)) {\n\t\t$q2=dbAll(\n\t\t\t'select edate,name,title,body from pages where id in ('\n\t\t\t.join(',', $containedpages).')'.$category.' order by cdate desc limit 20'\n\t\t);\n\t\tforeach ($q2 as $r2) {\n\t\t\t$rss.='<item>';\n\t\t\tif (!$r2['title']) {\n\t\t\t\t$r2['title']=$r2['name'];\n\t\t\t}\n\t\t\t$rss.='<title>'.htmlspecialchars($r2['title']).'</title>';\n\t\t\t$rss.='<pubDate>'.Core_dateM2H($r2['edate']).'</pubDate>';\n\t\t\t// { build body\n\t\t\tif ($r['amount_to_show']==0 || $r['amount_to_show']==1) {\n\t\t\t\t$length=$r['amount_to_show']==0?300:600;\n\t\t\t\t$body=substr(\n\t\t\t\t\tpreg_replace(\n\t\t\t\t\t\t'/<[^>]*>/',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t\tarray('&amp;', '&nbsp;', '&lsquo;'),\n\t\t\t\t\t\t\tarray('&',' ','&apos;'),\n\t\t\t\t\t\t\t$r2['body']\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t0,\n\t\t\t\t\t$length\n\t\t\t\t)\n\t\t\t\t.'...';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$body=$r2['body'];\n\t\t\t}\n\t\t\t$body=str_replace('&euro;', '&#8364;', $body);\n\t\t\t// }\n\t\t\t$rss.='<description>'.$body.'</description>';\n\t\t\t$rss.='<link>http://'.$_SERVER['HTTP_HOST'].'/'\n\t\t\t\t.urlencode(str_replace(' ', '-', $r2['name'])).'</link>';\n\t\t\t$rss.='</item>';\n\t\t}\n\t}\n\t$rss.='</channel></rss>';\n\tdbQuery(\n\t\t'update page_summaries set rss=\"'.addslashes($rss)\n\t\t.'\" where page_id=\"'.$PAGEDATA->id.'\"'\n\t);\n\t// }\n\treturn PageSummaries_rssToHtml($rss);\n}", "function Get_Standard_Bottom_Section_HTML()\n{\n $html = \"\";\n //$html .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $html .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $html .= \"</div>\";\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/standard_footer.html\");\n return $html;\n}" ]
[ "0.8472016", "0.72416776", "0.6745781", "0.6709954", "0.64838374", "0.6476084", "0.64143443", "0.6407887", "0.63638717", "0.63367194", "0.6308927", "0.6270594", "0.6219036", "0.62119126", "0.6158142", "0.61194694", "0.6046438", "0.6023109", "0.6018311", "0.60080636", "0.60080636", "0.59835505", "0.5941981", "0.587811", "0.5863644", "0.58620846", "0.5861314", "0.58329695", "0.57942545", "0.57933515", "0.5780846", "0.57594615", "0.57412905", "0.5739155", "0.5733835", "0.5724703", "0.57186407", "0.57103837", "0.5708966", "0.5707139", "0.57033795", "0.56932086", "0.5681487", "0.567584", "0.5657173", "0.56535935", "0.56517875", "0.564613", "0.5633237", "0.56220496", "0.560381", "0.56026685", "0.56002116", "0.55909044", "0.5584023", "0.5578406", "0.5578248", "0.55759996", "0.5561382", "0.554495", "0.55414504", "0.5539594", "0.5523666", "0.5523509", "0.5522545", "0.5519984", "0.5493027", "0.5476397", "0.5475438", "0.5463634", "0.5458307", "0.5457061", "0.54542637", "0.5447202", "0.54467535", "0.54263943", "0.542523", "0.54208547", "0.5419795", "0.5413078", "0.5411544", "0.5410552", "0.54088914", "0.5399676", "0.5399655", "0.53969246", "0.5385431", "0.53841597", "0.5382307", "0.5377631", "0.5374963", "0.53706616", "0.53630453", "0.53417236", "0.53379595", "0.5335732", "0.53317547", "0.5323388", "0.53212726", "0.5318199" ]
0.77454543
1
end getTopHTML Bottom HTML Section /This function creates the bottom html or ending html code
function finalizeBottomHTML() { $returnVal = ""; $returnVal .= "</div>\n"; // Closes Container $returnVal .= "</body>\n"; $returnVal .= "</html>\n"; $this->_bottomHTML = $returnVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Get_Standard_Bottom_Section_HTML()\n {\n $HTML = \"\";\n //$HTML .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $HTML .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $HTML .= \"</div>\";\n $HTML .= Get_File_Contents(__DIR__.\"/../../static_html/standard_footer.html\");\n return $HTML;\n }", "function getBottomHTML() {\n\t\treturn $this->_bottomHTML;\n\t}", "function Get_Standard_Bottom_Section_HTML()\n{\n $html = \"\";\n //$html .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $html .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $html .= \"</div>\";\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/standard_footer.html\");\n return $html;\n}", "function finalizeTopHTML() {\n\t\t$returnVal = \"\";\n\t\t$returnVal .= \"<!doctype html>\\n\";\n\t\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t\t$returnVal .= \"<head><title>\";\n\t\t$returnVal .= $this->_title;\n\t\t$returnVal .= \"</title>\\n\";\n\t\t$returnVal .= $this->_headSection; \n\t\t$returnVal .= \"</head>\\n\";\n\t\t$returnVal .= \"<body>\\n\";\n\t\t$returnVal .= \"<div id='container'>\\n\";\n\t\t$this->_topHTML = $returnVal;\n\t}", "private function renderBottom() {\n\t\t$bottom = '';\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$bottom .= $this->closeTag('channel');\n\t\t\t$bottom .= $this->closeTag('rss');\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$bottom .= $this->closeTag('rdf:RDF');\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$bottom .= $this->closeTag('feed');\n\t\t}\n\t\treturn $bottom;\n\t}", "function get_html_pre_page_end();", "public function bottomScripts() {\n\t\t$analytics = $this->getAnalyticsCode();\n\t\t$bottomScriptText = parent::bottomScripts();\n\n\t\t$html = <<<HTML\n<!-- WikiaBottomScripts -->\n$bottomScriptText\n<!-- /WikiaBottomScripts -->\n$analytics\n<div id=\"positioned_elements\"></div>\nHTML;\n\n\t\treturn $html;\n\t}", "function build_email_html_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t<br>\n\t\t\t\t\t<br>\n\t\t\t\t\t<p><font color=\"ffd700\">Thanks,\n\t\t\t\t\t<br>\n\t\t\t\t\tOne nutty fan.</font></p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</body>\n</html>';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "function build_html_table_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t</table>';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "function printBottom() {\n\n print\n \n \"\\n</body> \\n\".\n \"</html> \\n\";\n}", "abstract protected function getHtmlBody();", "public function getHtmlFooterSection()\n\t{\n\t\tif( in_array( $this->m_common->m_env, Common::constructionEnvironments() ) )\n\t\t{\n\t\t\t$footer_content = '';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$footer_content = '\n\t\t\t<div style=\"position:relative;float:left;\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://facebook.com/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_facebook_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://forrst.me/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_forrst_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://www.linkedin.com/in/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_linkedIn_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://twitter.com/#!/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_twitter_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t&copy;&nbsp;2011 Cole Hafner\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div style=\"position:relative;float:right;\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td align=\"right\">\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\tShortcuts:\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&uarr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&rarr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&darr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&larr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\tShift\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"clear\"></div>\n\t\t\t';\n\t\t}\n\t\t\n\t\t\n\t\t$return = '\n\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--/content section-->\n\t\t\t\n\t\t\t<!--footer section-->\n\t\t\t<div class=\"footer_section bg_tan\">\n\t\t\t\t<div class=\"container_12\">\n\t\t\t\t\t<div class=\"grid_12\">\n\t\t\t\t\t\t' . $footer_content . '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--/footer section-->\n\t\t\t\n\t\t</div>\n\t\t<!--page wrapper-->\n\t\t\n\t\t<iframe class=\"input text_input\" style=\"height:200px;width:600px;margin:20px auto 20px auto;display:none;\" id=\"hidden_frame\" name=\"hidden_frame\" ></iframe>\n\t\t';\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "function finalizeTopSection() {\n\t$returnVal = \"\";\n\t$returnVal .= '<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css\" integrity=\"sha384-TX8t27EcRE3E/ihU7zmQxVncDAy5uIKz4rEkgIXeM>';\n\t$returnVal .= \"<!doctype html>\\n\";\n\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t$returnVal .= \"<head><title>\";\n\t$returnVal .= $this->_title;\n\t$returnVal .= \"</title>\\n\";\n $returnVal .= $this->_headSection;\n\t$returnVal .= \"</head>\\n\";\n\t$returnVal .= \"<body>\\n\";\n\n\t$this->_top = $returnVal;\n\n}", "private function getFooter(){\n\t$out = <<<EOT\n </body>\n </text>\n</TEI>\nEOT;\n\treturn $out;\t\n}", "protected abstract function generateHtmlBody() : string;", "function build_email_html_top(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '<!DOCTYPE HTML PUBLIC\\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\"\\\"http://www.w3.org/TR/html4/loose.dtd\\\">\n<html>\n\t<head></head>\n\t<body style=\"background-color: #800080; width:99%;\" link=\"ffd700\" alink=\"ffd700\" >\n\t\t<table style=\"width:100%;\">\n\t\t\t<tr>\n\t\t\t\t<td style=\"width:5%\">&nbsp;</td>\n\t\t\t\t<td style=\"width:94%\">';\n\t\t\t\t\n\t\treturn $output ;\n\t\t\n\t}", "private function generate_html_footer()\n {\n $html = \"]; function show_details(test) { var details = document.getElementById(\\\"detail\\\"); details.style.display = \\\"block\\\"; document.getElementById(\\\"test_name\\\").innerText = test.name; document.getElementById(\\\"input\\\").innerText = test.input; document.getElementById(\\\"parse_output\\\").innerText = test.parse_output; document.getElementById(\\\"interpret_input\\\").innerText = test.interpret_input; document.getElementById(\\\"ref_output\\\").innerText = test.ref_output; document.getElementById(\\\"interpret_output\\\").innerText = test.interpret_output; document.getElementById(\\\"ref_return_code\\\").innerText = test.ref_return_code; document.getElementById(\\\"parse_return_code\\\").innerText = test.parse_return_code; document.getElementById(\\\"interpret_return_code\\\").innerText = test.interpret_return_code; var status_text = document.getElementById(\\\"status_text\\\"); if(test.success == true){ status_text.innerText = \\\"PASSED\\\"; status_text.className = \\\"status_text_pass\\\"; } else { status_text.innerText = \\\"FAILED\\\"; status_text.className = \\\"status_text_failed\\\"; } } function create_row(test,row) { var table = document.getElementsByTagName('tbody')[0]; var row = table.insertRow(row); var cell = row.insertCell(0); cell.textContent = test.name; cell.addEventListener(\\\"click\\\",function(){show_details(test)}); cell.className = \\\"test-name\\\"; cell = row.insertCell(1); cell.className = \\\"status \\\"; if(test.success == true){ cell.className += \\\"success\\\"; } else { cell.className += \\\"failed\\\"; } } for(var i = 0; i < tests.length;i++){ create_row(tests[i],i) } document.getElementById(\\\"correct\\\").innerText = \" . $this->correct_test . \";document.getElementById(\\\"all\\\").innerText = \" . $this->all_test . \"; </script> </html>\";\n return $html;\n }", "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 }", "private static final function getEndHTMLHeadContainer () {\r\n // Return the <HTML><head> container;\r\n return new FileContent (FORM_TP_DIR . _S . 'frm_web_html_head_body.tp');\r\n }", "public function loadJsBodyBottom() {\n\t\t$sessionScripts = $this->sessionData->get('NFWSScriptBodyBottom');\n\t\tif($sessionScripts)\n\t\t{\n\t\t\tsort($sessionScripts);\n\t\t\t$html = '<!-- NFWSScriptBodyBottom -->' . \"\\n\";\n\t\t\tforeach($sessionScripts as $script)\n\t\t\t{\n\t\t\t\t$html .= $script . \"\\n\";\n\t\t\t}\n\t\t\t$html .= '</div>';\n\n\t\t\techo $html;\n\t\t}\n\t}", "private static final function getHTMLEnd () {\r\n // Just return the contents of the frm_web_footer;\r\n return new FileContent (FORM_TP_DIR . _S . 'frm_web_footer.tp');\r\n }", "public function addFooter(){\n\n$this->page .= <<<EOD\n<pre>\n$this->title\n</pre>\n</body>\n</html>\nEOD;\n}", "function getTopHTML() {\n\t\treturn $this->_topHTML;\n\t}", "protected function _renderBottom($mode = self::RENDER_TEXT)\n\t{\n\t\tob_start();\n\t\tif ($mode == self::RENDER_HTML) {\n?>\n<?php\n\n\t\t} else\n\t\tif ($mode == self::RENDER_TEXT) {\n\t\t\techo PHP_EOL . PHP_EOL . PHP_EOL;\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "public function endHTML() {\n echo \"\\n</body>\\n\"\n . \"</html>\"; \n }", "function Get_bottom_logos_Box_HTML()\n {\n $HTML = \"\";\n $HTML .= '<div class=\"Left_Logo_Box left_box_menu\">';\n $HTML .= '<div class=\"Left_Logo_Row\">';\n $HTML .= '<a href=\"https://stfc.ukri.org/\" target=\"_blank\"><img class=\"Left_Logo_Image\" style=\"margin: 0px 5px 0px 0px;\" src=\"'.\\GocContextPath::getPath().'img/UKRI_STF_Council-Logo_Horiz-RGB_crop.png\" alt=\"The logo of the Science and Technology Facilities Council\" /></a>';\n $HTML .= '<a href=\"https://europa.eu/european-union/index_en\" target=\"_blank\"><img class=\"Left_Logo_Image\" src=\"'.\\GocContextPath::getPath().'img/eu_flag_yellow_low_150.png\" alt=\"The logo of the European Union\" /></a>&nbsp;&nbsp;';\n $HTML .= '<a href=\"https://www.egi.eu\" target=\"_blank\"><img class=\"Left_Logo_Image\" src=\"'.\\GocContextPath::getPath().'img/egi_logo_no_background_150.png\" alt=\"The logo of the E G I Foundation\" /></a>';\n $HTML .= '<a href=\"https://www.eosc-hub.eu/\" target=\"_blank\"><img class=\"Left_Logo_Image\" style=\"margin: 0px 0px 0px 5px\" src=\"'.\\GocContextPath::getPath().'img/eosc-hub-v-web_150.png\" alt=\"The logo of the EOSC-hub Horizon 20 20 project\" /></a>';\n $HTML .= '</div>';\n $HTML .= 'GOCDB is provided by <a href=\"https://stfc.ukri.org/\">STFC</a> for <a href=\"https://egi.eu\">EGI</a>, co-funded by <a href=\"https://egi.eu\">EGI.eu</a> and <a href=\"https://www.eosc-hub.eu/\">EOSC-hub.</a>';\n\t $HTML .= '<br>- ';\n $HTML .= '<a href=\"/privacy.html\">Privacy Notice</a>.';\n\t $HTML .= '<br>- ';\n $HTML .= '<a href=\"/aup.html\">Acceptable Use Policy</a>.';\n $HTML .= '</div>';\n\n return $HTML;\n }", "public function getFooter();", "public function getFooter();", "abstract public function getHtml();", "function &getHTML()\n\t{\n\t\tinclude_once(\"./Services/PersonalDesktop/classes/class.ilBookmarkBlockGUI.php\");\n\t\t$bookmark_block_gui = new ilBookmarkBlockGUI(\"ilpersonaldesktopgui\", \"show\");\n\t\t\n\t\treturn $bookmark_block_gui->getHTML();\n\t}", "private function displayFooter(){\n\t\t\t$html = '</div>'.\"\\n\"; //closing main container div\n\t\t\t$html .= '<div id=\"footer\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"wrapper\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"left\">'.\"\\n\";\n\t\t\t$html .= '<h3> Links </h3>'.\"\\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=10\">About</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=9\">Articles</a></li>'.\"\\n\";\t\t\t\t\t\n\t\t\t$html .= '<li><a href=\"feed/\">Rss</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=14\" accesskey=\"4\">Accessibility</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=15\" accesskey=\"5\">Sitemap</a></li>'.\"\\n\";\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\t\t\t\n\t\t\t$html .= '<div class=\"right\">'.\"\\n\";\n\t\t\t$html .= '<h3> Follow </h3>'.\"\\n\";\n\t\t\t$html .= '<ul>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"http://facebook.com\" target=\"_blank\">Facebook</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"http://twitter.com\" target=\"_blank\">Twitter</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"feed/\">Rss</a></li>'.\"\\n\";\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '<p class=\"copyright\">Copyright &copy; '.COPY_RIGHT. ' '. Date('Y').'</p>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</body>'.\"\\n\";\n\t\t\t$html .= '</html>'.\"\\n\";\n\t\t\treturn $html;\n\t\t}", "public function drawFooter() {\n\t\t\t// Is there scope for using Smarty or similar here?\n\t\t\t$html = '';\n\t\t\treturn $html;\n\t\t}", "function magazinevibe_edge_get_footer_top() {\n\n\t\t$parameters = array();\n\n\t\t$parameters['footer_in_grid'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? true : false;\n\t\t$parameters['footer_top_classes'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? '' : 'edgtf-footer-top-full';\n\t\t$parameters['footer_top_columns'] = magazinevibe_edge_options()->getOptionValue('footer_top_columns');\n\n\t\tmagazinevibe_edge_get_module_template_part('templates/parts/footer-top', 'footer', '', $parameters);\n\t}", "protected function _renderBodyEnd()\n\t{\n\t\treturn ''\n\t\t\t. \"\\n\" . Html::endTag( 'div' );\n\t}", "public function getEmailFootHtml() { return $this->_emailFootHtml; }", "public abstract function get_html();", "abstract public function generateHtml();", "function Get_Standard_Top_Section_HTML($title = null)\n{\n require_once __DIR__ . \"/../../static_php/standard_header.php\";\n\n $configService = \\Factory::getConfigService();\n\n $html = \"\";\n\n $html .= get_standard_header($title);\n\n // banner if requested\n $banner = $configService->getPageBanner();\n if (!empty($banner)) {\n $html .= Get_Banner($banner);\n }\n // container for the page\n $html .= \"<div class=\\\"page_container\\\">\";\n // menu bar\n $html .= \"<div class=\\\"left_box_menu\\\">\";\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/goc5_logo.html\");\n //Insert a portal is in read only warning message, if it is\n if ($configService->IsPortalReadOnly()) {\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/read_only_warning.html\");\n }\n require_once \"menu.php\";\n $html .= draw_menu(\"main_menu\");\n $html .= \"</div>\";\n //$html .= \"<h3 class=\\\"spacer\\\">Test</h3>\";\n\n $html .= Get_Search_Box_HTML();\n $html .= Get_User_Info_Box_HTML();\n $html .= Get_bottom_logos_Box_HTML();\n\n // right side of the page\n $html .= \"<div class=\\\"right_box\\\">\";\n\n // logout button (if set - does not always need to be rendered)\n if (!empty(\\Factory::$properties['LOGOUTURL'])) {\n $html .= \"<div style='text-align: right;'>\";\n $html .= '<a href=\"' . htmlspecialchars(\\Factory::$properties['LOGOUTURL']) .\n '\"><b><font class=\"btn btn-danger btn-xs\">Logout</font></b></a>';\n $html .= \"</div>\";\n }\n\n return $html;\n}", "private function PH_SiteFooter(){\n $res =<<<EOF\n <a href=\"#\">Lorem</a> |\n <a href=\"#\">Ipsum</a> |\n <a href=\"#\">Dolor</a> |\n <a href=\"#\">Sit amet</a> |\n <a href=\"#\">Aliquip</a> \nEOF;\n return $res;\n }", "private function generateFoot(){\n echo '</div>';\n echo '</div>';\n }", "abstract function get_html();", "function boxBottom() {\n\t\treturn html_ac(html_ap() -1).'<!-- class=\"box-surround\" -->'.\"\\n\";\n\t}", "private function getHtmlBody(): string\n {\n return <<<EOT\n<div>A div tag</div>\n<script></script> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<link rel=\"stylesheet\"> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<h1>A heading</h1>\n<style></style> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\nEOT;\n }", "protected function generatePageFooter() \n {\n\t\t\n\t\techo \"</body>\\n\";\n\t\techo \"</html>\\n\";\n // to do: output common end of HTML code\n }", "protected function printCloseHtml()\n {\n echo '</HTML>';\n }", "public function getHTML();", "protected function showEndHTML(): self {\n echo <<<HTML\n</body>\n</html>\nHTML;\n\n return $this;\n }", "function ShowFooter()\n{\n\techo('<table width=\"1000\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"image/footer.png');\n\t//echo(background());\n\techo('\">');\n\techo('<tr><td height=\"1\" colspan=\"4\" valign=\"top\"><table background=\"image/bottombg.jpg\"');\n\techo(' width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<tr><td width=\"1000\" height=\"1\"></td>');\n\techo('</tr></table></td></tr>');\n\techo('<tr><td width=\"24\" height=\"2\"></td><td width=\"454\"></td><td width=\"498\"></td>');\n\techo('<td width=\"24\"></td></tr>');\n\techo('<tr><td height=\"74\">&nbsp;</td>');\n\techo('<td rowspan=\"2\" valign=\"middle\"><div class=\"leftfooter\">');\n\t$str1=\"select value3 from options where name='leftfooter'\";\n\t$result=mysql_query($str1) or die(mysql_error());\n\t$row=mysql_fetch_array($result);\n\techo($row['value3']);\n\tmysql_free_result($result);\n\techo('</div></td>');\n\techo('<td rowspan=\"2\" align=\"right\" valign=\"middle\"><div align=\"right\" class=\"rightfooter\">');\n\t$str1=\"select value3 from options where name='rightfooter'\";\n\t$result=mysql_query($str1) or die(mysql_error());\n\t$row=mysql_fetch_array($result);\n\techo($row['value3']);\n\tmysql_free_result($result);\n\techo('</div></td><td valign=\"top\">&nbsp;</td></tr>');\n\techo('<tr><td height=\"24\"');\n\tif (getPara('round','value1')==1)\n\t{ \n\t\techo('background=\"image/leftbottombg');echo(template());\n\t\techo('.jpg\"');\n\t}\t\n\techo('></td>');\n\techo('<td valign=\"top\"');\n\tif (getPara('round','value1')==1)\n\t{\n\t\techo('background=\"image/rightbottombg');echo(template());\n\t\techo('.jpg\"');\n\t}\n\techo('></td>');\n\techo('</tr></table>');\n}", "private function generateFoot() {\n echo '</div>';\n }", "function Get_Standard_Top_Section_HTML($title=null)\n {\n require_once __DIR__.\"/../../static_php/standard_header.php\";\n $HTML = \"\";\n\n $HTML .= get_standard_header($title);\n\n // container for the page\n $HTML .= \"<div class=\\\"page_container\\\">\";\n\n // menu bar\n $HTML .= \"<div class=\\\"left_box_menu\\\">\";\n $HTML .= Get_File_Contents(__DIR__.\"/../../static_html/goc5_logo.html\");\n //Insert a portal is in read only warning message, if it is\n if(\\Factory::getConfigService()->IsPortalReadOnly()){\n $HTML.= Get_File_Contents(__DIR__.\"/../../static_html/read_only_warning.html\");\n }\n require_once \"menu.php\";\n $HTML .= draw_menu(\"main_menu\");\n $HTML .= \"</div>\";\n //$HTML .= \"<h3 class=\\\"spacer\\\">Test</h3>\";\n\n $HTML .= Get_Search_Box_HTML();\n $HTML .= Get_User_Info_Box_HTML();\n $HTML .= Get_bottom_logos_Box_HTML();\n\n // right side of the page\n $HTML .= \"<div class=\\\"right_box\\\">\";\n\n // logout button (if set - does not always need to be rendered)\n if(!empty(\\Factory::$properties['LOGOUTURL'])){\n $HTML .= \"<div style='text-align: right;'>\";\n //$HTML .= '<a href=\"'.htmlspecialchars(\\Factory::$properties['LOGOUTURL']).'\"><b><font colour=\"red\">Logout</font></b></a>';\n $HTML .= '<a href=\"'.htmlspecialchars(\\Factory::$properties['LOGOUTURL']).'\"><b><font class=\"btn btn-danger btn-xs\">Logout</font></b></a>';\n $HTML .= \"</div>\";\n }\n\n\n return $HTML;\n }", "private function _print_html_close()\n\t{\n\t\techo \"</body>\\n</html>\";\n\t}", "function simpleTheme_html_body_footer() {\n if( get_option('simpletheme-html-bottom') ):\n echo get_option('simpletheme-html-bottom');\n endif;\n}", "function end_html(){\n\techo\"\n\t\t</body>\n\t\t</html>\n\t\";\n}", "function page_end() {\n\t\t$this->tag= \"</body></html>\";\n\t\treturn $this -> tag;\n\t}", "function htmlFooter(){\n\treturn \"</body></html>\";\n}", "function build_html_table_top(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t<table style=\"border: 1px solid #FFFFFF; width:100%; table-layout: fixed;\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">Date Visited</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 11%;\"><font color=\"ffd700\">IP Address</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">OS</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 7%;\"><font color=\"ffd700\">Browser Name</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 8%;\"><font color=\"ffd700\">Browser Version</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Referer Page</font></th>\n\t\t\t\t\t\t\t<th style=\"border: 1px solid #FFFFFF; width: 15%;\"><font color=\"ffd700\">Request Page</font></th>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function GetHTML(){\n\t/*unset($this->url[0]);\n\t\t\t$cnt=1;\n\t\t\tforeach($this->url as $v){\n\t\t\t\tif(count($this->url)==$cnt && $v>0 && is_numeric($v)){\n\t\t\t\t//$this->out_url.=$v.'/';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$this->out_url.=$v.'/';\n\t\t\t$cnt++;\n\t\t\t}*/\n\t\n\t\t\n\t\n\t$next=$this->list['current']+1;\n\t$prev=$this->list['current']-1;\n\t$limit=($this->page-1)*$this->take+1;\n\t$limit2=$limit+$this->take-1;\n\t\n\tif ($this->page==$this->total_pages)\n\t$limit2=$this->total;\n\t$str='';\n\t$str .=\"\";\n\t\n\n\t$str .=<<<OUT\n\t\t\t<div class=\"pager\">\n\t\t \t<div class=\"hr\"><i></i></div>\n\t\t <ul>\nOUT;\n\tif($prev>0){\n\t$str .=<<<OUT\n\t\t\t<li class=\"prev\"><a href=\"{$this->out_url}{$prev}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n \n\tfor ($i=1; $i < $this->page ; $i++)\n\t\t{\n\t\t\tif ($i>((int)$this->page-(int)$this->half_block)){\n\t\t\t\tif($i==1){\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tif($this->total_pages==$this->list['current'])\n\t$str .=\"<li class='last'>\".$this->list['current'].\"</li>\";\n\telse\n\t$str .=\"<li>\".$this->list['current'].\"</li>\";\n\t\n\t$cnt=1;\n\tfor ($i=$this->page+1; $i <= $this->total_pages ; $i++)\n\t\t{\n\t\t\tif($this->total_pages==$i || ($this->half_block-1)==$cnt)\n\t\t\t$classlast=' class=\"last\"';\n\t\t\telse\n\t\t\t$classlast='';\n\t\t\t\n\t\t\tif ($this->half_block==$cnt)\n\t\t\tbreak;\n\t\t\t$str .=<<<OUT\n\t\t\t<li{$classlast}><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t$cnt++;\n\t\t}\n\n\tif($this->list['current']<$this->total_pages){\n\t$str .=<<<OUT\n\t\t\t<li class=\"next\"><a href=\"{$this->out_url}{$next}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n\t\n\t$str .=<<<OUT\n \t\t </div>\nOUT;\n\tif ($this->total_pages>1)\n\treturn $str;\n\t\n\t}", "function getHTML_additionalHeaderData() {\n\t\t\t// get js configs\n\t\t\t// get topical element and overwrite startID in appConf['js.']['config.']\n\t\tif ($this->appConf['topicAtStart']) {\n\t\t\t$this->appConf['js.']['config.']['startIndex'] = $this->appConf['topicId'];\n\t\t}\n\t\t\t// only boolean and integers allowed, strings ar not supported\n\t\tif (is_array($this->appConf['js.']['config.'])) {\n\t\t\t$configArray = array();\n\t\t\tforeach ($this->appConf['js.']['config.'] as $key => $val) {\n\t\t\t\t$configArray[] = trim($key) . ': ' . trim($val);\n\t\t\t}\n\t\t\t$config = implode(', ',$configArray);\n\t\t}\n\t\t\t// additional headers as css & js\n\t\t$GLOBALS['TSFE']->additionalHeaderData['contentcoverflow'] .= '\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['core.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['more.']['file'] . '\"></script>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\" src=\"' . $this->appConf['js.']['mod.']['file'] . '\"></script>\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->appConf['css.']['file'] . '\" />\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t/* <![CDATA[ */\n\t\t\t\tvar myMooFlowPage = {\n\t\t\t\t\tstart: function(){\n\t\t\t\t\t\tvar mf = new MooFlow($(\\'MooFlow\\'), {\n\t\t\t\t\t\t\t' . $config . ',\n\t\t\t\t\t\t\t\\'onClickView\\': function(obj){\n\t\t\t\t\t\t\t\tmyMooFlowPage.link(obj);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\\'onStart\\': function(){\n\t\t\t\t\t\t\t\tthis.autoPlay = this.auto.periodical(this.options.interval, this);\n\t\t\t\t\t\t\t\tthis.isAutoPlay = true;\n\t\t\t\t\t\t\t\tthis.fireEvent(\\'autoPlay\\');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\n\t\t\t\t\tlink: function(result){\n\t\t\t\t\t\tif (result.target == \"_blank\") {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = result.href;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\twindow.addEvent(\\'domready\\', myMooFlowPage.start);\n\n\t\t\t\t/* ]]> */\n\t\t\t</script>\n\t\t';\n\t}", "function add_html () {\n //Adds a html block\n return '<div class=\"black\">Lorem ipsum dolor</div>';\n }", "static public function NavBarBottom() {\n\t\t$show_back = (strlen(self::$prev_page) > 0);\n\t\t$show_next = (strlen(self::$next_page) > 0);\n\n\t\techo '<p class=\"center\">';\n\t\tif ($show_back) {\n\t\t\techo '<a href=\"', self::$prev_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" title=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" class=\"arrow_left {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_left.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '<a href=\"#top\">';\n\t\techo '<img alt=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" title=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" class=\"arrow_up {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_up.png\" width=\"15\" height=\"22\" />';\n\t\techo '</a>';\n\t\tif ($show_next) {\n\t\t\techo '<a href=\"', self::$next_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" title=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" class=\"arrow_right {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_right.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '</p>';\n\t}", "private function row_foot() {\n\t\t\t\n\t\t$row_foot = '<div class=\"adv_listing_mid\"><hr class=\"listing_divisor\" /></div>'.LB;\n\t\t\t\n\treturn $row_foot;\n\t}", "function magazinevibe_edge_get_footer_bottom() {\n\n\t\t$parameters = array();\n\n\t\t$parameters['footer_in_grid'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? true : false;\n $parameters['footer_bottom_classes'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? '' : 'edgtf-footer-top-full';\n\t\t$parameters['footer_bottom_columns'] = magazinevibe_edge_options()->getOptionValue('footer_bottom_columns');\n\n\t\tmagazinevibe_edge_get_module_template_part('templates/parts/footer-bottom', 'footer', '', $parameters);\n\t}", "function html_body($html) {\n\t\tif (strpos($html, '<body') !== false) {\n\t\t\t$html = substr($html, strpos($html, '<body')+5);\n\t\t\t$html = substr($html, strpos($html, '>')+1);\n\t\t\t$html = substr($html, 0, strpos($html, '</body>'));\n\t\t}\n\t\treturn $html;\n\t}", "public function getFooter()\n {\n return <<<EOF\n\n<info>\nFinished. \n</info>\n\n\nEOF;\n\n}", "function do_html_footer()\r\n{\r\n?>\r\n </body>\r\n </html>\r\n<?\r\n}", "function do_html_footer()\r\n{\r\n?>\r\n </body>\r\n </html>\r\n<?\r\n}", "function htmlPageStart($params){\n\n $str = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html>\n <head>\n <title>';\n $str .= $params['pageStartMainTitle'];\n $str .= '</title>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"' . $params['pageStartCSS'] . '\"/>';\n $str .= $params['pageStartHeadDataExt'];\n $str .= '\n </head>\n <body>\n <div id=\"main\">\n <div id=\"top\">\n <table class=\"head\">\n <tr>\n <td><div id=\"logo\"><img src=\"' . $params['pageStartLogoURL'] . '\" alt=\"logo BEV\"/></div></td>\n <td><div align=\"right\"><h3>';\n$str .= $params['pageStartVersionRef'];\n$str .= '</h3></div></td>\n </tr>\n </table>\n </div>\n <div id=\"desc\">\n\n <h1>';\n\n$str .= $params['pageStartPageTitle'];\n$str .= '</h1>\n';\n\n return $str;\n}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "public function getHtml();", "function getContentFooter() {\n return '';\n }", "function printBodyHeaders ($top, $second)\n{\n\n echo \"<body bgcolor=#000000>\\n\";\n\techo \"<div id=\\\"fb-root\\\"></div>\\n\";\necho \"<script>(function(d, s, id) {\\n\";\n echo \"var js, fjs = d.getElementsByTagName(s)[0];\\n\";\n echo \"if (d.getElementById(id)) {return;}\\n\";\n echo \"js = d.createElement(s); js.id = id;\\n\";\n echo \"js.src = \\\"//connect.facebook.net/en_US/all.js#xfbml=1\\\";\\n\";\n echo \"fjs.parentNode.insertBefore(js, fjs);\\n\";\necho \"}(document, 'script', 'facebook-jssdk'));</script>\\n\";\n\n\n\n echo \"<body><div id=Content>\\n\";\n echo \"<table width=100%><tr>\";\n echo \"<td valign=top style=\\\"padding-left:100px\\\">\";\n echo \"<a href=\\\"http://coloradofinearts.org\\\"><img align=center src=\\\"customLogo.gif\\\" border=0>\\n\";\n echo \"</td>\";\n\techo \"<td align=left valign=top style=\\\"font-size: 16pt; font-weight: bold; color: darkblue; font-family: Trebuchet MS,Arial Narrow\\\">\nColorado Fine Arts Association (CFAA)<br>\\n\";\n echo \"<div style=\\\"font-size: 8pt;color:#FF8200;font-weight:normal;font-family: Trebuchet MS,Arial Narrow\\\">Enriching Minds Through Enduring Arts</div>\\n\";\n\techo \"<p><div style=\\\"font-size: 9pt; color: #000000; font-weight:normal;font-family: Trebuchet MS,Arial Narrow\\\">A 501(c)(3), Tax Exempt, Non Profit Organization<br>\\n\";\n\techo \"Tax ID: 27-0325446\";\n echo \"<br><a href=\\\"http://colfinearts.blogspot.com\\\" title=\\\"CFAA Blogs\\\" target=\\\"_blank\\\"><img src=\\\"images/blogger.jpg\\\"></a>&nbsp;<a href=\\\"http://twitter.com/colfinearts\\\" title=\\\"Follow Us On Twitter!\\\" target=\\\"_blank\\\"><img src=\\\"pics/icon-twit.png\\\" border=0><a>&nbsp;<a href=\\\"http://www.facebook.com/pages/Colorado-Fine-Arts-Association/142216239170877\\\" title=\\\"Join us at Facebook!\\\" target=\\\"_blank\\\"><img src=\\\"pics/icon-fb.png\\\" border=0></a><br>\";\n\necho \"<!-- AddThis Button BEGIN -->\\n\";\necho \"<div class=\\\"addthis_toolbox addthis_default_style \\\">\\n\";\necho \"<a class=\\\"addthis_button_facebook_like\\\" fb:like:layout=\\\"button_count\\\"></a>\\n\";\necho \"<a class=\\\"addthis_button_tweet\\\"></a>\\n\";\necho \"<a class=\\\"addthis_button_google_plusone\\\" g:plusone:size=\\\"medium\\\"></a>\\n\";\necho \"<a class=\\\"addthis_counter addthis_pill_style\\\"></a>\\n\";\necho \"</div>\\n\";\necho \"<script type=\\\"text/javascript\\\" src=\\\"http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4ea33af50d9ee1f8\\\"></script>\\n\";\necho \"<!-- AddThis Button END -->\\n\";\necho \"</div></td>\";\n echo \"</tr></table>\";\n}", "protected function generatePageFooter() \r\n {\r\n echo <<<HTML\r\n </article>\r\n <script src=\"CityWok.js\"> </script>\r\n </body>\r\n</html>\r\nHTML;\r\n }", "public function xxxFooter() {\n \n include('fixed.php');\n\t\tinclude('data.php'); // Load Testing Data\n \n // Position at 15 mm from bottom\n $this->SetY(-15);\n \n // Set font\n // $this->SetFont('helvetica', 'I', 8);\n // Page number\n $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'R', 0, '', 0, false, 'T', 'M');\n//$this->Cell(-15, 10, 'aaabbbccc', 0, false, 'L', 0, '', 0, false, 'T', 'M'); \n//$this->Arrow(50,210,20,210,1,5,30); \n$foo=rand(0+10,210-10-50);\n\n$this->write1DBarcode($link_url, 'C39', 10, 293, 50, 6, 0.4, $style, 'N');\n$this->write1DBarcode($this->PageNo(), 'EAN2', 170, 293, '', 6, 0.4, $style, 'N');\n\n \n }", "function getHtml() {\r\n\t $html = \"\\n<!-- Begin myTable generated code -->\\n\";\r\n\t $html .= \"\\n<!-- myTable: HEADER -->\\n\";\r\n\t $html .= $this->_getHeaderHtml();\r\n\t $html .= \"\\n<!-- myTable: ROWS -->\\n\";\r\n\t\t$html .= $this->getRowHtml();\r\n\t $html .= \"\\n<!-- myTable: FOOTER -->\\n\";\r\n\t\t$html .= $this->_getFooterHtml();\r\n\t $html .= \"\\n<!-- myTable: SLIDER -->\\n\";\r\n\t\t//$html .= $this->_getSliderHtml();\r\n\t $html .= \"\\n<!-- myTable: SCRIPTS -->\\n\";\r\n\t\t$html .= $this->_getScripts();\r\n\t\t$html .= \"\\n<!-- End myTable generated code -->\\n\";\r\n\r\n\t\treturn $html;\r\n\t}", "public static function smtp_inner () \n { \n $html = null;\n\n $top = __( 'SMTP Send : Message', 'default-message' );\n $inner = self::smtp_inner_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'smtp', $top, $inner, $bottom );\n\n return $html;\n }", "public function writeTop() {}", "function endHTML(){\n echo\"</body>\\n</html>\\n\";\n}", "public function getHTML(): string;", "protected function setFooter() {\n $footer = \"<div class='footer'>\n <center>\n <a href='https://www.linkedin.com/in/ali-mohtasham-a75a2886' >Designed by <strong> Ali Mohtasham Gilani </strong> All rights reserved.</a>\n </center>\n </div>\n \";\n return $footer;\n }", "public function docbookFooter()\n {\n $output = <<<'EOS'\n </tbody>\n </tgroup>\n</table>\n\n</section>\n<!--\nvim:se ts=4 sw=4 et:\n-->\n\nEOS;\n\n return $output;\n }", "public function pre_close_body($h)\n {\n \n }", "function parseBody() {\r\n $count = count($this->body);\r\n for ($i = 0; $i < $count; $i++) {\r\n if ($this->html)\r\n $content.= \"<b>\";\r\n $content .= $this->body[$i][\"key\"] . ': ';\r\n if ($this->html)\r\n $content.= \"</b>\";\r\n if ($this->html)\r\n $content .= nl2br($this->body[$i][\"value\"]) . \"\\n\";\r\n else\r\n $content .= $this->body[$i][\"value\"];\r\n if ($this->html)\r\n $content.= \"<hr noshade size=1>\\n\";\r\n else\r\n $content.= \"\\n\" . str_repeat(\"-\", 80) . \"\\n\";\r\n }\r\n\r\n $this->body = $content;\r\n }", "function getHTML()\n {\n $show = true;\n $HTML = \"\n <div class='$this->size own-padding'>\n <div class='panel col-sm-12'>\n <header id='$this->headID' class='panel-heading'>\n $this->title\n <div class='panel-actions'>\n <a id='$this->buttonID' class='btn-minimize'>\n <i class='fa'><span class='arrow_up'/></i>\n </a>\n </div>\n </header>\n\n <div id='$this->bodyID' class='panel-body'>\n $this->content\n </div>\n </div>\n </div>\n\";\n\n\n if( $this->content == \"\"){\n $HTML = \"\";\n Errorlist::publicAddError(4,1);\n $show = false;\n }\n\n if( $this->title == \"\"){\n Errorlist::publicAddError(5,1);\n }\n\n if( $this->size == \"\"){\n Errorlist::publicAddError(6,1);\n $HTML = \"\";\n $show = false;\n }\n\n if($show){\n InitJSObjects::initObject($this->panelID, 'Panel', \"'$this->headID','$this->bodyID','$this->buttonID'\");\n EventHandler::newEvent(\"$this->buttonID\", \"function(){ $this->panelID.minMax() }\", \"click\");\n }\n\n\n return $HTML;\n }", "public function buildFooterNavigation()\n\t{\n\t\t//Reset the current object\n\t\t$this->resetNavigation();\n\n\t\t//Get all pages and child pages\n\t\t$navigation = $this->buildNavHierachy(new UnorderedList(), -1);\n\n\t\t//Convert and return\n\t\treturn $navigation->toHtml();\n\t}", "function TopIndexPage2()\n{\n\techo('<td valign=\"top\"><table width=\"100%\" border=\"1\" class=\"deco\" bordercolor=\"#0099FF\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<td height=\"334\" valign=\"top\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"e6f3fc\">');\n\techo('<tr>');\n\techo('<td width=\"278\" height=\"336\" valign=\"top\"><table background=\"image/tintucsukien.jpg\" ');\n\techo('width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<tr>');\n\techo('<td width=\"30\" height=\"52\">&nbsp;</td>');\n\techo('<td width=\"212\">&nbsp;</td>');\n\techo('<td width=\"36\">&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"253\">&nbsp;</td>');\n\techo('<td valign=\"top\">');\n\t///////////////////////////////////CAC TIN MOI NHAT\n\t$str1=\"select * from news where approval=1 order by date desc,newsid desc\";\n\t$result=mysql_query($str1) or\n\tdie(mysql_error());\n\t$i=0;\n\t$s=\"\";\n\twhile ($row=mysql_fetch_array($result))\n\t{\n\t\t$i=$i+1;\n\t\t$s=$s.$row['title'];\n\t\techo(\"<img src='image/newspoint.jpg' />&nbsp;&nbsp;\");\n\t\techo(\"<a alt='\".$row['abstract'].\"' title='\".$row['abstract']);\n\t\techo(\"' href='newsdetail.php?newsid=\".$row['newsid'].\"&id=\".$row['newsgroup'].\"' class='newstitle\");\n\t\techo(template());echo(\"'>\".$row['title'].\"</a>\");\n\t\techo(\"<br>\");echo(\"<img class='newsline' src='image/newsline.jpg' />\");\n\t\techo(\"<br>\");\n\t\tif ((strlen($s)>250)) break;\n\t}\n\tmysql_free_result($result);\n\techo('&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"31\">&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\t\n\t\n\techo('</table></td>');\n\techo('<td width=\"15\">&nbsp;</td>');\n\techo('<td width=\"278\" valign=\"top\"><table background=\"image/lich.jpg\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">');\n\techo('<tr>');\n\techo('<td width=\"29\" height=\"52\">&nbsp;</td>');\n\techo('<td width=\"212\">&nbsp;</td>');\n\techo('<td width=\"37\">&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"253\">&nbsp;</td>');\n\techo('<td valign=\"top\">');\n\t///////////////////////////////////LICH CONG TAC TUAN\n\t$timestamp = time(); \n\tif (date('l',$timestamp)=='Monday')\n\t$start_date=date(\"Y-m-d\", strtotime(\"this monday\", $timestamp));\n\telse\n\t$start_date=date(\"Y-m-d\", strtotime(\"last monday\", $timestamp)); \n\t$end_date=$newdate = date(\"Y-m-d\",strtotime ( \"+6 day\" , strtotime ( $start_date ) ) );\n\t$str1=\"select * from timetable where approval=1 and date>='\";\n\t$str1.=$start_date.\"' and date<='\".$end_date.\"' order by date\";\n\t$result=mysql_query($str1) or\n\tdie(mysql_error());\n\t$i=0;\n\techo(\"<marquee height='230' onmouseover=this.stop() onmouseout=this.start() \");\n\techo(\"scrollamount='1' scrolldelay='80' truespeed='true' direction=up>\");\n\techo(\"<div class='topnews'>\");\n\t\n\t$s=\"\";$d=\"\";\n\twhile ($row=mysql_fetch_array($result))\n\t{\n\t\t$i=$i+1;\n\t\tif ($d!=$row['date'])\n\t\t{\n\t\t\tif (strlen($d)>0) $s.=\"<br><br>\";\n\t\t\t$s.=\"<a href='timetable.php' class='newstitlelink\".template().\"'>\";\n\t\t\t$s.=\"Ngày \".date ('d-m-Y',strtotime($row['date'])).\"</a>\";\n\t\t}\n\t\t$d=$row['date'];\n\t\t$s.=\"<br><img src='image/newspoint.jpg' />&nbsp;<a class='newstitle\".template().\"' href='timetable.php'>\";\n\t\t$s.=$row['task'].\" (\".$row['chairman'];\n\t\tif (strlen($row['chairman'])>0) $s.=\", \";\n\t\t$s.=$row['attendant'].\")</a>\";\n\t}\n\techo($s);\n\techo(\"</div></marquee>\");\t\t\t\t\n\tmysql_free_result($result);\n\techo('&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\techo('<tr>');\n\techo('<td height=\"31\">&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('<td>&nbsp;</td>');\n\techo('</tr>');\n\t\n\techo('</table></td>');\n\techo('</tr>');\n\t\n\techo('</table></td>');\n\techo('</tr>');\n\techo('</table></td>');\n}", "function build_email_txt_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= 'Thanks,'.\"\\n\".\n\t\t\t\t'One nutty fan.';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "function to_the_top()\r\n{\r\n return \"\\n \"\r\n . \"<div style=\\\"text-align: right;\\\">\\n\"\r\n . \"<a href=\\\"#top\\\">\"\r\n . \"<img src=\\\"\".base_url().\"images/go-up.png\\\" \"\r\n . \"border=\\\"0\\\" style=\\\"vertical-align: middle;\\\"> \" . T_('go_up')\r\n . \"</a>\\n\"\r\n . \"</div>\\n\\n\";\r\n}", "function print_html_top() {\r\n\t\techo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">' .\r\n\t\t\t\"\\n<html>\";\r\n\t}", "function htmlFoot() {\r\n?>\r\n </div>\r\n </div>\r\n <div id=\"push\"></div>\r\n</div>\r\n<div id=\"footer\">\r\n</div>\r\n</body>\r\n</html>\r\n<?php\r\n}", "function _wp_get_foot(){\n $msg=\"</SOAP-ENV:Body>\n\t\t\t\t</SOAP-ENV:Envelope>\t\n \t\";\n return $msg;\n }", "private function getFooter() {\n\t\t$this->data['oxfooter']\t= \"\\n\"\n\t\t. '<!-- Module ' . ucfirst( $this->_name )\n\t\t.' v.'. $this->_version . ' by http://osworx.net (c) '\n\t\t. date('Y')\n\t\t. ' -->' . \"\\n\";\n\t}", "protected static function displayHtmlBody()\n {\n $strServerUrlRequestContext = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' .\n \"{$_SERVER['HTTP_HOST']}/{$_SERVER['REQUEST_URI']}\";\n\n $strDateTimeContext = date('Y-m-d H:i:s');\n $strFilePathContext = self::$arrBacktrace['file'];\n $intLineContext = self::$arrBacktrace['line'];\n\n $strFileContent = file_get_contents(self::$strTemplateFile);\n $strHtmlContent = str_replace('@debugcontext', self::$prettyDebugContext, $strFileContent);\n $strHtmlContent = str_replace('@filepathcontext', $strFilePathContext, $strHtmlContent);\n $strHtmlContent = str_replace('@linecontext', $intLineContext, $strHtmlContent);\n $strHtmlContent = str_replace('@serverurlrequest', $strServerUrlRequestContext, $strHtmlContent);\n $strHtmlContent = str_replace('@datetimecontext', $strDateTimeContext, $strHtmlContent);\n\n $intExecutionTimeContext = microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n $strHtmlContent = str_replace('@executiontimecontext', $intExecutionTimeContext, $strHtmlContent);\n $intMemoryUsageContext = memory_get_peak_usage();\n $strHtmlContent = str_replace('@memoryusagecontext', $intMemoryUsageContext, $strHtmlContent);\n return $strHtmlContent;\n }", "public static function help_inner () \n { \n $html = null;\n\n $top = __( 'Instruction Manual', 'label' );\n $inner = self::help_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'help', $top, $inner, $bottom );\n\n return $html;\n }", "private function displayFooter()\n {\n\n $html = '</div>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n $html .= '<div id=\"footer\">' . \"\\n\";\n $html .= '<ul>' . \"\\n\";\n $html .= '<li>&copy; Volition 2012</li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=home\">Home</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=home\">My Profile</a></li>' . \"\\n\";\n if (!$this->model->userLoggedIn) {\n $html .= '<li><a href=\"index.php?page=register\">Register</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=login\">Login</a></li>' . \"\\n\";\n }\n $html .= '<li><a href=\"index.php?page=browse\">Browse</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=about\">About</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=contact\">Contact</a></li>' . \"\\n\";\n $html .= '</ul>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n $html .= '<script type=\"text/javascript\" src=\"js/search.js\"></script>';\n $html .= '</body>' . \"\\n\";\n $html .= '</html>' . \"\\n\";\n\n return $html;\n }", "public static function manager_inner () \n { \n $html = null;\n\n $top = self::manager_inner_top();\n $inner = self::manager_inner_center();\n $bottom = self::manager_inner_bottom();\n\n $html .= self::page_body( 'manager', $top, $inner, $bottom );\n\n return $html;\n }", "function RBTM_RelPost_baseline_html() {\n\t// Set up container etc\n\t$baseline = '<section id=\"related-posts\" class=\"related-posts\">';\n\t$baseline .= '<a href=\"#\" class=\"get-related-posts\">Get related posts</a>';\n \t$baseline .= '<div class=\"ajax-loader\"><img src=\"' . plugin_dir_url( __FILE__ ) . 'css/spinner.svg\" width=\"32\" height=\"32\" /></div>';\n\t$baseline .= '</section><!-- .related-posts -->';\n\n\treturn $baseline;\n}", "public function getShortFooter() {\n\t\t$footer = '© ' . date('Y') . ' <a href=\"' . $this->getBaseUrl() . '\" target=\"_blank\">' . $this->getEntity() . '</a>' .\n\t\t\t'<br/>' . $this->getSlogan();\n\n\t\treturn $footer;\n\t}", "function html_footer() {\n\n echo \"</BODY>\\n</HTML>\";\n\n}", "function buildHTMLPage($body) {\n return \"<!DOCTYPE html>\" .\n \"<html>\" .\n \"<head>\" .\n \"<link rel='stylesheet' href='./style.css' type='text/css' media='all'>\" .\n \"<title>Superhero App</title>\" .\n \"</head>\" .\n \"<header class='header-nav'>\" .\n \"<h1>Superhero Database</h1>\" .\n \"<div class='navbar-default'>\" .\n \"<li><a href='superheros.php'>Superheros</a></li>\" .\n \"<li><a href='villians.php'>Villians</a></li>\" .\n \"<li><a href='alteregos.php'>Alter Egos</a></li>\" .\n \"<li><a href='comiccompanies.php'>Comic Companies</a></li>\" .\n \"<li><a href='teamavgpower.php'>Teams' Average Power</a></li>\" .\n \"<li><a href='herocompanyhqs.php'>Heros' Comic Company HQs</a></li>\" .\n \"<li><a href='heroalterego.php'>Heros' Alter Egos</a></li>\" .\n \"<li><a href='strongvillians.php'>Strong Villians</a></li>\" .\n \"<li><a href='marvelcharacters.php'>Marvel Characters</a></li>\" .\n \"</div>\" .\n \"</header>\" .\n \"<body>\" .\n $body .\n \"</body>\" .\n \"</html>\";\n}" ]
[ "0.76424545", "0.73680514", "0.6993539", "0.698574", "0.69126433", "0.68041354", "0.6747653", "0.666309", "0.66619563", "0.6633017", "0.6595982", "0.6534183", "0.64448845", "0.64385897", "0.63487357", "0.6338072", "0.62932634", "0.62653387", "0.6229789", "0.616888", "0.6164107", "0.6114008", "0.6041329", "0.60119927", "0.59987205", "0.5996082", "0.59877837", "0.59877837", "0.59683466", "0.59331936", "0.59169734", "0.5895859", "0.5889742", "0.58749264", "0.5869954", "0.58684075", "0.5855121", "0.58540964", "0.5848703", "0.5843053", "0.5841125", "0.5811556", "0.580616", "0.5796761", "0.57908726", "0.5773803", "0.57610273", "0.5752867", "0.5735882", "0.5721498", "0.57208496", "0.57134503", "0.5712962", "0.57096046", "0.57037395", "0.5694935", "0.5686938", "0.5651494", "0.5645504", "0.56386346", "0.5637747", "0.56296694", "0.5609551", "0.5603553", "0.55899006", "0.55899006", "0.5584271", "0.5583105", "0.5583105", "0.5573809", "0.5565508", "0.55642444", "0.55605036", "0.5553386", "0.554249", "0.553858", "0.55331564", "0.5527102", "0.5506693", "0.5484502", "0.54766655", "0.54689777", "0.5467138", "0.54644686", "0.5461301", "0.54582953", "0.54539394", "0.54492944", "0.5447646", "0.5445805", "0.54433906", "0.54405135", "0.5438829", "0.54336405", "0.5421357", "0.5416639", "0.5416534", "0.54155487", "0.54048395", "0.5403282" ]
0.75811625
1
end function finalizeBottomSection /This function returns the bottom html to the calling class.
function getBottomHTML() { return $this->_bottomHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalizeBottomHTML() {\n\t\t$returnVal = \"\";\n\t\t$returnVal .= \"</div>\\n\"; // Closes Container\n\t\t$returnVal .= \"</body>\\n\";\n\t\t$returnVal .= \"</html>\\n\";\n\t\t$this->_bottomHTML = $returnVal;\n\t}", "function Get_Standard_Bottom_Section_HTML()\n {\n $HTML = \"\";\n //$HTML .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $HTML .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $HTML .= \"</div>\";\n $HTML .= Get_File_Contents(__DIR__.\"/../../static_html/standard_footer.html\");\n return $HTML;\n }", "private function renderBottom() {\n\t\t$bottom = '';\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$bottom .= $this->closeTag('channel');\n\t\t\t$bottom .= $this->closeTag('rss');\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$bottom .= $this->closeTag('rdf:RDF');\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$bottom .= $this->closeTag('feed');\n\t\t}\n\t\treturn $bottom;\n\t}", "public function getHtmlFooterSection()\n\t{\n\t\tif( in_array( $this->m_common->m_env, Common::constructionEnvironments() ) )\n\t\t{\n\t\t\t$footer_content = '';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$footer_content = '\n\t\t\t<div style=\"position:relative;float:left;\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://facebook.com/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_facebook_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://forrst.me/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_forrst_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://www.linkedin.com/in/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_linkedIn_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://twitter.com/#!/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_twitter_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t&copy;&nbsp;2011 Cole Hafner\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div style=\"position:relative;float:right;\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td align=\"right\">\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\tShortcuts:\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&uarr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&rarr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&darr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&larr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\tShift\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"clear\"></div>\n\t\t\t';\n\t\t}\n\t\t\n\t\t\n\t\t$return = '\n\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--/content section-->\n\t\t\t\n\t\t\t<!--footer section-->\n\t\t\t<div class=\"footer_section bg_tan\">\n\t\t\t\t<div class=\"container_12\">\n\t\t\t\t\t<div class=\"grid_12\">\n\t\t\t\t\t\t' . $footer_content . '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--/footer section-->\n\t\t\t\n\t\t</div>\n\t\t<!--page wrapper-->\n\t\t\n\t\t<iframe class=\"input text_input\" style=\"height:200px;width:600px;margin:20px auto 20px auto;display:none;\" id=\"hidden_frame\" name=\"hidden_frame\" ></iframe>\n\t\t';\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "function Get_Standard_Bottom_Section_HTML()\n{\n $html = \"\";\n //$html .= Get_File_Contents(\"static_html/stfc_footer.html\");\n $html .= \"</div>\";\n // empty div so that page container is\n // correct size\n\n // end page container\n $html .= \"</div>\";\n $html .= Get_File_Contents(__DIR__ . \"/../../static_html/standard_footer.html\");\n return $html;\n}", "public function getFooter();", "public function getFooter();", "public function bottomScripts() {\n\t\t$analytics = $this->getAnalyticsCode();\n\t\t$bottomScriptText = parent::bottomScripts();\n\n\t\t$html = <<<HTML\n<!-- WikiaBottomScripts -->\n$bottomScriptText\n<!-- /WikiaBottomScripts -->\n$analytics\n<div id=\"positioned_elements\"></div>\nHTML;\n\n\t\treturn $html;\n\t}", "abstract protected function footer();", "abstract protected function footer();", "public function addFooter(){\n\n$this->page .= <<<EOD\n<pre>\n$this->title\n</pre>\n</body>\n</html>\nEOD;\n}", "function finalizeTopSection() {\n\t$returnVal = \"\";\n\t$returnVal .= '<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css\" integrity=\"sha384-TX8t27EcRE3E/ihU7zmQxVncDAy5uIKz4rEkgIXeM>';\n\t$returnVal .= \"<!doctype html>\\n\";\n\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t$returnVal .= \"<head><title>\";\n\t$returnVal .= $this->_title;\n\t$returnVal .= \"</title>\\n\";\n $returnVal .= $this->_headSection;\n\t$returnVal .= \"</head>\\n\";\n\t$returnVal .= \"<body>\\n\";\n\n\t$this->_top = $returnVal;\n\n}", "public function drawFooter() {\n\t\t\t// Is there scope for using Smarty or similar here?\n\t\t\t$html = '';\n\t\t\treturn $html;\n\t\t}", "protected function makeFooter()\n {\n }", "public static function getFooter()\n {\n ?>\n <p>Content in the front end's footer. This code comes from <?php echo __METHOD__; ?></p>\n <?php\n }", "function build_email_html_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t<br>\n\t\t\t\t\t<br>\n\t\t\t\t\t<p><font color=\"ffd700\">Thanks,\n\t\t\t\t\t<br>\n\t\t\t\t\tOne nutty fan.</font></p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</body>\n</html>';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "private function generate_html_footer()\n {\n $html = \"]; function show_details(test) { var details = document.getElementById(\\\"detail\\\"); details.style.display = \\\"block\\\"; document.getElementById(\\\"test_name\\\").innerText = test.name; document.getElementById(\\\"input\\\").innerText = test.input; document.getElementById(\\\"parse_output\\\").innerText = test.parse_output; document.getElementById(\\\"interpret_input\\\").innerText = test.interpret_input; document.getElementById(\\\"ref_output\\\").innerText = test.ref_output; document.getElementById(\\\"interpret_output\\\").innerText = test.interpret_output; document.getElementById(\\\"ref_return_code\\\").innerText = test.ref_return_code; document.getElementById(\\\"parse_return_code\\\").innerText = test.parse_return_code; document.getElementById(\\\"interpret_return_code\\\").innerText = test.interpret_return_code; var status_text = document.getElementById(\\\"status_text\\\"); if(test.success == true){ status_text.innerText = \\\"PASSED\\\"; status_text.className = \\\"status_text_pass\\\"; } else { status_text.innerText = \\\"FAILED\\\"; status_text.className = \\\"status_text_failed\\\"; } } function create_row(test,row) { var table = document.getElementsByTagName('tbody')[0]; var row = table.insertRow(row); var cell = row.insertCell(0); cell.textContent = test.name; cell.addEventListener(\\\"click\\\",function(){show_details(test)}); cell.className = \\\"test-name\\\"; cell = row.insertCell(1); cell.className = \\\"status \\\"; if(test.success == true){ cell.className += \\\"success\\\"; } else { cell.className += \\\"failed\\\"; } } for(var i = 0; i < tests.length;i++){ create_row(tests[i],i) } document.getElementById(\\\"correct\\\").innerText = \" . $this->correct_test . \";document.getElementById(\\\"all\\\").innerText = \" . $this->all_test . \"; </script> </html>\";\n return $html;\n }", "function finalizeTopHTML() {\n\t\t$returnVal = \"\";\n\t\t$returnVal .= \"<!doctype html>\\n\";\n\t\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t\t$returnVal .= \"<head><title>\";\n\t\t$returnVal .= $this->_title;\n\t\t$returnVal .= \"</title>\\n\";\n\t\t$returnVal .= $this->_headSection; \n\t\t$returnVal .= \"</head>\\n\";\n\t\t$returnVal .= \"<body>\\n\";\n\t\t$returnVal .= \"<div id='container'>\\n\";\n\t\t$this->_topHTML = $returnVal;\n\t}", "private function row_foot() {\n\t\t\t\n\t\t$row_foot = '<div class=\"adv_listing_mid\"><hr class=\"listing_divisor\" /></div>'.LB;\n\t\t\t\n\treturn $row_foot;\n\t}", "function build_html_table_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t</table>';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function getFooter()\n {\n return <<<EOF\n\n<info>\nFinished. \n</info>\n\n\nEOF;\n\n}", "function magazinevibe_edge_get_footer_bottom() {\n\n\t\t$parameters = array();\n\n\t\t$parameters['footer_in_grid'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? true : false;\n $parameters['footer_bottom_classes'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? '' : 'edgtf-footer-top-full';\n\t\t$parameters['footer_bottom_columns'] = magazinevibe_edge_options()->getOptionValue('footer_bottom_columns');\n\n\t\tmagazinevibe_edge_get_module_template_part('templates/parts/footer-bottom', 'footer', '', $parameters);\n\t}", "private function generateFoot(){\n echo '</div>';\n echo '</div>';\n }", "abstract protected function getHtmlBody();", "function getContentFooter() {\n return '';\n }", "private function generateFoot() {\n echo '</div>';\n }", "function boxBottom() {\n\t\treturn html_ac(html_ap() -1).'<!-- class=\"box-surround\" -->'.\"\\n\";\n\t}", "function udesign_bottom_section_bottom() {\r\n do_action('udesign_bottom_section_bottom');\r\n}", "public function standard_footer_html() {\n global $CFG, $SCRIPT;\n\n // This function is normally called from a layout.php file in {@link core_renderer::header()}\n // but some of the content will not be known until later, so we return a placeholder for now.\n // This will be replaced with the real content in {@link core_renderer::footer()}.\n $output = $this->unique_performance_info_token;\n if ($this->page->devicetypeinuse == 'legacy') {\n // The legacy theme is in use print the notification\n $output .= html_writer::tag('div', get_string('legacythemeinuse'), array('class'=>'legacythemeinuse'));\n }\n // Get links to switch device types (only shown for users not on a default device)\n $output .= $this->theme_switch_links();\n\n if (!empty($CFG->debugpageinfo)) {\n $icon = 'fa fa-cogs';\n $text = 'This page is ';\n $itag = html_writer::tag('i', '', array('class' => $icon));\n $output .= html_writer::tag('div', $itag . $text . $this->page->debug_summary(), array('class' => 'performanceinfo pageinfo well'));\n }\n if (debugging(null, DEBUG_DEVELOPER) and has_capability('moodle/site:config', context_system::instance())) { // Only in developer mode\n // Add link to profiling report if necessary\n if (function_exists('profiling_is_running') && profiling_is_running()) {\n $txt = get_string('profiledscript', 'admin');\n $title = get_string('profiledscriptview', 'admin');\n $url = $CFG->wwwroot . '/admin/tool/profiling/index.php?script=' . urlencode($SCRIPT);\n $link = html_writer::link($url, $txt, array('title' => $title));\n $output .= html_writer::tag('div', $link, array('class' => 'profilingfooter'));\n }\n $output .= html_writer::start_tag('div', array('class' => 'purgecaches'));\n $output .= html_writer::link(new moodle_url('/'.$CFG->admin.'/purgecaches.php?confirm=1&amp;sesskey='.sesskey()), html_writer::tag('i', '', array('class' => 'fa fa-trash-o')). '&nbsp;&nbsp;'.get_string('purgecaches', 'admin'), array('class' => 'btn btn-small'));\n $output .= html_writer::end_tag('div');\n\n\n }\n if (!empty($CFG->debugvalidators)) {\n // NOTE: this is not a nice hack, $PAGE->url is not always accurate and $FULLME neither, it is not a bug if it fails. --skodak\n $output .= '<div class=\"validators\"><ul>\n <li><a class=\"btn btn-small btn-info\" href=\"http://validator.w3.org/check?verbose=1&amp;ss=1&amp;uri=' . urlencode(qualified_me()) . '\"><i class=\"fa fa-cogs\"></i>&nbsp;&nbsp;Validate HTML</a></li>\n <li><a class=\"btn btn-small btn-info\" href=\"http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&amp;url1=' . urlencode(qualified_me()) . '\"><i class=\"fa fa-cogs\"></i>&nbsp;&nbsp;Section 508 Check</a></li>\n <li><a class=\"btn btn-small btn-info\" href=\"http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=0&amp;warnp2n3e=1&amp;url1=' . urlencode(qualified_me()) . '\"><i class=\"fa fa-cogs\"></i>&nbsp;&nbsp;WCAG 1 (2,3) Check</a></li>\n </ul><br /></div>';\n }\n if (!empty($CFG->additionalhtmlfooter)) {\n $output .= \"\\n\".$CFG->additionalhtmlfooter;\n }\n return $output;\n }", "protected abstract function generateHtmlBody() : string;", "public function printFooterContent() {\n\t\techo '<ul>';\n\t\tif (! $this->isActive ( PageState::Selection ))\n\t\t\techo '<li class=\"', $class, '\"><a href=\"?q=select\">Auswahl</a></li>';\n\t\tif (! $this->isActive ( PageState::Statistics ))\n\t\t\techo '<li class=\"', $class, '\"><a href=\"?q=stats\">Statistik</a></li>';\n\t\tif (! $this->isActive ( PageState::Setup ))\n\t\t\techo '<li class=\"', $class, '\"><a href=\"?q=setup\">Setup</a></li>';\n\t\techo '</ul>';\n\t}", "private function getFooter() {\n\t\t$this->data['oxfooter']\t= \"\\n\"\n\t\t. '<!-- Module ' . ucfirst( $this->_name )\n\t\t.' v.'. $this->_version . ' by http://osworx.net (c) '\n\t\t. date('Y')\n\t\t. ' -->' . \"\\n\";\n\t}", "private function displayFooter(){\n\t\t\t$html = '</div>'.\"\\n\"; //closing main container div\n\t\t\t$html .= '<div id=\"footer\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"wrapper\">'.\"\\n\";\n\t\t\t$html .= '<div class=\"left\">'.\"\\n\";\n\t\t\t$html .= '<h3> Links </h3>'.\"\\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=10\">About</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=9\">Articles</a></li>'.\"\\n\";\t\t\t\t\t\n\t\t\t$html .= '<li><a href=\"feed/\">Rss</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=14\" accesskey=\"4\">Accessibility</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"index.php?p=15\" accesskey=\"5\">Sitemap</a></li>'.\"\\n\";\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\t\t\t\n\t\t\t$html .= '<div class=\"right\">'.\"\\n\";\n\t\t\t$html .= '<h3> Follow </h3>'.\"\\n\";\n\t\t\t$html .= '<ul>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"http://facebook.com\" target=\"_blank\">Facebook</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"http://twitter.com\" target=\"_blank\">Twitter</a></li>'.\"\\n\";\n\t\t\t$html .= '<li><a href=\"feed/\">Rss</a></li>'.\"\\n\";\n\t\t\t$html .= '</ul>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '<p class=\"copyright\">Copyright &copy; '.COPY_RIGHT. ' '. Date('Y').'</p>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</div>'.\"\\n\";\n\t\t\t$html .= '</body>'.\"\\n\";\n\t\t\t$html .= '</html>'.\"\\n\";\n\t\t\treturn $html;\n\t\t}", "public function atBottom() {\n }", "function setFooter(){\n $this->footer.= <<<EOD\n</div>\n</div>\n</body>\n</html>\nEOD;\n }", "protected function setFooter() {\n $footer = \"<div class='footer'>\n <center>\n <a href='https://www.linkedin.com/in/ali-mohtasham-a75a2886' >Designed by <strong> Ali Mohtasham Gilani </strong> All rights reserved.</a>\n </center>\n </div>\n \";\n return $footer;\n }", "public function getEmailFootHtml() { return $this->_emailFootHtml; }", "private function PH_SiteFooter(){\n $res =<<<EOF\n <a href=\"#\">Lorem</a> |\n <a href=\"#\">Ipsum</a> |\n <a href=\"#\">Dolor</a> |\n <a href=\"#\">Sit amet</a> |\n <a href=\"#\">Aliquip</a> \nEOF;\n return $res;\n }", "public function xxxFooter() {\n \n include('fixed.php');\n\t\tinclude('data.php'); // Load Testing Data\n \n // Position at 15 mm from bottom\n $this->SetY(-15);\n \n // Set font\n // $this->SetFont('helvetica', 'I', 8);\n // Page number\n $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'R', 0, '', 0, false, 'T', 'M');\n//$this->Cell(-15, 10, 'aaabbbccc', 0, false, 'L', 0, '', 0, false, 'T', 'M'); \n//$this->Arrow(50,210,20,210,1,5,30); \n$foo=rand(0+10,210-10-50);\n\n$this->write1DBarcode($link_url, 'C39', 10, 293, 50, 6, 0.4, $style, 'N');\n$this->write1DBarcode($this->PageNo(), 'EAN2', 170, 293, '', 6, 0.4, $style, 'N');\n\n \n }", "public function loadJsBodyBottom() {\n\t\t$sessionScripts = $this->sessionData->get('NFWSScriptBodyBottom');\n\t\tif($sessionScripts)\n\t\t{\n\t\t\tsort($sessionScripts);\n\t\t\t$html = '<!-- NFWSScriptBodyBottom -->' . \"\\n\";\n\t\t\tforeach($sessionScripts as $script)\n\t\t\t{\n\t\t\t\t$html .= $script . \"\\n\";\n\t\t\t}\n\t\t\t$html .= '</div>';\n\n\t\t\techo $html;\n\t\t}\n\t}", "function simpleTheme_html_body_footer() {\n if( get_option('simpletheme-html-bottom') ):\n echo get_option('simpletheme-html-bottom');\n endif;\n}", "protected function _renderBodyEnd()\n\t{\n\t\treturn ''\n\t\t\t. \"\\n\" . Html::endTag( 'div' );\n\t}", "public function Footer()\n {\n global $PMF_LANG;\n\n // Set custom footer\n $this->setCustomFooter();\n\n $date = new PMF_Date($this->_config);\n\n $footer = sprintf(\n '(c) %d %s <%s> | %s',\n date('Y'),\n $this->_config->get('main.metaPublisher'),\n $this->_config->get('main.administrationMail'),\n $date->format(date('Y-m-d H:i'))\n );\n\n if (0 < PMF_String::strlen($this->customFooter)) {\n $this->writeHTMLCell(0, 0, '', '', $this->customFooter);\n }\n\n $currentTextColor = $this->TextColor;\n $this->SetTextColor(0, 0, 0);\n $this->SetY(-25);\n $this->SetFont($this->currentFont, '', 10);\n $this->Cell(0, 10, $PMF_LANG['ad_gen_page'].' '.$this->getAliasNumPage().' / '.$this->getAliasNbPages(), 0, 0, 'C');\n $this->SetY(-20);\n $this->SetFont($this->currentFont, 'B', 8);\n $this->Cell(0, 10, $footer, 0, 1, 'C');\n if ($this->enableBookmarks == false) {\n $this->SetY(-15);\n $this->SetFont($this->currentFont, '', 8);\n $baseUrl = 'index.php';\n if (is_array($this->faq) && !empty($this->faq)) {\n $baseUrl .= '?action=artikel&amp;';\n if (array_key_exists($this->category, $this->categories)) {\n $baseUrl .= 'cat='.$this->categories[$this->category]['id'];\n } else {\n $baseUrl .= 'cat=0';\n }\n $baseUrl .= '&amp;id='.$this->faq['id'];\n $baseUrl .= '&amp;artlang='.$this->faq['lang'];\n }\n $url = $this->_config->getDefaultUrl().$baseUrl;\n $urlObj = new PMF_Link($url, $this->_config);\n $urlObj->itemTitle = $this->question;\n $_url = str_replace('&amp;', '&', $urlObj->toString());\n $this->Cell(0, 10, 'URL: '.$_url, 0, 1, 'C', 0, $_url);\n }\n $this->TextColor = $currentTextColor;\n }", "protected function generatePageFooter() \r\n {\r\n echo <<<HTML\r\n </article>\r\n <script src=\"CityWok.js\"> </script>\r\n </body>\r\n</html>\r\nHTML;\r\n }", "function bethel_do_footer_bottom() {\n\tgenesis_widget_area ('footer-bottom', array ('before' => '<div id=\"bethel-header-right-bottom\">', 'after' => '</div>'));\n}", "public function get_footer()\n {\n return <<<EOD\n<div id=\"siteftr\">\n Sitewide Footer\n</div>\n\nEOD;\n }", "public function buildFooterNavigation()\n\t{\n\t\t//Reset the current object\n\t\t$this->resetNavigation();\n\n\t\t//Get all pages and child pages\n\t\t$navigation = $this->buildNavHierachy(new UnorderedList(), -1);\n\n\t\t//Convert and return\n\t\treturn $navigation->toHtml();\n\t}", "function printBottom() {\n\n print\n \n \"\\n</body> \\n\".\n \"</html> \\n\";\n}", "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 }", "protected function footer()\n {\n\n }", "public function renderDivisionFooter(): void;", "function Footer()\n {\n $this->SetY(-15);\n //Select Arial Italic 8\n $this->SetFont('Arial','I',8);\n $this->SetX(86,5);\n $this->Write(5, '[ powered by '.$this->web_str.']',$this->web_str);\n //Print centered page number\n $this->Cell(0,10,$this->page_str.' '.$this->PageNo(),0,0);\n }", "function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}", "public function footer() {\n\t}", "protected function showEndHTML(): self {\n echo <<<HTML\n</body>\n</html>\nHTML;\n\n return $this;\n }", "protected function generatePageFooter() \n {\n\t\t\n\t\techo \"</body>\\n\";\n\t\techo \"</html>\\n\";\n // to do: output common end of HTML code\n }", "private function getFooter(){\n\t$out = <<<EOT\n </body>\n </text>\n</TEI>\nEOT;\n\treturn $out;\t\n}", "function renderFoot()\n {\n return '';\n }", "public function control_panel__add_to_foot()\n\t{\n\t\tif (URL::getCurrent(false) !== '/publish') {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\treturn $this->js->link('section_links');\n\t}", "public function footer()\n {\n }", "function Footer()\n {\n date_default_timezone_set('UTC+1');\n //Date\n $tDate = date('F j, Y, g:i:s a');\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 12);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10,utf8_decode('Page ' . $this->PageNo().' \n CHUYC \n '.$tDate.'\n +237 693 553 454\n '.$this->Image(SITELOGO, 189, 280, 10, 10,'', URLROOT)), 0, 0, 'L');\n }", "function page_end() {\n\t\t$this->tag= \"</body></html>\";\n\t\treturn $this -> tag;\n\t}", "function sloodle_print_footer()\r\n {\r\n global $CFG;\r\n echo \"<p style=\\\"text-align:center; margin-top:32px; font-size:90%;\\\"><a href=\\\"{$CFG->wwwroot}/course/view.php?id={$this->course->id}\\\">&lt;&lt;&lt; \".get_string('backtocoursepage','sloodle').\"</a></h2>\";\r\n sloodle_print_footer($this->course);\r\n }", "public function Footer() {\n $this->SetY(-15);\n // Select helvetica italic 8\n $this->SetFont('helvetica', '', 10);\n // Print current and total page numbers\n\n //$this->Cell(0,10,'Page '.$this->pageNo().'/{nb}',0,0,'C');\n\n $this->Cell(0, 4, 'This document shall be deemed uncontrolled unless labelled \"CONTROLLED\"', 0, 0, 'C');\n $this->ln();\n\n $this->Cell($this->w - ($this->w * 0.51), 4, 'User should verify latest', 0, 0, 'R');\n $this->SetFont('helvetica', 'B', 10);\n $this->Cell(0, 4, ' revision.', 0, 0, 'L');\n $this->ln();\n\n $this->SetFont('helvetica', 'I', 7);\n\n $pageNo = 'Page '.$this->getAliasNumPage().' of '.$this->getAliasNbPages();\n $this->Cell(0, 3, $pageNo, 0, 0, 'R');\n }", "function page_footer()\n\t\t{\n\t\t\t$output = '\t\t\t</div>'; // <!-- end .ace_options_container -->\n\t\t\t$output .= '\t\t\t<div class=\"ace_footer\">';\n\t\t\t$output .= \t\t\t$this->hidden_data();\n\t\t\t$output .= '\t\t\t<span class=\"ace_loading\"></span>';\n\t\t\t$output .= '\t\t\t\t<ul class=\"ace_footer_links\">';\n\t\t\t$output .= '\t\t\t\t\t<li class=\"ace_footer_reset\">'.$this->reset_button().'</li>';\n\t\t\t$output .= '\t\t\t\t\t<li class=\"ace_footer_save\">'.$this->save_button().'</li>';\n\t\t\t$output .= '\t\t\t\t</ul>';\n\t\t\t$output .= '\t\t\t</div>';\n\t\t\t$output .= '\t\t</div>'; // <!--end ace_options_page_content-->\n\t\t\t$output .= '\t\t<div class=\"ace_clear\"></div>';\n\t\t\t$output .= '\t</div>'; //<!--end ace_options_page_inner-->\n\t\t\t$output .= '</form>'; // <!-- end #ace_options_page -->\n\t\t\t$output .= '<div class=\"ace_bottom_shadow\"></div>';\n\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "public function getShortFooter() {\n\t\t$footer = '© ' . date('Y') . ' <a href=\"' . $this->getBaseUrl() . '\" target=\"_blank\">' . $this->getEntity() . '</a>' .\n\t\t\t'<br/>' . $this->getSlogan();\n\n\t\treturn $footer;\n\t}", "function Footer()\n {\n $this->SetY(-15);\n\n // Police Arial italique 8\n $this->SetFont('Arial','I',6);\n // Num?ro de page\n $this->Cell(0,8,'Page '.$this->PageNo().'/{nb}',0,0,'C');$this->Ln(3);\n $this->Cell(0,8,\"Algerian Gulf Life Insurance Company, SPA au capital social de 1.000.000.000 de dinars algériens, 01 Rue Tripoli, Hussein Dey Alger, \",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"RC : 16/00-1009727 B 15 NIF : 001516100972762-NIS :0015160900296000\",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"Tel : +213 (0) 21 77 30 12/14/15 Fax : +213 (0) 21 77 29 56 Site Web : www.aglic.dz \",0,0,'C');\n }", "public function Footer(){\n // Posición: a 1,5 cm del final\n $this->SetY(-20);\n // Arial italic 8\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',10);\n $this->SetTextColor(50,50,50);\n // Número de págin\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode('Generado por GetYourGames'),0,0,\"R\");\n $this->Ln(4);\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode(date(\"d-m-Y g:i a\").' - Página ').$this->PageNo(),0,0,\"R\");\n\n }", "function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}", "function Footer()\n {\n $this->SetY(-15);\n // Police Arial italique 8\n $this->SetFont('Arial','I',6);\n // Num?ro de page\n $this->Cell(0,8,'Page '.$this->PageNo().'/{nb}',0,0,'C');$this->Ln(3);\n $this->Cell(0,8,\"Algerian Gulf Life Insurance Company, SPA au capital social de 1.000.000.000 de dinars algériens, 01 Rue Tripoli, Hussein Dey Alger, \",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"RC : 16/00-1009727 B 15 NIF : 001516100972762-NIS :0015160900296000\",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"Tel : +213 (0) 21 77 30 12/14/15 Fax : +213 (0) 21 77 29 56 Site Web : www.aglic.dz \",0,0,'C');\n }", "private function generateHtmlFooter() \n {\n $now = new \\DateTime();\n return '<footer>report generated on ' . $now->format('d-m-Y') . ' at ' . $now->format('H:i:s') . '</footer>';\n }", "function get_html_pre_page_end();", "function adminFooter()\n {\n return \"\";\n }", "function Footer()\n\t\t\t\t{\n\t\t\t\t\t$this->SetY(-15);\n\t\t\t\t\t//Arial italic 8\n\t\t\t\t\t$this->SetFont('Helvetica','I',8);\n\t\t\t\t\t//Page number\n\t\t\t\t\t$this->Cell(0,10,'Page '.$this->PageNo().'/'.$comp_name,'T',0,'C');\n\t\t\t\t\t$this->SetDrawColor(8, 102, 198);\n\t\t\t\t\tparent::Footer();\n\t\t\t\t}", "public function getFooterHTML()\n\t{\n\t\tif(!is_array($this->elements['footer'])){\n\t\t\t// Footers are optional\n\t\t\treturn false;\n\t\t}\n\n\t\t# Add the required Bootstrap footer class very first\n\t\t$this->elements['footer']['class'] = str::getAttrArray($this->elements['footer']['class'], \"modal-footer\", $this->elements['footer']['only_class']);\n\n\t\t# Styles\n\t\t$this->elements['footer']['style'] = str::getAttrArray($this->elements['footer']['style'], NULL, $this->elements['footer']['only_style']);\n\n\t\t# Dropdown buttons\n\t\tif($this->elements['footer']['buttons']){\n\t\t\t$buttons = Button::get($this->elements['footer']);\n\t\t}\n\n\t\t# Button(s) in a row\n\t\t$button = Button::generate($this->elements['footer']['button']);\n\n\t\tif($button){\n\t\t\t$button = \"<div class=\\\"btn-float-right\\\">{$button}</div>\";\n\t\t}\n\n\t\t# Icon\n\t\t$icon = Icon::generate($this->elements['footer']['icon']);\n\n\t\t# Badge\n\t\t$badge = Badge::generate($this->elements['footer']['badge']);\n\n\t\t# ID\n\t\t$id = str::getAttrTag(\"id\", $this->elements['footer']['id']);\n\n\t\t# Style\n\t\t$style = str::getAttrTag(\"style\", $this->elements['footer']['style']);\n\n\t\t# Text colour\n\t\t$class[] = str::getColour($this->elements['footer']['colour']);\n\n\t\t# Draggable\n\t\t$class[] = $this->draggable ? \"modal-footer-draggable\" : false;\n\n\t\t# Script\n\t\t$script = str::getScriptTag($this->elements['footer']['script']);\n\n\t\t# The div class\n\t\t$class = str::getAttrTag(\"class\", $this->elements['footer']['class']);\n\n\t\t# Only include left side if it has values (or a custom ID)\n\t\tif(($left = $icon . $this->elements['footer']['html'] . $badge) || $id){\n\t\t\t$left = \"<div class=\\\"col-auto\\\">{$left}</div>\";\n\t\t}\n\n\t\t# Only include right side if it has values (buttons)\n\t\tif($right = $buttons . $button){\n\t\t\t$right = \"<div class=\\\"col\\\">{$right}</div>\";\n\t\t}\n\n\t\treturn <<<EOF\n<div{$id}{$class}{$style}>\n\t<div class=\"container\">\n \t\t<div class=\"row\">\n \t\t{$left}\n \t\t{$right} \t\t\n \t</div>\n\t</div>{$script}\n</div>\nEOF;\n\n\t}", "public static function help_inner () \n { \n $html = null;\n\n $top = __( 'Instruction Manual', 'label' );\n $inner = self::help_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'help', $top, $inner, $bottom );\n\n return $html;\n }", "private function printFooter()\n {\n // Nothing to do at the moment\n }", "private function displayFooter()\n {\n\n $html = '</div>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n $html .= '<div id=\"footer\">' . \"\\n\";\n $html .= '<ul>' . \"\\n\";\n $html .= '<li>&copy; Volition 2012</li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=home\">Home</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=home\">My Profile</a></li>' . \"\\n\";\n if (!$this->model->userLoggedIn) {\n $html .= '<li><a href=\"index.php?page=register\">Register</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=login\">Login</a></li>' . \"\\n\";\n }\n $html .= '<li><a href=\"index.php?page=browse\">Browse</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=about\">About</a></li>' . \"\\n\";\n $html .= '<li><a href=\"index.php?page=contact\">Contact</a></li>' . \"\\n\";\n $html .= '</ul>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n $html .= '<script type=\"text/javascript\" src=\"js/search.js\"></script>';\n $html .= '</body>' . \"\\n\";\n $html .= '</html>' . \"\\n\";\n\n return $html;\n }", "private static final function getHTMLEnd () {\r\n // Just return the contents of the frm_web_footer;\r\n return new FileContent (FORM_TP_DIR . _S . 'frm_web_footer.tp');\r\n }", "protected function printCloseHtml()\n {\n echo '</HTML>';\n }", "function Footer()\n\t{\n\t\t$this->SetY(-13);\n\t\t// Arial italic 8\n\t\t$this->SetFont('Arial','I',8);\n\t\t// Page number\n\t\t$this->Cell(0,10,'Designed by winnie(+254701008108)',0,0,'C');\n\t\t$this->SetY(-18);\n\t\t$this->Cell(0,10,'www.veranevents.com',0,0,'C');\n\t}", "public function Footer(){\n // Position at 15 mm from bottom\n $this->SetY(-15);\n // Set font\n\t\t$html = \"<table>\";\n\t\t$html .= \"<tr><td>unidad de adm y serv</td><td>responsable del proyecto o accion centralizada</td><td>unidad de finanzas</td><td>unidad de planificacion ppto</td><td>presidente</td><td>secreatria de adcripcion</td><td>Secretaria de Planificacion presupuesto y control de gestion</td><td>Gobernador del estado</td></tr>\";\n\t\t$html .= \"<tr><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td></tr>\";\n\t\t$html .= \"</table>\";\n\t\t$this->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);\n $this->SetFont('helvetica', 'I', 8);\n // Page number\n $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n }", "public function bottom();", "static public function NavBarBottom() {\n\t\t$show_back = (strlen(self::$prev_page) > 0);\n\t\t$show_next = (strlen(self::$next_page) > 0);\n\n\t\techo '<p class=\"center\">';\n\t\tif ($show_back) {\n\t\t\techo '<a href=\"', self::$prev_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" title=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" class=\"arrow_left {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_left.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '<a href=\"#top\">';\n\t\techo '<img alt=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" title=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" class=\"arrow_up {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_up.png\" width=\"15\" height=\"22\" />';\n\t\techo '</a>';\n\t\tif ($show_next) {\n\t\t\techo '<a href=\"', self::$next_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" title=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" class=\"arrow_right {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_right.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '</p>';\n\t}", "function\ttableFoot() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $this->myDoc->pageNr >= 1) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterCT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everything we have output'\n\t\t}\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterPE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t}", "protected function end_section_list() {\n\n $html = html_writer::end_tag('div');\n $html .= html_writer::end_tag('div');\n return $html;\n }", "public function footer()\n\t\t{\t\t\t\n\t\t\treturn $this->render('incs/footer');\n\t\t}", "protected function _renderBottom($mode = self::RENDER_TEXT)\n\t{\n\t\tob_start();\n\t\tif ($mode == self::RENDER_HTML) {\n?>\n<?php\n\n\t\t} else\n\t\tif ($mode == self::RENDER_TEXT) {\n\t\t\techo PHP_EOL . PHP_EOL . PHP_EOL;\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "function section_close() {\n $this->doc .= DOKU_LF.'</div>'.DOKU_LF;\n }", "public function finish_display ()\n {\n $this->_finish_body ();\n?>\n </body>\n</html>\n<?php\n }", "public function Footer()\n {\n // Go to 10 cm from bottom\n $this->SetY(-10);\n // Set font to Open Sans\n $this->SetFont('opensans', 'I', 6);\n // Print centered page number with datetime and timezone\n $this->AliasNbPages('{totalPages}');\n // The timezone of the user is retrieved from their Auth0 user's profile if available, otherwise the server time zone is used\n // related to this trello card https://trello.com/c/OjWZzsGA\n $timezone = ($_SESSION['auth0_user']['https://www.boxtribute.com/timezone']) ? $_SESSION['auth0_user']['https://www.boxtribute.com/timezone'] : date_default_timezone_get();\n\n $dt = new DateTime('now', new DateTimeZone($timezone));\n // This is quick fix for an issue with the alignment of footer text as the library incorrectly calculates the text length when template variables {totalPages} are used\n $totalPages = ($_GET['count'] && 0 != $_GET['count']) ? round(intval($_GET['count']) / 2) : 1;\n $this->Cell(0, 10, 'Page '.$this->PageNo().' of '.$totalPages.' Printed on '.$dt->format('d-m-Y H:i:s').\" {$timezone}\", 0, 0, 'C');\n }", "function render_page_container_end()\n\t\t{\n\t\t\t$output = '</div>'; \n\t\t\treturn $output;\n\t\t}", "private function createCreatureBottom()\n {\n\n }", "function section_end(){\n\techo '</div>';\n\techo '</div>';\n}", "function htmlFooter(){\n\treturn \"</body></html>\";\n}", "function Footer() {\r\n\t\t\t$this->SetY( -15 );\r\n\t\t\t\r\n\t\t\t//set font to Arial, Bold, size 10\r\n\t\t\t$this->SetFont( 'Arial', 'B', 10 );\r\n\t\t\t\r\n\t\t\t//set font color to blue\r\n\t\t\t$this->SetTextColor( 52, 98, 185 );\r\n\t\t\t\r\n\t\t\t$this->Cell( 0, 10, 'www.iFadey.com', 0, 0, 'L' );\r\n\t\t\t\r\n\t\t\t//set font color to gray\r\n\t\t\t$this->SetTextColor( 150, 150, 150 );\r\n\t\t\t\r\n\t\t\t//write Page No\r\n\t\t\t$this->Cell( 0, 10, 'Page No: ' . $this->PageNo(), 0, 0, 'R' );\r\n\t\t}", "function printSampleHtmlFooter()\n{\n print '<a href=\"index.php\">Go back to samples list</a>';\n printHtmlFooter();\n}", "public function setContent(){\n\n\t\t$jContent='';\n\t\t$jContent.=$this->brand();\n\t\t$jContent.=$this->navigation->jTabs();\n\t\treturn $this->jQuery_DocReady().$this->vendor->setJS_Group('footer');\n\t\t\n\t}", "public function get_foot()\n\t{\n\t\treturn $this->footer_item;\n\t}", "function showFooter() \n {\n // AUSGABE\n echo \"<div class='newFahrt'><div class='footer'>\";\n echo \"<p>EventPlanner by Steven Schödel (c) Version 05.072019 | \";\n echo \"<a href='/flatnet2/informationen/impressum.php'>Impressum</a> | \";\n echo \"<a href='/index.php'>Login</a>\";\n echo \"</p>\";\n echo \"</div></div>\";\n }" ]
[ "0.7810672", "0.7465339", "0.68236285", "0.68000805", "0.6791196", "0.6768468", "0.6768468", "0.66753477", "0.6667897", "0.6667897", "0.6616711", "0.6610576", "0.6576755", "0.64742893", "0.6421377", "0.6394567", "0.6334091", "0.6321777", "0.6285799", "0.6284416", "0.62712497", "0.62456715", "0.6237485", "0.62203044", "0.621174", "0.6211618", "0.62035686", "0.6155333", "0.6147344", "0.6141932", "0.6140788", "0.6133744", "0.6103258", "0.6090566", "0.60878116", "0.6083612", "0.6079592", "0.60771376", "0.60581076", "0.6054794", "0.60528207", "0.6045318", "0.6035147", "0.60300297", "0.6029003", "0.6026668", "0.6017856", "0.60151523", "0.6009681", "0.60035014", "0.6003363", "0.5991475", "0.5981114", "0.5980696", "0.5977036", "0.59725857", "0.5963825", "0.5955986", "0.5933123", "0.5927645", "0.59256536", "0.59115845", "0.59083855", "0.5907788", "0.59029424", "0.58729994", "0.5870858", "0.58664453", "0.5866409", "0.5861502", "0.58445305", "0.5843349", "0.58311737", "0.5825896", "0.58254826", "0.5823988", "0.5818989", "0.58089894", "0.5806406", "0.58016545", "0.5801104", "0.5800904", "0.580088", "0.5779546", "0.5778628", "0.5773069", "0.5763292", "0.574213", "0.5740198", "0.57371676", "0.5736345", "0.57271975", "0.57265663", "0.57211137", "0.57189405", "0.5717025", "0.5715571", "0.5714253", "0.57090807", "0.5704726" ]
0.7639022
1
Initialize the categories form
public function initialize($entity = null, $send_to) { if (!is_null($entity)) { $this->view->data = $entity->getData(); } $this->view->form_action = $send_to; $this->view->parent_categories = $this->getParentCategories(); $this->view->pick("categories/form"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "public function init()\n {\n $this->addAttribs(array(\"class\" => \"form-horizontal\"))\n ->setDecorators(array(\n 'FormElements',\n 'Form'\n )); \n $this->addElement('hidden','idcategory'); \n \n $name = $this->createElement('text','name');\n $name->setLabel(\"Tên danh mục :\")\n ->setRequired()\n ->setAttrib(\"class\",\"large\")\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($name); \n \n $model = new Application_Model_DbTable_Categories();\n $result = $model->arrayChosen(); \n $groups_id = $this->createElement('select','parent_id');\n $groups_id->setLabel(\"Danh mục cha :\")\n ->setRequired()\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n ));\n $groups_id->addMultiOption(\"0\",\"None\"); \n foreach($result as $row){\n $groups_id->addMultiOption($row['key'],$row['value']);\n } \n $this->addElement($groups_id);\n \n $user_status = $this->createElement('Radio','status');\n $user_status->setLabel(\"Trạng thái :\")\n ->setMultiOptions(array(\"Khóa lại\",\"Hoạt động \"))\n ->setValue(1)\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($user_status); \n \n $submit = $this->createElement(\"submit\",\"submit\");\n $submit->setLabel(\"Thêm\"); \n $this->addElement($submit); \n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function init() {\n $this->setMethod(\"post\");\n $this->addElement('text', 'code_categorie', array('label' => 'Code:',\n 'required' => true,\n 'filters' => array('StringTrim'),\n 'class' => 'text',\n 'validators' => array(\n array('validator' => 'StringLength', 'options' => array(0, 10))\n )));\n\n $this->addElement('text', 'libelle_categorie', array('label' => 'Libelle:',\n 'required' => true,\n 'filters' => array('StringTrim'),\n 'class' => 'text'\n ));\n\n $this->addElement('textarea', 'description_categorie', array(\n 'label' => 'Description:',\n 'required' => FALSE,\n ));\n\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Valider',\n ));\n\n // Add the cancel button\n $this->addElement('button', 'cancel', array(\n 'ignore' => true,\n 'label' => 'Annuler',\n ));\n }", "protected function definition() {\n $mform = $this->_form;\n\n if (isset($this->_customdata['categoriesarray'])) {\n $this->set_categories_array($this->_customdata['categoriesarray']);\n } else {\n return;\n }\n\n if (isset($this->_customdata['defaultcategory'])) {\n $this->set_default_category($this->_customdata['defaultcategory']);\n } else {\n return;\n }\n\n $options = array(\n 'multiple' => false,\n );\n\n $categorieslistraw = $this->get_categories_array();\n\n $defaultcategory = $this->get_default_category();\n\n $categorieslistdefault = array_intersect_key($categorieslistraw, array_flip([$defaultcategory]));\n\n // Make sure that the default category was found, before unsetting it in the original array.\n if (isset($categorieslistdefault[$defaultcategory])) {\n unset($categorieslistraw[$defaultcategory]);\n }\n\n $categorieslist = $categorieslistdefault + $categorieslistraw;\n\n $mform->addElement(\n 'autocomplete',\n 'sel_cate',\n get_string('selectcategorybanner', 'local_course_templates'),\n $categorieslist,\n $options\n );\n\n $mform->addRule('sel_cate', get_string('requiredelement', 'form'), 'required', null, 'client');\n $mform->addRule('sel_cate', get_string('requiredelement', 'form'), 'required', null, 'server');\n\n // When there are two elements, we need a group.\n $buttonarray = array();\n $buttonarray[] = &$mform->createElement(\n 'button',\n 'back',\n get_string('back', 'local_course_templates'),\n array('onclick' => 'javascript :history.back(-1)')\n );\n $buttonarray[] = &$mform->createElement(\n 'submit',\n 'coursecategorieslistsubmit',\n get_string('continue', 'local_course_templates')\n );\n $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n\n $mform->closeHeaderBefore('buttonar');\n }", "private function initModel(){\n\t\t\n\t\t\n\t\t\n\t\t$this->buildModel( \"cd_contact\", BOL_LBL_CONTACTCATEGORY_CD_CONTACT_CATEGORY, 20 );\n\t\t\n\t\t\n\t\t$this->buildModel( \"ds_category\", BOL_LBL_CONTACTCATEGORY_CD_CATEGORY, 30, \"CC.cd_category\", null, CDT_CMP_GRID_FILTER_TYPE_COMBOBOX, false, \"\", \"=\", new CdtCriteriaFormatValue());\n\t\t\n\t\t$this->setFilterModelOptions( \"ds_category\", BOLUtils::getCategoryItems(), CDT_CMP_GRID_FILTER_TYPE_COMBOBOX);\n\t\t\n\t\t$this->buildModel( \"ds_contact\", BOL_LBL_CONTACTCATEGORY_CD_CONTACT, 30 );\n\t\t$this->buildModel( \"ds_mail\", BOL_LBL_CONTACT_DS_MAIL, 30 );\n\t\t$this->buildModel( \"ds_company\", BOL_LBL_CONTACT_DS_COMPANY, 30 );\n\t\t\n\t\t\n\t\t\n\t\t\t\t\n\t\t//acciones sobre la lista\n\t\t$this->buildAction( \"add_contactcategory_init\", \"add_contactcategory_init\", BOL_MSG_CONTACTCATEGORY_TITLE_ADD, \"image\", \"add\" );\n\n\t}", "public function _construct()\r\n {\r\n $this->_init('items/melicategoriesfilter', 'category_id');\r\n }", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "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 }", "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 }", "public function _construct()\r\n {\r\n $this->_init('advancedfaq/category', 'category_id');\r\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "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 }", "protected function form()\n {\n return Admin::form(Category::class, function (Form $form) {\n\n $form->display('catid', 'ID');\n $form->text('name','Category Name')->rules('required');\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "public function __construct(){\r\n\t\t\tparent::__construct();\r\n\t\t\t$this->categoryModel = $this->model('Category'); \r\n\t\t}", "public function showCategoryForm() {\n $company_logo = $this->showLogoImage();\n $category_images = \\App\\CouponCategory::categoryList();\n $signup_category_images = \\App\\CouponCategory::categoryListWeb();\n $country_list = \\App\\Country::countryList();\n\n return view('frontend.signup.category')->with(['company_logo' => $company_logo,\n 'category_images' => $category_images, 'signup_category_images' => $signup_category_images,\n 'country_list' => $country_list]);\n }", "protected function form()\n {\n return Admin::form(ProductCategory::class, function (Form $form) {\n $channelNameArr=Admin::user()->channelNameArr();\n $categoryListArr=ProductCategory::query()->where('channel',array_keys($channelNameArr))->get(['id','name','parent_id'])->toArray();\n $categoryTreeArr=[];\n $a=formatTreeList($categoryListArr);\n foreach($a as $k=>$v){\n $categoryTreeArr[$v['id']]=$v['name'];\n }\n $categoryTreeArr=['0'=>'--作为一级分类--']+$categoryTreeArr;\n $form->display('id', 'ID');\n $form->select('channel','渠道')->options($channelNameArr);\n $form->select('parent_id','上级分类')->options($categoryTreeArr)->rules('required');\n $form->text('name','分类名称')->rules('required');\n $form->image('thumb','封面图')->move('upload/product')->removable();\n $form->display('created_at', '创建时间');\n $form->display('updated_at', '修改时间');\n });\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}", "public function init()\n {\n $this->modelClass = $this->module->categoryModelClass;\n $this->modelSearchClass = $this->module->categoryModelSearchClass;\n $this->indexView = $this->module->categoryIndexView;\n $this->viewView = $this->module->categoryViewView;\n $this->createView = $this->module->categoryCreateView;\n $this->updateView = $this->module->categoryUpdateView;\n parent::init();\n }", "protected function _prepareForm()\r\n {\r\n \t/* @var $model Lanot_EasyBanner_Model_Category */\r\n $model = $this->_getHelper()->getCategoryItemInstance();\r\n\r\n /**\r\n * Checking if user have permissions to save information\r\n */\r\n if (Mage::helper('lanot_easybanner/admin')->isActionAllowed('manage_category/save')) {\r\n $isElementDisabled = false;\r\n } else {\r\n $isElementDisabled = true;\r\n }\r\n\r\n $form = new Varien_Data_Form();\r\n\r\n $form->setHtmlIdPrefix('category_main_');\r\n\r\n $fieldset = $form->addFieldset('base_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Category Item Info')\r\n ));\r\n\r\n if ($model->getId()) {\r\n $fieldset->addField('category_id', 'hidden', array(\r\n 'name' => 'id',\r\n ));\r\n }\r\n\r\n //Add main elements to the category\r\n $fieldset->addField('title', 'text', array(\r\n 'name' => 'title',\r\n 'label' => $this->_getHelper()->__('Title'),\r\n 'title' => $this->_getHelper()->__('Title'),\r\n 'required' => true,\r\n 'disabled' => $isElementDisabled\r\n ));\r\n\r\n $fieldset->addField('description', 'textarea', array(\r\n \t'name' => 'description',\r\n \t'label' => $this->_getHelper()->__('Description'),\r\n \t'title' => $this->_getHelper()->__('Description'),\r\n \t'required' => false,\r\n \t'disabled' => $isElementDisabled,\r\n \t'style' => 'height: 100px',\t\r\n ));\r\n \r\n $fieldset->addField('is_active', 'select', array(\r\n \t'name' => 'is_active',\r\n \t'label' => $this->_getHelper()->__('Is Active'),\r\n \t'title' => $this->_getHelper()->__('Is Active'),\r\n \t'required' => true,\r\n \t'disabled' => $isElementDisabled,\r\n \t'options' => $model->getAvailableStatuses(),\r\n ));\r\n\r\n /*\r\n //Add layout updates elements to the category\r\n $lBlock = $this->getLayout()->createBlock('lanot_easybanner/adminhtml_widget_instance_edit_tab_main_layout');\r\n $fieldset = $form->addFieldset('layout_updates_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Layout Updates')\r\n ));\r\n\r\n $fieldset->addField('layout_updates', 'note', array());\r\n $form->getElement('layout_updates_fieldset')->setRenderer($lBlock);\r\n */\r\n\r\n $form->setValues($model->getData());\r\n \r\n Mage::dispatchEvent('adminhtml_easybanner_category_edit_tab_main_prepare_form', array('form' => $form));\r\n\r\n $this->setForm($form);\r\n\r\n return parent::_prepareForm();\r\n }", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "public function create()\n {\n return view('admin.categories.form');\n }", "protected function form()\n {\n return Admin::form(ArticleCategory::class, function (Form $form) {\n\n $form->display('id', 'ID');\n // 添加text类型的input框\n $form->text('name', '分类名称')->rules('required');\n // 添加number类型的input框\n $form->number('sort', '排序');\n\n // 是否启用\n $form->switch('is_del', '启用?')->rules('required');\n //上传图片\n $form->image('icon','icon')->move('public/upload/image/')->rules('required');\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "function init()\n\t{\n $this->setMethod('post');\n $this->setAction(WEBROOT.'statistics');\n\t\t$this->addAttribs(array('id'=>'filterComplexForm', 'class'=>'')); \n\t\t$this->setEnctype(Zend_Form::ENCTYPE_MULTIPART);\n\t\t\n //BEGIN:Id Category Expenses\n $idCategoryE = new Zend_Form_Element_Multiselect('idCategoryE');\n\n $options= array(/*''=>Zend_Registry::get('translate')->_('admin_menu_categories'),*/ '1'=> strtoupper(Zend_Registry::get('translate')->_('admin_expenses')));\n $categories = new Default_Model_Groups();\n $select = $categories->getMapper()->getDbTable()->select() \n ->where('NOT deleted')\n ->where('type=?',0)\n ->order('name ASC');\n $result = $categories->fetchAll($select);\n if(NULL != $result) {\n foreach($result as $value){\n $options[$value->getId()] = $value->getName();\n }\n }\n $idCategoryE->setMultiOptions($options);\n $idCategoryE->addValidator(new Zend_Validate_InArray(array_keys($options)));\n $idCategoryE->setAttribs(array('class'=>'rightAdd form_selector','id'=>'idCategoryE'));\n $idCategoryE->setRequired(false);\n $this->addElement($idCategoryE);\n //END:Id Category Expenses\n \n //BEGIN:Id Category Income\n $idCategoryI = new Zend_Form_Element_Multiselect('idCategoryI');\n\n $options= array(/*''=>Zend_Registry::get('translate')->_('admin_menu_categories'),*/ '2'=> strtoupper(Zend_Registry::get('translate')->_('admin_income')));\n $categories = new Default_Model_Groups();\n $select = $categories->getMapper()->getDbTable()->select() \n ->where('NOT deleted')\n ->where('type=?',1)\n ->order('name ASC');\n $result = $categories->fetchAll($select);\n if(NULL != $result) {\n foreach($result as $value){\n $options[$value->getId()] = \" \".$value->getName();\n }\n }\n $idCategoryI->setMultiOptions($options);\n $idCategoryI->addValidator(new Zend_Validate_InArray(array_keys($options)));\n $idCategoryI->setAttribs(array('class'=>'rightAdd form_selector','id'=>'idCategoryI'));\n $idCategoryI->setRequired(false);\n $this->addElement($idCategoryI);\n //END:Id Category Income\n \n //BEGIN:Timeframe\n $timeframe = new Zend_Form_Element_Select('timeframe');\n\n $options= array('m'=>Zend_Registry::get('translate')->_('admin_monthly'), 'w'=> Zend_Registry::get('translate')->_('admin_weekly'), 'd'=> Zend_Registry::get('translate')->_('admin_daily'));\n $timeframe->setMultiOptions($options);\n $timeframe->addValidator(new Zend_Validate_InArray(array_keys($options)));\n $timeframe->setAttribs(array('class'=>'rightAdd validate[required] form_selector','id'=>'timeframe'));\n $timeframe->setRequired(true);\n $timeframe->setValue('m');\n $this->addElement($timeframe);\n //END:Timeframe\n \n\t\t// BEGIN: data\n\t\t$dataStart = new Zend_Form_Element_Text('dataStartC');\n\t\t$dataStart->setAttribs(array('class'=>'data_inceput_c validate[required]','placeholder'=>Zend_Registry::get('translate')->_('admin_from_date')));\n\t\t$dataStart->setRequired(true);\n $this->addElement($dataStart);\n\t\t\n\t\t$dataEnd = new Zend_Form_Element_Text('dataEndC');\n\t\t$dataEnd->setAttribs(array('class'=>'data_sfarsit_c validate[required]','placeholder'=>Zend_Registry::get('translate')->_('admin_to_date')));\n\t\t$this->addElement($dataEnd);\n\t\t// END: data\n\n\t\t$submit = new Zend_Form_Element_Submit('submitC');\n\t\t$submit->setValue(Zend_Registry::get('translate')->_('admin_menu_form_search'));\n\t\t$submit->setAttribs(array('class'=>'submit'));\n\t\t$submit->setRequired(true);\n\t\t$this->addElement($submit);\n \n $submitReportE = new Zend_Form_Element_Submit('submitReportE');\n\t\t$submitReportE->setAttribs(array('class'=>'submitReport'));\n\t\t$submitReportE->setRequired(true);\n\t\t$this->addElement($submitReportE);\n \n $submitReportI = new Zend_Form_Element_Submit('submitReportI');\n\t\t$submitReportI->setAttribs(array('class'=>'submitReport'));\n\t\t$submitReportI->setRequired(true);\n\t\t$this->addElement($submitReportI);\n\t}", "public function build_forms()\n {\n // Get list of categories to populate the category selector\n $em = EntityManagerSingleton::getInstance();\n\n $category_options = [];\n $category_listings = $em->getRepository('Library\\Model\\Category\\Category')->findAllWithHierarchy();\n\n // Get list of categories that are theme categories so that they are are not included\n $criteria = new Criteria();\n $criteria->where($criteria->expr()->eq('id', Category::THEME_CATEGORY_ID))->orWhere($criteria->expr()->eq('parent_category', $em->getReference('Library\\Model\\Category\\Category', Category::THEME_CATEGORY_ID)));\n $theme_categories = $em->getRepository('Library\\Model\\Category\\Category')->matching($criteria);\n $all_theme_category_ids = [];\n if ($theme_categories->count() > 0)\n {\n /** @var Category $theme_category */\n foreach ($theme_categories as $theme_category)\n $all_theme_category_ids[] = $theme_category->getId();\n }\n\n if (!empty($category_listings))\n {\n foreach($category_listings as $listing)\n {\n // Don't include theme categories in the list\n if (in_array($listing['id'], $all_theme_category_ids))\n continue;\n\n // Construct listing name\n $listing_name = \"\";\n if (count($listing['ancestors']) > 0)\n {\n foreach ($listing['ancestors'] as $ancestor)\n {\n $listing_name .= $ancestor['name'] . \" >> \";\n }\n }\n\n $listing_name .= $listing['name'];\n $category_options[$listing['id']] = $listing_name;\n }\n }\n\n // Get list of statuses to list for products\n $this->status_options = [];\n $status_listings = $em->getRepository('Library\\Model\\Product\\Status')->findAll();\n $this->status_options[0] = \"None\";\n\n if (count($status_listings) > 0)\n {\n foreach ($status_listings as $staus_listing)\n {\n $this->status_options[$staus_listing->getId()] = $staus_listing->getName();\n }\n }\n\n // Get list of options for skus form\n $option_list = [];\n $options = $em->getRepository('Library\\Model\\Product\\Option')->findAll();\n if (!empty($options))\n {\n foreach ($options as $option)\n {\n $option_list[$option->getId()] = $option->getName();\n }\n }\n\n // Add content to forms\n $this->create_update_form->get('category')->setAttribute('options', $category_options);\n $this->create_update_form->get('status_override')->setAttribute('options', $this->status_options);\n $this->create_update_form->get('status')->setAttribute('options', $this->status_options);\n $this->add_skus_form->get('options')->setAttribute('options', $option_list);\n }", "public function __construct()\n {\n $this->cate = Category::all();\n }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "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 }", "protected function form()\n {\n $categoryModel = new ArticleCategory();\n $form = new Form(new ArticleCategory);\n\n $form->select('parent_id', '父级分类')->options($categoryModel::selectOptions())->default(1);\n $form->text('title', '标题')->required();\n $form->text('description', trans('description'));\n $form->image('avatar', trans('avatar'));\n $form->number('order', __('Order'))->default(1)->setDisplay(false);\n\n return $form;\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 cmb_init() {\n\t\t$this->action( 'cmb2_init_hookup_rank-math-redirections', 'add_category_cmb_field', 110 );\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "private function setCategoryDefaultValues()\n {\n if($this->formMode === 'add')\n {\n $this->data['category_title'] = '';\n }\n else if(empty($_POST['category_submit']))\n {\n // Retrieve data from database if NOT POST request\n $data = $this->post_categories_model->getByID($this->data['category_id']);\n $this->data['category_title'] = $data['Post_Category_Title'];\n }\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}", "public function __construct() {\n $this->data['title'] = 'Category';\n }", "protected function form()\n {\n // 创建一个表单\n return Admin::form(ArticleCategory::class, function (Form $form) {\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->text('title', '文章分类名称')->rules('required');\n $form->text('sort', '排序(数字越小越靠前)')->default(0);\n $form->text('summary', '简介');\n });\n }", "public function __construct()\n {\n $this->categories = new ArrayCollection();\n }", "public function __construct()\n {\n $this->categories = new ArrayCollection();\n }", "public function getName()\n {\n return 'category_form';\n }", "public function create() {\n return view('admin.category.category_create_form');\n }", "protected function form()\n {\n $form = new Form(new Category());\n \n $form->text('erp_id', __('ID(ERP用)'));\n $form->select('parent_id', __('中分類'))->options(\n\n Category::Mid()->pluck('name', 'id')\n\n )->required();\n \n $form->text('name', __('小分類名稱'));\n $form->hidden('type', __('Type'))->default(3);\n\n return $form;\n }", "public function init_builder() {\n\t\t// add categories\n\t\tif ( Responsive_Lightbox()->options['builder']['gallery_builder'] && Responsive_Lightbox()->options['builder']['categories'] && Responsive_Lightbox()->options['builder']['archives'] ) {\n\t\t\t$terms = get_terms( array( 'taxonomy' => 'rl_category', 'hide_empty' => false ) );\n\n\t\t\tif ( ! empty( $terms ) ) {\n\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t$this->settings['builder']['fields']['archives_category']['options'][$term->slug] = $term->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// flush rewrite rules if needed\n\t\tif ( isset( $_GET['flush_rules'] ) )\n\t\t\tflush_rewrite_rules();\n\t}", "public function executeNew(sfWebRequest $request)\n {\n $this->form = new ForumCategoriesForm();\n }", "public function category()\n\t{\n\t\t$crud = $this->generate_crud('blog_categories');\n\t\t$crud->columns('title');\n\t\t$this->mPageTitle = 'Blog Categories';\n\t\t$this->mViewData['crud_note'] = modules::run('adminlte/widget/btn', 'Sort Order', 'blog/category_sortable');\n\t\t$this->render_crud();\n\t}", "function form($instance)\n {\n $instance = wp_parse_args((array)$instance, $defaults); ?>\n <!-- Category -->\n <p>\n <label for=\"<?php echo $this->get_field_id('categories'); ?>\">Select Category:</label>\n <select id=\"<?php echo $this->get_field_id('categories'); ?>\"\n name=\"<?php echo $this->get_field_name('categories'); ?>\" style=\"width:100%;\">\n <?php $categories = get_categories('hide_empty=0&depth=1&type=post'); ?>\n <?php foreach ($categories as $category) { ?>\n <option value='<?php echo $category->term_id; ?>' <?php if ($category->term_id == $instance['categories']) echo 'selected=\"selected\"'; ?>><?php echo $category->cat_name; ?></option>\n <?php } ?>\n </select>\n </p>\n <?php\n }", "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 categories(){\n \n $this->data['categories'] = $this->books_model->getAllCategories();\n $this->render('books/categories');\n }", "public function init()\n {\n // Top-level parent\n parent::init();\n $this->applyOmekaStyles();\n $this->setAutoApplyOmekaStyles(false);\n $this->setAttrib('id', 'new_collection');\n $this->setAttrib('method', 'POST');\n // Target collection\n $this->addElement('text', 'name', array(\n 'label' => __(\"Collection Name\"),\n 'description' => __(\"Name of the new collection to import into.\"),\n 'required' => true,\n ));\n }", "protected function form()\n {\n $form = new Form(new Category());\n\n $parents = Category::where('parent_id', 0)->get()->toArray();\n $select_ = array_prepend($parents, ['id' => 0, 'name_cn' => '顶级']);\n $select_array = array_column($select_, 'name_cn', 'id');\n //创建select\n $form->select('parent_id', '上级')->options($select_array);\n\n $form->text('name_cn', __('Name cn'))->rules('required');\n $form->text('name_en', __('Name en'))->rules('required');\n $form->multipleImage('top_image', __('置顶图'))->sortable()->removable()->help('按数字大小正序长宽建议比列(178:174|177:87),请按照建议比例顺序上传图片');\n $form->image('image', __('Image'))->help('按数字大小正序长宽建议比列(710:295)');\n $form->text('description', __('Description'))->rules('required');\n $form->ueditor('content', __('Content'));\n $states = [\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n ];\n $form->switch('is_top', __('Is top'))->states($states)->default(0);\n $form->number('sort_order', __('Sort order'))->default(99);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new ArticleCategory);\n $form->text('name', '名称');\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Category);\n\n// dump(Category::root(request()->segment(3)));\n\n $form->tab('Конструктор страницы', function($form){\n $form->sortable('source','Страница');\n $form->select('blocks','Добавить блок')->options(Block::where('static',0)->pluck('name','url'))->attribute(['rel' => 'blocks']);\n $form->select('static','Добавить статический блок')->options(Block::where('static',1)->pluck('name','url'))->attribute(['rel' => 'static']);\n });\n $form->tab('Настройки', function($form){\n $form->display('id');\n $form->alias('alias','Алиас');\n $form->text('link');\n $form->select('hook')->options(Resource::all()->pluck('name','id'));\n $form->text('name','Название');\n });\n $form->tab('SEO', function($form){\n $form->textarea('seo_title','seo title');\n $form->textarea('seo_desc','seo description');\n $form->textarea('seo_key','seo keywords');\n\n });\n\n return $form;\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "protected function form()\n {\n $form = new Form(new Category);\n $module_model = new Module();\n\n $options = $this->category_model->getOptions();\n $form->select('parent_id', '父ID')->options($options);\n $form->select('module_id', '模块ID')->options($module_model->getOptions());\n $form->text('name', '名称');\n $form->number('order', '排序');\n $form->text('alias', '别名');\n $form->icon('icon', '图标');\n $form->image('image', '图片')->uniqueName();\n $form->url('link', '链接');\n $form->text('seo_title', 'Seo 标题');\n $form->text('seo_keywords', 'Seo 关键词');\n $form->textarea('seo_description', 'Seo 描述');\n $form->text('index_template', '首页模版');\n $form->text('detail_template', '详情模版');\n $form->switch('status', '状态')->default(1);\n\n $form->saving(function (Form $form) {\n\n if(!empty($form->model()->id)){\n if($form->model()->id == $form->parent_id){\n $error = new MessageBag([\n 'title' => '父ID值有误',\n 'message' => '父ID不允许为自身',\n ]);\n return back()->with(compact('error'));\n }\n }\n\n if(!empty($form->model()->id)){\n $categories = $this->category_model->all()->toArray();\n $ids = getSonIds($form->model()->id,$categories);\n if(in_array($form->parent_id,$ids)){\n $error = new MessageBag([\n 'title' => '父ID值有误',\n 'message' => '父ID不允许为自身的子集',\n ]);\n\n return back()->with(compact('error'));\n }\n }\n });\n\n return $form;\n }", "public function action_Create()\n\t{\n\t\t// setup view\n\t\t$this->view = View::factory('Ticket/Fieldset')\n\t\t->bind('form', $form)\n\t\t->set('categories', ORM::factory('Category')->find_all()->as_array('id', 'name'));\n\n\t\t// create ticket model\n\t\t$item = ORM::factory('Ticket');\n\n\t\t// factory an form\n\t\t$form = Form::factory($item);\n\t\t$form->message_success .= '<br>'.HTML::anchor('Ticket', __('Go back'));\n\n\t\t// on form submit\n\t\tif ($this->request->method() === HTTP_Request::POST)\n\t\t{\n\t\t\t// get post data\n\t\t\t$data = $this->request->post();\n\t\t\t$data['status'] = 0;\n\n\t\t\t// set values to ORM\n\t\t\t$item->values($data);\n\n\t\t\t// validate categories\n\t\t\tforeach (Arr::get($data, 'categories', []) as $i => $category)\n\t\t\t{\n\t\t\t\t$data['categories'][$i] = ORM::factory('Category', $category);\n\n\t\t\t\tif ( ! $data['categories'][$i]->loaded())\n\t\t\t\t{\n\t\t\t\t\t$form->attach(['categories' => 'invalid category']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we need at least 1 category\n\t\t\tif (empty($data['categories']))\n\t\t\t{\n\t\t\t\t$form->attach(['categories' => 'minimum 1 category is required']);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// check validation\n\t\t\t\t$item->check();\n\n\t\t\t\t// proceed if form is valid\n\t\t\t\tif ($form->valid())\n\t\t\t\t{\n\t\t\t\t\t// save item\n\t\t\t\t\t$item->save();\n\n\t\t\t\t\t// loop through categories\n\t\t\t\t\tforeach ($data['categories'] as $category)\n\t\t\t\t\t{\n\t\t\t\t\t\t// add the relation\n\t\t\t\t\t\t$item->add('categories', $category);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (ORM_Validation_Exception $e)\n\t\t\t{\n\t\t\t\t// attach errors to form\n\t\t\t\t$form->attach($e);\n\t\t\t}\n\t\t}\n\t}", "protected function _initAction()\n {\n $this->loadLayout()\n ->_setActiveMenu('cis/CategoryAttribute');\n return $this;\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 $categories = Category::orderBy('id', 'ASC')->get();\n\n $this->CategoryList = $categories;\n }", "public function create()\n {\n $category = Categories::all();\n return view('panel.product-management.categories.form-create')->with(['category' => $category]);\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "protected function form()\n {\n $form = new Form(new TopicCategory);\n\n $form->text('name', '话题分类名称')->rules('required|string');\n $form->number('sort', '排序值')->default(9)->rules('required|integer|min:0')->help('默认倒序排列:数值越大越靠前');\n\n return $form;\n }", "public function __construct () \n {\n $this->title = 'Categories';\n $this->route = 'admin.categories.';\n $this->view = 'admin.category.';\n }", "function fill_parent_combo( $form_name, $category_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories where status = 1\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\t$combo = '<select class=\"validate[required] txarea2\" name=\"category_id\" id=\"category_id\" onchange=\"document.uploadAdvert.submit()\" >\n\t\t\t\t\t<option value=\"\">---Please Select Category---</option>';\n\t\tif( $r != false )\n\t\t{\n\t\t\tfor( $i = 0; $i < count( $r ); $i++ )\n\t\t\t{\n\t\t\t\t$selected = $category_id== $r[$i]['category_id'] ? \"selected\" : \"\";\n\t\t\t\t$combo .= '<option '.$selected.' value=\"'.$r[$i]['category_id'].'\">'.$r[$i]['category_title'].'</option>';\n\t\t\t}\t//\tEnd of for Looooooop\n\t\t}\t//\tEnd of if( $r != false )\n\t\t$combo .= '</select>';\n\t\t\n\t\treturn $combo;\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function init()\n {\n parent::init();\n $this->formModel = new GoodsForm();\n \n }", "public function newCategores($limit = 3)\n {\n $categoryList = Category::query()\n ->orderBy('id ASC')\n ->where('index_page = 1')\n ->limit($limit)\n ->execute();\n\n $this->widgetPartial('widget/new-categories', ['categorylist' => $categoryList]);\n }", "public function create()\n {\n $form = \\FormBuilder::create( 'App\\Forms\\Admin\\CategoryForm', [ 'method' => 'POST', 'url' => route( 'admin.categories.store' ) ] );\n\n return view( 'admin.categories.create', compact( 'form' ) );\n }", "private function category_menu2($count) {\n global $CFG, $DB, $USER;\n $page = optional_param('page', '0', PARAM_INT);\n $categoryid = optional_param('categoryid', null, PARAM_INT);\n $ctype = optional_param('ctype', null, PARAM_TEXT);\n $displaylist = core_course_category::make_categories_list();\n if (empty($count)) {\n $countstr = '<p>No course available</p>';\n } else if ($count == \"1\") {\n $countstr = '<p>'.$count.' course</p>';\n } else if ($count > 1) {\n $countstr = '<p>'.$count.' course(s)</p>';\n }\n\n $options = $options1 = '';\n\n foreach ($displaylist as $cid => $cval) {\n $ctxt = ($categoryid == $cid) ? ' selected=\"selected\" ' : '';\n $options .= \"<option value='$cid'$ctxt>$cval</option>\\n\";\n }\n\n $dlist = array(\"asc\" => \"Asc\", \"desc\" => \"Desc\");\n foreach ($dlist as $ct => $ctval) {\n $ctxt1 = ($ctype == $ct) ? ' selected=\"selected\" ' : '';\n $options1 .= \"<option value='$ct'$ctxt1>$ctval</option>\\n\";\n }\n\n $courseurl = new moodle_url(\"/course/index.php\");\n\n $html = '<div class=\"theme-filters\">\n <form action=\"'.$courseurl.'\" name=\"frmcourse\" method=\"post\" id=\"frmcrs\">\n <select name=\"categoryid\">';\n $html .= '<option value=\"\">Categories</option>'.$options.'\n </select><select name=\"ctype\"><option value=\"\">Sort</option>\n '.$options1.'</select>'.$countstr.'</form></div>';\n return $html;\n }", "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 }", "function category_description_widget() {\n\t\tparent::__construct( false, 'Category Description' );\n\t}", "function getSetupForm($options = array()){\n $form = parent::getSetupForm($options);\n $form->setLegend('Category Options');\n \n $set = $form->createElement('select', 'set');\n $set->setLabel('Set: ');\n $set->setRequired('true');\n \n $service = new Content_Model_CategorySet_Service();\n $results = $service->getObjects();\n\n $options = array();\n foreach($results as $value){\n $options[$value->id] = $value->title;\n }\n\n //$template->addMultiOption('None','');\n $set->setMultiOptions($options);\n $form->addElement($set);\n \n return $form;\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 {\n $this->beforeFilter(function() {\n View::share('catnav', Category::all());\n });\n }", "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 }", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "function ProductsLoggedInConstruct()\n\t{\tparent::ProductsLoggedInConstruct();\n\t\t\n\t\t$this->cat = new AdminStoreCategory($_GET['id']);\n\t\t\n\t\tif (isset($_POST['ctitle']))\n\t\t{\t$saved = $this->cat->Save($_POST);\n\t\t\t$this->successmessage = $saved['successmessage'];\n\t\t\t$this->failmessage = $saved['failmessage'];\n\t\t}\n\t\t\n\t\tif ($this->cat->id && $_GET['delete'] && $_GET['confirm'])\n\t\t{\tif ($this->cat->Delete())\n\t\t\t{\t$this->RedirectBack('storecategories.php');\n\t\t\t} else\n\t\t\t{\t$this->failmessage = 'Delete failed';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->breadcrumbs->AddCrumb('storecategories.php', 'Categories');\n\t\tif ($this->cat->id)\n\t\t{\t$this->breadcrumbs->AddCrumb('storecatedit.php?id=' . $this->cat->id, $this->InputSafeString($this->cat->details['ctitle']));\n\t\t} else\n\t\t{\t$this->breadcrumbs->AddCrumb('storecatedit.php', 'creating new category');\n\t\t}\n\t}", "public function __construct()\n {\n $categories = Category::all();\n \n view()->share('categories', $categories);\n \n }", "public function get_category_form_by_ajax() {\n $category_count = $_POST['id'];\n $data['category_id'] = $category_count;\n $data['category_branch_location'] = $this->get_branch_location();\n $data['get_printer'] = $this->get_printer();\n $this->load->view('restaurant/category/insert_category_form', $data);\n }", "public function actionCreate()\n\t{\n\t\t$model=new BookCategories;\n $step = 1;\n\t\tif(isset($_POST['BookCategories']))\n\t\t{\n\t\t\t$model->attributes=$_POST['BookCategories'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('update?id='.$model->id.'&step=2'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'step' => $step\n\t\t));\n\t}", "public function create()\n {\n return view('adminlte::categories.create');\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function render()\n {\n return view('components.category-form');\n }", "public function create()\n {\n return view('categoria.formcategoria');\n }", "public function __construct() {\n $this->articleModel = $this->loadModel('Article');\n $this->categories = $this->articleModel->findAllCategories();\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function __construct()\n {\n \n // The blockGroup must match the first half of how we call the block\n $this->_blockGroup = 'yourmindourwork_storesquare';\n \n // The controller must match the second half of how we call the block\n $this->_controller = 'adminhtml_manage_categories';\n \n $this->_headerText = Mage::helper('yourmindourwork_storesquare')->__('Manage Categories');\n \n parent::__construct();\n $this->_removeButton('add');\n\n }", "public function init()\n {\n $this->setName('carboncopy')\n ->setLabel('Options');\n\n $this->add(\n array(\n 'type' => 'Laminas\\Form\\Element\\Checkbox',\n 'name' => 'carboncopy',\n 'options' => array(\n 'checked_value' => '1',\n 'unchecked_value' => '0',\n 'label' => 'send me a carbon copy',\n )\n )\n );\n }", "public function create() {\n// user must be logged in\n if (User::is_logged_in()) {\n// preventing double submitting\n $token = md5(time());\n $_SESSION[$token] = true;\n\n// get all categories for the select box in form\n $categories = Category::all();\n// show post creation form\n require_once('views/posts/create.php');\n }\n }", "public function __construct(Category $model)\n {\n parent::__construct($model);\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 }", "function __construct()\n {\n parent::__construct();\n\t\t\t\t$this->load->model('Category');\n }", "function init(){\n\t\tif($this->catUID==0){//----ROOT it is\n\t\t\tquery(\"SELECT c.catUID as catUID, c.Lable AS lable, t.name AS type_name FROM category_cat AS c,category_type AS t WHERE c.typeUID=t.typeUID AND c.owner_type ='bizness' AND c.owner_UID='\".osBackBizness().\"'\");\n\t\t\tif($row=fetch()){\n\t\t\t\t$this->catUID=$row['catUID'];\n\t\t\t\t$this->lable=$row['lable'];\n\t\t\t\t$this->type_name=$row['type_name'];\n\t\t\t}\n\t\t}else{//---Specific category\n\t\t\tquery(\"SELECT c.Lable AS lable, t.Name AS type_name FROM category_cat AS c,category_type AS t WHERE c.typeUID=t.typeUID AND c.catUID=\".$this->catUID);\n\t\t\tif($row=fetch()){\n\t\t\t\t$this->lable=$row['lable'];\n\t\t\t\t$this->type_name=$row['type_name'];\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n {\n $this->readCategory = new ReadCategories();\n }", "function form($instance)\n {\n $defaults = array('category' => '');\n $instance = wp_parse_args(( array )$instance, $defaults);\n $category = $instance['category'];\n ?>\n <p>\n <label for=\"recent_posts_title\"><?php _e('Chọn các category được hiển thị'); ?></label>\n </p>\n\n <p>\n <label for=\"products_category\"><?php _e('Chuyên mục'); ?>:</label>\n <?php\n wp_dropdown_categories(array(\n 'orderby' => 'title',\n 'hide_empty' => false,\n 'name' => $this->get_field_name('category'),\n 'id' => 'products_category',\n 'class' => 'widefat',\n 'selected' => $category\n ));\n ?>\n </p>\n <?php\n\n }", "public function create()\n { \n $form_type = 'Add';\n $images = [];\n $category = [];\n $questions = ['Case / Box','A Game','The Manual'];\n \n $categories = Categories::where('parent_id',0)->pluck('category_name','id')->prepend('Select League', ''); \n $regions = Regions::pluck('name','id')->prepend('Select Region', ''); \n \n return view('admin.subcategories.form', compact('form_type','categories','regions','images','category','questions')); \n }", "function bootstrap4_list_categories_widget() {\n parent::WP_Widget(false, $name = 'Bootstrap Categories', array('description' => 'List categories in a bootstrap elements.'));\n }", "public function renderForm() {\n\n $id_default_lang = $this->context->language->id;\n $id_shop = $this->context->shop->id;\n\n /* Render Form */\n $carousel_types = array(\n array(\n 'value' => 'featured',\n 'name' => $this->l('Featured products')\n ),\n array(\n 'value' => 'new',\n 'name' => $this->l('New products')\n ),\n array(\n 'value' => 'special',\n 'name' => $this->l('Special products')\n ),\n array(\n 'value' => 'category',\n 'name' => $this->l('All products from certain category')\n ),\n array(\n 'value' => 'custom',\n 'name' => $this->l('Custom products')\n )\n );\n\n // Get Categories\n $root_category = Category::getRootCategory($id_default_lang);\n $this->_getCategories($root_category->id_category, $id_shop);\n\n // Init Fields form array\n $this->fields_form = array(\n 'legend' => array(\n 'title' => $this->l('Carousel'),\n 'icon' => 'icon-cogs'\n ),\n // Inputs\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->l('Carousel Title'),\n 'name' => 'title',\n 'desc' => $this->l('Must be less than 250 characters.'),\n 'size' => 50,\n 'required' => true,\n 'lang' => true\n ),\n array(\n 'type' => 'select',\n 'name' => 'carousel_type',\n 'label' => $this->l('Carousel Content'),\n 'required' => false,\n 'lang' => false,\n 'options' => array(\n 'query' => $carousel_types,\n 'id' => 'value',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'name' => 'select_category',\n 'label' => $this->l('Select a category'),\n 'required' => false,\n 'lang' => false,\n 'options' => array(\n 'query' => $this->_categorySelect,\n 'id' => 'value',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Add a product'),\n 'name' => 'product_autocomplete',\n 'size' => 50,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Carousel Content'),\n 'name' => 'carousel_content',\n 'size' => 50\n ),\n ),\n // Submit Button\n 'submit' => array(\n 'title' => $this->l('Save'),\n 'name' => 'saveProductCarousel'\n )\n );\n\n if (Shop::isFeatureActive()){\n $this->fields_form['input'][] = array(\n 'type' => 'shop',\n 'label' => $this->l('Shop association'),\n 'name' => 'checkBoxShopAsso',\n );\n }\n\n if (!($obj = $this->loadObject(true)))\n return;\n\n if ($obj && $obj->carousel_type == 'custom'){\n $carousel_content_products = array();\n $carousel_content = explode(',', $obj->carousel_content);\n\n foreach ($carousel_content as $pid) {\n $product = new Product($pid, false, $id_default_lang);\n $carousel_content_products[] = array(\n 'id' => $pid,\n 'name' => $product->name,\n 'ref' => $product->reference\n );\n }\n\n $this->tpl_form_vars['carousel_content_products'] = $carousel_content_products;\n }\n\n return parent::renderForm();\n }", "public function create(FormBuilder $formBuilder)\n {\n $dropdown = Category::attr(['name' => 'parent_id', 'class'=> 'form-control'])->placeholder(0, '--SELECT--')->nested()->renderAsDropdown();\n $form = $formBuilder->create('Modules\\Panel\\Forms\\CategoryForm', [\n 'method' => 'POST',\n 'url' => route('panel.categories.store')\n ]);\n return view('panel::categories.create', compact('form', 'dropdown'));\n }", "public function init()\n {\n $this->addElement(\n new Zend_Form_Element_Text(\n 'title',\n array(\n 'required' => true,\n 'label' => 'Название проекта',\n 'size' => '80',\n 'class' => 'iText',\n 'decorators' => array('ViewHelper'),\n )\n )\n );\n\n $this->addElement(\n new Zend_Form_Element_Select(\n 'manager_id',\n array(\n 'multiOptions' => $this->getUsers(),\n 'required' => true,\n 'label' => 'Менеджер проекта',\n 'decorators' => array('ViewHelper'),\n )\n )\n );\n\n $this->viewScript = '_forms/project.phtml';\n }" ]
[ "0.7470447", "0.7234751", "0.70818573", "0.69539213", "0.68671346", "0.65911096", "0.658379", "0.65500045", "0.651963", "0.6511316", "0.64970934", "0.6457811", "0.644399", "0.6438342", "0.64102316", "0.64098185", "0.6397564", "0.6390939", "0.63762385", "0.63659465", "0.63633907", "0.634608", "0.63305944", "0.63008434", "0.6273377", "0.6251946", "0.6246045", "0.6243085", "0.6231451", "0.6225254", "0.6223391", "0.62212956", "0.6179247", "0.6176548", "0.61751074", "0.6152231", "0.61494267", "0.6148167", "0.6142373", "0.6142373", "0.61001337", "0.6088645", "0.60693204", "0.6065808", "0.6057997", "0.6054837", "0.604902", "0.6026464", "0.6016826", "0.601657", "0.60056424", "0.60031736", "0.5999259", "0.59915423", "0.5979909", "0.597093", "0.5966779", "0.5958843", "0.5958493", "0.5957163", "0.5953228", "0.59416014", "0.59335554", "0.59229887", "0.59202796", "0.5909882", "0.5901244", "0.59010136", "0.59001976", "0.58793545", "0.58754194", "0.587343", "0.58657885", "0.5864213", "0.58611715", "0.58583915", "0.58519477", "0.58396083", "0.5826745", "0.5822337", "0.5821149", "0.5812935", "0.5800395", "0.5800254", "0.57972354", "0.5791097", "0.5781776", "0.57789713", "0.5776904", "0.5776902", "0.5768797", "0.5764957", "0.5753659", "0.5752812", "0.57526755", "0.57486165", "0.57450384", "0.57448494", "0.57416785", "0.573901", "0.5738901" ]
0.0
-1
Run the database seeds.
public function run() { factory(User::class, 10)->create()->each(function ($user) { $user->emails()->saveMany(factory(Email::class, 2)->make()); $user->phones()->saveMany(factory(Phone::class, 2)->make()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(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' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // 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' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(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' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.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
Constructor use to get connected to server and selecting database
function __construct(){ $con = mysql_connect(HOSTNAME,USERNAME,PASSWORD); if(!$con){ $response['error'] = 1; $response['response']['error'] ='unable to connect to server'; echo json_encode($response); die; } if($con){ $rec = mysql_select_db(DBNAME,$con); if(!$rec){ $response['error'] = 1; $response['response']['error'] ='Unable to select Database'; echo json_encode($response); die; } } //ob_start(); //session_start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $gl_config = Tools::getConfig();\n\n\n $this->_server = $gl_config['database_master']['params']['host'];\n $this->_user = $gl_config['database_master']['params']['username'];\n $this->_password = $gl_config['database_master']['params']['password'];\n $this->_type = $gl_config['database_master']['adapter'];\n $this->_database = $gl_config['database_master']['params']['dbname'];\n $this->connect();\n }", "private function __construct() {\r\n $this->dbName = self::$_dbname;\r\n $this->username = self::$_username;\r\n $this->password = self::$_password;\r\n $this->hostname = self::$_hostname; \r\n\t return $this->connect();\r\n }", "public function __construct(){\n\t\t$database = new Database();\n\t\t$db = $database->getConnection();\n $this->conn = $db;\n }", "function init() {\n if ( empty( $this->hostname ) ) {\n $this->hostname = $this->gCI->gPZ['db_config'][\"hostname\"];\n }\n if ( empty( $this->username ) ) {\n $this->username = $this->gCI->gPZ['db_config'][\"username\"];\n }\n if ( empty( $this->password ) ) {\n $this->password = $this->gCI->gPZ['db_config'][\"password\"];\n }\n if ( strstr( $this->hostname, \":\" ) ) {\n list( $this->hostname, $this->port ) = explode( \":\", $this->gCI->gPZ['db_config']['hostname'] );\n } else {\n $this->port = 0;\n }\n $this->database = ( empty( $this->database ) ? $this->gCI->gPZ['db_config'][\"database\"] : $this->database );\n $this->db_conn = new mysqli( $this->hostname, $this->username, $this->password, $this->database, $this->port );\n\n if ( mysqli_connect_errno() ) {\n\n $this->gCI->fatal_error( \"Database Connect failed: %s\\n\", mysqli_connect_error()) ;\n }\n }", "public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n \n $this->conn = $db;\n }", "public function __construct() {\n\t\t$this->db = MySQLConnectivity::get_instance();\n\t\t$this->conn = $this->db->get_connection(); \n\t}", "public function __construct() {\n// $this->db['server'] = $args['server'];\n// $this->db['username'] = $args['username'];\n// $this->db['password'] = $args['password'];\n// $this->db['database'] = $args['database'];\n $this->open_connection();\n }", "private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}", "public function __construct()\n {\n $this -> connection = $this ->connecdatabase();\n }", "function __construct(){\r\n\t\t\t$this->conn = mysqli_connect(DB_SERVER,DB_USER,DB_PASS) or die (\"Error:\" .mysql_error());\r\n\t\t\tmysqli_select_db($this->conn,DB_NAME);\r\n\t\t}", "function __construct() {\n\t\t$this->connect();\n\t\t\t$this->select_db($this->g_dbname);\n\t\t}", "protected function __construct()\n\t{\n\t\tglobal $confDBType, $confDBServer, $confDBName, $confDBPrefix, $confDBUser, $confDBPasswd, $confDBPort;\n\n\t\t$this->dbType = (!empty($confDBType)) ? strtolower($confDBType) : '';\n\t\t$this->dbServer = $confDBServer;\n\t\t$this->dbUser = $confDBUser;\n\t\t$this->dbPassword = $confDBPasswd;\n\t\t$this->dbPort = (!empty($confDBPort)) ? intval($confDBPort) : 0;\n\t\t$this->dbName = $confDBName;\n\t\t$this->dbPrefix = $confDBPrefix;\n\n\t\t$this->statementCache = array();\n\n\t\t$this->debugMode = BwDebug::getDebugMode();\n\n\t\t$this->connect();\n\t}", "public function __construct()\n {\n $dbhost = 'localhost';\n $dbuser = 'root';\n $dbpass = '';\n $dbname = 'Northwind';\n \n mysql_connect('dbhost', 'dbuser', 'dbpass');\n \n mysql_select_db($dbname);\n }", "private function __construct() {\r\n mysql_connect($this->dbHost,$this->dbUser,$this->dbPass) or die(\"Mysql Connection Failed: \" . mysql_error());\r\n mysql_select_db($this->dbName) or die(\"Database 'carpool_db' Selection failed: \" . mysql_error());\r\n }", "public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n $this->conn = $db;\n }", "public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n $this->conn = $db;\n }", "public function __construct() {\n // Making a connection with the database\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "public function connectToDB() {}", "public function __construct() {\n $dsn = \"mysql:host=\".Configuration::DATABASE_HOST.\";dbname=\".Configuration::DATABASE_NAME;\n self::connect($dsn, Configuration::DATABASE_USER, Configuration::DATABASE_PASSWORD);\n }", "function __construct(){\n // se definen los datos del servidor de base de datos\n $conection['server']=\"localhost\"; //host\n $conection['user']=\"root\"; // usuario\n $conection['pass']=\"admin\"; //password\n $conection['base']=\"INNSADB\"; //base de datos\n\n // crea la conexion pasandole el servidor , usuario y clave\n $conect= mysql_connect($conection['server'],$conection['user'],$conection['pass']);\n mysql_set_charset('utf8',$conect);\n\n if ($conect) {// si la conexion fue exitosa , selecciona la base\n mysql_select_db($conection['base']);\n $this->con=$conect;\n }\n\n }", "function Database()\n {\n\t\t$config = new Config();\n\n\t\t$this->host = $config->host;\n\t\t$this->user = $config->user;\n\t\t$this->password = $config->password;\n\t\t$this->database = $config->database;\n \t\n\t}", "private function __construct()\n \n {\n $config = Config::getConfig(); // set singleton config object\n $host = $this->host = Config::getKeys('host');\n $user = $this->username = Config::getKeys('username');\n $password = $this->password = Config::getKeys('password');\n $database = $this->db = Config::getKeys('db');\n $this->newConnection($host, $user, $password, $database);\n // return $dbid; //dbid to the registrey\n \n }", "public function __construct() {\n $db = new Connection();\n $this->conn = $db->connect();\n }", "function __construct(){\n $this->_db = (new DataBaseServices())->connect();\n }", "public function getConnect()\n {\n $this->conn = Registry::get('db');\n }", "function __construct(){\n // Make connection to database\n $this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());\n mysql_select_db(DB_NAME, $this->connection) or die(mysql_error());\n \n }", "public function __construct(){\n\n // If the connection to server has already been made this will return a instance without creating a new connection to the server\n if(!isset(static::$serverConnection)) {\n\n // If connection to server is not established, new connection will be made and instance will be stored in $serverConnection property\n $dbConnection = new DBConnect();\n static::$serverConnection = $dbConnection->serverInstance();\n }\n\n // Will return the instance of the database aka server connection\n return static::$serverConnection;\n }", "public function __construct(){\n //get the configuration for connection to database\n $data_base_opt = System\\Config::get_instance()->get_database_config();\n // receiving object for working with database\n $this->database = System\\Safe_SQL::get_instance($data_base_opt);\n }", "public function connectDB() {}", "public function __construct() {\n\t\t$this->db = getDatabase();\n\t}", "function __construct($db_location, $db_user_name, $db_password, $db_name) { \n \n $this->db = MYSQL_CONNECT ($db_location, $db_user_name, $db_password) or DIE (\"Unable to connect to Database Server\");\n MYSQL_SELECT_DB ($db_name, $this->db) or DIE (\"Could not select database\");\n }", "public function __construct()\n {\n $this->db = ConnectionClass::conn();\n }", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->Connec = DBConnexion::getInstance();\r\n\t\t}", "public function __construct() {\n\t if($_SERVER['HTTP_HOST']=='127.0.0.1'){\n\t\t//local db\n\t\t$this->host= \"localhost\";\n\t\t$this->user=\"root\";\n\t\t$this->passwd=\"root\";\n\t\t\n\t\t$this->base=\"tvsp\";\n\t\t$this->online=false;\n\t }else{\n\t\t//Hosted db\n\t\t$this->host= \"mysql51-60.perso\";\n\t\t$this->user=\"tvshowpltvsp\";\n\t\t$this->passwd=\"tn5Ij2i7\";\n\t\t\n\t\t$this->base=\"tvshowpltvsp\";\n\t\t$this->online=true;\n\t }\n\t \n\t $this->con= mysql_connect($this->host,$this->user,$this->passwd) or die(\"Connexion\");\n mysql_select_db($this->base,$this->con) or die(\"Sélection de MaBase\");\n }", "public function __construct() {\n // Making a connection with the database\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "function __construct()\n\t{\n\t\t//the constructor requires, that a DB_HOST, DB_NAME, DB_USER and DB_PASS was previously defined.\n\t\t$host\t\t\t= DB_HOST;\n\t\t$dbname\t\t\t= DB_NAME;\n\t\t$user\t\t\t= DB_USER;\n\t\t$pass\t\t\t= DB_PASS;\n\n\t\t//establish the connection to the databse\n\t\t$conn = mysqli_connect($host, $user, $pass);\n\n\t\tif(!$conn) //if we failed to establish the connection - output error and stop executing php\n\t\t{\n\t\t\tdie(\"Connection to the database failed!\");\n\t\t}\n\n\t\t$this->conn = $conn; //save the connection resource in our object - maybe we need it later\n\n\t\t//select the database\n\t\t$db_sel = mysqli_select_db($this->conn, $dbname);\n\n\t\tif(!$db_sel) //throw error if database couldn't be selected and stop executing php\n\t\t{\n\t\t\tdie(\"Can't select database with name \" . $dbname . \" !\");\n\t\t}\n\n\t\t//this is to ensure, that mysql operates with characterset utf-8\n\t\t$this->query(\"SET NAMES 'utf8'\");\n\t}", "function __construct () {\n $lines = file('../../dbinfo.txt');\n\t $dbserver = trim($lines[0]);\n\t $uid = trim($lines[1]);\n\t $pw = trim($lines[2]);\n\t $dbname = trim($lines[3]);\n \n //Connect to the mysql server and get back our link_identifier\n $link = mysqli_connect($dbserver, $uid, $pw, $dbname)\n \t\t\tor die('Could not connect: ' . mysqli_error($link));\n $this->link = $link;\n }", "public function Database() {\r\n\r\n $this->hostname = \"localhost\";\r\n $this->database = \"skynet\";\r\n $this->user = \"root\";\r\n $this->pass = \"\";\r\n $this->connect();\r\n\r\n }", "public function __construct()\n {\n if ($this->conn = mysqli_connect(\"localhost\", \"root\", \"\")) {\n if (mysqli_select_db($this->conn, \"allcruddb\")) {\n// echo \"Database Connection Successfull\";\n }\n } else {\n echo \"Database Connection faild\";\n }\n }", "public function __construct() {\n\t\t$this->host = sfConfig::get('mod_main_host');\n\t\t$this->port = sfConfig::get('mod_main_port');\n\t\t$this->user = sfConfig::get('mod_main_user');\n\t\t$this->pass = sfConfig::get('mod_main_pass');\n\t\t$this->database = sfConfig::get('mod_main_database');\t\t\n\t\t$this->link = mysql_connect($this->host . ':' . $this->port, $this->user, $this->pass);\n\t \n\t\tif(!$this->link)\n\t\t\tthrow new CustomUOMySQLException('Connexion impossible a la BDD : ' . mysql_error($this->link));\n\t\t \n\t\t$base = mysql_select_db($this->database, $this->link);\t \n\t\tif (!$base)\n\t\t\tthrow new CustomUOMySQLException(mysql_error($this->link));\n\t}", "function database()\n\t{\n\t\t$this->host = DB_HOST;\n\t\t$this->user = DB_USER;\n\t\t$this->password = DB_PASS;\n\t\t$this->database = DB_NAME;\n\t\t\n\t\t$this->connect();\n\t}", "function connect()\n\t{\n\t\t$this->conn = mysql_connect($this->host, $this->user, $this->password) or $this->error(mysql_error(), __LINE__, __FILE__);\n\t\t$this->serverVersion = explode('.', preg_replace('/^(\\d+)\\.(\\d+)\\.(\\d+)(.*?)$/', '\\1.\\2.\\3', mysql_get_server_info()));\n\t\t$this->select_db();\n\t}", "function __construct()\n\t\t{\n\t\t\t$this->conn = $this->connect();\n\t\t}", "function __construct() {\r\n\r\n\t\t$this->link = @mysql_connect(SQL_HOST, SQL_LOGIN, SQL_PASSE);\r\n\t // or Database::busy();\r\n\t\tif ($this->link) {\r\n\t\t \tif (!@mysql_select_db (SQL_DBASE)) {\r\n\t\t\t\t$this->link = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//or Database::busy();\r\n\t}", "public function __construct(){\n // connect to database using pre-configured globals\n $this->connection = mysql_connect(CONF_DB,\n CONF_DB_USER,\n CONF_DB_PASSWORD)\n or die(W_DB_ERROR);\n // auto-check database environment\n $this->autoCheck();\n }", "function __construct()\n\t\t{\n\t\t\t$this->connection = Connection::database();\n\t\t}", "function __construct() {\r\n $instancia = Database::getInstance();\r\n\r\n $this->con = $instancia->getConexion();\r\n }", "public function __construct()\n {\n $this->_dbInstance = Database::getInstance();\n $this->_dbHandle = $this->_dbInstance->getConnection();\n }", "public static function connect() {\n $databaseConfig = Config::getDatabase();\n $databaseClass = $databaseConfig['class'];\n $databaseFile = SRC.'lib/db/databases/'.$databaseClass.'.php';\n if (!file_exists($databaseFile)) {\n throw new SynopsyException(\"Database class file '$databaseFile' doesn't exist!\");\n }\n require_once($databaseFile);\n $c = \"\\Synopsy\\Db\\Databases\\\\$databaseClass\";\n self::$instance = new $c();\n if (!self::$instance instanceof DatabaseInterface) {\n throw new SynopsyException(\"Database class '$databaseClass' doesn't implement DatabaseInterface interface!\");\n }\t\n self::$instance->connect($databaseConfig);\n }", "function __construct()\n\t{\n\t\t/* constructor just creates a connection to the database */\n\t\t$this->con = mysql_connect($this->host,$this->dbUser,$this->dbpass) or die(\"Error: Could not connect to database server!!!\");\n\t\tmysql_select_db($this->dbName,$this->con);\n\t}", "public function __construct()\n {\n $this->db = DataBase::dbConnect();\n }", "public function __construct(){\n\t\t\trequire_once(\"db/db.php\");\n\t\t\t$db = new DbConnect();\n\t\t\t$this->dbConn = $db->connect();\n\t\t}", "public function __construct()\n {\n $dbInstance= Database::getInstance();\n $this->db= $dbInstance->getdbConnection();\n }", "private function __construct() {\n\t\tself::$_host = Config::get('host');\n\t\tself::$_username = Config::get('username');\n\t\tself::$_password = Config::get('password');\n\t\tself::$_database = Config::get('database');\n\n\t\t/* Establish connection */\n\t\tself::$_connection = new \\mysqli(self::$_host, self::$_username, \n\t\t\tself::$_password, self::$_database);\n\t\n\t\t/* Error handling */\n\t\tif(mysqli_connect_error()) {\n\t\t\ttrigger_error(\"Failed to connect to MySQL: \" . mysqli_connect_error(), E_USER_ERROR);\n\t\t}\n\t}", "public function __construct() {\n\t\t$this->_dbhost\t\t= \"alexandrgmsperso.mysql.db\";\n\t\t$this->_dbname\t\t= \"alexandrgmsperso\";\n\t\t$this->_dbusername\t= \"alexandrgmsperso\";\n\t\t$this->_dbpassword\t= \"Alexandre2007\";\n\t\t$this->startConnection();\n\t}", "static function init(){\n if (!self::$conn) {\n $KEYS = new Keys();\n $hostname = $KEYS->DATABASE_HOST;\n $dbname = $KEYS->DATABASE_NAME;\n $username = $KEYS->DATABASE_USERNAME;\n $password = $KEYS->DATABASE_PASSWORD;\n $db = $db = ($KEYS->DATABASE_TYPE == \"\")? \"mysql\": $KEYS->DATABASE_TYPE;\n $port = $port = ($KEYS->DATABASE_PORT == \"\")? \"\": \"port={$KEYS->DATABASE_PORT};\";\n \n self::$conn = null;\n \n try {\n self::$conn = new PDO(\"{$db}:host={$hostname};{$port}dbname={$dbname}\", $username, $password);\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch(PDOException $exception) {\n Response::send(null, 500, \"Connection error: \" . $exception->getMessage());\n }\n }\n }", "final public function __construct() {\n\t\t//lets start by connecting to the db\n\t\t$conn = new Database;\n\t\t$this->_dbh = $conn->connect();\n\n\t\tif (!$this->_dbh) {\n\t\t\t$db_response = $conn->getResponse();\n\t\t\t$this->setError($db_response['reason']);\n\t\t\t$this->_dbh = null;\n\t\t}\n\t\t$conn = null;\n\t}", "protected function CeateDatabaseConnection()\r\n\t{\r\n\t\t// Create an instance of the database for use in the system\r\n\t\tif($this->InProduction($_SERVER['SERVER_NAME']))\r\n\t\t\t//$this->Database\t= new Database('gstour.db.4628821.hostedresource.com','gstour','Golf1215','gstour');\r\n\t\t\t$this->Database\t= new Database('97.74.149.114','gstour','Golf1215','gstour');\r\n\t\telse\r\n\t\t\t$this->Database\t= new Database('localhost','root','','test');\r\n\t}", "public function __constructor() {\n //la variabile debug mi distingue i casi online o offline\n \n //return $this->getConnection();\n }", "public function __construct() {\n \trequire_once 'connection.php';\n\n $database = new Connection();\n\t\t$this->database = $database;\n }", "public function __construct() {\n $this->db = new Database();\n $this->con = $this->db->connect();\n }", "public function __construct() {\r\n $this->conn = PersistentManager::getInstance()->get_connection();\r\n }", "public function __construct(){\n\t\t\t$this->dsn = 'mysql:host=localhost;dbname=renova';\n\t\t\t$this->username = 'root';\n\t\t\t$this->password ='';\n\t\t\t$this->connection();\n\n\t\t}", "public function __construct() {\t\tif(enable_database == true) {\n\t\t\t$this->db = database::instance();\n\t\t\t$this->db->connect();\n\t\t}\n\t}", "function __construct() {\n $dbInfo = getDatabasebAccessInfo();\n\n $this->con = new mysqli($dbInfo['hostname'], $dbInfo['username'], $dbInfo['password'], $dbInfo['database']);\n $this->con->set_charset(\"utf8\");\n \n if(!$this->con) {\n die(\"Oops we have a problem connecting to the database, plz contact site admin..\");\n }\n }", "function DBClass()\n {\n // Load settings from parent class\n $settings = DatabaseSettings::getSettings();\n \n // Get the main settings from the array we just loaded\n $host = $settings['dbhost'];\n $name = $settings['dbname'];\n $user = $settings['dbusername'];\n $pass = $settings['dbpassword'];\n \n // Connect to the database\n $this->link = new mysqli($host, $user, $pass, $name);\n }", "function __construct() {\n global $db;\n $this->db_conn = mysql_connect(DB_HOST, DB_USER, DB_PASS); \n if ($this->db_conn) {\n if (!mysql_select_db(DB_NAME)) {\n throw new Exception('Database (' . DB_NAME . ') does not exists!');\n }\n }\n else {\n throw new Exception('Could not connect to database with the provided credentials!');\n }\n $this->last_query = '';\n }", "function __construct() {\n\n $this->dbserver = \"MYSQL5005.Smarterasp.net\";\n $this->username = \"9b0406_fm\";\n $this->password = \"vasusubramaniyam\";\n $this->dbname = \"db_9b0406_fm\";\n }", "public function __construct()\n\t{\n\t\t$this->db = MySQLdb::getInstance()->getDatabase();\n\t}", "function db()\n\t{\n\t\tglobal $dbhost, $dbuser, $dbpass, $dbname;\n\t\t$this->db_server_link = @mysql_connect($dbhost, $dbuser, $dbpass);\n\t\tmysql_select_db($dbname, $this->db_server_link) ;\n\t}", "function __construct()\n {\n $con_obj = new ConnectionClass();\n $this->con = $con_obj->getConnection();\n }", "public function __construct(){\n $database = new Database();\n $db = $database->dbConnection();\n $this->conn = $db;\n }", "private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}", "function __construct() {\n $this->createConnection();\n }", "private function init()\n {\n // connessione al mysql server\n if (!$this->link = mysql_connect( $this->hostname\n , $this->user_name\n , $this->user_pswd))\n {\n $this->set_error( 'Could not connect to mysql' );\n return;\n }\n\n // seleziona il database\n if (!mysql_select_db($this->user_db, $this->link))\n {\n $this->set_error( 'Could not select database' );\n return;\n }\n }", "public function __construct(){\r\n\r\n $db = new DB;\r\n\r\n $this->db = $db->get_connection();\r\n\r\n }", "public function __construct() {\n $this->_db = DB::connect();\n }", "private function __construct($_host = \"\", $_user = \"\", $_pass = \"\", $_default_db = \"\",$_driver=\"\") {\n\t\t$this->connect($_driver,$_host,$_user,$_pass,$_default_db);\n\t\t//register_shutdown_function(array($this, \"close\"));\n\t}", "public function __construct(){\n $this->connectToDatabase();\n }", "private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }", "public function connect() {\r\n\t\t$this->connection = mysql_connect($this->host, $this->username, $this->password);\r\n\t\t$this->selectDB($this->squema);\r\n\t}", "function __construct(){\n require_once dirname(__FILE__) . '/DBConnect.php';\n $db = new DbConnect;\n $this->con = $db->connect();\n }", "function __construct(){\n\t $host = \"localhost\";\n\t $user = \"cs130\";\n\t\t $pw = \"test\";\n\t\t $db = \"CS130\";\n $this->db_connection = mysql_connect($host, $user,$pw);\n mysql_select_db($db, $this->db_connection);\n if(!$this->db_connection)\n {\n $errmsg = mysql_error($this->db_connection);\n print \"Connection failed: $errmsg <br />\";\n exit(1);\n }\n }", "private function databaseConnection()\n {\n // Les connexions sont établies en créant des instances de la classe de base de PDO\n $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);\n $this->db = new PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS, $options);\n }", "public function __construct() {\n $this->connection = $this->create_connection();\n }", "public function __construct() {\n\t\t$host = MYSQL_HOST;\n\t\t$user = MYSQL_USER;\n\t\t$password = MYSQL_PASSWORD;\n\t\t$database = MYSQL_DATABASE;\n\n\t\t/*\n\t\t if (!$con = mysql_connect($host,$user,$password)) {\n\t\t\tthrow new Exception('Error connecting to the server');\n\t\t\t}\n\n\t\t\tif (!mysql_select_db($database,$con)) {\n\t\t\tthrow new Exception('Error selecting database');\n\t\t\t}\n\t\t\t*/\n\n\t\t$this->connection = mysql_connect($host, $user, $password) or die(mysql_error());\n\t\tmysql_select_db($database, $this->connection);\n\t}", "function __construct($tns = TNS, $usr = DB_SERVER_USERNAME, $pwd = DB_SERVER_PASSWORD,$dbName = DB_NAME) \n {\n\t\t\t$this->connectionStatus = false;\n\t\t\t$this->connect($tns, $usr, $pwd,$dbName);\n\t\t}", "function __construct() {\n require_once 'DB_Connect.php';\n // connecting to database\n try{\n $this->db = DB_Connect::connect();\n }catch(Exception $e)\n {\n die($e->getMessage());\n }\n \n \n }", "function __construct() {\r\n\t\t\r\n\t\tglobal $useDB, $dbTable;\r\n\t\t\r\n\t\t$this->ok = false;\r\n\t\tif( !$useDB ) return;\r\n\t\t\r\n\t\t$this->table = $dbTable;\r\n\t\t$this->state = 0;\r\n\t\t$this->connect();\r\n\t}", "function __construct()\r\n\t\t{\r\n\t\t\t$connect = mysql_connect(\"localhost\", \"root\", \"\");\r\n\t\t\t$db = mysql_select_db(\"mvc_php\");\r\n\t\t}", "public function __construct()\n\t{\n\t\t$this->conn = mysqli_connect($this->servername, $this->username, $this->password, $this->dbname);\n\t}", "function __construct() {\n $connector = new DbConnection();\n $conn = $connector->connect(); \n }", "function __construct() {\n require_once dirname(__FILE__) . '/DBConnect.php';\n\n //Creating a DbConnect object to connect to the database\n $db = new DbConnect();\n\n //Initializing our connection link of this class\n //by calling the method connect of DbConnect class\n $this->con = $db->connect();\n }", "function __construct(){\n\t\t$this->connect = mysqli_connect($this->host, $this->uname, $this->pass, $this->db);\n\t}", "function __construct(){\n\t\t\n\t\t\t$this-> host = 'localhost';\n\t\t\t$this -> user = 'root';\n\t\t\t$this -> pass = 'root';\n\t\t\t$this -> db = 'cc409_perros';\n\t\t\n\t\t}", "public function __construct()\r\n {\r\n if(self::$pdo == null) {\r\n try {\r\n self::$pdo = new \\PDO(self::$dbHost,\r\n self::$dbUser,\r\n self::$dbPassword);\r\n } catch(\\PDOException $e) {\r\n // If we can't connect we die!\r\n die(\"Unable to select database\");\r\n }\r\n }\r\n }", "function __construct()\n {\n $this->dataBase = new Database(\n Conf::get('pkg_db_host'),\n Conf::get('pkg_db_port'),\n Conf::get('pkg_db_user'),\n Conf::get('pkg_db_password'),\n Conf::get('pkg_db_name'),\n Conf::get('pkg_db_usefav_table'));\n }", "function __construct() {\n\t\t$this->connection = new mysqli($_SERVER['DB_SERVER'],$_SERVER['DB_USER'],$_SERVER['DB_PASSWORD'],$_SERVER['DB']);\n\t\tif($this->connection->connect_error){\n\t\t\techo \"connect failed:\".mysqli_connect_error();\n\t\t\tdie();\n\t\t}\n\t}", "function __construct() {\n $this->open_db_connection();\n }", "public function connect_db() {\n }", "protected function initDatabase() {\n\t\t$this->config\t\t= new Config();\n\t\tDatabase::$host\t\t= $this->config->host;\n\t\tDatabase::$username\t= $this->config->username;\n\t\tDatabase::$password\t= $this->config->password;\n\t\tDatabase::$dbname\t= $this->config->dbname;\n\t}" ]
[ "0.78863835", "0.773024", "0.76730525", "0.7642769", "0.76376104", "0.76265347", "0.76168025", "0.76142603", "0.7609701", "0.75906605", "0.75386673", "0.75238657", "0.75219053", "0.7510426", "0.7488682", "0.7488682", "0.7486154", "0.74787134", "0.7470428", "0.74667263", "0.7458231", "0.74549097", "0.74492764", "0.7448857", "0.7445876", "0.74322027", "0.74211526", "0.7416586", "0.7397834", "0.7387608", "0.7385063", "0.73779905", "0.7376518", "0.7375605", "0.7367218", "0.73635083", "0.73553073", "0.73512036", "0.73393816", "0.73274493", "0.7322629", "0.73197454", "0.73166054", "0.7316371", "0.730646", "0.73044425", "0.73027605", "0.7302332", "0.72973037", "0.72954345", "0.7291415", "0.7289624", "0.72839785", "0.7258965", "0.7254955", "0.7253792", "0.7252123", "0.72517604", "0.7241454", "0.72410107", "0.7237625", "0.7230343", "0.7214171", "0.7211497", "0.7210613", "0.72092056", "0.72089356", "0.7206281", "0.72058946", "0.7202458", "0.7199031", "0.7186382", "0.7185053", "0.7183833", "0.71819276", "0.7181044", "0.71798265", "0.7179203", "0.71757656", "0.7175475", "0.7169782", "0.7168965", "0.71685165", "0.7165097", "0.71608526", "0.71584815", "0.7155471", "0.71530676", "0.7152471", "0.71485996", "0.71485806", "0.7147288", "0.71348065", "0.712824", "0.7126222", "0.7116465", "0.7114571", "0.7113389", "0.71094775", "0.7106702", "0.7106054" ]
0.0
-1
function is used to set the query and will return the resource identifier
function query($query){ if($query){ $result = mysql_query($query); return $result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryId( $query, $type='f' )\n\t{\n\t\treturn $type.\"_\".MANUFACTURER_ID.\"_\".crc32 ( $query );\n\t}", "protected function getIdQuery()\n {\n return $this->idQuery;\n }", "public function getResourceID()\n {\n return $this->get('ResourceID');\n }", "public function getResourceID()\n {\n return $this->get('ResourceID');\n }", "public function getResourceID()\n {\n return $this->get('ResourceID');\n }", "public function getResourceID()\n {\n return $this->get('ResourceID');\n }", "function getResourceTypeIdFromResource($id){\n return sqlSelectOne(\"SELECT * FROM resources WHERE resource_id='$id'\", 'resource_type');\n}", "public function getQuestionId()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question\";\r\n\r\n return $query_string;\r\n}", "public function getResourceId();", "public function getResourceId();", "public function get_queried_object_id()\n {\n }", "public function getResourceId()\n {\n $this->resourceId;\n }", "protected function QueryForID_() {\n $table = Database::GetAccountTypeTableName($this->accountType);\n $queryStr = \"SELECT id FROM {$table} WHERE username='{$this->username}';\";\n\n $result = $this->db->sql->query($queryStr);\n\n if ($result && $result->num_rows > 0) {\n $this->id = $result->fetch_assoc()[\"id\"];\n $result->free();\n }\n }", "function getResourceDesc($id){\n return sqlSelectOne(\"SELECT * FROM resources WHERE resource_id={$id}\", 'resource_identifier');\n}", "public abstract function get_query();", "public function searchId()\n\t{\n\t\t$searchId = self::searchNamespace() . '-' . $this->id;\n\t\treturn $searchId;\n\t}", "public function _query()\n {\n }", "private function selectResourceID()\n {\n $result = $this->sdb->query('select nextval(\\'resource_id_seq\\') as id',array());\n $row = $this->sdb->fetchrow($result);\n return $row['id'];\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function getByID($queryID, $schemaKey = 'default');", "protected function _getPrimaryId()\n {\n return $this->_getParam($this->_getPrimaryIdKey());\n }", "function query() {}", "function query() {\n }", "public function id()\n {\n return $this->resource->getKey();\n }", "public function getSystemId()\r\n{\r\n $query_string = \"SELECT systemid FROM voting_system \";\r\n $query_string .= \"WHERE systemname = :systemname\";\r\n\r\n return $query_string;\r\n\r\n}", "function rest_get_queried_resource_route()\n {\n }", "public function itemQuery()\n {\n return $this->item($this->getInput('id'));\n }", "abstract public function\r\n\t\tget_query_for_something();", "public function getResourceId()\n {\n return $this->resourceId;\n }", "public function getResourceId()\n {\n return $this->resourceId;\n }", "function createQuery() ;", "public function getRequestedId() {}", "public function get_resource_index(){\n return $this->resource_index;\n }", "function query() {\n $this->field_alias = $this->real_field;\n }", "function query() {\n $this->field_alias = $this->real_field;\n }", "function get_queried_object_id()\n {\n }", "public function getSearchedId()\n {\n return $this->get(self::_SEARCHED_ID);\n }", "abstract public function get_id();", "function resource() {\n $value=clean_input($_GET['value']);\n $res=dbHelp::mysql_query2(\"select resource_id,resource_name from resource where resource_status<>2 and resource_type=\" . $value);\n for ($i=0;$i<dbHelp::mysql_numrows2($res);$i++) {\n // mysql_data_seek($res,$i);\n $arr=dbHelp::mysql_fetch_array2($res);\n echo \"<name>\" . $arr['resource_name'];\n echo \"<value>\" . $arr['resource_id'];\n }\n}", "function getPrimaryRequest($oldPrimary)\n{\n\t$primaryReq = getIdentifier().\"\\t\".\"GET_PRIMARY\".\"\\t\".$oldPrimary;\n\treturn $primaryReq;\n}", "function getResourceTypeId($name){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_name='$name'\", 'type_id');\n}", "function resourceForQuery($query) {\n $result = mysql_query(replaceConstantForQuery($query)) or trigger_error(mysql_error() . \" @ \" . $query);\n \n return $result;\n }", "public function query() {\n $this->field_alias = $this->real_field;\n }", "protected static function id(): mixed\n\t{\n\t\treturn self::$query->id;\n\t}", "protected static function id(): mixed\n\t{\n\t\treturn self::$query->id;\n\t}", "public function query()\n\t{\n\t\t\n\t}", "abstract protected function getQuery();", "public function resourceId(): int\n {\n return $this->model->id;\n }", "public function get_id();", "public function get_id();", "public function query();", "public function query();", "public function query();", "public function getIdentifier()\n {\n return TranslatableResourceIdentifier::forResource($this->type, $this->item->displayTitle($this->item->id()))\n ->setProject($this->project);\n }", "abstract public function query();", "public function get_resource();", "abstract protected function initQuery(): void;", "public static function query();", "function query($query) \n \t{\n \t\tif ( is_object($query) )\n \t\t\t$queryString = $query->getSQL();\n \t\telse\n \t\t\t$queryString = $query;\n \t\t\t\n \t\tif ($this->queryId) \n \t\t{\n \t\t\t@mysql_free_result($this->queryId);\n \t\t\t$this->queryId = 0;\n \t\t}\n\n \t\t$this->queryId = @mysql_query($queryString, $this->linkId);\n\t \tif (!$this->queryId)\n\t \t{\n\t \t\techo $query . \"<br>\";\n\t \t\tnew CException(mysql_error(), __FILE__, __LINE__);\n\t \t}\n\n \t\t$this->row = 0;\n \t\t\n \t\treturn $this->queryId;\n \t}", "function set_query($query) {\n\t\t\t// it just sets the query with which to get a recordset\n\t\t\t$this->query = $query;\n\t\t}", "public function get_id()\n {\n }", "function addQuery() {}", "public function fetch( $query_id=null );", "function getQuery() ;", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_identification\n\t\t\t\tWHERE idf_id=?\";\n\t\t$this->db->query($sql, array($this->idf_id));\n\t\treturn $query;\n\t}", "public function fetch_the_id() {}", "public function Query(){\n\t}", "public function Query(){\n\t}", "public function Query(){\n\t}", "public function query() {\n\n }", "public static function query()\n {\n }", "public function getResourceId(): ?string;", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function __toString() {\n return $this->getQueryId();\n }", "private function getRdfResourceId() {\r\n return 'RDF#'.$this->rdfResourceId;\r\n }", "abstract function query( $p_filter_input );", "final public function getResourceId() {\n return $this->resourceId;\n }", "function set_queried_object( $object, WP_Query &$query = null )\n {\n global $wp_query;\n\n if ( ! isset( $query ) ) {\n $query = &$wp_query;\n }\n\n $query->queried_object = $object;\n $query->queried_object_id = ( isset( $object->ID ) ? (int) $object->ID : 0 );\n }", "public function getQuery() {}", "public function getQuery() {}", "function getID();", "public function hook_query_index(&$query) {\n/*\t //Your code here\n $userId = CRUDBooster::myId();\n//\t echo $userId;\n\t $isAdmin = CRUDBooster::isSuperadmin();\n\t $storeAssignedtoUser = DB::table('srv_centers')\n ->where('cms_user_id', '=', $userId)\n ->first();\n\t if ($isAdmin) {\n\n\t }else {\n\t $query->where('cms_users.id',$storeAssignedtoUser->cms_user_id);\n\t }\n*/\n\t }", "public function getSearchId()\n {\n return $this->getAdditionalParam('searchId', '');\n }", "public abstract function getQuery();", "public function getSearchableId()\n {\n return $this->id;\n }", "public function query()\n {\n }", "public function query()\n {\n }", "public function getResourceId()\n {\n if (array_key_exists(\"resourceId\", $this->_propDict)) {\n return $this->_propDict[\"resourceId\"];\n } else {\n return null;\n }\n }", "public function getID()\n { return $this->get('id'); }", "abstract public function queryOne($Qs);" ]
[ "0.61131465", "0.58975387", "0.58565223", "0.58565223", "0.58557063", "0.58557063", "0.5791263", "0.57820714", "0.57602996", "0.57602996", "0.574147", "0.57366544", "0.5694592", "0.56921256", "0.5669476", "0.56639874", "0.5659127", "0.56484735", "0.56422174", "0.56422174", "0.56422174", "0.56422174", "0.56422174", "0.56422174", "0.56422174", "0.56422174", "0.56422174", "0.5621969", "0.5586085", "0.55634415", "0.55404246", "0.5525116", "0.5519432", "0.55170757", "0.5506328", "0.5483302", "0.54824203", "0.54824203", "0.54517734", "0.54429287", "0.5413454", "0.54132235", "0.54132235", "0.5376151", "0.53693813", "0.53621686", "0.53602123", "0.5338756", "0.5325967", "0.5322858", "0.5317603", "0.5312879", "0.5312879", "0.53092134", "0.53082514", "0.5295665", "0.52942747", "0.52942747", "0.52941984", "0.52941984", "0.52941984", "0.5279577", "0.5269131", "0.52618146", "0.526035", "0.52470905", "0.5246541", "0.5244107", "0.5233723", "0.5232483", "0.52318555", "0.52309847", "0.52258575", "0.52108324", "0.5209963", "0.5209963", "0.5209963", "0.519985", "0.51988417", "0.51881486", "0.5187301", "0.5187301", "0.5187301", "0.51861924", "0.51853716", "0.5174749", "0.5160514", "0.5159298", "0.51578116", "0.51566684", "0.51566684", "0.51471347", "0.5145849", "0.5144883", "0.51336884", "0.51163125", "0.5102402", "0.5102402", "0.5100529", "0.50904226", "0.50793874" ]
0.0
-1
function is used to set and get the password
function setPassword($password){ $password = base64_encode($password); $salt5 = mt_rand(10000,99999); $salt3 = mt_rand(100,999); $salt1 = mt_rand(0,25); $letter1 = range("a","z"); $salt2 = mt_rand(0,25); $letter2 = range("A","Z"); $password = base64_encode($letter2[$salt2].$salt5.$letter1[$salt1].$password.$letter1[$salt2].$salt3.$letter2[$salt1]); return str_replace("=", "#", $password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPassword(){\n\n}", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword() {}", "public function getPW() {}", "public function setPassword(){\n\t}", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword(): string;", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "function get_password($usrid){\r\n\t\r\n}", "public function setPassword($value);", "protected function getConfiguredPassword() {}", "public function getSecuredPassword();", "public function getAuthPassword()\n {\n }", "public function getAuthPassword()\n {\n }", "public function getAuthPassword()\n {\n }", "private function getPassword(): string {\n return $this->password;\n }", "public function password()\n {\n }", "public function necesitaCambiarPassword();", "private function getPassword()\n {\n return $this->password;\n }", "public function getPassword(): string\n {\n }", "public function getPassword()\n {\n // TODO: Implement getPassword() method.\n }", "public function getPassword()\n {\n // TODO: Implement getPassword() method.\n }", "public function olvidoPassword(){\n\t}", "public function get_pass() \n {\n return $this->pass;\n }", "function getPassword(){\n $options = sciploreDataAccessBundle::getGeneralOptions();\n //$options = $container->get('sciplore.options')->getGeneralOptions();\n $require_password = $options['authentifiaction_requires_password']; \n if($require_password==1){\n return $this->passphrase;\n }\n else{\n //hardcoded random default password. Must be sent by the authentification form in a hidden field.\n return 'WnDadvfhWqoJnHuXtyxwZxGbfHsXrNwI3Idns4d2Ie9BnEjYnr14ijyCr0YPg7i';\n }\n }", "function update_password()\n {\n }", "private function getPassword()\n {\n return $this->user->getPassword();\n }", "public function get_strPassword()\n {\n return $this->strPassword;\n }", "public function password($password);", "protected function changePassword() {}", "public function getPassword()\n {\n return $this->__get(\"password\");\n }", "function temp_pass(){\n\treturn 'password199';\n}", "public function getPassword(){\n return $this->password;\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "public function get_password()\n {\n return $this->_password;\n }", "public function get_password()\n {\n return $this->_password;\n }", "public function getPassword() {\r\n\t\treturn NULL;\r\n\r\n\t}", "public function getPassword(){\r\n\t\t\treturn $this->password;\r\n\t\t}", "public function getPassword(){\n return $this->password;\n }", "public function restPassword(){\n\t}", "public function getPassword() {\n return $this->getValue('password');\n }", "public function getPassword():? string;", "protected function password()\n {\n return 'password';\n }", "function getPassword() {\n return $this->password;\n }", "function getPassword() {\n return $this->password;\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public static function getPassword() \n { \n return emailSettings::$password; \n }", "public function getPassword()\n {\n $encrypted_pass = Mage::getStoreConfig('smsnotifier/main_conf/apipassword');\n\n return Mage::helper('core')->decrypt($encrypted_pass);\n\n }", "public function getPassword(): string\n {\n return $this->password;\n }", "public function setPW($dw) {}", "public function getPassword(){\n include('password.php');\n return $DATABASEPASSWORD;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function setPassword($newPassword);", "public function getPassword() : ?string ;", "function password_recovery()\n\t{\n\n\n\t}", "public function getPassword(){\n return $this->password;\n }", "public function getPassword()\r\n {\r\n return $this->password;\r\n }", "public function getAuthPassword()\n {\n // TODO: Implement getAuthPassword() method.\n }", "public function setPasswordField($password = true) {}", "public function getPassword()\r\n {\r\n return $this->password;\r\n }", "public function getPassword(){\n\t\t\treturn $this->password;\n\t\t}", "public function getPassword() : string\r\n\t{\r\n\t\treturn $this->password;\r\n\t}", "protected function getPassword()\r\n {\r\n return $this->processor_data['processor_params']['password'];\r\n }", "function getFieldPassword(){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_password');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_password');\n\t\t$tooltip = setToolTipNotification('password');\t\t\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.\"<span class='red'>*</span>\".$tooltip.\"</label><br><input type='password' name='newpassword' value='' class='' id='password'></br><div id='password_err_con'></div>\";\t\t\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function getPassword()\n {\n return $this->Password_user;\n }", "function set_password($string) {\r\n echo PHP_EOL;\r\n $this->action(\"setting new password of: $string\");\r\n $this->hashed_password = hash('sha256', $string . $this->vehicle_salt);\r\n $this->action(\"successfully set new password\");\r\n }", "public function getPassword( ) {\n\t\treturn $this->password;\n\t}", "function rest_get_authenticated_app_password()\n {\n }", "public function getPassword() {\r\n\t\treturn $this->password;\r\n\t}", "public function getPassword() {\n\t\tif( !isset($this->password) ){\n\t\t\t$this->generateLevelPassword();\n\t\t}\n\t\treturn $this->password;\n\t}", "public function password(){\n $_error = \"enter the password\";\n\t\treturn $_error;\n\t}", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }" ]
[ "0.8498597", "0.84889394", "0.84889394", "0.84889394", "0.84889394", "0.84889394", "0.84889394", "0.84889394", "0.847767", "0.8379514", "0.8256277", "0.82170206", "0.82170206", "0.82170206", "0.82170206", "0.82170206", "0.82170206", "0.8089938", "0.8083054", "0.80457836", "0.7963829", "0.7952575", "0.7950479", "0.7927999", "0.7927999", "0.7927999", "0.7924217", "0.78871423", "0.78632605", "0.78166354", "0.77878696", "0.77553016", "0.77553016", "0.77089137", "0.7685764", "0.76698613", "0.76415116", "0.76174784", "0.76101804", "0.76061857", "0.75925523", "0.7574082", "0.75638723", "0.75582564", "0.75411546", "0.75411546", "0.75411546", "0.75336", "0.75336", "0.7530972", "0.7521528", "0.75179577", "0.75012636", "0.74887663", "0.7481068", "0.74785596", "0.74756616", "0.74756616", "0.74678904", "0.74674493", "0.7465131", "0.7449228", "0.7436722", "0.74221647", "0.7419508", "0.7419508", "0.7419269", "0.7417144", "0.74121535", "0.7411245", "0.74031824", "0.73994976", "0.7392224", "0.73909706", "0.7381198", "0.7368694", "0.736504", "0.7331519", "0.7322854", "0.7322686", "0.7295859", "0.72891927", "0.72836107", "0.727581", "0.7275269", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453", "0.7259453" ]
0.0
-1
function is used to register device Params required: first_name,lase_name,phone,email,user_name,password. return status, message and user_id
function userRegistration($data){ $response = array(); $requiredData['email'] = @trim($data->email); $requiredData['user_name'] = @trim($data->user_name); $requiredData['password'] = $this->setPassword(@trim($data->password)); foreach($requiredData AS $key=>$val){ if(trim($val) == ''){ $response['status'] = 'Error'; $response['message'] = 'Please Specify '.ucwords(str_replace("_"," ",$key)); return $response; } } if($this->checkUserByUserName(addslashes($requiredData['user_name']))){ $response['status'] = 'Error'; $response['message'] = 'User already exists with this user name '. $requiredData['user_name']; return $response; } if($this->checkUserByEmail(addslashes($requiredData['email']))){ $response['status'] = 'Error'; $response['message'] = 'User already exists with this email '.$requiredData['email']; return $response; } $query = "INSERT INTO `users` (`email`, `user_name`, `password`, `auth_code`, `user_type`, `logtime`) VALUES ('".$requiredData['email']."', '".$requiredData['user_name']."', '".$requiredData['password']."', '".@trim($data->password)."', '1', '".date('Y-m-d H:i:s')."')"; $this->query($query); $user_id = $this->lastInsertedId(); /*$to = $requiredData['email']; $subject = "TrackMyHeritage account "; $tokan = $this->setPassword($requiredData['user_name']."#/#".$user_id); $message = "Dear ".$requiredData['user_name'].",<br><br> Thanks for registered with TrackMyHeritage!<br> Your account has been created successfully. Your login credentials are given below:<br> <b>User Name - ".$requiredData['user_name']." <br> Password - ".@trim($data->password)." <br><br></b> If you didn't sign up to TrackMyHeritage, please discard this e-mail and we won't e-mail you again.<br><br> With Regards<br> Team Support"; $this->sendMail($message,$to,$subject,$from=CONTACT_EMAIL);*/ $response['status'] = 'Success'; $response['message'] = 'User registered successfully'; $response['user_id'] = $user_id; $response['user_name'] = $requiredData['user_name']; $response['user_type'] = 1; return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registration(){\n\t\t\n\t\tif (($name = $this->input->get_post('name')) && ($emailId = $this->input->get_post('emailId')) && \n ($mobileNo = $this->input->get_post('mobileNo')) && ($password = $this->input->get_post('password')) && \n ($branchId = $this->input->get_post('branchId'))) {\n\t\t\t$data = array(\n 'name' => $name,\n 'email' => $emailId,\n 'phone' => $mobileNo,\n 'password' => $password,\n 'shop_id' => $branchId\n );\n $ret = $this->Lootel_model->registration($data);\n\t\t\tif($ret){\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",\"userid\"=>$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not saved\");\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\t\n\t\techo json_encode($response);\n\t}", "function register()\n {\n \t\t$data = file_get_contents('php://input');\n \t\t$this->logservice->log($this->module_name, \"DEBUG\",\"EVENT\",$this->IP,\"$data \");\n\t\t$busData = json_decode($data ,true);\n\t\t//查找是否有重名\n\t\t$criteria = array();\n\t\t$criteria[\"and\"] = array(\"Name\" => $busData[\"name\"]);\n\t\t$result = $this->User->count_results($criteria);\n\n\t\tif ($result > 0) {\n\t\t\t$rspData[\"userID\"] =0;\n\t\t\t$rspData[\"state\"] = \"ERRO\";\n\t\t\t$rspData[\"erroInfo\"] = \"该用户名已经被使用\";\n\n\t\t\t$rspInfo = json_encode($rspData);\n\t\t\techo $rspInfo;\n\t\t\treturn;\n\t\t}\n\t\t$data_in = array();\n\t\t$data_in[\"Role_Id\"] = 2;\n\t\t$data_in[\"Password\"] = $busData[\"password\"];\n\t\t$data_in[\"Name\"] = $busData[\"name\"];\n\t\t$data_in[\"Phone\"] = $busData[\"name\"];\n\t\t$data_in[\"UpLoad\"] = 0;\n\t\t$data_in[\"DownLoad\"] = 0;\n\t\t$data_in[\"Status\"] = 0;\n \n\t\t$result = $this->User->create($data_in);\n\t\tif ($result) {\n\t\t\t$criteria = array();\n\t\t\t$criteria[\"and\"] = array(\"Name\" => $busData[\"name\"]);\n\t\t\t$userDat = $this->User->read($criteria);\n\t\t\tif (!empty($userDat)) {\n\t\t\t\t\n\t\t\t\t$rspData[\"userID\"] =$userDat[0][\"User_Id\"];\n\t\t\t\t$rspData[\"state\"] = \"OK\";\n\t\t\t\t$rspData[\"erroInfo\"] = \"注册成功ID为\".$userDat[0][\"User_Id\"];\n\n\t\t\t\t$rspInfo = json_encode($rspData);\n\t\t\t\techo $rspInfo;\n\t\t\t}\n\n\t\t}\n }", "function register($firstName,$lastName,$Category,$phoneNumber,$Email,$ageBracket,$Country,$countryCode,$Gender,$Town,$Location,$stallNumber,$Status,$xikilaAccount,$bancoAccount,$wantBancoAccount){\n \n try {\n\n $userID = \"V\".\".\".\"1\".\".\".$phoneNumber;\n $categoryCode = \"V\";\n $db = new Database();\n $db->connect();\n $sql = \"insert into registration (userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,location,stallnumber,\n userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate ) \n values (:userID,:firstName,:lastName,:Category,:categoryCode,:phoneNumber,:Email,:ageBracket,:Country,:countryCode,:Gender,:Town,:Location,:stallNumber,:Status,:xikilaAccount,:bancoAccount,:wantBancoAccount,now())\";\n \n $params = array(\n \t\":userID\" => $userID,\n \t\":firstName\" => $firstName,\n \":lastName\" => $lastName,\n \":Category\" => $Category,\n \":categoryCode\" => $categoryCode,\n \":phoneNumber\" => $phoneNumber,\n \":Email\" => $Email,\n \":ageBracket\" => $ageBracket,\n \":Country\" => $Country,\n \":countryCode\" => $countryCode,\n \":Gender\" => $Gender,\n \":Town\" => $Town,\n \":Location\" => $Location,\n \":stallNumber\" => $stallNumber,\n \":Status\" => $Status,\n \":xikilaAccount\" => $xikilaAccount,\n \":bancoAccount\" => $bancoAccount,\n \":wantBancoAccount\" => $wantBancoAccount,\n );\n $i = $db->runUpdate($sql,$params);\n } catch(PDOException $ex) {\n echo $ex->getMessage();\n } \n\n return \"Vendor added Successfully\"; \n }", "public function register($request){\n $apikey = $request->get_header('apikey');\n $this->is_apikey($apikey); \n if(empty($this->apiKey)):\n return array(\n 'message' => 'Unauthorized',\n 'error' => 'Unauthorized',\n 'code' => 'Unauthorized',\n 'data' => array(\n 'error' => 'Unauthorized',\n 'status' => Sis_Rest_Public::HTTP_UNAUTHORIZED,\n ),\n ); \n endif;\n\n $email = sanitize_email($request->get_param('email'));\n $username = sanitize_user( $request->get_param('username'));\n $password = esc_attr( $request->get_param('password'));\n $fname = sanitize_text_field($request->get_param('fname'));\n $lname = sanitize_text_field($request->get_param('lname'));\n $deviceId = $request->get_param('deviceId');\n $deviceType = $request->get_param('deviceType');\n $deviceToken = $request->get_param('deviceToken');\n\n \n $exists = email_exists( $email );\n\n if ( !$exists ) {\n $userdata = array(\n 'user_login' => $username,\n 'user_email' => $email,\n 'user_pass' => $password,\n 'first_name' => $fname,\n 'last_name' => $lname,\n );\n $user = wp_insert_user( $userdata );\n \n if( is_wp_error($user) && count($user->get_error_messages()) > 0) {\n $errorco = '';\n foreach ($user->get_error_messages() as $error) {\n $errorco = $error;\n }\n return array(\n 'code' => $user->get_error_code(),\n 'message' => $errorco,\n 'error' => $errorco,\n 'data' => array_merge(['status' => Sis_Rest_Public::HTTP_BAD_REQUEST,'message'=> $errorco])\n );\n } else {\n $user = get_user_by('ID',$user);\n $userId = $user->ID;\n $accessToken = md5(uniqid(mt_rand(), true));\n $accessTokenData = $this->wpdb->get_row( \"SELECT id,accessToken FROM {$this->wpdb_prefix}access_tokens WHERE userId = {$userId} AND deviceId = '{$deviceId}' AND deviceType = '{$deviceType} LIMIT 1'\" );\n $userdata = (array)$user->data;\n $userroles = (array)$user->roles; \n if(empty($accessTokenData)) {\n $isAccessTokenCreated = $this->wpdb->insert($this->wpdb_prefix.'access_tokens',\n array(\n 'userId' => $userId,\n 'deviceId' => $deviceId,\n 'deviceType' => $deviceType,\n 'accessToken' => $accessToken,\n 'deviceToken' => $deviceToken,\n \n )\n );\n if ($userId && $isAccessTokenCreated) {\n return array(\n 'code' => 'success',\n 'message'=> __('Account sucessfully created.',$this->plugin_name),\n 'data' => array_merge(['status' => Sis_Rest_Public::HTTP_OK,'accessToken' => $accessToken,'roles'=>implode(\",\", $userroles)],$userdata)\n );\n }\n } \n }\n\n } else {\n return array(\n 'code' => Sis_Rest_Public::HTTP_BAD_REQUEST,\n 'message' => __('An account with this email already exists.',$this->plugin_name),\n 'error' => __('An account with this email already exists.',$this->plugin_name),\n 'data' => array_merge(['status' => Sis_Rest_Public::HTTP_BAD_REQUEST,'message'=> 'An account with this email already exists.'])\n );\n\n } \n\n return array(\n 'code' => Sis_Rest_Public::HTTP_INTERNAL_SERVER_ERROR,\n 'message' => __('There was a problem while trying to log you in, please try again.',$this->plugin_name),\n 'error' => __('There was a problem while trying to log you in, please try again.',$this->plugin_name),\n 'data' => array_merge(['status' => Sis_Rest_Public::HTTP_INTERNAL_SERVER_ERROR,'message'=> 'There was a problem while trying to log you in, please try again.'])\n ); \n \n }", "public function register($userName, $phone, $fullname, $email, $password, $transId = null) {\n\t\tlog_message('error', 'library register');\n\t\t$this->processing_code = '8000';\n\t\t$data = new stdClass();\n\t\t$data->user_name = $userName;\n\t\t$data->birthday = \"\";\n\t\t$data->fullname = $fullname;\n\t\t$data->address = \"\";\n\t\t\n\t\tif(empty($email))\n\t\t\t$data->email = \"\";\n\t\telse\n\t\t\t$data->email = $email;\n\t\t\n\t\tif(empty($phone))\n\t\t\t$data->phone = \"\";\n\t\telse\n\t\t\t$data->phone = $phone;\n\t\t\n\t\t$data->password = $password;\n\t\tif(is_null($transId))\n\t\t\t$data->request_id = \"RGT\" . date(\"Ymd\") . rand();\n\t\telse\n\t\t\t$data->request_id = $transId;\n\t\t\n\t\t/*\n\t\t$key3des = $this->getSessionKeyCache();\n\t\tif(!$key3des)\n\t\t\t$key3des = $this->getSessionKeyServer();\n\t\t*/\n\t\t\n\t\t$key3des = $this->getSessionKey();\n\t\tif(!$key3des)\n\t\t\treturn false;\n\t\t\n\t\t//log_message('error', 'data request register : ' . print_r($data, true));\n\t\t$encryptData = $this->encrypt3DES(json_encode($data), $key3des);\n\t\t$requestMegaV = $this->requestMegaVCore($encryptData);\n\t\tlog_message('error', 'data respone register: ' . print_r($requestMegaV, true));\n\t\t\n\t\t//$requestMegaV = '{\"status\":\"00\"}';\n\t\t\n\t\treturn $requestMegaV;\n\t}", "public function register_post() \n {\n $first_name = $this->post('fname');\n $last_name = $this->post('lname');\n $username = $this->post('username');\n $email = $this->post('email');\n $password = $this->post('password');\n $dob = $this->post('dob');\n $contact_no = $this->post('contact_no');\n $gender = $this->post('gender');\n $address = $this->post('address');\n $user_type = 2;//Member user\n $status = 1;//Active\n $added_date = time();\n if($first_name != '' && $last_name != '' && $username != '' && $email != '' && $password != '' && $dob != '' && $gender != '' && $address != '')\n {\n $userData = array('fname'=>$first_name,'lname'=>$last_name,'username'=>$username,'status'=>$status,\n 'email'=>$email,'password'=>$password,'dob'=>$dob,'contact_no'=>$contact_no,'address'=>$address,\n 'user_type'=>$user_type,'gender'=>$gender,'added_date'=>$added_date);\n \n $record = $this->artists_model->register_member($userData);\n $message = [\n 'status' => TRUE, \n 'message' => 'Registered successfully',\n 'status_code'=> 200\n ];\n $this->set_response($message, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code\n }\n else\n {\n $message = [\n 'status' => FALSE,\n 'message' => 'Not register,please enter required fields properly',\n 'status_code'=> 400\n ];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); \n \n }\n }", "public function actionRegister()\n {\n if (isset($this->request['mobile'])) {\n $mobile = $this->request['mobile'];\n $user = Users::model()->find('username = :mobile', [':mobile' => $mobile]);\n\n $code = Controller::generateRandomInt();\n if (!$user) {\n $user = new Users();\n $user->username = $mobile;\n $user->password = $mobile;\n $user->status = Users::STATUS_PENDING;\n $user->mobile = $mobile;\n }\n\n $user->verification_token = $code;\n if ($user->save()) {\n $userDetails = UserDetails::model()->findByAttributes(['user_id' => $user->id]);\n $userDetails->credit = SiteSetting::getOption('base_credit');\n $userDetails->save();\n }\n\n Notify::SendSms(\"کد فعال سازی شما در آچارچی:\\n\" . $code, $mobile);\n\n $this->_sendResponse(200, CJSON::encode(['status' => true]));\n } else\n $this->_sendResponse(400, CJSON::encode(['status' => false, 'message' => 'Mobile variable is required.']));\n }", "public function registrationAction($data){ \n try {\n \n if(!isset($data['mobile_no']) || !isset($data['device_id'])) {\n Library::logging('alert',\"API : registration : \".ERROR_INPUT);\n Library::output(false, '0', ERROR_INPUT, null);\n } else {\n $result = array();\n $mobile_no = $data['mobile_no'];\n $device_id = $data['device_id'];\n $record = Users::find( array(array(\"mobile_no\"=>$mobile_no, \"is_deleted\"=>0)) );\n $jaxlPassword = \"12345\";\n if( count($record) > 0 && $record[0]->is_active == 0 ){\n $db = Library::getMongo();\n $db->execute('return db.users.remove({\"_id\" :ObjectId(\"'.$record[0]->_id.'\") })');\n }\n if(count($record) > 0 && $record[0]->is_active != 0 && ($data['mobile_no']!=\"7503522085\"&&$data['mobile_no']!=\"+17503522085\"&&$data['mobile_no']!=\"+917503522085\"&& $data['mobile_no']!=\"8503522085\"&&$data['mobile_no']!=\"+18503522085\"&&$data['mobile_no']!=\"+918503522085\") ) {\n $result['user_id'] = $record[0]->_id;\n $result['token'] = $record[0]->hash;\n $db = Library::getMongo();\n if( empty($record[0]->jaxl_id) ){\n $jaxlCredentials = $this->registerOnEjabberd( $mobile_no, $jaxlPassword );\n $db->execute('return db.users.update({\"_id\" :ObjectId(\"'.$record[0]->_id.'\") },{$set:{jaxl_id : \"'.$jaxlCredentials[\"jaxl_id\"].'\",jaxl_password:\"'.$jaxlCredentials[\"jaxl_password\"].'\"}, $unset:{password:\"\"} })');\n $result = array_merge( $result, $jaxlCredentials ); \n }else{\n $result[\"jaxl_id\"] = $record[0]->jaxl_id;\n $result[\"jaxl_password\"] = $jaxlPassword;\n $db->execute( 'return db.users.update({\"_id\" :ObjectId(\"'.$record[0]->_id.'\") },{ $unset:{password:\"\"} })');\n // $result = array_merge( $result, $jaxlCredentials ); \n }\n $result[\"recovery_email_id\"] = $record[0]->recovery_email_id;\n $result[\"created\"] = 0;\n Library::output(true, '1', OTP_SENT, $result);\n } else {\n $user = new Users();\n $otp = Library::getOTP();\n if($data['mobile_no']==\"7503522085\"||$data['mobile_no']==\"+17503522085\"||$data['mobile_no']==\"+917503522085\" || $data['mobile_no']==\"8503522085\"||$data['mobile_no']==\"+18503522085\"||$data['mobile_no']==\"+918503522085\"){\n $otp = \"1614\";\n }\n $user->mobile_no = $mobile_no;\n $user->country_code = isset($data['country_code'])?$data['country_code']:'';\n $user->otp = $otp;\n $user->device_id = $device_id;\n $user->date = time();\n $user->is_active = 0;\n $user->is_deleted = 0;\n $user->profile_image = DEFAULT_PROFILE_IMAGE;\n \n if ($user->save() == false) {\n foreach ($user->getMessages() as $message) {\n $errors[] = $message->getMessage();\n }\n \n Library::logging('error',\"API : registration : \".$errors.\" \".$mobile_no);\n Library::output(false, '0', $errors, null);\n } else {\n \n /**************** code to register user on ejabber server ********************************/\n $jaxlCredentials = $this->registerOnEjabberd( $mobile_no, $jaxlPassword );\n $user->jaxl_id = $jaxlCredentials[\"jaxl_id\"];\n $user->jaxl_password = $jaxlCredentials[\"jaxl_password\"];\n $user->save();\n $result = array_merge( $result, $jaxlCredentials);\n /************* register code end ********************************/\n \n $result['user_id'] = $user->_id;\n $result['otp'] = $otp;\n $result[\"created\"] = 1;\n \n $message = \"Hi, Your OTP(One Time Password) for registration on Sociabile is : $otp\";\n Library::sendSMS($message,$user->country_code.$user->mobile_no);\n \n Library::output(true, '1', OTP_SENT, $result);\n }\n }\n }\n } catch (Exception $e) {\n Library::logging('error',\"API : registration : \".$e.\" \".$data['mobile_no']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }", "public function registerdevice_post()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"POST\")\n\t\t{\n\t\t\t$this->response('Not Acceptable',406);\n\t\t}\n\n\t\t$token = $this->input->post('token');\n\t\t$user_key = $this->input->post('user_key');\n\t\t$platform = $this->input->post('platform');\n\t\t$timezone = $this->input->post('timezone');\n\t\t$latitude = $this->input->post('latitude');\n\t\t$longitude = $this->input->post('longitude');\n\t\t\n\t\tif( empty( $token ) ){\n\t\t\t//Error Response: Requires Device Token\n\t\t\t$this->response( array('status'=>'failed','error' => 'Device Token is required'), 200);\n\t\t}\n\t\t/*else if(empty( $user_key )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'User key is required'), 200);\n\t\t}\n\t\telse if(empty( $timezone )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'Timezone is required'), 200);\n\t\t}\n\t\telse if(empty( $latitude )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'latitude is required'), 200);\n\t\t}\n\t\telse if(empty( $longitude )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'longitude is required'), 200);\n\t\t}*/\n\t\telse{\n\t\t\t//Check it exists\n\t\t\t//If Exists Update\n\t\t\t//Or Insert new\n\t\t\t$this->load->model('Table_model');\n\n\t\t\t$values=array();\n\t\t\t$values['token']= $token;\n\t\t\t$values['user_key'] = $user_key;\n\t\t\t$values['platform'] = ($platform!='')?$platform:'';\n\t\t\t$values['timezone'] = ($timezone!='')?$timezone:''; \n\t\t\t$values['latitude'] = ($latitude!='')?$latitude:''; \n\t\t\t$values['longitude'] = ($longitude!='')?$longitude:'';\n\n\t\t\t$message = $this->Table_model->InsertOrUpdateDevice( $values );\n\n\t\t\t$this->response( $message, 200);\n\t\t}\n\t}", "public function createUser($data)\n{\n$name = $data['name'];\n$email = $data['email'];\n$password = $data['password'];\n$phone = $data['phone'];\n$gender = $data['gender'];\n$prof = $data['prof'];\n$sport = $data['sport'];\n$location = $data['location'];\n$token = $data['token'];\n\n$query = mysql_query(\"INSERT into `user`(`name`,`email`,`password`,`contact_no`,`Gender`,`prof_id`,`sport`,`location`,`device_id`) values('$name','$email','$password','$phone','$gender','$prof','$sport','$location','$token')\");\n\nif($query)\n{\n\n return 1;\n\n}\nelse\n \n return 0;\n\n}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }", "public function register($username,$password,$fname,$lname,$telno){\n $query=$this->db->query(\"SELECT email FROM oc_customer WHERE email='\".$username.\"'\");\n if($query->num_rows)\n return array(\"reg\"=>\"fail\",\"error\"=>\"E-mail Registered Already.\");\n\n if($query=$this->db->query(\"INSERT INTO oc_customer SET customer_group_id =1, store_id = 0, language_id =1, firstname = '\" . $this->db->escape($fname) . \"',\n lastname = '\" . $this->db->escape($lname) . \"', email = '\" . $this->db->escape($username) . \"', telephone = '\" . $this->db->escape($telno) . \"',\n custom_field = '', salt = '\" . $this->db->escape($salt = token(9)) . \"', password = '\" . $this->db->escape(sha1($salt . sha1($salt . sha1($password)))) . \"',\n newsletter = 0, ip = '::1', status = 1, date_added = NOW()\")){\n return array(\"reg\"=>\"success\");\n }\n else{\n return array(\"reg\"=>\"fail\",\"error\"=>\"Something Went Wrong. Please Try Again Later\");\n }\n }", "public function index(){ //mobile,password,is_social,device_type,device_tokken,email,name\n\n\t\t$this->validate_registration();\n\t\t$_POST['password'] = md5($this->input->post('password')); \n\t\t$_POST['name'] = ucwords(strtolower($this->input->post('name')));\n\t\t$_POST['email'] = strtolower($this->input->post('email'));\n\t\t$user_data = $this->input->post();\n\t\t$return_id = $this->users_model->save_user($user_data);\n\t\tif($return_id){\n\t\t\treturn_data(true,'Registration successful.',$this->users_model->get_user($return_id));\n\t\t}\n\t\treturn_data(false,'Registration Failed.',array());\n\t}", "public function signUp()\n\t{\n\t\tif($this->session->userdata('VB_USER_ID') <> ''):\n\t\t\tredirect(base_url().'my-profile');\n\t\tendif;\n\t\tif($this->input->post('FormType') == 'registrationForm'):\n\t\t\tif(($this->input->post('user_email') <> \"\") && ($this->input->post('mobile_number') <> \"\") && ($this->input->post('password') <> \"\")):\n\t\t\t\t$user_name \t\t=\tstripslashes($this->input->post('user_name'));\n\t\t\t\t$user_email \t=\ttrim($this->input->post('user_email'));\n\t\t\t\t$mobile_number \t=\ttrim($this->input->post('mobile_number'));\n\t\t\t\t$password \t\t=\tstripslashes($this->input->post('password'));\n\t\t\t\t\n\t\t\t\t$existData \t\t=\t$this->common_model->getAllData('vb_users','mobile_number',$mobile_number);\n\t\t\t\tif($existData == ''):\n\t\t\t\t\t$existEmail \t\t=\t$this->common_model->getAllData('vb_users','user_email',$user_email);\n\t\t\t\t\tif($existEmail == ''):\n\t\t\t\t\t\t$param['full_name'] \t\t=\tstripslashes($this->input->post('full_name'));\n\t\t\t\t\t\t$param['user_email'] \t\t=\tstripslashes($this->input->post('user_email'));\n\t\t\t\t\t\t$param['mobile_number'] \t=\ttrim($this->input->post('mobile_number'));\n\t\t\t\t\t\t$param['password'] \t\t\t=\t$this->common_model->encriptPassword($this->input->post('password'));\n\t\t\t\t\t\t$param['user_phone_otp']\t=\t4321;/*(int)generateRandomString(4,n);*/\n\t\t\t\t\t\t$param['user_phone_verify']\t=\t'N';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$param['creation_ip']\t\t=\tcurrentIp();\n\t\t\t\t\t\t$param['creation_date']\t\t=\tcurrentDateTime();\n\t\t\t\t\t\t$param['status']\t\t\t=\t'I';\n\t\t\t\t\t\t$lastInsertId = $this->common_model->addData('users',$param);\t\t\t\t\t\t\t\n\t\t\t\t\t\t$Uparam['user_id']\t\t\t=\tgenerateUniqueId($lastInsertId);\n\t\t\t\t\t\t$Uwhere['id']\t\t\t\t=\t$lastInsertId;\n\t\t\t\t\t\t$this->common_model->editDataByMultipleCondition('users',$Uparam,$Uwhere);\n\t\t\t\t\t\t \n\t\t\t\t\t\t$this->session->set_userdata('VB_REGISTER_MOBILE',$param['mobile_number']);\n\t\t\t\t\t\techo 'success';die;\n\t\t\t\t\telse:\n\t\t\t\t\t\techo \"invalidemail\";die;\n\t\t\t\t\tendif;\n\t\t\t\telse:\n\t\t\t\t\techo \"invalidphone\";die;\n\t\t\t\tendif;\n\t\t\telse:\n\t\t\t\techo \"wentWrong\";die;\n\t\t\tendif;\n\t\tendif;\n\t\t\n\t\t$this->layouts->set_title(stripcslashes('Sign Up | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('Sign Up | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('Sign Up | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/signup',array(),$data);\n\t}", "public function register() {\n\n // If it is not a valid password\n if (!$this->valid_password()) {\n return \"Invalid Password. It must be six characters\";\n }\n\n // If the mobile is valid\n if (!$this->valid_mobile()) {\n return \"Mobile Number is Invalid. It must be 10 numeric digits\";\n }\n\n // If there is a user with that username\n if (User::find($this->username, 'username') !== null) {\n return \"Username already taken\";\n }\n\n // Now we create the user on the database\n if ($this->create_record()) {\n echo \"<br><br>Record Created\";\n // We update the sync the object with the database\n if ($this->update_object('username')) {\n return true;\n echo \"<br><br>Object Updated\";\n }\n }\n\n return \"Sorry, an error has ocurred. Try again later\";\n }", "public function register_user() {\n $this -> load -> library('form_validation');\n $this -> load -> helper('send_email');\n\n $this -> form_validation -> set_error_delimiters('<p>', '</p>');\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\n $query = $this -> basic -> get_where('users', array('user_email' => $this -> input -> post('user_email')));\n\n if ($query -> num_rows() > 0) {\n $response['html'] = 'El email ya existe';\n $response['error'] = '1';\n echo json_encode($response);\n return false;\n }\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\n $msg = \"<h2>Bienvendio xxx\t\" . $this -> input -> post('user_firstname') . \"!</h2>\";\n $msg .= \"Gracias por registrarte en <br/><br/>\";\n $msg .= \"Recuerda tu clave de acceso para que puedas siempre entrar y ver tu perfil, en el que podrás hacer seguimiento a tus compras y envios. <br/><br/>\";\n $msg .= \"Un saludo, <br/><br/>\";\n $msg .= \"El equipo de xxx <br/><br/>\";\n\n $contact_send = array('to' => $this -> input -> post('user_email'), 'subject' => 'Bienvendio - Courrier Box', 'message' => $msg);\n\n $html = 'Se ha guardado el usuario exitosamente';\n\n send_email($contact_send, $html);\n\n } else {\n $response['html'] = validation_errors();\n $response['error'] = '1';\n echo json_encode($response);\n }\n }", "public function UserRegister($firstname, $lastname, $username, $email, $phone, $location, $password){ \n $password = md5($password); \n $query = \"INSERT INTO users(Firstname, Lastname, Username, Gmail, Phone_number, Location, Password)\n values('$firstname', '$lastname', '$username', '$email', '$phone', '$location', '$password')\";\n $insert = mysqli_query($this->database, $query);\n return $insert; \n \n }", "function facebook_user_register_post(){\n\t\t$fb_id=$this->post('fb_id');\n\t\t$fullname=$this->post('fullname');\n\t\t$email=$this->post('email');\n\t\t$username=$this->post('username');\n\t\t$this->load->model('users_model');\n\t\t$data=$this->users_model->get_by_exact_email($email);\n\t\tif($data!=null){\n\t\t\t$this->response(array('ok'=>'0'));\n\t\t}\n\t\t$data=null;\n\t\t$data=$this->users_model->get_by_exact_name($username);\n\t\tif($data!=null){\n\t\t\t$this->response(array('ok'=>'1'));\n\t\t}\n\n\t\t$data=array(\n\t\t\t'fb_id'=>$fb_id,\n\t\t\t'user_name'=>$username,\n\t\t\t'email'=>$email,\n\t\t\t'full_name'=>$fullname,\n\t\t\t'avt'=> get_facebook_avt($fb_id, 200, 200),\n\t\t\t'perm'=>USER\n\t\t\t);\n\t\t$insert_id = $this->users_model->insert($data);\n\t\tif($insert_id!=0){\n\t\t\t$this->response($this->users_model->get_by_fb_id($fb_id));\n\t\t}else{\n\t\t\t$this->response(array('ok'=>'2'));\n\t\t}\n\t\t$this->response(array('ok'=>'2'));\n\t}", "public function register_user() {\n //validate user input and store response\n $validate = $this->validate_registration_form();\n if($validate['status'] == \"Error\") {\n return $validate;\n }\n //make sure email does not already exist\n $verify = $this->verify_email();\n if($verify['status'] == \"Error\") {\n return $verify;\n }\n $array = array();\n try {\n $this->password = password_hash($this->password, PASSWORD_DEFAULT);\n\n $stmt = $this->conn->prepare(\"INSERT INTO users (first_name, last_name, email, password) VALUES(:first_name, :last_name, :email, :password)\");\n\n $stmt->bindParam(':first_name', $this->first_name);\n $stmt->bindParam(':last_name', $this->last_name);\n $stmt->bindParam(':email', $this->email);\n $stmt->bindParam(':password', $this->password);\n\n $stmt->execute();\n\n $user_id = $this->conn->lastInsertId();\n $payload = array(\n \"user\" => $this->first_name,\n \"id\" => $user_id,\n \"exp\" => time()+2000,\n );\n\n $this->generate_token($payload);\n\n $array['status'] = \"Success\";\n return $array;\n\n } catch(\\Exception $e) {\n $array['status'] = \"Error\";\n $errors[] = \"Server Error\";\n $array['errors'] = $errors;\n return $array;\n }\n\n $array['status'] = \"Error\";\n $errors[] = \"Registration could not be completed\";\n $array['errors'] = $errors;\n return $array;\n\n }", "function register(){\n\t\t\t$this->__dataDecode();\n\t\t\t\t$data = $this->data;\n\t\t\t\t$username = $data['User']['userName'];\n\t\t\t\t$response\t= array();\n\t\t\t\t$emptyuserName = $this->User->findByUsername($username);\n\t\t\t \t$emptyEmail = $this->User->findByEmail($this->data['User']['email']);\n\t\t\t\n\t\t\t \t\n\t\t\tif(isset($this->data['User']['password']))\n\t\t\t{\n\t\t\t\t$this->data['User']['confirm_password'] = $this->data['User']['password'] \t= md5($this->data['User']['password']);\n\t\t\t\t$this->data['User']['email_confirmation']\t= 1;\n\t\t\t\t$this->data['User']['status']\t\t\t= 1;\n\t\t\t\t$data = $this->data;\n\t\t\t\t$data['User']['firstname']=$this->data['User']['firstName'];\n\t\t\t\t$data['User']['lastname']=$this->data['User']['lastName'];\n\t\t\t\t$data['User']['username']=$this->data['User']['userName'];\n\t\t\t\t}\n\n\t\t\tif(!($this->__validEmail($this->data['User']['email'])) && !empty($this->data['User']['email']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'Please enter a valid email.';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t \t}\n\t\t\tif(!empty($emptyuserName) && !empty($data['User']['username']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'userName Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\n\t\t\t}\n\t\t\tif(!empty($emptyuserName) && !empty($data['User']['username']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'userName Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\n\t\t\tif(!empty($emptyEmail) && !empty($this->data['User']['email']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'Email Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\n\t\t\t}\n\t\t\tif(!empty($emptyemail) && !empty($this->data['User']['email']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'email Already Exists';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\tif(!($this->validateUSAZip($this->data['User']['zip'])) && !empty($this->data['User']['zip']))\n\t\t\t{\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['message']\t= 'Please enter a valid Zip Code.';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t \t}\n\t\t\n\t\t\telse if($this->User->save($data))\n\t\t\t{\n\t\t\t\t$message\t= \"registered successfully\";\n\t\t\t\t$response['error']\t= 0;\n\t\t\t\t$response['response']['result'] = 'success';\n\t\t\t\t$response['response']['message'] = 'registered successfully';\n\t\t\t\t$this->set('response', $response);\t\t\t\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\n\t\t\t\t$response['error']\t\t= 1;\n\t\t\t\t$response['response']['result'] = 'failure';\n\t\t\t\t$response['response']['message']\t= 'registered unsuccessfully';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\n\t\t\techo json_encode($response);\n\t\t\tdie();\n\t\t}", "public function registerNewUser()\n\t{\n\t\t$Request= new Request();\n\t\t\n\t\t$Controler_Main= Controler_Main::getInstance();\n\t\t$ErrorString=\"\";\n\t\tif(strlen($Request->getAsString(\"tb_Name\"))<3){$ErrorString.=\":T_REGISTER_ERROR1: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))<5){$ErrorString.=\":T_REGISTER_ERROR2: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))===$Request->getAsString(\"tb_PassConfirme\")){$ErrorString.=\":T_REGISTER_ERROR3:<br />\";}\n\t\t$UserFinder= new UserFinder();\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))>3)\n\t\t{\n\t\t\t$User=$UserFinder->findByMail($Request->getAsString(\"tb_Mail\"));\n\t\t\tif($User->getId()!=0)\n\t\t\t{\n\t\t\t\t$ErrorString.=\":T_REGISTER_ERROR4: <br />\";\n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR5: <br />\";\n\t\t}\t\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))===$Request->getAsString(\"tb_MailConfirme\")){$ErrorString.=\":T_REGISTER_ERROR6:<br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Name\")))\n\t\t{\n\t\t\t$User=$UserFinder->findByName($Request->getAsString(\"tb_Name\"));\n\t\t\tif($User->getId()!=0){$ErrorString.=\":T_REGISTER_ERROR7: <br />\";}\n\t\t}\n\t\t\n\t\t\n\t\tif(!$this->isMailCorrect($Request->getAsString(\"tb_Mail\")))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR8: <br />\";\n\t\t}\t\n\t\t\n\t\tif(strtolower($_SESSION['Captcha'])!=(strtolower($Request->getAsString(\"tb_Captcha\"))))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR9: <br />\";\n\t\t}\n\t\t\t\n\t\tif(strlen($ErrorString)!=0)\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\t$this->setCaptchaCode();\n\t\t\treturn false;\n\t\t}\n\t\t$User= new User(0,$Request->getAsString(\"tb_Name\"),md5($Request->getAsString(\"tb_Pass\")),$Request->getAsString(\"tb_Mail\"),0,1,0,0);\t\n\t\t$UserManager= new UserManager();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// user Ordner anlegen\n\t\t\n\t\t// htaccess zugriff legen\n\t\tif(!is_dir(STORE_FOLDER.\"/\".md5($User->getName())))\n\t\t{\n\t\t\tmkdir(STORE_FOLDER.\"/\".md5($User->getName()), 0777);// ordner erstellen\n\t\t\t$User->setFolder(STORE_FOLDER.\"/\".md5($User->getName()));\n\t\t}else\n\t\t{\n\t\t\t$Folder=STORE_FOLDER.\"/\".md5($User->getName()+mktime());\n\t\t\tmkdir($Folder, 0777);\n\t\t\t$User->setFolder($Folder);\n\t\t}\n\t\t\n\t\t$User->setSpaceMax(MAXSPACE);\n\t\t//var_dump(\"und den UserFinder eintragen\");\n\t\t$UserManager->insertUser($User);// user in die db eintragen\n\t\tif(!$UserManager->getLastInsertId())\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\treturn false;\n\t\t}\n\t\t$User->setId($UserManager->getLastInsertId());\n\t\t$this->userLogin();\n\t\t\n\n\t}", "function register() {\n if (isset($_POST[\"password\"]) && isset($_POST[\"firstname\"]) && isset($_POST[\"surname\"]) \n && isset($_POST[\"tel\"]) && isset($_POST[\"email\"])) {\n\n // Put parameters into local variables\n $password = $_POST[\"password\"];\n $firstname = $_POST[\"firstname\"];\n $surname = $_POST[\"surname\"];\n $tel = $_POST[\"tel\"];\n $email = $_POST[\"email\"];\n\n if ($_POST[\"user\"] == 'landlord') {\n $stmt = $this->db->prepare('SELECT id FROM user_landlord WHERE email=?');\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n\t $stmt->bind_result($id);\n\t $stmt->fetch();\n\t\t$stmt->close();\n\n\t if (!empty($id)) {\n\t echo '{\"success\":0, error_message\":\"Email address already registered.\"}';\n\t } else {\n\t $stmt = $this->db->prepare('INSERT INTO user_landlord(id, firstname, surname, password, email, tel) VALUES (null, ?, ?, ?, ?, ?)');\n\t $stmt->bind_param(\"sssss\", $firstname, $surname, $password, $email, $tel);\n $success = $stmt->execute();\n if ($this->db->commit()) {\n \t\t echo '{\"success\":1}';\n \t } else {\n \t\t echo '{\"success\":0, error_message\":\"Registration not successful.\"}';\n \t }\n $stmt->close();\n\t }\n } else if ($_POST[\"user\"] == 'tenant') {\n $stmt = $this->db->prepare('SELECT id FROM user_tenant WHERE email=?');\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n\t $stmt->bind_result($id);\n\t $stmt->fetch();\n\t\t$stmt->close();\n\n\t if (!empty($id)) {\n\t echo '{\"success\":0, error_message\":\"Email address already registered.\"}';\n\t } else {\n\t $stmt = $this->db->prepare('INSERT INTO user_tenant(id, firstname, surname, password, email, tel) VALUES (null, ?, ?, ?, ?, ?)');\n\t $stmt->bind_param(\"sssss\", $firstname, $surname, $password, $email, $tel);\n $success = $stmt->execute();\n if ($this->db->commit()) {\n \t\t echo '{\"success\":1}';\n \t } else {\n \t\t echo '{\"success\":0, error_message\":\"Registration not successful.\"}';\n \t }\n $stmt->close();\n\t }\n } \n }\n }", "public function register()\n\t{\n\t\t$rsp = new Response();\n\n\t\t//Do we have all the required fields ?\n\t\tif(empty($_POST['user_name']) ||\n empty($_POST['user_email']) ||\n empty($_POST['user_passwd']) ||\n empty($_POST['user_passwd_confirm']))\n {\n\t\t\t$rsp->setFailure(400, \"One or more fields are missing.\")\n ->send();\n }\n\n //Is password confirmation correct ?\n if($_POST['user_passwd'] !== $_POST['user_passwd_confirm'])\n {\n $rsp->setFailure(409, \"`user_passwd` and `user_passwd_confirm` does not match.\")\n ->send();\n\n return;\n }\n\n //Is email valid ?\n if(!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL))\n {\n $rsp->setFailure(409, \"`user_email` is not a valid email.\")\n ->send();\n\n return;\n }\n\n //Is email banned?\n if(Response::read(\"ban\", \"is\", \"email\", $_POST['user_email'])[\"code\"] == 401)\n {\n $rsp->setFailure(406, \"The email used is banned.\")\n ->send();\n\n return;\n }\n\n //Is user unique?\n if(!$this->model->isUnique($_POST['user_email']))\n {\n $rsp->setFailure(403, \"This email is already in use. You might want to log in.\")\n ->send();\n\n return;\n }\n\n //Register the user\n $userID = $this->model->addUser($_POST['user_name'], $_POST['user_email'], $_POST['user_passwd'], time());\n\n //Send an activation email\n if(!$this->model->sendMail($userID, $_POST['user_email'], time()))\n {\n $rsp->setFailure(400, \"Error while sending the activation email.\")\n ->send();\n\n return;\n }\n\n $rsp->setSuccess(201, \"User added and activation mail sent.\")\n ->bindValue(\"email\", $_POST['user_email'])\n ->bindValue(\"userID\", $userID)\n ->send();\n\t}", "function registerUser( $data ){\n $utm_medium = isset($_COOKIE['utm_medium']) ? $_COOKIE['utm_medium']: $this->session->userdata('utm_medium');\n $utm_source = isset($_COOKIE['utm_source']) ? $_COOKIE['utm_source']: $this->session->userdata('utm_source');\n $reference = $this->session->userdata('reference');\n $password = addslashes( $data['password'] );\n $email = addslashes( trim(strtolower($data['email'])) );\n $username = addslashes( trim(strtolower($data['username'])) );\n\n $phone = 0919111001;\n if(isset($data['phone'])){\n $phone = addslashes( $data['phone'] );\n if(substr($phone,0,2) == '84') $phone = substr_replace($phone,'0',0,2);\n if(substr($phone,0,3) == '084') $phone = substr_replace($phone,'0',0,3);\n }\n /*Ban IP*/\n if( ban_ip() ){\n $this->retval['msg'] = 'Địa chỉ IP trên máy của bạn đã bị ban, vui lòng liên hệ admin !';\n return json_encode($this->retval); exit(); \n }\n \n if($this->validateUser($username)){\n $this->retval['msg'] = $this->validateUser($username);\n return json_encode($this->retval);\n }\n if($this->validateEmail($email)){\n $this->retval['msg'] = $this->validateEmail($email);\n return json_encode($this->retval);\n }\n if($this->validatePassword($password)){\n $this->retval['msg'] = $this->validatePassword($password );\n return json_encode($this->retval);\n }\n if($phone && !$this->validateNumberic($phone)){\n $this->retval['msg'] = \"Định dạng số điện thoại không chính xác\";\n return json_encode($this->retval);\n }\n $salt = $this->createSalt();\n $dataIns = array(\n 'username' => $username,\n 'salt' => $salt,\n 'password' => $this->createPassword($password, $salt),\n 'email' => strtolower($email),\n 'registerip' => getIP(),\n 'utm_source' => $utm_source,\n 'utm_medium' => $utm_medium,\n 'utm_campaign' => date('Y_m'),\n 'referer' => strtolower($reference),\n 'regdate' => time(),\n 'created' => date( 'Y-m-d H:i:s')\n );\n if($this->db->insert(PREFIX.$this->table, $dataIns)){\n $uid = $this->db->insert_id();\n \n if (0){\n $dt_in = array('username' => $username, 'count' => '10', 'created' => date(\"Y-m-d H:i:s\", time()));\n $this->db->insert(\"cli_lathinh_user\", $dt_in);\n }\n\n \n //add bua cho event dap trung\n if(0){\n $check_con = modules::run('daptrung_config/check_event');\n if( $check_con ){ //chua den thoi diem thi van cho add bua\n $dt_bua = array('user_id'=>$uid,'username' => $username, 'count' => 10, 'message'=>'Add 10 búa tài khoản đăng ký lần đầu','created' => date(\"Y-m-d H:i:s\", time()));\n $this->db->insert(PREFIX.'daptrung_count',$dt_bua);\n }\n }\n\n $data_profile = array(\n 'uid' => $uid,\n 'phone' => $phone,\n );\n $this->db->insert('cli_user_profiles', $data_profile);\n // CALL FUNCTION SEND MAIL\n \n // $this->sendEmailGiftCode($uid, $username, $email);\n\n if($this->session->userdata('redirect')) $this->retval['redirect'] = $this->session->userdata('redirect');\n else $this->retval['redirect'] = \"\";\n $this->retval['status'] = 1;\n $this->retval['msg'] = 'Đăng ký thành công';\n $this->session->set_userdata('username',$username);\n $this->session->set_userdata('uid',$uid);\n $this->session->set_userdata('first_login',1);\n return json_encode($this->retval);\n }\n }", "public function registerUser(){\n $sql = \"INSERT INTO `tbl_register_user`(`u_id`, `fname`, `lname`, `e_mail`, `telephone`, `address`, `city`, `country`, `region`, `gender`, `password`, `confirm_password`) VALUES (NULL, '$this->fname', '$this->lname', '$this->e_mail', '$this->telephone', '$this->address', '$this->city', '$this->country' , '$this->region', '$this->gender', '$this->password' , '$this->confirm_password')\";\n return $this->connect->qry($sql);\n }", "public function registerUser() {\n\t\t\t\t//check for email id existence\n\t\t\t\t$userExistence = $this->checkUserExistence();\n\t\t\t\tif(!$userExistence) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Email id already exists. Please try different email id!';\n\t\t\t\t\treturn false;\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$sql = \"insert into register(name, email, password, orig_password, address, mobile, landline, logo, photo, licence_aggrement,token, create_time) \";\n\t\t\t\t$sql .= \" values('$this->name', '$this->email', '$this->crypPwd', '$this->password', '$this->addr', '$this->mobile', '$this->landline', '$this->logoPath', '$this->photoPath', $this->licence, '$this->token', NOW())\";\n\t\t\t\t\n\t\t\t\t//store it in db now\n\t\t\t\t$result = returnQueryResult($sql);\n\t\t\t\tif($result == false) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Sorry! Something went wrong. Try Again';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//create user directory\n\t\t\t\t$dir = \"../registered_users/$this->email\";\n\t\t\t\tmkdir($dir, 0777, true);\n\t\t\t\tchmod($dir, 0777);\n\n\t\t\t\t//now move files to user directory\n\t\t\t\tmove_uploaded_file($this->logo['tmp_name'], $this->logoPath); //logo\n\t\t\t\tmove_uploaded_file($this->yourPhoto['tmp_name'], $this->photoPath); //your photo\n\n\t\t\t\t//now send confirmation mail to user\n\t\t\t\t$this->sendConfirmationMail();\n\t\t\t}", "function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n unset($DBA, $rs, $fields, $fieldvals);\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'id');\n $idfields = array(0 => 'username');\n $idvals = array(0 => $this->Username);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('ID', $res['id']);\n }\n }\n unset($DBA, $rs, $fields, $idfields, $idvals);\n }", "public function customerRegistration($data){\n\t\t\t$fName \t\t= $data['fName'];\n\t\t\t$lName \t\t= $data['lName'];\n\t\t\t$username \t= $data['username'];\n\t\t\t$address \t= $data['address'];\n\t\t\t$email \t\t= $data['email'];\n\t\t\t$contactNo \t= $data['contactNo'];\n\t\t\t$dob\t\t= $data['dob'];\n\t\t\t$password \t= $data['password'];\n\t\t\t$gender\t\t= $data['gender'];\n\t\t\t$finalPass;\n\n\t\t\t// echo $fName.\"</br>\";\n\t\t\t// echo $lName.\"</br>\";\n\t\t\t// echo $username.\"</br>\";\n\t\t\t// echo $address.\"</br>\";\n\t\t\t// echo $email.\"</br>\";\n\t\t\t// echo $contactNo.\"</br>\";\n\t\t\t// echo $dob.\"</br>\";\n\t\t\t// echo $password.\"</br>\";\n\t\t\t// echo $gender.\"</br>\";\n\n\t\t\t$usrname_chk= $this->usrnmCheck($username);\n\t\t\t$emil_chkr \t= $this->emailCheck($email);\n\t\t\t$phone_chkr\t= $this->phoneCheck($contactNo);\n\n\n\t\t\tif($fName == \"\" || $lName == \"\" || $username == \"\" || $address == \"\" || $email == \"\" || $contactNo == \"\" || $dob == \"\" || $password == \"\" || $gender == \"\"){\n\t\t\t\t$msg = \"<strong>Error! </strong> Field Must Not be empty...!!!\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\n\t\t\tif (strlen($username) < 3) {\n\t\t\t\t$msg = \"<div class = 'errorReport'><strong>Error! </strong>Username is too short...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}elseif(preg_match('/[^a-z0-9_-]+/i', $username)){\n\t\t\t\t$msg = \"<div class='errorReport'><strong>Error! </strong> Username only contain alphanumerical, dashes and underscores...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\n\n\t\t\tif(strlen($password) <= 6){\n\t\t\t\t$msg = \"<div class='errorReport'><strong>Error! </strong>Password should at least 6 charecters long...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}else{\n\t\t\t\t$finalPass = md5($password);\n\t\t\t\t // return $finalPass;\n\t\t\t}\n\n\n\n\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL) === false){\n\t\t\t\t$msg = \"<div class='errorReport'><strong>Error! </strong> Email is not valid...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t\tif($emil_chkr == true){\n\t\t\t\t$msg = \"<div class='errorReport'><strong>Error! </strong> Email already exist...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t\tif($phone_chkr == true){\n\t\t\t\t$msg = \"<div class='errorReport'><Strong>Error! </strong> Contact Number already exist...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t\tif($usrname_chk == true){\n\t\t\t\t$msg = \"<div class='errorReport'><strong>Error! </strong>Username already exist, try another one...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t\t$sql = \"INSERT INTO customer (First_Name, Last_Name, UserName, Address, Email, Contact_Number, Date_Of_Birth, Password, Gender) VALUES(:First_Name, :Last_Name, :UserName, :Address, :Email, :Contact_Number, :Date_Of_Birth, :Password, :Gender)\";\n\n\t\t\t$query = $this->db->pdo->prepare($sql);\n\t\t\t\n\t\t\t$query->bindValue(':First_Name', $fName);\n\t\t\t$query->bindValue(':Last_Name', $lName);\n\t\t\t$query->bindValue(':UserName', $username);\n\t\t\t$query->bindValue(':Address', $address);\n\t\t\t$query->bindValue(':Email', $email);\n\t\t\t$query->bindValue(':Contact_Number', $contactNo);\n\t\t\t$query->bindValue(':Date_Of_Birth', $dob);\n\t\t\t$query->bindValue(':Password', $finalPass);\n\t\t\t$query->bindValue(':Gender', $gender);\n\n\t\t\t$result = $query->execute();\n\t\t\tif ($result) {\n\t\t\t\t$msg = \"<div class='successReport'><strong>Success! </strong>Registration Completed Successfully...!!!</div>\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t}", "public function register(){\n if($_SERVER['REQUEST_METHOD'] == 'POST'){ // check if incoming method is 'POST' METHOD\n // sanitize POST strings before data processing\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); \n $data = [\n 'name' => trim($_POST['name']),\n 'email' => trim($_POST['email']),\n 'password' => trim($_POST['password']),\n 'confirm_password' => trim($_POST['confirm_password']),\n 'name_error' => '', // if user has put incorrect data it should be displayed\n 'email_error' => '',\n 'password_error' => '',\n 'confirm_password_error' => ''\n ];\n\n # validate email\n if(empty($data['email'])){ \n $data['email_error'] = 'Please enter email';\n } else {\n if($this->userModel->findUserByEmail($data['email'])){\n $data['email_error'] = 'Email is already taken';\n }\n }\n # validate name\n if(empty($data['name'])){ // \n $data['name_error'] = 'Please enter valid name';\n }\n # validate password\n if(empty($data['password'])){ \n $data['password_error'] = 'Please enter password';\n }elseif(strlen($data['password'])<6){\n $data['password_error'] = 'Password too short. Must be 6 characters.';\n }\n # confirm password\n if(empty($data['confirm_password'])){ \n $data['confirm_password_error'] = 'Please confirm password!';\n }else{\n if($data['password'] != $data['confirm_password']){\n $data['confirm_password_error'] = 'Passwords do not match.';\n }\n }\n\n # check if error variables are empty\n if(empty($data['email_error']) && empty($data['name_error']) && empty($data['password_error']) && empty($data['confirm_password_error'])){\n\n # Hash the password\n $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT);\n\n #call Model method - 'register' from User models\n if($this->userModel->register($data)){\n redirect('users/login');\n }else{\n die('Something went wrong');\n }\n\n } else {\n # load view with errors\n $this->view('users/register', $data);\n }\n\n\n\n\n } else{ // load 'blak' register form if it's not 'POST' request; save data if user has entered any data\n $data = [\n 'name' => '',\n 'email' =>'',\n 'password' => '',\n 'confirm_password' => '',\n 'name_error' => '', // if user has put incorrect data it should be displayed\n 'email_error' => '',\n 'password_error' => '',\n 'confirm_password_error' => ''\n ];\n\n $this->view('users/register', $data);\n }\n }", "function userRegister($account_id,$cellphone,$password,$nickname)\n {\n $query=$this->db->query(\"insert into xl_account(id,cellphone,password,register_user,nickname) values('{$account_id}','{$cellphone}','{$password}',1,'{$nickname}')\");\n if ($this->db->affected_rows() > 0) {\n # if register success, return true\n return TRUE;\n }\n\n return FALSE;\n }", "public function register(){\r\n //check for POST else display the form\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n // Sanitize POST\r\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\r\n //process form\r\n\r\n $data = [\r\n 'name' => trim($_POST['reg_username']),\r\n 'email' => trim($_POST['reg_email']),\r\n 'password' => trim($_POST['password']),\r\n 'confirm_password' => trim($_POST['confirm_password']),\r\n 'name_err' => '',\r\n 'email_err' => '',\r\n 'password_err' => '',\r\n 'confirm_password_err' => ''\r\n ];\r\n $errors = 0;\r\n //Validate email\r\n if(empty($data['email'])){\r\n $data['email_err'] = 'Please enter an email';\r\n $errors++;\r\n }else{\r\n $userModel = $this->model('user');\r\n if($userModel->findUserByEmail($data['email']) == true){\r\n $data['email_err'] = 'A user with that email already exists';\r\n $errors++;\r\n }\r\n }\r\n //Validate Name\r\n if(empty($data['name'])){\r\n $data['name_err'] = 'Please enter a name';\r\n $errors++;\r\n }\r\n //Validate Password\r\n if(empty($data['password'])){\r\n $data['password_err'] = 'Please enter a password';\r\n $errors++;\r\n }elseif(strlen($data['password']) < 6){\r\n $data['password_err'] = 'Password must be at least 6 characters';\r\n $errors++;\r\n }\r\n //Validate Confirm Password\r\n if(empty($data['confirm_password'])){\r\n $data['confirm_password_err'] = 'Please confirm password';\r\n $errors++;\r\n }\r\n //Validate if both passwords match\r\n if($data['password'] != $data['confirm_password']){\r\n $data['confirm_password_err'] = 'Passwords do not match';\r\n $errors++;\r\n }\r\n\r\n //Make sure errors are empty\r\n if(empty($data['email_err']) && empty($data['name_err']) && empty($data['password_err']) &&\r\n empty($data['confirm_password_err']) ){\r\n //validated\r\n //die('SUCCESS');\r\n // Hash Password\r\n $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT);\r\n //Execute to db\r\n if($userModel->register($data) == true){\r\n // Redirect to login\r\n header('Location: /user/login');\r\n } else {\r\n die('Something went wrong');\r\n }\r\n\r\n }else{\r\n //die('post submitted with errors');\r\n //Load View with Errors\r\n $this->view('user\\register', $data);\r\n\r\n }\r\n\r\n }else{\r\n //load form\r\n $data = [\r\n 'name' => '',\r\n 'email' => '',\r\n 'password' => '',\r\n 'confirm_password' => '',\r\n 'name_err' => '',\r\n 'email_err' => '',\r\n 'password_err' => '',\r\n 'confirm_password_err' => ''\r\n ];\r\n //load View\r\n $this->view('user\\register', $data);\r\n\r\n }//end else load form view\r\n\r\n }", "function register() {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('username','Full Name','trim|required|max_length[128]|xss_clean');\n $this->form_validation->set_rules('email','Email','trim|required|valid_email|xss_clean|max_length[128]');\n $this->form_validation->set_rules('password','Password','required|max_length[20]');\n // $this->form_validation->set_rules('isDjs','isDjs','required');\n if($this->form_validation->run() == FALSE)\n {\n echo json_encode(array('status' => \"failed\", 'msg' => \"Validation failed.\"));die;\n }\n else {\n $name = ucwords(strtolower($this->input->post('username')));\n $email = $this->input->post('email');\n $password = $this->input->post('password');\n // $isDjs = $this->input->post('isDjs'); // 1->for DJS 2-> Normal not Djs \n /* Check if the same email is already registered */\n $checkSameEmail = $this->customer_model->checkEmailExists($email);\n /* Register new user */\n if (!$checkSameEmail) {\n \n // $dj =2;\n // if($isDjs != \"\")\n // {\n // $dj = $isDjs;\n // }\n \n $userInfo = array('username' => $name, 'email' => $email, 'password' => getHashedPassword($password),/*'isDjs'=>$dj,*/ 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'));\n\n $insert_id = $this->customer_model->register($userInfo);\n\n echo json_encode(array('status' => \"Success\", 'msg' => \"User registered successfully.\"));die;\n } else {\n echo json_encode(array('status' => \"failed\", 'msg' => \"Same email was already registered.\"));die;\n }\n }\n\n exit(1);\n }", "public function userRegistration($data){\n\t\t\t$name = $data['name'];\n\t\t\t$username = $data['username'];\n\t\t\t$email = $data['email'];\n\t\t\t$password = $data['password'];\n\n\t\t\t$chk_email = $this->checkEmail($email);\n\n\n\n\t\t\tif ($name ==\"\" OR $username ==\"\" OR $email ==\"\" OR $password ==\"\"){\n\t\t\t\t$msg = \"<span class='alert alert-danger'><strong>*</strong> Field must not be empty!</span>\" ;\n\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t\tif (strlen($username) < 3){\n\t\t\t\t$msg = \"<span class='alert alert-danger'><strong>*</strong> Username is too short!</span>\" ;\n\n\t\t\t\treturn $msg;\n\n\t\t\t}elseif(preg_match('/[^a-z0-9_-]+/i',$username)){\n\t\t\t\t$msg = \"<span class='alert alert-danger'><strong>*</strong> Username must contain only alphanumeric,dashes,underscore!</span>\" ;\n\n\t\t\t\treturn $msg;\n\n\t\t\t}\n\n\t\t\tif (filter_var($email,FILTER_VALIDATE_EMAIL) === false){\n\t\t\t\t$msg = \"<span class='alert alert-danger'><strong>*</strong>Invalid email!</span>\" ;\n\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t\tif ($chk_email == true){\n\t\t\t\t$msg = \"<span class='alert alert-danger'><strong>*</strong>Email already exist!</span>\" ;\n\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t\tif (strlen($password) < 6){\n\t\t\t\t$msg = \"<span class='alert alert-danger'><strong>*</strong>Password should be 6 or more characters!</span>\" ;\n\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\n\t\t\t$sql = \"INSERT INTO tbl_user(Name, Username, Email, Password)\n\t\t\tVALUES(:Name, :Username, :Email, :Password)\";\n\t\t\t$query = $this->db->conn->prepare($sql);\n\n\t\t\t$query->bindValue(\":Name\", $name);\n\t\t\t$query->bindValue(\":Username\", $username);\n\t\t\t$query->bindValue(\":Email\", $email);\n\t\t\t$query->bindValue(\":Password\", md5($password));\n\t\t\t$result = $query->execute();\n\n\t\t\tif ($result){\n\t\t\t\t$msg = \"<span class='alert alert-success'><strong>*</strong>Registered successfully!</span>\" ;\n\n\t\t\t\treturn $msg;\n\t\t\t}\n\n\t\t}", "public function registration_submit() {;\n\n $response = array();\n /* $conn = mysqli_connect($hostname, $username, $db_password, $database);\n if (!$conn) {\n $response['success'] = false;\n $response['message'] = \"Connection failed: \" . mysqli_connect_error();\n echo json_encode($response);\n exit();\n } */\n\n $name = $_POST['name'];\n $email = $_POST['email'];\n $password = $_POST['password'];\n\n $this->load->model('user');\n $data = array(\n 'name' => $name,\n 'email' => $email,\n 'password' => $password\n );\n $this->user->insert_data($data);\n /* $sql = \"INSERT INTO users (name, email, password) VALUES ('$name', '$email', '$password')\";\n if (!mysqli_query($conn, $sql)) {\n $response['success'] = false;\n $response['message'] = \"this email exist \";\n echo json_encode($response);\n exit();\n } */\n\n $response['success'] = true;\n $response['message'] = \"Registration successful\";\n echo json_encode($response);\n // mysqli_close($conn);\n }", "public function register_post()\n\t{\n\t\t$array['username'] = strtolower($this->post('username'));\n\t\t$array['email'] = strtolower($this->post('email'));\n\t\t$array['password'] = hash('sha512', $this->post('password'));\n\n\t\t$error = [];\n\n\t\tif (!filter_var($array['email'], FILTER_VALIDATE_EMAIL)) {\n\t\t\t$error[] = 'Invalid email format.';\n\t\t}\n\t\tif (!preg_match('/^[A-Za-z][A-Za-z0-9]{5,100}$/', $array['username'])) {\n\t\t\t$error[] = 'Invalid username format. Only alphabets & numbers are allowed.';\n\t\t}\n\n\t\tif (!empty($error)) {\n\t\t\t$this->response(['status' => FALSE, 'error' => $error], REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\n\t\tif (empty($array['username'])) {\n\t\t\t$this->response(['status' => FALSE, 'error' => 'Username is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t} else if (empty($array['email'])) {\n\t\t\t$this->response(['status' => FALSE, 'error' => 'Email is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t} else if (empty($array['password'])) {\n\t\t\t$this->response(['status' => FALSE, 'error' => 'Password is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t} else {\n\t\t\t$data = $this->api_model->register($array);\n\t\t\tif ($data === FALSE) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Email or username already registered.'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else {\n\t\t\t\t$this->response(['status' => TRUE, 'message' => 'Account registered successfully.'], REST_Controller::HTTP_OK);\n\t\t\t}\n\t\t}\n\t}", "public function add_device( $did = '', $model = '', $hversion = '', $sversion = '', $type = '', $builder = '', $reg_device = '' ) {\n\t\tglobal $wpdb;\n\t\tglobal $rpids_api;\n \n try {\n // Process the parameters\n if( @$did != '' ) {\n $did = sanitize_text_field( $did );\n } else {\n $did = '0';\n }\n \n if( @$model != '' ) {\n $model = sanitize_text_field( $model );\n }\n \n if( @$hversion != '' ) {\n $hversion = sanitize_text_field( $hversion );\n }\n \n if( @$sversion != '' ) {\n $sversion = sanitize_text_field( $sversion );\n }\n \n if( @$type != '' ) {\n $type = sanitize_text_field( $type );\n }\n \n if( @$builder != '' ) {\n $builder = sanitize_text_field( $builder );\n }\n \n if( @$reg_device != '' ) {\n $reg_device = sanitize_text_field( $reg_device );\n } else {\n $reg_device = false;\n }\n \n // Get the current user\n $current_user = wp_get_current_user();\n \n if( $reg_device ) {\n // If $builder is empty, set it to the current user's email\n if( $builder = '' ) {\n $builder = $current_user->user_email;\n }\n \n // Register the device with the central server\n $rpids_register = $rpids_api->register_device( $model, $hversion, $sversion, $type, $builder );\n \n // Success? If yes, update the did variable\n if( $rpids_register['status'] == 'success' ) {\n $did = $rpids_register['did'];\n }\n }\n \n // Should we verify the device and claim it?\n if( $did != '0' ) {\n // DID is set (and not 0)\n // Check if the device is already in the database\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_devices` WHERE `did`='\" . $did . \"';\";\n $device = $wpdb->get_row($sql, ARRAY_A);\n \n if( $device != null ) {\n // Device has already been added\n throw new Exception( 'That device has already been added.' );\n } else {\n // Connect to the central server and claim the device\n $rpids_return = $rpids_api->claim_device( $did, $current_user->user_email );\n // Why email? If the device is given away or sold, but not removed from an account, we need to know who to contact for the new owner.\n \n // Check the status of $rpids_return\n if( $rpids_return['status'] == 'otheruser') {\n // The device is claimed by someone else\n throw new Exception( 'That device ID is already claimed. If you received the device used make sure the previous owner has transferred ownership.' );\n } elseif( $rpids_return['status'] == 'notfound') {\n // DID not found\n throw new Exception( 'That Device ID was not found. The device must be registered before you can add it.');\n } elseif( $rpids_return['status'] != 'success' ) {\n // Other error\n throw new Exception( 'Well that\\'s strange. Something went wrong, but we have no clue what.' );\n }\n \n // Looks like status == success\n // Get the device details\n $rpids_results = $rpids_api->get_device_info( $did );\n \n // Update the device info variables\n $model = sanitize_text_field( $rpids_results['model'] );\n $hversion = sanitize_text_field( $rpids_results['hversion'] );\n $sversion = sanitize_text_field( $rpids_results['sversion'] );\n $type = sanitize_text_field( $rpids_results['type'] );\n $builder = sanitize_text_field( $rpids_results['builder'] );\n }\n }\n \n // Now, add the device to the database\n $wpdb->insert( rpids_tableprefix() . \"rpids_devices\",\n array(\n \"did\" => $did,\n \"model\" => $model,\n\t\t\t\t \"hversion\" => $hversion,\n\t\t\t\t \"sversion\" => $sversion,\n\t\t\t\t \"type\" => $type,\n\t\t\t\t \"builder\" => $builder\n )\n );\n \n // Return success\n if( $reg_device ) {\n return (object) array(\n \"status\" => \"success\",\n \"message\" => \"Device registered and added.\"\n );\n }\n\t\t} catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n\t}", "public function customerRegistration( $data ){\n \n $first_name = $this->fm->validation($data['first_name']);\n $last_name = $this->fm->validation($data['last_name']);\n $username = $this->fm->validation($data['username']);\n $email = $this->fm->validation($data['email']);\n $gender = $this->fm->validation($data['gender']);\n $phone = $this->fm->validation($data['phone']);\n $password = $this->fm->validation ( md5 ( $data ['password'] ) );\n\n $first_name = mysqli_real_escape_string( $this->db->link, $data['first_name']);\n $last_name = mysqli_real_escape_string( $this->db->link, $data['last_name']);\n $username = mysqli_real_escape_string( $this->db->link, $data['username']);\n $email = mysqli_real_escape_string( $this->db->link, $data['email']);\n $gender = mysqli_real_escape_string( $this->db->link, $data['gender']);\n $phone = mysqli_real_escape_string( $this->db->link, $data['phone']);\n $password = mysqli_real_escape_string( $this->db->link, md5($data['password']));\n\n if ( $first_name == \"\" || $last_name == \"\" || $username == \"\" || $email == \"\" || $gender == \"\" || $phone == \"\" || $password == \"\" ) {\n $msg = \"<span class='error'>Field must not be empty !</span>\";\n return $msg;\n } \n $mailquery = \"SELECT * FROM tbl_customer WHERE email= '$email' LIMIT 1\";\n $mailChk = $this->db->select($mailquery);\n if ($mailChk != false) {\n $msg = \"<span class='error'>Email already exist !</span>\";\n return $msg;\n } else {\n $query = \"INSERT INTO tbl_customer (first_name, last_name, username, email, gender, phone, password ) VALUES('$first_name', '$last_name', '$username', '$email', '$gender', '$phone','$password')\";\n $inserted_rows = $this->db->insert($query);\n\n if ($inserted_rows) {\n $msg = \"<span class='success succ-reg'>Registration Successfully.<a class='login-reg' href='login.php'>login </a> </span>\"; \n return $msg;\n } else {\n $msg = \"<span class='error'> Something Wrong !</span>\";\n return $msg;\n } \n }\n\n }", "public function registerAction()\n {\n Lb_Points_Helper_Data::debug_log(\"Registration request sent to LB\", true);\n $txtName = $_POST['txtName'];\n $txtEmail = $_POST['txtEmail'];\n $txtPhoneNumber = $_POST['txtPhoneNumber'];\n $result = Lb_Points_Helper_Data::registerUser($txtName,$txtEmail,$txtPhoneNumber);\n echo json_encode($result);\n }", "public function register(){\n\t\t$password= $this->input->post('sign_password');\t\t\t\t\t\t\t\t\t\t\n\t\t$emailID=$this->input->post('sign_email');\n\n\t\t//validation check\n\t\tif($emailID=='' || $password=='')\n\t\t{\n\t\t\tredirect('login');\n\t\t\tdie();\n\t\t}\n\n\t\t$enc_password= base64_encode($password);\t//encrypt password\n\n\t\t//check email-Id is already registered \n\t\t$this->load->model('logged_user');\n\t\t$checkEmail=$this->logged_user->checkEmail_exist($emailID);\n\t\t\n\n\t\tif($checkEmail){\t\n\n\t\t\t//Connection establishment, processing of data and response from REST API\n\t\t\t$data=array(\n\t\t\t\t'email' =>$emailID,\n\t\t\t\t'password' => $enc_password\n\t\t\t);\n\t\t\t$path=base_url();\n\t\t\t$url = $path.'api/register.php';\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response_json = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$response=json_decode($response_json, true);\n\t\t//API processing end\n\n\n\t\t//if status returned is 0 then registering failed, if 1 then redirect to signup page\n\t\t\tif($response['status']==0){\n\t\t\t\t$data['account_registered']=$response['status_message'];\n\n\t\t\t\t$this->load->view('includes/header.php');\n\t\t\t\t$this->load->view('pages/member_signup.php',$data);\n\t\t\t\t$this->load->view('includes/footer.php');\t\t\t\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$session_data= array(\n\t\t\t\t\t'email_id' => $response['email_id'],\n\t\t\t\t\t'is_logged' => $response['is_logged'],\n\t\t\t\t\t'unique_id'=>'',\n\t\t\t\t\t'user_name'=>''\n\t\t\t\t);\n\n\t\t\t\t//after registering login user and redirect to edit-details page\n\t\t\t\t$this->session->set_userdata($session_data);\n\t\t\t\tredirect('edit_account');\n\n\t\t\t}\n\t\t//if-else stmt end\n\t\t}\n\t\telse{\n\n\t\t\t//if email-Id already regiterd then show error\n\t\t\t$data['account_registered']=\"Email ID Already Registered. Login by same or use another Email-ID!!!\";\n\n\t\t\t$this->load->view('includes/header.php');\n\t\t\t$this->load->view('pages/member_signup.php',$data);\n\t\t\t$this->load->view('includes/footer.php');\n\t\t}\n\t\t\n\t}", "public function registerNewUser($fullName,$email,$password);", "public function registerUser($firstName, $lastName,$password,$email,$phone,$personalinfo)\n {\n \n $sql2= \"SELECT userid from basicUser where email= '\".$email.\"' \";\n $alreadyUser = mysql_fetch_array(mysql_query($sql2));\n var_dump($alreadyUser);\n die();\n $alreadyUser = $alreadyUser[0];\n \n if ($alreadyUser == null){\n \n $sql = \"INSERT INTO basicUser VALUES '\". mysql_real_escape_string($firstName).\"'\n , '\".mysql_real_escape_string($lastName).\"'\n , '\".mysql_real_escape_string($password).\"'\n , '\".mysql_real_escape_string($email).\"'\n , '\". mysql_real_escape_string($phone).\"'\n , '\". mysql_real_escape_string($personalinfo).\"'\";\n \n mysql_query($sql); \n return \"Sucess User registered\";\n }\n else{\n //give an error saying an account is already associated with this email \n return \"failure: There is an account associated with this email\";\n }\n }", "public function register() {\n\t\t$user_email = $this->input->post(\"email\");\n\t\t$user_password = md5($this->input->post('password'));\n\t\t$user_reg_ip = ip2long($this->input->ip_address());\n\t\t\n\t\t$re = $this->user_lib->save_reg_userInfo($user_email,$user_password,$user_reg_ip);\n\t\t\n\t\tif($re===false){\n\t\t\t//set mc error\n\t\t}\n\t\t/*if(!$this->email_lib->send_active_email($user_email)){\n\t\t\t//send mail error\n\t\t}*/\n\t\t$uid = $this->user_lib->active_process($user_email);\n\t\tif($uid===false){\n\t\t\treturn false;\t\t//for active error\n\t\t}\n\t//\t$this->_set_login_cookie($uid);\n\t\tredirect('/regsuccess'); \n\t}", "public function actionRegistration() {\n\n $first_name = Yii::$app->request->post('first_name');\n $last_name = Yii::$app->request->post('last_name');\n $code = Yii::$app->request->post('code');\n $sample_code = Yii::$app->request->post('sample_code');\n $collector_code = Yii::$app->request->post('collector_code');\n $user = new User();\n $result = $user->registration($first_name,$last_name,$code,$sample_code, $collector_code);\n if(array_key_exists('error',$result))\n throw new \\yii\\web\\HttpException(400, 'Error occurred:'. json_encode($result['error']));\n return $result;\n }", "function register()\n {\n $saveData = null;\n // result is an array data if save data to db success, else it is false\n $saveData = $this->model->khachhang->registerCustomerAccount();\n // if save data success, send mail to user\n if ($saveData != false) {\n $linkVerify = baseUrl('user/verify/') . $saveData['activation'];\n $title = \"Verification Link | MobileShop| Subscription\";\n $content = \"\";\n $content .= \"Xin chào \" . $saveData['username'] . \",<br /><br />\";\n $content .= \"Vui lòng kích vào nút bên dưới để xác nhận tài khoản của bạn trên website \" . BASE_URL . \".<br />\";\n $content .= \"<span style='background-color:#07c;margin-top:15px;width: 115px;height: 40px;display:block;border-radius: 40px;cursor: pointer;'>\n <span style='display:block;padding:10px;cursor: pointer;'>\n <a href='{$linkVerify}' target='_blank' style='color:white;'>\n VERIFY EMAIL\n </a>\n </span>\n </span>\";\n $nTo = $saveData['username'];\n $mTo = $saveData['email'];\n $diachicc = \"\";\n $mailSuccess = sendMail($title, $content, $nTo, $mTo, $diachicc);\n if ($mailSuccess) {\n redirect('user/success');\n } else {\n redirect('user/fail');\n }\n } else {\n redirect('user/fail');\n }\n\n }", "public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }", "function register() {\n\t$a = array(\n\t 'status' => 'system-error'\n\t);\n\n\t// raw inputs\n\t$taint_uname = isset($_POST['uname']) ? $_POST['uname'] : 0;\n\t$taint_email = isset($_POST['email']) ? $_POST['email'] : 0;\n\t$taint_pword = isset($_POST['pword']) ? $_POST['pword'] : 0;\n\n\t// validate inputs\n\t$uname = validateUname($taint_uname);\n\t$email = validateEmail($taint_email);\n\t$pword = validatePword($taint_pword);\n\n\tif (!$email || !$uname || !$pword) {\n\t\tLog::write(LOG_WARNING, \"attempt with invalid parameter set\");\n\t\treturn $a;\n\t}\n\n\t$conn = getConnection();\n\tif (!$conn) {\n\t\treturn $a;\n\t}\n\n\t// validate username is unique\n\t$name = 'test-unique-username';\n\t$sql = \"select id from accounts.user where username = $1\";\n\t$params = array($uname);\n\t$result = execSql($conn, $name, $sql, $params, false);\n\tif (!$result) {\n\t\treturn $a;\n\t}\n\n\t$numrows = pg_num_rows($result);\n\tif ($numrows > 0) {\n\t\tLog::write(LOG_NOTICE, \"$name: username already on file\");\n\t\t$a['status'] = 'username-in-use';\n\t\treturn $a;\n\t}\n\n\t// validate email is unique\n\t$name = 'test-unique-email';\n\t$sql = \"select id from accounts.user where email = $1\";\n\t$params = array($email);\n\t$result = execSql($conn, $name, $sql, $params, false);\n\tif (!$result) {\n\t\treturn $a;\n\t}\n\n\t$numrows = pg_num_rows($result);\n\tif ($numrows > 0) {\n\t\tLog::write(LOG_NOTICE, \"$name: email already on file\");\n\t\t$a['status'] = 'email-in-use';\n\t\treturn $a;\n\t}\n\n\t// get the next user id\n\t$name = 'get-next-user-id';\n\t$sql = \"select nextval('accounts.user_id_seq')\";\n\t$params = array();\n\t$result = execSql($conn, $name, $sql, $params, true);\n\tif (!$result) {\n\t\treturn $a;\n\t}\n\n\t$row = pg_fetch_array($result, 0, PGSQL_ASSOC);\n\t$id = $row['nextval'];\n\n\t// hash the password\n\t$hashPassword = hashPassword($pword);\n\n\t$auth = DB::$auth_registered;\n\t$access = DB::$auth_novice;\n\n\t// get TIC\n\t$publicTic = generateTic();\n\t$hashTic = hashTic($publicTic);\n\n\t// write a session token\n\t$si = writeToken($conn, $id);\n\tif (!$si){\n\t\treturn $a;\n\t}\n\n\t// write the user record\n\t$name = 'insert-user';\n\t$sql = \"insert into accounts.user (id, username, email, hashpassword, auth, hashtic, tmhashtic) values ($1, $2, $3, $4, $5, $6, now())\";\n\t$params = array($id, $uname, $email, $hashPassword, $auth, $hashTic);\n\t$result = execSql($conn, $name, $sql, $params, true);\n\tif (!$result) {\n\t\treturn $a;\n\t}\n\n\t// send TIC to user by email\n\t$boo = sendAuthenticationEmail($email, 'verify', $publicTic);\n\tif (!$boo) {\n\t\t$a['status'] = 'send-email-failed';\n\t\treturn $a;\n\t}\n\n\t// success\n\t$a['status'] = 'ok';\n\t$a['si'] = $si;\n\t$a['auth'] = $auth;\n\t$a['access'] = $access;\n\t$a['uname'] = $uname;\n\t//$a['email'] = obscureEmail($email);\n\treturn $a;\n}", "function register(){\r\n\t\tif(!isset($_POST['username']) || !isset($_POST['email']) ){\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid Request\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\t//get inputs\r\n\t\t$username = $_POST['username'];\r\n\t\t$email = $_POST['email'];\r\n\t\t\r\n\t\t$v = new DooValidator;\r\n\t\t//validate\r\n\t\tif(($error = $v->testEmail($_POST['email'])) != null){\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = $error;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//check if username or email already exist in users db\r\n\t\t$u = Doo::db()->find('Users', array(\r\n\t\t\t'where' => \"username = :username OR email = :email\", \r\n\t\t\t'param' => array(':username' => $username, ':email' => $email)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t\r\n\t\tif(!empty($u)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Username or Email already exist\";\r\n\t\t\treturn;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//generate temp password\r\n\t\t$tmpPassword = $this->str_rand(6);\r\n\t\t\r\n\r\n\t\t//send email with temp password\r\n\t\t$to = $email;\r\n\r\n\t\t// Your subject\r\n\t\t$subject = \"Your temp password here\";\r\n\r\n\t\t// From\r\n\t\t$header=\"from: Register-EVAS <sandip.sandhu@ericsson.com>\";\r\n\t\t//$header = null;\r\n\t\t\r\n\t\t// Your message\r\n\t\t$message = \"Your Comfirmation password \\r\\n\";\r\n\t\t$message.= \"$tmpPassword\";\r\n\t\t\r\n\t\t//ini_set ( \"SMTP\", \"smtp-server.example.com\" ); \r\n\t\t\r\n\t\t// send email\r\n\t\tif(!mail($to, $subject, $message, $header)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Error sending email to $email\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//store new user temp password \r\n\t\tDoo::loadModel('Users');\r\n\t\t$u = new Users;\r\n\t\t$u->username = $username;\r\n\t\t$u->email = $email;\r\n\t\t$u->isEnabled = 1;\r\n\t\t$u->change_password_on_login = 1;\r\n\t\t$u->password = md5($tmpPassword);\r\n\t\t$u->default_basemap = \"Google Streets\";\r\n\t\t$u->cluster_zoom_level = 15;\r\n\t\t$u->is_enabled = 1;\r\n\t\t $u->client = \"T-Mobile\";\r\n\t\t$u->insert();\r\n\t\t\t\r\n\t\t//success!\r\n\t\t$this->res->success = true;\r\n\t}", "public function createUser($uid, $fullname, $phone_no, $email, $login_with){\n\n if(!$this->isUserIdExist($uid)){\n $stmt = $this->con->prepare(\"INSERT INTO users (uid, fullname, phone_no, email, login_with,reg_date) VALUES (?,?,?,?,?,?);\");\n $stmt->bind_param(\"ssssss\",$uid, $fullname, $phone_no, $email, $login_with,$reg_date);\n $reg_date = date(\"Y-m-d\").' '.date(\"H:i:s\");\n if($stmt->execute()){\n return USER_CREATED;\n }else{\n return USER_FAILURE;\n }\n }\n return USER_EXISTS;\n }", "public function register() {\n \n $this->form_validation->set_rules('email', 'Email', 'required|valid_email');\n $this->form_validation->set_rules('password', 'Passwort', 'required');\n $this->form_validation->set_rules('dataprotection', 'Datenschutz', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n if (strtolower($this->input->post('dataprotection')) == 'true') {\n \t// TODO: save acceptance or acceptance date to db, i.e. hand over to model\n } else {\n \t$this->error(404, 'Dataprotection error');\n } \n \n $this->user_model->setValue('email', $this->input->post('email'));\n $this->user_model->setValue(\n \t'hashed_password', \n \tpassword_hash($this->input->post('password'), PASSWORD_DEFAULT));\n\n if (! $this->user_model->newUser()) {\n\t\t\t$this->error(409, 'Duplicate');\n }\n\n\t\t$this->sendConfirmationMail($this->input->post('email'));\n\t\t$data['msg'] = $this->input->post('email') . ' registered.';\n\t\t$this->responseWithCode(201, $data);\n }", "public function registration($data){\n \n\n\n\n // restrict if fields are empty\n \n\t\tif($data['fname']==\"\" || $data['lname']==\"\" || $data['email']==\"\" || $data['password']==\"\"){\n\n\t\t\t$_SESSION['message'] = \"Please fill out these fields\";\n\t\t\t$_SESSION['msg_type'] = \"danger\";\n\n\t\t \t// validata the email format\n\n\t\t}elseif(!preg_match(\"/^[a-zA-Z ]*$/\",$data['fname'])) {\n\n\t\t\t $_SESSION['message'] = \"Only letters and white space allowed for names\";\n\t\t\t $_SESSION['msg_type'] = \"warning\";\n \n\t\t\t}\n\n\t\telseif (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)){\n\n\t\t\t$_SESSION['message'] = \"Email Format is not valid\";\n\t\t\t $_SESSION['msg_type'] = \"danger\";\n \n\n\t\t}elseif(strlen($data['password'])<8){\n\n\t\t\t$_SESSION['message'] = \"Password must contain 8 letters\";\n\t\t\t $_SESSION['msg_type'] = \"danger\";\n \n\n\t\t}elseif(!preg_match(\"/^[a-zA-Z0-9%@#$]+$/\", $data['password'])){\n\n\t\t\t$_SESSION['message'] = \"Password must contain special characters\";\n\t\t\t $_SESSION['msg_type'] = \"info\";\n \n\n\t\t}\n\t\telse{\n \n \t// check the email if already exit in database\n\n\t\t$q = \"SELECT * FROM user_table WHERE email='$data[email]'\";\n\t\t\n\t\t$result = $this->connection->query($q);\n\n\t\tif($result->num_rows > 0){\n\n\t\t\t$_SESSION['message'] = \"Email already exist\";\n\t\t\t $_SESSION['msg_type'] = \"danger\";\n \n\t\t\treturn; \n\n\t\t}\n\t else{\n\n\n\t\t// Insert data in database using mysqli query\n\n\t\t$q = \"INSERT INTO user_table (fname, lname, email, password ) VALUES('$data[fname]', '$data[lname]', '$data[email]', '$data[password]') \";\n\n\t\t$result = $this->connection->query($q);\n\n\t\tif($result){\n\n\t\t\t$_SESSION['message'] = \"Registered Successfuly\";\n\t\t\t $_SESSION['msg_type'] = \"success\";\n \n\t\t}\n\n\t\t\n\n\t}\n\n\t}\n}", "function register(){\r\n //FullName\r\n $fullName = $this->safety($_REQUEST['reg_fullName']);\r\n \t$_SESSION['reg_fullName'] = $fullName;\r\n //Email\r\n \t$email = $this->safety($_REQUEST['reg_email']);\r\n \tif (! filter_var($email, FILTER_VALIDATE_EMAIL) ){\r\n \t\t$errors[] = \"Invalid email format\";\r\n \t}\r\n \telseif( $this->emailExists($email) ) {\r\n \t\t\t$errors[] = \"Email already in use\";\r\n \t}\r\n \t$_SESSION['reg_email'] = $email; //Stores email into session variable\r\n \t//Password\r\n \t$password = $_REQUEST['reg_password'];\r\n //Fav. Quote\r\n \t$quote = $this->safety($_REQUEST['reg_quote']);\r\n //Current date\r\n \t$date = date(\"Y-m-d\");\r\n //Validate name\r\n \tif(strlen($fullName) > 100 || strlen($fullName) < 2) {\r\n \t\t$errors[] = \"Your name must be between 2 and 100 characters\";\r\n \t}\r\n //Validate password\r\n \tif (strlen($password) < 6) {\r\n \t $errors[] = \"Password is too short!\";\r\n \t}\r\n \t/* Check Password Strength */\r\n /* More about regular expressions https://www.w3schools.com/php/php_regex.asp */\r\n \tif (!preg_match(\"#[0-9]+#\", $password)) {\r\n \t $errors[] = \"Password must include at least one number!\";\r\n \t}\r\n \tif (!preg_match(\"#[a-zA-Z]+#\", $password)) {\r\n \t $errors[] = \"Password must include at least one letter!\";\r\n \t}\r\n // only proceed if there are no errors.\r\n \tif(empty($errors)) {\r\n //Encrypt before sending to database\r\n $password = password_hash($password, PASSWORD_DEFAULT);\r\n \t\t//Assign a random profile picture\r\n \t\t$number = rand(1, 16); //Random number between 1 and 16\r\n \t\t$avatar = 'assets/avatars/'.$number.'.png';\r\n \t\t// prepare data to be inserted\r\n $data = [\r\n 'fullName' => $fullName,\r\n 'email' => $email,\r\n 'password' => $password,\r\n 'quote' => $quote,\r\n 'signup_date' => $date,\r\n 'avatar' => $avatar\r\n ];\r\n // wrap structure with `backticks` and content with regular \"quotemarks\"\r\n $columns = '`'.implode('`,`',array_keys($data)).'`';\r\n $values = '\"'.implode('\",\"', $data).'\"';\r\n $sql = \"INSERT INTO `users` ($columns) VALUES ($values) \";\r\n if ( $this->q($sql) ){\r\n // redirect if registration was successful.\r\n header('Location: '.site_root.'?login_form&reg_success='.$email);\r\n \t\t}\r\n \t\telse{\t$errors[] = \"Something went wrong: \".$this->ixd->error; }\r\n \t}\r\n return $errors;\r\n }", "public function registeruser($email,$dateofbirth,$phonenumber,$password){\n\t\tif($this->checkuseremail($email)){\n\t\t\t$this->email_code=md5($dateofbirth);\n\t\t\t$object=array(\n\t\t\t\t'Email' => $email,\n\t\t\t\t'DateofBirth' => $dateofbirth,\n\t\t\t\t'Password' => md5($password),\n\t\t\t\t'Phonenumber' => $phonenumber,\n\t\t\t\t'RegisterDate' => date(\"Y-m-d\"),\n\t\t\t\t'UniqueKey' => $this->email_code\n\t\t\t);\n\t\t\t$this->SendVerificationEmail($email,$this->email_code);\n\t\t\t$this->db->insert('tbl_userdetails', $object);\n\t\t\treturn true;\n\t\t\techo \"OK\";\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t\techo \"emailexist\";\n\t\t}\n\t}", "public function registration(){\n\n\t\t\t$userData = $this->Common_model->selRowData(PREFIX.\"user\",\"\",\"emailId ='\".$_POST['email2'].\"'\");\n\t\t\t $topRatedFuncies= $this->Common_model->selTableData(\"fc_flyers\",\"GROUP_CONCAT(keywords) AS funcyName\",\"createdOn BETWEEN '\".date('Y-m-d',strtotime('-30 days')).\"' AND '\".date('Y-m-d').\"'\",\"viewCount DESC\",\"5\");\n\t\t\n\n\t\t\tif(isset($_POST[\"firstName\"]) && isset($_POST[\"email2\"]) && $userData ==\"\"){\n\t\t\t\n\t\t\t\t\n\t\t $insertData\t\t\t\t=\tarray();\n\n\t\t\t\t$insertData[\"firstName\"]=\tucfirst($_POST[\"firstName\"]);\n\t\t\t\t$insertData[\"lastName\"]\t=\tucfirst($_POST[\"lastName\"]);\n\t\t\t\t$insertData[\"emailId\"]\t=\ttrim(strtolower($_POST[\"email2\"]));\n\t\t\t\t$insertData[\"password\"]\t=\tmd5(trim($_POST[\"password1\"]));\n\t\t\t // $insertData[\"funcies\"]\t= $topRatedFuncies[0]->funcyName ;\n\t\t\t\t/*if ($_POST[\"txt_keyword\"]!=\"\") {\n\t\t\t\t\t$insertData[\"funcies\"]\t=\timplode(\",\",$_POST[\"txt_keyword\"]);\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t $insertData[\"funcies\"]\t=$topRatedFuncies[0]->funcyName ;\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\t/*$insertData[\"contactNumber\"]\t=\t$_POST[\"txt_contactNumber\"];\n\t\t\t\t$insertData[\"altContactNumber\"]\t=\t$_POST[\"txt_altContactNumber\"];\n\t\t\t\t//$insertData[\"password\"]\t=\t$_POST[\"txt_password\"];\n\t\t\t\t$insertData[\"city\"]\t=\t$_POST[\"txt_city\"];\n\t\t\t\t$insertData[\"status\"]\t=\t$_POST[\"txt_status\"];\n\t\t\t\t$insertData[\"address\"]\t=\t$_POST[\"txtarea_address\"];\n\t\t\t\t$insertData[\"zipcode\"]\t=\t$_POST[\"txt_zipcode\"];\t*/\n\t\t\t\t$insertedUserId\t\t\t\t\t=\t$this->Common_model->insert(PREFIX.\"user\",$insertData);\n\t\t\t\n\t\t\tif($insertedUserId){\n\t\t\t\t/*//send email URL to registered \n\t\t\t\t$settings = array();\n\t\t\t\t$settings[\"template\"] \t\t\t\t= \"welcome_to_funcano.html\";\n\t\t\t\t$settings[\"email\"] \t\t\t\t\t= trim($insertData['emailId']); \n\t\t\t\t$settings[\"subject\"] \t\t\t\t= \"Warm welcome from the Funcano\";\n\t\t\t\t$contentarr['[[[NAME]]]']\t\t\t=\ttrim($insertData[\"firstName\"]);\n\t\t\t\t$contentarr['[[[USERNAME]]]']\t\t=\t$insertData[\"emailId\"];\n\t\t\t\t$contentarr['[[[PASSWORD]]]']\t\t=\t$insertData[\"password\"];\n\t\t\t\t//$contentarr['[[[DASHURL]]]']\t\t=\tBASEURL.'/login';\n\t\t\t\t$settings[\"contentarr\"] \t= \t$contentarr;\n\t\t\t\t$this->common_lib->sendMail($settings);*/\n\t\t\t\t//insert into hr_verification\n\t\t\t\t$insertVeri['userId']\t\t=\t$insertedUserId;\n\t\t\t\t$insertVeri['verifyType']\t=\t1;\n\t\t\t\t$insertVeri['code']\t\t\t=\tgenerateStrongPassword(16,false,'lud');\t\t\t\t\t\t\n\t\t\t\t$insertStatus = $this->Common_model->insert(\"fc_verification\", $insertVeri);\n\t\t\t\tif($insertStatus){\n\t\t\t\t\t//Send verification email\n\t\t\t\t\t$settings = array();\n\t\t\t\t\t$settings[\"template\"] \t\t\t\t= \t\"verify_account.html\";\n\t\t\t\t\t$settings[\"email\"] \t\t\t\t\t= \t$insertData['emailId']; //\"darvatkarg@gmail.com\";\n\t\t\t\t\t$settings[\"subject\"] \t\t\t\t=\t\"Funcano - verify account\";\n\t\t\t\t\t$contentarr['[[[VERIFYURL]]]']\t\t=\tBASEURL.\"/home/verify-account/\".$insertVeri['code'];\n\t\t\t\t\t$settings[\"contentarr\"] \t\t\t= \t$contentarr;\n\t\t\t\t\t$this->common_lib->sendMail($settings);\t\n\t\t\t\t\t\n\t\t\t\t\t$outputData['result']\t=\t\"Success\";\n\t\t\t\t}\n\t\t\n\t\t\t}\n\t\t} else{\n\t\t\t$outputData['result']\t=\t\"Failed\";\n\t\t\t\n\t\t}\n\t\t$this->load->viewF('ajaxresult',$outputData);\n\t}", "public function create_device()\n\t{\n\t\t$this->data['title'] = \"Create Device\";\n\t\t\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('/', 'refresh');\n\t\t}\n\t\t\n\t\t// validate form input\n\t\t\n\t\t$this->form_validation->set_rules('mac_address', \"Mac Address\", 'trim|required|strtoupper|is_unique[devices.mac_address]');\n\t\t$this->form_validation->set_rules('company_id', \"Company Name\", 'trim|required');\n\t\t$this->form_validation->set_rules('installation_address', \"Installation Address\", 'trim|required|strtoupper');\n\t\t$this->form_validation->set_rules('installation_date', \"Installation Date\", 'trim|required|strtoupper');\n\t\t$this->form_validation->set_rules('pic_name', \"PIC Name\", 'trim|strtoupper');\n\t\t$this->form_validation->set_rules('pic_contact', \"PIC Contact\", 'trim|strtoupper');\n\t\t$this->form_validation->set_rules('working_day', \"Working Day\", 'trim|required|strtoupper');\n\t\t\n\t\tif ($this->form_validation->run() === TRUE)\n\t\t{\n\t\t\t// check to see if we are creating the user\n\t\t\t// redirect them back to the admin page\n\t\t\t$data = array(\n 'mac_address' => strtoupper($this->input->post('mac_address')),\n 'company_id' => strtoupper($this->input->post('company_id')),\n 'installation_address' => strtoupper($this->input->post('installation_address')),\n\t\t\t\t'installation_date' => $this->input->post('installation_date'),\n\t\t\t\t'pic_name' => strtoupper($this->input->post('pic_name')),\n\t\t\t\t'pic_contact' => strtoupper($this->input->post('pic_contact')),\n\t\t\t\t'working_day' => strtoupper($this->input->post('working_day'))\n );\n\t\t\tif($this->devices_model->set_device($data)){\n\t\t\t\t$this->session->set_flashdata('message', \"Device Created Successfully\");\n\t\t\t\tredirect(\"devices\", 'refresh');\n\t\t\t} else {\n\t\t\t\t$this->data['message'] = \"Unable to create device, please try again\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create user form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message'));\n\t\t}\n\t\t\t$this->data['mac_address'] = [\n\t\t\t\t'name' => 'mac_address',\n\t\t\t\t'id' => 'mac_address',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('mac_address'),\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$company_data = $this->companies_model->get_companies(false, 'company_name');\n\t\t\t$CompanyArray = array();\n\t\t\tforeach ($company_data as $company)\n\t\t\t{\n\t\t\t\t$CompanyArray[$company[\"id\"]] = $company[\"company_name\"];\n\t\t\t}\n\t\t\t$CompanyArray[NULL] = NULL;\n\t\t\t\n\t\t\t$this->data['company_id'] = [\n\t\t\t\t'name' => 'company_id',\n\t\t\t\t'id' => 'company_id',\n\t\t\t\t'data' => $CompanyArray,\n\t\t\t];\n\t\t\t$this->data['installation_address'] = [\n\t\t\t\t'name' => 'installation_address',\n\t\t\t\t'id' => 'installation_address',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('installation_address'),\n\t\t\t\t'placeholder' => 'E.g: Pearl Point, Ground Floor, Powerplant',\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$this->data['installation_date'] = [\n\t\t\t\t'name' => 'installation_date',\n\t\t\t\t'id' => 'installation_date',\n\t\t\t\t'type' => 'date',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('installation_date'),\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$this->data['pic_name'] = [\n\t\t\t\t'name' => 'pic_name',\n\t\t\t\t'id' => 'pic_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('pic_name')\n\t\t\t];\n\t\t\t$this->data['pic_contact'] = [\n\t\t\t\t'name' => 'pic_contact',\n\t\t\t\t'id' => 'pic_contact',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('pic_contact')\n\t\t\t];\n\t\t\t$this->data['working_day'] = [\n\t\t\t\t'name' => 'working_day',\n\t\t\t\t'id' => 'working_day',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('working_day'),\n\t\t\t\t'placeholder' => \"E.g:\\nMon to Sat: 9am - 5pm\\nSun: 9am - 2pm\",\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$this->data['page'] = \"devices\";\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'header', $this->data);\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'side', $this->data);\n\t\t\t$this->load->view('devices'. DIRECTORY_SEPARATOR . 'create_device', $this->data);\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'adminfooter', $this->data);\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'footer', $this->data);\n\t}", "public function actionSignUp() {\n //validate webservice\n $requiredParams = ['name', 'email', 'password', 'device_type'];\n\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n\n try {\n //Get request parameters.\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n\n $name = $post['name'];\n $email = $post['email'];\n $password = $post['password'];\n $device_type = $post['device_type'];\n\n if (isset($post['email']) && !empty($post['email'])) {\n $emailExist = Users::findOne(['email' => $post['email']]);\n if (isset($emailExist) && !empty($emailExist)) {\n return CommonApiHelper::return_error_response(\"Email already registered:\", \"Please try with different email\", \"2\");\n }\n }\n\n $modelUser = new Users();\n $modelUser->role_id = 2;\n $modelUser->user_type = Yii::$app->params['USER_TYPE']['user'];\n $modelUser->email = !empty($post['email']) ? trim($post['email']) : '';\n $modelUser->name = !empty($post['name']) ? trim($post['name']) : '';\n $modelUser->profile_pic = !empty($post['profile_pic']) ? trim($post['profile_pic']) : '';\n $modelUser->password = !empty($post['password']) ? password_hash($post['password'], PASSWORD_BCRYPT) : null;\n $modelUser->status = 1;\n\n if ($modelUser->save(false)) {\n // Update user's device token and acccess token \n $access_token = md5($modelUser->user_id . time());\n $userAccessToken = new UsersAccessTokens;\n $userAccessToken->user_id = $modelUser->user_id;\n $userAccessToken->access_token = $access_token;\n $userAccessToken->device_token = !empty($post['device_token']) ? trim($post['device_token']) : '';\n $userAccessToken->device_type = !empty($device_type) ? $device_type : Yii::$app->params['DEVICE_TYPE']['android'];\n $userAccessToken->save(false);\n\n /* //save the profile picture.\n if (isset($_FILES['profile_pic']['name']) && !empty($_FILES['profile_pic']['name']))\n {\n $modelUser->profile_pic = time().$_FILES['profile_pic']['name'];\n move_uploaded_file($_FILES['profile_pic']['tmp_name'],Yii::$app->params['DOCUMENT_ROOT'].'uploads/profile_pic/'.$modelUser->profile_pic);\n }\n else\n {\n $modelUser->profile_pic = \"\";\n }\n $modelUser->save(false); */\n }\n\n //Prepare response\n $response[] = [\n 'user_id' => $modelUser->user_id,\n 'user_type' => $modelUser->user_type,\n 'name' => $modelUser->name,\n 'email' => $modelUser->email,\n 'profile_pic' => !empty($modelUser->profile_pic) ? $modelUser->profile_pic : '',\n 'is_otp_verified' => $modelUser->is_otp_verified,\n 'access_token' => $userAccessToken->access_token\n ];\n\n if (!empty($modelUser->email)) {\n $emailformatemodel = EmailFormat::findOne([\"id\" => Yii::$app->params['EMAIL_TEMPLATE_ID']['welcome'], \"status\" => '1']);\n if ($emailformatemodel) {\n //create email body\n $AreplaceString = array('{password}' => $post['password'], '{name}' => $modelUser->name, '{email}' => $modelUser->email);\n $body = CommonApiHelper::MailTemplate($AreplaceString, $emailformatemodel->body);\n $ssSubject = $emailformatemodel->subject;\n //send email to new registered user\n Yii::$app->mailer->compose()\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name])\n ->setTo($modelUser->email)\n ->setSubject($ssSubject)\n ->setHtmlBody($body)\n ->send();\n }\n }\n\n return CommonApiHelper::return_success_response(\"Sign Up Successfully.\", \"\", $response);\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response(\"Sorry, Please try again.\");\n }\n }", "public function registration($username,$password,$name) { \n \n \n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t$email_exist= \"Select * FROM customer_entity where email='$username'\";\n\t\t$result_email = $connection->fetchAll($email_exist);\n\t\tif(!empty($result_email))\n\t\t{\n\t\t\t$result=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Email id Exist!\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t $websiteId = $this->storeManager->getWebsite()->getWebsiteId();\n $customer = $this->customerFactory->create();\n $customer->setEmail($username); \n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t\t\t$parts = explode(\" \", $name);\n\t\t\t\t $lastname = array_pop($parts);\n\t\t\t\t $firstname = implode(\" \", $parts);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t $lastname = $name;\n\t\t\t\t\t $firstname = $name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t\t\n \n\t\t\t\t\t$customer->setFirstname($firstname);\n\t\t\t\t\t$customer->setLastname($lastname); \n\t\t\t\t\t$customer->setPassword($password);\n\n\t\t\t\t\t// Save data\n\t\t\t\t $customer->save();\n\t\t\t\t \n\t\t\t\t if($customer->getId())\n\t\t\t\t\t {\n\t\t\t\t\t\t $customer->sendNewAccountEmail();\n\t\t\t\t\t\t // $customer->sendNewAccountEmail('registered', '',1);\n\t\t\t\t\t\t $result=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\",'user_detail'=>array('id'=>$customer->getId(),'username'=>$username,'password'=>$password,'name'=>$name)));\n\t\t\t\t\t\t//echo $customer->getId();\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t$result=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Registration Error\"));\n\t\t\t\t\t\n\t\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t}\n \n\t \n\t /* $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t $addresss = $objectManager->get('\\Magento\\Customer\\Model\\AddressFactory');\n\t $address = $addresss->create();\n $address->setCustomerId($customer->getId())\n ->setTelephone('0038511223344')\n ->setIsDefaultBilling('1')\n ->setIsDefaultShipping('1')\n ->setSaveInAddressBook('1'); \n $address = $addresss->create();\n $address->setCustomerId($customer->getId())\n ->setFirstname('Mav')\n ->setLastname('rick')\n ->setCountryId('HR')\n //->setRegionId('1') //state/province, only needed if the country is USA\n ->setPostcode('31000')\n ->setCity('Osijek')\n ->setTelephone('0038511223344')\n ->setFax('0038511223355')\n ->setCompany('GMI')\n ->setStreet('NO:12 Lake View')\n ->setIsDefaultBilling('1')\n ->setIsDefaultShipping('1')\n ->setSaveInAddressBook('1'); \n\t \n\t $address->save(); */\n\t \n\t \n\t \n\t \n\t \n\t \n \n\t\t// $id=$customer->getId(); \n\t\t\n\t\t/* $redirectUrl='';\n\t\t$customer = $this->customerAccountManagement\n ->createAccount($username,$password,$redirectUrl); */\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n\t\t return $result; \n\t }", "public function register(Request $request) \n { \n $validator = Validator::make($request->all(), [ \n 'name' => 'required', \n 'company_name' => 'required',\n 'email' => 'required|email|unique:users', \n 'password' => 'required', \n 'c_password' => 'required|same:password', \n 'chapter' => 'required', \n ]);\n if ($validator->fails()) { \n $errors = $validator->errors();\n foreach ($errors->all() as $message) {\n return response()->json([\n 'status'=>0,\n 'base_url' => $this->base_url,\n 'message'=>$message\n ], $this->errorCode);\n }\n }\n $input = $request->all(); \n $input['password'] = $password = Hash::make($input['password']);\n $input['rnumber'] = (isset($input['rnumber']))?$input['rnumber']:'';\n $input['company_name'] = (isset($input['company_name']))?$input['company_name']:'';\n $input['user_role'] = 3;\n $input['status'] = 0;\n $user = (new Users)->createUser($input);\n $success['name'] = $user->name;\n return response()->json([\n 'status'=>1,\n 'base_url' => $this->base_url,\n 'message'=>'User registered successfully. Wait for admin verification',\n 'userDetail' => $user\n ], $this->successCode); \n }", "public function registerUser($request) {\n $result = [];\n $formData = $request->getParsedBody();\n\n $firstname= null;\n $secondname= null;\n $firstlastname= null;\n $secondlastname= null;\n $personalId= null;\n $email= null;\n $password= null;\n $repeatPass= null;\n $userType= null;\n\n LoggingService::logVariable($formData, __FILE__, __LINE__);\n\n if (array_key_exists(\"firstname\", $formData)) {\n $firstname = $formData[\"firstname\"];\n }\n\n if (array_key_exists(\"secondname\", $formData)) {\n $secondname = $formData[\"secondname\"];\n }\n\n if (array_key_exists(\"firstlastname\", $formData)) {\n $firstlastname = $formData[\"firstlastname\"];\n }\n\n if (array_key_exists(\"secondlastname\", $formData)) {\n $secondlastname = $formData[\"secondlastname\"];\n }\n\n if (array_key_exists(\"personalId\", $formData)) {\n $personalId = $formData[\"personalId\"];\n }\n\n if (array_key_exists(\"email\", $formData)) {\n $email = $formData[\"email\"];\n }\n\n if (array_key_exists(\"password\", $formData)) {\n $password = $formData[\"password\"];\n }\n\n if (array_key_exists(\"repeatPass\", $formData)) {\n $repeatPass = $formData[\"repeatPass\"];\n }\n\n if (array_key_exists(\"userType\", $formData)) {\n $userType = $formData[\"userType\"];\n }\n\n $registerResult = $this->userService->registerUser($firstname, $secondname, $firstlastname, $secondlastname, $personalId, $email, $password, $repeatPass, $userType);\n\n if(array_key_exists(\"error\", $registerResult)) {\n $result[\"error\"] = true;\n $result[\"message\"] = $registerResult[\"message\"];\n $result[\"created\"] = false;\n }else{\n $result[\"meta\"]= $registerResult[\"meta\"][\"id\"];\n $result[\"message\"] = $registerResult[\"message\"];\n $result[\"created\"] = true;\n }\n\n\n return $result;\n }", "function registerUser()\n{\n // Return value\n $return_val = array(\n\t 'result' => true, // success\n\t 'err' => \"\", // err msg\n\t 'pass_err' => \"\" // wrong pass err msg\n\t );\n\n // User data\n $usr_info = array(\n\t 'name' => ''\n\t );\n\n // Logger\n $logger = new Logger();\n $logger->addLog(\"Registering new user\");\n\n // Chk all fields are filled\n if (empty($_POST[\"name\"]) || empty($_POST[\"pass\"]) || empty($_POST[\"pass2\"])) \n {\n\t$return_val['result'] = false;\n\t$return_val['err'] = \"*Please fill data\";\n\treturn $return_val;\n }\n\n // Compare pass1 and pass2\n else if ($_POST[\"pass\"] != $_POST[\"pass2\"])\n {\n\t$return_val['result'] = false;\n\t$return_val['pass_err'] = \"*Password did not match\";\n\treturn $return_val;\n }\n\n $name = formatString($_POST[\"name\"]);\n $pass = $_POST[\"pass\"];\n\n if ($name == false) \n {\n\t$return_val['result'] = false;\n\t$return_val['err'] = \"*User name should not contain special characters or space.\";\n\treturn $return_val;\n }\n\n $hash = password_hash($name.$pass, PASSWORD_DEFAULT);\n\n $base_dir = $_SERVER['DOCUMENT_ROOT'];\n\n // User dir\n $folder_path = \"$base_dir/Data/users/\".$name.\"/\";\n\n // Chk username availability\n if (file_exists($folder_path))\n {\n\t$return_val['result'] = false;\n\t$return_val['err'] = \"*Please select a different user name.\";\n\t$logger->addLog(\"Registration Failed : User $name already exists\");\n\treturn $return_val;\n }\n // Create new user\n else\n {\n\tmkdir($folder_path, 0777, true);\n\t$file = fopen($folder_path.\"userInfo.dat\", 'w');\n\t$usr_info['name'] = $name;\n\t$usr_info['hash'] = $hash;\n\tfwrite($file, json_encode($usr_info));\n\tfclose($file);\n }\n\n $logger->addLog(\"Registration success : User $name was created.\");\n return $return_val;\n}", "function user_register($user_info)\n {\n }", "public function registerUser()\n {\t\n\t\t/**\n\t\t * Our UserModel will return an error \n\t\t * if the email already exists, \n\t\t * or if the passwords do not match\n\t\t */\n\t\ttry{\n\t\t$user = new UserModel();\n\t\t$user->name = Input::get('name');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Input::get('password');\n\t\t$user->password_confirmation = Input::get('password_confirmation');\n\t\t$user->save();\t\n\t\t$this->setToken($user);\n\t\treturn $this->sendResponse('You have been registered and are logged in');\n\t\t}\n\t\tcatch(Exeption $e){\n\t\t\treturn $this->sendResponse(false, $e->getMessage());\n\n\t\t}\n }", "function register(){ \t\n\t\t$table = 'users';\n\t\t$capability =$sessionrole='';\t\t\n\t\t$type = $this->input->post('type');\n\t\t$redirect__url = base_url();\n\t\tif( $type == 'client' ):\n\t\t\t$role = 'client';\n\t\t\t$redirect__url = base_url('Interact/add_client');\n\t\telse:\n\t\t\t$role = $this->input->post('role');\n\t\t\t$redirect__url = base_url('Interact/add_user');\n\t\tendif; \n\t\t$attorney_id = $this->input->post('attorney_id');\n\t\t$user_name = $this->input->post('personInput');\n\t\t$current_url = $this->input->post('current_url');\n\t\t$companyName = $this->input->post('nameInput');\n\t\t$email = $this->input->post('emailInput');\n\t\t$password = $this->input->post('passInput');\n\t\t$confirm_password = $this->input->post('confirmPassInput');\n\t\t$phoneInput = $this->input->post('phoneInput');\n\t\t$screen_name = $this->input->post('screen_name');\t\t\n\t\tif( $role == 'admin' ):\t\t\t\n\t\t\t$customer_address = $this->input->post('customer_address');\n\t\t\t$street_number = $this->input->post('street_number');\n\t\t\t$city = $this->input->post('city');\n\t\t\t$state = $this->input->post('state');\n\t\t\t$postal_code = $this->input->post('postal_code');\n\t\tendif;\n\t\t$check_data = array('user_email' => $email);\n\t\t$check_user_availability = $this->InteractModal->check_user_availability( $check_data, $table );\n\t\tif(!empty($check_user_availability )):\n\t\t\t$this->session->set_flashdata('msg', 'User already exist with similar email!');\n\t\t\tif(!empty($current_url)){\n\t\t\tredirect( $current_url );\n\t\t\t}else{\n\t\t\tredirect( $redirect__url );\n\t\t\t}\n\t\telse:\n\t\t\t$data = array('user_email' => $email ,\n\t\t\t\t\t 'password' => md5( $password ),\n\t\t\t\t\t 'role' => $role,\n\t\t\t\t\t 'status' => 1,\n\t\t\t\t\t 'create_date' => date('Y-m-d h:i:s')\n\t\t\t);\t\t\t\n\t\t\t$response = $this->InteractModal->register_user($data, $table);\t\t\t\n\t\t\tif( array_key_exists('id', $response )): // update user meta in database \n\t\t\t\t$user_id = $response['id'];\t\n\t\t\t\t\t\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'concerned_person' , $user_name );\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'company_name' , $companyName );\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'phone_number' , $phoneInput );\t\t\t\t\n\t\t\t\tif( $role == 'admin' ):\n\t\t\t\t\tif(!empty($attorney_id)){\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'atterney_id' , $attorney_id );\n\t\t\t\t\t}\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'customer_address' , $customer_address );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'street_number' , $street_number );\n\t\t\t\t\t//$this->InteractModal->add_user_meta( $user_id, 'route' , $route );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'city' , $city );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'state' , $state );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'postal_code' , $postal_code );\n\t\t\t\t\t//$this->InteractModal->add_user_meta( $user_id, 'country' , $country );\t\t\t\t\t\n\t\t\t\tendif;\t\t\t\t\n\t\t\t\tif( $role =='client' ):\n\t\t\t\t\t$company_id = $this->input->post('company_id');\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'company_id' , $company_id );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'screen_name' , $screen_name );\n\t\t\t\tendif;\n\t\t\t\t$company = preg_replace('/\\s+/', '+', $companyName);\n\t\t\t\t//$login_url = base_url('Interact/userlogin/'.$company.'&'.$user_id);\n\t\t\t\t$login_url = base_url();\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'login_url' , $login_url );\t\n\t\t\t\t$login_deatil = 'Your credentials for login in interactACM account is: <br /> username: '. $email .'<br /> Password: '. $password .'<br /> Login Url: '. $login_url. ' ';\n\t\t///get auto email content data \n\t\t\tif($role==\"client\"){\n\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_1' );\n\t\t\t\tif(($status_template ==1) ){\n\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_1' );\n\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_1' );\n\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \n\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phoneInput,$content); \n\t\t\t\t\tif (strpos($content, '_LOGIN_DETAILS_') !== false) {\n\t\t\t\t\t\t $content = str_replace(\"_LOGIN_DETAILS_\",$login_deatil,$content); \n\t\t\t\t\t}else{\n\t\t\t\t\t\t $content = $content.'<br>'.$login_deatil;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$template_list = $this->InteractModal->get_email_template(1);\n\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t$content = $login_deatil;\n\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$this->send_email($email_data );\n\t\t\t}else{\n\t\t\t\t$email_content = 'Welcome to interactACM. Your credentials for login in interactACM account is: <br /> username: '. $email .'<br /> Password: '. $password .'<br /> Login Url: '. $login_url. ' ';\t\t\t\t\n\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t\t\t'content' => $email_content,\n\t\t\t\t\t\t\t\t\t'subject' => 'Welcome to interactACM'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t$this->send_email( $email_data ); \n\t\t\t\t/*====Email send super admin =======*/\n\t\t\t\t$content_superadmin='Hi interactACM<br/> A new broker is register with us. The details of which are following<br>Broker Name: '.$user_name.'<br> Contact Number: '.$phoneInput.'<br> Contact Email: '.$email; \n\t\t\t\t\t$email_data1 = array('email' => 'info@interactacm.com', \n\t\t\t\t\t\t\t\t\t\t'content' => $content_superadmin, \n\t\t\t\t\t\t\t\t\t\t'subject' => 'New Broker Registration'\n\t\t\t\t\t\t\t\t\t\t); \t\t\t\t\t\n\t\t\t\t\t$this->send_email($email_data1);\n\t\t\t\t/*======Email send super admin========*/\n\t\t\t\tif(!empty($current_url)):\n $this->session->set_flashdata('msg', 'Thank you for registering with us. Your login credentials has been sent in registered email. Please check your mailbox.');\n\t\t\t redirect( $current_url ); \n\t\t\t\tendif;\n\t\t\t}\n\t\t\t\t$regex = \"/^(\\(?\\d{3}\\)?)?[- .]?(\\d{3})[- .]?(\\d{4})$/\"; \n\t\t\t\t$mobile = preg_replace($regex, \"\\\\1\\\\2\\\\3\", $phoneInput); \n\t\t\t\t//$this->send_text_message($mobile,$email);\t\t\t\t\n\t\t\t\tif( $role =='client' ):\n\t\t\t\t\tredirect( base_url('Interact/afterAddClient/'.urlencode(base64_encode($user_id )))); \n\t\t\t\telse:\n\t\t\t\t redirect( base_url( 'Interact/all_users/'.$role ) );\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\telse:\n\t\t\t\techo $response['error'];\n\t\t\tendif; //==== error or id check ends\n\t\t\t//echo $response;\n\t\tendif;\t//==== user not exist proceed ends\n\t}", "function post_registration($email, $hash_pass, $first_name, $last_name){\n // Build the query to create a user account\n $query = \"INSERT INTO UserAccount (email, hash_pass, first_name, last_name) VALUES (?,?,?,?)\";\n // Create an array of the parameters for paramater binding\n $params = array($email, $hash_pass, $first_name, $last_name);\n // Execute the query\n if ($this->db->query($query, $params)){\n $data['success'] = \"Much success! Account created. Go login.\\n\";\n } else {\n $data['error'] = \"Error! Account registration failed.\\n\";\n }\n // Pass back the data\n return $data;\n }", "public function register() {\n\n define('KDEBUG_JSON', true);\n\n $errors = array();\n $success = true;\n\n $slug = user::generateUniqueUsername($_REQUEST['username']);\n if (!isset($_REQUEST['username']) || empty($_REQUEST['username']) || $_REQUEST['username'] == 'Full name') {\n $errors['register_username'] = 'You must specify your Full Name';\n $success = false;\n } elseif (user::findOne(array('slug' => $slug))) {\n $errors['register_username'] = 'This username already exists';\n $success = false;\n }\n\n if (!isset($_REQUEST['email']) || empty($_REQUEST['email']) || $_REQUEST['email'] == 'email address') {\n $errors['register_email'] = 'You must specify an e-mail address';\n $success = false;\n } elseif (!filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {\n $errors['register_email'] = 'Invalid e-mail address';\n $success = false;\n } elseif (user::findOne(array('email' => $_REQUEST['email'])) != null) {\n $errors['register_email'] = 'This e-mail address already exists';\n $success = false;\n }\n\n\n if (!isset($_REQUEST['password']) || empty($_REQUEST['password']) || $_REQUEST['password'] == 'password') {\n $errors['register_password'] = 'You must specify a password';\n $success = false;\n } elseif (user::verify('password', $_REQUEST['password']) !== true) {\n $errors['register_password'] = user::verify('password', $_REQUEST['password']);\n $success = false;\n }\n\n if ($_REQUEST['password'] != $_REQUEST['verify']) {\n $errors['register_verify'] = 'Your passwords do not match';\n $success = false;\n }\n\n if ($success) {\n\n // create our new user\n $user = new user();\n $user->email = $_REQUEST['email'];\n $user->username = $_REQUEST['username'];\n $user->slug = $slug;\n\n $user->public = 1;\n $user->created = time();\n $user->updated = time();\n $user->password = crypt($_REQUEST['password']);\n $user->save();\n $user->login();\n\n }\n\n echo json_encode(array('success' => $success, 'errors' => $errors));\n return true;\n\n }", "public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function register (){\n $msg=\"\";\n if (isset($_POST[\"register\"])) {\n if ($this->isValidInput($_POST)){\n $firstName = $_POST[\"firstName\"];\n $lastName = $_POST[\"lastName\"];\n $email = $_POST[\"email\"];\n $password = password_hash(trim($_POST[\"password\"]), PASSWORD_BCRYPT);\n $age = $_POST[\"age\"];\n $isAdmin = null;\n //if user is not empty - the email from input already exists\n $user = UserDao::getByEmail($email);\n if($user != null){\n $msg .= \"Вече съществува потребител с този email\";\n $this->triggerError($msg, 'register.tpl');\n }\n else {\n $newUser = new User(null, $firstName,$lastName,$email,$password,$age,$isAdmin);\n UserDao::addUser($newUser);\n $_SESSION[\"user\"] = $newUser;\n header(\"Location: \".BASE_PATH);\n }\n }\n else {\n $msg .= \"Въведени са невалидни данни\";\n $this->triggerError($msg, 'register.tpl');\n }\n }\n else {\n $GLOBALS[\"smarty\"]->assign('isLoggedIn', isset($_SESSION[\"user\"]));\n $GLOBALS[\"smarty\"]->assign('msg', $msg);\n $GLOBALS[\"smarty\"]->display('register.tpl');\n }\n }", "public function register(Request $request){ \n \n $this->validate($request, [\n 'username' => 'required',\n 'fullname' => 'required',\n 'phone_number' => 'required',\n 'password' => 'required|min:6|confirmed',\n ],$messages=[\n 'required' => 'Atribut di atas perlu diisi',\n 'min' => 'Atribut perlu diisi minimal :min karakter',\n 'confirmed' => 'Atribut pada password dan konfirmasi password tidak boleh berbeda'\n ]);\n\n User::create([\n 'username' => request('username'),\n 'fullname' => request('fullname'),\n 'phone_number' => request('phone_number'),\n 'password' => bcrypt(request('password')),\n 'role' => 'mahasiswa',\n ]);\n Alert::success('Success', 'Selamat datang di SimKP');\n return redirect()->route('login');\n }", "public function register () {\r\n if (isset($_POST['submitr'])) {\r\n\r\n $fnm = addslashes(strip_tags($_POST['fname']));\r\n $lnm = addslashes(strip_tags($_POST['lname']));\r\n $email = addslashes(strip_tags($_POST['emailr']));\r\n $pwd = addslashes(strip_tags($_POST['pwdr']));\r\n\r\n if ($fnm !==\"\" && $lnm !==\"\" && $email !==\"\" && $pwd!==\"\") {\r\n\r\n\r\n $s = \"INSERT INTO users (firstName,lastName,email, password) VALUES (?,?,?,?)\";\r\n $sql = $this->_r-> prepare($s);\r\n $sql->execute(array($fnm,$lnm,$email,$pwd));\r\n\r\n echo \"Successfully registered\";\r\n\r\n\r\n\r\n }else {\r\n echo \"Please fill all the information\";\r\n }\r\n\r\n }\r\n\r\n\r\n }", "function registerOnEjabberd($mobile_no,$jaxlPassword){\n /*********************register with curl code start*****************************************/\n $ch = curl_init();\n $options = array(\n CURLOPT_URL => \"https://sociabile-test.m.in-app.io:5281/api/register\",\n //CURLOPT_HEADER => true,\n CURLOPT_POST => 1,\n // CURLOPT_HTTPHEADER => $headers,\n CURLOPT_POSTFIELDS => '[\"'.$mobile_no.'\",\"'.JAXL_HOST_NAME.'\",\"'.$jaxlPassword.'\"]',\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true\n ); // cURL options\n curl_setopt_array($ch, $options);\n $result = curl_exec($ch);\n curl_close($ch);\n if( strpos($result, \"successfully registered\") !== false || strpos($result, \"already registered\") !== false ){\n return array(\"jaxl_id\"=>$mobile_no.'@'.JAXL_HOST_NAME, \"jaxl_password\"=>$jaxlPassword);\n }else{\n Library::logging('error',\"API : registration : JAXL registration failed with error \".$result.\". \".$mobile_no);\n Library::output(false, '0', JAXL_REG_FAILED, null); \n \n }\n /*********************register with curl code end*****************************************/\n \n require 'components/JAXL3/jaxl.php';\n require 'components/JAXL3/register.php';\n $client = new JAXL(array(\n// 'jid' => JAXL_HOST_NAME,\n 'host' => JAXL_HOST_NAME,\n 'log_level' => JAXL_ERROR,\n \"port\"=>5281\n ));\n\n $client->require_xep(array(\n '0077'\t// InBand Registration\t\n ));\n $form=array( \"username\"=>$mobile_no, \"password\"=>$jaxlPassword );\n $client->add_cb('on_stream_features', function($stanza) {\n $client = $_SESSION[\"client\"];\n $client->xeps['0077']->get_form(JAXL_HOST_NAME);\n return \"wait_for_register_form\";\n });\n\n $client->add_cb('on_disconnect', function() {\n });\n $_SESSION[\"client\"] = $client;\n $_SESSION[\"form\"] = $form;\n // finally start configured xmpp stream\n $client->start();\n $form = $_SESSION[\"form\"];\n unset($_SESSION[\"client\"]);\n unset($_SESSION[\"form\"]);\n if( isset($form['type']) ) {\n if($form['type'] == 'result') { //if registered successfully\n return array(\"jaxl_id\"=>$form[\"username\"].'@'.JAXL_HOST_NAME, \"jaxl_password\"=>$jaxlPassword);\n }else{ //if not registered successfully with an error\n Library::logging('error',\"API : registration : JAXL registration failed with error \".$form['type'].\". \".$mobile_no);\n Library::output(false, '0', JAXL_REG_FAILED, null); \n }\n }else{ //if not registered successfully with unknown error\n Library::logging('error',\"API : registration : JAXL registration failed \".$mobile_no. var_export($form, true));\n Library::output(false, '0', JAXL_REG_FAILED, null);\n }\n }", "public function register_new() {\n\t\t$fields = array(\n\t\t\t'address1', 'address2', 'city', 'comment', 'country', 'email', 'fax_src', 'first_name',\n\t\t\t'gender', 'insertion', 'company_name', 'lang', 'last_name', 'middle_name', 'mobile_src',\n\t\t\t'phone_src', 'prefix', 'state', 'suffix', 'zip', 'tax_ex_number', 'timezone'/* , 'house_num', 'house_suff' */\n\t\t);\n\t\t$clean_data = $this->_fill_account_data($fields);\n\n\t\t$clean_data['password'] = $_POST['password'];\t## password may contain escapeable symbols\n\t\t$clean_data['fraud_check'] = 1;\n\t\t$clean_data['ip_address'] = $this->translator->getClientIp();\n\n\t\tinstall_error_handler(array('UserPerson', 'NewAccountsDenied', 'UserExtData', 'InvalidAccountStatus'), 'handle_register_new_account_error');\n\t\t$account_id = call('create_customer', $clean_data, 'HSPC/API/Account');\n\t\tif($account_id) {\n\t\t\t$this->error->add(MC_SUCCESS, 'YOU_BEEN_REGISTERED');\n\t\t\treturn $this->sign_in();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function registerNewUser($userFirstName, $userLastName, $userName, $email, $userPassword)\n {\n \t# Open and validate the Database connection\n \t$conn = connect();\n\n if ($conn != null)\n {\n \t$sql = \"INSERT INTO Users(fName, lName, username, email, passwrd) VALUES ('$userFirstName', '$userLastName', '$userName', '$email', '$userPassword')\";\t\t\n\t\t\tif (mysqli_query($conn, $sql)) \n\t \t{\n\t \t\t# User registered correctly\n\t \t\t$conn->close();\n\t\t\t return array(\"status\" => \"COMPLETE\");\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t# Something went wrong when inserting the user\n\t\t\t\t$conn->close();\n\t\t\t\treturn array(\"status\" => \"ERROR\");\n\t\t\t}\n }\n else\n {\n \t# Connection to Database was not successful\n \t$conn->close();\n \treturn array(\"status\" => \"ERROR\");\n }\n }", "public function register(Request $request){\n\t\t\n\t\t$user= User::where('email', $request->email)->first();\n\n\t\t/*\n\t\t * $user =User::firstOrNew([ 'email' => $request-> email]);\n\t\t * if ($user->exist) {\n\t\t * // asd\n\t\t * } \n\t\t */\n\n\t\t$wallet= new Wallet();\n\t\t//$data= User::find($request->email);\n\n\t\tif(!$user){\n\t\t\t$input= $request->all();\n\n\t\t\t$input['password'] = Hash::make($input['password']);\n\t\t\t$input['email'] = $input['email'];\n\t\t\t$input['name'] = $input['name'];\n\t\t\t$input['phoneNumb'] = $input['phoneNumb'];\n\t\t\t$send_id = User::create($input);\n\n\t\t\t//create wallet id\n\t\t\t//$temp= DB::table('users')->where('email', $request->email)->get();\n\n\t\t\t$wallet->saldo = 0;\n\t\t\t$wallet->id_user = $send_id->id;\n\t\t\t$wallet->save();\n\t\t\t//end\n\t\t\t\n\t\t\t// $message[0]['success'] = '1';\n\t\t\t// $message[0]['message'] = \"Registration Success!\";\n\t\t\treturn response()->json(['result'=>'Registration success']);\n\t\t\t\n\n\t\t\t//return response()->json(['result' => 'sukses register']);\n\t\t}else{\n\t\t\n\t\t// $message['0']['success'] = '0';\n\t\t// $message['0']['message'] = \"Registration Failed!\";\n\t\treturn response()->json(['result'=>'Registration Fail!']);\n\t\t//return response()->json(['result' => 'gagal register']);\n\t\t\n\t\t}\n\t}", "public function register($data){\n\t\n\t\t$passArray = array();\n\t\t$mod = new userModel();\n\t\t\n\t\t$userName = $data['username'];\n\t\t$email = $data['email'];\n\t\t$password = md5($data['password']);\n\t\t\n\t\ttry{\n\t\t\t// Check for unique username\n\t\t\t$resUser = $mod->userCheck($userName);\n\t\t\tif(mysql_num_rows($resUser) > 0){\n\t\t\t\t$status = FAIL;\n\t\t\t\t$message = USRERRORMESSAGE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$resEmail = $mod->emailCheck($email);\n\t\t\t\tif(mysql_num_rows($resEmail) > 0){\n\t\t\t\t\t$status = FAIL;\n\t\t\t\t\t$message = EMAILMESSAGE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Registration process goes here\n\t\t\t\t\t$res = $mod->register($userName,$email,$password);\n\t\t\t\t\t$status = SUCCESS;\n\t\t\t\t\t$message = REGMESSAGE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(exception $error)\n\t\t{\n\t\t\t$status =FAIL;\n\t\t\t$message = $error;\n\t\t}\n\t\t\n\t\t$response = array(\n\t\t\t\t\t\t\t\"Status\" => $status,\n\t\t\t\t\t\t\t\"Message\"=> $message,\n\t\t\t\t\t\t\t\"Result\"=>$passArray\n\t\t\t\t\t\t);\n\t\t\n\t\treturn $response;\n\t}", "public function postCreateUser(){\n\n if (Admin::isAdmin(Helper::userId())) {\n $email = Input::get('email');\n $password = Input::get('password');\n $password_confirm = Input::get('password_confirm');\n\n\n if (\n isset($email) && $email != \"\" &&\n isset($password) && $password != \"\" &&\n isset($password_confirm) && $password_confirm != \"\"\n ) {\n\n if ($password != $password_confirm) {\n return json_encode(['error' => \"Passwords do not match.\"]);\n }\n\n if(User::where('email', '=', $email)->first()){\n return json_encode(['error' => \"Email already exists.\"]);\n }\n\n\n $user = [\n 'email' => $email,\n 'password' => Hash::make($password),\n 'gcm_token' => '',\n ];\n\n User::insert($user);\n Helper::dbLogger('AdminController', 'user', 'insert', 'postCreateUser', User::email(Helper::userId()), 'email:' . $email);\n\n try {\n Notifier::sendConfirmationEmail($email);\n return json_encode(['success' => 1]);\n } catch (Exception $e) {\n return json_encode([\n 'success' => 1\n ]);\n }\n }\n else {\n return json_encode(['error' => \"There are missing parameters.\"]);\n }\n }\n else {\n return json_encode(array('status' => 0, 'message' => 'You are not allowed to access this function.'));\n }\n\n }", "public function register(){\n if($this->isLoggedIn()){\n redirect('dashboard');\n }\n \n // Check if POST\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n // Sanitize POST\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n \n $data = [\n 'username' => trim($_POST['username']),\n 'email' => trim($_POST['email']),\n 'password' => trim($_POST['password']),\n 'confirm_password' => trim($_POST['confirm_password']),\n 'username_err' => '',\n 'email_err' => '',\n 'password_err' => '',\n 'confirm_password_err' => '',\n 'searchTerm'=>''\n ];\n \n // Validate email\n if(empty($data['email'])){\n $data['email_err'] = 'Please enter an email';\n // Validate name\n if(empty($data['name'])){\n $data['name_err'] = 'Please enter a name';\n }\n } else{\n // Check Email\n if($this->userModel->findUserByEmail($data['email'])){\n $data['email_err'] = 'Email is already taken.';\n }\n\n if($this->userModel->findUserByusername($data['username'])){\n $data['username_err'] = 'Username is already taken.';\n\n }\n }\n \n // Validate password\n if(empty($data['password'])){\n $password_err = 'Please enter a password.'; \n } elseif(strlen($data['password']) < 6){\n $data['password_err'] = 'Password must have atleast 6 characters.';\n }\n \n // Validate confirm password\n if(empty($data['confirm_password'])){\n $data['confirm_password_err'] = 'Please confirm password.'; \n } else{\n if($data['password'] != $data['confirm_password']){\n $data['confirm_password_err'] = 'Password do not match.';\n }\n }\n \n // Make sure errors are empty\n if(empty($data['name_err']) && empty($data['email_err']) && empty($data['password_err']) && empty($data['confirm_password_err'])){\n // SUCCESS - Proceed to insert\n \n // Hash Password\n $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT);\n \n //Execute\n if($this->userModel->register($data)){\n // Redirect to login\n redirect('users/login');\n } else {\n die('Something went wrong');\n }\n \n } else {\n // Load View\n $this->view('users/register', $data);\n }\n } else {\n // IF NOT A POST REQUEST\n \n // Init data\n $data = [\n 'username' => '',\n 'email' => '',\n 'password' => '',\n 'confirm_password' => '',\n 'username_err' => '',\n 'email_err' => '',\n 'password_err' => '',\n 'confirm_password_err' => '',\n 'searchTerm'=>''\n \n ];\n \n // Load View\n $this->view('users/register', $data);\n }\n }", "public function post_register() {\n try {\n $i = Input::post();\n $validation = \\Fuel\\Core\\Validation::forge();\n $validation->add('email', 'Email')\n ->add_rule('required')\n ->add_rule('valid_email');\n $validation->add('username', 'Username')\n ->add_rule('required')\n ->add_rule('min_length', 6)\n ->add_rule('max_length', 18);\n $validation->add('password', 'Password')\n ->add_rule('required')\n ->add_rule('min_length', 6)\n ->add_rule('max_length', 18);\n\n if ($validation->run()) {\n $email = $i['email'];\n if (\\Utils::isDisposableEmail($email)) throw new \\Craftpip\\Exception(\"$email is a disposable Email, please use a genuine Email-id to signup.\");\n\n $auth = new \\Craftpip\\OAuth\\Auth();\n\n $user = $auth->getByUsernameEmail($i['email']);\n if ($user) throw new \\Craftpip\\Exception('This Email-ID is already registered.');\n\n $user_id = $auth->create_user($i['username'], $i['password'], $i['email'], 1, array());\n $auth->setId($user_id);\n $auth->setAttr('verified', false);\n $auth->setAttr('project_limit', 2);\n\n\n $mail = new \\Craftpip\\Mail($user_id);\n $mail->template_signup();\n if (!$mail->send()) {\n $auth->removeUser($user_id);\n }\n }\n else {\n throw new \\Craftpip\\Exception('Something is not right. Please try again');\n }\n $response = array(\n 'status' => true\n );\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage()\n );\n }\n\n echo json_encode($response);\n }", "public function register(Request $request){\n $message['title'] = '';\n $message['body'] = '';\n $userInfoTb = new UserInfo();\n\n // 01. validate\n $this->validate($request, [\n 'userName' => 'required',\n 'pass' => 'required',\n 'mail' => 'required',\n ]);\n $userName = $request->get('userName');\n $pass = $request->get('pass');\n $mail = $request->get('mail');\n\n // 02. check unique data\n $uniqueData['name'] = $userName;\n $uniqueData['email'] = $mail;\n $checkResult = $userInfoTb->unique($uniqueData);\n if($checkResult === \\App\\Model\\RootModel::$success){\n\n // 03. insert data\n $values = new \\stdClass();\n $values->name = $userName;\n $values->URI = \\Config::get('app.domainName').\"resource/\".str_replace(\" \", \"_\", $userName);\n $values->password = $pass;\n $values->hashPassword = \\Hash::make($values->password);\n $values->email = $mail;\n $insertResult = $userInfoTb->insertAll($values);\n\n // 04. send email or redirect\n if($insertResult === \\App\\Model\\RootModel::$success){\n $message['title'] = 'Redirect';\n $message['content'] = \\Config::get('app.domainName');\n }\n }\n else{\n $message['title'] = 'Error';\n $message['content'] = $checkResult.' had been registered, please try new one.';\n }\n\n // 05. return\n return json_encode($message);\n }", "public function createUser($email, $password, $firstname, $lastname, $phone, $blood_type, $piercing, $tattoo, $sickness, $birthyear, $gender, $weight) {\n require_once 'PassHash.php';\n $response = array();\n\n // First check if user already existed in db\n if ($this->isUserExists($email)==0) {\n // Generating password hash\n\t\t\t\n\t\t\t$pass=new PassHash();\n\t\t\t\n $password_hash = $pass->hash($password); \n\n // Generating API key\n $api_key = $this->generateApiKey();\n\n // insert query\n \n //insert user data\n $result_data=$this->con->query(\"Insert into user_data (blood_type, piercing, tattoo, sickness) Values ('\".$blood_type.\"','\".$piercing.\"', '\".$tattoo.\"', '\".$sickness.\"')\");\n \n \n //get latest user data entry\n //get latest user data entry\n $usrdata=$this->con->query(\"SELECT MAX(iduser_data) AS data FROM user_data;\");\n $usdata=$usrdata->fetch_assoc();\n $data=$usdata['data'];\n \n //insert Users table\n $result_user = $this->con->query(\"INSERT INTO user(email, pass, phone, active, firstname, lastname, locked, lock_count, score, api_key, birth_year, gender, weight, user_data_iduser_data) \n values('\".$email.\"','\".$password_hash.\"','\".$phone.\"',1,'\".$firstname.\"','\".$lastname.\"',0,0,0,'\".$api_key.\"','\".$birthyear.\"','\".$gender.\"','\".$weight.\"','\".$data.\"');\");\n \n \n // Check for successful insertion\n if ($result_user && $result_data) {\n // User successfully inserted\n return USER_CREATED;\n } else {\n // Failed to create user\n return USER_CREATE_FAILED;\n }\n } else {\n // User with same email already existed in the db\n return USER_EXISTS;\n }\n\n return $response;\n }", "private static function register() {\n if ( !self::validatePost() ) {\n return;\n }\n\n if ( !self::validEmail($_POST['email']) ) {\n self::setError('E-Mail Adresse ist nicht g&uuml;ltig!<br>');\n return;\n }\n \n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $verified = md5($_POST['email'].$password.microtime(true));\n \n $result = Database::createUser($_POST['email'],$password,$verified);\n \n if ( $result === false || !is_numeric($result) ) {\n return;\n }\n \n $_SESSION['user']['id'] = $result;\n $_SESSION['user']['email'] = $_POST['email'];\n $_SESSION['user']['verified'] = $verified;\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n \n self::registerMail($verified);\n }", "function createUser($firstname, $lastname, $email, $phone, $password){\n\n\t\tglobal $conn;\n\n\t\t$md5Password = md5($password);\n\n\t\t$query = \"INSERT INTO User (firstname, lastname, email, phone, password)\n\t\tVALUES('\" . $firstname . \"', '\" . $lastname . \"', '\" . $email . \"', '\" . $phone . \"', '\" . $md5Password . \"')\";\n\n\t\tif($conn->query($query) === TRUE){\n\t\t\treturn \"VALID_INSERTION\";\n\t\t} else {\n\t\t\treturn \"Error inserting User: \" . $conn->error . \"<br/>\";\n\t\t}\n\n\t}", "function register(){\n\n $cust=new Customer();\n \n //get each field from form\n $first_name=$_POST['first_name'];\n $last_name=$_POST['last_name'];\n $vehicle_number=$_POST['vehicle_number'];\n $address=$_POST['address'];\n $e_mail=$_POST['email'];\n $password=$_POST['password'];\n $mobile_tel_no=$_POST['mobile_tel_no'];\n $home_tel_no=$_POST['home_tel_no'];\n\n //hash the password\n //$hashed=md5($password);\n $hashed = sha1($password);\n\n //$hashed = password_hash($password,PASSWORD_BCRYPT);\n $vehicle_type=Vehicle_regex::validate($vehicle_number);\n //insert data\n $result=$cust->insert_record($first_name,$last_name,$vehicle_number,$address,$hashed,$e_mail,$mobile_tel_no,$home_tel_no,$vehicle_type);\n echo(\"resultstart\");\n echo($result);\n echo(\"resultend\");\n //ON SUCCESS, send an email to customer address\n $mail=new Mailer();\n\n $subject=\"Welcome to Cleancar Reservation System!\";\n $body=\"<strong>Dear Mr./Mrs. $last_name,</strong></br>Thank you for\n registering with Cleancar reservation System.\";\n\n //call function in class\n $mail->mailto($subject,$e_mail,$body);\n }", "public function register_post()\n {\n\n $first_name = strip_tags($_POST['first_name']);\n $last_name = strip_tags($_POST['last_name']);\n $email = strip_tags($_POST['email']);\n $password = $_POST['password'];\n $photo_path = 'default.png';\n $phone = '';\n $create_at = time();\n $update_at = time();\n $roles = 1;\n\n $token = base64_encode(random_bytes(32));\n\n $emailConfig = [\n 'protocol' => 'smtp',\n 'smtp_host' => 'ssl://smtp.googlemail.com',\n 'smtp_user' => 'indradullanov1@gmail.com',\n 'smtp_pass' => 'emansudirman123',\n 'smtp_port' => 465,\n 'mailtype' => 'html',\n 'charset' => 'utf-8',\n 'newline' => \"\\r\\n\"\n ];\n\n if (!empty($first_name) && !empty($last_name) && !empty($email) && !empty($password)) {\n // $data['email'] = $email;\n $user_check = $this->user->check_user($email);\n\n if ($user_check > 0) {\n $this->response([\n 'status' => false,\n 'message' => 'Email already registered, check your email for verification'\n ], 404);\n } else {\n $data = [\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'email' => $email,\n 'password' => password_hash($password, PASSWORD_DEFAULT),\n 'photo_profile_path' => $photo_path,\n 'phone' => $phone,\n 'create_at' => $create_at,\n 'update_at' => $update_at,\n 'is_active' => 0,\n 'roles' => $roles,\n 'deleted_at' => '',\n 'last_login' => ''\n ];\n\n $insertdata = $this->user->insertdata($data);\n\n if ($insertdata) {\n\n $this->email->initialize($emailConfig);\n $this->email->from('indradullanov1@gmail.com', 'User Activation');\n $this->email->to($email);\n $this->email->subject('Account Verification');\n $this->email->message('Click this link to verify you account : <a href=\"' . base_url() . 'auth/verify?email=' . $email . '&token=' . urlencode($token) . '\">Activate</a>');\n if ($this->email->send()) {\n $this->response([\n 'status' => true,\n 'message' => 'Success registered, please check email for verification your account'\n ], 200);\n } else {\n $this->response([\n 'status' => false,\n 'message' => 'Failed to register'\n ], 404);\n }\n } else {\n $this->response([\n 'status' => false,\n 'message' => 'Failed to register'\n ], 404);\n }\n }\n } else {\n $this->response([\n 'status' => false,\n 'message' => 'Something wrong'\n ], 404);\n }\n }", "public function register_user()\n\t{\t\n\t\t//CHECKING THE VALIDATION\n\t\t$this->form_validation->set_rules('firstname','first name','trim|required');\n\t\t$this->form_validation->set_rules('useremail','email','trim|required');\n\t\t$this->form_validation->set_rules('password','password','trim|required');\n\n\t\tif($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$data['main_view'] = 'user/register_view';\n\t\t\t$this->load->view('layouts/main',$data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$user_detail = $this->input->post();\n\t\t\t$query = $this->register_user_model->create_user($user_detail);\n\t\t\tif($query)\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('user_registered','User has been registered');\n\t\t\t\tredirect('user/register_controller');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->session->set_flashdata('not_registered','User has not been registered or user already registered.');\n\t\t\t\tredirect('user/register_controller');\n\t\t\t}\n\t\t}\n\t}", "public function register_action() \n\t{\n $rules = array(\n 'username' => 'required',\n 'email' => 'valid_email|required',\n 'password' => 'required',\n 'password2' => 'required',\n 'securityq1' => 'required',\n 'securityq2' => 'required',\n 'securitya1' => 'required',\n 'securitya2' => 'required',\n\n );\n \n // Readible array\n $readible = \n [ \n 'securityq1' => 'Security Queston 1',\n 'securityq2' => 'Security Queston 2',\n 'securitya1' => 'Security Answer 1',\n 'securitya2' => 'Security Answer 2'\n ];\n\n // readible inputs\n FormValidation::set_field_names($readible);\n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n\n UserModel::register();\n }", "public function registerAction()\n {\n // specify required fields\n $requirements = array(\n 'userName',\n 'password',\n 'email'\n );\n\n // fech post json data\n $post = $this->fetchRequestData($requirements);\n\n //we need to match what's in the database\n $fields = array(\n 'yourEmail' => 'email',\n 'yourUserName' => 'userName',\n 'yourPassword' => 'password',\n 'fname' => 'fname',\n 'lname' => 'lname',\n 'yourIP' => 'ip',\n 'yourCountry' => 'countryAbbreviation',\n 'yourBday' => 'birthdate',\n 'accountId' => 'accountId',\n 'gender' => 'gender',\n 'cmsUserGroupId' => 'userRole',\n 'isChannel' => 'isChannel',\n );\n\n $params = array();\n $params['userId'] = 0;\n\n foreach ($fields as $key => $val) {\n if (isset($post[$val]) && $post[$val]) $params[$key] = $post[$val];\n }\n\n if (isset($params['yourEmail']) && $params['yourEmail']) {\n if ($this->get('UserServices')->checkDuplicateUserEmail($params['userId'], $params['yourEmail'])) {\n throw new HttpException(422, $this->translator->trans('This email address belongs to an existing Tourist Tuber.'));\n }\n }\n\n if (isset($params['yourUserName']) && $params['yourUserName']) {\n if ($this->get('UserServices')->checkDuplicateUserName($params['userId'], $params['yourUserName'])) {\n $suggestedNewUserNames = $this->get('UserServices')->suggestUserNameNew($params['yourUserName']);\n throw new HttpException(422, $this->translator->trans('Your username is already taken. try:') . ' ' . implode(' or ', $suggestedNewUserNames));\n }\n }\n\n if (isset($params['yourPassword']) && $params['yourPassword']) {\n //validate first for invalid password\n $validatePass = $this->get('UserServices')->validateUserLengthPassword($params['yourPassword']);\n if (isset($validatePass['success']) && $validatePass['success'] == false) {\n throw new HttpException(422, $validatePass['message']);\n }\n }\n\n if ((isset($params['fname']) && $params['fname']) || (isset($params['lname']) && $params['lname'])) {\n $fullname = '';\n if ($params['fname']) {\n $fullname .= $params['fname'];\n }\n if ($params['lname']) {\n $fullname .= $params['lname'];\n }\n } else {\n $fullname = $params['fname'] = $params['yourUserName'];\n }\n\n $params['fullName'] = $fullname;\n $params['defaultPublished'] = 0;\n $result = array();\n\n\n\n $insert = $this->get('UserServices')->generateUser($params);\n\n if (is_array($insert) && isset($insert['error']) && !empty($insert['error'])) {\n throw new HttpException(422, $insert['error']);\n } else {\n $this->get('UserServices')->sendRegisterActivationEmail(array('userId' => $insert->getId(), 'activationLink' => '/api/users/activate/'));\n $result['status'] = \"success\";\n $result['message'] = $this->translator->trans('An email is sent to you to activate your account.');\n }\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "public function register_act()\n\t{\n\t\t$this->form_validation->set_rules('username','Username','required|callback_username_check|xss_clean');\n\t\t$this->form_validation->set_rules('password','Password','required|xss_clean|min_length[6]|max_length[30]');\n\t\t$this->form_validation->set_rules('email','Email','trim|required|valid_email|xss_clean');\n\t\t$this->form_validation->set_rules('firstname','First Name','required');\n\t\t$this->form_validation->set_rules('lastname','Last Name','required');\n\t\t$this->form_validation->set_error_delimiters('<div class=\"alert alert-warning\">', '</div>');\n\t\t$this->form_validation->set_message('min_length', '%s: the minimum of characters is %s');\n\t\t$this->form_validation->set_message('max_length', '%s: the maximum of characters is %s');\n\n\t\tif($this->form_validation->run() == true) {\n\t\t\t$username\t\t\t\t= $this->input->post('username');\n\t\t\t$password\t\t\t\t= $this->input->post('password');\n\t\t\t$email\t\t\t\t\t= $this->input->post('email');\t\n\t\t\t$firstname \t\t\t= $this->input->post('firstname');\n\t\t\t$lastname\t\t\t\t= $this->input->post('lastname');\n\n\t\t\t$data = array(\n\t\t\t\t'id'\t\t\t=> null,\n\t\t\t\t'username'\t\t=> $username,\n\t\t\t\t'password'\t\t=> $password,\n\t\t\t\t'email'\t\t\t=> $email,\n\t\t\t\t'first_name'\t=> $firstname,\n\t\t\t\t'last_name'\t\t=> $lastname,\n\t\t\t\t'created'\t\t=> date('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t$this->model_users->get_insert($data);\n\t\t\t$this->session->set_flashdata(\"pesan\", \"<div class=\\\"ui green message\\\" id=\\\"alert\\\"><i class=\\\"glyphicon glyphicon-ok\\\"></i> Successfully Registered!</div>\");\n\t\t\tredirect('shorten');\n\t\t} else {\n\t\t\t$this->load->view('register');\n\t\t}\n\t\t\n\t}", "function adduser($firstname,$lastname,$email,$password, $contact=1,$profile=1) \n{\n\tglobal $spebs_db;\n\t$pquery = \"INSERT INTO user (firstname,lastname,email,password,profile,creation_time,active,contact) VALUES(?,?,?,SHA1(?), ?, ?,0,?)\";\n\t$newuid = get_prepared_insert_id($pquery, array($firstname,$lastname,$email,$password,$profile,date('Y-m-d H:i:s'),$contact), 'ssssisi');\n\t\n\tif(is_numeric($newuid) && $newuid>0)\n\t{\n\t\tsend_registration_confirmation($newuid, $firstname.' '.$lastname, $email, $password);\n\t\tadd_log('REGISTRATION',$newuid);\n\t\treturn $newuid;\n\t}\n\telse\n\t\treturn false;\n}", "public function regNewUser( $data ){\n\n\t\t$success = parent::regNewUser( $data );\n\t\n\t\tif( is_array( $success ) ){\n\t\t \treturn $this->createAnswer( 1,\"Username or email already exist\",403 );\n\t\t}elseif ( $success ){\n\t\t\treturn $this->createAnswer( 0,\"Congratulation you got permission\" );\n\t\t}else{\n\t\t return $this->createAnswer( 1,\"invalid query\",402 );\n\t\t}\n\t}", "function merchantRegister($userDetails){\n\ttry {\n\t\t$user = new MangoPay\\UserLegal();\n\t\t$user->Name \t\t\t\t\t\t\t\t\t= $userDetails['CompanyName'];\n\t\t$user->Email \t\t\t\t\t\t\t\t\t= $userDetails['Email'];\n\t\t$user->LegalPersonType \t\t\t\t\t\t\t= \"BUSINESS\";\n\t\t$user->LegalRepresentativeFirstName\t\t\t\t= $userDetails['FirstName'];\n\t\t$user->LegalRepresentativeLastName \t\t\t\t= $userDetails['LastName'];\n\t\t$user->LegalRepresentativeEmail\t\t\t\t\t= $userDetails['Email'];\n\t\t$user->HeadquartersAddress\t\t\t\t\t\t= $userDetails['Address'];\n\t\t$user->LegalRepresentativeBirthday \t\t\t\t= strtotime($userDetails['Birthday']);\n\t\t$user->LegalRepresentativeNationality\t\t\t= $userDetails['Country'];\n\t\t$user->LegalRepresentativeCountryOfResidence\t= $userDetails['Country'];\n\t\t$user->Tag\t\t\t\t\t\t\t\t\t\t= 'Merchant - ' . $userDetails['CompanyName'];\n\t\t\n\t\t//call create function\n\t\t$createdUser \t\t\t\t= $mangoPayApi->Users->Create($user);\n\t\tif(isset($createdUser->Id)) {\n\t\t\treturn $createdUser->Id;\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t}\n}", "public function register(){\n if (!empty($_SESSION['user_id']))\n redirects('pages/index');\n // Check for POST\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n // Process form\n \n // Sanitize POST data\n // $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n // Init data\n $data =[\n 'name' => trim($_POST['name']),\n 'username' => trim($_POST['username']),\n 'email' => trim($_POST['email']),\n 'password' => trim($_POST['password']),\n 'confirm_password' => trim($_POST['confirm_password']),\n 'validation_hash' => '',\n 'email_verification' => '',\n 'name_error' => '',\n 'username_error' => '',\n 'email_error' => '',\n 'password_error' => '',\n 'confirm_password_error' => '',\n 'message' => '',\n 'title' => '',\n ];\n\n // Validate Email\n if(empty($data['email'])){\n $data['email_error'] = 'Pleae enter email';\n } else {\n // check if valid email\n if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {\n $data['email_error'] = \"Please enter a valid email\"; \n }\n\n // Check email if exists\n if($this->userModel->findUserByEmail($data['email'])){\n $data['email_error'] = 'Email is already taken';\n }\n }\n //valid username\n if (preg_match('/\\s/',$data['username']) || !ctype_alnum($data['username'])){\n $data['username_error'] = 'Please enter a valid username';\n } else {\n // check the lenght of the username\n if (strlen($data['username']) < 6)\n $data['username_error'] = 'Username should be at least 6 characters';\n\n // check if the username is already taken\n if ($this->userModel->findUserByUsername($data['username']))\n $data['username_error'] = 'Username is already taken';\n }\n\n // Validate Name\n if(empty($data['name'])){\n $data['name_error'] = 'Pleae enter name';\n } else {\n if (!ctype_alnum($data['name']))\n $data['name_error'] = 'Please enter a valid name';\n }\n\n // Validate Password\n if(empty($data['password'])){\n $data['password_error'] = 'Pleae enter password';\n } else {\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $data['password']);\n $lowercase = preg_match('@[a-z]@', $data['password']);\n $number = preg_match('@[0-9]@', $data['password']);\n if(!$uppercase || !$lowercase || !$number || strlen($data['password']) < 8)\n $data['password_error'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number.';\n }\n // validate confirm_password\n if ($data['password'] != $data['confirm_password'])\n $data['confirm_password_error'] = 'Password does not match!';\n\n // Make sure errors are empty\n if(empty($data['email_error']) && empty($data['username_error']) && empty($data['name_error']) && empty($data['password_error']) && empty($data['confirm_password_error'])){\n // Validated\n\n // generate confirmation key\n $hash = md5( rand(0,1000) );\n $data['validation_hash'] = $hash;\n // hash password\n $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT);\n if($this->userModel->register($data))\n {\n $link = $link = URLROOT . '/users/emailVerification/' . $data['validation_hash'];\n $data['message'] = 'Please click on the link to validate you registration : ' . $link;\n $data['title'] = '[Camagru] Complete your registration';\n $this->sendEmailnotification($data);\n $data['email_verification'] = 'alert-info';\n $data['email'] = '';\n $data['password'] = '';\n $this->view('users/login', $data);\n }\n else\n {\n die('somthing went wrong');\n }\n } else {\n // // Load view with errors\n $this->view('users/register', $data);\n }\n\n } else {\n // Init data\n $data =[\n 'name' => '',\n 'email' => '',\n 'username' => '',\n 'password' => '',\n 'name_error' => '',\n 'username_error' => '', \n 'email_error' => '',\n 'password_error' => ''\n ];\n\n // // Load view\n $this->view('users/register', $data);\n }\n }", "function create_user()\r\n\t{\r\n\t\t$additional_data = array();\r\n\t\tif ($this->form_validation->run() == true)\r\n\t\t{\r\n\t\t\t$nickname \t= $this->input->post('nickname');\r\n\t\t\t$email \t= $this->input->post('email');\r\n\t\t\t$password \t= $this->input->post('password');\r\n\t\t\t$national\t= $this->input->post('national');\r\n\t\t\t$plan \t\t= $this->input->post('plan');\r\n\t\t\t$ed_level\t= $this->input->post('ed_level');\r\n\t\t\t$lang\t\t= $this->input->post('lang');\r\n\t\t\t$gender\t= $this->input->post('gender');\r\n\t\t\t\r\n\t\t\t$additional_data = array(\r\n\t\t\t\t'email'\t\t\t\t=> $email,\r\n\t\t\t\t'pass' \t\t\t=> $password,\r\n\t\t\t\t'nickname' \t\t\t=> $nickname,\r\n\t\t\t\t'last_name' \t\t\t=> '',\r\n\t\t\t\t'middle_name'\t\t\t=> '',\r\n\t\t\t\t'first_name'\t\t\t=> '',\r\n\t\t\t\t'gender'\t\t\t\t=> $gender,\r\n\t\t\t\t'addr1'\t\t\t\t=> '',\r\n\t\t\t\t'addr2'\t\t\t\t=> '',\r\n\t\t\t\t'addr3'\t\t\t\t=> '',\r\n\t\t\t\t'country'\t\t\t\t=> '',\r\n\t\t\t\t'zip_code'\t\t\t\t=> '',\r\n\t\t\t\t'nationality' \t\t=> $national,\r\n\t\t\t\t'ethnicity' \t\t\t=> '',\r\n\t\t\t\t'birthday_day' \t\t=> '',\r\n\t\t\t\t'birthday_month' \t\t=> '',\r\n\t\t\t\t'birthday_year' \t\t=> '',\r\n\t\t\t\t'language' \t\t\t=> $lang,\r\n\t\t\t\t'currently_school' \t=> '',\r\n\t\t\t\t'graduation_year' \t=> '',\r\n\t\t\t\t'area_of_interests' \t=> '',\r\n\t\t\t\t'major' \t\t\t\t=> '',\r\n\t\t\t\t'parents_email' \t\t=> '',\r\n\t\t\t\t'grade' \t\t\t\t=> $ed_level,\r\n\t\t\t\t'activationKey' \t\t=> mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand(),\r\n\t\t\t\t'remember_code'\t\t=> sha1($password)\r\n\t\t\t);\r\n\r\n\t\t}\r\n\r\n\r\n\t\tif ($this->form_validation->run() == true && $this->ion_auth->register($email, $password, $additional_data))\r\n\t\t{\r\n\t\t\t//check to see if we are creating the user\r\n\t\t\t//redirect them back to the admin page\r\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\r\n\t\t\tredirect(\"dashboard\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\r\n\t\t\t\r\n\t\t\t$this->session->set_flashdata('app_error', $this->ion_auth->errors());\r\n\t\t\t\r\n\t\t\t$data['national'] = $this->config->item('national');\r\n\t\t\t\r\n\t\t\t$data['nickname'] = array('name' => 'nickname',\r\n\t\t\t\t'id' => 'nickname',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'value' => $this->form_validation->set_value('nickname'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'NICKNAME *'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['email'] = array('name' => 'email',\r\n\t\t\t\t'id' => 'email',\r\n\t\t\t\t'type' => 'email',\r\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'EMAIL ADDRESS'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['password'] = array('name' => 'password',\r\n\t\t\t\t'id' => 'password',\r\n\t\t\t\t'type' => 'password',\r\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'PASSWORD'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['cpassword'] = array('name' => 'cpassword',\r\n\t\t\t\t'id' => 'cpassword',\r\n\t\t\t\t'type' => 'password',\r\n\t\t\t\t'value' => $this->form_validation->set_value('cpassword'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'CONFIRM PASSWORD'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['lang'] = array('name' => 'lang',\r\n\t\t\t\t'id' => 'lang',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'LANGUAGE SPOKEN'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['show_form'] = \"show\";\r\n\r\n\t\t\t\r\n\t\t\t$this->render_page('signup/index', $data);\r\n\t\t}\r\n\t}", "public function registerUser()\n\t\t{\n\t\t\ttry{\n\t\t\t\t\n\t\t\t\t$client = OrientDb::connection();\n\t\t\t\t$insert = $client->command('SELECT createUser({username: \"' . $this->email . '\", email : \"' . $this->email . '\", password: \"' . $this->password . '\", nameFirst:\"' . $this->name . '\", nameLast: \"' . $this->lastname . '\", authData : null, phone: \"' . $this->phone . '\"})');\n\t\t\t\t$response = $insert->getOData();\n\t\t\t\treturn $response;\n\n\t\t\t}catch(PhpOrientException $e){\n\t\t\t\t\n\t\t\t\treturn $e;\n\n\t\t\t}\n\t\t}", "function registerUser() {\n // Return value\n $return_val = array(\n 'result' => true, // success\n 'err' => \"\", // err msg\n );\n\n verifyAdmin();\n $requiredValues = array(\"name\", \"avatar\", \"email\");\n checkPostRequiredValues($requiredValues);\n\n $name = $_POST[\"name\"];\n $avatar = $_POST[\"avatar\"];\n $email = $_POST[\"email\"];\n\n createUser($name, $email, $avatar);\n return $return_val;\n}", "function register()\n\t\t{\n\n\t\t if(!empty($_POST['email']) && !empty($_POST['password'])&& !empty($_POST['nombre'])){\n\n\t\t $email=filter_input(INPUT_POST, 'email', FILTER_SANITIZE_STRING);\n\t\t $password=filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n\t\t $name=filter_input(INPUT_POST, 'nombre', FILTER_SANITIZE_STRING);\n\t\t $new_user=$this->model->register($email,$password,$name);\n\n\t\t if ($new_user == TRUE){ \n\t\t // cap a la pàgina principal\n\t\t header('Location:'.APP_W.'home');\n\t\t }\n\t\t else{\n\t\t // no hi és l'usuari, cal registrar\n\t\t header('Location:'.APP_W.'register');\n\t\t }\n\t\t \t\t}\n\t\t}", "public function registerInFrontEnd($params)\n {\n $model = $this->getModel($params['User'], 'User');\n $this->result->processed('model', $model);\n\n $model->setScenario('register_frontend');\n if (!$model->validate()) {\n return $this->result->fail(ERROR_INVALID_DATA, 'Submitted data is missing or invalid.');\n }\n \n include_once(Yii::getPathOfAlias(\"webroot\").'/protected/modules/Core/extensions/web/helpers/string.php');\n $registerSuccess = FALSE;\n $passwordForSendEmail = randomString('lower',12);\n $anotherUser = User::model()->findByAttributes(array('email'=>$model->email));\n if (!is_null($anotherUser))\n {\n $anotherUser->first_name = $model->first_name;\n $anotherUser->last_name = $model->last_name;\n $anotherUser->password = md5($passwordForSendEmail);\n $anotherUser->status = User::STATUS_ACTIVE;\n if ($anotherUser->update(array('first_name','last_name','password','status')))\n $registerSuccess = TRUE; \n }\n else\n {\n $model->username = $model->email;\n $model->password = md5($passwordForSendEmail);\n $model->status = User::STATUS_ACTIVE;\n if ($model->save(FALSE)) $registerSuccess = TRUE; \n }\n\n if ($registerSuccess == TRUE) {\n Yii::import('application.modules.Core.extensions.vendors.mail.YiiMailMessage');\n $messageObj = new YiiMailMessage;\n $messageObj->setSubject(\n\t '['.Settings::SITE_NAME.'] '.\n\t Language::t(Yii::app()->language,'Frontend.Message.MailSubject','Thanks for registering !')\n );\n $messageObj->setFrom(Settings::ADMIN_EMAIL);\n $messageObj->setTo($model->email);\n Yii::app()->mail->viewPath = 'application.runtime.emails'; \n $messageObj->view = 'registration_email'.'_'.Yii::app()->language;\n // create content\n $messageObj->setBody(array(\n 'user_email'=>$model->email,\n 'site_name'=>Settings::SITE_NAME,\n 'login_page_url'=>Yii::app()->createAbsoluteUrl('/site/login'),\n 'site_url'=>baseUrl(),\n 'user_password'=>$passwordForSendEmail,\n ), 'text/html');\n if (!Yii::app()->mail->send($messageObj))\n $this->result->fail('SEND_MAIL_FAILED', Yii::t('Ads/Ads','Registration Email was sent failed!'));\n } else\n $this->result->fail(ERROR_HANDLING_DB, Yii::t('User.User','Error while saving submitted data into database.'));\n return $this->result;\n }", "function userRegister($userDetails){\n\ttry {\n\t\t$user = new MangoPay\\UserNatural();\n\t\t$user->FirstName \t\t\t= $userDetails['FirstName'];\n\t\t$user->LastName \t\t\t= $userDetails['LastName'];\n\t\t$user->Email \t\t\t\t= $userDetails['Email'];\n\t\t$user->Address \t\t\t\t= $userDetails['Address'];\n\t\t$user->Birthday \t\t\t= strtotime($userDetails['Birthday']);\n\t\t$user->Nationality \t\t\t= $userDetails['Nationality'];\n\t\t$user->CountryOfResidence \t= $userDetails['CountryOfResidence'];\n\t\t$user->Occupation \t\t\t= $userDetails['Occupation'];\n\t\t$user->IncomeRange \t\t\t= $userDetails['IncomeRange'];\n\t\t//call create function\n\t\t$createdUser \t\t\t\t= $mangoPayApi->Users->Create($user);\n\t\tif(isset($createdUser->Id)) {\n\t\t\treturn $createdUser->Id;\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t\t\n\t}\n}", "public function registerUser($data);", "function register()\n\t\t{\n\t\t\tif ($this->input->post('create_user'))\n\t\t\t{\n\t\t\t\tif ($this->data['user'])\n\t\t\t\t{\n\t\t\t\t\tif ($this->ion_auth->in_group('public'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->session->set_flashdata('alert', array(\n\t\t\t\t\t\t\t'type' => 'danger',\n\t\t\t\t\t\t\t'message' => 'You are already registered.'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t// redirect them back to this page.\n\t\t\t\t\t\tredirect(current_url(), 'refresh');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$tables = $this->config->item('tables','ion_auth');\n\t\t\t\t$identity_column = $this->config->item('identity','ion_auth');\n\t\t\t\t$this->data['identity_column'] = $identity_column;\n\n\t\t\t\t// validate form input\n\t\t\t\t$this->form_validation->set_rules('username', 'above', 'required|is_unique['.$tables['users'].'.'.$identity_column.']');\n\t\t\t\t$this->form_validation->set_rules('password_confirm', 'above', 'required');\n\t\t\t\t$this->form_validation->set_rules('password', 'above', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t\t\t$this->form_validation->set_rules('email', 'above', 'required|valid_email');\n\t\t\t\t$this->form_validation->set_rules('address', 'above', 'required');\n\t\t\t\t$this->form_validation->set_rules('phone', 'above', 'required|trim');\n\n\t\t\t\t// Add data for different user groups.\n\t\t\t\t$this->form_validation->set_rules('first_name', 'above', 'required');\n\t\t\t\t$this->form_validation->set_rules('last_name', 'above', 'required');\n\n\t\t\t\tif ($this->form_validation->run() == true)\n\t\t\t\t{\n\t\t\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t\t\t$identity = $this->input->post('username');\n\t\t\t\t\t$password = $this->input->post('password');\n\n\t\t\t\t\t$profile = array(\n\t\t\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t\t\t'address' => $this->input->post('address'),\n\t\t\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t\t\t);\n\n\t\t\t\t\t$group = array('2'); // Sets user to public.\n\n\t\t\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$avatar = $this->upload_image();\n\t\t\t\t\t\tif ( ! $avatar['error'])\n\t\t\t\t\t\t\t$profile['avatar'] = $avatar['path'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$user_id = $this->ion_auth->register($identity, $password, $email, $profile, $group);\n\n\t\t\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t\t\tif ($user_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Define profile information.\n\t\t\t\t\t\t// $this->users_model->add($profile);\n\n\t\t\t\t\t\t$this->flexi_cart_admin->set_status_message('Account was successfully created', 'public', TRUE);\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart_admin->get_messages('public'));\n\n\t\t\t\t\t\t// redirect them back to the login page\n\t\t\t\t\t\tredirect(\"login\", 'refresh');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->flexi_cart_admin->set_error_message(($this->ion_auth->errors() ? $this->ion_auth->errors() : 'Account could not be created'), 'public', TRUE);\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart_admin->get_messages('public'));\n\n\t\t\t\t\t\t// redirect them back to the login page\n\t\t\t\t\t\tredirect(\"register\", 'refresh');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t// display the create user form\n\t\t\t$this->load->view('public/auth/register_user', $this->data);\n\t\t}", "public function registerUserRequest()\n {\n $user = factory(User::class)->make();\n\n return $this->json('POST', '/api/v2/user', array_merge($user->toArray(), ['password' => 'secret1234', 'agb_check' => true]));\n }", "public function mobileAuthRegister(Request $request)\n {\n \n $validator = Validator::make($request->all(), [\n 'name' => 'required|string',\n 'email' => 'required|email|unique:users,email',\n 'role' => 'required|integer'\n ]);\n \n if ($validator->fails()) {\n return response()->json(['error' => $validator->errors()], 401);\n }\n\n $input = $request->all();\n $role = $input['role'];\n //$user->assignRole(3);\n unset($input['role']);\n\n $user = User::create($input); \n $user->assignRole($role);\n $success['token'] = $user->createToken('MyApp')->accessToken;\n $success['name'] = $user->name;\n return response()->json([\n 'success' => $success,\n 'role' => $user->getRoleNames(),\n 'deviceToken' => $user->device_token\n ]);\n // return response()->json(['success' => $success]);\n \n }" ]
[ "0.74560726", "0.7257391", "0.7234609", "0.7226053", "0.71596366", "0.7157977", "0.71506876", "0.710598", "0.7092913", "0.70532876", "0.69730145", "0.6960298", "0.6945626", "0.6927674", "0.6923858", "0.69100624", "0.689768", "0.6859483", "0.6847696", "0.68453395", "0.68403995", "0.68271625", "0.68202573", "0.68168396", "0.68140906", "0.6798839", "0.67776316", "0.677128", "0.6757314", "0.6734615", "0.6723228", "0.6709738", "0.67020625", "0.6700886", "0.66951317", "0.6654827", "0.6642026", "0.6641281", "0.6635785", "0.66261506", "0.661819", "0.6616482", "0.6615238", "0.6613696", "0.66026336", "0.6601976", "0.65990394", "0.6594378", "0.65936995", "0.65924513", "0.65892124", "0.65861976", "0.6580188", "0.65786177", "0.6576887", "0.65749824", "0.6571815", "0.6568388", "0.6567088", "0.65591735", "0.6558388", "0.65462416", "0.6545965", "0.65399593", "0.65380996", "0.65295464", "0.65250355", "0.6514719", "0.6511866", "0.6506044", "0.6496667", "0.6494076", "0.64928156", "0.6479338", "0.6471609", "0.64709914", "0.6469676", "0.646643", "0.64570546", "0.6450785", "0.6448789", "0.6448068", "0.64461935", "0.64445835", "0.64332837", "0.6417124", "0.6411012", "0.6410335", "0.64085346", "0.6406356", "0.6405743", "0.64007354", "0.64005405", "0.6397542", "0.6392646", "0.63879544", "0.6384681", "0.63753456", "0.6373353", "0.6370344" ]
0.70618844
9
function is used for User Confirmation Params required: action. return ???.
function userConfirmation($data){ $requiredData['action'] = $this->getPassword(@trim($data->action)); $user_name_id = explode("#/#",$requiredData['action']); $rec = $this->query("UPDATE `users` SET `status`=1 where `user_name` = '".@$user_name_id[0]."' AND `id`= ".@$user_name_id[1]); if($rec){ $url = HTTP_HOST."confirm.php?action=1"; echo "<meta http-equiv=Refresh content=0;url=".$url.">"; exit; }else{ $url = HTTP_HOST."confirm.php?action=0"; echo "<meta http-equiv=Refresh content=0;url=".$url.">"; exit; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "function action($action=null) {\n switch ($action) {\n\t\tcase 'payreturn' : echo GetGlobal('controller')->calldpc_method(\"stutasks.invoice_viewer use \".$this->transaction.\"+1\");\n\t\t die();\n\t\t break;\n\t\tcase 'paycancel' : echo GetGlobal('controller')->calldpc_method(\"stutasks.invoice_viewer use \".$this->transaction);\n\t\t die();\n\t\t break;\n\t\tcase 'payipn' : $ret = null;//'Key:' . GetReq('key');//null;\n\t\t break; \n\t\tcase 'stutpay' :\t\t\t\t \n\t case 'process' : //$ret = $this->error;//null;//must not have action, if error goto frontpage'Please wait processing...'; \n\t default : $ret = seturl('t=',localize('_HOME',getlocal()));\n\t\t $ret .= $this->set_message('error');\n\n\t } \n\t \n\t return ($ret);\n }", "public function actionConfirm()\n\t{\n\t\tif(isset($_SESSION) && isset($_SESSION['userRegisterVal']) && $_SESSION['userRegisterVal']['email'] != '')\n\t\t{\n\t\t\t $this->layout =\"homeinner\";\n\t\t\t $modelUser=new Users;\n\t\t\t \n\t\t\t //for getting lastly saved value of Gift model\n\t\t\t $userGiftId = $_SESSION['giftId'];\n\t\t\t \n\t\t\t if(isset($userGiftId) && $userGiftId != '')\n\t\t\t {\n\t\t\t\t \n\t\t\t\t Yii::app()->user->setFlash('successmessage','You have been registered properly.. Please check your mailbox');\n\t\t\t }\n\t\t\t else \n\t\t\t {\n\t\t\t\t \n\t\t\t\t Yii::app()->user->setFlash('failuremessage','Please fill the form properly again');\n\t\t\t }\n\t\t\t //for getting lastly saved value of Gift model by current user\n\t\t $giftLastValue=Gift::model()->findByAttributes(array('id'=>$userGiftId));\n\t\t\t //for getting lastly saved value of Gift model by current user\n\t\t\t\n\t\t\t //destroying session here..\n\t session_destroy(); \n\t \n\t //create new session to keep current gift id for fbshare\n\t session_start();\n\t $_SESSION['giftId'] = $userGiftId;\n\t\n\t //render page to view page....\n\t\t\t $this->render('finalconfirmed',array(\n\t\t\t\t 'modelUser'=>$modelUser,\n\t\t\t\t 'maxIdGift'=>$userGiftId,\n\t\t\t\t 'giftLastValue'=>$giftLastValue,\n\t\t\t ));\n\t\t}\n\t\telse\n\t\t{\n\t\t \t//Redirect to home page\n\t\t\t$this->redirect('../index.php', '');\n\t\t}\n\t}", "public function action_confirm()\n\t{\n $params = input::post();\n\n\t\t// check field\n\t\t$validation = Validation::forge();\n\t\t$validation->add_field('c_name', '企業名', 'required');\n\t\t$validation->add_field('job_detail', '仕事内容', 'required');\n if (empty($params['salary']) === false) {\n //$validation->add_field('valid_string', '給与', array('numeric'));\n $validation->add_field('salary', '給与', 'valid_string[numeric]');\n }\n if (empty($params['reception_mail']) === false) {\n $validation->add_field('reception_mail', 'メールアドレス', 'valid_emails');\n }\n if (empty($params['home_page']) === false) {\n $validation->add_field('home_page', 'ホームページ', 'valid_url');\n }\n\n\t\tif ($validation->run()) {\n Confirm::setRequest($params);\n Confirm::run($params);\n $data['disp'] = Confirm::getRequest();\n\t\t\t$data['val'] = $params;\n $data['logo_path'] = Confirm::$image_path;\n\t\t\t$this->common_view->set('content', View::forge('career/confirm', $data));\n\t\t\treturn $this->common_view;\n\t\t} else {\n $this->common_view->set_global('err_msg', $validation->show_errors(), false);\n return $this->action_add();\n\t\t}\n\t\t\n\t}", "public function actionConfirm(){\n if($this->confirm('Yakin loe..??'))\n echo \"Ok deh kaka..\";\n else\n echo \"Ga yakin diee..:p\";\n }", "protected function initializeConfirmationAction() {}", "public function confirmationAction()\n {\n Zend_Registry::set('SubCategory', SubCategory::USERUPDATE);\n \t$userId = $this->getRequest()->getParam('userId');\n $activationKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME);\n\n $user = $this->_getUserFromIdAndKey($userId, $activationKey);\n\n if(!$user){\n // No such user\n Globals::getLogger()->registrationError(\"Account activation: user retrieval failed - userId=$userId, key=$activationKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::ACTIVATION_FAILED));\n }\n\n $user->clearCache();\n $user = $this->_getUserFromIdAndKey($userId, $activationKey);\n\n if($user->{User::COLUMN_STATUS} == User::STATUS_PENDING){\n $user->{User::COLUMN_STATUS} = User::STATUS_MEMBER;\n $user->date = date('Y-m-d H:i:s');\n $id = $user->save();\n if($id !== $userId){\n Globals::getLogger()->registrationError(\"Account activation: user save failed - userId=$userId, key=$activationKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::ACTIVATION_FAILED));\n }\n\n $this->view->success = true;\n $this->view->alreadyDone = false;\n \t$this->_savePendingUserIdentity($userId);\n } else {\n $this->view->success = false;\n $this->view->alreadyDone = true;\n }\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 }", "function confirmation() {\n\t\n\n\n}", "public function actionCustomiseconfirm()\n\t{\n\t\tif(isset($_SESSION) && isset($_SESSION['userRegisterVal']) && $_SESSION['userRegisterVal']['email'] != '')\n\t\t{\n\t\t\t$this->layout =\"homeinner\";\n\t\t\t$modelUser=new Users;\n\t\t\t$modelGifts=new Gift;\n\n\t\t\t//simply redirecting to Confirm page...\n\t\t\t$this->render('customizejerseyconfirm',array(\n\t\t\t\t'modelUser'=>$modelUser,\n\t\t\t));\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Redirect to home page\n\t\t\t$this->redirect('../index.php', '');\n\t\t}\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 }", "protected function baseConfirmActions()\n {\n if ($this->Request()->isPost()) {\n $this->payment_plan = $this->Request()->getParam('payment_plan');\n $config = Shopware()->Config();\n if ($config->getByNamespace(\"ByjunoPayments\", \"byjuno_allowpostal\") == \"Disabled\") {\n $this->payment_send = \"email\";\n } else {\n $this->payment_send = $this->Request()->getParam('invoice_send');\n }\n $user = $this->getUser();\n if ($this->payment_send == \"email\") {\n $this->payment_send_to = (String)$user[\"additional\"][\"user\"][\"email\"];\n } else {\n $billing = $user['billingaddress'];\n $address = trim(trim((String)$billing['street'].' '.$billing['streetnumber']).', '.(String)$billing['city'].', '.(String)$billing['zipcode']);\n $this->payment_send_to = $address;\n }\n $custom_gender = $this->Request()->getParam('custom_gender');\n if ($custom_gender != null) {\n $this->custom_gender = $custom_gender;\n }\n $custom_birthday = $this->Request()->getParam('custom_birthday');\n if ($custom_birthday != null && !empty($custom_birthday[\"day\"]) && !empty($custom_birthday[\"month\"]) && !empty($custom_birthday[\"year\"])) {\n $this->custom_birthday = $custom_birthday[\"year\"].\"-\".$custom_birthday[\"month\"].\"-\".$custom_birthday[\"day\"];\n if (!empty($user[\"additional\"][\"user\"][\"id\"])) {\n if (!checkdate($custom_birthday[\"month\"], $custom_birthday[\"day\"], $custom_birthday[\"year\"])) {\n throw new \\Exception(\"wrong_dob\");\n }\n /* @var $customer \\Shopware\\Models\\Customer\\Customer */\n $customer = Shopware()->Models()->getRepository('Shopware\\Models\\Customer\\Customer')\n ->findOneBy(array('id' => $user[\"additional\"][\"user\"][\"id\"]));\n try {\n $customer->setBirthday(new \\DateTime($this->custom_birthday));\n Shopware()->Models()->persist($customer);\n Shopware()->Models()->flush();\n } catch (Exception $e) {\n $logger = Shopware()->Container()->get('corelogger');\n $logger->log(Logger::ERROR, $e->getMessage());\n }\n }\n }\n\n }\n }", "function determine_action() {\n\t\t$is_email = is_email( $this->email );\n\n\t\tif ( is_email( $this->new_email) && $is_email && $this->key_type == 'change_email' )\n\t\t\t$this->action = 'change_email';\n\t\telseif ( $this->key_type == 'opt_in' && $is_email )\n\t\t\t$this->action = 'opt_in';\n\t\telseif ( isset( $_POST['removesubscrips'] ) && $is_email )\n\t\t\t$this->action = 'remove_subscriptions';\n\t\telseif ( isset( $_POST['removeBlock'] ) && $is_email && current_user_can( 'manage_options' ) )\n\t\t\t$this->action = 'remove_block';\n\t\telseif ( isset( $_POST['changeemailrequest'] ) && $is_email && is_email( $this->new_email ) )\n\t\t\t$this->action = 'email_change_request';\n\t\telseif ( $is_email && isset( $_POST['blockemail'] ) )\n\t\t\t$this->action = 'block_request';\n\t\telseif ( isset( $_GET['subscribeid'] ) )\n\t\t\t$this->action = 'solo_subscribe';\n\t\telseif ( $is_email && isset( $_GET['blockemailconfirm'] ) && $this->key == $this->generate_key( $this->email . 'blockrequest' ) )\n\t\t\t$this->action = 'block';\n\t\telse\n\t\t\t$this->action = 'none';\n\t}", "function confirm()\n {\n return $this->__confirm();\n }", "public function confirmAction()\r\n {\r\n if (empty($this->View()->sUserLoggedIn)) {\r\n return $this->forward('login', 'account', null, array('sTarget'=>'sKUZOOffer', 'sTargetAction'=>'confirm'));\r\n } elseif ($this->basket->sCountBasket() < 1) {\r\n return $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'checkout',\r\n 'action' => 'cart'\r\n ));\r\n }\r\n\r\n $this->View()->sCountry = $this->getSelectedCountry();\r\n $this->View()->sState = $this->getSelectedState();\r\n $this->View()->sPayment = $this->getSelectedPayment();\r\n $this->View()->sUserData[\"payment\"] = $this->View()->sPayment;\r\n\r\n $this->View()->sDispatch = $this->getSelectedDispatch();\r\n $this->View()->sPayments = $this->getPayments();\r\n $this->View()->sDispatches = $this->getDispatches();\r\n\r\n $this->View()->sBasket = $this->getBasket();\r\n\r\n $this->View()->sLaststock = $this->basket->sCheckBasketQuantities();\r\n $this->View()->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $this->View()->sShippingcostsDifference = $this->View()->sBasket['sShippingcostsDifference'];\r\n $this->View()->sAmount = $this->View()->sBasket['sAmount'];\r\n $this->View()->sAmountWithTax = $this->View()->sBasket['sAmountWithTax'];\r\n $this->View()->sAmountTax = $this->View()->sBasket['sAmountTax'];\r\n $this->View()->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n\r\n $this->View()->sPremiums = $this->getPremiums();\r\n\r\n $this->View()->sNewsletter = isset($this->session['sNewsletter']) ? $this->session['sNewsletter'] : null;\r\n $this->View()->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : null;\r\n\r\n $this->View()->sShowEsdNote = $this->getEsdNote();\r\n\r\n $this->View()->sDispatchNoOrder = $this->getDispatchNoOrder();\r\n if(!$this->View()->sDispatch)\r\n {\r\n $this->View()->sDispatchNoOrder = true;\r\n }\r\n $this->View()->sRegisterFinished = !empty($this->session['sRegisterFinished']);\r\n\r\n $this->saveTemporaryOrder();\r\n\r\n if ($this->getMinimumCharge()) {\r\n return $this->forward('cart');\r\n }\r\n\r\n if($this->View()->sBasket['sAmount'] < Shopware()->Config()->inquiryvalue)\r\n {\r\n return $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'checkout',\r\n 'action' => 'cart',\r\n 'amountError' => true\r\n ));\r\n }\r\n\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")) {\r\n $activeBillingAddressId = $this->session->offsetGet('checkoutBillingAddressId', null);\r\n if(empty($activeBillingAddressId)) {\r\n $activeBillingAddressId = $this->View()->sUserData['additional']['user']['default_billing_address_id'];\r\n }\r\n\r\n $activeShippingAddressId = $this->session->offsetGet('checkoutShippingAddressId', null);\r\n if(empty($activeShippingAddressId)) {\r\n $activeShippingAddressId = $this->View()->sUserData['additional']['user']['default_shipping_address_id'];\r\n }\r\n\r\n $this->View()->assign('activeBillingAddressId', $activeBillingAddressId);\r\n $this->View()->assign('activeShippingAddressId', $activeShippingAddressId);\r\n\r\n $this->View()->assign('invalidBillingAddress', !$this->isValidAddress($activeBillingAddressId));\r\n $this->View()->assign('invalidShippingAddress', !$this->isValidAddress($activeShippingAddressId));\r\n\r\n $billingAddress = Shopware()->Models()->find('Shopware\\Models\\Customer\\Address',$activeBillingAddressId);\r\n $this->get('shopware_account.address_service')->setDefaultBillingAddress($billingAddress);\r\n $shippingAddress = Shopware()->Models()->find('Shopware\\Models\\Customer\\Address',$activeShippingAddressId);\r\n $this->get('shopware_account.address_service')->setDefaultShippingAddress($shippingAddress);\r\n\r\n $userData = $this->View()->sUserData;\r\n $userAddressData = Shopware()->Modules()->Admin()->sGetUserData();\r\n $userData['billingaddress'] = $userAddressData['billingaddress'];\r\n $userData['shippingaddress'] = $userAddressData['shippingaddress'];\r\n $this->View()->sUserData = $userData;\r\n }\r\n\r\n $this->session['sOrderVariables'] = new ArrayObject($this->View()->getAssign(), ArrayObject::ARRAY_AS_PROPS);\r\n $this->View()->sKUZOOffer = true;\r\n $this->View()->sTargetAction = 'confirm';\r\n }", "function confirm()\n\t{\n\t\t$orderdetail = $this->Order_mdl->orderdetail();\n\t\t$voucher = $orderdetail['orderdetails_voucherno'];\n\t\t//---------------------------------\n\n\t\t// Second - Get session userid\n\t\t$sessiondata = $this->session->userdata('logged_in');\n\t\t$sessionid = $sessiondata['id'];\n\t\t//---------------------------------\n\n\t\t$data['orders'] = $this->Order_mdl->orderconfirm($voucher, $sessionid);\n\t\t\n\n\t\t$data['total'] = $orderdetail['orderdetails_total'];\n\t\t$data['voucher'] = $voucher;\n\n\n\t\t$data['session'] = $this->session->userdata('logged_in');\n\t\t$data['authors'] = $this->Author_mdl->list();\n\t\t$data['genres'] = $this->Genre_mdl->list();\n\n\t\t$data['innerdata'] = 'frontend/confirm';\n\n\t\t$this->load->view('include/frontendtemplate',$data);\n\n\n\t}", "public function get_nonce_action();", "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}", "function actionHandler()\n{\n\t// came from.\n\tif (isset($_POST['act'])) \n\t{\n\t\t$act= $_POST['act'];\n\t\tunset($_POST['act']);\n\t\treturn $act;\n\t} \n\telse \n\t{\n\t\t/*\n\t\t//if it goes here either they attempted to hack this\n\t\t//or the process logic is flawed...check the functions being called\n\t\t$_SESSION['message_buffer'] = create_message(\"warningMessage\", \"shouldnt see this, action not valid\");\n\t\t//die(header(\"location: \" . INDEX_URL));\n\t\tdie();\n\t\t*/\n\t\t//return false;\n\t\techo \"act not set\";\n\t\tdie();\n\t}\n}", "public function actionThankyou() {\n // $pnr = $utilsModel->randomString(10);\n $subject=\"Confirm Booking\";\n $session = Yii::$app->session;\n $arr_booking_data = $session['booking_data'];\n $userinfo=\\Yii::$app->user->identity;\n \n if(isset($arr_booking_data['phone']))\n {\n $param['mobile_no']=$arr_booking_data['phone'];\n }else if(isset($userinfo['id']))\n {\n \t$profile=\\backend\\models\\Profile::find()->where(['user_id'=>$userinfo['id']])->one();\n \t$param['mobile_no']=$profile->phone_no;\n }\n \n $param['subject']=$subject;\n if(isset($arr_booking_data['email']))\n {\n $param['email']=$arr_booking_data['email'];\n }else if(isset($userinfo['id']))\n {\n \t$param['email']=$profile->gravatar_email;\n }\n $clubObj= \\backend\\models\\Club::findOne( $arr_booking_data['c_id']);\n $param['club_name']= $clubObj->name ;\n $param['booking_date']=$arr_booking_data['txt_datepicker'];\n $param['booking_type']=$arr_booking_data['b_type'];\n $pnr= Yii::$app->request->get('pnr');\n $param['pnr']=$pnr;\n $view=\"orderconfirm\";\n $utilsobj=new \\common\\models\\Utils;\n $sendparam=array('mobile_no'=>$param['mobile_no'],'email'=>$param['email'],'club_name'=>$param['club_name'],'booking_date'=>$param['booking_date'],'pnr'=>$param['pnr'],'booking_type'=>$param['booking_type']);\n $mailsend=$utilsobj->sendMessage($param['email'], $param['subject'], $view, $sendparam);\n $view=\"sms/orderconfirm\";\n $sendsms=$utilsobj->sendSMS($param['mobile_no'], $param['subject'], $view, $sendparam);\n return $this->render('thankyou',['param'=>$param]);\n }", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_USER_RIGHT_ACTION;\r\n }", "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 otp_confirm() {\n\t\tif (request()->method() == 'POST') {\n\n\t\t\t$rules = array(\n\t\t\t\t'code_confirm' => 'required',\n\t\t\t);\n\t\t\t// validation custom messages\n\t\t\t$niceNames = array(\n\t\t\t\t'code_confirm' => trans('admin_messages.code'),\n\t\t\t);\n\n\t\t\t$validator = Validator::make(request()->all(), $rules);\n\t\t\t$validator->setAttributeNames($niceNames);\n\t\t\tif ($validator->fails()) {\n\n\t\t\t\treturn back()->withErrors($validator)->withInput(); // Form calling with Errors and Input values\n\t\t\t} else {\n\n\t\t\t\t$code = request()->code_confirm;\n\t\t\t\t$user_id = request()->user_details;\n\n\t\t\t\t$user = User::find($user_id);\n\n\t\t\t\t// dd($session_code);\n\t\t\t\tif ($user->otp != $code) {\n\t\t\t\t\treturn back()->withErrors(['code_confirm' => trans('messages.store_dashboard.code_is_incorrect')])->withInput(); // Form calling with Errors and Input values\n\t\t\t\t}\n\t\t\t\treturn redirect()->route('reset_password');\n\t\t\t}\n\t\t} else {\n\t\t\t$user_id = session::get('reset_user_id');\n\t\t\t$user_details = User::findOrFail($user_id);\n\t\t\t$this->view_data['user_details'] = $user_details;\n\n\t\t\treturn view('home/forgot_password2', $this->view_data);\n\n\t\t}\n\t}", "public function execute()\n {\n $customerId = (int) $this->getRequest()->getParam('customer_id');\n \t$this->customerHelper->confirmCustomerEmail($customerId);\n $resultRedirect = $this->resultRedirectFactory->create();\n $resultRedirect->setPath('customer/index/index');\n return $resultRedirect;\n }", "public function thankYouAction(){\n\t}", "public function getCallbackAction() {}", "public function getCallbackAction() {}", "function confirmation() {\r\n global $order;\r\n $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_NAME,\r\n 'field' => $_POST['authorizenet_echeck_bank_name']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ROUTING_CODE,\r\n 'field' => $_POST['authorizenet_echeck_bank_aba_code']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_TYPE,\r\n 'field' => $_POST['authorizenet_echeck_bank_acct_type']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_NUM,\r\n 'field' => $_POST['authorizenet_echeck_bank_acct_num']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHORIZATION_TITLE,\r\n 'field' => sprintf(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHORIZATION_NOTICE, strtolower(zen_db_prepare_input($_POST['authorizenet_echeck_bank_acct_type'])), zen_date_short(date(\"Y-m-d\")), $order->info['total']))\r\n ));\r\n return $confirmation;\r\n }", "protected function validateAction() {\n\t\tif (isset($_POST['Action']) || isset($_POST['action'])) {\n\t\t\tif (isset($_POST['Action'])) {\n\t\t\t\t$action = htmlspecialchars($_POST['Action']);\n\t\t\t} else {\n\t\t\t\t$action = htmlspecialchars($_POST['action']);\n\t\t\t}\t\n\t\t\treturn strtolower($action);\n\t\t\t\n\t\t} else if (isset($_GET['Action']) || isset($_GET['action'])) {\n\t\t\tif (isset($_GET['Action'])) {\n\t\t\t\t$action = htmlspecialchars($_GET['Action']);\t\n\t\t\t} else {\n\t\t\t\t$action = htmlspecialchars($_GET['action']);\n\t\t\t}\n\t\t\treturn strtolower($action);\n\t\t\t\n\t\t} else {\n\t\t\tif (headers_sent()) {\n\t\t\t\treturn $this->getDefaultActionAfterHeaders();\n\t\t\t} else {\n\t\t\t\theader(\"Location: \".$this->getDefaultAction());\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}", "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 }", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_ACTION;\r\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 }", "public function compareAction() {}", "public function confirm()\n {\n\n\n $this->load->model('checkout/order');\n\n if (!isset($this->session->data['order_id'])) {\n $this->response->redirect($this->url->link('checkout/cart'));\n return;\n }\n $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);\n if (false === $order_info) {\n $this->response->redirect($this->url->link('checkout/cart'));\n return;\n }\n\n $orderID = $this->session->data['order_id'];\n $order_total = $order_info['total'];\n $order_total = round($order_total, 2);\n $currency_code = $order_info['currency_code'];\n $redirect_url = $this->config->get($this->code.'_redirect_url');\n\n $AccountID = $this->config->get($this->code.'_payment_api_accountID');\n $AccountPrivateKey = $this->config->get($this->code.'_payment_api_privateKey');\n if (isset($this->session->data['meth'])) {\n $data['meth'] = $this->session->data['meth'];\n }\n $payinput = \"knet\";\n if(!empty($data['meth'])){\n \t$payinput = $data['meth'];\n }else{\n \t$payinput = 'knet';\n }\n \n\n $this->redirect_post($AccountID,$AccountPrivateKey,$redirect_url,$order_total,$payinput);\n }", "function performAction($action)\n\t{\n\t\t$post = $this->input->post();\n\t\t$success = 0;\n\t\t$failed = 0;\n\t\tif (!empty($post))\n\t\t{\n\t\t\t// Unset the action key from the post array\n\t\t\tunset($post[$action]);\n\t\t\tforeach ($post as $key => $value)\n\t\t\t{\n\t\t\t\tswitch ($action)\n\t\t\t\t{\n\t\t\t\t\tcase 'confirmResetPasswords':\n\t\t\t\t\t\t$updatePlayer = array(\n\t\t\t\t\t\t\t'Player'\t\t => strtolower($key),\n\t\t\t\t\t\t\t'Password'\t\t => password_hash(strtolower($key), PASSWORD_DEFAULT),\n\t\t\t\t\t\t\t'LastUpdated'\t => date('Y-m-d H:i:s')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t($this->players->update($updatePlayer) ? $success++ : $failed++);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'confirmDeleteAccounts':\n\t\t\t\t\t\t(is_object($this->players->delete($key)) ? $success++ : $failed++);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'confirmResetAvatars':\n\t\t\t\t\t\t$curAvatar = $this->players->get(strtolower($key))->Avatar;\n\t\t\t\t\t\t// If player's avatar is already generic, do nothing.\n\t\t\t\t\t\tif ($curAvatar != 'generic_photo.png')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunlink($_SERVER['DOCUMENT_ROOT'] . $this->data['appRoot'] . \"/assets/images/avatar/\" . $curAvatar);\n\n\t\t\t\t\t\t\t$updatePlayer = array(\n\t\t\t\t\t\t\t\t'Player'\t\t => strtolower($key),\n\t\t\t\t\t\t\t\t'Avatar'\t\t => 'generic_photo.png',\n\t\t\t\t\t\t\t\t'LastUpdated'\t => date('Y-m-d H:i:s')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t($this->players->update($updatePlayer) ? $success++ : $failed++);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'confirmPromoteToAdmin':\n\t\t\t\t\t\t$updatePlayer = array(\n\t\t\t\t\t\t\t'Player'\t\t => strtolower($key),\n\t\t\t\t\t\t\t'AccessLevel'\t => 99,\n\t\t\t\t\t\t\t'LastUpdated'\t => date('Y-m-d H:i:s')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t($this->players->update($updatePlayer) ? $success++ : $failed++);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'confirmRemoveAdmin':\n\t\t\t\t\t\t$updatePlayer = array(\n\t\t\t\t\t\t\t'Player'\t\t => strtolower($key),\n\t\t\t\t\t\t\t'AccessLevel'\t => 1,\n\t\t\t\t\t\t\t'LastUpdated'\t => date('Y-m-d H:i:s')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t($this->players->update($updatePlayer) ? $success++ : $failed++);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn array(\"success\" => $success, \"failed\" => $failed);\n\t}", "public function acceptUserConfirmRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->acceptUserConfirmRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function userupdatesuccessAction()\n {\n }", "protected function confirmDelete() {\n\t}", "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 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 getUserAction(){\r\n\t\treturn $this->userAction;\r\n\t}", "public function requireAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return;\n }\n }\n\n $this->sendJsonResponse(false, 'Invalid Action!');\n die;\n }", "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 confirmAction() {\r\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\r\n\t\t$controller = Zend_Controller_Front::getInstance ()->getRequest ()->getControllerName ();\r\n\t\ttry {\r\n\t\t\tif (is_numeric ( $id )) {\r\n\t\t\t\t$this->view->back = \"/admin/$controller/edit/id/$id\";\r\n\t\t\t\t$this->view->goto = \"/admin/$controller/delete/id/$id\";\r\n\t\t\t\t$this->view->title = $this->translator->translate ( 'Are you sure you want to delete the selected record?' );\r\n\t\t\t\t$this->view->description = $this->translator->translate ( 'If you delete the selected bank information, your customers will not be able to pay you with this method of payment' );\r\n\t\r\n\t\t\t\t$record = $this->productsattributes->find ( $id )->toArray();\r\n\t\t\t\t$this->view->recordselected = $record ['code'];\r\n\t\t\t} else {\r\n\t\t\t\t$this->_helper->redirector ( 'list', $controller, 'admin', array ('mex' => $this->translator->translate ( 'Unable to process the request at this time.' ), 'status' => 'danger' ) );\r\n\t\t\t}\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\techo $e->getMessage ();\r\n\t\t}\r\n\t}", "function confirm($type)\n\t{\n\t\t$data = t('session')->userdata($type);\n\t\tif (!$data) {\n\t\t\tredirect();\n\t\t}\n\n\t\t$this->data['key_confirm'] = $type;\n\n\t\t// Tai cac file thanh phan\n\t\t$this->load->library('form_validation');\n\t\t$this->load->helper('form');\n\n\t\t// Xu ly form\n\t\tif ($this->input->post('_submit')) {\n\t\t\t$user = user_get_account_info();\n\t\t\t// Gan dieu kien cho cac bien\n\t\t\t$params = array($this->_mod()->param());\n\t\t\t$this->_set_rules($params);\n\n\t\t\t// Xu ly du lieu\n\t\t\t$result = array();\n\t\t\tif ($this->form_validation->run()) {\n\n\t\t\t\t// Khai bao du lieu tra ve\n\t\t\t\t$result['complete'] = TRUE;\n\t\t\t\tif($type == \"change_password\"){\n\t\t\t\t\tmodel('user')->update($user->id, $data);\n\t\t\t\t\t$result['location'] = $this->_url('change_pass');\n\t\t\t\t}\n\t\t\t\telseif($type == \"change_pin\"){\n\t\t\t\t\t$this->_set_pin($user->id, $data[\"pin\"]);\n\t\t\t\t\t$result['location'] = $this->_url('change_pin');\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$result['location'] = site_url('user');\n\n\t\t\t\tset_message(lang('confirmComplate'));\n\t\t\t} else {\n\t\t\t\tforeach ($params as $param) {\n\t\t\t\t\t$result[$param] = form_error($param);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Form output\n\t\t\t$this->_form_submit_output($result);\n\t\t}\n\n\t\t// Hien thi view\n\t\t$this->_display();\n\t}", "public function action(){\n return $this->action;\n }", "public function confirmAction() {\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t$controller = Zend_Controller_Front::getInstance ()->getRequest ()->getControllerName ();\n\t\ttry {\n\t\t\tif (is_numeric ( $id )) {\n\t\t\t\t$this->view->back = \"/admin/$controller/edit/id/$id\";\n\t\t\t\t$this->view->goto = \"/admin/$controller/delete/id/$id\";\n\t\t\t\t$this->view->title = $this->translator->translate ( 'Are you sure you want to delete the invoice selected?' );\n\t\t\t\t$this->view->description = $this->translator->translate ( 'The invoice will not be longer available' );\n\t\t\t\t$record = $this->invoices->find ( $id );\n\t\t\t\t$this->view->recordselected = $record ['number'] . \" - \" . Shineisp_Commons_Utilities::formatDateOut ( $record ['invoice_date'] );\n\t\t\t} else {\n\t\t\t\t$this->_helper->redirector ( 'list', $controller, 'admin', array ('mex' => $this->translator->translate ( 'Unable to process the request at this time.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\techo $e->getMessage ();\n\t\t}\n\t\n\t}", "public function editRecordConfirmMessage($editId)\n{\n\n return \"\";\n}", "public function requestAcceptAction() {\r\n $notification = $this->_getParam('notification', 0);\r\n\t\t$is_suggestionExist = Engine_Api::_()->getItem('user', $notification->object_id);\r\n\t\tif( empty($is_suggestionExist) ) {\r\n\t\t\t// If user are not exist then we are deleting the \"User Request\" which loggden user are gettig.\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}else {\r\n\t\t\t$this->view->notification = $notification;\r\n\t\t}\r\n }", "public function action_handler() {\n\t\tif ( !isset( $_REQUEST['ucc_ucn_acn'] ) )\n\t\t\treturn;\n\n\t\t// Define local variables\n\t\t$user_id = $post_id = 0;\n\t\t$action = '';\n\t\t$errors = array();\n\n\t\t/** User Details **********************************************/\n\t\t// Is logged in\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$current_user = wp_get_current_user();\n\t\t\t$user_id = get_current_user_id(); \n\n\t\t// Not allowed \n\t\t} else {\n\t\t\t$errors[] = __( 'You do not have permission to do that.', 'unified-comment-notifications' );\n\t\t}\n\n\t\t/** Post ID ***************************************************/\n\n\t\tif ( isset( $_REQUEST['ucc_ucn_pid'] ) ) {\n\t\t\t$post_id = (int) $_REQUEST['ucc_ucn_pid'];\n\t\t}\n\n\t\t/** Action ****************************************************/\n\n\t\tif ( isset( $_REQUEST['ucc_ucn_acn'] ) ) {\n\n\t\t\tif ( !in_array( $_REQUEST['ucc_ucn_acn'], array(\n\t\t\t\t'subscribe', // AJAX/link subscribe\n\t\t\t\t'unsubscribe', // AJAX/link unsubscribe\n\t\t\t\t'unsubscribe_all' // AJAX/link unsubscribe all\n\t\t\t) ) )\n\t\t\t\t$errors[] = __( 'Invalid action specified.', 'unified-comment-notifications' ); \n\t\t\telse\n\t\t\t\t$action = $_REQUEST['ucc_ucn_acn'];\n\n\t\t// Required\n\t\t} else {\n\t\t\t$errors[] = __( 'No action specified.', 'unified-comment-notifications' );\n\t\t}\n\n\t\t/** Key *******************************************************/\n/*\n\t\tif ( isset( $_REQUEST['ucc_ucn_key'] ) ) {\n\t\t\t$key = $_REQUEST['ucc_ucn_key'];\n\n\t\t\tif ( !$this->check_key( $user_id, $key ) )\n\t\t\t\t$errors[] = __( 'Invalid key.', 'unified-comment-notifications' );\n\t\t} else {\n\t\t\t$errors[] = __( 'No key specified.', 'unified-comment-notifications' );\n\t\t}\n*/\n\t\t/** Required **************************************************/\n\n\t\tif ( 'unsubscribe_all' != $action && empty( $post_id ) )\n\t\t\t$errors[] = __( 'No post id specified.', 'unified-comment-notifications' );\n\n\t\t/** No Errors *************************************************/\n\n\t\tif ( empty( $errors ) ) {\n\n\t\t\t// Process action\n\t\t\tswitch( $action ) {\n\t\t\t\tcase 'subscribe':\n\t\t\t\t\t$this->subscribe( $user_id, $post_id );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'unsubscribe':\n\t\t\t\t\t$this->unsubscribe( $user_id, $post_id );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'unsubscribe_all':\n\t\t\t\t\t$this->unsubscribe_all( $user_id );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function callback_confirm(){\r\n\r\n $this->log('Entering the confirm callback', 'info');\r\n\r\n try{\r\n\r\n $flowApi = $this->getFlowApi();\r\n $service = 'payment/getStatus';\r\n $method = 'GET';\r\n\r\n $token = filter_input(INPUT_POST, 'token');\r\n $params = array(\r\n \"token\" => $token\r\n );\r\n \r\n $this->log('Calling the flow service: '.$service);\r\n $this->log('With params: '.json_encode($params));\r\n $result = $flowApi->send($service, $params, $method);\r\n $this->log('Flow response: '.json_encode($result));\r\n if (isset($result[\"message\"])) {\r\n throw new \\Exception($result[\"message\"]);\r\n }\r\n\r\n $order_id = $result['commerceOrder'];\r\n $order = $this->getOrder($order_id);\r\n $status = $result['status'];\r\n\r\n $amountInStore = round(number_format($order->get_total(), 0, ',', ''));\r\n $amountPaidInFlow = $result[\"amount\"];\r\n $this->log('Amount in store: '.$amountInStore);\r\n\r\n if ($amountPaidInFlow != $amountInStore) {\r\n throw new Exception('The amount has been altered. Aborting...');\r\n }\r\n\r\n /*if($this->isTesting($result)){\r\n $this->setProductionEnvSimulation($status, $result);\r\n }*/\r\n\r\n if($this->isPendingInFlow($status)){\r\n $this->setOrderAsPending($order);\r\n }\r\n elseif($this->isPaidInFlow($status)){\r\n $this->payOrder($order);\r\n }\r\n elseif($this->isCancelledInFlow($status)){\r\n $this->cancelOrder($order);\r\n }\r\n else{\r\n $this->rejectOrder($order);\r\n }\r\n\r\n } catch(Exception $e) {\r\n error_log($e->getMessage());\r\n $this->log('Unexpected error: '.$e->getCode(). ' - '.$e->getMessage(), 'error');\r\n }\r\n }", "public function confirmAction()\n {\n try {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n $hash = $this->getRequest()->getParam('hash');\n $this->loadValidOrder($orderId, $hash);\n\n //Load and render basic layout\n $this->loadLayout();\n\n // set page title\n $title = $this->getLayout()->getBlock('dhlonlineretoure_customer_address_edit')->getTitle();\n $this->getLayout()->getBlock('head')->setTitle($this->__($title));\n\n // set current navigation entry\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('sales/order/history');\n }\n\n $this->renderLayout();\n } catch (Exception $e) {\n //Show error message to user\n Mage::getSingleton('core/session')->addError($e->getMessage());\n Mage::helper(\"dhlonlineretoure/data\")->log($e->getMessage());\n\n $this->_redirect('*/*/error');\n }\n }", "public function actionAccept($confirmation) {\n\n\t\tUser::confirmEmail($confirmation);\n\t}", "public function actionConfirm()\n\t{\n\t\tif (is_array(@$_POST['operations'])) {\n\t\t\tforeach ($_POST['operations'] as $operation_id) {\n\t\t\t\tif (!$operation = Element_OphTrOperationbooking_Operation::model()->with('latestBooking')->findByPk($operation_id)) {\n\t\t\t\t\tthrow new Exception('Operation not found: '.$operation_id);\n\t\t\t\t}\n\n\t\t\t\t$booking = $operation->latestBooking;\n\n\t\t\t\tif (!$booking->transport_arranged) {\n\t\t\t\t\t$booking->transport_arranged = 1;\n\t\t\t\t\t$booking->transport_arranged_date = date('Y-m-d');\n\n\t\t\t\t\tif (!$booking->save(true,null,true)) {\n\t\t\t\t\t\tthrow new Exception('Unable to save booking: '.print_r($booking->getErrors(),true));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo '1';\n\t}", "function verifyEmail($action = ''){\n\t\t//$url = ROOT_URI_UI.'validUser.php?k='.$this->secretKey($this->username).'&e='.$this->username;\n\n\t\t$url = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'?k='.$this->secretKey($this->username).'&e='.$this->username;\n\t\t\n\t\tif('recover' == $action){\n\t\t\t$msg = DICO_WORD_PASSWORD_RESTORE;\n\t\t}else{\n\t\t\t$msg = DICO_WORD_CONFIRM_EMAIL;\n\t\t}\n\t\t\n\t\t$body_message = DICO_MAIL_VALID_HEAD.'<br>'\n\t\t\t\t\t\t.'<a href=\"'.$url.'\">'.$msg.'</a><br><br>'\n\t\t\t\t\t\t.$url.'<br>'\n\t\t\t\t\t\t.DICO_MAIL_VALID_FOOT;\n\n\t\t\n\t\treturn send_mail(ROOT_EMAIL, $this->username, '', ROOT_EMAIL_NAME.' '.DICO_WORD_AUTH,$body_message);\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "public function completeresetAction() {\n if ($this->request->isPost()) {\n //Get the info\n $verify = $this->request->getPost('verify-key');\n $email = $this->request->getPost('verify-email');\n $password1 = $this->request->getPost('password1');\n $password2 = $this->request->getPost('password2');\n \n //Check to make sure all field conditions are met\n if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { //email check\n $this->flash->error(\"This is not an email :(\");\n return $this->forward('session/verifyreset/'.$verify);\n }\n if($password1 != $password2 || !$password1) { //password check\n $this->flash->error(\"Passwords are not the same.\");\n return $this->forward('session/verifyreset/'.$verify);\n } \n if(!$verify) { //verify empty check\n $this->flash->error(\"Careful, no funny stuff. The Brown University Beekeeping Society is always watching ;)\");\n return $this->forward('session/verifyreset/'.$verify);\n }\n //Find a user with the appropriate things. \n $user = Users::findFirst(\n array( //emails are unique so its fine\n \"(email = :email: AND verify=:verify:)\",\n 'bind' => array('email' => addslashes($email), 'verify' => addslashes($verify))\n )\n );\n if(!$user) {\n $this->flash->error(\"Reset password failed: Invalid email or link. Try again or contact support.\");\n return $this->forward('session/tryreset');\n } else if ((time() - $user->verify_timer) > 600) {\n $this->flash->error(\"Reset password failed: Expired.\");\n return $this->forward('session/tryreset');\n } else {\n if(!$user->setPassword($password1)) {\n $this->flash->error('Fatal Hashing Error. Contact a dev.');\n return $this->forward('session/completereset');\n }\n if ($user->save() == false) {\n foreach ($user->getMessages() as $message) {\n $this->flash->error((string) $message);\n }\n $this->flash->error('Wow, that broke. Couldn\\'t save the password');\n } else {\n $this->flash->success('Success! Please log in.');\n } \n }\n \n }\n return $this->forward('session/index');\n }", "public function action()\n {\n return $this->reqaction;\n }", "public function moodupconfirmAction()\n {\n $uid = $this->_USER_ID;\n $floorId = $this->getParam(\"CF_floorid\");\n $itemId = $this->getParam(\"CF_itemid\");\n $storeType = $this->getParam(\"CF_storeType\");\n $isMoodToOther = $this->getParam(\"CF_isother\");\n\n if ($isMoodToOther) {\n if (isset($_SESSION['friend_name'])) {\n $targetName = $_SESSION['friend_name'];\n }\n\n $this->view->targetName = $targetName;\n }\n\n //get mood up chairs\n $chairList = $this->getChairList($uid, $floorId);\n\n //chairs picture name, haircut or cake or spa\n $picName = Mbll_Tower_Common::getChairPicName($storeType);\n\n $this->view->chairList1 = $chairList['chairList1'];\n $this->view->chairList2 = $chairList['chairList2'];\n $this->view->chairList3 = $chairList['chairList3'];\n $this->view->floorId = $floorId;\n $this->view->itemId = $itemId;\n $this->view->userInfo = $this->_user;\n $this->view->storeType = $storeType;\n $this->view->isToOther = $isMoodToOther;\n $this->view->picName = $picName;\n\n $this->render();\n\n }", "function confirmation_delete(){\n\t\t\tif($this->check_session->user_session() && $this->check_session->get_level()==100){\n\t\t\t\tif($this->uri->segment(3)!='99'){ //jika bukan user pusat\n\t\t\t\t\t$data['url']\t\t= site_url('rsa_tambah_em/exec_delete/'.$this->uri->segment(3));\n\t\t\t\t\t$data['message']\t= \"Apakah anda yakin akan menghapus data ini ( kode : \".$this->uri->segment(3).\") ?\";\n\t\t\t\t\t$this->load->view('confirmation_',$data);\n\t\t\t\t}else{ //jika user pusat\n\t\t\t\t\t$data['class']\t = 'option box';\n\t\t\t\t\t$data['class_btn']\t = 'ya';\n\t\t\t\t\t$data['message'] = 'Unit pusat tidak diijinkan untuk dihapus';\n\t\t\t\t\t$this->load->view('messagebox_',$data);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshow_404('page');\n\t\t\t}\n\t\t}", "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}", "abstract protected function getConfirmationSecret();", "function _action($action)\n\t{\n\t // Lay input\n\t $ids = $this->uri->rsegment(3);\n\t $ids = (!$ids) ? $this->input->post('id') : $ids;\n\t $ids = (!is_array($ids)) ? array($ids) : $ids;\n\t\n\t // Thuc hien action\n\t foreach ($ids as $id)\n\t {\n\t // Xu ly id\n\t $id = (!is_numeric($id)) ? 0 : $id;\n\t \t\n\t // Kiem tra id\n\t $info = model('user_bank')->get_info($id);\n\t if (!$info) continue;\n\t \n\t // Chuyen den ham duoc yeu cau\n\t $this->{'_'.$action}($info);\n\t }\n\t}", "function confirm($message = 'Are you sure?')\n{\n\t$CI\t=& get_instance();\n $CI->output->set_header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n $CI->output->set_header(\"Cache-Control: post-check=0, pre-check=0\", FALSE);\n $CI->output->set_header(\"Pragma: no-cache\");\n\t$segments = $CI->uri->segment_array();\n\t\n\tif( end($segments) != 'yes')\n\t{\n\t\t$referrer = $CI->input->server('HTTP_REFERER');\n\t\tif (empty($referrer))\n\t\t{\n\t\t\t// No user agent referrer, use the controller index\n\t\t\t$RTR =& load_class('Router');\n\t\t\t$referrer = $RTR->fetch_directory().$RTR->fetch_class();\n\t\t}\n\n\t\t$data['no_href']\t= $referrer;\n\t\t$data['yes_href']\t= implode('/', $segments).'/yes';\n\t\t$data['message']\t= $message;\n\t\t\t\t\n\t\techo $CI->template->display('content/confirmation', $data, 'general', TRUE);\n\t\texit;\n\t}\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 }", "function confirmation() {\r\n return false;\r\n }", "public function actionCallback() {\n\n $request = Yii::$app->request->get();\n\n $booking_id = $request['trackid'];\n\n $booking = Booking::findOne($booking_id);\n\n if(!$booking) {\n throw new \\yii\\web\\NotFoundHttpException('The requested page does not exist.');\n }\n\n $error = '';\n \n $key = $this->tap_merchantid;\n $refid = $request['ref'];\n \n $str = 'x_account_id'.$key.'x_ref'.$refid.'x_resultSUCCESSx_referenceid'.$booking_id.'';\n $hashstring = hash_hmac('sha256', $str, $this->tap_api_key);//'1tap7'\n $responsehashstring = $request['hash'];\n \n if ($hashstring != $responsehashstring) {\n $error = Yii::t('api', 'Unable to locate or update your booking status');\n } else if ($request['result'] != 'SUCCESS') {\n $error = Yii::t('api', 'Payment was declined by Tap');\n }\n \n if ($error) \n {\n return $this->redirect(['error']); \n } \n else \n { \n //gateway info \n $gateway = PaymentGateway::find()->where(['code' => 'tap', 'status' => 1])->one();\n\n if($request['crdtype'] == 'KNET') {\n $booking->payment_method = 'Tap - Paid with KNET';\n $booking->gateway_fees = $gateway->fees;\n $booking->gateway_percentage = 0;\n $booking->gateway_total = $gateway->fees;//fixed price fee \n } else {\n $booking->payment_method = 'Tap - Paid with Creditcard/Debitcard';\n $booking->gateway_fees = 0;\n $booking->gateway_percentage = $gateway->percentage;\n $booking->gateway_total = $gateway->percentage * ($booking->total_with_delivery / 100);\n }\n\n //update status \n $booking->transaction_id = $request['ref'];\n $booking->save(false);\n\n //add payment to vendor wallet \n Booking::addPayment($booking);\n \n //send order emails\n Booking::sendBookingPaidEmails($booking_id);\n\n //redirect to order success \n return $this->redirect(['success']); \n }\n }", "function Row_CustomAction($action, $row) {\n\n\t\t// Return FALSE to abort\n\t\treturn TRUE;\n\t}", "function Row_CustomAction($action, $row) {\n\n\t\t// Return FALSE to abort\n\t\treturn TRUE;\n\t}", "function Row_CustomAction($action, $row) {\n\n\t\t// Return FALSE to abort\n\t\treturn TRUE;\n\t}", "function Row_CustomAction($action, $row) {\n\n\t\t// Return FALSE to abort\n\t\treturn TRUE;\n\t}", "function Row_CustomAction($action, $row) {\n\n\t\t// Return FALSE to abort\n\t\treturn TRUE;\n\t}", "function Row_CustomAction($action, $row) {\n\n\t\t// Return FALSE to abort\n\t\treturn TRUE;\n\t}", "public function getUserAction()\n\t{\n\t\treturn $this->userAction;\n\t}", "protected function getAction() {}", "public function action();", "public function getActionParameter(){\n return $this->actionParameter;\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 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 }", "function prompt ($template_file, $url, $message, $options = array(1 => 'Yes', 0 => 'No'), $parameter_name = 'confirm')\n{\n\tglobal $template;\n\n\t// Has confirmation page been displayed and confirmed already?\n\tif (isset($_REQUEST[$parameter_name]))\n\t{\n\t\treturn $_REQUEST[$parameter_name];\n\t}\n\t\n\t// Build choices to send to template\n\t$choices = array();\n\tforeach ($options as $value => $option_label)\n\t{\n\t\t$option_url = build_url($url, $_POST + $_GET + array($parameter_name => $value));\n\t\t$choices[] = array('u_choice' => $option_url, 'label' => $option_label);\n\t}\n\t\n\t// Send all variables to template and output\n\t$template->set_tpl_var('choices', $choices);\n\t$template->set_tpl_var('message', $message);\n\t$template->set_tpl_var('page_title', 'Please Confirm');\n\t$template->set_file('main', $template_file);\n\t$template->output('main');\n\texit;\n}", "public function waitforconfirmationAction()\n {\n \tZend_Registry::set('SubCategory', SubCategory::USERUPDATE);\n }", "public function action() {\n $html_allowed = array();\n foreach ($_REQUEST as $key => $value) {\n // ignore config values!\n if (!in_array($key, $html_allowed)) {\n $_REQUEST[$key] = $this->xssPrevent($value);\n }\n }\n\n $action = isset($_REQUEST[self::REQUEST_ACTION]) ? $_REQUEST[self::REQUEST_ACTION] : self::ACTION_DEFAULT;\n\n switch ($action) :\n case self::ACTION_CONFIG:\n $this->show(self::ACTION_CONFIG, $this->dlgConfig());\n break;\n case self::ACTION_ABOUT:\n $this->show(self::ACTION_ABOUT, $this->dlgAbout());\n break;\n case self::ACTION_EDIT:\n $this->show(self::ACTION_EDIT, $this->dlgEdit());\n break;\n case self::ACTION_EDIT_CHECK:\n $this->show(self::ACTION_EDIT, $this->checkEdit());\n break;\n case self::ACTION_PROTOCOL:\n $this->show(self::ACTION_PROTOCOL, $this->dlgProtocol());\n break;\n case self::ACTION_CRONJOBS:\n $this->show(self::ACTION_CRONJOBS, $this->dlgCronjobs());\n break;\n default:\n $this->show(self::ACTION_ABOUT, $this->dlgAbout());\n break;\n endswitch;\n }", "public function actionCancel()\n {\n }", "public function executeConfirmEmail($request)\r\n {\r\n \t$this->forward404Unless($request->isMethod('get'));\r\n \t\r\n \t$email = EmailPeer::getFromField(EmailPeer::CONFIRM_CODE,$this->getRequestParameter('confirm_code'));\r\n \tif($email)\r\n \t{\r\n \t\tif($email->getIsPrimary() && !$email->getActualEmail())\r\n \t\t{\r\n \t\t\t// if invited, send acceptance email and add to quick contact\r\n \t\t\t$user = $email->getUser();\r\n \t\t\tif($user->getInvitedBy())\r\n \t\t\t{\r\n \t\t\t\t// add to bookmark\r\n \t\t\t\t$b = new Bookmark();\r\n \t\t\t\t$b->setUser($user->getUserRelatedByInvitedBy());\r\n \t\t\t\t$b->setTag($user->retrievePrimaryJotag());\r\n \t\t\t\t$b->save();\r\n \t\t\t\t\r\n \t\t\t\t// give credit to the inviter\r\n \t\t\t\t$credits = $user->getUserRelatedByInvitedBy()->giveCredit(OptionPeer::retrieveOption('BONUS_ACCEPT_CREDIT'));\r\n\t\t \tMailer::sendEmail($user->getUserRelatedByInvitedBy()->getPrimaryEmail(),'inviteAccepted',array('owner'=>$user->getUserRelatedByInvitedBy(),'user'=>$user,'email'=>$email,'credits'=>$credits),$user->getUserRelatedByInvitedBy()->getPreferedLanguage());\r\n \t\t\t}\r\n \t\t\t// activate primary jotag\r\n \t\t\t$jotag = $email->getUser()->retrievePrimaryJotag();\r\n \t\t\t$jotag->setStatus(TagPeer::ST_ACTIVE);\r\n \t\t\t$jotag->save();\r\n \t\t\t\r\n \t\t\t$this->setMessage('ACCOUNT_CONFIRM','SUCCESS');\r\n \t\t}\r\n \t\telse $this->setMessage('EMAIL_CONFIRM','SUCCESS');\r\n \t\t \r\n \t\t$email->setIsConfirmed(true);\r\n \t\t$email->setConfirmCode(null);\r\n \t\t$email->setActualEmail(null);\r\n \t\t$email->save();\r\n \t}\r\n \telse $this->setMessage('EMAIL_CONFIRM_ERROR','ERROR');\r\n\r\n \t$this->redirect('@homepage');\r\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 }", "public function confirmation() {\n return false;\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}", "public function hookPaymentReturn($params)\r\n\t{\r\n\t\tglobal $cart;\r\n\r\n\t\t//customers were to reorder an order done with billmate cardpay.\r\n\t\t$cart->save();\r\n\t\tif (!$this->active)\r\n\t\t\treturn;\r\n\r\n\r\n\t\t return $this->display(dirname(__FILE__), 'confirmation.tpl');\r\n\t}", "public function pesquisarAction() {\r\n \r\n }", "function action() {\n\t\t$ids = ($this->input->post ( 'multiaction' ) == 'Yes' ? $this->input->post ( 'id' ) : decode_value ( $this->input->post ( 'changeId' ) ));\n\t\t\n\t\t$ids = ($this->input->post ( 'changeId' ) != '') ? decode_value ( $this->input->post ( 'changeId' ) ) : $this->input->post ( 'id' );\n\t\t$postaction = $this->input->post ( 'postaction' );\n\t\t\n\t\t$response = array (\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => get_label ( 'something_wrong' ),\n\t\t\t\t'action' => '',\n\t\t\t\t'multiaction' => $this->input->post ( 'multiaction' ) \n\t\t);\n\n\t\tif ($postaction == 'Delete' && ! empty ( $ids )) {\n\t\t\t\n\t\t\tif (is_array ( $ids )) {\n\n\t\t\t\n\t\t\t\t\n\t\t\t\t$this->Mydb->delete_where_in($this->table,'category_id',$ids,'');\n\t\t\t\t\n\n\t\t\t\tif( count($ids) > 1 ){\n\t\t\t\t\t$response ['msg'] = sprintf ( $this->lang->line ( 'success_message_delete' ), $this->module_labels );\n\t\t\t\t} else{\n\t\t\t\t\t$response ['msg'] = sprintf ( $this->lang->line ( 'success_message_delete' ), $this->module_label );\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t\n\t\t\t\t$this->Mydb->delete_where_in($this->table,'category_id',$ids,'');\n\t\t\t\t\n\t\t\t\t$response ['msg'] = sprintf ( $this->lang->line ( 'success_message_delete' ), $this->module_label );\n\t\t\t}\n\t\t\t$response ['status'] = 'success';\n\t\t\t$response ['action'] = $postaction;\n\t\t}\n\t\t\n\t\t/* Activation */\n\t\tif ($postaction == 'Activate' && ! empty ( $ids )) {\n\t\t\t$update_values = array (\n\t\t\t\t\t\"category_status\" \t => 'A',\n\t\t\t\t\t\"category_created_on\" => current_date (),\n\t\t\t\t\t'category_created_by' => get_admin_id (),\n\t\t\t\t\t'category_created_ip' => get_ip () \n\t\t\t);\n\t\t\t\n\t\t\tif (is_array ( $ids )) {\n\t\t\t\t$this->Mydb->update_where_in ( $this->table, $this->primary_key, $ids, $update_values );\n\t\t\t\t$response ['msg'] = sprintf ( $this->lang->line ( 'success_message_activate' ), $this->module_labels );\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->Mydb->update ( $this->table, array (\n\t\t\t\t\t\t$this->primary_key => $ids \n\t\t\t\t), $update_values );\n\t\t\t\t$response ['msg'] = sprintf ( $this->lang->line ( 'success_message_activate' ), $this->module_label );\n\t\t\t}\n\t\t\t\n\t\t\t$response ['status'] = 'success';\n\t\t\t$response ['action'] = $postaction;\n\t\t}\n\t\t\n\t\t/* Deactivation */\n\t\tif ($postaction == 'Deactivate' && ! empty ( $ids )) {\n\t\t\t$update_values = array (\n\t\t\t\t\t\"category_status\" \t => 'I',\n\t\t\t\t\t\"category_created_on\" => current_date (),\n\t\t\t\t\t'category_created_by' => get_admin_id (),\n\t\t\t\t\t'category_created_ip' => get_ip () \n\t\t\t);\n\t\t\t\n\t\t\tif (is_array ( $ids )) {\n\t\t\t\t$this->Mydb->update_where_in ( $this->table, $this->primary_key, $ids, $update_values );\n\t\t\t\t$response ['msg'] = sprintf ( $this->lang->line ( 'success_message_deactivate' ), $this->module_labels );\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->Mydb->update ( $this->table, array (\n\t\t\t\t\t\t$this->primary_key => $ids \n\t\t\t\t), $update_values );\n\t\t\t\t$response ['msg'] = sprintf ( $this->lang->line ( 'success_message_deactivate' ), $this->module_label );\n\t\t\t}\n\t\t\t\n\t\t\t$response ['status'] = 'success';\n\t\t\t$response ['action'] = $postaction;\n\t\t}\n\t\t\n\t\techo json_encode ( $response );\n\t\texit ();\n\t}", "public function beforeAction($action)\n {\n // which are triggered on the [[EVENT_BEFORE_ACTION]] event, e.g. PageCache or AccessControl\n $this->tahun = Yii::$app->params['tahun'];\n $this->pemda_id = Yii::$app->params['pemda_id'];\n \n // return var_dump($action->id);\n if($action->id !== 'view'){\n if(Yii::$app->user->identity->username !== 'admin'){\n Yii::$app->session->setFlash('warning', \"You didn't have access.\");\n return $this->redirect(['/survaiawal']);\n }\n }\n \n if (!parent::beforeAction($action)) {\n return false;\n }\n \n // other custom code here\n \n return true; // or false to not run the action\n }", "public function getConfirmUrl() {\n\t\treturn $this->getEmailActionLink('email/emailConfirm');\n\t}", "private function get_action($action = null, $additional_message = null) {\n\t\t\t// Run through a switch statement to specify an action and return\n\t\t\tswitch($action) {\n\t\t\t\tcase 'view' : // For page views\n\t\t\t\t\t$action = 'Page Viewed: (' . page_name() . ')'; // Use the page_name function to specify which page a user has visited\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'not_found' : // For accessing pages which couldn't be found, such as invalid $_GET values or values which couldn't be found in the database\n\t\t\t\t\t$action = \"Result Not Found: (\" . page_name() . ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'login_failed' :\n\t\t\t\t\t$action = 'Login Failed';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'login_success' :\n\t\t\t\t\t$action = 'Login Success';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'login_redirect' :\n\t\t\t\t\t$action = 'User redirected from login page due to already being logged in';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'logout_success' :\n\t\t\t\t\t$action = 'Logout Success';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'logout_security' :\n\t\t\t\t\t$action = 'Automatic logout due to a failed security check';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'not_authenticated' :\n\t\t\t\t\t$action = 'Unauthenticated User Attempted Accessing Page: (' . page_name() . ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_add_failed' :\n\t\t\t\t\t$action = 'User Add Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_add_success' :\n\t\t\t\t\t$action = 'User Add Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_delete_failed' :\n\t\t\t\t\t$action = 'User Delete Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_delete_success' :\n\t\t\t\t\t$action = 'User Delete Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_update_failed' :\n\t\t\t\t\t$action = 'User Update Failed';\n\t\t\t\t\tif($additional_message == 'database_password') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database to update password.';\n\t\t\t\t\t} elseif($additional_message == 'database_details') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database to update details.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_update_success' :\n\t\t\t\t\t$action = 'User Update Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contact_add_failed' :\n\t\t\t\t\t$action = 'Contact Add Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contact_add_success' :\n\t\t\t\t\t$action = 'Contact Add Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contact_delete_failed' :\n\t\t\t\t\t$action = 'Contact Delete Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contact_delete_success' :\n\t\t\t\t\t$action = 'Contact Delete Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contact_update_failed' :\n\t\t\t\t\t$action = 'Contact Update Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contact_update_success' :\n\t\t\t\t\t$action = 'Contact Update Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_call_success' :\n\t\t\t\t\t$action = 'API Call Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_call_failed' :\n\t\t\t\t\t$action = 'API Call Failed';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_add_failed' :\n\t\t\t\t\t$action = 'API Token Add Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_add_success' :\n\t\t\t\t\t$action = 'API Token Add Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_delete_failed' :\n\t\t\t\t\t$action = 'API Token Delete Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_delete_success' :\n\t\t\t\t\t$action = 'API Token Delete Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_update_failed' :\n\t\t\t\t\t$action = 'API Token Update Failed';\n\t\t\t\t\tif($additional_message == 'database') {\n\t\t\t\t\t\t$action .= ': There was an error making changes to the database.';\n\t\t\t\t\t} elseif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'api_update_success' :\n\t\t\t\t\t$action = 'API Token Update Success';\n\t\t\t\t\tif($additional_message) {\n\t\t\t\t\t\t$action .= ': ' . $additional_message;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\t$action = 'Action Unspecified!';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Return the $action\n\t\t\treturn $action;\n\t\t}", "public static function confirmscreen($returnurl, $actionurl, $action = 'cancelsubscription')\n\t{\n\t\t?>\n\t\t<div class=\"confirmwrap\">\n\t\t\t<div class=\"confirmscreen\">\n\t\t\t\t<p class=\"warning\"><?php echo Lang::txt('COM_JOBS_CONFIRM_ARE_YOU_SURE') . \" \";\n\t\t\t\t\tif ($action == 'cancelsubscription')\n\t\t\t\t\t{\n\t\t\t\t\t\techo strtolower(Lang::txt('COM_JOBSSUBSCRIPTION_CANCEL_THIS'));\n\t\t\t\t\t}\n\t\t\t\t\telse if ($action == 'withdrawapp')\n\t\t\t\t\t{\n\t\t\t\t\t\techo Lang::txt('COM_JOBS_APPLICATION_WITHDRAW');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo Lang::txt('COM_JOBS_ACTION_PERFORM_THIS');\n\t\t\t\t\t}\n\t\t\t\t\t$yes = strtoupper(Lang::txt('YES'));\n\t\t\t\t\t$yes .= $action == 'cancelsubscription' ? ', ' . Lang::txt('COM_JOBS_ACTION_CANCEL_IT') : '';\n\t\t\t\t\t$yes .= $action == 'withdrawapp' ? ', ' . Lang::txt('COM_JOBS_ACTION_WITHDRAW') : '';\n\t\t\t\t\t$no = strtoupper(Lang::txt('NO'));\n\t\t\t\t\t$no .= $action == 'cancelsubscription' ? ', ' . Lang::txt('COM_JOBS_ACTION_DO_NOT_CANCEL') : '';\n\t\t\t\t\t$no .= $action == 'withdrawapp' ? ', ' . Lang::txt('COM_JOBS_ACTION_DO_NOT_WITHDRAW') : ''; ?>\n\t\t\t\t</p>\n\t\t\t\t<p><span class=\"yes\"><a href=\"<?php echo $actionurl ?>\"><?php echo $yes ?></a></span> <span class=\"no\"><a href=\"<?php echo $returnurl ?>\"><?php echo $no ?></a></span></p>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "function grid_submit_confirm_edit() {\r\n /* echoed before enterim form, inside <script>, define form_submit_confirm javascript function behaviour in your code\r\n */\r\n return <<<__END__\r\n function submit_confirm(myform) {\r\n //action = myform.elements['act'].value;\r\n //myform.submit();\r\n }\r\n__END__;\r\n\r\n }", "function confirmFriendRequest($params) {\n $username1 = $params['username1'];\n $username2 = $params['username2'];\n\n $response = acceptFriendRequest($username1, $username2);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function action() {\n return $this->action;\n }", "function confirm_user_signup($user_name, $user_email)\n {\n }" ]
[ "0.6938741", "0.6871067", "0.68649226", "0.68606925", "0.6702972", "0.6686289", "0.6494769", "0.64932954", "0.64883083", "0.6452348", "0.6396363", "0.6393949", "0.637466", "0.6352716", "0.63022244", "0.6293017", "0.6269882", "0.62572324", "0.6246413", "0.62438107", "0.6239237", "0.62347114", "0.6190217", "0.6189564", "0.6186998", "0.6180622", "0.6180591", "0.61744314", "0.6153099", "0.6149039", "0.61246514", "0.61097306", "0.6102737", "0.6101693", "0.60928595", "0.60784096", "0.6059984", "0.60556525", "0.6038045", "0.60376257", "0.6029081", "0.60089076", "0.60047644", "0.6003151", "0.59834105", "0.59762764", "0.5967202", "0.5966633", "0.59568983", "0.59527045", "0.5952649", "0.5946941", "0.5946218", "0.59374", "0.5928102", "0.59255004", "0.59255004", "0.59255004", "0.5915948", "0.591515", "0.5908648", "0.5905969", "0.5899633", "0.5895485", "0.58763045", "0.58480614", "0.58400124", "0.5825565", "0.5825313", "0.58225435", "0.58225435", "0.58225435", "0.58225435", "0.58225435", "0.58225435", "0.5819079", "0.58105814", "0.58067584", "0.58036345", "0.58019376", "0.57965744", "0.5790977", "0.57896864", "0.57891804", "0.5788823", "0.57830137", "0.57808524", "0.57805413", "0.5768949", "0.5765276", "0.5760784", "0.57566714", "0.57452786", "0.573434", "0.573301", "0.57259417", "0.57238746", "0.57221097", "0.57180214", "0.5716164" ]
0.6728388
4
function is used to check User exist or not By email Params required: email. return true or false. used within class.
function checkUserByEmail($email){ $rec = $this->query("SELECT `id` from `users` where `email` = '$email' AND `user_type` = '1'"); if($rec && mysql_num_rows($rec)>0){ //if user with the email got found return true; }else{ //if user with the email got not found return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userExists($email) {\r\n\t\t\tif ($this->getUser($email) != false)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}", "public function checkUserExist($email) {\n try {\n $result = User::model()->checkUserExist($email);\n return $result;\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:checkUserExist::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n \n }", "public function isUserExisted($email) {\n $user = Member::model()->find('email=:email',array(':email'=>$email));\n $number_of_rows = count($user);\n if ($number_of_rows > 0) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "public function isUserExisted($email) {\r\n $result = mysqli_query($this->con,\"SELECT email from users WHERE email = '$email'\");\r\n $no_of_rows = mysqli_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n // user existed \r\n return true;\r\n } else {\r\n // user not existed\r\n return false;\r\n }\r\n }", "public function isUserExisted($email) {\n $stm = $this->db->prepare(\"SELECT email FROM users WHERE email=?\");\n $stm->execute(array($email));\n $user=$stm->fetch(PDO::FETCH_OBJ);\n if($user!=null){\n return true;\n }else{\n false;\n }\n }", "public function Check($email)\n {\n $db = new DB();\n //Check whether user data already exists in database\n $querySelect = \"SELECT \n * \n FROM \n \".$this->userTbl.\" \n WHERE\n email = '\".$email.\"'\";\n $result = $db->prepare($querySelect);\n $result->execute();\n if($result->rowCount() > 0)\n {\n return false;\n }\n else\n {\n return true;\n }\n\n }", "public function email_exists() {\n\t\t\n\t\t$email = $this->input->post('users_email');\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array (\n\t\t\t'users_email' => trim ( $email )\n\t\t);\n\n\t\tif ($edit_id != \"\") {\n\n\t\t\t$where = array_merge ( $where, array (\n\t\t\t\t\t\"users_id !=\" => $edit_id \n\t\t\t) );\n\t\n\t\t} \n\n\t\t$result = $this->Mydb->get_record( 'users_id', $this->table, $where );\n\t\t\n\t\tif ( !empty ( $result ) ) {\n\t\t\t$this->form_validation->set_message ( 'email_exists', get_label ( 'user_email_exist' ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "function checkExistsUser($email){\n\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM user Where email=:email\");\n\t\t$stmt->execute(['email'=>$email]);\n\t\t$result = $stmt->fetchAll();\n\t\t$num_rows = count($result);\n\n\t\tif($num_rows > 0){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function isUserExistsByEmail($email) {\n $query = \"select * from user_profile_details WHERE email='{$email}' \";\n $result_set = mysql_query($query);\n if(isQuerySuccess($result_set)){\n\t\tif (mysql_num_rows($result_set) > 0) { \n\t\t\treturn true;\n\t\t} else { \n\t\t\treturn false;\n\t\t}\t\n\t}\t\n}", "public function isUserExisted($email) {\n \t\t\n\t\t$query = \" \n SELECT * from users WHERE email = :email;\n \"; \n\t\t\n\t\ttry \n { \n $stmt = $this->_db->prepare($query); \n\t\t\t$stmt->bindValue(':email',$email);\n $stmt->execute(); \n\t\t\t$result = $stmt->fetch();\n } \n catch(PDOException $ex) \n { \n\t\t\t$h = $ex->getMessage ();\n die($h); \n }\n\t\t\n\t\tif (!(empty($result))) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n\t\t\t\n }", "public function userExists($email){\r\n\r\n\t\t$this->stmt = $this->db->prep(\"SELECT email FROM Users WHERE email=:email\");\r\n\t\t$this->stmt->bindParam(':email', $email);\r\n\t\t$this->stmt->execute();\r\n\t\t$email_check = $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t//comparing given email to what was fetched from the database\r\n\t\tif($email == $email_check[\"email\"]){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function isUserExisted($email) {\n $stms = $this->conn->prepare(\"SELECT email from users WHERE email = ?\");\n \n $stms->bind_param(\"s\", $email);\n \n $stms->execute();\n \n $stms->store_result();\n \n if ($stms->num_rows > 0) {\n // user existed \n $stms->close();\n return true;\n } else {\n // user not existed\n $stms->close();\n return false;\n }\n }", "public function isUserEmilExisted($email) {\n $result = mysql_query(\"SELECT * from users WHERE email = '$email'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user email existed \n return true;\n } else {\n // user email not existed\n return false;\n }\n }", "public function userExists($email) {\r\n $query = 'SELECT 1 FROM usermanagement.users WHERE email=\\'' . pg_escape_string($email) . '\\'';\r\n $results = $this->dbDriver->fetch($this->dbDriver->query($query));\r\n return !empty($results);\r\n }", "public function chkEmailExist() {\n ob_clean();\n $this->load->model('register_model');\n $user_email = $this->input->post('user_email');\n $table_to_pass = 'mst_users';\n $fields_to_pass = array('user_id', 'user_email');\n if ($this->input->post('action') != \"\") {\n $condition_to_pass = \"(user_type!=2) and (`user_email` = '\" . $user_email . \"' or `user_name` = '\" . $user_email . \"')\";\n } else {\n $condition_to_pass = array(\"user_email\" => $user_email);\n }\n $arr_login_data = $this->register_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\n if (count($arr_login_data)) {\n echo 'true';\n } else {\n echo 'false';\n }\n }", "public function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users2 WHERE email = '$email'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "function check_existing_email($email){\n $sql = \"SELECT * from mbf_user WHERE email='$email'\";\n $query = $query = $this->db->query($sql);\n if ($query->num_rows() > 0){\n return true;\n }else{\n return false;\n }\n }", "Public Function emailExists($Email)\n\t{\n\t\t$Result = $this->_db->fetchRow('SELECT * FROM bevomedia_user WHERE email = ?', $Email);\n\t\tif(sizeOf($Result) == 0 || !$Result)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function isEmailExist($email){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Gmail = '$email'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "public function isUserExisted($email)\n {\n $Dbcon = new Dbcon();\n $stmt = $Dbcon->select_one_row(\"SELECT email from users WHERE email = '\" . $email . \"' and active='1'\");\n\n if ($stmt) {\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "private function isUserExists($email) {\n\t\t$stmt = $this->conn->prepare(\"SELECT user_id from tb_user WHERE user_email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t$num_rows = $stmt->num_rows;\n\t\t$stmt->close();\n\t\treturn $num_rows > 0;\n\t}", "function checkEmailExists()\n {\n $userId = $this->input->post(\"userid\");\n $email = $this->input->post(\"email\");\n\n if (empty($userId)) {\n $result = $this->user_model->checkEmailExists($email);\n } else {\n $result = $this->user_model->checkEmailExists($email, $userId);\n }\n\n if (empty($result)) {\n echo(\"true\");\n } else {\n echo(\"false\");\n }\n }", "private function isUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT id FROM app_users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function check_existing_user($email, $user_type)\n {\n if (empty($email) || empty($user_type))\n {\n return;\n }\n $this->db->where(array('email' => $email, 'user_type' => $user_type));\n\n if ($this->db->count_all_results('users') > 0)\n {\n return TRUE;\n }\n return FALSE;\n }", "function checkEmailExists()\n {\n $userId = $this->input->post(\"userId\");\n $email = $this->input->post(\"email\");\n\n if(empty($userId)){\n $result = $this->user_model->checkEmailExists($email);\n } else {\n $result = $this->user_model->checkEmailExists($email, $userId);\n }\n\n if(empty($result)){ echo(\"true\"); }\n else { echo(\"false\"); }\n }", "function check_exists_email($email){\n /* Select 'users' table on database */\n $this->db->select('email');\n $this->db->from('users');\n $this->db->where('email', $email);\n $result = $this->db->get();\n \n if($result->num_rows() >0){\n /*Username Exists*/\n return TRUE;\n } else {\n /*Username does not exist*/\n return FALSE;\n }\n }", "function emailExists(){\r\n \r\n // query to check if email exists\r\n $query = \"SELECT id, fname, lname, password,role\r\n FROM user\r\n WHERE email = ?\r\n LIMIT 0,1\";\r\n \r\n // prepare the query\r\n $stmt = $this->conn->prepare( $query );\r\n \r\n // sanitize\r\n $this->email=htmlspecialchars(strip_tags($this->email));\r\n $this->password =htmlspecialchars(strip_tags($this->password));\r\n // bind given email value\r\n $stmt->bindParam(1, $this->email);\r\n \r\n // execute the query\r\n $stmt->execute();\r\n \r\n // get number of rows\r\n $num = $stmt->rowCount();\r\n \r\n // if email exists, assign values to object properties for easy access and use for php sessions\r\n if($num>0){\r\n \r\n // get record details / values\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n // assign values to object properties\r\n $this->id = $row['id'];\r\n $this->fname = $row['fname'];\r\n $this->lname = $row['lname'];\r\n $this->password = $row['password'];\r\n $this->user_type = $row['user_type'];\r\n \r\n // return true because email exists in the database\r\n return true;\r\n }\r\n \r\n // return false if email does not exist in the database\r\n return false;\r\n }", "private function isUserExists($email) {\n $query = mysql_query(\"SELECT UserId FROM user WHERE Email = '$email'\");\n $no_of_rows = mysql_num_rows($query);\n return $no_of_rows > 0;\n }", "protected function userExist ($username,$email) {\n\t\t$sql = \"SELECT user_name, user_email FROM users\n\t\t\t\tWHERE user_name = ? AND user_email = ?\";\n\t\t$data = [$username,$email];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\t\n\t\t$statement = $this->setStatement($sql,$data);\n\t\t\tif ( $statement->rowCount() < 1 ) {\n\t\t\t\t$out = true;\n\t\t\t} else {\n\t\t\t\t$out = false;\n\t}\n\t\treturn $out;\n\t}", "public function checkUserExist($email)\n {\n $sql = \"SELECT `id` FROM `user` WHERE email = '$email'\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n $count = sizeof($result);\n if ($count > 0)\n return true;\n else return false;\n }", "public function UserEmailExists($email, $id=NULL){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->addInCondition('user_email', array($email));\n\t\tif($id){\n\t\t\t$criteria->condition .= \" AND user_id != '\".(int)$id.\"' \";\n\t\t}\n\t\t$User = NeUser::model()->count($criteria);\n\t\tif($User>0){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkuseremail($email){\n\t\t$this->db->where('Email',$email);\n\t\t$this->db->select('Email,Status');\n\n\t\t$query=$this->db->get('tbl_userdetails');\n\t\tif($query->num_rows()==1){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\n\t}", "public function checkUserExist($uemail) {\n\t\t$this->db->select('*');\n\t\t$this->db->from('users');\n\t\t$this->db->where('email',$uemail);\n\t\t$this->db->limit(1);\n\t\t$query = $this->db->get();\n\t\t\n\t\tif ($query->num_rows() == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkIfEmailExists($email);", "public function _check_email_exists($email = ''){\n\t\t\n\t}", "public function isUserExisted($email){\n\t\t$stmt = $this->conn->prepare(\"SELECT email FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\",$email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\tif($stmt->num_rows > 0){\n\t\t\t$stmt->close();\n\t\t\treturn true;\n\t\t}\n\n\t\telse{\n\t\t\t$stmt->close();\n\t\t\treturn false;\n\t\t}\n\t}", "public function email_exists(){\n $email = $this->input->post('email');\n $query = $this->db->query(\"SELECT email, password FROM user WHERE email='$email'\"); \n if($row = $query->row()){\n return TRUE;\n }else{\n return FALSE;\n }\n}", "private function isUserExists($email) {\n $stmt = $this->con->prepare(\"SELECT id from users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "private function isUserExists($email) {\n \n $result = $this->con->query(\"SELECT iduser from user WHERE email = '\".$email.\"';\");\n $num_rows=$result->num_rows;\n \n \n return $num_rows;\n }", "function isUserExist($email)\n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}", "public function userExists($username, $email) {\n\t\t\t$user_exists_check_sql = \"SELECT id FROM `po-users` WHERE `username` = :username OR `email` = :email ORDER BY `id` LIMIT 1\";\n\t\t\t$user_exists_check_query = $this->getConnection()->prepare($user_exists_check_sql);\n\t\t\t$user_exists_check_query->bindParam(\":username\", $username);\n\t\t\t$user_exists_check_query->bindParam(\":email\", $email);\n\t\t\t$user_exists_check_query->execute();\n\t\t\treturn !$user_exists_check_query->rowCount() == 0;\n\t\t}", "private function check_email($email){\r\n $this->db->where('email', $email);\r\n $query = $this->db->get('users');\r\n if($query->num_rows() != 0){\r\n return false;\r\n }else{\r\n return true;\r\n }\r\n }", "public function emailExists($email) {\n\n return $this->getEntityManager()\n ->getRepository('Alt68\\Entities\\User')\n ->findOneBy(array('email' => $email));\n }", "function emailExists($email) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT email FROM users WHERE email = ?\",array($email));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function checkemail() {\n\n if (env(\"NEW_ACCOUNTS\") == \"Disabled\" && env(\"GUEST_SIGNING\") == \"Disabled\") {\n\n $account = Database::table(\"users\")->where(\"email\", input(\"email\"))->first();\n if (!empty($account)){\n response()->json(array(\"exists\" => true));\n }else{\n response()->json(array(\"exists\" => false));\n }\n\n }\n\n }", "function emailExists($email){\r\n $sql = \"SELECT email FROM users WHERE email = '$email'\";\r\n $count = $this->q($sql)->num_rows;\r\n if ($count > 0 ){ return true; } else{ return false; }\r\n }", "public function findUserByEmail($email){\r\n $this->db->query('SELECT * FROM user_request WHERE email = :email');\r\n // Bind value\r\n $this->db->bind(':email', $email);\r\n\r\n $row = $this->db->single();\r\n\r\n // Check row\r\n if($this->db->rowCount() > 0){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function is_registered($email) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($email) || is_array($email)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t//check if user exists\n\t\t$sql = \"SELECT id FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\")\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t$sth->execute();\n\n\t\tif($sth->rowCount() == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function ifUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT * from users WHERE emailID = ?\");\n\n $stmt->bind_param(\"s\", $email);\n\n $stmt->execute();\n\n $stmt->store_result();\n\n if ($stmt->num_rows > 0) {\n // user existed\n $stmt->close();\n return true;\n } else {\n // user not existed\n $stmt->close();\n return false;\n }\n }", "public function emailExists($email)\n {\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"select * from users where email = :email\");\n $statement->bindParam(\":email\", $email);\n $statement->execute();\n $count = $statement->rowCount();\n if ($count > 0) {\n return true;\n }\n else {\n return false;\n }\n }", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function emailExists($email)\n\t{\n\t\tglobal $db,$db_table_prefix;\n\t\n\t\t$sql = \"SELECT Active FROM \".$db_table_prefix.\"Users\n\t\t\t\tWHERE\n\t\t\t\tEmail = '\".$db->sql_escape(sanitize($email)).\"'\n\t\t\t\tLIMIT 1\";\n\t\n\t\tif(returns_result($sql) > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\t\n\t}", "public function emailExists($email) {\n\n\t $app = getApp();\n\n\t $sql = 'SELECT ' . $app->getConfig('security_email_property') . ' FROM ' . $this->table .\n\t ' WHERE ' . $app->getConfig('security_email_property') . ' = :email LIMIT 1';\n\n\t $dbh = ConnectionModel::getDbh();\n\t $sth = $dbh->prepare($sql);\n\t $sth->bindValue(':email', $email);\n\n\t if($sth->execute()) {\n\t $foundUser = $sth->fetch();\n\t if($foundUser){\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "public function checkIfUserExists($email)\n {\n $data = $this->getUserData($email);\n if ($data === 'error') {\n return 'error';\n }\n if ($data) {\n return true;\n } else {\n return false;\n }\n }", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "public function hasEmail(): bool;", "public function check_email_exist($email)\n\t{\n\t\t$query = $this->db->get_where('users', array('email' => $email));\n\t\tif($query->num_rows() > 0) \n { \n return true; \n } \n else \n { \n return false; \n } \n\t}", "public function isUserExist($userEmail) {\n $query = $this->db->query(\"SELECT * FROM Tokens WHERE email = '$userEmail' \");\n return $query->num_rows();\n }", "public static function userExists($emailOrUsername)\n {\n $user = new UserModel();\n if (!$user->readByEmail($emailOrUsername)) {\n if (!$user->readByUserName($emailOrUsername)) {\n return false;\n }\n }\n return true;\n }", "public function findUserByEmail($email){\n $this->db->query('SELECT * FROM users WHERE email = :email');\n\n // Bind value\n $this->db->bind(':email', $email);\n\n $row = $this->db->single();\n\n // Check row\n if($this->db->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n }", "public function exist_email()\r\n {\r\n $email = $this->input->post('email');\r\n \r\n $this->load->model('frontend/user_model');\r\n \r\n $record = $this->user_model->select('COUNT(id) as total')->find_by(array('email' => $email));\r\n \r\n if ($record->total == 0)\r\n echo false;\r\n else\r\n echo true; \r\n }", "public function findUserByEmail($email) {\r\n // rufe die Funktion query('SQL Statement') in der Klasse Database auf\r\n $this->db->query('SELECT * FROM users WHERE email = :email');\r\n $this->db->bind(':email', $email);\r\n \r\n //es sollte nur eine uebereinstiende Mail geben, also single() methode nuzzen\r\n $row = $this->db->singleResult();\r\n\r\n // Check row, if > 0 an email is found\r\n if($this->db->numRows() > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function findUserByEmail($email) {\n\n\t\t$this->db->query('SELECT COUNT(*) AS emailChek\n\t\t\t\t\t\tFROM users\n\t\t\t\t\t\tWHERE email = :email');\n\t\t$this->db->bind(':email', $email);\n\t\t$row = $this->db->single();\n\n\t\tif ($row->emailChek > 0) {\n\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}", "public static function isExist($email)\r\n {\r\n return User::where('email', '=', $email)->count();\r\n }", "private function check_If_Email_Exists($email){\r\n\r\n // Prepare query\r\n $query = \"SELECT * FROM `users` WHERE (Fuid = '' AND Guid = '' AND email = '{$email}')\";\r\n\r\n // Send query into server\r\n $this->_db->get_Rows($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "function email_exists($email = '', $userid = '')\n\t{\n\t\t$this->db->select('user_email');\n\t\tif($userid != '')\n\t\t{\n\t\t$this->db->where('user_id != ', $userid);\n\t\t}\n\t\t$this->db->where('user_email', $email);\n\t\t$this->db->from('ci_users');\n\t\t$query = $this->db->get();\n\t\tif($query->num_rows() > 0) \n\t\treturn true;\n\t\telse\n\t\treturn false;\n\t}", "public function accountExists($email) {\r\n $this->db = new Db();\r\n \r\n $this->db->scrub($email);\r\n $query = \"SELECT UID FROM MEMBER WHERE EMAIL = '\".$email.\"'\";\r\n $results = $this->db->select($query);\r\n return(sizeof($results)>0);\r\n }", "private function isUserExists($email)\n {\n $stmt = $this->conn->prepare(\"SELECT id FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function checkEmail(){\n\t\t\t$user = new User;\n\t\t\t$doubleCount = $user->where('login','=', Input::get('new_user_email'))->count();\n\t\t\t\n\t\t\tif($doubleCount > 0){\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>1,\n\t\t\t\t\t'msg'=>trans('alerts.exist_email')\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>0,\n\t\t\t\t\t'msg'=>'good email'\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\treturn Response::json($result);\n\t\t}", "public function emailExists( $email )\n {\n $user = \\R::findOne('user', 'email = ?', [ $email ]);\n \n return ( !is_null($user) );\n }", "public function email_check($email)\n {\n session_check();\n $user_id = $this->uri->segment(3);\n $user_id = empty($user_id) ? $this->session->userdata('user_id') : $user_id;\n if($this->uri->segment(2) == 'add' || $this->uri->segment(2) == 'Add')\n $user_id = 0;\n if($this->users_model->isemailexist($email, $user_id))\n {\n $this->form_validation->set_message('email_check', $this->lang->line('validation_email_exist'));\n return FALSE;\n }\n return TRUE; \n }", "function checkEmail($email){\n\t\t\t$database = new connect();\n\t\t\t$result = false;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM users WHERE email='$email'\";\n\t\t\t$resultQuery = mysql_query($query); \n\t\t\t\n\t\t\tif(mysql_num_rows($resultQuery) == 1){\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function DB_email_existing_check($email){\n $connection = DB_get_connection();\n $queryCheck = \"SELECT * FROM `users` WHERE Email='$email'\";\n $result = mysqli_query($connection, $queryCheck);\n if(mysqli_num_rows($result) > 0){\n \n return true;\n \n }else{\n\n return false;\n\n }\n\n}", "function check_username_exists($email){\n\t\t\t$this->form_validation->set_message('check_username_exists','This username has taken');\n\t\t\tif($this->User_model->check_username_exists($email)){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function emailExist($api, $email) {\n $result = false;\n $response = $api->get($this->get('router')->generate('api_get_user_by_email', array('email' => $email)));\n if($response->getStatusCode() != StatusCodeEnum::empty_response) {\n $result = true;\n }\n return $result;\n }", "public function email_verify() {\n $return = array();\n $email = $this->input->post('email');\n $user = new User();\n $user->where(\"email\", $email)->get();\n $return = ($user->exists()) ? FALSE : TRUE;\n echo json_encode($return);\n }", "public function validateEmail($userId,$email){\n $con=$GLOBALS['con'];\n $sql=\"SELECT 1 FROM user WHERE user_email='$email' AND user_id!='$userId'\";\n $results = $con->query($sql);\n if($results->num_rows>0)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function checkEmail($email){\n\t\t\t/**\n\t\t\t*\t@var array $result - rezultat pretrage tabele users za datu email adresu\n\t\t\t*/\n\t\t\t$result = $this->db->get_where('users', array('email' => $email));\n\t\t\tif(empty($result->row_array())){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t} \n\t\t}", "function _check_email_exist_create($email) {\n\n\t\t$this->load->model('user');\n\n\t\t$result = $this->user->check_email_exist($email);\n\n\t\t\n\n\t\tif ($result == TRUE) {\n\n\t\t\t$this->form_validation->set_message('_check_email_exist_create', 'The email \"'.$email.'\" already exists!');\n\n\t\t\treturn FALSE;\n\n\t\t} else {\n\n\t\t\treturn TRUE;\n\n\t\t}\n\n\t}", "function _check_email_exist_create($email) {\n\n\t\t$this->load->model('user');\n\n\t\t$result = $this->user->check_email_exist($email);\n\n\t\t\n\n\t\tif ($result == TRUE) {\n\n\t\t\t$this->form_validation->set_message('_check_email_exist_create', 'The email \"'.$email.'\" already exists!');\n\n\t\t\treturn FALSE;\n\n\t\t} else {\n\n\t\t\treturn TRUE;\n\n\t\t}\n\n\t}", "function useremail_check($str) {\r\n $res = $this->auth_model->is_email_exists($str);\r\n if ($res <= 0) {\r\n $this->form_validation->set_message('useremail_check', lang_key('email_not_matched'));\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function checkEmail(Request $request)\n { \n // dd($request->all());\n if (User::where('email', $request->email)->exists()) {\n return 1;\n }else{\n return 0;\n }\n }", "public function check_unique($username,$email){\n $usernameQuery = $this->db->get_where('user_ac',array('user_email'=>$username));\n $emailQuery = $this->db->get_where('user_ac',array('user_email'=>$email));\n \n $usernameCount=$usernameQuery->num_rows();\n $emailCount=$emailQuery->num_rows();\n \n if($emailCount>0 && $usernameCount>0)\n {\n return \"Both username and email exist\";\n }\n elseif($usernameCount>0)\n {\n return \"Username already exists\";\n }\n elseif ($emailCount>0) {\n return \"Email already exists\";\n }\n else {\n return true; \n }\n }", "public function emailExists( $email )\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"SELECT userID FROM user WHERE email = :email\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':email', $email);\n Core::dbClose();\n \n try\n {\n if( $stmt->execute()) \n\t\t\t{\n $row = $stmt->fetch();\n if( $stmt->rowCount() > 0 ) {\t\t\t\t\n \treturn true;\n\t\t\t\t}\n }\n } catch ( PDOException $e ) {\n echo \"Search for email failed!\";\n }\n\t\t\n\t\treturn false;\n\t}", "function userExists($username, $name, $email) {\n $dbo =& JFactory::getDBO();\n $query = 'SELECT id FROM #__users ' .\n 'WHERE username = ' . $dbo->quote($username) . ' ' .\n 'AND name = ' . $dbo->quote($name) . ' ' .\n 'AND email = ' . $dbo->quote($email);\n \n $dbo->setQuery($query);\n // Checking subscription existence\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0];\n return $user->id;\n }\n }\n return false;\n }", "public function isEmailExist($email){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\",$email);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "public function findUserByEmail($email){\n // Query the database with a named variable.\n $this->db->query('SELECT * FROM users WHERE email = :email');\n\n // Bind a value to that variable, based on the input to this function.\n $this->db->bind(':email', $email);\n\n // Run a query for a single row.\n $row = $this->db->single();\n\n if($this->db->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n\n }", "public function userExists(string $email) {\n\t\t$queryString = \"SELECT COUNT(*) FROM users \n\t\t\t\t WHERE email='{$email}';\";\n\n\t\t$numberOfRows = $this->query($queryString);\n\t\treturn (int)$numberOfRows != 0;\n\t}", "public function check_email_exists($email){\n\t\t\t$query = $this->db->get_where('users', array('email' => $email));\n\t\t\tif(empty($query->row_array())){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t} \n\t\t}", "public function ExistEmail(string $email)\r\n {\r\n\r\n $data = $this->database->select(\"users\", [\r\n \"ID\"\r\n ], [\r\n \"email\" => $email\r\n ]);\r\n\r\n $error_array = $this->database->error();\r\n\r\n if($error_array[2] == NULL)\r\n {\r\n\r\n if(!isset($data[0]))\r\n {\r\n\r\n return (bool) false;\r\n\r\n }\r\n else\r\n {\r\n\r\n return (bool) true;\r\n\r\n }\r\n\r\n }\r\n else\r\n {\r\n\r\n throw new UserException($this->error = $error_array[2]);\r\n\r\n }\r\n\r\n }", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->User->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function userEmailCheck($uName,$uEmail){\n \n $username = [\n 'conditions' => ['user_name = ?'],\n 'bind' => [\"$uName\"]\n ];\n $email = [\n 'conditions' => ['user_email = ?'],\n 'bind' => [\"$uEmail\"]\n ];\n if($this->findFirst($username,$operator = \"and\") && $this->findFirst($email,$operator = \"and\")){\n header(REGISTER_REDIRECT . \"?error=usernameemailexist&uname=\" . $this->uName . \"&udisplay=\" . $this->uDisplayName . \"&umail=\" . $this->uEmail);\n exit(); \n }\n elseif($this->findFirst($username,$operator = \"and\")){\n header(REGISTER_REDIRECT . \"?error=usernameexist&uname=\" . $this->uName . \"&udisplay=\" . $this->uDisplayName . \"&umail=\" . $this->uEmail);\n exit(); \n }\n elseif($this->findFirst($email,$operator = \"and\")){\n header(REGISTER_REDIRECT . \"?error=emailexist&uname=\" . $this->uName . \"&udisplay=\" . $this->uDisplayName . \"&umail=\" . $this->uEmail);\n exit(); \n }\n return true;\n }", "function isUserRegistered($email) {\n\t\ttry {\n \t\tif($email==null) {\n \treturn false;\n \texit();\n\t\t}\n\t\t$mailCheck = $this->connection->prepare(\"SELECT `EMAIL` from win WHERE `email` = ?\");\n\t\t$mailCheck->bindValue(1, $email);\n\t\t$mailCheck->execute();\n\t\tif ($mailCheck->rowCount() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n \treturn false;\n \texit();\n\t\t}\n\t}\n\t\tcatch(Exception $e) {\n\t\t}\n\t}", "public function checkEmail($email) // provjera dali email vec postoji \r\n {\r\n $query = $this->db->select('*')->from($this->userTbl)->where('email', $email)->get();\r\n $result=$query->result();\r\n $num_rows=$query->num_rows();\r\n\r\n if($num_rows == 0) // ako nema emaila koji podudaraju vraca \"false\"\r\n return false;\r\n return true;\r\n }", "public function iN_CheckEmailExistForRegister($email) {\n\t\t$email = mysqli_real_escape_string($this->db, $email);\n\t\t$checkEmail = mysqli_query($this->db, \"SELECT i_user_email FROM i_users WHERE i_user_email = '$email'\") or die(mysqli_error($this->db));\n\t\tif (mysqli_num_rows($checkEmail) == 1) {\n\t\t\treturn true;\n\t\t} else {return false;}\n\t}", "function email_exists($email,$id='')\n {\n $this->db->where('email', $email);\n if(!empty($id)){\n $this->db->where('id !=', $id);\n }\n $query = $this->db->get('users');\n if( $query->num_rows() > 0 ){ return True; } else { return False; }\n }", "function checkIfUserExist($username, $email) {\n $query = getQuery(\"checkIfUserExist.query\", $username, \"\", $email);\n $result = mysql_query($query);\n\n return (mysql_result($result, 0) >= 1);\n}", "private function existeUsuario($email){ \n\t if (filter_var($email, FILTER_VALIDATE_EMAIL)){ \n\t $query = $this->_conn->prepare(\n\t \t\t\"SELECT email \n\t \t\t from usuario \n\t \t\t WHERE email = :email\");\n\t \t//se le asigna el parámetro \n\t $query->bindValue(\":email\", $email); \n\t $query->execute(); \n\t if ($query->fetch(PDO::FETCH_ASSOC)){\n\t \t\t//solo se retorna true ya que no es necesario recuperar ningun valor de la base de datos\n\t \treturn true; \n\t } \n\t } \n\t else \n\t return false; \n }" ]
[ "0.8646915", "0.82477397", "0.81878406", "0.8106403", "0.80828124", "0.8007472", "0.80041355", "0.7985071", "0.7973582", "0.79314417", "0.79310966", "0.7857776", "0.7855363", "0.78465116", "0.78439546", "0.7839178", "0.7838538", "0.78371876", "0.7826863", "0.7812455", "0.7810327", "0.7790717", "0.7785244", "0.77818316", "0.7773487", "0.7765202", "0.77554226", "0.7753328", "0.775054", "0.77486444", "0.77438504", "0.77297324", "0.7711853", "0.7692393", "0.7685422", "0.76797724", "0.76796687", "0.76741433", "0.76595277", "0.76436293", "0.7637131", "0.76302695", "0.76302046", "0.76252025", "0.7621464", "0.7621062", "0.7619593", "0.76005137", "0.7599944", "0.75889874", "0.7584562", "0.75728077", "0.75722224", "0.75719595", "0.7555266", "0.75544316", "0.7552605", "0.75367844", "0.7535886", "0.75350744", "0.7531375", "0.7529891", "0.75297725", "0.7510415", "0.7509572", "0.74959093", "0.7488008", "0.74871457", "0.74871147", "0.7485309", "0.74685496", "0.7452481", "0.7452196", "0.7449338", "0.7446208", "0.74439347", "0.74372166", "0.74303097", "0.742834", "0.74283034", "0.7415136", "0.7415136", "0.74148095", "0.7413865", "0.7412224", "0.7411077", "0.7397517", "0.7393793", "0.7390845", "0.7389497", "0.73884445", "0.7378394", "0.73754144", "0.7372187", "0.7365482", "0.7360808", "0.73552126", "0.73536247", "0.73512644", "0.734754" ]
0.79360294
9
function is used to check User exist or not By UserName Params required: user_name. return true or false. used within class.
function checkUserByUserName($user_name){ $rec = $this->query("SELECT `id` from `users` where `user_name` = '$user_name' "); if($rec && mysql_num_rows($rec)>0){ //if user with the user_name got found return true; }else{ //if user with the user_name got not found return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function userExists( $user_name ) { return true;}", "public function userExists()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "function is_username_exists($user_name){\n\t\t\t\n\t\t\t$select_data = \"*\"; \n\t\t\t\n\t\t\t$where_data = array(\t// ----------------Array for check data exist ot not\n\t\t\t\t'username' => $user_name\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"userdetails\"; //------------ Select table\n\t\t\t$result = $this->get_table_where( $select_data, $where_data, $table );\n\t\t\t\n\t\t\tif( count($result) > 0 ){ // check if user exist or not\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t }", "function exists ($name)\r\n {\r\n # create encoded_key_string\r\n $encoded_key_string = parent::_encode_key_string(USER_NAME_FIELD_NAME.\"='\".$name.\"'\");\r\n\r\n $record = parent::select_record($encoded_key_string);\r\n if (count($record) > 0)\r\n {\r\n $this->_log->debug(\"user already exists (name=\".$name.\")\");\r\n\r\n return TRUE;\r\n }\r\n else if (strlen($this->get_error_message_str()) == 0)\r\n {\r\n $this->_log->debug(\"user does not exist (name=\".$name.\")\");\r\n\r\n return FALSE;\r\n }\r\n else\r\n return FALSE;\r\n }", "public function existNameUser($user){\t\t\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False;\n\t}", "public static function userExists($userName){\n\n// database instance\n $db = database::getPDOobject();\n\n// query\n// BINARY makes the query case sensitive\n $checkUser = $db->prepare('SELECT `user_name` FROM `users` WHERE BINARY `user_name` = BINARY :userName');\n $checkUser->bindParam(':userName',$userName);\n $checkUser->execute();\n $user = $checkUser->fetchAll();\n\n if (count($user) > 0 ){\n// user exits\n return true;\n }else{\n// user does not exist\n return false;\n }\n }", "public function username_check($user_name)\n {\n session_check();\n $user_id = $this->uri->segment(3);\n $user_id = empty($user_id) ? $this->session->userdata('user_id') : $user_id;\n if($this->uri->segment(2) == 'add' || $this->uri->segment(2) == 'Add')\n $user_id = 0;\n if($this->users_model->isusernameexist($user_name, $user_id))\n {\n $this->form_validation->set_message('username_check', $this->lang->line('validation_username_exist'));\n return FALSE;\n }else\n {\n return TRUE;\n }\n }", "function exists($userName)\n{\n\treturn (bool)$this->getUser($userName);\n}", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "public static function exists($user_name) {\n\t\t$db = db::get_instance();\n\t\t\n\t\t$query = sprintf(\"SELECT * \n\t\t FROM users\n\t\t WHERE `user_name` = '%s'\",\n\t\t $db->db_escape($user_name));\n\t\t\n\t\t$result = $db->db_query($query);\n\t\t \n\t\treturn $db->db_num_rows($result) ? true : false;\n\t}", "private function doesUserExists($name,$log=false){\n\t\treturn ($this->_link->countFieldsLCASE('users',array('name'=>strtolower($name)),$log)>0);\n\t}", "private static function userExists() {\r\n\t\tif (!isset($_GET) || !isset($_GET['userName']))\r\n\t\t\treturn self::jsonError('User name missing from request.');\r\n\r\n\t\t// make sure user name is not already taken\r\n\t\tif (UsersDB::userExists($_GET['userName']))\r\n\t\t\treturn self::jsonResponse(true, true, null, 'User name already exists.');\r\n\r\n\t\treturn self::jsonResponse(true, false, null, 'User name does not exist.');\r\n\t}", "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "public function isusernameexist($user_id=0)\n {\n //session_check();\n $user_name = $this->input->get('username', TRUE);\n if($this->users_model->isusernameexist($user_name, $user_id))\n echo 'false';\n else\n echo 'true'; \n }", "function userExists( $username ) {\n return true;\n }", "public function usrnmCheck($usrName){\n\t\t\t$sql = \"SELECT Username FROM customer WHERE Username = :Username\";\n\t\t\t$query = $this->db->pdo->prepare($sql);\n\t\t\t$query->bindValue(\":Username\", $usrName);\n\t\t\t$query->execute();\n\n\t\t\tif ($query->rowCount() > 0) {\n\t\t\t \treturn true;\n\t\t\t }else{\n\t\t\t \treturn false;\n\t\t\t }\n\t\t}", "function checkuser($user_name)\n\t{\n\t\t$checkid=mysql_query(\"select user_id from registration where user_name='$user_name' or user_id='$user_name'\");\n\t\t\tif(mysql_num_rows($checkid)>0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn true;\n\t}", "static function checkForUserName($user)\n {\n $users = R::getAll('SELECT * FROM user');\n\n foreach ($users as $u) {\n if ($u['name'] == $user) {\n return true;\n }\n }\n\n return false;\n }", "public function _userexists($input) {\n\n\t\t$prepare \t= $this->db->prepare(\"SELECT * FROM `users` WHERE `username` = ?\");\n\t\t$prepare->execute(array(r::post($input)));\n\t\t$result \t= $prepare->fetch();\n\n\t\tif(!empty($result)) {\n\t\t\treturn true;\n\t\t}\n\t}", "function exists($user_query){\n\t\t\n\t\t//CALL MEMBER FUNCTION QUERY OF THE CURRENT OBJECT\n\t\t$result = $this->query(\"Select username from users where username='\".$user_query.\"'\");\n\t\t\n\t\t//COUNT RESULTS FROM QUERY\n\t\t$count = mysqli_num_rows($result);\n\n\t\t//IF COUNT HAS COUNTED ONE OR MORE RESULTS, RETURN FALSE BECAUSE EMAIL/USER IS ALREADY REGISTERED!\n\t\tif($count>0){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function checkUserNameExist()\n {\n $collection = new AjaxModel();\n\n if ($collection->CheckUserName($_POST['username'])) {\n echo \"true\";\n } else {\n echo \"false\";\n }\n }", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "function userExists(){\n\t\t//assume user is not in system\n\t\t$exists = false;\n\t\ttry{//try to est connection to db \n\t\t\t$user_db = new SQLite3('users.db');\n\t\t}catch(Exception $ex){ //if cannot catch exception \n\t\t\techo $ex->getMessage(); \n\t\t}\n\t\t//query for all usernames\n\t\t$statement = 'SELECT Username FROM users;';\n\t\t$run = $user_db->query($statement); \n\n\t\tif($run){//if not error in query \n\t\t\twhile($row = $run->fetchArray()){//while there are still rows to parse\n\t\t\t\tif(trim($row['Username']) === trim($_POST['name'])){//if provided user name matches one in db\n\t\t\t\t\t//user exists\n\t\t\t\t\t$exists = true;\n\t\t\t\t\t//break out of loop\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//close connection to db\n\t\t$user_db->close(); \n\t\treturn $exists;\n\t}", "public function hasUser();", "private function check_user_exists($user_name, $user_email)\n {\n $user_id = email_exists( $user_email );\n if($user_id) {\n // $user_id = $this->check_user_reporter($user_id);\n return $user_id;\n }\n\n $user_id = username_exists( $user_name );\n if($user_id) {\n // $user_id = $this->check_user_reporter($user_id);\n return $user_id;\n }\n\n return false;\n }", "function _user_exists($username)\n {\n $this->where('username', $username);\n $user = $this->get('users');\n //return true/false\n if ($user)\n {\n return true;\n } else {\n return false;\n }\n }", "public function userExist( $data = [] ) {\n\t\tif( $this->where(\"username\", $data[\"user\"])->exist() ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function username_exist($user){\n\t\t$db = new mysql();\n\t\t$query = \"SELECT*FROM user WHERE username='$user'\";\n\t\t$x = $db->numofrows($query);\n\t\tif($x > 0){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkUser($userName) {\n \n $db = new Database();\n \n $conn = $db->getConnection();\n \n $result = mysqli_query($conn, \"SELECT * FROM `users` WHERE USER_NAME LIKE '\" . $userName . \"'\");\n \n if(mysqli_num_rows($result) == 0) {\n $conn->close();\n return false;\n }\n else {\n $conn->close();\n return true;\n }\n }", "function checkUserExists($username){\n\treturn false;\n}", "public static function isUser($uname){\n //select statement for pulling user name\n $db = getDatabaseConnection();\n $sql = \"SELECT username FROM registered_user WHERE username ='$uname'\";\n $val = $db->prepare($sql);\n $val->execute();\n $shoop = $val->fetch();\n //echo $sql;\n //var_dump($shoop);\n if($uname == $shoop['username']){\n //echo \"hit\";\n return true;\n }\n else\n {\n return false;\n }\n }", "function doesUserExist($user) {\r\n global $dbaseUserData, $leagueID, $dbase;\r\n\r\n\r\n $query = \"SELECT username from $dbaseUserData where lid='$leagueID' and username=\\\"$user\\\"\";\r\n $result = $dbase->query($query);\r\n\r\n if ($result == FALSE) {\r\n ErrorNotify(\"Query Failed : $query\");\r\n CloseConnection($link);\r\n return TRUE;\r\n }\r\n \r\n // If we get >0 rows, the username already exists.\r\n $numrows = mysql_num_rows($result);\r\n\r\n if ($numrows == 0) {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n}", "public function check_user()\n {\n $res = $this->CustomModel->checkUser(\n $this->input->get('index_no')\n );\n\n if (!$res) {\n echo 'not exists';\n }\n }", "public function userExists()\n {\n $action = __NAMESPACE__ . '\\actions\\UserExists';\n\n $result = $this->actionController->executeAction($action);\n $content = ($result->getSuccess()) ?: 'That Username Does Not Exist';\n\n $result->setContent($content)\n ->Render();\n }", "function user_exist($uname)\n {\n $this->removeOldTemps();\n \n $res = $this->query(\"SELECT * FROM `{$this->userTable}` WHERE `{$this->tbFields1['email']}` = '\".$uname.\"'\");\n $res2 = $this->query(\"SELECT * FROM `{$this->userTempTable}` WHERE `{$this->tbTmpFields['email']}` = '\".$uname.\"'\"); \n \n if((!$res && !$res2) || (mysql_num_rows($res) == 0 && mysql_num_rows($res2) == 0)){ // no records \n return false;\n }\n return true; \n }", "function user_exists()\n\t{\t\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "function checkUser(){\n\t\t// Check for request forgeries\n\t\tJSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));\n\t\n\t\t$app \t = JFactory::getApplication();\n\t\t$db \t = JFactory::getDbo();\n\t\t$inputstr = $app->input->get('inputstr', '', 'string');\n\t\t$name \t = $app->input->get('name', '', 'string');\n\t\n\t\tif($name == 'username'){\n\t\t\t$query \t = \"SELECT COUNT(*) FROM #__users WHERE username=\".$db->quote($inputstr);\n\t\t\t$msg = 'COM_JBLANCE_USERNAME_EXISTS';\n\t\t}\n\t\telseif($name == 'email'){\n\t\t\t$query \t = \"SELECT COUNT(*) FROM #__users WHERE email=\".$db->quote($inputstr);\n\t\t\t$msg = 'COM_JBLANCE_EMAIL_EXISTS';\n\t\t}\n\t\n\t\t$db->setQuery($query);\n\t\tif($db->loadResult()){\n\t\t\techo JText::sprintf($msg, $inputstr);\n\t\t}\n\t\telse {\n\t\t\techo 'OK';\n\t\t}\n\t\texit;\n\t}", "function usernameExists($user_name) {\n return valueExists('users', 'user_name', $user_name);\n}", "public function hasUsername() : bool;", "public function usernameExists() {\n\t\tif(!check($this->_username)) return;\n\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_USERNM_.\" FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = ?\", array($this->_username));\n\t\tif(!is_array($result)) return;\n\t\treturn true;\n\t}", "public function CheckIfUserExists($name){\n\t\t\tif(is_string($name) === false){\n\t\t\t\tthrow new InvalidArgumentException('Name should be a string');\n\t\t\t}\n\t\t\treturn $this->makeCallToAPI('CheckIfUserExists', true, array('Name'=>$name), array('Verified'=>array('boolean'=>array())))->Verified;\n\t\t}", "function userExists($username) {\r\n\t\treturn username_exists($username);\r\n\t}", "public function userExists($user) {\n $user = $this->connection->escape_string($user);\n\n $result = $this->query(\"SELECT user FROM Users U where U.user='$user'\");\n\n return ($result->num_rows > 0);\n }", "private function checkUsernameExist(){\n $base = new ConnexionDb();\n\n $req = $base->query(\n \"SELECT u.username FROM user as u WHERE u.username = :username\",\n array(\n array('username',$_POST['username'],\\PDO::PARAM_STR)\n )\n );\n\n if(isset($req[0]->username)){\n return true;\n }else{\n return false;\n }\n }", "function existsUser($user){\n $users = array();\n $table = $this->getTableConstant();\n $query_selectUser = \"SELECT * FROM $table WHERE user=?\";\n $statement = $this->connection->prepare($query_selectUser);\n $statement->bind_param('s', $user);\n $statement->execute();\n $result = $statement->get_result();\n while($result->fetch_assoc()){\n return true;\n }\n return false;\n }", "public function userExists($userId) {\n\t\t$sql = \"select userName from user where userName = ? LIMIT 1\";\n\t\t$result = $this->executeQuery($sql, array($userId));\n\t\treturn count($result) == 1; \n\t}", "function name_exists($name){\n\t\t\t\n\t\t\t//var_dump($name);\n\t\t\tglobal $wpdb;\n\t\t\t$table = $wpdb->prefix.'users' ;\n\t\t\t$user_id = $wpdb->get_var( \"SELECT ID FROM $table WHERE user_login='$name'\" ) ;\n\t\t\t\n\t\t\t//return ($user_id) ? false: true ;\n\t\t\treturn $user_id ;\n\t\t}", "function userExist($user){\n\t\tglobal $db;\n\t\t$sql= \"SELECT username from users where username = '\". $user .\"'\";\n\t\t$result =$db->query($sql);\n\t\n\t\tif($result->num_rows>0)\n\t\t\treturn 'This username already exists.';\n\t\telse if($user ==\"\")\n\t\t\treturn 'Please enter a username.';\n\t\telse\n\t\t\treturn '';\n\t}", "function UserNameExists($username) {\n\n\t$result = DBRead('usuarios', $params = 'username', $fields = 'username');\n\n\t$query = \"SELECT username FROM usuarios WHERE username = '$username'\";\n\t$result = DBExecute($query);\n\n\tif (mysqli_num_rows($result) <= 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function User_Exists($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT XU.ID FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return true;\n\t\telse \n\t\t{\n\t\t\tif (j::$Session->UserExists($UserIDorUsername)) return 2;\n\t\t\treturn false;\n\t\t}\n\t}", "public function userExists(){\r\n\t\t$bool = false ;\r\n\t\t$pseudo = addslashes($this -> getPseudo()) ;\r\n\t\t$r = execute(\"select count(User_pseudo) as nb from UserTab where User_pseudo='\".$pseudo.\"'\");\t\r\n\t\twhile($l = mysql_fetch_assoc($r)){\r\n\t\t\tif($l['nb'] > 0)\r\n\t\t\t\t$bool = true ;\r\n\t\t}\t\t\r\n\t\r\n\t\treturn $bool ;\r\n\t }", "public function checkUserExists($username){\n require_once('../app/Core/Database.php');\n $db = new Database();\n $conn = $db->setConnection();\n if($conn !== null){\n $stmt = $conn->query(\"SELECT username FROM user where username='\".$username.\"'\");\n if($stmt->fetch(PDO::FETCH_ASSOC)==true){\n return true;\n }\n else{\n return false;\n }\n }\n }", "function isUserExist($username)\n {\n $allUsers = $this->data->getAllUsers();\n while ($user = $allUsers->fetch_assoc())\n {\n if ($user['Username'] == $username)\n {\n return true;\n }\n }\n return false;\n }", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function name_exists($name){\n\t\t$query = $this->db->prepare(\"SELECT count(`user_login`) FROM `nw_users` WHERE `user_login` = ?\");\n\t\t$query->bindValue(1, $name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$rows = $query->fetchColumn();\n\n\t\t\tif($rows == 1){\n\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "function userExists($username){\r\n $sql = \"SELECT username FROM users WHERE username = '$username'\";\r\n $count = $this->q()->num_rows;\r\n if ($count > 0 ){ return true; } else{ return false; }\r\n }", "public function check_user_exist($con,$username) {\n $query = \"SELECT * FROM user WHERE username = '$username'\";\n $result = mysqli_query($con, $query);\n $count = mysqli_num_rows($result);\n if ($count > 0) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "function checkUserName()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $user,$utf8;\r\n\t// --------- CHECK ---------\r\n\t$name = $utf8->toUTF8(GET_INC('name'));\r\n\tif ( $user->uname_exist($name) )\r\n\t{\r\n\t\techo 1;\r\n\t}else{\r\n\t\techo 0;\r\n\t}\r\n}", "function check_user($user)\n\t\t{\n\n\t\t}", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}", "function checkUsernameExists($pSql, $pUser) {\n // Look up in db\n $stmt = $pSql->prepare(\"SELECT * FROM user WHERE user = ?\");\n $stmt->bind_param('s', $pUser);\n $stmt->execute();\n $results = $stmt->get_result();\n $stmt->close();\n\n // Check results\n return ($results->num_rows != 0);\n }", "public function checkUsername() {\r\n if (isset($this->data[$this->name]['id'])) {\r\n $condition = array(\r\n \"conditions\" => array(\r\n \"id !=\" => $this->data[$this->name]['id'],\r\n \"Username\" => $this->data[$this->name]['Username'],\r\n ),\r\n \"limit\" => 1,\r\n );\r\n } else {\r\n $condition = array(\r\n \"conditions\" => array(\r\n \"Username\" => $this->data[$this->name]['Username'],\r\n ),\r\n \"limit\" => 1,\r\n );\r\n }\r\n\r\n $this->find(\"first\", $condition);\r\n $count = $this->getNumRows();\r\n if ($count > 0) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "function login_name(){\n\t\tif(isset($_POST[\"user_name\"])){\n\t\t\t$user_name=$_POST[\"user_name\"];\n\t\t\t$valid='TRUE';\n\t\t\t$data[\"check_name\"]=$this->db->query(\"SELECT * FROM user_account WHERE user_name='$user_name'\"); \n\t\t\tif($data[\"check_name\"]->num_rows() > 0){\n \t\t\techo \"true\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"false\";\n\t\t\t}\n\t\t}\n\t}", "function getUserExists($username)\n\t{\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"filter\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"portal_name\" => array( '$equals' => $username,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name\",\n\t\t\t);\n\n\t\t\t$url = $this->url.\"/Contacts/filter\";\n\n\t\t\t$response = self::call($url, $this->token, 'POST', $filter_arguments);\n\n\t\t\t$isUser = $response->records[0]->portal_name;\n\n\t\t\tif($isUser == $username)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function usernameExists($username)\r\n{\r\n\tglobal $db,$db_table_prefix;\r\n\r\n \tif(returns_result(\"SELECT Active FROM \".$db_table_prefix.\"Users WHERE Username_Clean = '\".$db->sql_escape(sanitize($username)).\"' LIMIT 1\") > 0)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "public function check_user_exists($user)\n\t{\n\n\t\t$result = $this->db->query(\"SELECT cli_nome FROM ms_clientes WHERE cli_nome='$user'\");\n\t\tif($result->rowCount() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t}", "public function isUsernameExist($username){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Username = '$username'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "public function userExist(User $user):bool\n {\n // SQL request\n $sql = \" SELECT COUNT(*) AS user FROM user WHERE email = :email\";\n\n // Preparing the sql query\n $requete = $this->DB->prepare($sql);\n\n // Associates a value with the email parameter\n $requete->bindValue(':email', $user->getEmail(), \\PDO::PARAM_STR);\n\n // Execute the sql query\n $requete->execute();\n\n // Retrieves information\n $reponse = $requete->fetch();\n\n // If there is a record, we return true\n if ($reponse['user'] == 1) {\n return true;\n }\n // else\n return false;\n }", "public function existUser($user,$pwd){\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"' and \n\t\tpassword='\".$pwd.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False; \n\t}", "public function ifExists(User $user)\n {\n $req = $this->db->prepare('SELECT * FROM tbl_user WHERE Email = :email');\n $req->bindValue(':email',$user->getEmail());\n $req->execute();\n\n if($req->fetch())\n return true;\n else\n return false;\n }", "function dbUserExists($unm)\n{\n\t$result = false;\n\t$sql = \"SELECT username FROM _account WHERE username = '$unm'\";\n\ttry {\n\t\t$stmt = Database :: prepare ( $sql );\n\t\t$stmt->execute();\n\t\t$count = $stmt -> rowCount();\n\t\tif ($count > 0) {\n\t\t\t$result = true; //Username already taken\n\t\t}\n\t\t$stmt->closeCursor ( ) ;\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n\treturn $result;\n}", "public function isReg($userName){\r\n try{\r\n $stmt = $this->query(\"SELECT 1 FROM users WHERE username = :username\");\r\n $stmt->bindParam(\":username\", $userName, PDO::PARAM_STR);\r\n $stmt->execute();\r\n if($stmt->rowCount() == 1)\r\n return true;\r\n else\r\n return false;\r\n }\r\n catch(PDOException $exception){\r\n echo (\"is registered ERROR: \" . $exception->getMessage());\r\n }\r\n }", "public function _userntexists($input) {\n\n\t\t$prepare \t= $this->db->prepare(\"SELECT * FROM `users` WHERE `username` = ?\");\n\t\t$prepare->execute(array(r::post($input)));\n\t\t$result \t= $prepare->fetch();\n\n\t\tif(empty($result)) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function Check_UserName($uname)\n\t\t{\n\t\t\tglobal $connection;\n\t\t\t$sql = \"call users_check_username('$uname')\";\n\t\t\t$connection->next_result();\n\t\t\tif($retrieved = $connection->query($sql))\n\t\t\t{\n\t\t\t\tif($retrieved->num_rows)\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "private function checkUserExists($username) {\n\n $result = $this->databaseHandler->select(self::TABLE, 'name = \"' . $username . '\"');\n\n if (empty($result)\n || !isset($result)\n || $result == false\n || $result == 0) {\n return false;\n } else {\n return true;\n }\n\n }", "public function checkUsernameExists(){\r\n\t\t\t$objDBConn = DBManager::getInstance();\r\n\t\t\tif($objDBConn->dbConnect()){\r\n\t\t\t\t//echo \"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"'\";\r\n\t\t\t\t$result = mysql_query(\"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"' LIMIT 1\");\r\n\t\t\t\t$count= mysql_num_rows($result);\r\n\t\t\t\tif($count==0){\r\n\t\t\t\t\t//Username is available\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\t//return true;\r\n\t\t\t\t\techo $count;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//Username already taken.\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\t//return false;\r\n\t\t\t\t\techo $count;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t//echo 'Something went wrong ! ';\r\n\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t//return false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function userExists($username, $name, $email) {\n $dbo =& JFactory::getDBO();\n $query = 'SELECT id FROM #__users ' .\n 'WHERE username = ' . $dbo->quote($username) . ' ' .\n 'AND name = ' . $dbo->quote($name) . ' ' .\n 'AND email = ' . $dbo->quote($email);\n \n $dbo->setQuery($query);\n // Checking subscription existence\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0];\n return $user->id;\n }\n }\n return false;\n }", "public function checkUser(){\n \n $user = $this->request->data[\"user\"];\n \n $result = $this->User->find(\"first\",array(\n 'conditions' => array(\n 'user' => $user\n )\n ));\n \n $result = array_filter($result);\n \n echo !empty($result) ? true : false;\n \n $this->autoRender = false;\n \n \n }", "public function Exists($userName)\r\n {\r\n $queryUserExists = \"SELECT * FROM users WHERE user_name=:user_name\";\r\n $userExists = $this->sqlDataBase->prepare($queryUserExists);\r\n $userExists->execute(array(':user_name'=>$userName));\r\n $userExistsArr = $userExists->fetch(PDO::FETCH_ASSOC);\r\n\r\n if(count($userExistsArr))\r\n {\r\n return $userExistsArr['user_id'];\r\n }\r\n\r\n return false;\r\n }", "public function isUserExisting($username){\n\t\t$sqlQuery = \"SELECT count(*) as isExisting \";\n\n\t\t$sqlQuery .= \"FROM user_table \";\n\n\t\t$sqlQuery .= \"WHERE user_name='$username' \";\t\t\n\t\t//Calls the method from the DAOFactory and passes in the query to be execute, and the result is stored\n\t\t$result = $this->getDbManager()->executeSelectQuery($sqlQuery);\n\t\t\n\t\tif ($result[0][\"isExisting\"] == 1) return (true);\n\n\t\telse return (false);\n\t}", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "function getUserExistsOrNot() \n{\n\t$username = $_POST['username'];\t\n\t$query = \"SELECT id FROM users WHERE username='\".$username.\"'\";\n\t$result = mysql_query($query) or die(\"Failed to fetch data: \".mysql_error());\n\t\n\tif(!mysql_num_rows($result)) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\t\n}", "private function Check_If_User_Exists($query){\r\n\r\n // Send query into server\r\n $this->_db->get_Row($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "private function checkUser()\n {\n $session = $this->di->get(\"session\");\n\n if (!$session->get(\"activeUser\") && !$session->get(\"username\")) {\n return $this->di->response->redirect(\"user/login\");\n }\n }", "public function userexists($username='') {\r\n\t\t$users = $this->db\r\n\t\t\t->where('username', $username)\r\n\t\t\t->get($this->user_table)\r\n\t\t\t->num_rows();\r\n\t\tif ($users > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function User_x_Exists($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT jfp_xuser.ID FROM jfp_xuser AS XU JOIN jf_users ON (jf_users.ID=jfp_xuser.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return true;\n\t\telse return false;\n\t}", "public function existUser($params)\r\n {\r\n if (!empty($this->getAll($params))) {\r\n return True;\r\n } else {\r\n return False;\r\n }\r\n }", "private function isUsernameAvailable($user) {\n $connect = $this->dc->connect();\n $username = $user->getUsername();\n \n $records = $connect->prepare('SELECT id,username,password FROM users WHERE username = :username');\n $records->bindParam(':username', $username);\n $records->execute();\n $results = $records->fetch(\\PDO::FETCH_ASSOC);\n\n return !$results;\n }", "function isUserExistsByUsername($username) {\n $query = \"select * from user_profile_details WHERE username='{$username}' \";\n $result_set = mysql_query($query);\n\tif(isQuerySuccess($result_set)){\n\t\tif (mysql_num_rows($result_set) > 0) { \n\t\t\treturn true;\n\t\t} else { \n\t\t\treturn false;\n\t\t}\t\n\t} \n}", "public function UserNameExists($username, $id=NULL){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->addInCondition('user_name', array($username));\n\t\tif($id){\n\t\t\t$criteria->condition .= \" AND user_id != '\".(int)$id.\"' \";\n\t\t}\n\t\t$User = NeUser::model()->count($criteria);\n\t\tif($User>0){\n\t\t\treturn true;\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isUserExist($userId, $userName) {\n\n try {\n\n $q = Doctrine_Query::create()\n ->from('User')\n ->where(\"user_name = ?\", $userName);\n\n $user = $q->fetchArray();\n\n if (is_array($user) && !empty($user)) {\n\n if ($user) {\n\n if ($user[0]['user_id'] == $userId) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n\n\n } catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n }", "function UserNameExistsEdit($username) {\n\t$usernameUser = GetUser('username');\n\n\t$result = DBRead('usuarios', $params = 'username', $fields = 'username');\n\t$query = \"SELECT username FROM usuarios WHERE username = '$username'\";\n\t$result = DBExecute($query);\n\t$resultUsername = mysqli_fetch_assoc($result);\n\t$resultUsername = $resultUsername['username'];\n\n\tif (mysqli_num_rows($result) <= 0 || $usernameUser == $resultUsername)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function usernameExists(){\n\t $query = \"SELECT id, first_name, last_name, password\n\t FROM \" . $this->table_name . \"\n\t WHERE username = ?\n\t LIMIT 0,1\";\n\t \n\t $stmt = $this->conn->prepare( $query );\n\t $this->username=htmlspecialchars(strip_tags($this->username));\n\t $stmt->bindParam(1, $this->username);\n\t \n\t $stmt->execute();\n\t $num = $stmt->rowCount();\n\t \n\t if($num > 0){\n\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t \n\t $this->id = $row['id'];\n\t $this->first_name = $row['first_name'];\n\t $this->last_name = $row['last_name'];\n\t $this->password = $row['password'];\n\t \n\t return true;\n\t }\n\t return false;\n\t}", "function nameExists($newUname){\n\t\tglobal $servername, $username, $dbname, $password, $userid;\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\n\t\t// Check connection\n\t\tif ($conn->connect_error) {\n\t\t die(\"Connection failed: \" . $conn->connect_error);\n\t\t} \n\t\telse {\n\t\t\t$sql = \"SELECT * FROM users WHERE u_username = \\\"\".$newUname.\"\\\";\";\n\t\t\t$result = $conn->query($sql);\n\t\t\tif($result->num_rows > 0){ // if > 0, then obviously this name is taken\n\t\t\t\t$conn->close();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$conn->close();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t}", "static function CheckUsername(User $User)\n {\n $sqlCheckScreen = \"SELECT screen_name from users where screen_name = '$User->UserName'\";\n $CheckScreen = mysqli_query($GLOBALS['con'], $sqlCheckScreen);\n if (mysqli_affected_rows($GLOBALS['con']) === 1)\n {\n return true;\n }\n }", "function isUser($username){\n $results = sqlSelectOne(\"SELECT * FROM users WHERE user_username='$username'\", 'user_username');\n if ($results === null) {\n return false;\n }\n return true;\n}", "public function user_exists() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT user_id FROM `users` WHERE user_id = '$this->user_id'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn ($result->num_rows == 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on method call user_exists because the user id is invalid');\r\n\t\t}\r\n\t}", "public function findUserByName($name){\n $this->db->query('SELECT * FROM subscriber WHERE name = :user_name');\n // Bind value\n $this->db->bind(':user_name', $name);\n \n $row = $this->db->single();\n \n // Check row\n if($this->db->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n }", "function checkUserByUserID($user_id){\n\t\t$rec\t= $this->query(\"SELECT * from `users` where `id` = \".$user_id);\t\t\n\t\tif($rec && mysql_num_rows($rec) == 1){\n\t\t\t//if user with the user_name got found\n\t\t\treturn $rec;\n\t\t}else{\n\t\t\t//if user with the user_name got not found\n\t\t\treturn false;\n\t\t}\n\t}", "public function isUsernameAvailable($username){\n \n $con=Connection::createConnection();\n $result = mysql_query(\"SELECT * FROM user WHERE nickname = '$username'\");\n $flagToReturn=false;\n \n if(mysql_num_rows($result) == 1){\n //already exist\n }else{\n $flagToReturn=true;\n }\n NetDebug::trace($flagToReturn);\n Connection::closeConnection($con);\n return $flagToReturn;\n \n }" ]
[ "0.8987246", "0.84156466", "0.811867", "0.8110338", "0.80471605", "0.7977374", "0.79446906", "0.7928968", "0.7926099", "0.79135585", "0.779491", "0.7770162", "0.76913923", "0.7670861", "0.7659823", "0.76480514", "0.7631853", "0.76238114", "0.76181686", "0.76115304", "0.75775206", "0.7572068", "0.7561291", "0.75274676", "0.7525914", "0.75069124", "0.7501253", "0.7499609", "0.74895906", "0.74658376", "0.74447125", "0.74421406", "0.7419222", "0.7398648", "0.738994", "0.7388907", "0.73809934", "0.73776853", "0.73672354", "0.7356598", "0.73498076", "0.734644", "0.73458695", "0.73453915", "0.73427063", "0.732801", "0.7322078", "0.73207396", "0.7317463", "0.7311037", "0.7306841", "0.7272408", "0.7267826", "0.72625273", "0.7254474", "0.72510004", "0.72449857", "0.72444546", "0.72421324", "0.7230606", "0.7226654", "0.72087777", "0.71988475", "0.71839434", "0.71771616", "0.71745694", "0.7169119", "0.7149256", "0.71413934", "0.71383166", "0.7137015", "0.71324", "0.7124433", "0.7122243", "0.71077913", "0.710125", "0.7096555", "0.70918155", "0.70861053", "0.7080275", "0.70793706", "0.70788705", "0.7078654", "0.7075359", "0.7063193", "0.705366", "0.7048491", "0.7020222", "0.7013049", "0.70115143", "0.7007527", "0.6996452", "0.69906074", "0.6985435", "0.69804174", "0.69794583", "0.6975754", "0.69724476", "0.69710964", "0.69706875" ]
0.8215185
2
function is used to check User exist or not By UserID Params required: user_id. return true or false. used within class.
function checkUserByUserID($user_id){ $rec = $this->query("SELECT * from `users` where `id` = ".$user_id); if($rec && mysql_num_rows($rec) == 1){ //if user with the user_name got found return $rec; }else{ //if user with the user_name got not found return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "public static function checkUser($user_id);", "public function user_check($userId)\n {\n $sql1 = \"SELECT userId FROM users WHERE userId ='\".$userId.\"'\";\n $record = $this->db->query($sql1);\n if ($record->num_rows()>0) {\n return true;\n } \n }", "function User_Exists($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT XU.ID FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return true;\n\t\telse \n\t\t{\n\t\t\tif (j::$Session->UserExists($UserIDorUsername)) return 2;\n\t\t\treturn false;\n\t\t}\n\t}", "function userIdExists($id) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users WHERE id = ?\",array($id));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function userExists( $user_name ) { return true;}", "public function hasUser();", "function User_x_Exists($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT jfp_xuser.ID FROM jfp_xuser AS XU JOIN jf_users ON (jf_users.ID=jfp_xuser.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return true;\n\t\telse return false;\n\t}", "public function isusernameexist($user_id=0)\n {\n //session_check();\n $user_name = $this->input->get('username', TRUE);\n if($this->users_model->isusernameexist($user_name, $user_id))\n echo 'false';\n else\n echo 'true'; \n }", "function user_id_exists($user_id) {\n $db = connectDB();\n $stmt = $db->prepare('\n SELECT\n COUNT(*)\n FROM\n users\n WHERE\n user_id = :user_id\n ;\n ');\n $stmt->execute([':user_id' => $user_id]);\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n // If 0 rows, no such user exists -> false\n // If 1 row, user exists -> true\n return !!($row['COUNT(*)']);\n}", "public function hasUser($id);", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "public function userExists()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "public function is_user_id_existed($user_id)\n {\n $query = $this->db->get_where('users', array('user_id' => $user_id));\n return ($query->num_rows() > 0);\n }", "function check_User($user_id)\n\t{\n\n\tif ($this->Logeo_model->check_User($user_id)) {\n\t\t\t$this->form_validation->set_message('check_User', \"$user_id no Disponible\");\n\t\t\treturn FALSE;\n }\n else\n {\n return TRUE;\n }\n\t}", "public function user_exists() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT user_id FROM `users` WHERE user_id = '$this->user_id'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\treturn ($result->num_rows == 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on method call user_exists because the user id is invalid');\r\n\t\t}\r\n\t}", "function userid_exists($uid = '')\r\n\t{\r\n\t\tif(!is_numeric($uid))\r\n\t\t\treturn false;\r\n\t\t$this->db->where('id', $uid);\r\n\t\t$query = $this->db->get('users');\r\n\t\tif($query->num_rows == 1)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private function doesUserExists($id,$log=false){\n\t\treturn (\n\t\t\tNewDao::getInstance()\n\t\t\t->countFields('users',array('id'=>$id),$log)>0\n\t\t);\n\t}", "function exists($user_query){\n\t\t\n\t\t//CALL MEMBER FUNCTION QUERY OF THE CURRENT OBJECT\n\t\t$result = $this->query(\"Select username from users where username='\".$user_query.\"'\");\n\t\t\n\t\t//COUNT RESULTS FROM QUERY\n\t\t$count = mysqli_num_rows($result);\n\n\t\t//IF COUNT HAS COUNTED ONE OR MORE RESULTS, RETURN FALSE BECAUSE EMAIL/USER IS ALREADY REGISTERED!\n\t\tif($count>0){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function userExists($uid)\r\n {\r\n return $this->UD->userExists($uid);\r\n }", "function user_id_exists($db, $user_id)\n{\n\t$sql = 'SELECT * FROM users where id=:id';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':id'=>$user_id));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "public function isExistuserById($userId) {\n\n $rq = $this->db->prepare('\n SELECT * FROM user WHERE id=:id');\n\n $rq->execute(array(\n 'id' => $userId,\n ));\n \n $isExistuser = $rq->fetchColumn();\n\n return $isExistuser;\n }", "public function userExists($userId){\n $query = \"SELECT * FROM user_details WHERE usr_id = ?\";\n $stmt = $this->conn->prepare($query);\n $stmt->bind_param('d', $userId);\n $stmt->execute();\n $result = $stmt->get_result();\n if($result->num_rows == 0) return 0;\n $row = $result->fetch_assoc();\n return $row['usr_id'];\n }", "public function exists($iduser)\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM tbuser WHERE iduser = $iduser\");\n\n\t\treturn ($query->num_rows() == 1);\n\t}", "function chkExist($user){\n\tglobal $dbLink;\n\t\n\t$sqlChkExist = \"SELECT uid FROM users WHERE uid='$user'\";\n\t\n\t$dbLink->query($sqlChkExist);\n\t$rows = $dbLink->affected_rows;\n\t\n\tif($rows == 1){\n\t\t$ok==0;\n\t}\n\telse{\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user does not exist\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t}\n}", "function checkUserByUserName($user_name){\n\t\t$rec\t= $this->query(\"SELECT `id` from `users` where `user_name` = '$user_name' \");\t\t\n\t\tif($rec && mysql_num_rows($rec)>0){\t\t\n\t\t\t//if user with the user_name got found\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//if user with the user_name got not found\n\t\t\treturn false;\n\t\t}\n\t}", "function isValid( $id_user ) {\n\n\t\treturn true;\n\t}", "public function userExists($user) {\n $user = $this->connection->escape_string($user);\n\n $result = $this->query(\"SELECT user FROM Users U where U.user='$user'\");\n\n return ($result->num_rows > 0);\n }", "function isInvitedUserExist($invited_user)\n {\n $sql=\"SELECT id from user WHERE id = $invited_user\";\n $query = $this->db->query($sql);\n if($query->num_rows()>0)\n { return true;\n }\n else{\n return false;\n }\n }", "public function userExists($userId) {\n\t\t$sql = \"select userName from user where userName = ? LIMIT 1\";\n\t\t$result = $this->executeQuery($sql, array($userId));\n\t\treturn count($result) == 1; \n\t}", "function user_is($id) {\n $query =\"SELECT EXISTS(SELECT id FROM users WHERE id = '$id')\";\n $result = $this->conn->query($query);\n\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n\n $result->data_seek(0);\n if ($result->fetch_array(MYSQLI_NUM)[0]) {\n $result->close();\n return true;\n } else {\n $result->close();\n return false;\n }\n }", "function userExists()\n\t{\n\t\t$uid = mysql_real_escape_string($_POST[\"uid\"]);\n\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM user\n\t\t\tWHERE uid='$uid';\";\n\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\n\t\t$exists = (mysql_numrows($result) == 1) ? true : false;\n\n\t\treturn $exists;\n\t}", "function existsUser($user){\n $users = array();\n $table = $this->getTableConstant();\n $query_selectUser = \"SELECT * FROM $table WHERE user=?\";\n $statement = $this->connection->prepare($query_selectUser);\n $statement->bind_param('s', $user);\n $statement->execute();\n $result = $statement->get_result();\n while($result->fetch_assoc()){\n return true;\n }\n return false;\n }", "private function Check_If_User_Exists($query){\r\n\r\n // Send query into server\r\n $this->_db->get_Row($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "public function existNameUser($user){\t\t\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False;\n\t}", "public function userExists(){\r\n\t\t$bool = false ;\r\n\t\t$pseudo = addslashes($this -> getPseudo()) ;\r\n\t\t$r = execute(\"select count(User_pseudo) as nb from UserTab where User_pseudo='\".$pseudo.\"'\");\t\r\n\t\twhile($l = mysql_fetch_assoc($r)){\r\n\t\t\tif($l['nb'] > 0)\r\n\t\t\t\t$bool = true ;\r\n\t\t}\t\t\r\n\t\r\n\t\treturn $bool ;\r\n\t }", "public function _userexists($input) {\n\n\t\t$prepare \t= $this->db->prepare(\"SELECT * FROM `users` WHERE `username` = ?\");\n\t\t$prepare->execute(array(r::post($input)));\n\t\t$result \t= $prepare->fetch();\n\n\t\tif(!empty($result)) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function existUser($user,$pwd){\n\t\t$query = \"SELECT idUser FROM final_usuario WHERE nick='\".$user.\"' and \n\t\tpassword='\".$pwd.\"'\";\n\t\treturn mysqli_num_rows($this->con->action($query))> 0? True: False; \n\t}", "public function check_user()\n {\n $res = $this->CustomModel->checkUser(\n $this->input->get('index_no')\n );\n\n if (!$res) {\n echo 'not exists';\n }\n }", "public function hasUser($id) {\n if (!Zend_OpenId::normalize($id)) {\n return false;\n }\n return $this->_storage->hasUser($id);\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 hasUserId(){\n return $this->_has(2);\n }", "public function ifExists(User $user)\n {\n $req = $this->db->prepare('SELECT * FROM tbl_user WHERE Email = :email');\n $req->bindValue(':email',$user->getEmail());\n $req->execute();\n\n if($req->fetch())\n return true;\n else\n return false;\n }", "function checkuser($user_name)\n\t{\n\t\t$checkid=mysql_query(\"select user_id from registration where user_name='$user_name' or user_id='$user_name'\");\n\t\t\tif(mysql_num_rows($checkid)>0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn true;\n\t}", "function isUserExist($user_id){\r\n global $pdo;\r\n\r\n $stmt = $pdo->prepare('SELECT * FROM users WHERE UserID = :UserID');\r\n $stmt->bindParam(':UserID', $user_id);\r\n $stmt->execute();\r\n\r\n return $stmt->rowCount();\r\n}", "public function userExist(User $user):bool\n {\n // SQL request\n $sql = \" SELECT COUNT(*) AS user FROM user WHERE email = :email\";\n\n // Preparing the sql query\n $requete = $this->DB->prepare($sql);\n\n // Associates a value with the email parameter\n $requete->bindValue(':email', $user->getEmail(), \\PDO::PARAM_STR);\n\n // Execute the sql query\n $requete->execute();\n\n // Retrieves information\n $reponse = $requete->fetch();\n\n // If there is a record, we return true\n if ($reponse['user'] == 1) {\n return true;\n }\n // else\n return false;\n }", "public function Exists($id)\r\n {\r\n global $db;\r\n if (empty($id)) {\r\n return false;\r\n }\r\n\r\n if (is_numeric($id)) {\r\n $col = \"id\";\r\n } elseif ($this->isEmail($id)) {\r\n $col = \"email\";\r\n } else {\r\n $col = \"username\";\r\n }\r\n $cols = [$col, \"pass\"];\r\n if ($col != \"id\") {\r\n $cols[] = \"id\";\r\n }\r\n $users = $db->select(\"users\", $cols, array(\"$col\" => $id));\r\n if ($users->num_rows != \"1\") {\r\n return false;\r\n }\r\n $this->user = $users->fetch_object();\r\n if (empty($this->current_user)) {\r\n $this->current_user = $this->user->id;\r\n }\r\n return true;\r\n }", "function check_user($user)\n\t\t{\n\n\t\t}", "public function userExist( $data = [] ) {\n\t\tif( $this->where(\"username\", $data[\"user\"])->exist() ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function loaded_user(string $id): bool { return isset($this->users[$id]); }", "public static function isUser($id)\n {\n database::query('SELECT * FROM `#_users` WHERE id = '.(int)$id);\n if(database::num_rows() > 0) {\n return true;\n }\n return false;\n }", "public function existUser($params)\r\n {\r\n if (!empty($this->getAll($params))) {\r\n return True;\r\n } else {\r\n return False;\r\n }\r\n }", "function getUserExistsOrNot() \n{\n\t$username = $_POST['username'];\t\n\t$query = \"SELECT id FROM users WHERE username='\".$username.\"'\";\n\t$result = mysql_query($query) or die(\"Failed to fetch data: \".mysql_error());\n\t\n\tif(!mysql_num_rows($result)) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\t\n}", "function userExists($userId) {\n return getSingleValue(\"SELECT COUNT(`id`) FROM `private_users` WHERE `id` =\" . escape(intval($userId)) . \" LIMIT 0, 1\");\n }", "function userExists($uid)\n\t{\n\t\t$check = $this->DB->database_select('users', 'uid', array('uid' => $uid));\n\t\treturn ($check == 0) ? false : true;\n\t}", "function user_exists($username)\n{\n $query = \"Select user_id\n FROM tblUser\n WHERE username = '$username'\";\n mysql_query ($query) or die ('Error checking user');\n\n $result = mysql_query($query);\n $num_rows = mysql_num_rows($result);\n\n if ($num_rows==1){\n return $row['user_id'];\n }else{\n return False;\n }\n}", "public function checkIdExist($id)\n {\n $response = false;\n\n if(!empty($id)) {\n $user = PmUser::find($id);\n if(isset($user['id'])) {\n $response = true;\n }\n }\n\n return $response;\n }", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function doesUserExist($user) {\r\n global $dbaseUserData, $leagueID, $dbase;\r\n\r\n\r\n $query = \"SELECT username from $dbaseUserData where lid='$leagueID' and username=\\\"$user\\\"\";\r\n $result = $dbase->query($query);\r\n\r\n if ($result == FALSE) {\r\n ErrorNotify(\"Query Failed : $query\");\r\n CloseConnection($link);\r\n return TRUE;\r\n }\r\n \r\n // If we get >0 rows, the username already exists.\r\n $numrows = mysql_num_rows($result);\r\n\r\n if ($numrows == 0) {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n}", "public function any_user_exists(){\n $select_query = \"SELECT `id`, `staff_id`, `unit`, `password`, `cpassword` FROM `register_user` \";\n //check if user exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if user exists \n if(mysqli_num_rows($run_select_query) > 0){\n //check if \n return true;\n }else{\n return false;\n }\n }\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "function userIdExists($id) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT active\n\t\tFROM \" . $db_table_prefix . \"users\n\t\tWHERE\n\t\tid = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}", "private function check_ID($id){\r\n\r\n $query = \"SELECT FROM users WHERE oauth_uid = ?\";\r\n $data = $this->_db->get_Row($query, $id);\r\n\r\n return ($this->_db->count_Rows($data) > 0) ? true : false;\r\n }", "function exists($userName)\n{\n\treturn (bool)$this->getUser($userName);\n}", "public function checkUser(){\n \n $user = $this->request->data[\"user\"];\n \n $result = $this->User->find(\"first\",array(\n 'conditions' => array(\n 'user' => $user\n )\n ));\n \n $result = array_filter($result);\n \n echo !empty($result) ? true : false;\n \n $this->autoRender = false;\n \n \n }", "function _user_exists($username)\n {\n $this->where('username', $username);\n $user = $this->get('users');\n //return true/false\n if ($user)\n {\n return true;\n } else {\n return false;\n }\n }", "public function exist_pg_user($id_user, $pg_name){\n\n\t\t\t$q = new Query();\n\t\t\t$q->tables = array(\"pg_view\");\n\t\t\t$q->fields = array(\"id\");\n\t\t\t$q->filters = \"idUt=\".$id_user.\" and pg_view.Username = '\".$pg_name.\"'\";\n\t\t\t\n\t\t\tif($q->Open()){\n\t\t\t\t$row=$q->GetNextRecord();\t\t\t\t\n\t\t\t\tif(is_array($row)){\n\t\t\t\t\treturn $row[0];\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}", "public function hasUser($user) : bool\n {\n return $this->users->contains('id', is_a($user, user_model()) ? $user->id : $user);\n }", "function checkUser($userId)\r\n{\r\n $userExists=true;\r\n global $DBServer, $DBName, $DBUser, $DBPass;\r\n $conn = new mysqli($DBServer, $DBUser, $DBPass, $DBName);\r\n // check connection\r\n if ($conn->connect_error) {\r\n trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);\r\n exit;\r\n }\r\n $sql = \"SELECT * from users WHERE username LIKE '{$userId}' LIMIT 1\";\r\n $result = $conn->query($sql);\r\n if (!$result->num_rows == 1) {\r\n $userExists=false;\r\n }\r\n $conn->close();\r\n return $userExists;\r\n}", "public function userExists($user) {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_tdddemo_domain_model_user');\n \n $statement = $queryBuilder\n ->select('tx_tdddemo_domain_model_user.*')\n ->from('tx_tdddemo_domain_model_user')\n ->where(\n $queryBuilder->expr()->eq('tx_deskmaadmin_domain_model_company.uid', $user)\n )\n ->execute()\n ->fetch();\n \n if (!empty($statement)) {\n return true;\n }\n \n return false;\n }", "function is_exists($id) {\n $query = \"SELECT\n id\n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of user to be updated\n $stmt->bindParam(1, $id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n return ($stmt->rowCount() > 0);\n }", "public static function exists()\n {\n return Session::get('UserID') != null;\n }", "static public function isUser(){\n if ( isset($_SESSION['id']) && $_SESSION['id'] != 0 ) {\n return true;\n } else {\n return false;\n }\n }", "public function user_exists($staff_id){\n $select_query = \"SELECT `id`, `staff_id`, `unit`, `password`, `cpassword` FROM `register_user` WHERE `staff_id` = '$staff_id'\";\n //check if user exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if user exists \n if(mysqli_num_rows($run_select_query) > 0){\n //check if \n return true;\n// trecho \"hgello\";\n }else{\n return false;\n }\n }\n }", "function can_visit_user($id) {\r\n $sql = \"select id from user where id=?\";\r\n $result = $this->db->query($sql, $id);\r\n if ($result->num_rows() == 1) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}", "public function check_duplicate_user($id, $user_id){\n\t\t$this->loadModel('FinAdvUser');\n\t\t$count = $this->FinAdvUser->find('count', array('conditions' => array('app_users_id' => $user_id, 'fin_advance_id' => $id)));\n\t\tif($count > 0){\t\n\t\t\t$this->invalid_attempt();\n\t\t}\n\t}", "function user_exists()\n\t{\t\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function isUserIdExist($uid){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE uid = ?\");\n $stmt->bind_param(\"s\",$uid);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "public function verify_user($user){\n\t$conexion = mysqli_connect(\"localhost\", \"root\",\"\")\n\tor die(\"No se ha podido conectar\");\n\tmysqli_select_db($conexion, \"codeigniter\")\n\tor die(\"No se ha podido seleccionar la base de datos.\");\n\t$consulta = mysqli_query($conexion, \"SELECT * FROM usuario WHERE\n\tusuario='\".$user.\"'\");\n\t$filas = mysqli_num_rows($consulta);\n\tif($filas == 0){ //el usuario no existe\n\treturn false;\n\t}else{ //el usuario existe\n\treturn true;\n\t}\n}", "public function user_exists($staff_id){\n $select_query = \"SELECT `id`, `staff_id`, `unit`, `password`, `cpassword` FROM `register_user` WHERE `staff_id` = '$staff_id'\";\n //check if user exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if user already exists \n if(mysqli_num_rows($run_select_query) == 0){\n //check if \n return false;\n }else{\n return true;\n }\n }\n }", "public function user_exists($staff_id){\n $select_query = \"SELECT `id`, `staff_id`, `unit`, `password`, `cpassword` FROM `register_user` WHERE `staff_id` = '$staff_id'\";\n //check if user exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if user exists \n if(mysqli_num_rows($run_select_query) > 0){\n //check if \n return true;\n }else{\n return false;\n }\n }\n }", "function username_exists($username,$id='')\n {\n $this->db->where('username', $username);\n if(!empty($id)){\n $this->db->where('id !=', $id);\n }\n $query = $this->db->get('users');\n if( $query->num_rows() > 0 ){ return True; } else { return False; }\n }", "function check_username_userid($username,$userid){\n\t\t\t$this->db->select('userid');\n\t\t\t$this->db->where('userid', $userid);\n\t\t\t$this->db->where('username', $username);\n\t\t\t$query = $this->db->get('user');\n\t\t\tif(count($query->result())){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function userExists()\r\n {\r\n $sql = \"SELECT COUNT(*) FROM (SELECT * FROM doctors WHERE email = :email) AS subquery\";\r\n\r\n $query = $this->db_connection->prepare($sql);\r\n $query->bindValue(':email', $this->email);\r\n $query->execute();\r\n\r\n while($result_row = $query->fetch() ){\r\n if($result_row[0] == 1) return true;\r\n else return false;\r\n }\r\n\r\n return false; \r\n }", "function checkAction($id)\n\t{\n\t\t$check = $this->DB->database_select('users', 'uid', array('username' => session_get('username'), 'uid' => $id), 1);\n\t\treturn ($check != 0);\n\t}", "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 userExists( $username ) {\n return true;\n }", "public function check_user_exists( $user, $usertbl='facebook' )\n {\n self::get_db_instance();\n \n // Determine which table we're checking\n $table = ($usertbl === 'facebook' ? 'facebook_users':'user');\n \n // Determine the correct \"where\" statement\n $where = ($usertbl === 'facebook' ? \"uid='{$user}'\" : \"username='{$user}'\");\n \n if( !$result = self::db_select_one($table, $where) ) \n {\n return false;\n } \n else \n {\n if( $usertbl === 'facebook' ) \n { \n self::$uid = $result['uid'];\n self::$wolf_uid = $result['wolf_uid']; \n }\n return true;\n }\n }", "public function check_user_exists($user)\n\t{\n\n\t\t$result = $this->db->query(\"SELECT cli_nome FROM ms_clientes WHERE cli_nome='$user'\");\n\t\tif($result->rowCount() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t}", "public function verifyUser($arrData) \n\t\t{\n\t\t\t\tif (array_key_exists(\"idUser\", $arrData)) {\n\t\t\t\t\t$this->db->where('id_user !=', $arrData[\"idUser\"]);\n\t\t\t\t}\t\t\t\n\n\t\t\t\t$this->db->where($arrData[\"column\"], $arrData[\"value\"]);\n\t\t\t\t$query = $this->db->get(\"user\");\n\n\t\t\t\tif ($query->num_rows() >= 1) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else{ return false; }\n\t\t}", "public function username_check($user_name)\n {\n session_check();\n $user_id = $this->uri->segment(3);\n $user_id = empty($user_id) ? $this->session->userdata('user_id') : $user_id;\n if($this->uri->segment(2) == 'add' || $this->uri->segment(2) == 'Add')\n $user_id = 0;\n if($this->users_model->isusernameexist($user_name, $user_id))\n {\n $this->form_validation->set_message('username_check', $this->lang->line('validation_username_exist'));\n return FALSE;\n }else\n {\n return TRUE;\n }\n }", "function is_username_exists($user_name){\n\t\t\t\n\t\t\t$select_data = \"*\"; \n\t\t\t\n\t\t\t$where_data = array(\t// ----------------Array for check data exist ot not\n\t\t\t\t'username' => $user_name\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"userdetails\"; //------------ Select table\n\t\t\t$result = $this->get_table_where( $select_data, $where_data, $table );\n\t\t\t\n\t\t\tif( count($result) > 0 ){ // check if user exist or not\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t }", "function isUserExist($con,$androidId,$username,$email){\n\t$sql = \"SELECT * FROM `access`,`owner` WHERE owner.email = access.email AND owner.android_id = '\".$androidId.\"' AND owner.email='\".$email.\"' AND access.username='\".$username.\"' AND access.enable = 'Y'\";\n\n\t$result = mysqli_query($con,$sql);\n\t$value = @mysqli_num_rows($result);\n\n\tif ($value){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public static function exists($user_name) {\n\t\t$db = db::get_instance();\n\t\t\n\t\t$query = sprintf(\"SELECT * \n\t\t FROM users\n\t\t WHERE `user_name` = '%s'\",\n\t\t $db->db_escape($user_name));\n\t\t\n\t\t$result = $db->db_query($query);\n\t\t \n\t\treturn $db->db_num_rows($result) ? true : false;\n\t}", "public function admin_func_check_user($params, $vars) {\n if ( ! empty($vars['username']) || ! empty($vars['email']) ) {\n $is_available = 1;\n $user_id = empty($vars['user_id']) ? false : $vars['user_id'];\n if ( ! empty($vars['username']) ) {\n $username = $vars['username'];\n if ( $this->model->is_user($username, $user_id) || $this->model->is_super($username) ) {\n $is_available = 0;\n }\n } else {\n $email = trim( strtolower($vars['email']) );\n if ( $this->model->email_exists($email, $user_id) ) {\n $is_available = 0;\n }\n }\n return $is_available;\n }\n }" ]
[ "0.8153765", "0.81507945", "0.81420386", "0.8043655", "0.80211204", "0.7995807", "0.79812294", "0.78201056", "0.78151596", "0.7765341", "0.77622575", "0.77563715", "0.7737876", "0.770566", "0.76796275", "0.76281714", "0.7627959", "0.7605623", "0.7599155", "0.75728184", "0.7558965", "0.7549466", "0.7525929", "0.7512606", "0.7511823", "0.74982834", "0.7497677", "0.7483135", "0.7468605", "0.74523073", "0.7442372", "0.7439941", "0.74375784", "0.74356824", "0.74253607", "0.7423676", "0.74215865", "0.7407026", "0.7386973", "0.7382148", "0.73492616", "0.73423886", "0.73423886", "0.73423886", "0.73423886", "0.73423886", "0.7338079", "0.7331155", "0.7326641", "0.7322589", "0.73200285", "0.7314378", "0.7313868", "0.7309525", "0.7307557", "0.73067826", "0.73063403", "0.72888404", "0.7270498", "0.7261349", "0.7250954", "0.7243693", "0.7237398", "0.7235694", "0.72181773", "0.7213888", "0.7213284", "0.72054094", "0.71978134", "0.71950245", "0.71778125", "0.71741736", "0.71621543", "0.7157564", "0.7157247", "0.71520805", "0.71500653", "0.7147316", "0.7146009", "0.71329755", "0.71301025", "0.712", "0.7107873", "0.7102846", "0.70991886", "0.70965093", "0.70918673", "0.70835334", "0.70748615", "0.7074217", "0.7074114", "0.7060551", "0.70564634", "0.7055523", "0.70410144", "0.7040791", "0.7034692", "0.70264673", "0.7026201", "0.6990853" ]
0.80534756
3
function is used to login Params required: user_name,password. return status, message and user_id
function userLogin($data){ //die($data); $response = array(); $requiredData['user_name'] = @trim($data->user_name); $requiredData['password'] = @trim($data->password); foreach($requiredData AS $key=>$val){ if(trim($val) == ''){ $response['status'] = 'Error'; $response['message'] = 'Please Specify '.ucwords(str_replace("_"," ",$key)); return $response; } } $rec = $this->query("SELECT `id`, `user_name`, `password`, `user_type`, `status`, `token` from `users` where `user_name` = '".$requiredData['user_name']."' "); if($rec && mysql_num_rows($rec)== 1){ $user_info = mysql_fetch_object($rec); if($requiredData['user_name'] == $user_info->user_name && $requiredData['password'] == $this->getPassword($user_info->password)){ $response['status'] = 'Success'; $response['message'] = 'User login Successfully'; $response['user_id'] = $user_info->id; $response['user_name'] = $user_info->user_name; $response['user_type'] = 1; return $response; }elseif($requiredData['user_type'] == $user_info->user_type){ $response['status'] = 'Error'; $response['message'] = 'Sorry! You cannot access another account'; return $response; }else{ $response['status'] = 'Error'; $response['message'] = 'Invalid user name or password. Please try again'; return $response; } }else{ $response['status'] = 'Error'; $response['message'] = 'Invalid user name or password. Please try again'; return $response; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "function login()\n {\n \t \t$data = file_get_contents('php://input');\n \t\t$this->logservice->log($this->module_name, \"DEBUG\",\"EVENT\",$this->IP,\"$data \");\n\t\t$busData = json_decode($data ,true);\n\t\t//查找该用户名与密码\n\t\t$criteria = array();\n\t\t$criteria[\"and\"] = array(\"Name\" => $busData[\"name\"],\"Password\" => $busData[\"password\"]);\n\t\t$userDat = $this->User->read($criteria);\n\t\tif (!empty($userDat)) {\n\t\t\t\t\n\t\t\t//更新用户的状态\n\t\t\t$data_in = array('Status' => 1);\n \t\t$upd_criteria['and'] = array('User_Id' => $userDat[0]['User_Id']);\n \t\t$result = $this->User->update($data_in, $upd_criteria);\n\t \tif($result !== false)\n\t \t{\n\t\t\t\t$rspData[\"userID\"] =$userDat[0][\"User_Id\"];\n\t\t\t\t$rspData[\"state\"] = \"OK\";\n\t\t\t\t$rspData[\"erroInfo\"] = \"登陆成功ID为\".$userDat[0][\"User_Id\"];\n\n\t\t\t\t$rspInfo = json_encode($rspData);\n\t\t\t\techo $rspInfo;\n\t\t }\n\n\t\t}\n }", "public function login_post()\n\t{\n\t\t$name = $this->post('username',true);\n $pass = $this->post('password',true);\n\n $user = $this->db->get_where('user',['username' =>$name])->row_array();\n\n if ($user) \n {\n if (password_verify($pass,$user['password'])) \n {\n $this->response([\n 'error' => false,\n 'message' => 'Login successfull',\n 'user' => $user\n ],200);\n }\n else\n {\n $this->response([\n 'error' => true,\n 'message' => 'Password salah'\n ],200);\n }\n }\n else\n {\n $this->response([\n\n 'error'=>true,\n 'message'=>\"Username dan Password salah\"\n ],200);\n }\n\t}", "public function login()\n {\n $strUsername = !empty($_POST['username']) ? $_POST['username'] : null;\n $strPassword = !empty($_POST['password']) ? $_POST['password'] : null;\n if( is_null($strUsername) || is_null($strPassword) )\n {\n header('HTTP/1.1 422 Unprocessable Entity');\n return ['error' => \"Both a username and a password are required.\"];\n }\n $oRet = $this->oUserModel->checkLogin($strUsername, $strPassword);\n if( $oRet->HasFailure() )\n {\n header('HTTP/1.1 403 Forbidden');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $_SESSION['user_id'] = $oRet->Get();\n $oRet = $this->oUserModel\n ->getUser(['user_id' => $oRet->Get()]);\n if( $oRet->HasFailure() )\n {\n unset($_SESSION['user_id']);\n header('HTTP/1.1 500 Internal Server Error');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $aRet = ['success' => true, 'user' => $oRet->Get()[0]];\n }\n }\n return $aRet;\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "function loginUser($username,$password,$return=true);", "public function login($userName, $password);", "function userLogin()\n\t{\n\t\t$userName = $_POST['userName'];\n\t\t$password = $_POST['userPassword'];\n\t\t$rememberData = $_POST['rememberData'];\n\n\t\t# Verify if the user currently exists in the Database\n\t\t$result = validateUserCredentials($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$decryptedPassword = decryptPassword($result['password']);\n\n\t\t\t# Compare the decrypted password with the one provided by the user\n\t\t \tif ($decryptedPassword === $password)\n\t\t \t{\n\t\t \t$response = array(\"status\" => \"COMPLETE\");\n\n\t\t\t # Starting the sesion\n\t\t \tstartSession($result['fName'], $result['lName'], $userName);\n\n\t\t\t # Setting the cookies\n\t\t\t if ($rememberData)\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"cookieUserName\", $userName);\n\t\t\t \t}\n\t\t\t echo json_encode($response);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdie(json_encode(errors(306)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}", "public function login();", "public function login();", "private function user_login() {\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\tif(!isset($_POST['password']) && !isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email and password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['password'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t\t\t\t\t// Input validations\n\t\t\tif(!empty($email) and !empty($password)) {\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$sql = \"SELECT user_name, user_email, user_phone_no, user_pic, user_address, remember_token\n\t\t\t\t\t\t\t\t\tFROM table_user\n\t\t\t\t\t\t\t\t\tWHERE user_email = '$email'\n\t\t\t\t\t\t\t\t\tAND user_password = '\".$hashed_password.\"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if($stmt->rowCount()=='0') {\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n $this->response($this->json($error), 200);\n }\n\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Sucessfully Login!\", \"data\" => json_encode($results) );\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Fields are required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n\t\t\t$this->response($this->json($error), 200);\n\t\t}", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "public function login()\n\t{\t\n\n\t\t$this->db->select('id, username, password, access');\n\t\t$this->db->where('username', $this->input->post('username', true));\n\t\t$query = $this->db->get('all_users_info', 1);\n\t\tif ($result = $query->first_row()) {\n\t\t\t$pw_check = $this->password_check($this->input->post('password', true), $result->password);\n\t\t\tif ($pw_check) {\n\n\t\t\t\t// check to see if user suspended or not\n\t\t\t\t$result->suspended = $this->is_user_suspended($result->id);\n\t\t\t\tif (!$result->suspended) {\n\t\t\t\t\t$array = array(\n\t\t\t\t\t'set_id' => $result->id,\n\t\t\t\t\t'access_pass' => $result->access,\n\t\t\t\t);\n\t\t\t\t\t$this->session->set_userdata($array);\n\t\t\t\t}\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('msg', 'Username or Password is incorrect');\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t} else {\n\t\t\t$this->session->set_flashdata('msg', 'Username or Password is incorrect');\n\t\t\treturn false;\n\t\t}\n\n\t}", "function login() {\n\n\t\t//$email = $this -> _request['user_email'];\n\t\t$u_password = $this -> _request['user_password'];\n\t\t$password = $this -> _request['user_password'];\n\t\t$login_id = $this -> _request['login_id'];\n\n\t\t// Input validations\n\t\tif (!empty($login_id) && !empty($password)) {\n\t\t\t$mobile = $login_id;\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t$verify_status = $records[0]['user_mobile_verify_status'];\n\t\t\t$mob = $records[0]['user_contact_no'];\n\t\t\t$id_user = $records[0]['user_id'];\n\t\t\tif (!empty($records)) {\n\n\t\t\t\t$records_user = $this -> conn -> get_table_field_doubles('user', 'user_contact_no', $mobile, 'user_password', md5($password));\n\t\t\t\tif (!empty($records_user)) {\n\t\t\t\t\t$status = $records_user[0]['user_status'];\n\t\t\t\t\tif ($status == '1') {\n\t\t\t\t\t\tif ($verify_status == '1') {\n\n\t\t\t\t\t\t\t$pin_status = $records_user[0]['user_pin_status'];\n\t\t\t\t\t\t\t$reffer_code = $records_user[0]['user_refferal_code'];\n\t\t\t\t\t\t\t$user_id = $records_user[0]['user_id'];\n\t\t\t\t\t\t\t$user_mobile = $records_user[0]['user_contact_no'];\n\t\t\t\t\t\t\t$user_email = $records_user[0]['user_email'];\n\t\t\t\t\t\t\t$user_name = $records_user[0]['user_name'];\n\t\t\t\t\t\t\t$wallet_amount = $records_user[0]['wallet_amount'];\n\t\t\t\t\t\t\t$profile_pic = $records_user['0']['user_profile_pic'];\n\t\t\t\t\t\t\t$user_password = $records_user['0']['user_password'];\n\t\t\t\t\t\t\tif (!empty($profile_pic)) {\n\t\t\t\t\t\t\t\t$img = self_img_url . $profile_pic;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$img = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\", 'user_id' => $user_id, 'user_status' => $status, 'user_name' => $user_name, 'wallet_amount' => $wallet_amount, 'user_profile_pic' => $img, 'user_email' => $user_email, 'user_password' => $u_password, 'mobile' => $user_mobile, 'login_type' => 1, 'user_pin_status' => $pin_status, 'refferal_code' => $reffer_code);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$token = $this -> send_code($mob);\n\t\t\t\t\t\t\t$data['user_verified_code'] = $token;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $id_user, $data);\n\t\t\t\t\t\t\t$post = array('status' => \"not_verify\", \"message\" => \"User Mobile verification pending\", 'mobile' => $mob);\n\t\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Account Inactive by admin, please contact to OyaCahrge\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t}\n\t\t\t} elseif (empty($records)) {\n\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_email', $login_id);\n\t\t\t\t$verify_status = $records[0]['user_mobile_verify_status'];\n\t\t\t\t$mob = $records[0]['user_contact_no'];\n\t\t\t\t$id_user = $records[0]['user_id'];\n\t\t\t\tif (!empty($records)) {\n\n\t\t\t\t\t$records_user = $this -> conn -> get_table_field_doubles('user', 'user_email', $login_id, 'user_password', md5($password));\n\t\t\t\t\tif (!empty($records_user)) {\n\t\t\t\t\t\t$status = $records_user[0]['user_status'];\n\t\t\t\t\t\tif ($status == '1') {\n\t\t\t\t\t\t\tif ($verify_status == '1') {\n\n\t\t\t\t\t\t\t\t$pin_status = $records_user[0]['user_pin_status'];\n\t\t\t\t\t\t\t\t$user_id = $records_user[0]['user_id'];\n\t\t\t\t\t\t\t\t$reffer_code = $records_user[0]['user_refferal_code'];\n\t\t\t\t\t\t\t\t$user_name = $records_user[0]['user_name'];\n\t\t\t\t\t\t\t\t$user_mobile = $records_user[0]['user_contact_no'];\n\t\t\t\t\t\t\t\t$wallet_amount = $records_user[0]['wallet_amount'];\n\t\t\t\t\t\t\t\t$profile_pic = $records_user['0']['user_profile_pic'];\n\t\t\t\t\t\t\t\t$user_email = $records_user[0]['user_email'];\n\t\t\t\t\t\t\t\t$user_password = $records_user['0']['user_password'];\n\t\t\t\t\t\t\t\tif (!empty($user_profile_pic)) {\n\t\t\t\t\t\t\t\t\t$img = $path . $user_profile_pic;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$img = 'No image';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\", 'user_id' => $user_id, 'user_status' => $status, 'user_name' => $user_name, 'wallet_amount' => $wallet_amount, 'profile_pic' => $img, 'user_email' => $user_email, 'user_password' => $u_password, 'mobile' => $user_mobile, 'login_type' => 1, 'user_pin_status' => $pin_status, 'refferal_code' => $reffer_code);\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$token = $this -> send_code($mob);\n\t\t\t\t\t\t\t\t$data['user_verified_code'] = $token;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $id_user, $data);\n\t\t\t\t\t\t\t\t$post = array('status' => \"not_verify\", \"message\" => \"User Mobile verification pending\", 'mobile' => $mob);\n\n\t\t\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Account Inactive by admin, please contact to OyaCahrge\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Login ID and Password are Required\", 'login_id' => $login_id, 'user_password' => $user_password);\n\t\t\t// $this->response($this->json($error), 400);\n\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function login() {\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n if (!empty($email) && !empty($pass)) {\n $user = $this->users_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('ERROR');\n }\n $this->event_log();\n return $this->send_response(array(\n 'privatekey' => $user->privatekey,\n 'user_id' => $user->id,\n 'is_coach' => (bool) $this->ion_auth->in_group('coach', $user->id)\n ));\n }\n return $this->send_error('LOGIN_FAIL');\n }", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function doLogin(){\n $rules = array(\n 'userid' => 'required|max:30',\n 'password' => 'required',\n );\n $display = array(\n 'userid' => 'User ID',\n 'password' => 'Password'\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, array(), $display);\n if($validator->fails()) {\n return \\Redirect::back()\n ->withErrors($validator)\n ->withInput(\\Input::all());\n }else{\n $user = User::where('username', '=', \\Input::get('userid'))\n ->first();\n if(isset($user->id)){\n if($user->level < 3) {\n if (\\Hash::check(\\Input::get('password'), $user->password)) {\n \\Session::put('logedin', $user->id);\n \\Session::put('loginLevel', $user->level);\n \\Session::put('nickname', $user->nickname);\n }\n return \\Redirect::nccms('/');\n }else{\n \\Session::flash('error', 'Permission Error.');\n return \\Redirect::nccms('login');\n }\n }else{\n \\Session::flash('error', 'Email/Password Error.');\n return \\Redirect::nccms('login');\n }\n }\n }", "public function loginUser($user,$pwd){\n \n $pwdCr = mkpwd($pwd);\n \n \n \n $sql = new Sql();\n $userData = $sql->select('SELECT * FROM usuarios \n WHERE email_usuario = :email_usuario\n AND pwd_usuario = :pwd_usuario',array(':email_usuario'=>$user,':pwd_usuario'=>$pwdCr));\n \n if(!isSet($userData) || count($userData)==0){//CASO NADA RETORNADO\n return false;\n }elseif(count($userData)>0){//CASO DADOS RETORNADOS CONFERE O STATUS\n \n if($userData[0]['status_usuario']==0){\n \n return 0;//caso INATIVO entao retorna ZERO indicando cadastro NAO ATIVO\n \n }elseif($userData[0]['status_usuario']==1){//CASO USUARIO ATIVO GERA SESSION DO LOGIN\n \n \n //permissao do cliente\n $_SESSION['_uL'] = encode($userData[0]['permissao_usuario']);\n $_SESSION['logado'] = 'sim';\n \n //dados do usuario\n $_SESSION['_iU'] = encode($userData[0]['id_usuario']);\n $_SESSION['_iE'] = encode($userData[0]['id_empresa']);\n $_SESSION['_nU'] = encode($userData[0]['nome_usuario'] . ' ' . $userData[0]['sobrenome_usuario']);\n $_SESSION['_eU'] = encode($userData[0]['email_usuario']);\n \n return 1;\n }\n \n }\n \n \n }", "public function login()\n\t{\n\t\t$input = $this->input->post();\n\n\t\t$username = $this->db->escape_str($input['USR']);\n\t\t$password = $this->db->escape_str($input['PSW']);\n\n\t\t$result = array();\n\n\t\tif(isset($username) && isset($password)){\n\n\t\t\t$this->db->select('id, count(*) as total');\n\t\t\t$query = $this->db->get_where(' tb_user',array('username' => $username,'password' => $password), 1 );\n\n\t\t\t$data = $query->result_array();\n\n\t\t\t$total = $data[0]['total'];\n\t\t\t$user_id = $data[0]['id'];\n\n\t\t\tif( $total > 0 ){\n\n\t\t\t\t$this->session->set_userdata(array('is_login' => true));\n\t\t\t\t$this->session->set_userdata(array('user_id' => $user_id));\n\t\t\t\t$this->session->set_userdata(array('user_name' => $username ));\n\t\t\t\t$result['rs'] = true;//array('rs' => true);\n\n\t\t\t}else{\n\t\t\t\t$result = array('rs' => false, 'msg' => \"Login incorrect !\");\n\t\t\t}\n\n\t\t}else{\n\t\t\t$result = array('rs' => false, 'msg' => \"Wrong Solution Login\");\n\t\t}\n\n\t\techo json_encode($result);\n\t}", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public function login(){\n require_once($_SERVER['DOCUMENT_ROOT'] . $_SERVER['CONTEXT_PREFIX'] . '/model/users.php');\n\n $username = $this->security->clean($this->data['username']);\n $password = $this->security->clean($this->data['password']);\n $password = $this->security->crypt($password);\n\n $user = new stdClass;\n\n $user->id = null;\n $user->username = $username;\n $user->password = $password;\n\n $users = new Users($user);\n\n $checkUsername = $users->checkUsername();\n if(gettype($checkUsername) == 'string'){\n return ['status' => false, 'data' => $checkUsername];\n }else{\n if($checkUsername){\n $checkPassword = $users->checkPassword();\n if(gettype($checkPassword) == 'string'){\n return ['status' => false, 'data' => $checkPassword];\n }else{\n if($checkPassword){\n $cookie = setcookie($this->security->crypt('user'), $this->security->crypt($users->getId()), time() + 60 * 60 * 24 * 30, '/', 'localhost', false, true);\n if($cookie){\n session_start();\n $_SESSION['user'] = $users->getId();\n session_write_close();\n \n return ['status' => true, 'data' => $checkPassword];\n }else{\n return ['status' => false, 'data' => 'Cookie failed'];\n }\n }else{\n return ['status' => true, 'data' => 'password'];\n }\n }\n }else{\n return ['status' => true, 'data' => 'username'];\n }\n }\n }", "public function authLogin() {\n\t\tif($this->input->post()) {\n\t\t\t$user = $this->input->post('username');\n\t\t\t$pass = $this->input->post('upassword');\n\t\t\t$login = $this->m_user->checkLogin($user, $pass);\n\t\t\tif($login) {\n\t\t\t\t$output = array('success' => true, 'login' => $login);\n\t\t\t\t$this->session->set_userdata('u_login', $login);\n\t\t\t\t$this->session->set_userdata('u_name', $login->username);\n\t\t\t\t$this->session->set_userdata('u_level', $login->level);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t} else {\n\t\t\t\t$output = array('success' => false, 'login' => null);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t}\n\t\t}\n\t}", "function login() {\n\t \t\n\t\t//$email = $this -> _request['user_email'];\n\t\t$u_password = $this -> _request['user_password'];\n\t\t\t$password = $this -> _request['user_password'];\n\t\t$login_id = $this -> _request['login_id'];\n\n\t\t// Input validations\n\t\tif (!empty($login_id) && !empty($password)) {\n\t\t\t$mobile=country_code.$login_id;\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t$verify_status=$records[0]['user_mobile_verify_status'];\n\t\t\t$mob=substr($records[0]['user_contact_no'],4);\n\t\t\t$id_user=$records[0]['user_id'];\n\t\t\tif(!empty($records)){\n\t\t\t\t\n\t\t\t\t$records_user = $this -> conn -> get_table_field_doubles('user', 'user_contact_no', $mobile, 'user_password', md5($password));\n\t\t\t\tif (!empty($records_user))\n\t\t\t\t {\n\t\t\t\t \tif($verify_status=='1'){\n\t\t\t\t \t$status=$records_user[0]['user_status'];\n\t\t\t\t $pin_status=$records_user[0]['user_pin_status'];\n\t\t\t\t $reffer_code=$records_user[0]['user_refferal_code'];\n\t\t\t\t\t$user_id=$records_user[0]['user_id'];\n\t\t\t\t\t$user_mobile=$records_user[0]['user_contact_no'];\n\t\t\t\t\t$user_email=$records_user[0]['user_email'];\n\t\t\t\t\t$user_name=$records_user[0]['user_name'];\n\t\t\t\t\t$wallet_amount=$records_user[0]['wallet_amount'];\n\t\t\t\t\t$profile_pic = $records_user['0']['user_profile_pic'];\n\t\t\t\t\t$user_password = $records_user['0']['user_password'];\n\t\t\t\tif (!empty($profile_pic)) \n\t\t\t\t{\n\t\t\t\t\t$img = self_img_url.$profile_pic;\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$img = '';\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\", 'user_id' => $user_id,'user_status'=>$status,'user_name'=>$user_name,'wallet_amount'=>$wallet_amount,'user_profile_pic'=>$img,'user_email'=>$user_email,'user_password'=>$u_password,'mobile'=>substr($user_mobile,4),'login_type'=>1,'user_pin_status'=>$pin_status,'refferal_code'=>$reffer_code);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t$token = $this -> send_code($mob);\n\t\t\t\t\t\t$data['user_verified_code']=$token;\n\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$id_user, $data);\n\t\t\t\t\t\t$post = array('status' => \"not_verify\", \"message\" => \"User Mobile verification pending\",'mobile'=>$mob);\n\t\t\t\techo $this -> json($post);\n\t\t\t\texit();\n\t\t}}else{\n\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t}\n\t\t\t}elseif(empty($records)){\n\t\t\t\t\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_email', $login_id);\n\t\t\t\t$verify_status=$records[0]['user_mobile_verify_status'];\n\t\t\t\t$mob=$records[0]['user_contact_no'];\n\t\t\t$id_user=$records[0]['user_id'];\n\t\t\tif(!empty($records)){\n\t\t\t\t\t\n\t\t\t\t$records_user = $this -> conn -> get_table_field_doubles('user', 'user_email', $login_id, 'user_password', md5($password));\n\t\t\t\tif (!empty($records_user))\n\t\t\t\t {\n\t\t\t\t if($verify_status=='1'){\n\t\t\t\t\t$status=$records_user[0]['user_status'];\n\t\t\t\t\t $pin_status=$records_user[0]['user_pin_status'];\n\t\t\t\t\t$user_id=$records_user[0]['user_id'];\n\t\t\t\t\t $reffer_code=$records_user[0]['user_refferal_code'];\n\t\t\t\t\t$user_name=$records_user[0]['user_name'];\n\t\t\t\t\t$user_mobile=substr($records_user[0]['user_contact_no'],4);\n\t\t\t\t\t$wallet_amount=$records_user[0]['wallet_amount'];\n\t\t\t\t\t$profile_pic = $records_user['0']['user_profile_pic'];\n\t\t\t\t\t$user_email=$records_user[0]['user_email'];\n\t\t\t\t\t$user_password = $records_user['0']['user_password'];\n\t\t\t\tif (!empty($user_profile_pic)) \n\t\t\t\t{\n\t\t\t\t\t$img = $path.$user_profile_pic;\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$img = 'No image';\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\", 'user_id' => $user_id,'user_status'=>$status,'user_name'=>$user_name,'wallet_amount'=>$wallet_amount,'profile_pic'=>$img,'user_email'=>$user_email,'user_password'=>$u_password,'mobile'=>substr($user_mobile,4),'login_type'=>1,'user_pin_status'=>$pin_status,'refferal_code'=>$reffer_code);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$token = $this -> send_code($mob);\n\t\t\t\t\t\t$data['user_verified_code']=$token;\n\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$id_user, $data);\n\t\t\t\t\t\t$post = array('status' => \"not_verify\", \"message\" => \"User Mobile verification pending\",'mobile'=>$mob);\n\t\t\t\n\t\t\t\techo $this -> json($post);\n\t\t\t\texit();\n\t\t}}else{\n\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t}}\n\t\t\t\t\n\t\t\n\n}else{\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Login ID and Password are Required\", 'login_id' => $login_id, 'user_password' =>$user_password);\n\t\t\t// $this->response($this->json($error), 400);\n\t\t\t\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function login()\n {\n $p=$this->input->post();\n\n $email=$p['user_email'];\n $password=$p['user_password'];\n\n $rs=$this->um->login($email,$password);\n\n $msg=array();\n\n if($rs!='')\n {\n $id=$rs->user_id;\n\n $msg['alert']='success';\n $msg['link_to']='home-page';\n $msg['user_id']=$id;\n }\n else\n {\n $msg['alert']='';\n $msg['notify']='Incorrect email and password';\n }\n\n echo json_encode($msg);\n }", "function login(){\r\n\t\tif(!isset($_POST['username']) || !isset($_POST['password']) ){\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid Request\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//sanitize \r\n\t\t$username = $_POST['username'];\r\n\t\t$password = $_POST['password'];\r\n\t\t\r\n\t\t//query database\r\n\t\t$user = Doo::db()->getOne('Users', array('where' => \"username =:username\", 'param' => array(':username' => $username)));\r\n\t\t//$user = Doo::db()->getOne('Users', array('where' => 'username = \\'' . $username . '\\' '));\r\n\t\t\r\n\t\t//check for result row\r\n\t\tif(empty($user)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid username and/or password. Note: Both fields are case sensitive\";\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//see if user is blocked\r\n\t\tif(!$user->is_enabled) {\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"User is blocked. Contact your administrator\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//compare hash values\r\n\t\tif($user->password === md5($password)) {\r\n\t\t\r\n\t\t\tsession_start();\r\n\t\t\tsession_regenerate_id();\r\n\t\t\tunset($_SESSION['user']);\r\n\t\t\t\t\r\n\t\t\t//save user session vars\r\n\t\t\t$_SESSION['user'] = array(\r\n\t\t\t\t\t\t\t\t\t'id' \t\t\t=> $user->id, \r\n\t\t\t\t\t\t\t\t\t'username' \t\t=> $user->username, \t\r\n\t\t\t\t\t\t\t\t\t'email'\t\t\t=> $user->email,\r\n\t\t\t\t\t\t\t\t\t'cluster_zoom_level' => $user->cluster_zoom_level\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = true;\r\n\t\t\t$this->res->message = \"Login Successful.\";\r\n\t\t\t\r\n\r\n\t\t\t//update user\r\n\t\t\t$user->client_ip = $this->clientIP();\r\n\t\t\tdate_default_timezone_set('UTC');\r\n\t\t\t$user->last_login_utc = date( 'Y-m-d H:i:s', time());\t\r\n\t\t\t$user->update();\r\n\t\t\t\r\n\t\t\t//update log\r\n\t\t\t$log = new Log;\r\n\t\t\t$log->username = $user->username;\r\n\t\t\t$log->ip_address = $this->clientIP();\r\n\t\t\t$log->client_ip = $this->clientIP();\r\n\t\t\t$log->insert();\r\n\t\t\t\r\n\t\t\t//change password\r\n\t\t\tif($user->change_password_on_login == 1){\r\n\t\t\t\t//build response\r\n\t\t\t\t$this->res->success = true;\r\n\t\t\t\t$this->res->message = \"Change Password Requested\";\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else{\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid username and/or password. Note: Both fields are case sensitive\";\t\r\n\t\t}\r\n\t\r\n\t}", "function login_post()\n {\n if(!$this->post('user') || !$this->post('pass')){\n $this->response(NULL, 400);\n }\n\n $this->load->library('authentication');\n $array = array(\n 'user' => $this->post('user'),\n 'pass' => $this->post('pass')\n );\n $auth_result = $this->authentication->authenticate($array);\n \n if($auth_result['success'] == 1){\n $this->response(array('status' => 'success'));\n }else{\n $this->response(array('status' => 'failed'));\n }\n }", "public function login(){\n\t\t//$this->output->enable_profiler(TRUE);\n\n\t\tif (($emailId = $this->input->get_post('emailId')) && ($password = $this->input->get_post('password'))) {\n \n $data = array(\n 'email' => $emailId,\n 'password' => $password\n );\n \n $ret = $this->Lootel_model->login($data);\n \n if($ret){\n\t\t\t\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not found\");\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\techo json_encode($response);\n\t\n }", "public function login(){\n\t\t$this->load->library('encryption');\n\t\t\n\t\t$username = $this->input->post('username', TRUE);\n\t\t$password = $this->input->post('password', TRUE);\n\t\t\n\t\t$errorMsg = '';\n\t\t\n\t\tif(trim($username) == '') { $errorMsg .= 'Username Tidak Boleh Kosong<br/>'; }\n\t\tif(trim($password) == '') { $errorMsg .= 'Password Tidak Boleh Kosong<br/>'; }\n\t\t\n\t\tif($errorMsg == ''){\n\t\t\t$userDB = \\SleekDB\\SleekDB::store('users', DATADIR);\n\t\t\t$findUser = $userDB\n\t\t\t\t->where('user_name', '=', $username)\n\t\t\t\t->where('user_pass', '=', md5($password))\n\t\t\t\t->fetch();\n\t\t\t$checkUser = count( $findUser );\n\t\t\tif($checkUser == 1){\n\t\t\t\t\n\t\t\t\t$encryptedKey = $this->encryption->encrypt( $username . \"|=.=|\" . $password );\n\t\t\t\t\n\t\t\t\t$usersActiveDB = \\SleekDB\\SleekDB::store('users_active', DATADIR);\n\t\t\t\t\n\t\t\t\t$newLoginData = [\n\t\t\t\t\t'key' => $encryptedKey,\n\t\t\t\t\t'user' => $username,\n\t\t\t\t\t'datetime' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t\t'type' => 'Logged In'\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t$results = $usersActiveDB->insert( $newLoginData );\n\t\t\t\t\n\t\t\t\t$results = [\n\t\t\t\t\t'success' => true,\n\t\t\t\t\t'message' => 'Berhasil Login',\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'key' => $encryptedKey,\n\t\t\t\t\t\t'description' => 'Gunakan Key tersebut untuk mengakses data API lainnya',\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t$this->setOutput( $results );\n\t\t\t}else{\n\t\t\t\t$results = [\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => 'Gagal Login'\n\t\t\t\t];\n\t\t\t\t$this->setOutput( $results );\n\t\t\t}\n\t\t}else{\n\t\t\t$this->setOutput( $errorMsg );\n\t\t}\n\t}", "function login($user_name,$password){\n\t$conn = db_connect();\n\t$sql_cmd = sprintf(\n\t\t\"SELECT * FROM `User` WHERE `Email` = '%s'\",// and `Password` = '%s'\",\n\t\t$conn->real_escape_string($user_name)\n\t\t//,$conn->real_escape_string($password)\n\t);\n\t$result=$conn->query($sql_cmd);\n\t$response_obj=new stdClass();\n\tif ($result->num_rows > 0) {\n\t\t$row = $result->fetch_assoc();\n\t\t$response_obj->action=\"login\";\n\t\t$response_obj->ID=$row[\"ID\"];\n\t\t$response_obj->FirstName=$row[\"FirstName\"];\n\t\t$response_obj->LastName=$row[\"LastName\"];\n\t\t$response_obj->Active=$row[\"Active\"];\n\t\t$response_obj->Email=$row[\"Email\"];\n\t\t$response_obj->Password=$row[\"Password\"];\n\t\t$response_obj->Permission=$row[\"Permission\"];\n\t\tif(($response_obj->ID!=null) &&\n\t\t ($response_obj->Password==null || $response_obj->Password==$password) &&\n\t\t ($response_obj->Active>=1)\n\t\t ){\n\t\t \tsession_start();\n\t\t\t$_SESSION['user_id'] = $response_obj->ID;\n\t\t\t//$_SESSION['user_name'] = $response_obj->FirstName.\" \".$response_obj->LastName;\n\t\t\t//$_SESSION['user_email']=$response_obj->Email;\n\t\t\t$_SESSION['user_permission']=$response_obj->Permission; \n\t\t\t//$return_msg=\"{'result':'Pass','message':'Hello, \".$response_obj->FirstName.\"'}\";\n\t\t\t$response_obj->result=\"Pass\";\n\t\t\tunset($response_obj->Password);\n\t\t}\n\t\telse{\n\t\t\t//$return_msg=\"{'result':'Fail','message':'Invalid Account or Password!'}\";\n\t\t\t$response_obj->result=\"Fail\";\n\t\t}\n\t}\n\telse{\n\t\t$response_obj->result=\"Fail\";\n\t}\n\t$conn->close();\n\t$strResult = json_encode($response_obj);\n\t//file_put_contents('php://stderr', print_r($strResult.\"\\n\", TRUE)); //************Debug**********\n\techo $strResult;\n}", "public function login($login) {\n $userName = '';\n $userId=0;\n $password = '';\n $roleId=0;\n\n $stmt = $this->connection -> prepare('SELECT id, name, password FROM users WHERE email = ? AND is_active = 1 LIMIT 1');\n $stmt -> bind_param('s', $login['email']);\n $stmt -> execute();\n $stmt -> store_result();\n $stmt -> bind_result($userId, $userName, $password);\n $stmt -> fetch();\n if($userId > 0){ \n //if(password_verify($login['password'], $password)){\n if(password_verify($login['password'], $password)){\n $this->setSession($userId);\n $this->setSessionDb($userId);\n return json_encode([\"success\" => 1,\n \"user_id\" => $userId,\n \"name\" => $userName,\n \"msg\"=> \"You are now logged in.\"]);\n }\n }\n return json_encode([\"success\"=> 0,\"msg\"=> \"Login failed.\"]);\n }", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "function login($control,$userid, $password)\r\n\t{\r\n\t\t\r\n\t\t$auth=$this->authenticate($control,$userid,$password);\r\n\t\tif($auth==0)\r\n\t\t\t{\r\n\t\t\t\t$r[\"re\"]=\"Wrong Username or password\";\r\n print(json_encode($r));\r\n }\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$r[\"re\"]=\"User Found\";\r\n print(json_encode($r));\r\n\t\t\t}\r\n\t}", "public function loginON($request,$response){\n\n\n /*=================={Fetch data from the link}================*/\n\n\n $user_name0 = $request->getParam('user_name');\n $user_password = $request->getParam('user_password');\n\n\n\n if( !$this->isemty( $user_name0,$user_password )){\n $result = array(\n 'messageEN'=> 'Error!! No text to process',\n 'messageAR'=> 'خطأ!! لايوجد نص لمعالجته ',\n 'Properties'=> 'user_name,user_password',\n 'code'=> 400,\n\n );\n\nreturn $response->withJson( $result,$result['code']);\n }else\n\n $user = $this->getuserdata($user_name0);\n\nif($user === false){\n\n $result = array(\n 'messageEN'=> 'Error!! This user is not found! ',\n 'messageAR'=> 'خطأ!! هذا المستخدم غير موجد ',\n 'Properties'=> 'user_name',\n 'code'=> 404\n\n );\n\nreturn $response->withJson( $result,$result['code']);\n\n\n}else if($this->passwordverify($user_password ,$user) === false){\n\n\n $result = array(\n 'messageEN'=> 'Error !! Password not valid ',\n 'messageAR'=> 'خطأ !! كلمة المرور ليست صالحة ',\n 'Properties'=> 'user_password',\n\n 'code'=> 406,\n\n );\n\nreturn $response->withJson( $result,$result['code']);\n\n\n}else{\n\n\n $result = array(\n 'messageEN'=> 'Operation Success: Access Allowed',\n 'messageAR'=> 'العملية نجاحة :الوصول مسموح',\n 'token'=> $this->getnewToken($user),\n 'code'=> 200,\n\n\n\n );\n\n\n\nreturn $response->withJson( $result,$result['code']);\n\n\n\n}\n\n\n\n\n\n}", "private function login(){\n \n }", "function admin_login() {\n\t\t$admin_email = $_REQUEST['admin_email'];\n\t\t$admin_pass = $_REQUEST['admin_pass'];\n\t\tif (!empty($admin_email) && !empty($admin_pass)) {\n\t\t\t$records_user = $this -> conn -> get_table_field_doubles('pg_track_admin', 'admin_email', $admin_email, 'admin_password', md5($admin_pass));\n\t\t\tif (!empty($records_user)) {\n\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid login id and password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'admin_email' => $admin_email, 'admin_pass' => $_REQUEST['admin_pass']);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function admin_login(){\n\t$admin_email=$_REQUEST['admin_email'];\n\t$admin_pass=$_REQUEST['admin_pass'];\n\tif(!empty($admin_email) && !empty($admin_pass)){\n\t\t\t$records_user = $this -> conn -> get_table_field_doubles('pg_track_admin', 'admin_email', $admin_email, 'admin_password', md5($admin_pass));\n\t\tif(!empty($records_user)){\n\t\t\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\");\n\t\t}else{\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid login id and password\");\n\t\t}\n\t}else{\n\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\",'admin_email'=>$admin_email,'admin_pass'=>$_REQUEST['admin_pass']);\n\t}\n\techo $this -> json($post);\n}", "public function userlogin($username,$password) { \n\t\n\t //$result='';\n\t\t\t\t//$customer = $this->customerAccountManagement->authenticate($username,$password);\n\t\t\t\t\n\t $result1 = $this->customerAccountManagement->customauthenticate($username,$password);\n\t\t\t\t//print_r($result1);\n\t\t\t\tif(!empty($result1))\n\t\t\t\t{\n\t\t\t\t\t//return $result1;\n\t\t\t\t\treturn $result2=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"Success\"),'user_detail'=>$result1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$result2=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Invalid login or password.\"));\n\t\t\t\t\treturn $result2;\n\t\t\t\t}\n\t // return $result;\n\t /* $validate = 0;\n\t try {\n\t\t\t\t//$customer = $this->customerAccountManagement->authenticate($username,$password);\n\t\t\t\t$result = $this->customerAccountManagement->customauthenticate($username,$password);\n\t\t\t\tprint_r($result);\n\t\t\t\t$validate = 1;\n\t\t\t}\n\t\t\tcatch(InvalidEmailOrPasswordException $ex) {\n\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Error\",'message'=>$ex->getMessage));\n\t\t\t\t$validate = 0; \n\t\t\t} \n\t\n\t\n\t if($validate == 1) \n\t\t\t {\n\t\t\t\t if($customer->getId())\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t// $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'customer'=>array('id'=>$customer->getId(),'username'=>$username,'password'=>$password,'name'=>$customer->getFirstname()));\n\t\t\t\t\t\t\t//echo $customer->getId();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$result[]=array('status'=>array(\"message\"=>\"Login Successful\"),'customer'=>array('id'=>$customer->getId(),'username'=>$username,'password'=>$password,'name'=>$customer->getFirstname()));\n\t\t\t\t\t\t//$result=array('status'=>array(\"message\"=>\"Login Successful.\"));\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"error\"));\n\t\t\t\t\t\t\n\t\t\t\t\t\t }\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"Error\",'message'=>$ex->getMessage));\n\t\t\t }\n\t \n \n\t\treturn $result; */ \n \t\t\t\n\n\t }", "function login() {\n $params = $this->objService->get_request_params();\n $isSuccess = $this->objQuery->count('user','email= ? AND password = ?', array($params->email,$params->password));\n echo $isSuccess;\n }", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "public function login()\n\t{\n\t\tif ( func_get_args() ) {\n\t\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t\tif ( array_key_exists( 'EmailAddress', $args ) ) {\n\t\t\t\t// Login with password\n\t\t\t\t$this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) );\n\t\t\t} else if ( array_key_exists( 'UserID', $args ) ) {\n\t\t\t\t// Login with hash\n\t\t\t\t$this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) );\n\t\t\t}\n\t\t\t$this->loginType = 'authd';\n\t\t\t\n\t\t} else {\n\t\t\t// Anonymous login\n\t\t\t$this->loginType = 'anon';\n\t\t\t$this->request( 'smugmug.login.anonymously' );\n\t\t}\n\t\t$this->SessionID = $this->parsed_response['Login']['Session']['id'];\n\t\treturn $this->parsed_response ? $this->parsed_response['Login'] : FALSE;\n\t}", "function login($userName, $password)\n {\n //get the user data from db\n $userData = isUsernameExist($userName);\n //if no userdata found redirect user to login page with \"User Not Exist\" message.\n if ($userData === false) {\n header(\"location: login.php?error=wrongLogin\");\n exit();\n }\n\n // we will be reaching here @this part of code if we were not redirected to login page with error so no need to use else statement\n //using password_verify function we can verify hash it returns true / false according to the values it has been given\n //if password is not matched redirect user to login page with \"Wrong Password\" message.\n if (!password_verify($password, $userData['PASSWORD'])) {\n header(\"location: login.php?error=wrongPassword\");\n exit();\n } else {\n //if password verified with the hash then start a session and store user info into session variables and redirect user to home page\n session_start();\n $_SESSION[\"userid\"] = $userData['user_uuid'];\n $_SESSION[\"firstname\"] = $userData['firstname'];\n $_SESSION[\"lastname\"] = $userData['lastname'];\n $_SESSION[\"username\"] = $userData['username'];\n $_SESSION['updateMode'] = false;\n header(\"location: index.php\");\n }\n }", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "public function login()\n {\n $data = array(\n 'status' => 'ERROR',\n 'message' => 'Invalid request'\n );\n\n $query = $this->db->get_where('users', array(\n 'email' => $this->input->post('email')\n ));\n\n if (!$query->row()) {\n $data['message'] = 'Invalid user';\n return $data;\n }\n\n\n $user = $query->row_array();\n\n if (sha1($this->input->post('password')) === $user['password']) {\n return array(\n 'status' => 'OK',\n 'message' => 'Login success',\n 'id' => $user['id'],\n 'first_name' => $user['first_name'],\n 'last_name' => $user['last_name'],\n 'email' => $user['email'],\n 'img_name' => $user['img_name'],\n );\n }\n \n\n $data['message'] = 'Incorrect password';\n return $data;\n }", "public function loginuser($login_details){\n\t\t\t\n\t\t\t$email = $login_details->email;\n\t\t\t$password = $login_details->password;\n\t\t\t$err_msg=[];\n\t\t\tif(trim(isset($email)?$email:'')=='')\n\t\t\t$err_msg[]='Email is required';\n\t\t\tif(trim(isset($password)?$password:'')=='')\n\t\t\t$err_msg[]='Password is required';\n\t\t\t$response = new ResponseHandler();\n\t\t\tif(empty($err_msg))\n\t\t\t{\n\t\t\t\t$login_dao = new LoginDAO();\n\t\t\t\t$response = new ResponseHandler(); \n\t\t\t\t\n\t\t\t\t$login_response = $login_dao->login($email,$password);\n\t\t\t\tif(isset($login_response['result']) && $login_response['result'] == 1)\n\t\t\t\t{\n\t\t\t\t\treturn $response->encode_response(['status' => 'success', 'message' => 'Login Successfully','login_details'=>$login_response['user_details'][0]]);\n\t\t\t\t}\n\t\t\t\telse if($login_response['result']=='fail')\n\t\t\t\t{\n\t\t\t\t\treturn $response->encode_response(['status' => 'failure', 'message' => $login_response['user_details']]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $response->encode_response(['status' => 'failure', 'message' => 'Invalid details']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\treturn $response->encode_response(['status' => 'failure', 'message' =>$err_msg]);\t\n\t\t\t}\n\t\t\t\n\t\t}", "function login() {\n /**\n * This array will hold the errors we found\n */\n $errors = [];\n\n /**\n * Check whether a POST request was made\n * If a POST request was made, we can authorize and authenticate the user\n */\n if($_POST) {\n /**\n * Decode the received data to associative array\n */\n $data = json_decode($_POST[\"data\"], true);\n\n /**\n * Check whether user name and password were inputed\n */\n if(!$data[\"userName\"]) {\n $errors[] = \"Моля, въведете потребителско име.\";\n }\n\n if(!$data[\"password\"]) {\n $errors[] = \"Моля, въведете парола.\";\n }\n\n /** \n * If the user name and password were inputed we can validate them\n */\n if($data[\"userName\"] && $data[\"password\"]) {\n $user = new User($data[\"userName\"], $data[\"password\"]);\n $isValid = $user->isValid();\n\n /**\n * If the inputed user name and password were valid, we can store the to the session\n */\n if($isValid[\"success\"]){\n $_SESSION[\"userName\"] = $user->getUsername();\n $_SESSION[\"password\"] = $user->getPassword();\n } else {\n $errors[] = $isValid[\"error\"];\n }\n }\n \n $response;\n\n if($errors) {\n $response = [\"success\" => false, \"data\" => $errors];\n } else {\n $response = [\"success\" => true];\n }\n\n /**\n * Return response to the user\n */\n echo json_encode($response);\n } else {\n echo json_encode(array(\"succes\" => false, \"error\" => \"Не е изпратена правилна заявка\"));\n }\n }", "public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }", "public function login($name, $password);", "public static function login($username, $password)\r\n {\r\n\t\t//\\Config::load('db', true);\r\n\t\t//$active_db = \\Config::get('db.active');\r\n\t\t//print_r($active_db); \r\n\t\t$call_to_db = \\quotes\\Model_Quote::get_nmi_section($username, $password);exit;\r\n\t\t$sql\t=\t\"SELECT EM1_Username, EM1_EmployeeID_pk from t_Employee1, EM1_Password where EM1_Username = ? and EM1_Password = ?\";\r\n $sql = \\NMI::Db()->prepare($sql);\r\n\t\tprint_r($sql);log::error($sql); \r\n\t\t\r\n $stmt->execute(array($username,$password));\r\n $meta = $stmt->fetch();\r\n print_r($meta);exit;\r\n foreach ($meta as $u)\r\n {\r\n $user_id = $u['EM1_EmployeeID_pk'];\r\n $user_name = $u['EM1_Username'];\r\n\t\t $password = $u['EM1_Password'];\r\n }\r\n\t\t\r\n \\Session::set('user_id', $user_id);\r\n\t\t\\Session::set('username', $username);\r\n\t\t\\Session::set('password', $password);\r\n\t\t\\Session::set('authed', 'validated');\r\n\t\t\r\n\t\tif(count($user>0)){return 1;}else{return 0;}\r\n }", "public function AdminLogin(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $username = $_POST['email'];\n $password = $_POST['password'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($username) && !empty($password)){\n $res->admin_login($username, $password, $conn);\n $this->dbClose();\n }\n else{\t\n $this->dbClose();\n $error = array('status' => \"0\", \"msg\" => \"Fill Both Fields !!\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }", "public function login($username,$password){\r\n\t\t $link = $this->connect();\r\n\t\t $login = mysqli_real_escape_string($link,$username);\r\n\t\t $pword = mysqli_real_escape_string($link,$password);\r\n\t\t $query = \"SELECT user_id,user_name FROM user WHERE user_name = '$login' AND password = '\".$pword.\"' LIMIT 1\";\r\n\t\t $result = mysqli_query ( $link, $query );\r\n\t\t if(mysqli_num_rows($result) == 1){\r\n\t\t while ( $row = mysqli_fetch_row ( $result ) ) {\r\n\t\t $lid = $row[0];\r\n\r\n\t\t session_start();\r\n\t\t session_regenerate_id(TRUE);\r\n\t\t $_SESSION['userid'] = $row[0];\r\n\t\t $_SESSION['uname'] = $row[1];\r\n\t\t }\r\n\t\t \r\n\t\t return true;\r\n\t\t }else{\r\n\t\t return false;\r\n\t\t }\r\n\t \t}", "function login()\n{\n\tglobal $conf, $json, $resout, $db;\n\n\t$username = cRequest::any('_user');\n\t$password = cRequest::any('_pass');\n\t$p = $password;\n\n\t//die(\"_user: $username | _pass: $password\");\n\t\n\tif ((!$password) || (!$username)) {\n\t\t# XXX: Error page\n\t\tdie(\"Username and Password Required\");\n\t}\n\n\t$dbh = $db->open($conf['db']['host'], $conf['db']['user'],\n\t\t\t $conf['db']['passwd'], $conf['db']['name']);\n\n\t$uname = $db->secure($username);\n\t$passwd = sha1($password);\n\n\t$sql = \"select * from {$conf['tbl']['usermap']}\n\t\twhere username='$uname';\";\n\t$ret = $db->query($sql);\n\tif ($ret) {\n\t\t$res = $db->asfetch($ret);\n\t\t$uid = $res['uid'];\n\t\t$actype = $res['actype'];\n\t\tswitch($actype) {\n\t\tcase 'sa':\n\t\t\t$sql = \"select * from {$conf['tbl']['login']}\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'a':\n\t\t\t$sql = \"select * from {$conf['tbl']['shopinfo']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['shopinfo']}.sid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tcase 'u':\n\t\t\t$sql = \"select * from {$conf['tbl']['profile']}\n\t\t\t\tleft join {$conf['tbl']['login']} \n\t\t\t\ton({$conf['tbl']['profile']}.uid = \n\t\t\t\t{$conf['tbl']['login']}.uid )\n\t\t\t\twhere username='$uname'\";\n\t\t\t$ret = $db->query($sql);\n\t\t\t$res = $db->asfetch($ret);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* XXX: ERROR */\n\t\t\tdie(\"[!] Error: No account with Username $uname\");\n\t\t\t/* NOTREACHED */\n\t\t}\n\n\t\t# cmp passwd\n\t\tif ($passwd != $res['passwd']) {\n\t\t\tprint_r($res);\n\t\t\tprint \"Passwords don't match[$passwd | {$res['passwd']}]\";\n\t\t\texit();\n\t\t}\n\n\t\t# get last login\n\t\t$sqll = \"select * from loginhistory where uid='$uid'\";\n\t\t$retl = $db->query($sqll);\n\t\t$resl = $db->asfetch($retl);\n\n\t\t# set up session data\n\t\t$sess = new cSession;\n\t\t$datetime = date('Y/m/d H:i:s');\n\t\t$lastip = cIP::getusrip();\n\t\t$location = cIP::getusrcountry($lastip); # FIXME: need to add ip2ctry dir\n\t\tif (isset($location['country_name'])) {\n\t\t\t$location = $location['country_name'];\n\t\t} else {\n\t\t\t$location = \"Unknown\";\n\t\t}\n\n\t\tif (preg_match('/1996\\/09\\/26 16:00:00/', $resl['lastlogin'], $match)) {\n\t\t\t$ll = $datetime;\n\t\t} else {\n\t\t\t$ll = $resl['lastlogin'];\n\t\t}\n\n\t\tif (preg_match('/0\\.0\\.0\\.0/', $resl['lastip'], $match)) {\n\t\t\t$lip = $lastip;\n\t\t} else {\n\t\t\t$lip = $resl['lastip'];\n\t\t}\n\n\t\t$sess->set('uid', $res['uid']);\n\t\t$sess->set('uname', $username);\n\t\t$sess->set('actype', $actype);\n\t\tif ($actype == 'u') {\n\t\t\t$sess->set('fname', $res['fname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\t\tif ($actype == 'a') {\n\t\t\t$sess->set('sname', $res['sname']);\n\t\t\t$sess->set('email', $res['email']);\n\t\t}\n\n\t\t$sess->set('lastlogin', $ll);\n\t\t$sess->set('lastip', $lip);\n\n\t\t# XXX: update login history\n\t\t$sql = \"update {$conf['tbl']['loginhistory']} set lastlogin='$datetime',\n\t\t\tlastip='$lastip', lastlocation='$location'\n\t\t\twhere uid='$uid';\";\n\t\t$db->query($sql);\n\n\t\t$db->close($dbh);\n\t\tunset($db);\n\t\tunset($sess);\n\n\t\theader(\"Location: dashboard.php\");\n\t\texit();\n\t} else {\n\t\t# XXX: Error page\n\t\tdie(\"[!] Fatal Error: No account with Username '$uname'\");\n\t\t/* NOTREACHED */\n\t}\n}", "public function login_post()\n\t{\n\t\t$array['username'] = strtolower($this->post('username'));\n\t\t$array['password'] = hash('sha512', $this->post('password'));\n\n\t\t$error = [];\n\n\t\tif (filter_var($array['username'], FILTER_VALIDATE_EMAIL) \n\t\t\tOR preg_match('/^[A-Za-z][A-Za-z0-9]{5,100}$/', $array['username'])) {\n\n\t\t\tif (empty($array['username'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Username is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else if (empty($array['password'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Password is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else {\n\t\t\t\t$data = $this->api_model->login($array);\n\t\t\t\t$auth_code = $this->createAuthorizationCode($data->id);\n\t \t$is_auth_code_valid = (new Authorization_codes_model)->isValid($auth_code->code);\n\t\t if (!$is_auth_code_valid) {\n\t\t $this->response(['status' => FALSE, 'error' => ['Invalid Authorization Code.']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t }\n\n\t \t$accesstoken = $this->createAccesstoken($auth_code->code);\n\n\t\t\t\tif (empty($data)) {\n\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Username or password is incorrect']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t} else {\n\t\t\t\t\t$result = array(\n\t\t\t\t\t\t'user_id' => (int) $data->id,\n\t\t\t\t\t\t'username' => $data->username,\n\t\t\t\t\t\t'email' => $data->email,\n\t\t\t\t\t\t'access_token' => $accesstoken->token,\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->response(['status' => TRUE, 'message' => 'Login successful.', 'user_details' => $result], REST_Controller::HTTP_OK);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$error[] = 'Invalid username format.';\n\t\t\t$this->response(['status' => FALSE, 'error' => $error], REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "public function login($user_name,$password){\n\t\t$output=false;\n\t\t$query=DB::select(\"SELECT * FROM users WHERE name=:name AND password=:password\",['name'=>$user_name,'password'=>$password]);\n\t\tif(count($query)==1){\n\t\t\tSession::put('user_id', $query[0]->id);\n\t\t\tSession::put('user_name',$query[0]->name);\t\n\t\t\t$output=true;\n\t\t}\n\t\treturn $output;\n\n\t}", "public function LoginUserByUserNameAndPassword($username, $password) {\n if ($username == \"\" || $password == \"\") {\n $response[\"error\"] = 1;\n $response[\"error_msg\"] = \"Please fill all information.\";\n return $response;\n }\n $query = \"select * from users where username='$username' and active='Y'\";\n //echo $query;\n $result = mysql_query($query); // or die(mysql_error());\n // check for result \n $no_of_rows = mysql_num_rows($result);\n\n if ($no_of_rows > 0) {\n $result = mysql_fetch_array($result);\n\n $encrypted_password = $result['userpass'];\n $hash = $this->checkhashSSHA($result['salt'], $password);\n\n // check for password equality\n if ($encrypted_password == $hash) {\n // user authentication details are correct\n $response[\"error\"] = 0;\n $response[\"success\"] = 1;\n $response[\"userid\"] = $result['id'];\n $response[\"username\"] = $result['fname'] . \" \" . $result['lname'];\n $response[\"usertype\"] = $result['usertype'];\n return $response;\n } else {\n $response[\"error\"] = 1;\n $response[\"error_msg\"] = \"Invalid user name or password!\";\n return $response;\n }\n } else {\n $response[\"error\"] = 1;\n $response[\"error_msg\"] = \"Invalid user name or password!\";\n return $response;\n }\n }", "public function login(){\n\n }", "public function dologin() {\n $password=$this->model->getpassword($_POST['username']);\n if (!empty($_POST['password']) && !empty($password) && $password[0]['userpasswd']==$_POST['password']) {\n $_SESSION['username']=$_POST['username'];\n $id=$this->model->getid($_POST['username']);\n $_SESSION['userid']=$id[0]['userid'];\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->set('errormessage', \"Błędny login lub hasło!\");\n $this->view->set('redirectto', \"?v=user&a=login\");\n $this->view->render('error_view');\n }\n }", "function user_login($username, $password)\n {\n\n $query = \"SELECT u.*\n \t\t FROM \" . $this->db_table_prefix . \"users u\n \t\t JOIN \" . $this->db_table_prefix . \"roles r ON u.role_id = r.id\n \t\t WHERE email='\" . $username . \"' AND password='\" . md5($password) . \"' \n AND u.status = '1' LIMIT 0,1\";\n \n $result = $this->commonDatabaseAction($query); \n $user_details = array(); \n $user_details = $this->sqlAssoc;\n \n// if (mysql_num_rows($result) > 0 && !empty($user_details))\n if ($this->rowCount > 0 && !empty($user_details))\n { \n $_SESSION ['user_id'] = $user_details[0]['id'];\n $_SESSION ['user_first_name'] = $user_details[0]['firstname'];\n\n if ($user_details[0]['lastname'] !== '')\n {\n $_SESSION ['user_last_name'] = $user_details[0]['lastname'];\n }\n else\n {\n $_SESSION ['user_last_name'] = '';\n }\n\n $_SESSION ['user_role'] = $user_details[0]['role_id'];\n }\n else\n {\n $_SESSION ['user_login_error'] = 1;\n }\n }", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function user_login($username,$password){\n $sqlQuery= \"select * from Sidhus_Login_credentials where (mobileno='\".$username.\"' or emailId ='\".$username.\"') and (password='\".$password.\"')\";\n $result=$this->con->query($sqlQuery);\n $this->con->close();\n return $result;\n }", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "public function Login($user, $password)\n { \n //build query and array\n $sql = \"SELECT id,role,acronym,name,intrests,music,books,favoritemovie FROM oophp0710_user WHERE acronym = ? AND password = md5(concat(?, salt))\";\n $params = array($user, $password);\n\n //run query\n $res = $this->db->ExecuteSelectQueryAndFetchAll($sql,$params);\n\n //login - success!\n if(isset($res[0])) {\n $_SESSION['user'] = $res[0];\n $this->acronym = $res[0]->acronym;\n $this->name = $res[0]->name;\n $this->role = $res[0]->role;\n }\n else\n {\n $this->status = \"<span style='color:red;'>Felaktigt användarnamn eller lösenord.</span>\";\n }\n\n }", "public function login()\n {\n $response = $this->response();\n $config = [\n ['field' => 'username', 'label' => '', 'rules' => 'trim|required|min_length[4]|max_length[100]|valid_email'],\n ['field' => 'password', 'label' => '', 'rules' => 'trim|required|min_length[8]|max_length[50]'],\n ['field' => 'keepmeconnected', 'label' => '', 'rules' => 'trim|integer'],\n ];\n $this->form_validation->set_rules($config);\n if ($this->form_validation->run() === false) {\n $response[\"errors\"] = $this->form_validation->error_array();\n $this->output->set_output(json_encode($response));\n return false;\n }\n $redirect = false;\n $username = $this->input->post('username');\n $password = $this->input->post('password');\n $keepmeconnected = $this->input->post('keepmeconnected');\n\n $oaut2auth = $this->oauth_server->user_credentials(true);\n if ($oaut2auth->getStatusCode() == 200 && $this->oauth_web->login($username, $password, $oaut2auth->getParameters(), $keepmeconnected == true)) {\n $response = array_merge($response, $oaut2auth->getParameters());\n // if success\n $response[\"msg\"] = \"Successful\";\n $response[\"status\"] = true;\n $response[\"redirect\"] = site_url();\n } else {\n $response[\"errors\"][\"username\"] = $this->lang->line(\"bad_user_pass_combinaison\");\n }\n $this->output->set_output(json_encode($response));\n }", "public function login($params) {\n\n \t$IdAPIs = new IdentityApi();\n \t\n \t/*\n \t * {\n \t * 'identity': {\n \t * { \"resultCode\": null, \"resultDescription\": null, \"userId\": 7133727038931809260,\n \t * \"identities\":[ { \"type\": \"mobile\", \"identity\": \"xxx\" }, { \"type\": \"username\", \"identity\": \"xxx\" } ],\n \t * \"allowAttempts\": 0, \"logonAttempts\": 0 } } }\n \t* */\n \t$user = $IdAPIs->logon($params);\n \tif (isset($user['identity']['userId'])) {//登陆成功\n \t\t$session = Yii::$app->session;\n \t\t$userid = $user['identity']['userId'];\n \t\t$this->_userId = $userid;\n \t\t$this->userIdentities = $user['identity']['identities'];\n \t\t$session['__mobileUser'] = serialize($this);\n \t\tyii::info(\"登陆成功\");\n \t\tYii::$app->mobileUser->login($this->getUser(), 0);\n \t\t\n \t\treturn $user;\n \t}else{\n \t\t//返回登陆失败的具体信息到api 调用者\n \t\treturn $user;\n \t}\n \n }", "function loginUser() {\n\tsession_start();\n\trequire_once(\"sql/dbQueries.php\");\n\n\t// Fetching user data from login data\n\t$userData = getUserFromLogin($_POST['vms_email'], $_POST['userPassword']);\n\n\tif($userData == False) {\n\t\tprintLoginPage(\"The login information supplied is not valid.\");\n\t\treturn;\n\t} else {\n\t\t// Saving the user's info in a session variable\n\t\t$_SESSION['auth'] = TRUE;\n\t\t$_SESSION['auth_info'] = $userData[0];\n\n\t\t// Fetching the DID for the user's default DID.\n\t\t$activeDID = getDIDFromID($userData[0]['didID_default']);\n\t\tif($activeDID != false) {\n\t\t\t$_SESSION['auth_info']['activeDID'] = $activeDID['did'];\n\t\t} else {\n\t\t\t$_SESSION['auth_info']['activeDID'] = null;\n\t\t}\n\t\t//print_r($_SESSION);\n\n\t\t// Head back home\n\t\theader(\"Location: index.php\");\n\t\treturn;\n\t}\n}", "public function login($uname, $upass) {\n\n\n try {\n $q = $this->db->where('username', $uname)->get('stc_firm')->result();\n\n if (count($q) != 1) {\n return array('status' => 401, 'message' => 'Username not found.');\n } else {\n $hashed_password = $q[0]->password;\n $id = $q[0]->id;\n\n if (hash_equals($hashed_password, crypt($upass, $hashed_password))) {\n\n $last_login = date('Y-m-d H:i:s');\n $token = crypt(substr(md5(rand()), 0, 7), 'stchexaclan');\n $expired_at = date(\"Y-m-d H:i:s\", strtotime('+6 hours'));\n $this->db->trans_start();\n $this->db->where('id', $id)->update('stc_firm', array('login_at' => $last_login, 'logstatus' => 1));\n $this->db->insert('users_authentication', array('users_id' => $id, 'token' => $token, 'expired_at' => $expired_at, 'user_type' => 1));\n if ($this->db->trans_status() === FALSE) {\n $this->db->trans_rollback();\n return array('status' => 500, 'message' => 'Internal server error.');\n } else {\n $this->db->trans_commit();\n return array('status' => 200, 'message' => 'Successfully login.', 'id' => $id, 'token' => $token);\n }\n } else {\n return array('status' => 401, 'message' => 'Wrong password.');\n }\n }\n } catch (Exception $e) {\n $this->show_error();\n return array('status' => 401, 'message' => 'db error');\n }\n }", "function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db for this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token \n FROM users \n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the database, it means login failed\n if(!$token) {\n\n # Send them back to the login page\n Router::redirect(\"/users/login/error\");\n\n # But if we did, login succeeded! \n } else {\n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n # update the last_login time for the user\n/* $_POST['last_login'] = Time::now();\n\n $user_id = DB::instance(DB_NAME)->update('users', $_POST); */\n\n # Send them to the main page - or whever you want them to go\n Router::redirect(\"/\");\n }\n }", "public function actionLogin() {\n $sample_code = Yii::$app->request->post('sample_code');\n $collector_code = Yii::$app->request->post('collector_code');\n $full_name = Yii::$app->request->post('full_name');\n $password = Yii::$app->request->post('password');\n $user = new User();\n\n if(is_null($password)) {\n $user->scenario = User::SCENARIO_USER;\n $result = $user->loginOrCreate($sample_code,$collector_code,$full_name);\n } else {\n $user->scenario = User::SCENARIO_OPERATOR;\n $result = $user->loginOrCreate($sample_code,$collector_code,$password);\n }\n if(array_key_exists('error',$result))\n throw new \\yii\\web\\HttpException(400, 'An error occurred:'. json_encode($result['error']));\n return $result;\n }", "public function logIn() {\n try {\n /* Check if for the empty or null email and password parameters */\n if (isset($_POST[\"email\"]) && isset($_POST[\"password\"])) {\n // Get the email and password parameters from POST request\n $form_data = array(\n ':email' => $_POST[\"email\"],\n ':password' => $_POST[\"password\"]\n );\n // Create a SQL query to check if exist this user with email and password\n $query = \"\n select id, username, access \n from tb_user \n where email = :email and password = :password and state = 1\n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query with passed parameters username and password\n $statement->execute($form_data);\n // Get affect rows in associative array\n $row = $statement->fetch(PDO::FETCH_ASSOC);\n // Check if any affected row\n if ($row) {\n // Check if there's any open session\n if (isset($_SESSION['views'])) {\n // Increment the open session + 1\n $_SESSION['views']++;\n } else {\n // Open new session\n $_SESSION['views'] = 1;\n }\n // Set user info into php session\n $_SESSION[$_SESSION['views'].'id'] = $row['id'];\n $_SESSION[$_SESSION['views'].'email'] = $form_data[':email'];\n $_SESSION[$_SESSION['views'].'password'] = $form_data[':password'];\n $_SESSION[$_SESSION['views'].'username'] = $row['username'];\n $_SESSION[$_SESSION['views'].'access'] = $row['access'];\n // data[] is a associative array that return json\n $data[] = array('result' => '1');\n } else {\n $data[] = array('result' => 'Please check your username or password!');\n }\n } else {\n // Check for missing parameters in POST data\n if (!isset($_POST[\"email\"]) && !isset($_POST[\"password\"])) {\n $data[] = array('result' => 'All parameters are missing for user authentication!');\n } elseif (!isset($_POST[\"email\"])) {\n $data[] = array('result' => 'Missing email parameter!');\n } else {\n $data[] = array('result' => 'Missing password parameter!!');\n }\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }", "public function login($params) {\n //validates form by preventing extra characters from being read\n $params = htmlspecialchars($params);\n // failure state\n $fail = function() {\n $this->addFlashMessage(\"Unable to log in: Error in usename or password.\", self::FLASH_LEVEL_USER_ERR);\n error_log('failed login attempt!');\n header( \"HTTP/1.0 401 Unauthorized\" );\n $this->redirect('/users/login');\n };\n\n // try to fetch user: if user DNE, then fail\n $username = strtolower($_POST['username']);\n $user = User::fetchByName($this->getDBConn(), $username); // Long term todo - separate user info from auth\n if ($user == null) {\n error_log(\"Bad Username!\");\n $fail();\n }\n\n // check password: if hash doesn't match, then fail\n if (!password_verify($_POST['password'], $user->getPasswordHash())) {\n error_log(\"Bad Password!\");\n $fail();\n }\n\n // Everything checks out, start user session and create token:\n $token = new Token();\n $token->setUser($user);\n $token->setCreated(date(\"Y-m-d H:i:s\"));\n $token->setExpires(date(\"Y-m-d H:i:s\", time() + 30 * 60));\n $token->commit($this->getDBConn());\n\n session_start();\n $_SESSION['tokenid'] = $token->getTokenId();\n $_SESSION['user'] = $token->getUser();\n\n // Notify user of success\n $this->addFlashMessage(\"Welcome, $username!\", self::FLASH_LEVEL_SUCCESS);\n $this->redirect('/users/'.$token->getUser()->getUserId());\n }", "function userLogin($userData)\n\t\t{\n\t\t\t//at first we are checking that the input value is username or email id\n\t\t\t$presenceChar = strpos($userData['username'],'@');\n\t\t\tif(empty($presenceChar))\n\t\t\t{\n\t\t\t\t$column_name = 'username';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$column_name = 'email_id';\n\t\t\t}\n\t\t\t//getting the password from database\n\t\t\t$userCreden = $this->manageContent->getValue_where('user_credentials','*',$column_name,$userData['username']);\n\t\t\tif(!empty($userCreden[0]))\n\t\t\t{\n\t\t\t\t//checking for password field\n\t\t\t\tif($userCreden[0]['password'] == md5($userData['password']))\n\t\t\t\t{\n\t\t\t\t\tif($userCreden[0]['status'] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//setting cookie expiry time\n\t\t\t\t\t\tif($userData['loggedin_time'] == 'on')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cookie_exp_time = time() + (2*7*24*3600);\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$cookie_exp_time = time() + (24*3600);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//creating the cookie\n\t\t\t\t\t\t$set_cookie = $this->createCookie('uid',$userCreden[0]['user_id'],$cookie_exp_time);\n\t\t\t\t\t\t//calculating total number of sign in\n\t\t\t\t\t\t$sign_in = $userCreden[0]['sign_in_count'] + 1;\n\t\t\t\t\t\t//getting last sign in ip\n\t\t\t\t\t\t$last_sign_in_ip = $this->manageUtility->getIpAddress();\n\t\t\t\t\t\t//updating the values\n\t\t\t\t\t\t$update1 = $this->manageContent->updateValueWhere(\"user_credentials\",\"sign_in_count\",$sign_in,\"user_id\",$userCreden[0]['user_id']);\n\t\t\t\t\t\t$update2 = $this->manageContent->updateValueWhere(\"user_credentials\",\"last_sign_in_ip\",$last_sign_in_ip,\"user_id\",$userCreden[0]['user_id']);\n\t\t\t\t\t\t$update1 = $this->manageContent->updateValueWhere(\"user_credentials\",\"date\",date(\"Y-m-d g:i:s\"),\"user_id\",$userCreden[0]['user_id']);\n\t\t\t\t\t\treturn array(1,'Login Successfull!!',$userCreden[0]['user_id'],$userCreden[0]['category']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array(0,'You Have Been Deactivated By Admin.. Please Contact To The Admin!!');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn array(0,'Username or Password Is Incorrect!!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array(0,'Username or Password Is Incorrect!!');\n\t\t\t}\n\t\t\t\n\t\t}", "public static function LogIn ($userName = '', $password = '');", "public function loginAction() {\n\n\n $login = $this->getRequest()->getPost();\n if (!isset($login['username']) || !isset($login['password'])) {\n return $this->showMsg(-1, '用户名或者密码不能为空.');\n }\n\n\n $ret = Admin_Service_User::login($login['username'], $login['password']);\n\n\n if (Common::isError($ret)) return $this->showMsg($ret['code'], $ret['msg']);\n if (!$ret) $this->showMsg(-1, '登录失败.');\n $this->redirect('/Admin/Index/index');\n }", "public function loginAction(){\n// $data = [];\n// if(isset($_POST['login']))\n// {\n// $post = deActiveXss(deActiveSqlEnjection($_POST));\n// if(validStringAndNumber($post['username']))\n// {\n// $data['username'] = $post['username'];\n// }\n// else\n// {\n// $data['username_error'] = 'نام کاربری حاوی حروف و اعداد میباشد ';\n// }\n// if(isset($post['password']) and !empty($post['password']))\n// {\n// if($post['password']<8)\n// {\n// $data['password_error'] = 'رمز عبور باید بیش از 8 کرکتر باشد';\n// }\n// else\n// {\n// $data['password'] = $post['password'];\n// }\n// }\n// else\n// {\n// $data['password_error'] = 'رمز عبور نمیتواند خالی باشد';\n// }\n// //check username and password is currect ---\n// if(empty($data['password_error']) and empty($data['username']))\n// {\n// $exists_user = $user->findby($data['username'],'username');\n// if(!empty($exists_user))\n// {\n// if($exists_user['password'] === md5($data['password'])) // if true user loged in ------\n// {\n// $_SESSION['user'] = $exists_user;\n// header('location'.URL_SITE.'dashboard');\n// exit;\n// }\n// else\n// {\n// $data['password_error'] = 'رمز عبور با نام کاربری مطابقت ندارد';\n// }\n// }\n// else\n// {\n// $data['username_error'] = 'نام کاربری در سیستم ثبت نشده است';\n// }\n// }\n// }\n// $this->render('user.register',$data);\n var_dump($_POST);\n }", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "public function login($data){\n $username = $data['username'];\n $password = $data['password'];\n\n /*\n *\n * # cek username ada atau tidak kosong \n *\n *\n */\n if (isset($username) && $username !== ''){\n /*\n *\n * # ambil data dari username di database yng di inputkan jika ada tampilkan \n *\n *\n */\n if ($datauser = $this->ambildata(\"username\", ($username))){\n /*\n *\n * # ambik data password dan rolenya dari username yng dimasukkan \n *\n *\n */\n $Uspw = $datauser[\"password\"];\n $role = $datauser['id_level'];\n // var_dump($role);die;\n $nama = $datauser['nama'];\n if (isset($password) && $password !== '') {\n if (password_verify($password, $Uspw)) {\n if ($role == '1' || $role == 1) {\n session_start();\n $_SESSION['username'] = $username;\n $_SESSION['nama'] = $nama;\n $_SESSION['status'] = 'ada';\n $_SESSION['role'] = $role;\n Flasher::setFlash('Selamat Datang ', $username,'success');\n header('Location: '.BASEURL.'');\n }elseif ($role == '2' || $role == 2) {\n session_start();\n $_SESSION['username'] = $username;\n $_SESSION['nama'] = $nama;\n $_SESSION['status'] = 'ada';\n $_SESSION['role'] = $role;\n Flasher::setFlash('Selamat Datang ', $username,'success');\n header('Location: '.BASEURL.'/petugas');\n }\n elseif ($role == '3' || $role == 3) {\n session_start();\n $_SESSION['username'] = $username;\n $_SESSION['nama'] = $nama;\n $_SESSION['status'] = 'ada';\n $_SESSION['role'] = '3';\n Flasher::setFlash('Selamat Datang ', $username,'success');\n header('Location: '.BASEURL.'/homepage_user');\n }\n }else { // else cek password db\n Flasher::setFlash('Password Anda', ' Salah !! ','error');\n header('Location: '.BASEURL.'/home/page');\n }\n }else { // else cek password\n Flasher::setFlash('Username Dan Password', ' Harus Diisi !! ','error');\n header('Location: '.BASEURL.'/home/page');\n }\n }else{ //else cek data\n Flasher::setFlash('Username Anda ', 'Tidak Terdaftar !! ','error');\n header('Location: '.BASEURL.'/home/page');\n }\n }else { //else cek username\n \tFlasher::setFlash('Username Dan Password', ' Harus Diisi !! ','error');\n \theader('Location: '.BASEURL.'/home/page');\n }\n }", "public function getLogin($data){\n\t\n\t\t$passArray = array();\n\t\t$mod = new userModel();\n\t\t\n\t\t$email = $data['email'];\n\t\t$password = md5($data['password']);\n\t\t\n\t\t$res = $mod->loginCheck($email,$password);\n\t\t\n\t\tif(mysql_num_rows($res) > 0){\n\t\t\twhile($row = mysql_fetch_array($res)){\n\t\t\t\t$passArray['userDetails'] = array(\"id\"=>$row[\"id\"],\"UserName\"=>$row[\"username\"],\"Email\"=>$row[\"email\"]);\n\t\t\t}\n\t\t\t$status = SUCCESS;\n\t\t\t$message = MESSAGE;\n\t\t\t/* Set session and send session token */\n\t\t\t//$_SESSION['token'] =$this->rand_str();\n\t\t\t$_SESSION['id'] = $passArray['userDetails']['id'];\n\t\t\t$_SESSION['username'] = $passArray['userDetails']['UserName'];\n\t\t\t$_SESSION['email'] = $passArray['userDetails']['Email'];\n\t\t\n\t\t\t$passArray['token']=$this->newTokenEncode($passArray['userDetails']['UserName'],$passArray['userDetails']['id']);\n\t\t\t$_SESSION['token'] =$passArray['token'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$status =FAIL;\n\t\t\t$message = ERRORMESSAGE;\n\t\t}\n\t\t\n\t\t$response = array(\n\t\t\t\t\t\t\t\"Status\" => $status,\n\t\t\t\t\t\t\t\"Message\"=> $message,\n\t\t\t\t\t\t\t\"Result\"=>$passArray\n\t\t\t\t\t\t);\n\t\t\n\t\treturn $response;\n\t}", "public function login()\n {\n\t if( !isset( $_POST[\"username\"] ) || preg_match( '/[a-zA-Z]{1, 20}/', $_POST[\"username\"] ) )\n {\n $x = new UsersController;\n $x->index();\n }\n\n // Možda se ne šalje password; u njemu smije biti bilo što.\n if( !isset( $_POST[\"password\"] ) )\n {\n $x = new UsersController;\n $x->index();\n }\n \n $provjera = new ChatService;\n $row = $provjera->loginUser();\n\n if( $row === false )\n {\n // Taj user ne postoji, ili nije registriran upit u bazu nije vratio ništa.\n $x = new UsersController;\n $x->index();\n return;\n }\n else\n {\n\n // Postoji user. Dohvati hash njegovog passworda.\n $hash = $row['password_hash'];\n\n // Da li je password dobar?\n if( password_verify( $_POST['password'], $hash ) )\n {\n // Dobar je. Ulogiraj ga.\n $y = new ChatService;\n $_SESSION['id_user'] = $y->getUserId($_POST['username']);\n\n $x = new ChannelsController;\n $x->naslovna();\n \n return;\n }\n else\n {\n // Nije dobar. Crtaj opet login formu s pripadnom porukom.\n $x = new UsersController;\n $x->index();\n return;\n }\n }\n }", "function doLogin($d){ ///email|password\n $dataArr = explode(\"|\",$d);\n $response = getLoginData($dataArr[0],$dataArr[1]);\n \n if($response === 'null'){\n echo(\"Login Fail\");\n }else{\n echo(\"Login Success\");\n }\n \n }", "public function login(){\n\t\t\tValidator::validateOrRedirect($_POST,\n\t\t\t\t\t[\n\t\t\t\t\t\t\t\"required\" => [\"txt-input\", \"password\",\"action\"],\n\t\t\t\t\t\t\t\"email\" => \"txt-input\",\n\t\t\t\t\t],\n\t\t\t\t\t\"/login\");\n\t\t\t$this->resetMessage();\n\t $username=$_POST[\"txt-input\"];\n\t $password=$_POST[\"password\"];\n\t $action=$_POST[\"action\"];\n\t\t\t$userList =[];\n\t\t\t$column_value=array('email'=>$username,'password'=>$password);\n\t\t\t$uss=new User();\n\t\t\t$login=$uss->getBy($column_value);\n\t\t\tif (is_array($login)) {\n\t\t\t\tif (count($login)>0) {\n\t\t\t\t\tforeach ($login as $user)\n\t\t\t {\n\t\t\t\t\t\t$userList[]= array(\n\t\t\t 'user' =>$user['user_name'],\n\t\t\t 'email' =>$user['email'],\n\t\t\t 'password' =>$user['password']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$user=$userList[0][\"email\"];\n\t\t $pass=$userList[0][\"password\"];\n\t\t Redirect::to(\"/products\")->with([\n\t\t 'name'=>$userList[0][\"email\"],\n\t\t 'check'=>\"true\",\n\t\t ])->do();\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tRedirect::to(\"/login\")->with([\n\t\t \"message\" => \"Ha ocurrido un error: usuario o contraseña incorrectos.</br> Revise por favor\",\n\t\t \"type\" => \"danger\",\n\t\t ])\n\t\t ->do();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\tRedirect::to(\"/login\")->with([\n\t \"message\" => $login,\n\t \"type\" => \"danger\",\n\t ])\n\t ->do();\n\t\t\t}\n\t }", "function loginUser()\n{\n $return_val = array(\n\t 'result' => true,\n\t 'err' => \"\",\n\t );\n\n $logger = new Logger();\n\n if (empty($_POST[\"name\"]) || empty($_POST[\"pass\"]) ) \n {\n\t$return_val['result'] = false;\n\t$return_val['err'] = \"*Please fill data\";\n\treturn $return_val;\n } \n\n $name = $_POST[\"name\"];\n $pass = $_POST[\"pass\"];\n $hash = password_hash($name.$pass, PASSWORD_DEFAULT);\n\n $base_dir = $_SERVER['DOCUMENT_ROOT'];\n\n // Chk existance\n if (!file_exists(\"$base_dir/Data/users/\".$name.\"/userInfo.dat\"))\n {\n\t$return_val['result'] = false;\n\t$return_val['err'] = \"*Wrong username or password\";\n\treturn $return_val;\n }\n\n $data = file_get_contents(\"$base_dir/Data/users/\".$name.\"/userInfo.dat\");\n $data = json_decode($data, true);\n\n if (!password_verify($name.$pass, $data['hash'])) \n {\n\t$return_val['result'] = false;\n\t$return_val['err'] = \"*Wrong username or password\";\n\treturn $return_val;\n }\n\n // Default : method of login (Cookie)\n // Fallback method : IP based (To be done)\n if (!isCookiesEnabled()) \n {\n\t$logger->addLog(\"Error : Cookies not enabled, login_key\");\n }\n\n // Set cookies\n setcookie(\"login_key\", $hash, time() + (86400 * 30), \"/\");\n setcookie(\"login_id\", $name, time() + (86400 * 30), \"/\");\n\n $logger->addLog(\"Login success : User $name logged in.\");\n return $return_val;\n}", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "public function user_login() {\n global $db;\n\n //Use path to det user\n if (isset($_POST['login'])) {\n $username = \"\";\n $log_col = $_POST['liwth'];\n $user = $_POST['uname'];\n $pwd = sha1($_POST['pwd']);\n $login = $_POST['lias'];\n\n//Chosing the col of table where to login fron\n switch ($log_col) {\n case \"user\":\n $username = \"uname\";\n break;\n case \"cuser\":\n $username = \"cuname\";\n break;\n case \"employee\":\n $username = \"employee_no\";\n break;\n case\"job_seeker\":\n $username = \"natid\";\n break;\n default :\n echo 'ERROR DETERMINING USER CATEGORY!!!';\n }\n\n// echo '.' . $user . '.' . $pwd . '.' . $login . '.';\n// $query = \"SELECT fname $username, pwd FROM $login WHERE $username='$user' AND pwd='$pwd' \";\n $query = \"SELECT $username, fname, pwd FROM $login WHERE $username = ? AND pwd = ?\";\n $type_array = array('s', 's');\n $data_array = array($user, $pwd);\n\n $res = $db->select($query, $type_array, $data_array);\n if (!empty($res)) {\n foreach ($res as $row) {\n $_SESSION[$username] = $row[$username];\n $empno = $_SESSION[$username];\n $_SESSION['fname'] = $row['fname'];\n echo 'Login success';\n echo 'SESSION NAME' . $_SESSION['fname'];\n Redirect::to(\"index.php?rdr=1\");\n }\n } else {\n $query = \"SELECT fname $username, pwd FROM $login WHERE $username = ?\";\n $type_array = array('s');\n $data_array = array($user);\n\n $res = $db->select($query, $type_array, $data_array);\n if (!empty($res)) {\n echo 'Wrong password for ' . $user;\n// echo '.' . $user . '.' . $pwd . '.' . $login . '.';\n } else {\n echo 'The username does not exist';\n }\n }\n }\n }", "function login_post()\n\t{\n\t\t$user = $this->m_user_model->get(array(\n\t\t\t\"user_name\" => $this->input->post('username'), \n\t\t\t\"user_pass\" => $this->input->post('password'), \n\t\t\t));\n\n\t\tif ($user) {\n\t\t\t$array = array(\n\t\t\t\t'userid' => $user->user_id,\n\t\t\t\t'username' => $user->user_name,\n\t\t\t\t'nama' => $user->nama,\n\t\t\t\t'no_rm' => $user->no_rm,\n\t\t\t\t'group' => $user->level,\n\t\t\t\t'loged_in' => TRUE,\n\t\t\t);\n\t\t\t\n\t\t\t$this->session->set_userdata( $array );\n\t\t\tif ($user->level == 1) {\n\t\t\t\tredirect('dashboard','refresh');\n\t\t\t}elseif ($user->level == 2) {\n\t\t\t\tredirect('dashboard','refresh');\n\t\t\t}else{ //$user->level == 3\n\t\t\t\tredirect('dashboard','refresh');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->session->set_flashdata('msg', 'Username atau password Anda Salah! Silahkan coba lagi');\n\t\t\tredirect('auth','refresh');\n\t\t}\n\t}", "public function login($user, $pass, $persistent);", "function validate_login($user_name = '', $password = '') {\n $credential = array('user_name' => $user_name, 'profile_password' => $password);\n \n // Checking login credential for admin\n $query = $this->db->get_where('user', $credential);\n if ($query->num_rows() > 0) {\n $row = $query->row();\n $this->session->set_userdata('user_login', 'true');\n $this->session->set_userdata('login_user_id', $row->user_id);\n $this->session->set_userdata('name', $row->user_name);\n $this->session->set_userdata('email', $row->user_email);\n return 'success';\n }\n \n return 'invalid';\n }", "function login() {\n $username = Slim::getInstance()->request()->post('username');\n $password = Slim::getInstance()->request()->post('password');\n\n try {\n $db = getConnection();\n\n\t$sql = \"SELECT userId FROM users WHERE username=:username\";\n\t$stmt = $db->prepare($sql);\n\t$stmt->bindParam(\"username\", $username);\n\t$stmt->execute();\n\t$username_test = $stmt->fetchObject();\n\tif(empty($username_test)) {\n\t\techo \"error_username_doesnt_exists\";\n\t\treturn;\n\t}\n\n\t$sql = \"SELECT password FROM users WHERE username=:username\";\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"username\", $username);\n $stmt->execute();\n $storedPassword = $stmt->fetchObject()->password;\n\n if(empty($storedPassword)) {\n echo \"null\";\n } else if(strcmp($password, $storedPassword) == 0) {\n\t\t $query = \"SELECT userId FROM users WHERE username=:username\";\n\t\t $stmt2 = $db->prepare($query);\n\t\t $stmt2->bindParam(\"username\", $username);\n\t\t $stmt2->execute();\n \t echo '{\"Username\": \"' . $username . '\", \"ID\": ' . $stmt2->fetchObject()->userId . '}'; \n } else {\n\t\techo \"null\";\n\t}\n\n $db = null;\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n }\n}", "public function login(){\n\n }", "function pgLogin($user, $passw) {\n $passw_crypt = pgCodifica($user, $passw);\n $uuid = sgLogin($user, $passw_crypt);\n\n //Si el id es diferente al error...\n if ($uuid <> 'KO!') {\n /**\n * Usuario Logeado\n */\n\n $name = sgInfoUser($uuid['id']);\n\n $_SESSION['id'] = $uuid['id'];\n $_SESSION['name'] = $name['name'];\n\n return 'OK!';\n } else {\n /**\n * Usuario no logeado\n */\n return 'KO!';\n }\n }", "public function login_user()\n\t{\n\t\t$form_filled = true;\n\n\t\t//a way to set default values\n\t\tif (isset($_POST['username']) && $_POST['username'] != \"\") \n\t\t{\n\t\t\t$username = $_POST[\"username\"];\n\t\t} else\n\t\t{\n\t\t\t$username = \"\";\n\t\t\t$form_filled = false;\n\t\t}\n\t\tif (isset($_POST['password']) && $_POST['password'] != \"\") \n\t\t{\n\t\t\t$password = $_POST[\"password\"];\n\t\t} else\n\t\t{\n\t\t\t$password = \"\";\n\t\t\t$form_filled = false;\n\t\t}\n\n\t\tif ($form_filled)\n\t\t{\n\t\t\t$table = $this->getTableFormat(\"users\");\n\t\t\t$results = DB::query(\"SELECT id, username, password FROM $table\");\n\t\t\tforeach ($results as $row) {\n\t\t\t\tif ($row['username'] == $username)\n\t\t\t\t{\n\t\t\t\t\tif (password_verify($password, $row['password']))\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo \"Login Correct\";\n\t\t\t\t\t\t$logged_in = true;\n\t\t\t\t\t\t//$_SESSION['user'] = $row['id'];\n\n\t\t\t\t\t\t/*Add login to logins table*/\n\t\t\t\t\t\t$userid = $row['id'];\n\t\t\t\t\t\t$userip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t\t\t\t$userip2 = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$userip2 = $userip;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$current_time = time();\n\t\t\t\t\t\t$table = $this->getTableFormat(\"logins\");\n\t\t\t\t\t\tDB::insert($table, array(\n\t\t\t\t\t\t 'userid' => $userid,\n\t\t\t\t\t\t 'user_ip' => $userip,\n\t\t\t\t\t\t 'user_ip_2' => $userip2,\n\t\t\t\t\t\t 'last_action' => $current_time\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t//now, lets get the id of the session, hash it, and save it in the session variable\n\t\t\t\t\t\t$login_results = DB::query(\"Select * FROM $table\");\n\t\t\t\t\t\tforeach ($login_results as $i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($i['userid'] == $userid && $i['user_ip'] == $userip && $i['user_ip_2'] == $userip2 && $i['last_action'] == $current_time) {\n\t\t\t\t\t\t\t\t//echo \"found the record\";\n\t\t\t\t\t\t\t\t$_SESSION['user'] = hash('ripemd160', $i['id']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t//echo \"Username or Password not correct\";\n\t\t\t\t\t$logged_in = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function do_login($data)\n {\n $this->db->select(\"id,nama,email,no_hp,username,level,id_,blokir\");\n //$this->db->where(array(\"blokir\"=>\"N\"));\n $this->db->where($data);\n $hasil = $this->db->get('v_member_all');\n if($hasil->num_rows()>0){\n $data = $hasil->row(1);\n if($data->blokir == \"Y\"){\n return array(\"status\"=>false,\"message\"=>\"Akun Anda di Nonaktifkan.\");\n }\n $sesi = new myObject();\n $sesi->islogin = true;\n $sesi->nama = $data->nama;\n $sesi->id = $data->id;\n $sesi->email = $data->email;\n $sesi->no_hp = $data->no_hp;\n $sesi->level = $data->level;\n $sesi->user = $data->username;\n $sesi->id_member = $data->id_;\n set_session(\"user\",$sesi);\n return array(\"status\"=>true);\n }\n unset_session(\"user\");\n return array(\"status\"=>false,\"message\"=>\"Username / Password Salah\");\n }", "private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }", "function user_login($username,$password,$redirect='/'){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t$user = $app->db->findOne('user', array('login'=>$username) );\n\tif( $user['pass'] == passhash($password) ){\n\t\t$app->store( \"user\",$user['_id'] );\n\t\t$app->redirect( $redirect );\n\t}else{\n\t\t$app->redirect( $app->getBaseUri().'/login');\n\t}\n\n}", "public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }", "public function login($userName, $password){\r\n \r\n $sql = \"SELECT * FROM CUSTOMERS WHERE cus_username = '$userName' OR cus_email = '$userName'\";\r\n \r\n $result = $this->readObject($sql);\r\n //echo print_r($result);\r\n \r\n // The password in the database needs to be a hashed string, plain text is not allowed.\r\n // echo $hash = password_hash(\"dev\", PASSWORD_BCRYPT);\r\n // thislogin method is vunreable to SQL injection\r\n // investigate:http://piotrpasich.com/how-to-hack-the-form-sql-injection/\r\n // $stmt = $db->prepare(�update users set parameter = ? where id = ?�);<br>$stmt->bind_param(�si�,$name,$id);<br>$stmt->execute();\r\n \r\n \r\n \r\n if ($result['responseContent']->num_rows > 0){\r\n \r\n while ($row = $result['responseContent']->fetch_assoc()) {\r\n \r\n if(($userName == $row[\"cus_username\"] || $userName == $row[\"cus_email\"]) && password_verify($password,$row[\"cus_pass\"])){\r\n \r\n $_SESSION['valid'] = true;\r\n $_SESSION['timeout'] = time();\r\n $_SESSION['username'] = $userName;\r\n $_SESSION['status'] = 'good';\r\n echo 'You have entered valid user name and password';\r\n $response=TRUE;\r\n break;\r\n } else {\r\n $response=FALSE;\r\n }\r\n \r\n \r\n \r\n if ($response == FALSE) {\r\n //bad input\r\n echo \"Username or password dont match our records\";\r\n $_SESSION['status']='bad';\r\n //header(\"Location:\".\"../../templates/loginRegistration/index.php\");\r\n exit();\r\n }\r\n \r\n }\r\n header(\"Location:\".\"../index.php\");\r\n exit();\r\n } elseif ($result->num_rows == 0){\r\n //there are no such users in the database\r\n echo \"Username or password dont match our records. No such user\";\r\n $_SESSION['status']='bad';\r\n //header(\"Location:\".\"../../templates/loginRegistration/index.php\");\r\n exit();\r\n \r\n } else {\r\n //There is another error\r\n echo $result['responseMessage'];\r\n echo \"Ops. There is something wrong with the database!\";\r\n $_SESSION['status']='error';\r\n //header(\"Location:\".\"../../templates/loginRegistration/index.php\");\r\n exit();\r\n }\r\n \r\n\r\n }", "public function loginUser() {\n $this->form_validation->set_rules('username', 'Username', 'trim|required');\n $this->form_validation->set_rules('password', 'Password', 'required');\n\n if ($this->form_validation->run() == FALSE) {\n $this->login();\n\n } else {\n $formUsername = $this->input->post('username');\n $formPassword = $this->input->post('password');\n $userData = $this->UserManager->loginUser($formUsername, $formPassword);\n\n if (gettype($userData) !== 'string') {\n $this->session->set_userdata($userData);\n redirect('/SiteController/homepage');\n\n }else{\n $this->session->set_userdata('errorMsg', $userData);\n $this->login();\n }\n }\n }", "function loginUser($user,$password){\n if($this->connection){\n $table = $this->getTableConstant();\n $query_selectUser = \"SELECT * FROM $table WHERE user=?\";\n $statement = $this->connection->prepare($query_selectUser);\n $statement->bind_param('s', $user);\n $statement->execute();\n $result = $statement->get_result();\n while($row = $result->fetch_assoc()){\n $hash = $row['password'];\n $userID = $row['id'];\n if(password_verify($password, $hash)){\n $_SESSION['loggedIn'] = true;\n $_SESSION['userName'] = $user;\n $_SESSION['userID'] = $userID;\n return true;\n }\n }\n }\n return false;\n }", "function login_user( $user, $password )\n {\n //Unimplemented\n }", "public function postLoginAction()\n {\n //get input\n $inputs = $this->getPostInput();\n\n //define default\n $default = [\n 'status' => 'active'\n ];\n\n // Validate input\n $params = $this->myValidate->validateApi($this->userLogin, $default, $inputs);\n\n if (isset($params['validate_error']))\n {\n //Validate error\n return $this->responseError($params['validate_error'], '/users');\n }\n\n //process user login\n $result = $this->userService->checkLogin($params);\n\n //Check response error\n if (!$result['success'])\n {\n //process error\n return $this->responseError($result['message'], '/users');\n }\n\n //return data\n $encoder = $this->createEncoder($this->modelName, $this->schemaName);\n\n return $this->response($encoder, $result['data']);\n }", "function userLogin($argArrPost) {\n //echo '<pre>';print_r($argArrPost);exit;\n\n $objValid = new Validate_fields;\n $objCore = new Core();\n $arrUserFlds = array('pkUserID', 'UserEmail', 'UserPassword', 'UserFirstName', 'UserType', 'UserStatus', 'UserLastName');\n //$varUserWhere = ' 1 AND UserEmail = \\''.$argArrPost['frmUserLoginEmail'].'\\' AND UserPassword = \\''.md5(trim($argArrPost['frmUserLoginPassword'])).'\\' AND UserStatus = \"Active\" AND UserType = \"'.$argArrPost['frmHiddenUserType'].'\"';\n $varUserWhere = ' 1 AND UserEmail = \\'' . $argArrPost['frmUserLoginEmail'] . '\\' AND UserPassword = \\'' . md5(trim($argArrPost['frmUserLoginPassword'])) . '\\' AND UserType = \"' . $argArrPost['frmHiddenUserType'] . '\"';\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n\n\n if (count($arrUserList) > 0) {\n if (isset($argArrPost['frmUserActvationID']) && $argArrPost['frmUserActvationID'] <> '') {\n $varwhere = ' 1 AND pkUserID = ' . $arrUserList[0]['pkUserID'] . ' AND UserAccountActivationToken = \"' . base64_decode($argArrPost['frmUserActvationToken']) . '\"';\n $arrUpdateFlds = array('UserAccountActivationToken' => '', 'UserStatus' => 'Active', 'UserDateUpdated' => 'now()');\n $varaffectedRecord = $this->update(TABLE_USERS, $arrUpdateFlds, $varUserWhere);\n }\n if ($varaffectedRecord || $arrUserList[0]['UserStatus'] == 'Active') {\n $_SESSION['VenusetP_UserEmail'] = $arrUserList[0]['UserEmail'];\n $_SESSION['VenusetP_UserID'] = $arrUserList[0]['pkUserID'];\n $_SESSION['VenusetP_UserName'] = $arrUserList[0]['UserFirstName'];\n $_SESSION['Venuset_UserType'] = $arrUserList[0]['UserType'];\n $_SESSION['Venuset_UserLastName'] = $arrUserList[0]['UserLastName'];\n\n if (isset($_POST['frmRememberMe'])) {\n setcookie(\"cook_VenusetP_UserEmail\", $_SESSION['VenusetP_UserEmail'], time() + 60 * 60 * 24 * 30, \"/\");\n setcookie(\"cook_VenusetP_UserID\", $_SESSION['VenusetP_UserID'], time() + 60 * 60 * 24 * 30, \"/\");\n setcookie(\"cook_Venueset_UserPassword\", $argArrPost['frmUserLoginPassword'], time() + 60 * 60 * 24 * 30, \"/\");\n setcookie(\"cook_Venuset_UserType\", $_SESSION['Venuset_UserType'], time() + 60 * 60 * 24 * 30, \"/\");\n }\n return true;\n } else {\n $objCore->setErrorMsg(FRON_END_USER_ACCOUNT_DEACTIVATE_ERROR);\n return false;\n }\n } else {\n $objCore->setErrorMsg(FRON_END_USER_LOGIN_ERROR);\n return false;\n }\n }", "function loginFunc($user, $pass) {\n\tif (authentificate($user, $pass))\n\t\tresponseSuccess();\n}" ]
[ "0.79128355", "0.7779438", "0.7697035", "0.7689193", "0.76629335", "0.76427066", "0.76314116", "0.75956595", "0.75869507", "0.75869507", "0.7540176", "0.7522943", "0.75073534", "0.7459436", "0.74426806", "0.7440539", "0.7407491", "0.7403313", "0.73901427", "0.7375578", "0.7368521", "0.7362713", "0.7349794", "0.7344436", "0.7343417", "0.7317803", "0.7317094", "0.73128986", "0.73022693", "0.7273232", "0.7267612", "0.7255633", "0.72471154", "0.72359085", "0.722773", "0.7219982", "0.7210442", "0.72104055", "0.72046715", "0.71984446", "0.71890664", "0.71831197", "0.7179982", "0.71760374", "0.71737367", "0.7173492", "0.7167919", "0.7160634", "0.7160473", "0.71450067", "0.714098", "0.71315485", "0.7127727", "0.7125715", "0.71199316", "0.71089196", "0.7108799", "0.71062195", "0.71051055", "0.7102294", "0.7099988", "0.7098306", "0.70909965", "0.7087905", "0.70861965", "0.7086157", "0.7074788", "0.70709515", "0.7068569", "0.7063708", "0.7063641", "0.7061371", "0.70584637", "0.7055085", "0.7055001", "0.70510286", "0.7046637", "0.7045167", "0.70444834", "0.7042334", "0.7025251", "0.702518", "0.7023432", "0.7013055", "0.700946", "0.7007896", "0.70061415", "0.70054567", "0.70027703", "0.6995558", "0.6994268", "0.6993135", "0.6990847", "0.69879985", "0.6980145", "0.6979138", "0.69759846", "0.69706947", "0.6968007", "0.69636345" ]
0.7570047
10
function is used to setplaces Params required: user_id,city,country,year,lat,long. return status, message
function addPlaces($data) { $response=array(); $requiredData['user_id'] = @trim($data->user_id); $requiredData['user_city']=@trim($data->user_city); $requiredData['user_country']=@trim($data->user_country); $requiredData['user_year']=@trim($data->user_year); $requiredData['user_lat'] = @trim($data->user_lat); $requiredData['user_long']=@trim($data->user_long); foreach($requiredData AS $key=>$val){ if(trim($val) == ''){ $response['status'] = 'Error'; $response['message'] = 'Please Specify '.ucwords(str_replace("_"," ",$key)); return $response; } } if($requiredData['user_id'] == ''){ $response['status'] = 'Error'; $response['message'] = 'Sorry! user id is missing '; return $response; } elseif($requiredData['user_city'] == ''){ $response['status'] = 'Error'; $response['message'] = 'Sorry! city is missing '; return $response; }elseif($requiredData['user_country'] == ''){ $response['status'] = 'Error'; $response['message'] = 'Sorry! country is missing '; return $response; } elseif($requiredData['user_year'] == ''){ $response['status'] = 'Error'; $response['message'] = 'Sorry! year is missing '; return $response; } else { $query = "INSERT INTO `places` (`user_id`, `city`, `country`, `year`, `lat`, `long`) VALUES ('".$requiredData['user_id']."', '".$requiredData['user_city']."', '".$requiredData['user_country']."','".$requiredData['user_year']."','".$requiredData['user_lat']."','".$requiredData['user_long']."')"; $this->query($query); $result=array(array()); $query = "select * from places where user_id='".$requiredData['user_id']."' "; $rec=$this->query($query); if($rec && mysql_num_rows($rec)>= 1){ $i=0; while($row=mysql_fetch_array($rec)) { $result[$i]['place_id']=$row['id']; $result[$i]['user_id']=$row['user_id']; $result[$i]['city']=$row['city']; $result[$i]['country']=$row['country']; $result[$i]['year']=$row['year']; $result[$i]['lat']=$row['lat']; $result[$i]['long']=$row['long']; $i++; } } $response['status']='Success'; $response['message']='Places information stored successfully'; $response['data']=$result; return $response; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, $id)\n {\n //\n $user = JWTAuth::parseToken()->authenticate();\n $userId = $user->id;\n $GetUserType=User::where('id','=',$userId)->select('userType')->first();\n $userType=$GetUserType->userType; \n $toBeEdited=$id;\n if($userType==1)\n {\n $places = Place::where('id','=',$toBeEdited)->first();\n if ($request->has('longitude')) {\n $places->longitude = $request->longitude;\n }\n if ($request->has('latitude')) {\n $places->latitude = $request->latitude;\n }\n if($request->has('Address')){\n $places->Address = $request->Address;\n }\n if($request->has('city')){\n $places->city = $request->city; \n }\n if($request->has('area')){\n $places->area = $request->area; \n }\n if($request->has('pType')){\n $places->pType = $request->pType; \n }\n if($request->has('subType')){\n $places->subType = $request->subType;\n }\n if($request->has('postCode')){\n $places->postCode = $request->postCode;\n }\n if($request->has('flag')){\n $places->flag = $request->flag;\n }\n //$places->user_id = $request->user_id; \n\n $places->save();\n\n return new JsonResponse([\n 'message'=>'Place Updated'\n ]);\n }\n else{\n return new JsonResponse([\n 'message' => 'User Not Permitted To See This Resource.'\n ]);\n }\n }", "function save_user_loc($db, $user_id, $user_loc)\n{\n\ttry\n\t{\n\t\t$user_loc_tab = explode(',', $user_loc);\n\t\t$stmt = $db->conn->prepare(\"SELECT user_true_long, user_true_lat FROM profils WHERE user_id = :user_id\");\n\t\t$stmt->execute(array(':user_id'=>$user_id));\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\tif ($row['user_true_long'] != $user_loc_tab[1] || $row['user_true_lat'] != $user_loc_tab[0])\n\t\t{\n\t\t\t$stmt = $db->conn->prepare(\"UPDATE profils SET user_true_long = :user_long, user_true_lat = :user_lat, user_true_city = :user_city, user_true_city_code = :user_city_code, user_true_country = :user_country WHERE user_id = :user_id\");\n\t\t\t$stmt->execute(array(':user_id'=>$user_id, ':user_long'=>$user_loc_tab[1], ':user_lat'=>$user_loc_tab[0], ':user_city'=>$user_loc_tab[2], ':user_city_code'=>$user_loc_tab[3], ':user_country'=>$user_loc_tab[4]));\n\t\t}\n\t}\n\tcatch(PDOExeption $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n}", "public function setPlace($place){\n $this->place=$place;\n }", "function TechnomadLocation ($user_id) {\n $data = $this->fetchGoogleLatitudeLocation($user_id);\n $this->current_city = $data['current_city'];\n $this->latitude = $data['latitude'];\n $this->longitude = $data['longitude'];\n $this->last_updated = $data['last_updated'];\n $this->last_fetched = time();\n // TODO: Did we move cities?\n }", "private function setUserMapPlace() {\n\t\t$this->mapPlaceManager->unsetMapPlace($this->user->id);\n\n\t\t$count = $this->mapPlaceManager->getFreeMapPlaceCount();\n\t\tif($count < 10 || GlobalConfig::ALWAYS_EXTEND_MAP ) {\n\t\t\t$mapManager = new MapManager($this->db);\n\t\t\t$mapManager->extendMap();\n\t\t}\n\t\t\t\n\t\t$mapPlace = $this->mapPlaceManager->getRandomFreeMapPlace();\n\t\t$mapPlace->userid = $this->user->id;\n\t\tif(!$mapPlace) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$this->mapPlaceManager->updateMapPlace($mapPlace);\n\t\t\treturn true;\n\t\t}\n\t}", "public function addresssavevenue(Request $request)\n {\n $respAr = array();\n $errorflagmsg = 0;\n $error_message='';\n $venuecretaeOredit=0;\n $nicknmres = 0;\n $user_id = 1;\n if ($request->session()->has('front_id_sess'))\n {\n $user_id=$request->session()->get('front_id_sess'); // get session \n $venueID = $this->getseo_name($user_id);\n }\n //**********check modifying date starts here\n $r = $this->check_modifying_date($venueID,$user_id);\n //IF MODIFYING DATE IS 1 THEN THIS IS FIRST TIME EDIT //*** update user_master table ends\n \n $addressvenue1 = $request->input('address1val');\n $addressvenue2 = $request->input('address2val');\n \n $countryId = $request->input('countrydata');\n $statelistdata = $request->input('statelistdata');\n $tablenamecountry ='location_country';\n $tablenamestate ='location_state';\n $countryfield = 'country_name';\n $statefield = 'state_name';\n\n\n\n$chkvalid=$this->checksavevenueaddressamenities($request);\n\nif($chkvalid===true)\n{\n //$countrycmpfield = 'id';\n //$statecmpfield = '';\n \n $countryname = $this->getcountrystatevenueedit($countryId,$tablenamecountry,$countryfield);\n $statename = $this->getcountrystatevenueedit($statelistdata,$tablenamestate,$statefield);\n \n $towndata = $request->input('towndata');\n $zipdata = $request->input('zipdata');\n //$addressvenue1 = $request->input('valchk');\n $valchk = $request->input('valchk');\n \n //*************getltlong from address starts here\n $hlprdta = urlencode($addressvenue1.' '.$addressvenue2.' '.$towndata.' '.$zipdata.' '.$statename.' '.$countryname);\n $LatLongchk = getLatLong($hlprdta);\n $latitude = $LatLongchk['latlong'][0]['latitude'];\n // echo \"<br>\";\n $longitude = $LatLongchk['latlong'][0]['longitude'];\n $TimeZoneCheck = getTimezone($latitude,$longitude);\n $timezoneId = $TimeZoneCheck['timeZoneId'];\n $timezoneName = $TimeZoneCheck['timeZoneName'];\n //*************get latlong from address ends here\n \n $updatedatavenue = array(\n 'address_1' =>$addressvenue1,\n 'address_2' =>$addressvenue2,\n 'country' =>$countryId,\n 'state'=>$statelistdata,\n 'city'=>$towndata,\n 'zip'=>$zipdata,\n 'venue_lat'=>$latitude,\n 'venue_long'=>$longitude,\n 'venue_timezone'=>$timezoneId,\n 'modified_date'=>date('Y-m-d H:i:s')\n );\n //echo \"<pre>\";\n //print_r($updatedatavenue);\n \n //$insertvaenueaminity = \n $amnty = count($valchk);\n if($amnty>0)\n {\n DB::table('venue_amenity_rel')\n ->where('venue_id', $venueID)\n ->where('v_creator_id', $user_id)\n ->delete();\n for($i=0;$i<$amnty;$i++)\n {\n DB::table('venue_amenity_rel')->insert([\n \n ['venue_id' => $venueID,'v_creator_id' => $user_id, 'amenity_id' => $valchk[$i],'create_date' =>date('Y-m-d H:i:s')]\n ]);\n }\n }\n \n $updatevenueqry = DB::table('venue_master')\n ->where('id', $venueID)\n ->where('creater_id', $user_id)\n ->update($updatedatavenue);\n if($updatevenueqry)\n {\n // echo \"Data updated successfully\";\n $respAr['flag']=1;\n \n }else\n {\n //echo \"Data not updated succesfully\";\n $respAr['flag']=0;\n }\n if($r == 1)\n {\n $request->session()->flash('front_successmsgdata_sess', 'Your venue has been created successfully .');\n //return redirect('/');\n $venuecretaeOredit=1;\n //**get nickname starts here\n $nicknmres = $this->getnicknm($venueID,$user_id);\n //**get nickname ends here\n \n }\n $errorflagmsg = 1;\n \n\n }\n \n else\n { \n\n $error_message = $chkvalid->messages();\n }\n $error_msgAr=array(); // echo $amnty;\n // die;\n $respAr['venuecretaeedit']=$venuecretaeOredit;\n $respAr['nicknmdata']= $nicknmres;\n $respAr['errormsgdata']= $error_message;\n $respAr['errorflagmsghck']= $errorflagmsg;\n\n echo json_encode($respAr); \n \n // print_r($addressvenue1);die;\n //$j = count($addressvenue1);\n \n }", "function setPlace( &$value )\n {\n $this->Place = $value;\n }", "public function updateUserPosition($userId, $latitude, $longitude);", "public function updateLocation_post(){\n $user_id = $this->input->post('user_id');\n $latitude = $this->input->post('latitude');\n $longitude = $this->input->post('longitude');\n $data = $this->User_model->update_data('tbl_users',array('latitude'=>$latitude,'longitude'=>$longitude),array('id'=>$user_id));\n\n if($data != 1)\n\n {\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"updateLocation\",\n \"ResponseCode\" => false,\n \"MessageWhatHappen\" => \"Not updated\"\n\n );\n }else{\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"updateLocation\",\n \"ResponseCode\" => true,\n \"MessageWhatHappen\" => \"Updated successfully\"\n\n );\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "function updateCityMgrInformation($userid,$firstname,$lastname,$email,$mobile,$address,$country,$city,$shopname)\n{\n\n\tif($country!='' && $city=='')\n\t{\n\t\t$queryString = \"update coupons_users set firstname = '$firstname' ,lastname = '$lastname', email = '$email', mobile = '$mobile', address = '$address',country = '$country' where userid= '$userid'\";\n\t\tmysql_query($queryString) or die(mysql_error());\n\t\treturn 1;\n\t}\n\n\tif($country!='' && $city!='')\n\t{\n\t\tif($shopname!='')\n\t\t{\n\t\t$queryString = \"SELECT shop_city FROM coupons_shops where shopid='$shopname'\";\n\t\t$resultSet = mysql_query($queryString);\n\t\t\tif($row = mysql_fetch_array ($resultSet))\n\t\t\t{\n\t\t\t\t$rs = $row['shop_city'];\n\t\t\t}\n\t\t\t\tif($rs == $city)\n\t\t\t\t{\n\t\t\t\t\t$queryString = \"update coupons_users set firstname = '$firstname' ,lastname = '$lastname', email = '$email', mobile = '$mobile', address = '$address',country = '$country',city = '$city',user_shopid = '$shopname' where userid= '$userid'\";\n\t\t\t\t\tmysql_query($queryString) or die(mysql_error());\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$queryString = \"update coupons_users set firstname = '$firstname' ,lastname = '$lastname', email = '$email', mobile = '$mobile', address = '$address',country = '$country',city = '$city',user_shopid = '$shopname' where userid= '$userid'\";\n\t\t\t\tmysql_query($queryString) or die(mysql_error());\n\t\t\t\treturn 1;\n\t\t}\n\t}\n\n}", "public function store(Request $request)\n {\n if(!empty($request->get('id'))){\n\n $long = $request->get('long');\n $lat = $request->get('lat');\n\n $data = Data::where('id', '=', $request->get('id'))->first();\n\n if($data->cep != $request->get('cep')){\n $endpoint = 'https://www.google.com/maps/search/' . $request->street . '+' . $request->number . '+' . $request->neighborhood . '+' . $request->city . '+' . $request->state;\n $endpoint = str_replace(' ', '%20', $endpoint);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n\n preg_match(\"/APP_INITIALIZATION_STATE=\\[\\[\\[(-?\\d+\\.\\d+),(-?\\d+\\.\\d+),(-?\\d+\\.\\d+)\\]/m\", $response, $group);\n\n $long = $group[2];\n $lat = $group[3];\n }\n\n Data::where('id', '=', $request->get('id'))->update(\n [\n 'status' => $request->get('status'),\n 'street' => $request->get('street'),\n 'number' => $request->get('number'),\n 'neighborhood' => $request->get('neighborhood'),\n 'city' => $request->get('city'),\n 'state' => $request->get('state'),\n 'cep' => $request->get('cep'),\n 'whatsapp' => $request->get('whatsapp'),\n 'lat' => $lat,\n 'long' => $long,\n ]\n );\n\n return redirect()->back()->with('success', 'Atualizado com sucesso ...'); \n }\n\n $data = new Data();\n $data->user_id = Auth::user()->id;\n $data->fill($request->all());\n\n $endpoint = 'https://www.google.com/maps/place/' . $data->street . '+' . $data->number . '+' . $data->neighborhood . '+' . $data->city . '+' . $data->state;\n $endpoint = str_replace(' ', '+', $endpoint);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n\n preg_match(\"/APP_INITIALIZATION_STATE=\\[\\[\\[(-?\\d+\\.\\d+),(-?\\d+\\.\\d+),(-?\\d+\\.\\d+)\\]/m\", $response, $group);\n\n $data->long = $group[2];\n $data->lat = $group[3];\n\n $data->save();\n \n return redirect()->back()->with('success', 'Atualizado com sucesso'); \n }", "public function setGeolocation($user_id, $latitude, $longitude, $height)\n {\n $query = \"INSERT INTO geolocation(user_id, latitude, longitude, height, updated_at)\n VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP)\n ON DUPLICATE KEY\n UPDATE latitude=VALUES(latitude), longitude=VALUES(longitude),\n height=VALUES(height), updated_at=CURRENT_TIMESTAMP\";\n $stmt = $this->conn->prepare($query);\n $stmt->bind_param(\"iddd\", $user_id, $latitude, $longitude, $height);\n $result = $stmt->execute();\n $stmt->close();\n\n return $result;\n }", "function createPlace($workflowId, $placeDatas);", "function updatedb($lat, $lng, $address)\r\n\t{\r\n\t\t$query = \"UPDATE \" . $this->table . \" SET latitude = '\". $lat .\"', longitude = '\". $lng .\"' WHERE address = '\". $address .\"'\";\r\n\t\t$result = mysql_query($query);\r\n\t\t$status = \"\";\r\n\t\tif($lat==0 && $lng==0){\r\n\t\t $status = \"<font color=red><b>FAILED</b></font>\";\r\n\t\t} else {\r\n\t\t $status = \"<font color=green><b>SUCCESS</b></font>\";\r\n\t\t}\r\n\t\t\r\n\t\techo \"<tr>\r\n\t\t\t\t\t<td>$address</td>\r\n\t\t\t\t\t<td>$lat\".\",\".\"$lng</td>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<td>\".$status.\"</td>\r\n\t\t\t\t</tr>\";\r\n\t}", "public function setGpsUser(Request $request) {\n $result = array('status' => false, 'data' => $request->all(), 'messages' => array('success' => '', 'errors' => ''));\n\n if (!Auth::check()) {\n $result['messages']['errors'] = 'Yêu cầu đăng nhập trước khi sử dụng tính năng này';\n\n return $result;\n }\n\n if ($request->isMethod('POST')) {\n $data = $request->all();\n\n if (empty($data['lat'])) {\n $result['messages']['errors'] = 'Vĩ độ không được để trống';\n\n return $result;\n }\n\n if (empty($data['long'])) {\n $result['messages']['errors'] = 'Kinh độ không được để trống';\n\n return $result;\n }\n\n $user = Auth::user();\n $user->lat_long = json_encode(array('lat' => $data['lat'], 'lng' => $data['long'], 'icon' => URL::action('\\Api\\Controllers\\MainController@index').'/backend/images/shipper.png'));\n $user->save();\n\n $result['status'] = true;\n $result['messages']['success'] = 'Cập nhật thành công toạ độ';\n }\n\n return $result;\n }", "public function admin_add($year = null, $user_id = null) {\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places,geometry','places_autocomplete','tools'));\n \t\n \t//on recupere l'equipage pour le breadcrumbs\n\t $this->Position->User->recursive = 0;\n \t$this->set('user',$this->Position->User->find('first', array('conditions' => array('User.id' => $user_id))));\n \n //on recupere la position de son école\n $this->Position->User->recursive = 0;\n $school = $this->Position->User->find('first', array('conditions' => array('User.id' => $user_id),\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => array('School.lat', 'School.lon')));\n $this->set('school',$school);\n \n $this->request->data['Position']['user_id']=$user_id;\n \n if ($this->request->is('post')) {\n \t\n $this->Position->create();\n if ($this->Position->save($this->request->data)&&$this->update_distance($user_id)) {\n $this->Session->setFlash(\"Les modifications ont bien été enregistrées\", 'default', array('class' => 'alert-box radius alert-success'));\n return $this->redirect(array('action' => 'index',$year,$user_id));\n }\n $this->Session->setFlash(\"Erreur lors de l'enregistrement\", 'default', array('class' => 'alert-box radius warning'));\n }\n }", "public function UpdateUserLatLong(){\n\t\t $input_data \t\t= \t$this->GetDecryptedData(Input::get()['request']);\n\t\t $rules = array(\n\t\t 'user_id' \t\t\t=> 'required',\n\t\t //'device_id' \t\t=> 'required',\n\t\t 'platform_type' => 'required',\n\t\t 'latitude' \t\t=> 'required',\n\t\t 'longitude' \t\t=> 'required',\n\t\t 'clinic_id' \t\t=> 'required',\n\t\t );\n\t\t $validator = Validator::make($input_data,$rules);\n\t\t if ($validator->fails()){\n\t\t\t $messages = $validator->messages();\n\t\t\t return $this->encrypt(json_encode(array('status' => 'error', 'message' => $validator->errors()->all())));\n\t\t }else{\n\t\t\t\t$user_id\t\t\t\t\t=\t$input_data['user_id'];\n\t\t\t\t$clinic_id\t\t\t\t\t=\t$input_data['clinic_id'];\n\t\t\t\t$longitude\t\t\t\t\t=\t$input_data['longitude'];\n\t\t\t\t$latitude\t\t\t\t\t=\t$input_data['latitude'];\n\t\t\t\t$user\t\t\t=\tUser_model::GetUserById($user_id);\n\t\t\t\tif(!empty($user)){\n\t\t\t\t\t$check_clinic_clock_out_status = ClinicStatusModel::where('provider_id',$user_id)->where('clinic_id',$clinic_id)->where('status',1)->whereNull('clock_out')->whereNotNull('clock_in')->get()->count();\n\t\t\t\t\t\tif($check_clinic_clock_out_status > 0){\n\t\t\t\t\t\t\t$update = GeoLocationModel::SaveLatLong($user_id,$clinic_id,$longitude,$latitude);\n\t\t\t\t\t\t\t\tif($update){\n\t\t\t\t\t\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'success','message'=>'Lat long saved.')));\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'success','message'=>'Technical error.')));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'error','message'=>'No records found.')));\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'error','message'=>'User not found.')));\n\t\t\t\t}\n\t\t }\n\t }", "public function testUpdatePlaceSuccess(): void\n {\n\n $response = $this->post(route('place-update'), [\n \"id\" => $this->placeFactory->id,\n \"name\" => \"juan\",\n \"company_id\" => $this->companyFactory->id,\n \"is_active\" => 1\n ], [\n 'Accept' => 'application/json'\n ]);\n\n $response->assertStatus(200);\n $response->assertJson([\n 'message' => 'profesional actualizado con éxito'\n ]);\n }", "public function __construct(Places $places)\n {\n $this->place = $places;\n }", "public function changeUserLocationAction()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$user = Application_Model_User::getAuth();\r\n\r\n\t\t\tif ($user == null)\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('You are not authorized to access this action');\r\n\t\t\t}\r\n\r\n\t\t\t$profile_id = $this->_request->getParam('user_id');\r\n\r\n\t\t\tif (!v::optional(v::intVal())->validate($profile_id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect user ID value: ' .\r\n\t\t\t\t\tvar_export($profile_id, true));\r\n\t\t\t}\r\n\r\n\t\t\t$queryOptions = [\r\n\t\t\t\t'auth' => $user,\r\n\t\t\t\t'link' => ['thumbs'=>[[448,320]]],\r\n\t\t\t\t'userVote' => $user != null ? true : false,\r\n\t\t\t\t'thumbs' => [[448,320],[960,960]]\r\n\t\t\t];\r\n\r\n\t\t\tif ($profile_id != null)\r\n\t\t\t{\r\n\t\t\t\t$profile = Application_Model_User::findById($profile_id, true);\r\n\r\n\t\t\t\tif ($profile == null)\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new RuntimeException('Incorrect user ID: ' .\r\n\t\t\t\t\t\tvar_export($profile_id, true));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$queryOptions['user'] = $profile;\r\n\t\t\t}\r\n\r\n\t\t\t$addressForm = new Application_Form_Address;\r\n\r\n\t\t\tif (!$addressForm->isValid($this->_request->getPost()))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException(My_Form::outputErrors($addressForm));\r\n\t\t\t}\r\n\r\n\t\t\t$data = $addressForm->getValues();\r\n\r\n\t\t\t$searchParameters = [\r\n\t\t\t\t'latitude' => $data['latitude'],\r\n\t\t\t\t'longitude' => $data['longitude'],\r\n\t\t\t\t'keywords' => $this->_request->getPost('keywords'),\r\n\t\t\t\t'filter' => SearchForm::getFilter($this->_request->getPost('filter')),\r\n\t\t\t\t'category_id' => (array) $this->_request->getPost('category_id'),\r\n\t\t\t\t'radius' => $this->_request->getPost('radius')\r\n\t\t\t];\r\n\r\n\t\t\t$searchForm = new SearchForm;\r\n\r\n\t\t\tif (!$searchForm->isValid($searchParameters))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException(My_Form::outputErrors($searchForm));\r\n\t\t\t}\r\n\r\n\t\t\t(new Application_Model_Address)->update($data,\r\n\t\t\t\t'id=' . $user['address_id']);\r\n\t\t\tApplication_Model_User::cleanUserCache($user);\r\n\r\n\t\t\t$response = ['status' => 1];\r\n\r\n\t\t\t$result = (new Application_Model_News)->search(['limit' => 15] +\r\n\t\t\t\t$searchParameters, $queryOptions);\r\n\r\n\t\t\tforeach ($result as $post)\r\n\t\t\t{\r\n\t\t\t\t$data = [\r\n\t\t\t\t\t'id' => $post['id'],\r\n\t\t\t\t\t'user_id' => $post['user_id'],\r\n\t\t\t\t\t'cid' => $post['category_id'],\r\n\t\t\t\t\t'lat' => $post['latitude'],\r\n\t\t\t\t\t'lng' => $post['longitude'],\r\n\t\t\t\t];\r\n\r\n\t\t\t\tif ($profile_id == null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$assets = [\r\n\t\t\t\t\t\t'post' => $post,\r\n\t\t\t\t\t\t'owner' => [\r\n\t\t\t\t\t\t\t'Name' => $post['owner_name'],\r\n\t\t\t\t\t\t\t'image_id' => $post['owner_image_id'],\r\n\t\t\t\t\t\t\t'image_name' => $post['owner_image_name']\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t'user' => $user,\r\n\t\t\t\t\t\t'limit' => 350\r\n\t\t\t\t\t];\r\n\r\n\t\t\t\t\tif (!empty($post['link_id']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$assets['link'] = [\r\n\t\t\t\t\t\t\t'id' => $post['link_id'],\r\n\t\t\t\t\t\t\t'link' => $post['link_link'],\r\n\t\t\t\t\t\t\t'title' => $post['link_title'],\r\n\t\t\t\t\t\t\t'description' => $post['link_description'],\r\n\t\t\t\t\t\t\t'author' => $post['link_author'],\r\n\t\t\t\t\t\t\t'image_id' => $post['link_image_id'],\r\n\t\t\t\t\t\t\t'image_name' => $post['link_image_name']\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$data['html'] = $this->view->partial('post/view.html', $assets);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$response['data'][] = $data;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\t$response = [\r\n\t\t\t\t'status' => 0,\r\n\t\t\t\t'message' => $e instanceof RuntimeException ? $e->getMessage() :\r\n\t\t\t\t\t'Internal Server Error'\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\t$this->_helper->json($response);\r\n\t}", "function update_location($user_id,$location,$connection) \n {\n if(!empty($location))\n {\n $salt_string=\"@!\";\n $username.=$salt_string;\n $query=\"UPDATE user_details SET location='$location' WHERE user_id='$user_id' LIMIT 1\";\n $result = mysqli_query($connection,$query);\n if($result)\n return true;\n else\n return false;\n }\n else\n return true;\n }", "public function testLocationCreationRequiredParameters()\n {\n $user = User::all()->random();\n\n $this->actingAs($user, 'api')\n ->post(\"api/location\", [\n 'branch' => 'Twofold Asperger-Academy',\n 'room' => '431',\n ]);\n $this->seeStatusCode(200);\n }", "public function updateInfo($uid, $place, $data) {\r\n if($this -> testConnection()) {\r\n $req = \"UPDATE user_info WHERE 'uid'={$uid} SET {$place}={$data}\";\r\n if($this -> c -> query($req) === TRUE) {\r\n echo \"Record updated successfully.\";\r\n return TRUE;\r\n } else {\r\n echo \"Error updating record: \".$this -> c -> error;\r\n return FALSE;\r\n }\r\n } else echo \"Not connected to server.\";\r\n return FALSE;\r\n }", "public function saveaddress() {\n if (isset($_POST['address'])) {\n $userId = $this->session->userdata('user_id');\n $address = $this->input->post('address');\n $result = $this->Users->saveaddress($address, $userId);\n if ($result) {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 1)));\n } else {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 0)));\n }\n }\n }", "function Create($userid,$lat,$long,$img)\n {\n $response=array();\n $response[\"success\"]=0; \n $response[\"content\"]= \"\";\n $response[\"message\"]=\"\";\n \n $park= new ParkLocation();\n $park->creator_id=$userid;\n $park->setLocation($long, $lat);\n \n $stta = (isset($this->Search($lat,$long)[\"content\"][0][\"address\"]))?true:false;\n \n $park->streetname=($park->streetname==\"\" && $stta)?$this->Search($lat,$long)[\"content\"][0][\"address\"]:\"undefined\";\n $park->streetImage=$img;\n \n $response[\"content\"]=$park;\n if($park->validated())\n { \n $model = new ParkModel($park,$this->db);\n $model->Attach($this);\n \n if(!$model->IsExists())\n {\n $status= $model->Create();\n if($status){\n $response[\"success\"]=$status;\n $response[\"message\"]=\"Successfully added\";\n }else\n {\n $response[\"message\"]=\"could not add the park details\";\n $response[\"success\"]=-1;\n $response[\"content\"]= $model->getError();\n }\n }else \n {\n $response[\"success\"]=-1; \n $response[\"content\"]= $park;\n $response[\"message\"]=\"Someone as already add this address as a park\";\n }\n \n \n }else\n {\n $response[\"content\"]=$park;\n $response[\"success\"]=-1; \n $response[\"message\"]=$park->getError();\n }\n return $response;\n }", "function updateLocation($UserID, $LastPointX, $LastPointY,$LastUpdateTime){\n $conn = connectDB();\n $updateLocationSQL = \"UPDATE Task SET Task.LastPointX =\".$LastPointX.\", Task.LastPointY =\".$LastPointY.\", Task.LastUpdateTime = \".$LastUpdateTime.\" WHERE Task.UserID = \".$UserID.\" AND Task.Canceled = 'N';\";\n $conn->query($updateLocationSQL);\n $conn->close();\n}", "function updateStoreAdminInformation($userid,$firstname,$lastname,$email,$mobile,$address,$country,$city,$shopname)\n{\n\n\t$queryString = \"SELECT shop_country FROM coupons_shops where shopid='$shopname'\";\n\t$resultSet = mysql_query($queryString);\n\n\t\tif($row = mysql_fetch_array($resultSet))\n\t\t{\n\t\t\t$rs = $row['shop_country'];\n\t\t}\n\n\n\t\tif($rs == $country)\n\t\t{\n\t\n\t\t\tif($city!='')\n\t\t\t{\n\t\t\t\t$queryString = \"update coupons_users set firstname = '$firstname' ,lastname = '$lastname', email = '$email', mobile = '$mobile', address = '$address', user_shopid='$shopname', country = '$country', city ='$city' where userid= '$userid'\";\n\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$queryString = \"update coupons_users set firstname = '$firstname' ,lastname = '$lastname', email = '$email', mobile = '$mobile', address = '$address', user_shopid='$shopname', country = '$country' where userid= '$userid'\";\n\t\t\t}\n\t\t \n\t\t\tmysql_query($queryString) or die(mysql_error());\n\t\t\treturn 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n}", "function grabUserLocation($input){\n $user_city = $input;\n $request_url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$user_city.\"%20Canada&sensor=false\";\n $USERJSON = file_get_contents($request_url);\n $result = json_decode($USERJSON);\n $lat=$result->results[0]->geometry->location->lat;\n $long=$result->results[0]->geometry->location->lng;\n return compact('lat','long');\n}", "public function update_address(){\n\t\t\t\t\t\t//$this->ADDRESS[$last_index] = $address;\n\t\t\t\t$error = 0;\n\t\t\t\t\t$updated = 0;\n\t\t\t\t\t\t\t$address;\n\t\t\t\t$count = 0;\n\n\n\t\t\t\twhile($count < $this->get_address_count()) {\n\n\n\t\t\t\t\t\tif($this->get_address($count + 1)->get_status() == 'updated' ) {\n\t\t\t\t\t\tif((!$address[$updated]['addressId'] = $this->get_address($count + 1)->get_id()) && $error = 1)\n\t\t\t\t\t\t\ttrigger_error('REQUIRED Organization (ID) not provided', E_USER_ERROR);\n\t\t\t\t\t\tif((!$address[$updated]['country'] = $this->get_address($count + 1)->get_country()) && $error = 1)\n\t\t\t\t\t\t\ttrigger_error('REQUIRED Organization (country) not provided', E_USER_ERROR);\n\t\t\t\t\t\tif((!$address[$updated]['city'] = $this->get_address($count + 1)->get_city()) && $error = 1)\n\t\t\t\t\t\t\ttrigger_error('REQUIRED Organization (city) not provided', E_USER_ERROR);\n\t\t\t\t\t\tif((!$address[$updated]['subCity'] = $this->get_address($count + 1)->get_sub_city()) && $error = 1)\n\t\t\t\t\t\t\ttrigger_error('REQUIRED Organization (Sub-City) not provided', E_USER_ERROR);\n\t\t\t\t\t\tif((!$address[$updated]['location'] = $this->get_address($count + 1)->get_location()) && $error = 1)\n\t\t\t\t\t\t\ttrigger_error('REQUIRED Organization (Location) not provided', E_USER_ERROR);\n\t\t\t\t\t\tif((!$address[$updated]['latitude'] = $this->get_address($count + 1)->get_latitude()))\n\t\t\t\t\t\t\ttrigger_error(' Organization (latitude) not provided', E_USER_WARNING);\n\t\t\t\t\t\tif((!$address[$updated]['longitude'] = $this->get_address($count + 1)->get_longitude() ))\n\t\t\t\t\t\t\ttrigger_error(' Organization (longitude) not provided', E_USER_WARNING);\n\n\t\t\t\t\t\t\t$updated++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$count++;\n\n\t\t\t\t}\n\n\n\n\t\t\t\t\tif($error == 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t$address = json_encode($address);\n\t\t\t\t\t\t\t\t$sql = 'CALL updateOrganizationAddress('.$this->get_id().', '.json_encode($address) .')';\n\t\t\t\t\t\t\t\t$statement = $this->DB_Driver->prepare_query($sql);\n\t\t\t\t\t\t\t\t$statement->execute();\n\t\t\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\t\t\ttrigger_error($e->getMessage(), E_USER_ERROR);\n\t\t\t\t\t\t\t$error = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn ($error == 0 ) ? true : false;\n\n\t\t\t}", "public function actionTakeMyLocation()\n\t{\n\t\t$result = \"Missing parameter\";\n\t\tif (isset($_REQUEST['latitude']) && $_REQUEST['latitude'] != NULL\n\t\t&& isset($_REQUEST['longitude']) && $_REQUEST['longitude'] != NULL\n\t\t&& isset($_REQUEST['altitude']) && $_REQUEST['altitude'] != NULL\n\t\t&& isset($_REQUEST['deviceId']) && $_REQUEST['deviceId'] != NULL\n\t\t&& isset($_REQUEST['time']) && $_REQUEST['time'] != NULL\n\t\t)\n\t\t{\n\t\t\t$latitude = (float) $_REQUEST['latitude'];\n\t\t\t$longitude = (float) $_REQUEST['longitude'];\n\t\t\t$altitude = (float) $_REQUEST['altitude'];\n\t\t\t$deviceId = $_REQUEST['deviceId'];\n\t\t\t$calculatedTime = date('Y-m-d H:i:s', $_REQUEST['time']);\n\n\t\t\t$result = \"No valid user id\";\t\n\t\t\tif (Yii::app()->user->id != false) \n\t\t\t{\n\t\t\t\t$sql = sprintf('UPDATE '\n\t\t\t\t. Users::model()->tableName() .'\n\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t \tlatitude = %f , '\n\t\t\t\t\t\t\t\t \t.'\tlongitude = %f , '\n\t\t\t\t\t\t\t\t \t.'\taltitude = %f ,\t'\n\t\t\t\t\t\t\t\t \t.'\tdataArrivedTime = NOW(), '\n\t\t\t\t\t\t\t\t \t.'\tdeviceId = \"%s\"\t,'\n\t\t\t\t\t\t\t\t \t.' dataCalculatedTime = \"%s\" '\n\t\t\t\t\t\t\t\t \t.' WHERE '\n\t\t\t\t\t\t\t\t \t.' Id = %d '\n\t\t\t\t\t\t\t\t \t .' LIMIT 1;',\n\t\t\t\t$latitude, $longitude, $altitude, $deviceId, $calculatedTime, Yii::app()->user->id);\n\t\t\t\t$effectedRows = Yii::app()->db->createCommand($sql)->execute();\n\t\t\t\t$result = \"Unknown Error\";\n\t\t\t\tif ($effectedRows == 1)\n\t\t\t\t{\n\t\t\t\t\t$sqlWasHere = sprintf('INSERT INTO '\n\t\t\t\t\t\t\t\t\t. UserWasHere::model()->tableName() . '\n\t\t\t\t\t\t\t\t\t(userId, latitude, longitude, altitude, dataArrivedTime, deviceId, dataCalculatedTime)\n\t\t \t\t\t\t\t\tVALUES(%d,\t%f, %f, %f, NOW(), \"%s\", \"%s\") \n\t\t\t\t\t\t\t\t\t',\n\t\t\t\t\t\t\t\t \tYii::app()->user->id, $latitude, $longitude, $altitude, $deviceId, $calculatedTime);\n\t\t\t\t\tYii::app()->db->createCommand($sqlWasHere)->execute();\n\t\t\t\t\t$result = \"1\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$resultArray = array(\"result\"=>$result);\n\t\tif ($result == \"1\") {\n\t\t\t$resultArray = array_merge($resultArray, array( \t\t\t\n\t\t\t\t\t\t\t\t\t\"minDataSentInterval\"=> Yii::app()->params->minDataSentInterval,\n\t\t\t\t\t\t\t\t\t\"minDistanceInterval\"=> Yii::app()->params->minDistanceInterval,\n\t\t\t\t\t\t\t));\n\t\t}\n\t\techo CJSON::encode(\n \t\t$resultArray\n\t\t);\n\n\t\tYii::app()->end();\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|unique_with:places, user_id',\n ]);\n\n $input = array_add($request->all(), 'user_id', Auth::id());\n\n // TODO-KGW Check if you need this one, I may be handling null values below.\n foreach ($input as $key => $value) {\n $input[$key] = $input[$key] == \"\" ? null : $input[$key];\n }\n //dd($input);\n\n $place = Place::create([\n 'user_id' => auth()->id(),\n 'name' => $input['name'],\n 'address' => $input['address'],\n 'city' => $input['city'],\n 'province' => $input['province'],\n 'country_code' => $input['country_code'] == \"00\" ? null : $input['country_code'],\n 'url_place' => $input['url_place'],\n 'url_wikipedia' => $input['url_wikipedia'],\n 'lat' => $input['lat'],\n 'lng' => $input['lng'],\n 'map_zoom' => $input['map_zoom'],\n 'image_id' => $input['image_id'],\n 'timezone_id' => $input['timezone_id'] == \"00\" ? null : $input['timezone_id'],\n 'extant' => (integer) $input['extant'],\n 'privacy' => (integer) $input['privacy'],\n 'user_id' => $input['user_id']\n ]);\n\n return redirect('/places')\n ->with('flash', \"$place->name has been added\");\n }", "public function Add_tracking($user_master_id,$lat_1,$lon_1,$location,$lat_2,$lon_2,$miles_distance_bw,$service_order_id)\n\t{\n\t\t$sQuery = \"INSERT INTO serv_pers_tracking (user_master_id,lat_1,lon_1,location,lat_2,lon_2,miles_distance_bw,service_order_id,created_at) VALUES ('\". $user_master_id . \"','\". $lat_1 . \"','\". $lon_1 . \"','\". $location . \"','\". $lat_2 . \"','\". $lon_2 . \"','\". $miles_distance_bw . \"','\". $service_order_id . \"',NOW())\";\n\t\t$ins_query = $this->db->query($sQuery);\n\n\t\tif($ins_query){\n\t\t\t\t$response=array(\"status\" => \"success\",\"msg\" => \"Tracking Details Added\");\n }else{\n\t\t\t\t$response=array(\"status\" => \"error\",\"msg\" => \"Something Wrong\");\n\n }\n\t\treturn $response;\n\t}", "function update_map($id, $coords) {\n\t\t$str = \"UPDATE company SET gmap_coords = '$coords' WHERE Comany_ID = $id\";\n\t\tif($req = mysqli_query($link,$str)) return true;\n\t\telse return false;\t\n\t}", "public function save_date_place_info($will_id, $date_place_data){\n $this->db->where('will_id', $will_id)\n ->update('tbl_will', $date_place_data);\n }", "public function __construct($user)\n {\n //$this->city = $city;\n $this->user = $user;\n }", "function edituserPaddress($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$paddress = mysqli_real_escape_string($conn, $data['paddress']);\n\t\t\t$parea = mysqli_real_escape_string($conn, $data['parea']);\n\t\t\t$pthana = mysqli_real_escape_string($conn, $data['pthana']);\n\t\t\t$pdistrict = mysqli_real_escape_string($conn, $data['pdistrict']);\n\t\t\t$pzip = mysqli_real_escape_string($conn, $data['pzip']);\n\t\t\tif(empty($paddress) || empty($parea) || empty($pthana) || empty($pdistrict) || empty($pzip)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $pdistrict)) {\n\t\t\t\t\tif($this->length($pdistrict,25,3)){\n\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $pthana)) {\n\t\t\t\t\t\t\tif($this->length($pthana,25,3)) {\n\t\t\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $parea)) {\n\t\t\t\t\t\t\t\t\tif($this->length($parea,25,3)) {\n\t\t\t\t\t\t\t\t\t\tif($this->length($paddress,50,3)) {\n\t\t\t\t\t\t\t\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $pzip)) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($this->length($pzip,4,4)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_paddress\", $paddress , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_parea\", $parea , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result2 = $this->change(\"user_login\", \"user_pthana\", $pthana , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result3 = $this->change(\"user_login\", \"user_pdistrict\", $pdistrict , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result4 = $this->change(\"user_login\", \"user_pzip\", $pzip , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( $result == false || $result1 == false || $result2 == false || $result3 == false || $result4 == false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed!\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=tooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=ZipCode\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=addretooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=areatooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=area\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=thanatooBigORtooSmall\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=thana\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=DistricttooBigORtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=District\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function tracking_user_put($user_id)\n {\n $this->authenticate();\n $messages_lang = $this->common->set_language_for_server_api('tracking_users_api',\n array('tracking_user_success', 'tracking_user_failure'));\n $response = array();\n $this->verify_required_params(array('is_available'));\n $status = $this->put('is_available');\n $result = $this->tracking_users_model->check_time_update_user($user_id, ATTEND);\n if ($result)\n {\n $response['status'] = $messages_lang['success'];\n $response['message'] = $messages_lang['tracking_user_success'];\n }\n else\n {\n $response['status'] = $messages_lang['failure'];\n $response['message'] = $messages_lang['tracking_user_failure'];\n }\n $this->response($response, 200);\n }", "public function testLocationCreationValidParameters()\n {\n $user = User::all()->random();\n\n $this->actingAs($user, 'api')\n ->post(\"api/location\", [\n 'branch' => 'Twofold Asperger-Academy',\n 'room' => '431',\n 'shelf' => '3',\n 'compartment' => '4',\n 'description' => 'This is a description where the location is.'\n ]);\n $this->seeStatusCode(200);\n }", "function edituserCaddress($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$caddress = mysqli_real_escape_string($conn, $data['caddress']);\n\t\t\t$carea = mysqli_real_escape_string($conn, $data['carea']);\n\t\t\t$cthana = mysqli_real_escape_string($conn, $data['cthana']);\n\t\t\t$cdistrict = mysqli_real_escape_string($conn, $data['cdistrict']);\n\t\t\t$czip = mysqli_real_escape_string($conn, $data['czip']);\n\t\t\tif(empty($caddress) || empty($carea) || empty($cthana) || empty($cdistrict) || empty($czip)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $cdistrict)) {\n\t\t\t\t\tif($this->length($cdistrict,25,3)){\n\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $cthana)) {\n\t\t\t\t\t\t\tif($this->length($cthana,25,3)) {\n\t\t\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $carea)) {\n\t\t\t\t\t\t\t\t\tif($this->length($carea,25,3)) {\n\t\t\t\t\t\t\t\t\t\tif($this->length($caddress,50,3)) {\n\t\t\t\t\t\t\t\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $czip)) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($this->length($czip,4,4)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_caddress\", $caddress , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_carea\", $carea , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result2 = $this->change(\"user_login\", \"user_cthana\", $cthana , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result3 = $this->change(\"user_login\", \"user_cdistrict\", $cdistrict , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result4 = $this->change(\"user_login\", \"user_czip\", $czip , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( $result == false || $result1 == false || $result2 == false || $result3 == false || $result4 == false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed!\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=tooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=ZipCode\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=tooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=areatooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=area\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=thanatooBigORtooSmall\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=thana\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=DistricttooBigORtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=District\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function Insertareacode($citylocid=false,$lat=false,$long=false,$projectid=false)\n\t{\n\t\t$areacode=\tnumber_format((float)$lat, 1, '.', '');\t\n\t\t$areacode.=\tnumber_format((float)$long, 1, '.', '');\n\t\t$areacode=str_replace('.','',\"$areacode\");\n\t\t$CountDetails=$this->db->get_where('rp_property_to_areas',array('propertyID'=>$projectid,'propertyType'=>'Project'));\n\t\t$count=$CountDetails->result();\n\t\tif(empty($count))\n\t\t{\n\t\t\t$arealocalitydata=array('areaCode'=>$areacode,'localityID'=>$citylocid);\t\t\t\t\t \n\t\t\t$this->db->insert('rp_locality_to_areas',$arealocalitydata);\n\t\t\t$propertytoarea=array('areaCode'=>$areacode,'propertyID'=>$projectid,'propertyType'=>'Project');\n\t\t\t$this->db->insert('rp_property_to_areas',$propertytoarea);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arealocalitydata=array('areaCode'=>$areacode);\t\t\n\t\t\t$this->db->where(array('localityID'=>$citylocid));\t\t\n\t\t\t$this->db->update('rp_locality_to_areas',$arealocalitydata);\n\t\t\t$propertytoarea=array('areaCode'=>$areacode);\n\t\t\t$this->db->where(array('propertyID'=>$projectid,'propertyType'=>'Project'));\n\t\t\t$this->db->update('rp_property_to_areas',$propertytoarea);\n\t\t}\n\t}", "function saveAddress($formvalues, $prefix){\n\t\n\t\tif(isset($formvalues[$prefix.'addressupdateid'])){\n\t\t\t$query = \"UPDATE places SET name = '\".$formvalues[$prefix.'name'].\"', telephone = '\".$formvalues[$prefix.'tel'].\"', village = '\".$formvalues[$prefix.'village'].\"', subcounty = '\".$formvalues[$prefix.'subcounty'].\"', county = '\".$formvalues[$prefix.'county'].\"', parish = '\".$formvalues[$prefix.'parish'].\"', town = '\".$formvalues[$prefix.'town'].\"', district = '\".$formvalues[$prefix.'district'].\"', plotnumber = '\".$formvalues[$prefix.'plotno'].\"', lc1chairman = '\".$formvalues[$prefix.'lc1cm'].\"', lc1telephone = '\".$formvalues[$prefix.'lc1tel'].\"', lc2chairman = '\".$formvalues[$prefix.'lc2cm'].\"', lc2telephone = '\".$formvalues[$prefix.'lc2tel'].\"', lastupdatedby = \".$_SESSION['userid'].\", lastupdatedate = now() WHERE id = '\".$formvalues[$prefix.'addressupdateid'].\"'\";\n\t\t\t\n\t\t} else {\n\t\t\t$query = \"INSERT INTO places (name, telephone, village, subcounty, county, parish, town, district, plotnumber, lc1chairman, lc1telephone, lc2chairman, lc2telephone, createdby, datecreated) VALUES ('\".$formvalues[$prefix.'name'].\"', '\".$formvalues[$prefix.'tel'].\"', '\".$formvalues[$prefix.'village'].\"', '\".$formvalues[$prefix.'subcounty'].\"', '\".$formvalues[$prefix.'county'].\"', '\".$formvalues[$prefix.'parish'].\"', '\".$formvalues[$prefix.'town'].\"', '\".$formvalues[$prefix.'district'].\"', '\".$formvalues[$prefix.'plotno'].\"', '\".$formvalues[$prefix.'lc1cm'].\"', '\".$formvalues[$prefix.'lc1tel'].\"', '\".$formvalues[$prefix.'lc2cm'].\"', '\".$formvalues[$prefix.'lc2tel'].\"', \".$_SESSION['userid'].\", NOW())\";\n\t\t\n\t\t}\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$addressid = \"\";\n\t\t# check if any errors have occured during the saving the activities to the database\n\t\tif (mysql_error() == \"\") {\n\t\t\t# no errors occured, so return the last inserted id\n\t\t\t$addressid = mysql_insert_id();\n\t\t\t\n\t\t\tif(isset($formvalues[$prefix.'addressupdateid'])){\n\t\t\t\t$addressid = $formvalues[$prefix.'addressupdateid'];\n\t\t\t}\n\t\t} else {\n\t\t\t# add the error message to the string\n\t\t\t$_SESSION['error'] = \"ERROR: Couldnot insert address for \".$formvalues[$prefix.'village'].\". Please try again. DETAILS: \".mysql_error();\n\t\t}\n\t\treturn $addressid;\n\t\n}", "public function add_delivery_address(){\n $save_data['customer_id'] = $_REQUEST['customer_id'];\n $save_data['address_title'] = $_REQUEST['address_title'];\n $save_data['address'] = $_REQUEST['address'];\n $save_data['country_id'] = $_REQUEST['country_id'];\n $save_data['state_id'] = $_REQUEST['state_id'];\n $save_data['city_id'] = $_REQUEST['city_id'];\n $save_data['pincode'] = $_REQUEST['pincode'];\n\n $is_default = $_REQUEST['is_default'];\n $customer_id = $_REQUEST['customer_id'];\n\n $address_id = $this->User_Model->save_data('delivery_address', $save_data);\n if ($address_id) {\n if($is_default == 1){\n $up_data1['is_default'] = 0;\n $this->User_Model->update_info('customer_id', $customer_id, 'delivery_address', $up_data1);\n $up_data2['is_default'] = 1;\n $this->User_Model->update_info('address_id', $address_id, 'delivery_address', $up_data2);\n }\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Address Saved Successfuly\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Address Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function set_hotspot_user($param, $id){\n $input = array(\n 'command' => '/ip/hotspot/user/set',\n 'id' => $id\n );\n $out=array_merge($input, $param);\n return $this->query($out);\n }", "public function admin_edit($year = null, $user_id = null, $id = null) {\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places,geometry','places_autocomplete','tools'));\n \t\n \t//on recupere l'equipage pour le breadcrumbs\n\t $this->Position->User->recursive = 0;\n \t$this->set('user',$this->Position->User->find('first', array('conditions' => array('User.id' => $user_id))));\n \t\n \t//on recupere la position de son école\n $this->Position->User->recursive = 0;\n $school = $this->Position->User->find('first', array('conditions' => array('User.id' => $user_id),\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => array('School.lat', 'School.lon')));\n $this->set('school',$school);\n \n $this->Position->id = $id;\n \n if (!$this->Position->exists()) {\n throw new NotFoundException(__(\"Cette position n'existe pas\"));\n }\n if ($this->request->is('post') || $this->request->is('put')) {\n if ($this->Position->save($this->request->data)&&$this->update_distance($user_id)) {\n $this->Session->setFlash(\"Les modifications ont bien été enregistrées\", 'default', array('class' => 'alert-box radius alert-success'));\n return $this->redirect(array('action' => 'index',$year,$user_id));\n }\n $this->Session->setFlash(\"Erreur lors de l'enregistrement\", 'default', array('class' => 'alert-box radius warning'));\n } else {\n $this->request->data = $this->Position->read(null, $id);\n }\n }", "function get_place_JSON() {\n\n try {\n // Declare global variables;\n global $fb, $keyword, $latitude, $longitude;\n // Use Facebook SDK to code;\n // Returns a `Facebook\\FacebookResponse` object\n if(empty($latitude) || empty($longitude)) {\n $request = $fb->request('GET', '/search', ['q' => $keyword,'type' => 'place', 'fields'=>'id,name,picture.width(700).height(700)']);\n $response = $fb->getClient()->sendRequest($request);\n $arrayJSON = $response->getDecodedBody();\n $jsonObj = json_encode($arrayJSON);\n } else {\n $request = $fb->request('GET', '/search', ['q' => $keyword,'type' => 'place','center' => $latitude . \",\" . $longitude, 'fields'=>'id,name,picture.width(700).height(700)']);\n $response = $fb->getClient()->sendRequest($request);\n $arrayJSON = $response->getDecodedBody();\n $jsonObj = json_encode($arrayJSON);\n }\n\n } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n } catch (Exception $e) {\n $jsonObj = '{' . '\"error\":' . '\"'. $e . '\"' . '}';\n }\n\n\n\n\n\n return $jsonObj;\n}", "public function favouriteExist($user_id, $addressname, $latitude, $longitude, $addressline0, $addressline1, $addressline2, $addressline3, $locality, $city, $state, $country, $pincode) {\n $stmt = $this->conn->prepare(\"SELECT * FROM `user_address` WHERE `addressline0` = ? && `addressline1` = ? && `addressline2` = ? && `addressline3` = ? && locality = ? && city = ? && user_id = ?\");\n $stmt->bind_param(\"ssssssi\", $addressline0, $addressline1, $addressline2, $addressline3, $locality, $city, $user_id);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0; \n }", "public static function updateUserLocation() {\r\n $debug = \\Drupal::config('smart_ip.settings')->get('debug_mode');\r\n if (!$debug) {\r\n $ip = \\Drupal::request()->getClientIp();\r\n $smartIpSession = self::getSession('smart_ip');\r\n if (!isset($smartIpSession['location']['ipAddress']) || $smartIpSession['location']['ipAddress'] != $ip) {\r\n $result = self::query();\r\n self::userLocationFallback($result);\r\n /** @var \\Drupal\\smart_ip\\SmartIpLocation $location */\r\n $location = \\Drupal::service('smart_ip.smart_ip_location');\r\n $location->setData($result);\r\n $location->save();\r\n }\r\n }\r\n }", "function updateFacebookCurrentCity () {\n }", "public function updatelocationAction()\n {\n $userInfo = new UserInfo($_POST);\n if ($userInfo->hasIPUpdated())\n {\n $userInfo->saveIP();\n $userInfo->findLocationFromIP();\n $userInfo->saveLocation();\n }\n }", "public function set_pickup(Request $request)\n {\n $request->user->order->p_lat = $request->input('p_lat');\n $request->user->order->p_lng = $request->input('p_lng');\n $request->user->order->p_gaddress = $request->input('p_gaddress');\n $request->user->order->p_address = $request->input('p_address');\n $request->user->order->p_city = $request->input('p_city');\n $request->user->order->p_state = $request->input('p_state');\n $request->user->order->p_country = $request->input('p_country');\n $request->user->order->p_place = $request->input('p_place');\n $request->user->order->ostate = 2;\n $request->user->order->save();\n\n return $request->user->data();\n }", "public function update(Request $request, Place $place)\n {\n //\n }", "public function update(Request $request, Place $place)\n {\n //\n }", "function updateFoodTruckLocation($foodTruckID, $oldLat, $oldLong, $newLat, $newLong){\n include('../db.php');\n $query = \"SELECT * FROM food_truck WHERE foodtruckid=$foodTruckID AND latitude=$oldLat AND longitude=$oldLong\";\n $results = $db->query($query);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, test query failed.\";\n exit();\n }\n $num_query_results = $results->num_rows;\n if ($num_query_results == 0){\n printf(\"Error, No matching food trucks found. From query: id: %s oldLat: %s oldLong: %s\",\n $foodTruckID, $oldLat, $oldLong);\n exit();\n }\n // food truck info is valid, update it with the new lat and long values\n $updateQuery = \"UPDATE food_truck SET latitude=$newLat, longitude=$newLong WHERE foodtruckid=$foodTruckID\";\n $results = $db->query($updateQuery);\n if ($results === false){\n // db query returns false if the call failed\n echo \"Error, update query failed.\";\n exit();\n }\n $json[] = [\n 'message' => \"Food Truck location successfully updated.\",\n ];\n header('Content-Type: application/json');\n echo json_encode($json, JSON_PRETTY_PRINT);\n $db->close();\n}", "public function addNewCity($latitude,$lng,$detail_city){\r\n\t\t}", "public function save_tracking($email,$lat,$long,$adress)\n {\n\n$gpis = new Gpi();\n$gpis->email = $email;\n$gpis->lat = $lat;\n$gpis->long = $long;\n$gpis->adress = $adress;\ntry {\n $gpis->save();\n return \"[{\".'\"status\":'.'\"Uploaded Successfully\"'.\"}]\"; \n \n} catch (Exception $e) {\n\n return \"[{\".'\"status\":'.'\"Error on Save please Try again\"'.\"}]\";\n}\n\n\n \n }", "private function setCoordinates($chosenCity) {\n $this->cityLongitude = $this->cities[$chosenCity]['Longitude']; \n $this->cityLatitude = $this->cities[$chosenCity]['Latitude'];\n }", "public function createDefault($id = 0) {\n\t $x =UserLocation::model()->findByAttributes(array('user_id'=>$id));\n if ($x === null) {\n $ul = new UserLocation();\n $ul->neighborhood_id = 0; // default\n $ul->user_id = $id;\n $ul->gps = new CDbExpression(\"GeomFromText('Point(0 0)')\"); // default\n $ul->address ='';\n $ul->address_ext =''; \n $ul->save();\n } \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 postcodenl_civicrm_pre($op, $objectName, $id, &$params) {\n CRM_Postcodenl_Updater::pre($op, $objectName, $id, $params);\n if ($objectName == 'Address' && isset($params['country_id']) && $params['country_id'] == 1152) {\n // skip_geocode is an optional parameter through the api.\n // manual_geo_code is on the contact edit form. They do the same thing....\n if (empty($params['skip_geocode']) && empty($params['manual_geo_code'])) {\n CRM_Core_BAO_Address::addGeocoderData($params);\n }\n }\n}", "function updateAllLocations () {\n //updateFacebookCurrentCity();\n //updateOkCupidCurrentCity();\n }", "function insertLocation($uid,$tid,$latitude,$long,$area,$continent,$country,$pcode)\n {\n $sql = sprintf(\"INSERT INTO `location` (\n `uid` ,\n `tid` ,\n `latitude` ,\n `longitude`,\n `area`,\n `continent`,\n `country`,\n `pcode`\n )\n VALUES (\n '%d','%d','%s','%s','%s','%s','%s','%s'\n );\",\n $uid,$tid, $latitude, $long, $this->db->escape($area), $this->db->escape($continent), $this->db->escape($country), $this->db->escape($pcode)\n );\n $this->db->query($sql);\n }", "public function storeLocation(Request $request, $id)\n { \n $data = $request->all();\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids;\n $user = auth()->user();\n $poi_ids = array();\n foreach ($request->data_poi as $key => $value) {\n array_push($poi_ids, $value['poiid']);\n $dest_id = $value['did'];\n if(LocationPointOfInterest::where(['place_id' => $value['place'],'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $value['routes']])->doesntExist())\n {\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids; \n \n $locationPois = LocationPointOfInterest::create([\n 'name' => $value['dname'],\n 'place_id' => $value['place'],\n 'tour_package_id' => $value['routes'],\n 'location_id' => $value['did'],\n 'point_of_interest_id' => $value['poiid'],\n 'tenant_id' => $user->tenant_id,\n 'user_id' => $user->id\n ]); \n }\n }\n $poi_latitude = 0;\n $poi_longitude = 0; \n $poi_count = 0;\n foreach ($poi_ids as $value) {\n $latlong = PointOfInterest::where('id', $value)->first();\n $poi_latitude += $latlong->latitude;\n $poi_longitude += $latlong->longitude;\n $poi_count += 1;\n }\n $location_lat = $poi_latitude/$poi_count;\n $location_long = $poi_longitude/$poi_count;\n $shopping_url = file_get_contents('https://api.tomtom.com/search/2/search/shopping_center.json?language=en-US&limit=20&lat='.$location_lat.'&lon='.$location_long.'&radius=5000&categorySet=7373&key=6vdxVANLJketgjeoT3dvURPnu4ny3VWy');\n $jsondata_shopping = json_decode($shopping_url);\n\n foreach ($jsondata_shopping->results as $key => $value_shopping) {\n if(Shopping::where(['poi_id' => $value_shopping->id,'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $route_id,'location_id' => $dest_id])->doesntExist()){\n $shopping = new Shopping();\n if((array_key_exists('municipalitySubdivision', $value_shopping->address))){\n $shopping->location = $value_shopping->address->municipalitySubdivision;\n }\n\n $shopping->name = $value_shopping->poi->name;\n $shopping->latitude = $value_shopping->position->lat;\n $shopping->longitude = $value_shopping->position->lon;\n $shopping->postal_code = $value_shopping->address->postalCode;\n $shopping->country = $value_shopping->address->country;\n $shopping->address = $value_shopping->address->freeformAddress;\n $shopping->local_name = $value_shopping->address->localName;\n $shopping->location_id = $dest_id;\n $shopping->tour_package_id = $route_id;\n $shopping->tenant_id = $user->tenant_id;\n $shopping->type = $value_shopping->poi->categories[0];\n $shopping->poi_id = $value_shopping->id;\n $shopping->save();\n }\n }\n\n $transport_url = file_get_contents('https://api.tomtom.com/search/2/search/PUBLIC_TRANSPORT_STOP.json?language=en-US&limit=20&lat='.$location_lat.'&lon='.$location_long.'&radius=10000&categorySet=9942002,9942003,9942004,9942005,7380002,7380003,7380004,7380005&key=6vdxVANLJketgjeoT3dvURPnu4ny3VWy');\n $jsondata_transport = json_decode($transport_url);\n\n foreach ($jsondata_transport->results as $key => $value_transport) {\n if(TransportLocation::where(['poi_id' => $value_transport->id,'tenant_id' => auth()->user()->tenant_id,'tour_package_id' => $route_id,'location_id' => $dest_id])->doesntExist()){\n $transport = new TransportLocation();\n if((array_key_exists('municipalitySubdivision', $value_transport->address))){\n $transport->location = $value_transport->address->municipalitySubdivision;\n }\n\n $transport->name = $value_transport->poi->name;\n $transport->latitude = $value_transport->position->lat;\n $transport->longitude = $value_transport->position->lon;\n $transport->postal_code = $value_transport->address->postalCode;\n $transport->country = $value_transport->address->country;\n $transport->address = $value_transport->address->freeformAddress;\n $transport->local_name = $value_transport->address->localName;\n $transport->location_id = $dest_id;\n $transport->tour_package_id = $route_id;\n $transport->tenant_id = $user->tenant_id;\n $transport->type = $value_transport->poi->categories[1];\n $transport->poi_id = $value_transport->id;\n $transport->save();\n }\n }\n \n //$updatestatus = TourPckage::completeStatus($route_id); // Closed 19-May-2020\n $route_ids = $request->route('id'); \n $route_id = (int)$route_ids;\n $countryISO = DB::table('location_point_of_interests')\n ->join('point_of_interests','point_of_interests.id','=','location_point_of_interests.point_of_interest_id')\n ->distinct()\n ->where('location_point_of_interests.tour_package_id',$route_id)\n ->select('point_of_interests.iso_2','point_of_interests.country_name')\n ->get();\n if(count($countryISO) > 0){\n foreach ($countryISO as $iso2) {\n $inc = CountryGuide::where('iso_2',$iso2->iso_2)\n ->where('tour_package_id',$route_id)\n ->first();\n if(is_null($inc)){\n $countryguide = new CountryGuide;\n $countryguide->iso_2 = $iso2->iso_2; \n $countryguide->country_name = $iso2->country_name;\n $countryguide->tour_package_id = $route_id;\n $countryguide->status = \"1\";\n $user = auth()->user();\n $countryguide->tenant_id = $user->tenant_id;\n $countryguide->user_id = $user->id;\n $countryguide->save();\n }\n }\n }\n return response()->json(['success' => 'added successfully']); \n }", "public function updateUserData($user_id,$device_id,$device_type,$rememberToken,$latitude,$longitude)\n {\n \n $updateUserData = DB::table('users')->where([\n ['id','=',$user_id],\n ])->update(array(\n 'remember_token' => $rememberToken,\n 'device_id' => $device_id,\n 'device_type' => $device_type,\n 'latitude'=>$latitude,\n 'longitude'=>$longitude\n\n ));\n\n\n\n }", "public function refreshUserGeolocation($iUserId, $sCountryIso, $sCity, $sPostalCode)\n\t{\n\t\t$aUserRow = $this->getUserAddress($iUserId);\n\t\t\n\t\t//Address Not found\n\t\tif($aUserRow == null || !isset($sCity) || $sCity == '')\n\t\t{\n\t\t\t$this->database()->delete(Phpfox::getT('gmap'), 'user_id = \\'' . $iUserId . '\\'');\n\t\t\t$this->cache()->remove('gmap.locations', 'substr');\n\t\t\t$this->cache()->remove('gmap.countries', 'substr');\n\t\t\treturn;\n\t\t}\n\n\t\t//Address Found\n\t\t//Get Country\n\t\t$aCountry = $this->database()->select('c.name as country')\n\t\t\t->from(Phpfox::getT('country'), 'c')\t\t\n\t\t\t->where('c.country_iso = \\'' . $sCountryIso . '\\'')\n\t\t\t->execute('getSlaveRow');\n\t\t\n\t\t//Get Full Address\n\t\t$addressCode = $sCity . ' ' . $aCountry['country'] . ' ' . $sPostalCode;\n\n\t\t//Get User past location (if exists)\n\t\t$aUserLocation = $this->database()->select('f.*')\n\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t->where('f.user_id = \\'' . $iUserId . '\\'')\n\t\t\t->execute('getSlaveRow');\n\t\t\t\n\t\t//Same address, don't do anything\n\t\tif($aUserLocation != null && $addressCode == $aUserLocation['address'])\n\t\t\treturn;\n\t\t\t\n\t\t//Delete cache\n\t\t$this->cache()->remove('gmap.locations', 'substr');\n\t\t$this->cache()->remove('gmap.countries', 'substr');\n\t\t\n\t\t//Not same address, do something!\n\t\t$this->database()->delete(Phpfox::getT('gmap'), 'user_id = \\'' . $iUserId . '\\'');\n\t\t\n\t\t//Insert new value\n\t\tif(!isset($oGoogleMapService))\n\t\t\t$oGoogleMapService = Phpfox::getService('gmap.googlemap');\n\n\t\t$return = $oGoogleMapService->geocoding($addressCode);\n\t\tif(isset($return))\n\t\t{\t\n\t\t\t$return[2] = ((float)$return[2]) + ((float)rand(-1000, 1000)) / 100000;\n\t\t\t$return[3] = ((float)$return[3]) + ((float)rand(-1000, 1000)) / 100000;\n\t\t\t$this->database()->insert(Phpfox::getT('gmap'), array(\n\t\t\t\t\t'user_id' => $iUserId,\n\t\t\t\t\t'lat' => $return[2],\n\t\t\t\t\t'lng' => $return[3],\n\t\t\t\t\t'address' => $addressCode,\n\t\t\t\t\t'not_found' => 0\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->database()->insert(Phpfox::getT('gmap'), array(\n\t\t\t\t\t'user_id' => $iUserId,\n\t\t\t\t\t'address' => $addressCode,\n\t\t\t\t\t'not_found' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\t//Check if new country\n\t\t$aCountryLocalisation = $this->database()->select('c.country_iso')\n\t\t\t->from(Phpfox::getT('gmap_countries'), 'c')\t\t\n\t\t\t->where('c.country_iso = \\'' . $sCountryIso . '\\'')\n\t\t\t->execute('getSlaveRow');\n\t\tif($aCountryLocalisation == null)\n\t\t{\n\t\t\t//Create new one\n\t\t\t$diffBound = 0;\n\t\t\tif($sCountryIso == 'FR')\n\t\t\t\t$diffBound = 1;\n\t\t\t$return = $oGoogleMapService->geocoding($aCountry['country']);\n\t\t\tif(isset($return))\n\t\t\t{\n\t\t\t\t$this->database()->insert(Phpfox::getT('gmap_countries'), array(\n\t\t\t\t\t\t'country_iso' => $sCountryIso,\n\t\t\t\t\t\t'lat' => $return[2],\n\t\t\t\t\t\t'lng' => $return[3],\n\t\t\t\t\t\t'northeast_lat' => ((float)$return[4]['northeast']['lat']) - $diffBound,\n\t\t\t\t\t\t'northeast_lng' => ((float)$return[4]['northeast']['lng']) - $diffBound,\n\t\t\t\t\t\t'southwest_lat' => ((float)$return[4]['southwest']['lat']) + $diffBound,\n\t\t\t\t\t\t'southwest_lng' => ((float)$return[4]['southwest']['lng']) + $diffBound\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function createuniversitylocation(){\n\n\t\tif($_POST['other_information']!=\"\" || $_POST['other_information']!=NULL){\n\t\t\t$other_information = $_POST['other_information'];\n\t\t}else{\n\t\t\t$other_information = \"\";\n\t\t}\n\n\t\tif($_POST['website']!=\"\" || $_POST['website']!=NULL){\n\t\t\t$website = $_POST['website'];\n\t\t}else{\n\t\t\t$website = \"\";\n\t\t}\n\n\t\tif($_POST['countrycode']!='')\n\t\t{\n\t\t\t$phone = $_POST['countrycode'].'-'.$_POST['phone'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$phone = $_POST['phone'];\n\t\t}\n\n\t\tif(isset($_POST['ismain']) && $_POST['ismain']==1)\n\t\t{\n\t\t\t$this->db->query(\"UPDATE tbl_university_location SET ismain=0 WHERE universityid = (SELECT uuid FROM tbl_university_registration WHERE userid=\".$this->session->userdata('fuserid').\")\");\n\t\t\t$ismain = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ismain = 0;\n\t\t}\n\n\t\t$currentdate=date(\"Y-m-d H:i:s\");\n\n\t\t$locationQuuid = $this->db->query(\"SELECT uuid() as id\");\n\n\t\tif ($locationQuuid->num_rows() > 0)\n\t\t{\n\t\t\t$datauuid = $locationQuuid->row_array();\n\t\t\t$locationuuid=$datauuid[\"id\"];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'campus_name' => $_POST['campus_name'],\n\t\t\t'name' => $_POST['name'],\n\t\t\t'address' => $_POST['address'],\n\t\t\t'email' => $_POST['email'],\n\t\t\t'phone' => $phone,\n\t\t\t'insertdate' => date('Y-m-d'),\n\t\t\t'universityid' => $_POST['universityid'],\n\t\t\t'other_information' => $other_information,\n\t\t\t'website' => $website,\n\t\t\t'country' => $_POST['countryid'],\n\t\t\t'state' => $_POST['stateid'],\n\t\t\t'city' => $_POST['cityid'],\n\t\t\t'zipcode' => $_POST['zipcode'],\n\t\t\t'event_title' => $_POST['event_title'],\n\t\t\t'locationuuid' => $locationuuid,\n\t\t\t'latitude'\t=> $_POST['latitude'],\n\t\t\t'longitude' => $_POST['longitude'],\n\t\t\t'ismain'\t=> $ismain\n\t\t\t//'opening_time' => $_POST['opening_time'],\n\t\t\t//'closing_time' => $_POST['closing_time'],\n\t\t\t//'action_date' => $currentdate,\n\t\t\t//'userstatus' => 1\n\t\t\t\n\t\t);\n\n\t\t$this->db->INSERT('tbl_university_location',$data);\n\t}", "public function testCreateWithPlace()\n {\n $options = Search::place('Chicago, IL');\n\n $this->assertInstanceOf(Search::class, $options);\n $this->assertCount(1, $options->parametrise());\n $this->assertArrayHasKey('near', $options->parametrise());\n }", "private function doGeoQuery($city, $country ,$state = null, $address = null, $zip_code = null){\n\n\t\t$formatted_city = urlencode($city);\n\t\t$query = \"?components=locality:{$formatted_city}|country:{$country}\";\n\t\tif(!empty($state)){\n\t\t\t$formatted_state = urlencode($state);\n\t\t\t$query .= \"|administrative_area:{$formatted_state}\";\n\t\t}\n\t\tif(!empty($address)){\n\t\t\t$formatted_address = urlencode($address);\n\t\t\t$query .= \"|address:{$formatted_address}\";\n\t\t}\n\t\tif(!empty($zip_code)){\n\t\t\t$formatted_zip_code = urlencode($zip_code);\n\t\t\t$query .= \"&postal_code={$formatted_zip_code}\";\n\t\t}\n\t\t$query .= \"&sensor=false\";\n\n\t\t$url = self::ApiBaseUrl.$query;\n\t\tif($this->shouldUseKey()){\n\t\t\t$url .= \"&key={$this->api_key}\";\n\t\t}\n\t\telse if($this->shouldSignUrl()){\n\t\t\t$url = $this->signUrl($url);\n\t\t}\n\n\t\t$factory = $this->factory;\n\t\t$repository = $this->repository;\n\t\treturn $this->tx_manager->transaction(function() use($repository, $factory, $url, $query, $city, $country ,$state, $address , $zip_code){\n\n\t\t\t$res = $repository->getByGeoQuery($query);\n\t\t\tif($res) return array($res->getLat(),$res->getLng());\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, GoogleGeoCodingService::ApiHost . $url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, 3128);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t\t$response = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$response_a = json_decode($response);\n\t\t\tif(is_null($response_a)){\n\t\t\t\tif(!empty($address))\n\t\t\t\t\tthrow new EntityValidationException(array( array('message' => sprintf('Address %s (%s) does not exist on City %s',$address,$zip_code,$city))));\n\t\t\t\telse\n\t\t\t\t\tthrow new EntityValidationException(array( array('message' => sprintf('City %s does not exist on Country %s',$city,$country))));\n\t\t\t}\n\t\t\tif($response_a->status!='OK'){\n\t\t\t\tif(!empty($address))\n\t\t\t\t\tthrow new EntityValidationException(array( array('message' => sprintf('Address %s (%s) does not exist on City %s - (STATUS: %s)',$address,$zip_code,$city,$response_a->status))));\n\t\t\t\telse\n\t\t\t\t\tthrow new EntityValidationException(array( array('message' => sprintf('City %s does not exist on Country %s (STATUS: %s)',$city,$country,$response_a->status))));\n\t\t\t}\n\t\t\t$repository->add($factory->buildGeoCodingQuery($query,$response_a->results[0]->geometry->location->lat, $response_a->results[0]->geometry->location->lng));\n\t\t\treturn array($response_a->results[0]->geometry->location->lat, $response_a->results[0]->geometry->location->lng);\n\t\t});\n\t}", "public function set_httpuser($httpuser){\n $this->checkinit();\n\n $this->check_httpuser($httpuser);\n $this->db->_exec('dataprovider_update_httpuser', array($httpuser,$this->id));\n $this->httpuser = $httpuser;\n\n }", "public function set_location($data = FALSE, $id = FALSE)\n {\n if (!empty($data)) {\n //filter out\n $data = array('name' => $data['name']);\n\n //check if unique\n $this->db->select('name');\n $this->db->where('name', $data['name']);\n $count = $this->db->count_all_results('locations');\n\n if ($count === 0) {\n if (empty($id)) {\n return $this->db->insert('locations', $data);\n } else {\n $this->db->where('id', $id);\n $this->db->update('locations', $data);\n return array('success' => true);\n }\n } else {\n return array('success' => false, 'errors' => array('Deze locatie bestaat al.'));\n }\n } else {\n return array('success' => false, 'errors' => array('Geen data gegeven.'));\n }\n }", "function place_order_post()\n { \n\n $this->form_validation->set_rules('user_id','User Id','required|numeric');\n $this->form_validation->set_rules('car_type','Car Type','required|numeric');\n $this->form_validation->set_rules('pickup_address','Pickup Address','required');\n $this->form_validation->set_rules('pickup_latitude','Pickup Latitude','required');\n $this->form_validation->set_rules('pickup_longitude','Pickup Longitude','required');\n \n $this->form_validation->set_rules('trip_type','Trip Type','required');\n\n $AllPostData = $this->input->post();\n extract($AllPostData);\n\n $user_data = $this->Common_model->getUserDetails($user_id);\n if($this->form_validation->run()) \n { \n if($this->post('trip_type') == 'now'){\n $tripdatetime = date('Y-m-d H:i:s');\n }\n else{\n if($this->post('tripdatetime') != ''){\n $tripdatetime = $this->post('tripdatetime');\n }\n else{\n $message = ['status' => FALSE,'message' => 'Please enter trip time'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); \n } \n }\n $trek_for_her = 0;\n if($this->post('trek_for_her') != ''){\n $trek_for_her = $this->post('trek_for_her');\n }\n\n $params = array(\n 'user_id' => $this->post('user_id'),\n 'car_type' => $this->post('car_type'),\n 'pickup_address' => $this->post('pickup_address'),\n 'pickup_latitude' => $this->post('pickup_latitude'),\n 'pickup_longitude' => $this->post('pickup_longitude'),\n 'dropoff_address' => $this->post('dropoff_address'),\n 'dropoff_latitude' => $this->post('dropoff_latitude'),\n 'dropoff_longitude' => $this->post('dropoff_longitude'),\n 'trip_type' => $this->post('trip_type'),\n 'tripdatetime' => $tripdatetime,\n );\n\n if($this->post('dropoff_latitude') != ''){\n $params['dropoff_latitude'] = $this->post('dropoff_latitude'); \n } \n\n if($this->post('dropoff_longitude') != ''){\n $params['dropoff_longitude'] = $this->post('dropoff_longitude'); \n } \n\n if($this->post('surge_charge') != ''){\n $params['surge_charge'] = $this->post('surge_charge'); \n } \n\n $order_id = \"\";\n /*echo $tripdatetime; die;*/\n /*Assign Ride To Driver*/\n if($AllPostData['trip_type'] == 'now'){\n $settings = $this->Common_model->getSettings('driver');\n\n $sql = \"SELECT *, 6371 * 2 * ASIN(SQRT( POWER(SIN(($pickup_latitude - latitude) * pi()/180 / 2), 2) + COS($pickup_latitude * pi()/180) * COS(latitude * pi()/180) *POWER(SIN(($pickup_longitude - longitude) * pi()/180 / 2), 2) )) as distance FROM tbl_drivers WHERE car_type=\".$this->post('car_type').\" AND is_free=1 AND is_login=1 AND is_active=1 HAVING distance <= \".$settings['base_distance'].\" ORDER by distance LIMIT 1\";\n \n \n\n \n \n $result = $this->db->query($sql)->row_array();\n if($result)\n {\n $order_id = $this->order_model->placeOrder($params);\n\n $this->db->update('tbl_drivers',array('is_free'=>'0'),array('id'=>$result['id']));\n $this->db->update('tbl_trip_details',array('driver_id'=>$result['id']),array('id'=>$order_id));\n /*Send Push to driver*/\n $this->Common_model->sendOrderDetails($result, $order_id, $user_id, $AllPostData['trip_type']);\n }\n else{\n $message = ['status' => FALSE,'message' => 'No driver found! Please try again'];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400) \n }\n }\n else{\n $order_id = $this->order_model->placeOrder($params);\n }\n\n /*Add Splitfare Contact*/\n if(!empty($this->post('splitfare_contact')) && $this->post('splitfare_contact') != '')\n {\n $contact_data = json_decode($AllPostData['splitfare_contact'],true);\n\n foreach ($contact_data as $key => $value) { \n \n foreach ($value['phoneList'] as $phone_value) {\n $temp_data = $this->db->get_where('tbl_users',array('phone'=>$phone_value,'is_active'=>'1','is_login'=>'1'))->row_array();\n \n if($temp_data){\n \n\n if($AllPostData['user_id'] != $temp_data['id'])\n {\n /*Check User is currently in any active ride or not*/\n\n if($this->order_model->check_user_availability($temp_data['id']) == 0){\n $params = array('sender_id'=>$AllPostData['user_id'],'order_id'=>$order_id,'receiver_id'=>$temp_data['id']);\n \n if($this->db->get_where('tbl_splitfare',$params)->num_rows() == 0){\n\n /*Send Push To the User*/\n $sender_data = $this->Common_model->getUserDetails($AllPostData['user_id']);\n\n //Android Push Message\n $message = array(\"message\"=>strtoupper($sender_data['fname']).\" has invited you for a ride\",'order_id'=>$order_id,\"flag\"=>\"splitfare_request\",'trip_type'=>$AllPostData['trip_type']);\n\n //IOS Push Message\n $body = array();\n $bodyI['aps'] = array('sound'=>'default','alert'=>strtoupper($sender_data['fname']).\" has invited you for a ride\",'order_id'=>$order_id,\"tag\"=>\"splitfare_request\",'trip_type'=>$AllPostData['trip_type']);\n\n /*Android Push*/\n if($temp_data['device_type']=='A' && $temp_data['device_id']!=''){\n $registatoin_ids_D = $temp_data['device_id'];\n $this->Common_model->send_gcm_notification_user($registatoin_ids_D,$message);\n }\n\n /*IOS Push*/\n if($temp_data['device_type']=='I' && $temp_data['device_id']!=''){\n $this->Common_model->send_notification_ios_user($bodyI,$temp_data['device_id']);\n }\n\n $this->Common_model->addData('tbl_splitfare',$params); \n }\n } \n }\n }\n }\n }\n }\n\n $order_data = $this->Common_model->getOrderDetails($order_id);\n\n $message = ['status' => TRUE,'message' => 'Ride placed successfully','data'=>$order_data];\n $this->set_response($message, REST_Controller::HTTP_CREATED); // CREATED (201)\n }\n else\n {\n $fields_validation = $this->validation_errors();\n $message = ['status' => FALSE,'message' => (string)$fields_validation[0]];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n }", "function updatePlaceTarif($place){\n\t \n\t\t// update query\n\t\t$query = \"UPDATE\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tSET\n\t\t\t\t\tplace = place - 1\n\t\t\t\tWHERE\n\t\t\t\t\tplace > :place\";\n\t \n\t\t// prepare query statement\n\t\t$stmt = $this->conn->prepare($query);\n\t \n\t\t// sanitize\n\t\t$this->place=htmlspecialchars(strip_tags($place));\n\t \n\t\t// bind new values\n\t\t$stmt->bindParam(\":place\", $this->place);\n\t \n\t\t// execute the query\n\t\tif($stmt->execute()){\n\t\t\treturn true;\n\t\t}\n\t \n\t\treturn false;\n\t}", "function addPoint()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $db;\r\n\t// The 1st alias\r\n\t$name = GET_INC('name');\r\n\t// City? Lng? Lat?\r\n\t$city = GET_INC('city');\r\n\t$lng = GET_INC('lng');\r\n\t$lat = GET_INC('lat');\r\n\t// We need user ID\r\n\t$uid = GET_INC('uid');\r\n\t// Query?\r\n\t// Looks simple...\r\n\t$db->connDB();\r\n\t// insert into db\r\n\t$db->insert('bus_station', \"NULL,{$city},{$lng},{$lat}\");\r\n\t// get ID\r\n\t$db->query('SELECT MAX(id) FROM bus_station;');\r\n\t$res = $db->fetch_array();\r\n\t// insert 1st alias\r\n\t$db->insert('bus_sname', \"{$res[0]},{$name}\");\r\n\t// close db\r\n\t$db->closeDB();\r\n}", "public function insert_data()\n {\n // pr($_POST);exit;\n //pr($_FILES);exit;\n $client_data['fullname'] = $_POST['first_name'].' '.$_POST['last_name'];\n $client_data['first_name'] = $_POST['first_name'];\n $client_data['last_name'] = $_POST['last_name'];\n $client_data['phone_number'] = $_POST['phone_number'];\n $where = array('user_id' => $_POST['user_id']);\n $this->general_model->update(USER_TABLE, $client_data, $where);\n\n $com_data['user_id'] = $_POST['user_id'];\n $com_data['com_name'] = $_POST['com_name'];\n $com_data['added_date'] = db_datetimeformat();\n $com_id = $this->general_model->insert(COMPANY,$com_data);\n\n $company_data['com_id'] = $com_id;\n $company_data['user_id'] = $_POST['user_id'];\n $company_data['address'] = $_POST['address'];\n $company_data['state'] = $_POST['state'];\n $company_data['city'] = $_POST['city'];\n $company_data['zipcode'] = $_POST['zipcode'];\n $company_data['description'] = trim($_POST['description']);\n\n $map_info = $this->get_latlong_val($_POST['address'], $com_data['com_name'], $_POST['zipcode'], $_POST['city']);\n\n $company_data['lat'] = $map_info['lat'];\n $company_data['long'] = $map_info['long'];\n $company_data['added_date'] = $com_data['added_date'];\n $company_id= $this->general_model->insert(COMPANY_LOCATION,$company_data);\n\n if($company_id){\n $msg = $this->lang->line('update_successfully');\n $this->session->set_flashdata('message_session', $msg);\n redirect($this->type.'/location_user_account');\n }else{\n $msg = $this->lang->line('plz_try_again');\n $this->session->set_flashdata('message_session', $msg);\n redirect($this->type.'/location_user_account');\n }\n\n }", "function insert_checkin( $con, $user_id, $place_id, $user_checkin, $created_time ) { \n\t\n\t\t$res = insert_checkin_query( $con, $user_id, $place_id, $user_checkin, $created_time ); \n\t\tfree_result($res);\n\t\t//return $res; \t\n\t}", "function rh_gmw_fl_update_location() {\n global $wpdb;\n parse_str($_POST['formValues'], $location);\n $usergetid = (!empty($_POST['usergetid'])) ? $_POST['usergetid'] : '';\n $userid = ($usergetid) ? $usergetid : get_current_user_id();\n $location['gmw_map_icon'] = ( isset($location['gmw_map_icon']) ) ? $location['gmw_map_icon'] : '_default.png';\n $location = apply_filters('gmw_fl_location_before_updated', $location, $userid);\n if ( $wpdb->replace('wppl_friends_locator', array(\n 'member_id' => $userid,\n 'street_number' => $location['gmw_street_number'],\n 'street_name' => $location['gmw_street_name'],\n 'street' => $location['gmw_street'],\n 'apt' => $location['gmw_apt'],\n 'city' => $location['gmw_city'],\n 'state' => $location['gmw_state'],\n 'state_long' => $location['gmw_state_long'],\n 'zipcode' => $location['gmw_zipcode'],\n 'country' => $location['gmw_country'],\n 'country_long' => $location['gmw_country_long'],\n 'address' => $location['gmw_address'],\n 'formatted_address' => $location['gmw_formatted_address'],\n 'lat' => $location['gmw_lat'],\n 'long' => $location['gmw_long'],\n 'map_icon' => $location['gmw_map_icon']\n ) ) === FALSE ) :\n echo __( 'There was a problem saving your location.', 'rehub_framework' );\n else :\n echo __( 'Location successfully saved!', 'rehub_framework' );\n do_action( 'gmw_fl_after_location_saved', $userid, $location );\n endif;\n die();\n}", "public function update(Request $request, $id)\n {\n $place = PPlace::find($id);\n $place->verified_by = $request->input('verify');\n $place->save();\n return redirect('/home')->with('success', 'Parking Place Verfied');\n }", "public function addAddressParams()\n {\n $oUser = $this->getUser();\n if (!$oUser) {\n return;\n }\n $oRequest = $this->getPayPalRequest();\n\n $oRequest->setParameter(\"EMAIL\", $oUser->oxuser__oxusername->value);\n\n $sAddressId = $oUser->getSelectedAddressId();\n if ($sAddressId) {\n $oAddress = oxNew(\"oxAddress\");\n $oAddress->load($sAddressId);\n\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oAddress->oxaddress__oxfname->value . \" \" . $oAddress->oxaddress__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oAddress->oxaddress__oxstreet->value . \" \" . $oAddress->oxaddress__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oAddress->oxaddress__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oAddress->oxaddress__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oAddress->oxaddress__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oAddress->oxaddress__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oAddress->oxaddress__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oAddress->oxaddress__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n } else {\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oUser->oxuser__oxfname->value . \" \" . $oUser->oxuser__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oUser->oxuser__oxstreet->value . \" \" . $oUser->oxuser__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oUser->oxuser__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oUser->oxuser__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oUser->oxuser__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oUser->oxuser__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oUser->oxuser__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oUser->oxuser__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n }\n }", "public function store(PlaceRequest $request)\n {\n Place::create($request->all());\n \n $this->redirect();\n }", "function dibujar_Cerca($lat1,$lat2,$lat3,$lat4,$lng1,$lng2,$lng3,$lng4,$connection,$user,$name){\n\t$query = \"INSERT INTO id_cercas(lat1,lat2,lat3,lat4,lng1,lng2,lng3,lng4,user,name) VALUES('$lat1','$lat2','$lat3','$lat4','$lng1','$lng2','$lng3','$lng4','$user','$name')\";\n\t$resultado = $connection->query($query);\n\t\n}", "public function __construct(Place $place)\n {\n $this->place = $place;\n }", "public function updateLocation (Request $request) {\n\n try {\n\n\t\t\n\t\t\t$errors = null;\n\t\t\t\n\t\t\tif ($this->profileRepo->validateLocationInfo ($request, $errors)) {\n\t\t\t\t\n\t\t\t\t//validation success\n\t\t\t\t$data['latitude'] = $request->lat;\n\t\t\t\t$data['longitude'] = $request->long;\n\t\t\t\t$data['city'] = $request->city;\n\t\t\t\t$data['country'] = $request->country;\n\n\t\t\t\t$this->profileRepo->saveLocation (Auth::user()->id, $data);\n\n\t\t\t\treturn response()->json(['status' => 'success']);\n\t\t\t\t\n\t\t\t} else {\n\n\t\t\t\t//validation fails\n\t\t\t\treturn response()->json(['status' => 'error', 'errors' => $errors]);\n\t\t\t}\t\t\t\n\n\n \t} catch (\\Exception $e) {\n\n \t\treturn response()->json(['status' => 'error', 'errors' => [trans('app.fail_save')]]);\n \t}\n\n }", "public function save()\n {\n try {\n global $connection;\n //check if user data exist , if yes then save it into $userDataifExits , it will hold bool(false) if no data found\n $userDataifExits = isUsernameExist($this->getUsername());\n //if it found the data , that means we have it in already , so making sql statement that will call customers update sp\n //if data is not found then we insert the data by making sql that will call customer_insert sp\n if ($userDataifExits !== false) {\n #update\n $sql = \"CALL customers_update(:username , :password, :firstname, :lastname, :address, :city, :province, :postalCode)\";\n } else {\n #insert\n $sql = \"CALL customer_insert(:username , :password, :firstname, :lastname, :address, :city, :province, :postalCode)\";\n }\n\n // adding the current values from fields to local variables..\n $username = $this->getUsername();\n $password = $this->getPassword();\n $firstname = $this->getFirstName();\n $lastname = $this->getLastName();\n $address = $this->getAddress();\n $city = $this->getCity();\n $province = $this->getProvince();\n $postalCode = $this->getPostalcode();\n\n //preparing the statement using prepare function\n $stmt = $connection->prepare($sql);\n\n //binding the parameters into sql using local appropriate fields\n $stmt->bindParam(':username', $username);\n $stmt->bindParam(':password', $password);\n $stmt->bindParam(':firstname', $firstname);\n $stmt->bindParam(':lastname', $lastname);\n $stmt->bindParam(':address', $address);\n $stmt->bindParam(':city', $city);\n $stmt->bindParam(':province', $province);\n $stmt->bindParam(':postalCode', $postalCode);\n\n //if execution is successful it will return true else false.. because execute function will return bool\n return $stmt->execute();\n } catch (Exception $e) {\n echo 'Exception occurred: ' . $e->getMessage();\n }\n\n }", "function update_location($longitude, $latitude, $info_id) {\r\n $query = \"Update mw_info set longitude = $longitude, \r\n latitude = $latitude\r\n , date_modified = now()\r\n where info_id = $info_id\";\r\n// print $query;\r\n// print mysql_error();\r\n return $this->query($query);\r\n }", "public function edit_student($map,$user_id){\n if(empty($map)){\n return 0;\n }else{\n return $this->where(\"user_id=%d\",$user_id)->save($map);\n }\n }", "public function saveAddress()\r\n\t{\t\t\t\r\n\t\t$data = array('address' => $this->input->post('address'));\t\r\n\t\t$where = array('id' => $this->session->userdata('emp_id'));\t\t\t\t\r\n\t\t$iStatus = $this->My_model->updateRecord('lang_company',$data,$where);\r\n\t\techo $iStatus;\t\t\r\n\t}", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function testUpdatePlaceError()\n {\n $placeRepositoryMock = \\Mockery::mock(PlaceRepositoryInterface::class)\n ->shouldReceive('update')\n ->andReturn(false)\n ->getMock();\n\n $this->app->instance(PlaceRepositoryInterface::class, $placeRepositoryMock);\n\n $response = $this->post(route('place-update'), [\n \"id\" => $this->placeFactory->id,\n \"name\" => \"juan\",\n \"company_id\" => $this->companyFactory->id,\n \"is_active\" => 1\n ], [\n 'Accept' => 'application/json'\n ]);\n\n $response->assertStatus(412);\n $response->assertJson([\n 'message' => 'Error al actualizar el profesional'\n ]);\n }", "public function actionPlaces()\n {\n $city = Yii::$app->request->post('city');\n $api = new Kladr\\Api('51dfe5d42fb2b43e3300006e', '86a2c2a06f1b2451a87d05512cc2c3edfdf41969');\n\n $query = new Kladr\\Query();\n $query->ContentName = $city;\n $query->ContentType = Kladr\\ObjectType::City;\n $query->WithParent = true;\n $query->Limit = 2;\n\n $result = $api->QueryToArray($query);\n echo json_encode($result);\n }", "function edit_organization_location($connection , $location_id ,$organization_id =\"\", $primary =\"\", $address =\"\", $city =\"\", $state =\"\", $zip =\"\", $latitude = \"\", $longitude = \"\", $email1 = \"\", $email2 = \"\", $phone1 =\"\", $phone2 = \"\", $modified_by = \"\")\n{\n\t$sql = \"update organization_location set modified_time = now()\";\n\tif($organization_id != \"\")\n\t\t$sql .= \", organization_id ={$organization_id}\";\n\tif($primary != \"\")\n\t\t$sql .= \", primary ={$primary}\";\n\tif($address != \"\")\n\t\t$sql .= \", address ='{$address}'\";\n\tif($city != \"\")\n\t\t$sql .= \", city ='{$city}'\";\n\tif($state != \"\")\n\t\t$sql .= \", state ='{$state}'\";\n\tif($zip != \"\")\n\t\t$sql .= \", zip ='{$zip}'\";\n\tif($phone_1 != \"\")\n\t\t$sql .= \", phone1 =='{$phone1}'\";\n\tif($latitude != \"\" && $longitude != \"\")\n\t\t$sql = $sql.\", latitude = {$latitude}, longitude = {$longitude}\";\n\tif($email1 != \"\")\n\t\t$sql = $sql.\", email1 = '{$email1}'\";\n\tif($email2 != \"\")\n\t\t$sql = $sql.\", email2 = '{$email2}'\";\n\tif($phone2 != \"\")\n\t\t$sql = $sql.\", phone2 = '{$phone2}'\";\n\tif($modified_by != \"\")\n\t\t$sql = $sql.\", modified_by = {$modified_by}\";\n\t$sql .= \" where location_id = {$location_id}\";\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}", "public function actionSaveRestaurantDetails() {\n //validate webservice\n $requiredParams = ['user_id', 'name', 'restaurant_lat', 'restaurant_long'];\n\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n\n try {\n //Get request parameters.\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n\n $user_id = $post['user_id'];\n $name = $post['name'];\n $mobile = !empty($post['mobile']) ? $post['mobile'] : null;\n $address = !empty($post['address']) ? $post['address'] : null;\n $country_code = !empty($post['country_code']) ? $post['country_code'] : 'US';\n $restaurant_google_id = !empty($post['restaurant_google_id']) ? $post['restaurant_google_id'] : null;\n $restaurant_lat = $post['restaurant_lat'];\n $restaurant_long = $post['restaurant_long'];\n\n //Fetch country details\n $countryDetails = Countries::findOne([\"code\" => $country_code]);\n\n //Fetch logged in user details\n $userdata = Users::find()->where(['user_id' => $user_id])->one();\n\n //update user type to restaurant user\n $userdata->user_type = Yii::$app->params['USER_TYPE']['restaurant'];\n $userdata->save(false);\n\n //Check if Restaurannt exist or not\n //If exist then Update Restaurant details\n //If not exist then Add Restaurant details\n $restaurants = Restaurants::find()->where(['user_id' => $user_id])->one();\n if (empty($restaurants)) {\n $restaurants = new Restaurants();\n }\n $restaurants->user_id = $user_id;\n $restaurants->name = !empty($post['name']) ? trim($post['name']) : '';\n $restaurants->restaurant_google_id = !empty($post['restaurant_google_id']) ? trim($post['restaurant_google_id']) : '';\n $restaurants->country_id = $countryDetails->id;\n $restaurants->mobile = !empty($post['mobile']) ? trim($post['mobile']) : '';\n $restaurants->address = !empty($post['address']) ? trim($post['address']) : '';\n $restaurants->restaurant_lat = !empty($post['restaurant_lat']) ? trim($post['restaurant_lat']) : '';\n $restaurants->restaurant_long = !empty($post['restaurant_long']) ? trim($post['restaurant_long']) : '';\n $restaurants->save(false);\n\n //send email to owner about restaurant registration\n if (!empty(Yii::$app->params['SITE_OWNER_EMAIL'])) {\n $emailformatemodel = EmailFormat::findOne([\"id\" => Yii::$app->params['EMAIL_TEMPLATE_ID']['restaurant_registered'], \"status\" => '1']);\n if ($emailformatemodel) {\n //create email body\n $AreplaceString = array(\n '{site_owner_name}' => Yii::$app->params['SITE_OWNER_NAME'],\n '{restaurant_name}' => $restaurants->name,\n '{restaurant_owner_name}' => $userdata->name,\n '{phone_number}' => $restaurants->mobile,\n '{email}' => $userdata->email,\n '{address}' => $restaurants->address\n );\n $body = CommonApiHelper::MailTemplate($AreplaceString, $emailformatemodel->body);\n $ssSubject = $emailformatemodel->subject;\n //send email to new registered user\n Yii::$app->mailer->compose()\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name])\n ->setTo(Yii::$app->params['SITE_OWNER_EMAIL'])\n ->setSubject($ssSubject)\n ->setHtmlBody($body)\n ->send();\n }\n }\n\n //Prepare response\n $restaurantDetails = [\n 'name' => $restaurants->name,\n 'restaurant_google_id' => $restaurants->restaurant_google_id,\n 'mobile' => $restaurants->mobile,\n 'address' => $restaurants->address,\n 'restaurant_lat' => $restaurants->restaurant_lat,\n 'restaurant_long' => $restaurants->restaurant_long\n ];\n $response[] = [\n 'user_id' => $userdata->user_id,\n 'user_type' => $userdata->user_type,\n 'name' => $userdata->name,\n 'email' => $userdata->email,\n 'profile_pic' => !empty($userdata->profile_pic) ? $userdata->profile_pic : '',\n 'is_otp_verified' => $userdata->is_otp_verified,\n 'restaurant_details' => $restaurantDetails\n ];\n\n return CommonApiHelper::return_success_response(\"Restaurant details has been saved.\", \"\", $response);\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response('Sorry, Please try again.');\n }\n }", "protected function setGetSpatial( $data) {\n\t\tR::nuke();\n\t\t$place = R::dispense('place');\n\t\t$place->location = $data; //R::$f->GeomFromText('\"'.$data.'\"');\n\t\tR::store($place);\n\t\tasrt(R::getCell('SELECT AsText(location) FROM place LIMIT 1'),$data);\n\t}", "public function gen_coords($city_only = true) {\r\n if (!$this->city) {\r\n return false;\r\n }\r\n $place = \"\";\r\n if (!$city_only) {\r\n $name = str_replace(str_split(\"_ -/\\\\&?\"), \"+\", $this->name);\r\n $address = str_replace(str_split(\"_ -/\\\\&?\"), \"+\", $this->address);\r\n $place = \"$name+$address+\";\r\n }\r\n $address = \"$place$this->city+$this->state\";\r\n $google_api_key = \\Nefuzz\\Php\\Auth::google_maps_key;\r\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=$address&key=$google_api_key\";$curl_handle = curl_init();\r\n curl_setopt( $curl_handle, CURLOPT_URL, $url );\r\n curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );\r\n $choord_info = json_decode(curl_exec( $curl_handle ), true);\r\n curl_close( $curl_handle );\r\n if ($choord_info[\"status\"] === \"OK\") {\r\n $result = $choord_info['results'][0]['geometry']['location'];\r\n $this->lat = $result[\"lat\"];\r\n $this->lng = $result[\"lng\"];\r\n return $result;\r\n } elseif ($choord_info[\"status\"] === \"OVER_QUERY_LIMIT\") {\r\n // This is thrown if too many addresses are querried at once\r\n throw new Exception(\"OVER_QUERY_LIMIT\");\r\n } else {\r\n return false;\r\n }\r\n }", "public function placeOrder()\n {\n $callback = request()->input('callback');\n\n try {\n if ($order = request()->input('order_id')) {\n $this->aliExpressOrderRepository->update([\n 'is_placed' => 1\n ], request()->input('order_id'));\n\n $response = response($callback . '(' . json_encode([\n 'success' => true,\n 'message' => 'Order successfully updated.'\n ]) . ')');\n } else {\n $response = response($callback . '(' . json_encode([\n 'success' => false,\n 'message' => 'Order id not exist.'\n ]) . ')');\n }\n } catch(\\Exception $e) {\n $response = response($callback . '(' . json_encode([\n 'success' => false,\n 'message' => $e->getMessage(),\n ]) . ')');\n }\n\n $response->header('Content-Type', 'application/javascript');\n\n return $response;\n }", "public function saveUserInfo($user, $userData){\n $this->users[$user->id]->type = $userData['type'];\n if($userData['type'] === 'admin'){\n $this->adminID[count($this->adminID)] = $user->id;\n }\n if($userData['type'] === 'client'){\n if(isset($this->tokenIdMap[$userData['token']])){\n $this->tokenIdMap[$userData['token']][count($this->tokenIdMap[$userData['token']])] = $user->id;\n }else{\n $this->tokenIdMap[$userData['token']] = array();\n $this->tokenIdMap[$userData['token']][count($this->tokenIdMap[$userData['token']])] = $user->id;\n }\n }\n if(isset($userData['location']) && isset($userData['location']['lat']) && isset($userData['location']['lng'])){\n $this->users[$user->id]->location = array(\n 'lat' => $userData['location']['lat'],\n 'lng' => $userData['location']['lng']\n );\n }\n $this->users[$user->id]->token = $userData['token']; \n $this->users[$user->id]->email = $userData['email']; \n $this->users[$user->id]->username = $userData['username']; \n }", "function geocode($street_address,$city,$state){\n \n $street_address = str_replace(\" \", \"+\", $street_address); //google doesn't like spaces in urls, but who does?\n $city = str_replace(\" \", \"+\", $city);\n $state = str_replace(\" \", \"+\", $state);\n\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?address=$street_address,+$city,+$state&sensor=false\"; \n $google_api_response = wp_remote_get( $url ); \n\n $results = json_decode( $google_api_response['body'] ); //grab our results from Google\n $results = (array) $results; //cast them to an array\n $status = $results[\"status\"]; //easily use our status\n $location_all_fields = (array) $results[\"results\"][0];\n $location_geometry = (array) $location_all_fields[\"geometry\"];\n $location_lat_long = (array) $location_geometry[\"location\"];\n\n // echo \"<!-- GEOCODE RESPONSE \" ;\n // var_dump( $location_lat_long );\n // echo \" -->\";\n\n if( $status == 'OK'){\n $latitude = $location_lat_long[\"lat\"];\n $longitude = $location_lat_long[\"lng\"];\n }else{\n $latitude = '';\n $longitude = '';\n }\n\n $return = array(\n 'latitude' => $latitude,\n 'longitude' => $longitude\n );\n return $return;\n}", "public function update(Request $request, Place $place)\n {\n $validatedData = $request->validate([\n 'name' => 'required|max:255|unique:places,name,'.$place->id,\n \n ]);\n \n $place->name = $request->name;\n $place->save();\n return redirect('/places/'.$place->id);\n }", "static public function set_place_value($place_name, $value) {\n trigger_error(\"Do not use me \" . __METHOD__, E_USER_WARNING);\n self::is_enabled(true);\n\n if (empty($value)) {\n return FALSE;\n }\n\n if (!is_string($place_name)) {\n trigger_error(\"The OUTPUT PLACE '{$place_name}' couldn't be registered with a value diferent a string \" . __FUNCTION__, E_USER_WARNING);\n }\n if (!is_string($value)) {\n if (!is_object($value)) {\n trigger_error(\"The OUTPUT VALUE '$place_name'->$value couldn't be used \" . __FUNCTION__, E_USER_ERROR);\n } elseif (strstr(get_class($value), 'k1lib\\html\\\\') === false) {\n trigger_error(\"The OUTPUT VALUE as object diferent from html couldn't be used, now is (\" . get_class($value) . \") \" . __FUNCTION__, E_USER_ERROR);\n }\n }\n\n if (isset(self::$output_places[$place_name])) {\n self::$output_places[$place_name][] = $value;\n } else {\n die(\"The OUTPUT PLACE '{$place_name}' is not defined yet \" . __FUNCTION__);\n }\n }", "public function setGeolocationPrivacy(Request $request)\n {\n $user = $request->user();\n\n if($user->settings->restricted_countries == null){\n $request_data[$request->country_type] = $request->restricted_countries;\n\n\n }else{\n $request_data = json_decode($user->settings->restricted_countries, true);\n $request_data[$request->country_type] = $request->restricted_countries;\n// dd($request_data);\n }\n $user->settings->restricted_countries = json_encode($request_data);\n $user->settings->save();\n\n// dd(json_encode($request_data));\n return response()->json([\n 'result' => 'success'\n ]);\n }", "function refine_existing_data() {\n /* get all the data from the master table */\n $datas = RefineData::getMasterData();\n foreach ($datas as $data) {\n /* refine data from Google API and get the details */\n $add = geo2address($data->lat, $data->lang);\n /* update the address, district , state */\n if (!RefineData::updateDetails($data->id, json_encode($add))) {\n ScreenMessage::setMessage(\"Error Occured\", ScreenMessage::MESSAGE_TYPE_ERROR);\n }\n }\n ScreenMessage::setMessage(\"All is Well\", ScreenMessage::MESSAGE_TYPE_SUCCESS);\n}", "public function updateBoatLocation($boat_id, Request $request)\n {\n $user = Auth::guard('api')->user();\n\n if ($user){\n $boat = Boat::where('unique_id',$boat_id)->first();\n $boat->latitude = Input::get('latitude');\n $boat->longitude = Input::get('longitude');\n if ($boat->save()){\n return $this->apiResponse('success', '200', 'Boat Location Updated Successfully');\n } else {\n return $this->apiResponse('error', '401', 'Sorry! Error in updating location.');\n }\n } else {\n return $this->apiResponse('error', '401', 'No Valid Token');\n }\n }" ]
[ "0.6179382", "0.61420256", "0.572364", "0.5721085", "0.57192254", "0.5703008", "0.56173295", "0.561422", "0.54750013", "0.5452578", "0.5443833", "0.54310584", "0.54150033", "0.5410679", "0.53732204", "0.53675807", "0.53476477", "0.5330172", "0.5327018", "0.5308758", "0.53019", "0.5279247", "0.52636564", "0.52194816", "0.5199838", "0.5189468", "0.51829916", "0.51589394", "0.51464576", "0.5121134", "0.51206714", "0.510943", "0.51028264", "0.5101884", "0.5092057", "0.50744545", "0.5066437", "0.50493777", "0.50470996", "0.5042739", "0.504177", "0.50296164", "0.50184953", "0.5008094", "0.4995522", "0.49839044", "0.4982047", "0.4981292", "0.49787632", "0.49775782", "0.495745", "0.495745", "0.49524748", "0.49376568", "0.49095523", "0.49012876", "0.48939928", "0.48938987", "0.48666456", "0.48603156", "0.48493955", "0.4847111", "0.4846909", "0.48311093", "0.4814498", "0.48102877", "0.47827637", "0.47782692", "0.47731045", "0.47718814", "0.47717804", "0.4763713", "0.4751234", "0.47463086", "0.47448567", "0.47400233", "0.47370073", "0.47361574", "0.47345722", "0.47299019", "0.472686", "0.47247058", "0.47242302", "0.47165662", "0.4712044", "0.47098336", "0.46963152", "0.46944064", "0.4694081", "0.4684428", "0.46802098", "0.4677766", "0.4677649", "0.46771246", "0.4676739", "0.46762002", "0.4674879", "0.46716413", "0.4664568", "0.46522844" ]
0.6366761
0
Display a listing of summaries
public function index() { $summaries = Summary::all(); return View::make('summaries.index', compact('summaries')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function summaryAction()\n {\n // handle unfiltered collection\n $collection = $this->getCollection();\n return $this->toJson([\n 'numberOfTotalItems' => $collection->queryCount(),\n ]);\n }", "public function index()\n {\n // Create Summary for library.\n $results = Book::with('section', 'authors')->paginate(10);\n return view('summary', compact('results', $results));\n }", "public function display_summary() {\n // FIXME\n }", "public function getSummary();", "public function getSummariesList() {\n return $this->_get(1);\n }", "public function getSummariesList() {\n return $this->_get(1);\n }", "public function getSummariesList() {\n return $this->_get(1);\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 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 summary();", "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 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 getSummaryData();", "public function index()\n {\n return evaluationSummary::all();\n }", "public function index()\n {\n $statistics = Statistic::latest()->paginate(6);\n return view('models.statistics.index')->withStatistics($statistics);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "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 getSummary()\n {\n return view('tox.dashboard.index')->withTitle('Dashboard');\n }", "public function index()\n {\n $sale = Sale::all();\n return $this->showAll($sale);\n }", "public function index()\n {\n $publishers = User::where('role', 'publisher')->get();\n if ( count($publishers) > 10 ) {\n $publishers = User::where('role', 'publisher')->paginate(10);\n }\n\n return view('admin.stats', compact('publishers'));\n }", "public function overAllSummaryReport()\n {\n return view('report.overAllSummaryReport');\n }", "public function index()\n {\n $sales = $this->sale_object->get_sales();\n\n return view('admin.sale.list', compact('sales'));\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}", "public function index()\n {\n $number_listed_sum = ListedSecurity::sum('number_listed');\n $mkt_ngn_sum = ListedSecurity::sum('mkt_cpt_ngn');\n $mkt_usd_sum = ListedSecurity::sum('mkt_cpt_usd');\n $listings =ListedSecurity::orderBy('created_at', 'desc')->get();\n $profile = DB::table('profiles')->first();\n $mkt_flows =MarketFlow::orderBy('created_at', 'desc')->get();\n $sectors =PerformanceSector::orderBy('created_at', 'desc')->get();\n $capitalizations =PerformanceCapitalization::orderBy('created_at', 'desc')->get();\n return view('admin_panel', compact('profile', 'capitalizations','sectors', 'mkt_flows', 'listings', 'number_listed_sum', 'mkt_ngn_sum', 'mkt_usd_sum'));\n }", "public function actionIndex()\n {\n $reportBuilder = new SummaryReport;\n\n $reportBuilder->on(SummaryReport::EVENT_BEFORE_BUILD, [\\RS\\Visitor\\Event\\ReportEvent::class, 'deleteVisitsOverhead']);\n\n $report = $reportBuilder->build();\n\n return $report;\n }", "public function index() {\n\t\t//\n\t\treturn view('admin.pages.statistic.index');\n\t}", "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 index()\n {\n $stadia = Stadium::orderBy('name', 'asc')->paginate(15);\n\n return view('admin.stadium.index', compact('stadia'));\n }", "public function index()\n {\n $estimates = Estimate::where('admin_id', auth()->id());\n if (request()->has('rows')) {\n \\Search::searchByKeywords($estimates, request()->keywords, ['items', 'file', 'customer.firstname', 'customer.lastname']);\n\n \\Search::searchBetweenByRange($estimates, request()->range);\n\n \\Search::searchByStatus($estimates, request()->status);\n\n if (is_numeric(request()->rows) && request()->rows >= 10 && request()->rows <= 50) {\n $perPage = request()->rows;\n }\n }\n\n $estimates = $estimates->latest()->paginate($perPage ?? config('app.pagination'));\n $statuses = Status::all();\n return view('admin.documents.estimates.index', compact('estimates', 'statuses'));\n }", "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 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 }", "function printSummary () {\n foreach ($this->ids as $i) {\n $this->link[$i]->printSummary();\n }\n }", "public function index()\n {\n $results = new Result();\n $subjects = new Subject();\n $students = new Student();\n $result_list = Result::orderBy('student_id')->get()->groupBy(function ($item) {\n return $item->student_id;\n });\n\n return view('manage-results.report-test', compact('results', 'subjects', 'result_list', 'students'));\n }", "public function filtersummaryAction()\r\n {\r\n \t/*\r\n \t * form needs to include:\r\n \t * \r\n \t * user id\r\n \t * task category\r\n \t * client id\r\n \t * project id\r\n \t * start date\r\n \t * end date\r\n \t */\r\n $this->view->allUsers = $this->userService->getUserList();\r\n $task = new Task();\r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->clients = $this->clientService->getClients();\r\n \t $this->view->projects = new ArrayObject();\r\n $this->renderView('timesheet/filterSummary.php'); \t\r\n }", "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 index()\n {\n $students = Student::simplePaginate(10);\n \n return view('students.list', compact('students'));\n }", "public function index()\n {\n $students = Student::all()->take(5);\n \n $result = [];\n foreach ($students as $student) {\n $result [] = $this->ResultFormatter($student);\n }\n return $result;\n }", "public function index()\n\t{\n\t\t$entries = Entry::all();\n\n\t\t$expenses = 0;\n\t\t$income = 0;\n\n\t\t// Build up totals\n\t\tforeach ($entries as $entry) {\n\t\t\t// if income\n\t\t\tif ($entry->difference > 0) {\n\t\t\t\t$income += $entry->difference;\n\t\t\t} else {\n\t\t\t\t// if not\n\t\t\t\t$expenses += $entry->difference;\n\t\t\t}\n\t\t}\n\n\t\t// Generate balance; note, expenses are negative, so add.\n\t\t$balance = $income + $expenses;\n\n\t\treturn View::make('all_entries')->with(array(\n\t\t\t'entries' => $entries,\n\t\t\t'balance' => $balance,\n\t\t\t'expenses' => $expenses,\n\t\t\t'income' => $income\n\t\t\t));\n\t}", "public function getStudySummariesList() {\n return $this->_get(13);\n }", "function index() {\n\t\t$this->show_list();\n\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function overviewallAction() {\n\n $this->validateUser();\n\n $testCase = new Yourdelivery_Model_Testing_TestCase();\n $this->view->testcases = $testCase->getTable()->fetchAll()->toArray();\n $this->view->exp = $testCase->getExpectations();\n }", "public function listing();", "public function index()\n {\n $sales = Sale::paginate(10);\n\n return view('manage.sales.index')\n ->withSales($sales);\n }", "public function index()\n {\n $countSales = sizeof(Sale::all());\n $countProducts = sizeof(Product::all());\n $countTrademarks = sizeof(Trademark::all());\n return view('statistic.index', compact('countSales','countProducts','countTrademarks'));\n }", "private function printStatisticsPage() {\n\t\techo '<ul data-role=\"listview\" data-inset=\"true\">';\n\t\t$statistics = array ();\n\t\t$dir = new DirectoryIterator ( 'lessons/' );\n\t\tforeach ( $dir as $fileinfo ) {\n\t\t\tif (! $fileinfo->isDot ()) {\n\t\t\t\t$fileName = pathinfo ( $fileinfo->getFilename (), PATHINFO_FILENAME );\n\t\t\t\t$lection = fgets ( fopen ( $fileinfo->getPath () . '/' . $fileinfo, 'r' ) );\n\t\t\t\tif (strcmp ( \"-stat\", substr ( $fileName, - 5 ) ) != 0) {\n\t\t\t\t\t$stats = $this->getStatsFromFile ( $fileinfo->getPath () . '/' . $fileName . $this::statisticsExtension );\n\t\t\t\t\tarray_push ( $statistics, array (\n\t\t\t\t\t\t\t$lection,\n\t\t\t\t\t\t\t$stats \n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ( $statistics as $stats ) {\n\t\t\techo '<li class=\"centered\" data-form=\"ui-body-a\">', $stats [0], '<br>Richtig: ' . $stats [1] [0] . ' / ' . $stats [1] [1] . '</li>';\n\t\t}\n\t\techo '</ul>';\n\t}", "function pnh_employee_sales_summary()\r\n\t{\r\n\t\t$this->erpm->auth(true);\r\n\t\t$data['page']='pnh_employee_sales_summary';\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t}", "public function getSummary(): string;", "public function index()\n\t{\n\t\t$data = array();\n\t\t$records = ConsolidatedReports::getList();\n\t\t\n\t\tforeach ( $records as $record ) {\n\t\t\t$currentReport = Reports::getReportById($record->report_id);\n\t\t\t$record->incident_report = \"{$currentReport->incident_name} - Incident # {$currentReport->incident_number}\";\n\t\t}\n\t\t\n\t\t$data['records'] = $records;\n\t\t\n\t\treturn view($this->viewPath.'list', $data);\n\t}", "public function index()\n {\n $invpisums = InvPiSum::getAllInvPiSum();\n return InvPiSumResource::collection($invpisums);\n }", "public function index()\n\t{\n\t\t$sales = Sales::paginate(5);\n\t\treturn View::make('trading.sales.index')->with('sales',$sales);\n\t}", "public function index()\n {\n $marriages = $this->marriage->with(['priest'])->paginate();\n\n return view('marriage.index', [\n 'marriages' => $marriages\n ]);\n }", "public function statisticAction() {\n\t\t\t// @TODO: Check toArray\n\t\t$results = $this->resultRepository->findByFeuser((int) $GLOBALS['TSFE']->fe_user->user['uid'])->toArray();\n\t\t$this->view->assign('results', $results);\n\t\t$this->view->assign('page', $this->settings['certificate']['detailPid']);\n\t}", "public function getStudySummariesList() {\n return $this->_get(18);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => InsightsDef::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $sales = Sale::paginate(10);\n\n return view('sales.index', compact('sales'));\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}", "public function index()\n {\n return view('students.index', ['students'=> Student::orderBy('roll', 'ASC')->paginate(5) ]);\n }", "public function overview()\n\t{\n\t\t$total = Article::count();\n\t\t$star = Article::where('star_ind', '1')->count();\n\t\t$read = Article::where('status', 'read')->count();\n\t\t$unread = $total - $read;\n\t\treturn response()->json(compact('total', 'star', 'read', 'unread'));\n\t}", "public function index()\n {\n $overviews = FeatureOverview::where('status',1)->paginate(5);\n return view('admin.feature_overview.List',compact('overviews'));\n }", "public function index()\n\t{\n $statuses = $this->statusRepository->getFeedForUser(Auth::user());\n\n\t\treturn View::make('statuses.index',compact('statuses'));\n\t}", "public function actionStatistical()\n {\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->statistictalSearch(Yii::$app->request->queryParams);\n\t\t\n// var_dump($dataProvider->getModels());\n\t\t\n\t\t// exit;\n return $this->render('statistical', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $interests = Interest::orderBy('title')->paginate(10);\n\n return view('admin.interest.index', compact('interests'));\n }", "public function displayContentOverview() {}", "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 listing() {\n check_access($this->session->userdata('role_id'),3);\n \n $data = array();\n $data['title'] = \"Day Listings\";\n $data['content'] = \"admin/dayopenclose/listing\";\n $this->load->view(ADMIN_BODY, $data);\n }", "public function getSummaryOfTotalsReport()\n\t{\n\t\treturn view('reports.summary-of-totals', [\n\t\t\t\t'from_date' => null,\n\t\t\t\t'to_date' => null,\n\t\t\t\t'total_properties' => null,\n\t\t\t\t'totals_per_seller_status' => null,\n\t\t\t\t'totals_per_property_status' => null,\n\t\t\t\t'totals_per_area' => null,\n\t\t\t\t'totals_per_greater_area' => null,\n\t\t\t\t'generated' => false\n\t\t]);\n\t}", "private function ga_api_account_summaries() {\n\t\t$request = Ga_Lib_Api_Request::get_instance();\n\t\t$request = $this->sign( $request );\n\t\t$response = $request->make_request( self::GA_ACCOUNT_SUMMARIES_ENDPOINT );\n\n\t\treturn new Ga_Lib_Api_Response( $response );\n\t}", "public function getOverview() {}", "public function overview()\n {\n return $this->responseFactory->view('post.list', [\n 'posts' => Post::published()->simplePaginate(25)\n ]);\n }", "public function getOverview() {}", "protected function index() \n {\n //fetch all entries\n $rows = Article::where('group_id', Auth::user()->group_id)->where('status', '>=', 1)->get(); \n foreach ($rows as $row) \n { \n $row['owner_id'] = User::findOrFail($row['owner_id'])->name;\n\n //show 100st caracther of the description\n $content_length = strlen($row['content']);\n $row['content'] = substr(strip_tags($row['content']), 0, min(150, $content_length)) . (($content_length > 100) ? '...' : '');\n }\n return view('dashboard.article.view')->with('data', $rows);\n }", "public function overview() {\r\n\r\n // load model\r\n require_once APP_PATH . '/models/LocationsModel.php';\r\n\r\n // get all locations\r\n $locationsModel = new LocationsModel();\r\n $locations = $locationsModel->getAll();\r\n\r\n // show views\r\n loadView('theme/header');\r\n loadView('locations/overview', [\r\n 'locations' => $locations,\r\n ]);\r\n loadView('theme/footer');\r\n }", "public function index()\n {\n $prosStudents = ProspectiveStudent::simplePaginate(5);\n return view('admin.prosStudent.index', compact('prosStudents'));\n }", "public function getOverview();", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\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 index()\n {\n $items = SalesItem::distinct()->get(['supplier']);\n\n return view('scrap.sale.index', compact('items'));\n }", "public function getStudySummariesList() {\n return $this->_get(4);\n }", "public function getIndex()\n {\n // Title\n $title = \"LoveDining Statistic\";\n\t\t\n // Grab all the Statistics\n $stat = Statistic::all();\n // Show the page\n return View::make('admin/stat/index', compact('stat', 'title'));\n }", "function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}", "public function index()\n {\n $data = Student::paginate(5);\n return view('admin.students.index', [\n \"data\" => $data\n ]);\n }", "public function index()\n {\n return view('result', ['adverts'=>Advert::with('modification.model.mark')\n ->orderBy('created_at', 'DESC')\n ->simplePaginate(5)]);\n }", "public function summaryAction()\r\n {\r\n \t$timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n $users = $this->userService->getUserList();\r\n\r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n\r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $order = 'endtime desc';\r\n\r\n $this->view->taskInfo = array();\r\n\r\n $project = null;\r\n if ($this->_getParam('projectid')) {\r\n \t$project = $this->projectService->getProject($this->_getParam('projectid'));\r\n }\r\n \r\n foreach ($users as $user) {\r\n \t$this->view->taskInfo[$user->username] = $this->projectService->getTimesheetReport($user, $project, null, -1, $start, $end, $cats, $order);\r\n }\r\n \r\n $task = new Task();\r\n \r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $this->renderView('timesheet/user-report.php');\r\n }", "public function actionIndex()\n {\n \n $salons = Salon::find()->asArray()->all();\n\n return $this->render('index', [\n 'salons' => $salons,\n ]);\n }", "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 category_summary()\n\t{\n\t \t$categories = MainCategories::select('*')->orderBy('id', 'asc')->get();\n\t \t//echo \"<pre/>\";print_r($categories);\n\t \treturn view('admin.main_categories.category_summary', compact('categories'));\n\t}", "public function index()\n {\n\n $students = Student::with('user')->paginate(15);\n\n return view('sections.admin.students.index', compact('students'));\n }", "public function index()\n {\n $students = Student::all()->sortByDesc('updated_at');\n $students_status = Student::all()->pluck('id', 'status')->all();\n return view('admin.students.index', compact('students', 'students_status'));\n }" ]
[ "0.72245854", "0.7125255", "0.6964007", "0.68833447", "0.67833734", "0.67833734", "0.67833734", "0.67470205", "0.66440135", "0.6590939", "0.6548849", "0.64934707", "0.6492391", "0.64636064", "0.64316684", "0.6407456", "0.63297063", "0.6318976", "0.6317237", "0.6315878", "0.6310268", "0.6293033", "0.629225", "0.62884456", "0.62771744", "0.62747705", "0.6261185", "0.62438196", "0.62320524", "0.6224541", "0.621346", "0.621346", "0.621308", "0.621308", "0.621308", "0.621308", "0.621308", "0.621308", "0.621308", "0.6199946", "0.618098", "0.61687016", "0.61686707", "0.61653155", "0.6157126", "0.61293745", "0.61242056", "0.6119452", "0.61175656", "0.61175656", "0.61175656", "0.6114874", "0.6113488", "0.61115193", "0.6105935", "0.6105397", "0.6104384", "0.6095703", "0.6090433", "0.60728896", "0.60688365", "0.606532", "0.6063852", "0.60628706", "0.6049554", "0.6044238", "0.6035645", "0.6035245", "0.6034119", "0.60288644", "0.6025691", "0.6022736", "0.6014485", "0.60139513", "0.60079306", "0.6003743", "0.60016215", "0.5998381", "0.59961784", "0.599546", "0.59947413", "0.598438", "0.5981963", "0.5981803", "0.59742254", "0.59639186", "0.5962439", "0.5959654", "0.5950585", "0.59481853", "0.59474593", "0.593227", "0.5929293", "0.59281856", "0.5928062", "0.59230024", "0.59230024", "0.5922814", "0.59221226", "0.59155303" ]
0.7588896
0
Show the form for creating a new summary
public function create() { return View::make('summaries.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "protected function addShowForm() \n {\n return view('dashboard.article.add');\n }", "public function addForm() {\n $this->view->displayForm();\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction() {\n \n\n $entity = new MedicamentosSuministrados();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('models.statistics.create');\n }", "public function create()\n\t{\n $summaries = Summaries::lists('name','id');\n\n return View::make('task.create',compact('summaries'));\n\t}", "public function get_add(){\n return View::make('stance.add')->with('title', 'Submit a Stance')->with('subtitle', 'Try to make your views official party Stances');;\n }", "public function create()\n\t{\n\t\treturn view('consulations.create');\n\t}", "public function create()\n {\n return view('admin.std.create');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "function display_add() {\n $this->_addform->display();\n }", "public function create()\n {\n return view('all-section.student.result.create');\n }", "public function create()\n {\n return view('Samples.create', [\n 'create' => new FormBuilder(\n [\n 'title'=>'text',\n 'slug'=>'text',\n 'type_id'=>'hidden',\n 'id'=>'hidden' \n ],\n ['samples.store'],\n 'POST',\n 'Create'\n ) \n ]);\n }", "public function create() {\n\t \n \n\t return view('admin.totalcreate');\n\t \t\n\t }", "public function create()\n\t{\n\t\treturn View::make('trading.sales.create')->with('page','Sales')->with('modul','Create');\n\t}", "public function showForm(){\n return view('marketItem.itemCreateForm');\n }", "function show_new_record() {\r\n if ($this->allow_new) {\r\n #~ echo \"<p><a href='{$_SERVER['PHP_SELF']}?m={$this->module}&amp;act=new&amp;go=\".urlencode($GLOBALS['full_self_url']).\"'>Insert new row</a>\";\r\n echo '<form method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n echo '<input type=hidden name=\"m\" value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=\"act\" value=\"new\">';\r\n echo '<input type=hidden name=\"go\" value=\"'.htmlentities($GLOBALS['full_self_url']).'\">'; # url to go after successful submitation\r\n # if i'm a detail, get master-detail field's value and pass it to new-form\r\n if ($this->logical_parent) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->parentkey) { # foreign key always int\r\n echo '<input type=hidden name=\"sugg_field['.$colvar.']\" value=\"'.htmlentities($col->parentkey_value).'\">';\r\n }\r\n }\r\n }\r\n echo '<p>'.lang('Add').' <input type=text name=\"num_row\" size=2 value=\"1\"> '.lang($this->unit).' <input type=submit value=\"'.lang('Go').'\">';\r\n echo '</form>';\r\n }\r\n }", "public function create()\n {\n\t $shops = Shops::all();\n\t $warehouse = Warehouse::all();\n\t $suppliers = suppliers::all();\n\t\n\t return view(\"admin.income.create\",compact( 'shops', 'warehouse','suppliers'));\n }", "public function create()\n {\n return view('admin.master.sales_man.add');\n }", "public function create()\n {\n return view('study.create');\n return \"Aquí formulario de crear estudios\";\n }", "public function create()\n {\n return view('admin.insurance.create');\n }", "public function create()\n\t{\n\t\treturn View::make('centrals.create');\n\t}", "public function create()\n {\n return view('paneladmin/addKredit');\n }", "public function create()\n {\n return view('cli.informacion.create');\n }", "public function create()\n {\n return view('backoffice.administration.siswa.add');\n }", "public function create()\n {\n return \\View::make('mady-skincare.Formulation.formulation-create');\n }", "public function showAddStudent() {\n\n $viewName = $this->viewFolderStudent . '.addStudent';\n\n return view($viewName);\n }", "public function actionCreate()\n\t{\n\t\t$model=new JobSummary;\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['JobSummary']))\n\t\t{\n\t\t\t$model->attributes=$_POST['JobSummary'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->JOB_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('saldo.form');\n }", "public function create()\n {\n //\n return View::make('admin.form_int_mun');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function getCreate(){\n\t\treturn View::make('admin.plan.add')\n\t\t\t\t\t->with('insurances', Insurance::lists('name', 'id'));\n\t}", "public function create()\n {\n return view('backend.student.form');\n }", "public function create()\n\t{\n\t\treturn view('stafs.create');\n\t}", "public function create()\n {\n return view('sucursals.create');\n }", "public function addForm()\n {\n $this->getState()->template = 'displaygroup-form-add';\n $this->getState()->setData([\n 'help' => $this->getHelp()->link('DisplayGroup', 'Add')\n ]);\n }", "public function create()\n {\n return view('backend.singers.addnew');\n }", "public function create() {\n\t\t$title = trans( 'online_exam.new' );\n\t\t$this->generateParam();\n\n\t\treturn view( 'layouts.create', compact( 'title' ) );\n\t}", "public function create()\n {\n return view('analysis.create');\n }", "public function create()\n {\n return view('pages.incomes.create');\n }", "public function create()\n {\n return View::make('dashboard.tips.create_edit')\n ->withPageTitle(trans('dashboard.tips.add.title').' - '.trans('dashboard.dashboard'));\n }", "public function showInvestmentForm()\n\t{\n\t\t//get id of logged in user\n\t\ttry\n\t\t{\n\t\t\t//get user id from auth\n\t\t\t$userId = Auth::id();\n\t\t\t//get investment related data from trait,all count and sum\n\t\t\t$countInvData = $this->GetOwnerDetails($userId);\n\t\t\t//send data to view\n\t \treturn view('owner.add_investment',['countInvData'=>$countInvData]);\n\t\t}\n\t catch(Exception $e){\n\t\t \tabort(403, $e->getMessage());\n\t\t}\n\t}", "public function create()\n {\n return view('backend.seos.form', [\n 'nameAction' => 'Новое правило SEO',\n 'controllerPathList' => self::$path,\n 'controllerAction' => 'add',\n 'controllerEntity' => new SEO()\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 $title = trans('measures.create');\n\n return view('measures.create',compact('title'));\n }", "public function showForm()\n {\n return view('admin.groups.create');\n }", "public function create()\n\t{\t\n\n\t\treturn View::make('admin.expense.add')->with('cashInHand', Expense::cashInHand());\n\t}", "public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }", "public function create()\n {\n //\n return view('Admin.Meals.add');\n }", "public function create()\n {\n $template = (object) $this->template;\n $form = $this->form();\n return view('admin.disposisi.create', compact('template','form'));\n }", "public function create()\n {\n return view('documento_institucionals.create');\n }", "public function create()\n {\n //\n return view('student_info_create');\n }", "public function create()\n {\n \n return view('system-mgmt/policestation/create');\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n\t{\n\t\treturn View::make('admin.banner.create-detail');\n\t}", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n {\n return view('meal.addmealform');\n }", "public function newAction()\n {\n View::renderTemplate('Expense/new.html', [\n 'categories' => Expense::getCategories(),\n 'methods' => Payment::getCategories()\n ]);\n }", "public function actionCreate()\n {\n $model = new AfterSaleStatistics();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('backend.admin.medicine.create');\n }", "public function getCreate()\n\t{\n\t\treturn view('beneficios.create');\n\t}", "public function showAdd()\n {\n return View::make('honeys.add');\n }", "public function create()\n {\n return view('student.add');\n }", "public static function display_create_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=save' method='post'>\";\n echo \"Name: <input type='text' name='name' /><br />\";\n echo \"Description: <textarea name='description'></textarea><br />\";\n echo \"<input type='submit' value='Save' />\";\n echo \"</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 Pensum();\n $form = $this->createForm(new PensumType(), $entity);\n\n return $this->render('QQiRecordappBundle:Pensum:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction(): void\n {\n $this->view->form = new AnaForm(null, ['edit' => true]);\n }", "public function addform()\n {\n \n //$this->session_manager->validateFashion(__METHOD__);\n \n $data['cate'] = $this->promo->promoSliderOptionCuisine($by_id=null,$platform=1);\n $data['promo_duration'] = $this->promo->promoDurationOption();\n $data['admin_info'] = $this->promo->adminInfo();\n \n $data['title_type']= 'New Promo Form';\n $data ['content_file']= 'promo_new';\n $data['pageheader'] = \"Add Promo\";\n $data['breadCrumbs'] = '<li class=\"breadcrumb-item\"><a href=\"'.site_url(\"jollofadmin/promos\").'\">Promos</a></li> <li class=\"breadcrumb-item active\">Add Promo</li>';\n $data['mainmenu'] = \"promos\";\n $this->load->view('jollof_admin/layout', $data);\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n return view(\"Add\");\n }", "public function create()\n {\n return view('supplier.add');\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\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 return view('warrant::admin.acts.create');\n }", "public function create()\n {\n //\n $caseReference= commonModel::CaseList();\n\n return view('admin.case.coartInfo.form', compact('caseReference'));\n }", "public function create()\n {\n return view('admin.additionals.create');\n }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "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('dashboard.assessment.create');\n }", "public function create()\n\t{\n\t\treturn View::make('salesmanagers.create');\n\t}", "public function create()\n\t{\n\t\treturn View::make('usp.koperasi.create')->with('page','Koperasi')\n\t\t->with('modul','Create');\n\t}", "public function create()\n {\n return view(\"backoffice.service_detail.create\");\n }", "public function display_summary() {\n // FIXME\n }", "public function getAdd()\n\t{\n\t $form = \\FormBuilder::create($this->form, [\n 'method' => 'POST',\n 'model' => $this->getModelInstance(),\n 'url' => ($this->url_prefix.'/add')\n ]);\n return view($this->tpl_prefix.'add',array('catalog'=>$this), compact('form'));\n\t}", "public function create()\n {\n return view('addBankDetail');\t}", "public function create()\n {\n return view('admin/school/detail/school_info.create');\n }", "public function create()\n {\n return view('admin.complaint.add');\n }", "public function newAction()\n {\n\t\tTag::appendTitle('Create Article');\n }", "public function create()\n {\n $briefcases = Briefcase::lists('name','id')->toArray();\n\n return view('group.create', compact('briefcases'));\n }", "public function create()\n {\n return view('student::students.student.create');\n }", "public function create()\n {\n return view('admin.visit_purpose.add_visit_purpose');\n }", "public function create()\n {\n //\n\n return view('suplier.create');\n }", "public function create()\n {\n return view('admin.award.form');\n }", "public function displayNewAction() {\n $params = t3lib_div::_GET('libconnect');\n $params['jq_type1'] = 'ID';\n $params['sc'] = $params['search']['sc'];\n if(!empty($params['subject'])){\n $subject = $this->ezbRepository->getSubject($params['subject']);\n $params['Notations']=array($subject['ezbnotation']);\n }\n unset($params['subject']);\n unset($params['search']);\n\n //include CSS\n $this->decideIncludeCSS();\n\n //date how long entry is new\n $params['jq_term1'] = $this->getCalculatedDate();\n\n $config['detailPid'] = $this->settings['flexform']['detailPid'];\n\n if(empty($config['detailPid'])){\n $this->addFlashMessage(\n \"Bitte konfigurieren Sie ein Ziel für die Detailseite.\",\n $messageTitle = 'Fehler',\n $severity = \\TYPO3\\CMS\\Core\\Messaging\\AbstractMessage::ERROR,\n $storeInSession = TRUE\n );\n $liste = FALSE;\n }else{\n //request\n $journals = $this->ezbRepository->loadSearch($params, false, $config);\n }\n \n //variables for template\n $this->view->assign('journals', $journals);\n $this->view->assign('new_date', $params['jq_term1']);\n $this->view->assign('subject', $subject['title']);\n }", "public function show() {\n return view('add_info');\n }", "public function incomeFormAction()\n\t{\n\t\tView::renderTemplate('Income/addIncome.html', [\n\t\t\t'date' => date('Y-m-d'),\n\t\t\t'incomes' => Income::getIncomesCategories()\n\t\t]);\n\t}", "public function create()\n {\n return view('admin.stadium.create');\n }" ]
[ "0.6642981", "0.6596088", "0.65905017", "0.65787107", "0.652507", "0.6524237", "0.6498433", "0.6488183", "0.6470251", "0.6452301", "0.64511615", "0.64496976", "0.64374363", "0.64304864", "0.6414343", "0.6397362", "0.6390753", "0.63803744", "0.6378605", "0.63565904", "0.6355394", "0.6354594", "0.63523465", "0.63490766", "0.6336795", "0.63249344", "0.63225347", "0.63197213", "0.6312675", "0.63007694", "0.63001984", "0.62875247", "0.6287347", "0.6286393", "0.62855697", "0.62827873", "0.628262", "0.6277546", "0.6274677", "0.62721443", "0.626397", "0.626001", "0.62596405", "0.6258199", "0.6253488", "0.62483007", "0.6246843", "0.62414396", "0.6241352", "0.6240546", "0.6237596", "0.62238026", "0.6216435", "0.6212816", "0.6209872", "0.6209436", "0.6206839", "0.62026733", "0.6197239", "0.6191022", "0.6188645", "0.6185722", "0.6184306", "0.6176621", "0.61760825", "0.6172907", "0.61717045", "0.61707175", "0.61673003", "0.6165561", "0.616522", "0.6164942", "0.61538815", "0.61509", "0.614583", "0.61446196", "0.6141144", "0.6140397", "0.6132502", "0.6129348", "0.61265326", "0.61251324", "0.6122477", "0.61214", "0.6121083", "0.61201346", "0.61198986", "0.6117932", "0.61160946", "0.6115608", "0.6114742", "0.61114705", "0.61087704", "0.6101305", "0.6100807", "0.61001456", "0.60948896", "0.60938954", "0.6093883", "0.60934067" ]
0.7400211
0
Store a newly created summary in storage.
public function store() { $validator = Validator::make($data = Input::all(), Summary::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } Summary::create($data); return Redirect::route('summaries.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSummary(string $summary): void;", "public function store(Request $request)\n {\n $request->validate([\n 'evaluatorId'=>'required',\n 'remarks'=>'required',\n 'evaluationDate'=>'required',\n 'userTypeId'=>'required'\n ]);\n\n $evaluation = new evaluationSummary([\n 'evaluatorId' => $request->get('evaluatorId'),\n 'remarks' => $request->get('remarks'),\n 'evaluationDate' => $request->get('evaluationDate'),\n 'userTypeId' => $request->get('userTypeId'),\n 'courseId' => $request->get('courseId'),\n 'report' => $request->get('report'),\n 'publish' => $request->get('publish'),\n ]);\n\n $evaluation->save();\n\n return response()->json($evaluation, 201);\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }", "public function 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}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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.59264636", "0.5795525", "0.57839495", "0.57735044", "0.57464194", "0.57464194", "0.57464194", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892", "0.5719892" ]
0.69186705
0
Display the specified summary.
public function show($id) { $summary = Summary::findOrFail($id); return View::make('summaries.show', compact('summary')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_summary() {\n // FIXME\n }", "public function summary();", "public function setSummary($summary)\n {\n $this->summary = $summary;\n }", "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 }", "public function setSummary(string $summary): void;", "public function getSummary();", "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}", "public function setSummary(string $summary): void\n {\n $this->summary = $summary;\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 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 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 get_summary() {\n return $this->summary;\n }", "function printSummary () {\n foreach ($this->ids as $i) {\n $this->link[$i]->printSummary();\n }\n }", "public function getSummary(): string\n {\n return $this->summary;\n }", "public function getSummary(): string;", "public static function getName()\n {\n return 'summary';\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 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}", "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 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 getSummary(): string {\n return $this->body['summary'] ?? \"none\";\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\t\treturn $this->summary;\n\t}", "public function getSummary() {\n return $this->summary;\n }", "function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}", "function set_summary($string) {\n $this->summary = $string;\n return true;\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 }", "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 setSummary($summary, array $parameters = null) {\n \n if (!empty($summary)) {\n $this->instance->add($this->calendar->createProperty('SUMMARY', $summary, $parameters));\n }\n }", "public function setSummary(string $summary)\n {\n $this->summary = $summary;\n\n return $this;\n }", "public function setShowSummary($showSummary) {\r\n\t\t$this->showSummary = $showSummary;\r\n }", "function getSummary() {\n\t\treturn $this->data_array['summary'];\n\t}", "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 summary()\n {\n $this->arguments[] = '--summary';\n\n return $this;\n }", "function getSummary(){\n\t\t$output=\"{$this->getTitle()} ({$this->getProducer()})\";\n\t\treturn $output;\n\t}", "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 }", "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 setSummary($value)\n {\n return $this->set('Summary', $value);\n }", "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 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 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 getSummaryForDisplay()\n {\n if (is_string($this->_description)) {\n return $this->_description;\n }\n\n return $this->buildCommand();\n }", "public function display(){}", "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 buildPaneSummary();", "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 testGettingTheSummary()\n {\n $this->assertEquals('summary', $this->revision->getSummary());\n }", "public function summary($remote = false) {\n\t\treturn $this->cmd('summary')->remote($remote);\n\t}", "public function setSummary(?string $summary): self\n {\n $this->summary = $summary;\n\n return $this;\n }", "function summary() {\n return NULL;\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 }", "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 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 display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function getSummary(): ?string\n {\n return $this->summary;\n }", "abstract function display();", "abstract function display();", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "function printResultsSummary($jobId) {\n $this->printDebugMessage('printResultsSummary', 'Begin', 1);\n echo \"<p>Results:</p>\\n\";\n echo \"<ul>\\n\";\n $resultTypes = $this->getResultTypes($jobId);\n foreach($resultTypes as $resultType) {\n $resultUrl = \"?jobId=$jobId&resultType=\" . $resultType->identifier;\n print \"<li><a href=\\\"$resultUrl\\\">\" . $resultType->label . \"</a>\";\n if(isset($resultType->description)) {\n\tprint \": \" . $resultType->description . \"\\n\";\n }\n print \"</li>\\n\";\n }\n echo \"</ul>\\n\";\n $this->printDebugMessage('printResultsSummary', 'End', 1);\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 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 }", "public function show(ss $ss)\n {\n //\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 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 show(FunFacts $funFacts)\n {\n //\n }", "public function show(Routine $routine)\n {\n //\n }", "private function escapeSummary($summary) {\n return str_replace(array('<', '>'), array('&lt;', '&gt;'), $summary);\n }", "public function display()\n {\n }", "public function display()\n {\n }", "public function display()\n {\n }", "public function display()\n {\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 summaryAction()\n {\n // handle unfiltered collection\n $collection = $this->getCollection();\n return $this->toJson([\n 'numberOfTotalItems' => $collection->queryCount(),\n ]);\n }", "public function display() {}", "public function display() {}", "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 }", "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 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 getSummaryData();", "public function setRunSummary($val)\n {\n $this->_propDict[\"runSummary\"] = $val;\n return $this;\n }", "public function show(Statut $statut)\n {\n //\n }", "public abstract function display();", "function renderConstantSummary() {\n\n reset($this->accessModifiers);\n while (list($k, $access) = each($this->accessModifiers)) {\n if (0 == count($this->constants[$access])) \n continue;\n\n $this->tpl->setCurrentBlock(\"constantssummary_loop\");\n\n reset($this->constants[$access]);\n while (list($name, $const) = each($this->constants[$access])) {\n\n $this->tpl->setVariable(\"NAME\", $name);\n $this->tpl->setVariable(\"VALUE\", htmlentities($const[\"value\"])); \n \n if (isset($const[\"doc\"][\"shortdescription\"]))\n $this->tpl->setVariable(\"SHORTDESCRIPTION\", $this->encode($const[\"doc\"][\"shortdescription\"][\"value\"]));\n\n if (\"true\" == $const[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"constantssummary\");\n $this->tpl->setVariable(\"ACCESS\", ucfirst($access));\n $this->tpl->parseCurrentBlock();\n\n }\n\n }", "public function display(){\r\n echo \"Unique Row Id: \" . $this->getUnique_studentKey() . \"<br/>\";\r\n echo \"User Id: \" . $this->getStudentUserID() . \"<br/>\";\r\n echo \"Password: \" . $this->getStudentPassword() . \"<br/>\";\r\n echo \"First Name: \" . $this->getFirstName() . \"<br/>\";\r\n echo \"Middle Name: \" . $this->getMiddleName() . \"<br/>\";\r\n echo \"Last Name: \" . $this->getLastName() . \"<br/>\";\r\n echo \"Email: \" . $this->getEmail() . \"<br/>\"; \r\n echo \"School Name: \" . $this->getSchoolName() . \"<br/>\"; \r\n echo \"Grade: \" . $this->getGrade() . \"<br/>\";\r\n echo \"Role: \" . $this->getRole() . \"<br/>\";\r\n }", "public function show(Unit $unit)\n {\n //\n }", "public function show(Unit $unit)\n {\n //\n }", "public function show(Unit $unit)\n {\n //\n }" ]
[ "0.8169734", "0.718636", "0.71636087", "0.71013874", "0.69998616", "0.6787889", "0.6745351", "0.6673561", "0.6657333", "0.6606337", "0.65804404", "0.65731394", "0.65646315", "0.6556759", "0.65393704", "0.65329343", "0.653188", "0.65298164", "0.65181786", "0.65152246", "0.64675844", "0.6464342", "0.6459699", "0.6459699", "0.6459699", "0.6438792", "0.64056313", "0.6399187", "0.6362129", "0.6327021", "0.6300669", "0.6300669", "0.6300377", "0.6300377", "0.6300377", "0.6300377", "0.6300377", "0.6300377", "0.6300377", "0.627685", "0.627685", "0.6243354", "0.6235036", "0.6213094", "0.6194587", "0.6177103", "0.61503047", "0.614357", "0.6127328", "0.61037815", "0.61005133", "0.60971296", "0.60543394", "0.59716", "0.5969277", "0.5961298", "0.59457195", "0.5923402", "0.5892596", "0.58923817", "0.58829224", "0.58680826", "0.58560276", "0.58502376", "0.5807189", "0.5777492", "0.57760924", "0.57588875", "0.5746053", "0.5746053", "0.57457197", "0.57302743", "0.5727155", "0.57268023", "0.5719378", "0.57139", "0.5710418", "0.5697725", "0.5696049", "0.56800294", "0.5676088", "0.5676088", "0.5675899", "0.5675899", "0.56709427", "0.5656765", "0.56505597", "0.56505597", "0.5642478", "0.5640857", "0.56373674", "0.56305116", "0.5613548", "0.5602516", "0.55919147", "0.5578714", "0.5560605", "0.55550236", "0.55550236", "0.55550236" ]
0.6099588
51
Show the form for editing the specified summary.
public function edit($id) { $summary = Summary::find($id); return View::make('summaries.edit', compact('summary')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(evaluationSummary $evaluationSummary)\n {\n //\n }", "private function showConfirmationForm( $summary, $undidRevision = 0 ) {\n\t\t$req = $this->getRequest();\n\n\t\t$args = array(\n\t\t\t'action' => 'submit',\n\t\t);\n\n\t\tif ( $req->getInt( 'undo' ) ) {\n\t\t\t$args[ 'undo' ] = $req->getInt( 'undo' );\n\t\t}\n\n\t\tif ( $req->getInt( 'undoafter' ) ) {\n\t\t\t$args[ 'undoafter' ] = $req->getInt( 'undoafter' );\n\t\t}\n\n\t\tif ( $req->getInt( 'restore' ) ) {\n\t\t\t$args[ 'restore' ] = $req->getInt( 'restore' );\n\t\t}\n\n\t\t$actionUrl = $this->getTitle()->getLocalURL( $args );\n\n\t\t$this->getOutput()->addHTML( Html::openElement( 'div', array( 'style' => 'margin-top: 1em;' ) ) );\n\n\t\t$this->getOutput()->addHTML( Html::openElement( 'form', array(\n\t\t\t'id' => 'undo',\n\t\t\t'name' => 'undo',\n\t\t\t'method' => 'post',\n\t\t\t'action' => $actionUrl,\n\t\t\t'enctype' => 'multipart/form-data' ) ) );\n\n\t\t$this->getOutput()->addHTML( \"<p class='editOptions'>\\n\" );\n\n\t\t$labelText = wfMessage( 'summary' )->text();\n\t\tlist( $label, $field ) = $this->getSummaryInput( $summary, $labelText );\n\t\t$this->getOutput()->addHTML( $label . ' ' . $field );\n\t\t$this->getOutput()->addHTML( \"<p class='editButtons'>\\n\" );\n\t\t$this->getOutput()->addHTML( $this->getEditButton() . \"\\n\" );\n\n\t\t$cancel = $this->getCancelLink();\n\t\tif ( $cancel !== '' ) {\n\t\t\t$this->getOutput()->addHTML( wfMessage( 'pipe-separator' )->escaped() );\n\t\t\t$this->getOutput()->addHTML( $cancel );\n\t\t}\n\n\t\t$this->getOutput()->addHTML( \"</p><!-- editButtons -->\\n</p><!-- editOptions -->\\n\" );\n\n\t\t$hidden = array(\n\t\t\t'wpEditToken' => $this->getUser()->getEditToken(),\n\t\t\t'wpBaseRev' => $this->getTitle()->getLatestRevID(),\n\t\t);\n\t\tif ( !empty( $undidRevision ) ) {\n\t\t\t$hidden['wpUndidRevision'] = $undidRevision;\n\t\t}\n\t\tforeach ( $hidden as $name => $value ) {\n\t\t\t$this->getOutput()->addHTML( \"\\n\" . Html::hidden( $name, $value ) . \"\\n\" );\n\t\t}\n\n\t\t$this->getOutput()->addHTML( Html::closeElement( 'form' ) );\n\t\t$this->getOutput()->addHTML( Html::closeElement( 'div' ) );\n\t}", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "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() {\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 editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "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(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function showEdit()\n {\n\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function edit(Form1 $form1)\n {\n //\n }", "public function edit(Spform $spform)\n {\n //\n }", "function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'transactions');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}", "public function edit($model, $form);", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\r\n\t{\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\r\n\t}", "public function edit()\n {\n return view('common::edit');\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function edit($id)\n {\n $SEO = SEO::find($id);\n if (!$SEO->status) {\n abort(404);\n }\n\n return view('backend.seos.form', [\n 'item' => $SEO,\n\n 'nameAction' => $SEO->original_url,\n 'idEntity' => $SEO->id,\n 'controllerPathList' => self::$path,\n 'controllerAction' => 'edit',\n 'controllerEntity' => new SEO(),\n ]);\n }", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "public function editView() {\n $this->template()->addTplFile('edit.phtml');\n $this->setTinyMCE($this->formEdit->text, 'advanced');\n $this->setTinyMCE($this->formEdit->textPanel, 'advanced', array('height' => 300));\n if(isset($this->formEdit->textFooter)){\n $this->setTinyMCE($this->formEdit->textFooter, 'advanced', array('height' => 300));\n }\n Template_Module::setEdit(true);\n }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit(PersonalDetail $personalDetail)\n {\n //\n }", "public function editPurposePage($id){\n $editableRecord=HPP::find($id);\n return view('Admin.HistoryPlanPurpose.Purpose.EditPurpose',compact('editableRecord'));\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "public function Edit_details_form() {\n\t\t$this->load->model('mlist');\n\t\t$dealerships = $this->mlist->getClients();\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t$user->Address = mod_parser($user->Address);\n\t\t$user->CompanyAddress = mod_parser($user->CompanyAddress);\n\t\t$user->Email = mod_parser($user->Emails,false,true);\n\t\t$user->Phone = mod_parser($user->Phones,false,true);\n\t\t\n\t\t$page = $_GET['page'];\n\t\t\n\t\t$data = array(\n\t\t\t'user'=>$user,\n\t\t\t'dealerships'=>$dealerships,\n\t\t\t'page'=>$page\n\t\t);\t\n\t\t$this->load->dom_view('forms/users/edit_details', $this->theme_settings['ThemeViews'], $data);\n\t}", "public function editForm($id)\n {\n $record = HistoryDb::findOrFail($id);\n $this->edit_id = $id;\n $this->title = $record->title;\n $this->description = $record->description;\n $this->event_date = $record->event_date;\n $this->mode = 'edit';\n $this->submit_text = \"Update\";\n\n // Util::showAlert($this,'Test content...!');\n\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(DetailPelamar $detailPelamar)\n {\n //\n }", "public function edit()\n\t{\n\t\t\n\t}", "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 edit()\n {\n return view('hirmvc::edit');\n }", "public function edit() {\n }", "function edit() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultViewForm();\n\n\t\tif (!$view) {\n\t\t\tthrow new Exception('Edit task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t// Hint the view that it's not a listing, but a form (KenedoView::display() uses it to set the right template file)\n\t\t$view->listing = false;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function 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($id)\n {\n // show form edit user info\n }", "public function getEditForm();", "public function edit($id)\n {\n $getSingleData = Formulation::find($id);\n // return $getSingleData->id;\n\n return \\View::make('mady-skincare/Formulation/Formulation-update' , compact('getSingleData'));\n }", "public function edit(Estimate $estimate)\n {\n //remove this\n }", "function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'groups');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('panel.materiales.edit');\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edit($id)\n {\n $formData = FormData::findOrFail($id);\n $formTemplate = Form::publish()->undelete()->findOrFail($formData->fid);\n $url = route('pub.info.update', $id);\n $form = $this->createForm($formTemplate, $url, 'PUT', $formData);\n return view('pub.info.info', compact('form'));\n }", "public function edit()\n {\n \n \n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "function edit()\n\t{\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Make sure you are logged in\n\t\tif (!$user->authorise('com_weblink.weblink.edit')) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\tJRequest::setVar('view', 'weblink');\n\t\tJRequest::setVar('layout', 'form');\n\n\t\t$model = &$this->getModel('weblink');\n\t\t$model->checkout();\n\n\t\tparent::display();\n\t}", "public function edit()\n {\n return view('stores::edit');\n }", "public function edit()\n {\n return view('policy.edit')->withPage(Policy::first());\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "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($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(FormModel $formModel)\n {\n //\n }", "public function edit()\n {\n return view(\"web_admin.books.edit\");\n }", "function show_edit()\n\t{\n\t\treturn '';\n\t}", "public function edit(){\r\n\r\n\t\t// create info\r\n\t\t$info[] = JText::_('Size').': '.$this->getSize();\r\n\t\t$info[] = JText::_('Hits').': '.(int) $this->get('hits', 0);\r\n\t\t$info = ' ('.implode(', ', $info).')';\r\n\r\n if ($layout = $this->getLayout('edit.php')) {\r\n return $this->renderLayout($layout,\r\n array(\r\n\t\t\t\t\t'info' => $info,\r\n 'hits' => $this->get('hits', 0)\r\n )\r\n );\r\n }\r\n\r\n\t}", "public function edit($slug)\n { \n $sample = $this->sample->whereslug($slug)->first();\n return view('Samples.edit', [\n 'sample' => $sample,\n 'edit' => new FormBuilder(\n [\n 'title'=>'text',\n 'slug'=>'text',\n 'id'=>'hidden', \n ],\n ['samples.update', $slug],\n 'PATCH',\n 'Update'\n ),\n 'delete' => new FormBuilder(\n [], \n ['samples.destroy', $sample->id],\n 'DELETE',\n 'Delete'\n )]);\n }", "public function editAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$layoutName = $this->_request->getParam('layout'); \n\t\t$this->view->objLayout = $model->getLayout($layoutName);\n\t }", "public function edit(PermohonanLab $permohonanLab)\n {\n //\n }", "public function edit($id)\n {\n $single_overview = FeatureOverview::findOrFail($id);\n $titles = FeatureTitle::where('status',1)->get();\n return view('admin.feature_overview.add_edit',compact('titles','single_overview'));\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()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function isEditFormShown() {}", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit(ViewUnits $viewUnits)\n {\n //\n }", "public function edit(Insumo $insumo)\n {\n $this->authorize('update', $insumo);\n return view('theme.backoffice.pages.insumo.edit', [\n 'insumo' => $insumo\n ]);\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n $story = Story::first();\n\n return view('story.edit',compact('story'));\n\n }", "public function edit()\n {\n $aboutus = AboutUs::get()->first();\n return view('admin.aboutus.edit',compact('aboutus')); \n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gc_Service_OrderShow::getOrderShow(intval($id));\n\t\n\t\t//状态\n\t\t$this->assign('ordershow_status', $this->ordershow_status);\n\t\t\n\t\t//渠道\n\t\tlist(,$ordershow_channel) = Gc_Service_OrderChannel::getAllOrderChannel();\n\t\t$ordershow_channel = Common::resetKey($ordershow_channel, 'id');\n\t\t$this->assign('ordershow_channel', $ordershow_channel);\n\t\t\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function editAction() {}", "public function edit()\n {\n return view('admin.profile.edit');\n }", "public function edit()\n {\n return \"Ini Halaman Edit\";\n }", "public function edit($id)\n\t{\n\t\t$student = $this->student->find($id);\n\t\t$center = Center::lists('name_vi', 'id');\n\t\t$type = $this->type->lists('name','id');\n\t\treturn view('Admin::pages.student.view', compact('student', 'center', 'type'));\n\t}", "public function edit($id, $newTitle = null, $newDescription = null);", "public function edit(Estadios $estadios)\n {\n //\n }", "public function edit(Insumo $insumo)\n {\n //\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit($id) {\n\t\t//\n\t\tvar_dump ( \"edit--\" . $id );\n\t\treturn view ( 'app.web.flowscript' );\n\t}", "public function edit($id)\n {\n $sucursal= Sucursal::find( $id );\n return view('sucursals.edit', compact('sucursal'));\n }", "public function edit($id)\n {\n //see modal controller\n }" ]
[ "0.71452236", "0.6981046", "0.68195707", "0.67479897", "0.6722708", "0.6716508", "0.662612", "0.64748806", "0.6457006", "0.6407958", "0.6406284", "0.6395663", "0.63723445", "0.6369635", "0.6303251", "0.628466", "0.624427", "0.6237623", "0.6236822", "0.62367845", "0.62367845", "0.62259084", "0.6225596", "0.6218582", "0.6207331", "0.62027323", "0.6177553", "0.6176448", "0.61754346", "0.61693573", "0.6168835", "0.6168835", "0.6162178", "0.6151623", "0.615007", "0.6140805", "0.613626", "0.61232066", "0.6117395", "0.61163694", "0.6109009", "0.6107711", "0.61064494", "0.6103831", "0.6097793", "0.6092456", "0.60868925", "0.6086611", "0.60843754", "0.6083017", "0.60789114", "0.60787517", "0.6074852", "0.6074679", "0.6065355", "0.60648096", "0.6062797", "0.60587513", "0.60568804", "0.6055254", "0.60545415", "0.60513604", "0.6049498", "0.60492027", "0.60464483", "0.6039274", "0.60390425", "0.6030874", "0.6003183", "0.60004485", "0.5999602", "0.59984523", "0.5997281", "0.5991977", "0.598522", "0.59848225", "0.59775025", "0.59711593", "0.5960364", "0.5953611", "0.59518087", "0.59516895", "0.594667", "0.594667", "0.594667", "0.5942549", "0.5940899", "0.5939645", "0.5936387", "0.59361774", "0.59337693", "0.59266776", "0.5926592", "0.59201837", "0.5919146", "0.59173983", "0.59173983", "0.59146935", "0.5913727", "0.5912773" ]
0.704775
1
Update the specified summary in storage.
public function update($id) { $summary = Summary::findOrFail($id); $validator = Validator::make($data = Input::all(), Summary::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $summary->update($data); return Redirect::route('summaries.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSummary(string $summary): void;", "public function setSummary($summary)\n {\n $this->summary = $summary;\n }", "function update_summary() {\n\tinclude 'get_data.php';\n\t//find the relevant info from db_data.json and store it in summary.json\n\tinclude 'summary_data.php';\n}", "public function setSummary(string $summary): void\n {\n $this->summary = $summary;\n }", "public function update(Request $request, evaluationSummary $evaluationSummary)\n {\n //\n }", "public function setSummary($summary, array $parameters = null) {\n \n if (!empty($summary)) {\n $this->instance->add($this->calendar->createProperty('SUMMARY', $summary, $parameters));\n }\n }", "public function setRunSummary(?DeviceHealthScriptRunSummary $value): void {\n $this->getBackingStore()->set('runSummary', $value);\n }", "function update($units, $total){}", "public function edit(evaluationSummary $evaluationSummary)\n {\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, 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 }", "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 testUpdateMetadata1UsingPUT()\n {\n }", "public function update(StoreEstimateRequest $request, $id)\n {\n\t\tDB::beginTransaction();\n\t\ttry {\n\t\t\t$estimate = Estimate::find($id);\n\t\t\t$estimate->fill($request->all());\n\t\t\t$estimate->setRedundantData(auth()->user());\n\n\t\t\t$details_input = $request->get('details');\n\t\t\t$details = [];\n\t\t\t$delete_detail_ids = [];\n\t\t\tforeach ($details_input as $key => $detail_input) {\n\t\t\t\tif (is_numeric($key) === false ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ($detail_input['is_delete']) {\n\t\t\t\t\t$delete_detail_ids[] = $detail_input['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$detail = EstimateDetail::firstOrNew(['id' => $detail_input['id']]);\n\t\t\t\t\t$detail->fill($detail_input);\n\t\t\t\t\t$details[] = $detail;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$estimate->total_price = $estimate->calc_price($details);\n\t\t\t$estimate->save();\n\t\t\t$estimate->estimate_details()->saveMany($details);\n\t\t\tEstimateDetail::destroy($delete_detail_ids);\n\t\t} catch (Exception $e) {\n\t\t\tDB::rollback();\n\t\t\treturn back()->withInput();\n\t\t}\n\t\tDB::commit();\n\n\t\treturn redirect()\n\t\t\t\t->route('estimates.index')\n\t\t\t\t->with('message', '更新しました');\n }", "public function update(Request $request)\n {\n $this->validate ( $request, [\n 'measure_name' => 'required|min:1|max:255',\n ] );\n \n $measures = MeasureUnit::find($request->index);\n $measures->measure_name = $request->measure_name;\n $measures->measure_symbol = $request->measure_symbol;\n \n $measures->save ();\n \\Session::flash('flash_message_success','Unités de mesure modifiée');\n $measures = MeasureUnit::all ();\n return redirect('stock/mesures');\n }", "public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }", "public function setNewSummary($value)\n {\n return $this->set('NewSummary', $value);\n }", "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 update()\n {\n update($this->id, $article);\n }", "public function setSummary($value)\n {\n return $this->set('Summary', $value);\n }", "public function testUpdate()\n {\n Debrief::exists() || Debrief::factory()->create();\n $debrief = Debrief::latest()->first();\n $newDebrief = Debrief::factory()->make();\n\n $tutor = Tutor::find($debrief['tutor_id']);\n $student = Student::find($debrief['student_id']);\n $contact = Contact::find($debrief['contact_id']);\n\n $data = [\n 'date' => $newDebrief->date,\n 'summary' => $newDebrief->summary,\n 'student' => $student->getKey(),\n 'tutor' => $tutor->getKey(),\n 'contact' => $contact->getKey()\n ];\n\n $response = $this->actingAs($this->adminUser)->putJson('/api/debriefs/' . $debrief->getKey(), $data);\n if ($response->exception) {\n dd($response->exception);\n }\n\n $debrief = $debrief->fresh();\n $expectedResponseContent = (new DebriefResource($debrief))->toArray(request());\n\n\n $response->assertOk()\n ->assertJson([\n 'data' => $expectedResponseContent\n ]);\n\n $this->actingAs($this->unauthorizedUser)->putJson('/api/debriefs/' . $debrief->getKey(), $data)\n ->assertForbidden();\n }", "public function updateSummaryFields(&$fields)\n {\n $tagNamesSummary = null;\n foreach ($fields as $key => $summary) {\n if ($key === 'getNamesAsTagWithExtraInfo') {\n $tagNamesSummary = $fields[$key];\n unset($fields[$key]);\n }\n }\n\n if ($tagNamesSummary) {\n $fields['getNamesAsTagWithExtraInfo'] = $tagNamesSummary;\n }\n }", "public function update(StoreArticleRequest $request)\n {\n //\n $input = $request->except('id');\n $input['intro']=mb_substr($request->get('content'),0,46);\n \n $request->input('intro',mb_substr($request->get('content'),0,46));\n \n $article = Article::find($request->get('id'));\n $article->update($input);\n $article->tags()->sync($request->get('tag_list'));\n //dd($request->all());\n return redirect('/');\n }", "public function update()\n {\n $this->storage->set(self::STORAGE_KEY, md5(time()));\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function testUpdateStore()\n {\n\n }", "public function testUpdateStorage() {\n // Setting values in both key stores, then installing the module and\n // testing if these key values are cleared.\n $keyvalue_update = $this->container->get('keyvalue.expirable')->get('update');\n $keyvalue_update->set('key', 'some value');\n $keyvalue_update_available_release = $this->container->get('keyvalue.expirable')->get('update_available_release');\n $keyvalue_update_available_release->set('key', 'some value');\n $this->container->get('module_installer')->install(['help']);\n $this->assertNull($keyvalue_update->get('key'));\n $this->assertNull($keyvalue_update_available_release->get('key'));\n\n // Setting new values in both key stores, then uninstalling the module and\n // testing if these new key values are cleared.\n $keyvalue_update->set('another_key', 'some value');\n $keyvalue_update_available_release->set('another_key', 'some value');\n $this->container->get('module_installer')->uninstall(['help']);\n $this->assertNull($keyvalue_update->get('another_key'));\n $this->assertNull($keyvalue_update_available_release->get('another_key'));\n }", "public function setSummary(string $summary)\n {\n $this->summary = $summary;\n\n return $this;\n }", "public function update(Structure $structure = null)\n {\n\n }", "private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}", "protected function UpdateStats() {\n\n $Path= $this->StorageDir.'/Stats.txt';\n // load and parse file\n $Lines= explode(\"\\n\", file_get_contents($Path));\n $Parsed= [];\n foreach($Lines as $Line) {\n $Parts= explode(':', $Line, 2);\n if (count($Parts) > 1) {\n $Parsed[$Parts[0]]= trim(end($Parts));\n }\n }\n // update values\n $Period= $Parsed['Period'] ?: date('r').' - 0';\n $Stats= $Parsed;\n foreach($this->Stats as $k => $v) {\t// transfer values from buffer\n $Stats[$k]= isset($Parsed[$k]) ? intval($Parsed[$k]) + $v : $v;\n }\n // prepare report\n array_walk($Stats, function(&$v, $k){$v= \"$k: $v\";});\n natcasesort($Stats);\n unset($Stats['Period']);\n array_unshift($Stats, 'Period: '.trim(explode(' - ', $Period)[0]).' - '.date('r'), '');\n // save\n file_put_contents($Path, implode(\"\\n\", $Stats));\n }", "public function update($data) {}", "public function update($data) {}", "public function update(Request $request, ViewUnits $viewUnits)\n {\n //\n }", "public function setSummary(?string $summary): self\n {\n $this->summary = $summary;\n\n return $this;\n }", "private function update(Profile $profile, array $infos)\n {\n $newInfo = new StdClass();\n $newInfo->name = $infos[self::NAME];\n $newInfo->altitude = $infos[self::ALTITUDE];\n\n if(isset ($infos[self::ALTITUDETOWZ]))\n {\n $newInfo->altitudeTowz = $infos[self::ALTITUDETOWZ];\n }\n\n $profile->setNewInfos($newInfo);\n\n if ($profile->save())\n {\n $this->info(\"'$profile->stn_code' has been refreshed !\");\n }\n else\n {\n $this->commit = false;\n }\n }", "public function update($article);", "public function updated(Historia $historia)\n {\n //\n }", "public function updated(Structure $structure)\n {\n\t\t\t$structure->updated_by = Auth::id();\n }", "public function testUpdateMetadata2UsingPUT()\n {\n }", "public function update(Request $request, Statistic $statistic)\n {\n $this->validate($request, array(\n 'icon' => 'required|min:3|max:60',\n 'name' => 'required|min:2|max:30',\n 'number' => 'required|max:9',\n 'slug' => 'required|alpha_dash|min:5|max:255|unique:statistics,slug,' . $statistic->id,\n ));\n\n $statistic->icon = $request->icon;\n $statistic->name = $request->name;\n $statistic->number = $request->number;\n $statistic->slug = $request->slug;\n\n $statistic->save();\n\n return redirect()->route('statistics.show', $statistic)\n ->with('success', 'The statistic has been successfully updated!');\n }", "public function update(Request $request, Estadios $estadios)\n {\n //\n }", "public function update(): void\n {\n $content = $this->getOriginalContent();\n\n $parsed = $this->parseContent($content);\n\n $this->storeList($parsed);\n }", "function set_summary($string) {\n $this->summary = $string;\n return true;\n }", "public function testUpdatingData()\n {\n $store = new Storage(TESTING_STORE);\n\n // get id from our first item\n $id = $store->read()[0]['_id'];\n\n // new dummy data\n $new_dummy = array(\n 'label' => 'test update',\n 'message' => 'let me update this old data',\n );\n\n // do update our data\n $store->update($id, $new_dummy);\n\n // fetch single item from data by id\n $item = $store->read($id);\n\n // testing data\n $test = array($item['label'], $item['message']);\n\n // here we make a test that count diff values from data between 2 array_values\n $diff_count = count(array_diff(array_values($new_dummy), $test));\n $this->assertEquals(0, $diff_count);\n }", "public function update(Request $request, $id)\n {\n $post = Statistic::findOrFail($id);\n\n $post-> update( $request->all() );\n\n return redirect()->route('statistic.show', $post->id);\n }", "public function update($banner);", "public function update(Request $request, Study $study)\n {\n $study->fill($request->all());\n $study->save();\n return redirect('/studies');\n }", "public function setSummaries($summary) {\n $this->request->setSummary($summary);\n return $this;\n }", "public function update(Request $request)\n {\n $update_data = EventLogistic::find($request->id);\n\n if ($request->hasFile('new_photo')) {\n $img = $request->file('new_photo');\n $photo_uname = md5(time() . rand()) . '.' . $img->getClientOriginalExtension();\n $img->move(public_path('media/event_services/logistics'), $photo_uname);\n if(!empty($update_data->photo)){\n unlink('media/event_services/logistics/' . $update_data->photo);\n }\n } else {\n $photo_uname = $update_data->photo;\n }\n\n $update_data->title = $request->title;\n $update_data->photo = $photo_uname;\n $update_data->update();\n\n return redirect()->route('logistics.index')->with('success', 'Event logistics updated successfull!');\n }", "public function update(personal $personal);", "public function updatePublic() {\n $this->Industry->updateSystemIndices();\n $this->Markets->updatePublic();\n $this->Usage->sendUsageStats();\n }", "public function updated(Lab $lab)\n {\n $lab->postLog();\n }", "public function testUpdateMetadata3UsingPUT()\n {\n }", "public function update(MeasuresRequest $request, $id)\n {\n $measure = Measures::findOrFail($id);\n\n $input = $request->all();\n $input['ip'] = $request->ip();\n $input['user_id'] = Auth::id();\n\n $measure->update($input);\n\n return redirect('/measures');\n }", "public function update() {\n\t\tif ( empty( $this->smoId ) ) {\n\t\t\tthrow new UnexpectedValueException( \"Use an existing SMO id.\" );\n\t\t}\n\t\tif ( !$this->content || !$this->resource ) {\n\t\t\tthrow new UnexpectedValueException( \"Provide at least a comment, rating or tag and a resource.\" );\n\t\t}\n\t\t$this->action = \"update\";\n\t\t$this->setParameter( \"dtreviewed\", date('c') );\n\t\t$this->createSmoRequest();\n\t\t$xmlVar = new SoapVar( \"<ns1:updateSMO>\".$this->smo.\"</ns1:updateSMO>\", XSD_ANYXML );\n\t\t$this->updateSMO( $xmlVar );\n\t\t$this->processResponse( $this->__getLastResponse() );\n\t}", "public function updatePhoto(Request $request)\n {\n $store = auth('api')->user()->store;\n $currentPhoto = $store->photo;\n $name = 'store-'.$store->id.'-'.time() . '.' . explode('/', explode(':', substr($request->photo, 0, strpos($request->photo, ';')))[1])[1];\n if (!is_dir('storage/store_photo/')) {\n mkdir('storage/store_photo/');\n }\n \\Image::make($request->photo)->save(public_path('storage/store_photo/') . $name);\n $request->merge(['photo' => $name]);\n\n //Deleting current store photo\n if ($currentPhoto != 'store.png') {\n $store_photo = public_path('storage/store_photo/') . $currentPhoto;\n if (file_exists($store_photo)) {\n @unlink($store_photo);\n }\n }\n $store->update(array('photo' => $request->photo));\n\n return $name;\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, OwnMeasurement $ownMeasurement)\n {\n //\n }", "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 }", "public function updateCover(Request $request)\n {\n $store = auth('api')->user()->store;\n $currentCover = $store->cover;\n $name = 'store-'.$store->id.'-'.time() . '.' . explode('/', explode(':', substr($request->photo, 0, strpos($request->photo, ';')))[1])[1];\n if (!is_dir('storage/store_cover/')) {\n mkdir('storage/store_cover/');\n }\n \\Image::make($request->photo)->save(public_path('storage/store_cover/') . $name);\n $request->merge(['photo' => $name]);\n\n //Deleting current store photo\n if ($currentCover != 'store_cover.png') {\n $store_cover = public_path('storage/store_cover/') . $currentCover;\n if (file_exists($store_cover)) {\n @unlink($store_cover);\n }\n }\n $store->update(array('cover' => $request->photo));\n\n return $name;\n }", "public function updated(Credit $credit)\n {\n\n }", "public function update_details($param) {\n \n }", "public function update(AdminUpdateSizing $request, Sizing $sizing)\n {\n if ($sizing->update($request->validated()))\n {\n return redirect()->route('sizing.index');\n }\n }", "public function testUpdateDocumentMetadata()\n {\n }", "public function update(): void\n {\n // Update quality\n $this->item->quality = self::QUALITY_MAX;\n }", "public function update($store, Request $request)\n {\n $params = $request->all();\n\n //$filters = Filter::orderBy('position', 'ASC')->where('is_hidden', 0)->where('is_default', 0)->get();\n if($request->input('tags_string')) {\n $store->tags = explode(\",\", $request->input('tags_string'));\n $store->tags_string = $request->input('tags_string');\n }\n\n $store->fill($request->only(['name', 'description', 'city', 'city_id', 'country']));\n if($request->input('photos') && is_array($request->input('photos'))) {\n $store->photos = $request->input('photos');\n }\n\n\n $store->save();\n\n alert()->success( __('Successfully saved.') );\n return back();\n }", "public function updateSensorDescription($id, $name, $displayName, $deviceType, $pagerType, $dataType, $dataStructure)\n {\n\t\t$data = $this->call(array(\"name\"=>$name, \"display_name\"=>$displayName, \"device_type\"=>$deviceType, \"pager_type\"=>$pagerType, \"data_type\"=>$dataType, \"data_structure\"=>$dataStructure), \"PUT\", \"sensors/\".$id.\".json\");\n\t\treturn $data;\n }", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update(Request $request, Photo $photo)\n {\n $this->ProcessFile($photo, $request);\n $photo->name = request()->input('name');\n $photo->description = request()->input('description');\n $res = $photo->save();\n $message = $res? \"photo \".$photo->name.\" update\": \"photo \".$photo->name.\" not update\";\n session()->flash(\"message\", $message);\n return redirect()->route(\"albums\");\n dd($request->only(['name', 'description']));\n }", "public function update(Request $request, InterviewStatistic $interviewStatistic)\n {\n //\n }", "public function update()\n {\n }", "abstract public function updateData();", "public function update() {\r\n\t\tif ( $this->key === 'job_title' || $this->key === 'job_description' ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$value = $this->get_posted_value();\r\n\t\tupdate_post_meta( $this->listing->get_id(), '_'.$this->key, $value );\r\n\t}", "public function update(StoreGoods $request)\n {\n $imageName = $request->get('img_name_old');\n\n $file = $request->img_name;\n if($file)\n {\n if($file->isValid())\n {\n $imageName = $request->get('id') . '.' . $request->file('img_name')->getClientOriginalExtension();\n $request->file('img_name')->move(public_path(\"/img\"), $imageName);\n }\n }\n\n $result = Goods::where('id', $request->get('id'))\n ->update([\n 'name' => $request->get('name'),\n 'description' => $request->get('description'),\n 'modified' => Carbon::now()->toDateTimeString(),\n 'price' => $request->get('price'),\n 'price_old' => $request->get('price_old'),\n 'shipping_costs' => $request->get('shipping_costs'),\n 'currency_id' => $request->get('currency_id'),\n 'program_id' => $request->get('program_id'),\n 'manufacturer_id' => $request->get('manufacturer_id'),\n 'merchant_id' => $request->get('merchant_id'),\n 'ean' => $request->get('EAN'),\n 'image' => $imageName,\n ]);\n\n if($result)\n {\n Session::flash('message', \"Goods updated!\");\n }\n else\n {\n Session::flash('message', \"Wrong!\");\n }\n\n return redirect()->route('goods.show', ['id' => $request->get('id')]);\n }", "public function update(Request $request, Media $photo)\n {\n if (!$photo) {\n return redirect()->route('photos.index')->with('error', 'Resource not found.');\n }\n\n $validator = Validator::make($request->all(), [\n 'label' => 'required|string|min:3',\n 'description' => 'required|string|min:3'\n ]);\n\n\n // validate inputs\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator->errors())\n ->withInput($request->all());\n } else {\n $photo->name = $request->title ? Str::slug(Str::lower($request->label)) : $photo->name;\n $photo->label = $request->title ? $request->label : $photo->label;\n $photo->description = $request->description ? $request->description : $photo->description;\n $photo->save();\n\n // redirect\n toast('success', 'Update successful!');\n return redirect()->route('photos.show', $photo)->with('photo', $photo);\n }\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Summary::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tSummary::create($data);\n\n\t\treturn Redirect::route('summaries.index');\n\t}", "public function update(){\n\t//\tprint_r($this->country);\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",description=\\\"$this->description\\\",tags=\\\"$this->tags\\\",area_id=\".$this->area_id.\",image=\\\"$this->image\\\",created_at=$this->created_at,is_public=$this->is_public,price=$this->price where id=\".$this->id;\n\t\tExecutor::doit($sql);\n\t}", "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_barang_summary($id) {\n $this->form_validation->set_rules('harga_beli', 'Harga Beli', 'required|trim');\n $this->form_validation->set_rules('kd_dealer', 'Kode Dealer', 'required|trim');\n \n if ($this->form_validation->run() === FALSE) {\n $data = array(\n 'status' => false,\n 'message' => validation_errors()\n );\n\n $this->output->set_output(json_encode($data));\n } else {\n $param = array(\n 'id' => $this->input->post(\"id\"),\n 'id_part' => $this->input->post(\"id_part\"),\n 'harga_beli' => $this->input->post(\"harga_beli\"),\n 'harga_jual' => $this->input->post(\"harga_jual\"),\n 'diskon' => null,\n 'stock' => null,\n 'kd_dealer' => $this->input->post(\"kd_dealer\"),\n 'kd_maindealer' => $this->input->post(\"kd_maindealer\"),\n 'row_status' => $this->input->post(\"row_status\"),\n 'lastmodified_by' => $this->session->userdata('user_id')\n );\n\n $hasil = $this->curl->simple_put(API_URL . \"/api/inventori/barang_summary\", $param, array(CURLOPT_BUFFERSIZE => 10));\n //print_r($hasil);exit();\n $this->session->set_flashdata('tr-active', $id);\n $this->data_output($hasil, 'put');\n }\n }", "function update($md) {\n $this->setName($md->getName());\n $this->setType($md->getType());\n $this->setDescription($md->getDescription());\n $this->setIsRequired($md->getIsRequired());\n $this->setIsEmptyAllowed($md->getIsEmptyAllowed());\n $this->setIsMultipleValuesAllowed($md->getIsMultipleValuesAllowed());\n $this->setKeepHistory($md->getKeepHistory());\n $this->setSpecial($md->getSpecial());\n $this->setUseIt($md->getUseIt());\n }", "public function update(\\SplSubject $load)\n {\n echo 'New Load ' . $load->getTitle() . ' was posted in the market place.';\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(Section $section)\n {\n $this->validate(request(), [\n 'title' => 'required|spamfree'\n ]);\n\n $section->update([\n 'title' => request('title'),\n 'description' => request('description')\n ]);\n }", "public function update()\n {\n if ($GLOBALS['config']['cache_method'] == 'memcached') {\n $this->memcache_obj->flush();\n } elseif ($GLOBALS['config']['cache_method'] == 'apc') {\n apc_clear_cache('user');\n }\n\n $this->removeFiles();\n\n $this->updateDataFormats();\n\n $this->updateSubmitForms();\n $this->updateCategoriesByType();\n $this->updateCategoriesByParent();\n $this->updateCategoriesByID();\n $this->updateSearchForms();\n $this->updateSearchFields();\n\n $this->updateFeaturedFormFields();\n $this->updateTitlesFormFields();\n $this->updateShortFormFields();\n $this->updateSortingFormFields();\n\n $this->updateListingStatistics();\n }", "public function update(Request $request, RemoteAssessment $remoteAssessment)\n {\n //\n }", "public function update($data) {\n\t\t$sql = \"UPDATE time_record_summary_range SET range_start = ?, range_end = ?, description = ?, date_updated = ? WHERE id = ?\";\n\t\t$this->db->query($sql, $data);\n\t}", "public function update(Request $request, $id)\n {\n //dd($request->all());\n Auth::user()->authorizeRoles(['1', '3']);\n\n $sampleCost = new SampleArticle();\n $sampleCost = $sampleCost->getValuePerSample($request->all());\n\n //Update SampleArticle Class\n $sampleArticle= SampleArticle::find($id);\n $sampleArticle->reference = $request->reference;\n $sampleArticle->description = $request->description;\n //Store Image Updated\n $file = $request->file('image_url');\n if($file) {\n $filename = 'sampleArticles/' . explode('.', $file->getClientOriginalName())[0] . '-' . Carbon::now('Europe/London')->format('YmdHis') . '.jpg';\n Storage::disk('public')->put($filename, File::get($file));\n $sampleArticle->image_url = $filename;\n }\n //End Store Image Upload\n $sampleArticle->tamanho1 = $request->tamanho1 ? $request->tamanho1 : '0';\n $sampleArticle->pe1 = $request->pe1 ? $request->pe1 : '0';\n $sampleArticle->perna1 = $request->perna1 ? $request->perna1 : '0';\n $sampleArticle->punho1 = $request->punho1 ? $request->punho1 : '0';\n $sampleArticle->malha1 = $request->malha1 ? $request->malha1 : '0';\n $sampleArticle->maq1 = $request->maq1 ? $request->maq1 : '0';\n $sampleArticle->forma1 = $request->forma1 ? $request->forma1 : '0';\n $sampleArticle->tamanho2 = $request->tamanho2 ? $request->tamanho2 : '0';\n $sampleArticle->pe2 = $request->pe2 ? $request->pe2 : '0';\n $sampleArticle->perna2 = $request->perna2 ? $request->perna2 : '0';\n $sampleArticle->punho2 = $request->punho2 ? $request->punho2 : '0';\n $sampleArticle->malha2 = $request->malha2 ? $request->malha2 : '0';\n $sampleArticle->maq2 = $request->maq2 ? $request->maq2 : '0';\n $sampleArticle->forma2 = $request->forma2 ? $request->forma2 : '0';\n $sampleArticle->tamanho3 = $request->tamanho3 ? $request->tamanho3 : '0';\n $sampleArticle->pe3 = $request->pe3 ? $request->pe3 : '0';\n $sampleArticle->perna3 = $request->perna3 ? $request->perna3 : '0';\n $sampleArticle->punho3 = $request->punho3 ? $request->punho3 : '0';\n $sampleArticle->malha3 = $request->malha3 ? $request->malha3 : '0';\n $sampleArticle->maq3 = $request->maq3 ? $request->maq3 : '0';\n $sampleArticle->forma3 = $request->forma3 ? $request->forma3 : '0';\n $sampleArticle->tamanho4 = $request->tamanho4 ? $request->tamanho4 : '0';\n $sampleArticle->pe4 = $request->pe4 ? $request->pe4 : '0';\n $sampleArticle->perna4 = $request->perna4 ? $request->perna4 : '0';\n $sampleArticle->punho4 = $request->punho4 ? $request->punho4 : '0';\n $sampleArticle->malha4 = $request->malha4 ? $request->malha4 : '0';\n $sampleArticle->maq4 = $request->maq4 ? $request->maq4 : '0';\n $sampleArticle->forma4 = $request->forma4 ? $request->forma4 : '0';\n $sampleArticle->cost1 = round($sampleCost['cor1'], 2);\n $sampleArticle->cost2 = round($sampleCost['cor2'], 2);\n $sampleArticle->cost3 = round($sampleCost['cor3'], 2);\n $sampleArticle->cost4 = round($sampleCost['cor4'], 2);\n $sampleArticle->cor1 = $request->cor1;\n $sampleArticle->cor2 = $request->cor2;\n $sampleArticle->cor3 = $request->cor3;\n $sampleArticle->cor4 = $request->cor4;\n $sampleArticle->save();\n\n //dd($request->all());\n //dd($sampleArticle->sampleArticleWires()->get()->values()->get(0)->wireColors()->get()->values()->get(0)->warehouse_product_spec_id);\n\n //Store on SampleArticleWire Class\n //Run for each row of the table\n for($i = 1; $i < $request->rowCount; $i++) {\n $step = 'row-'.$i.'-step';\n $grams = 'row-'.$i.'-grams';\n $reference = 'row-'.$i.'-reference';\n $guiafios = 'row-'.$i.'-guiafios';\n\n $wire = $sampleArticle->sampleArticleWires()->get()->values()->get($i-1);\n $wire->step_id = $request->$step ? $request->$step : '0';\n $wire->warehouse_product_id = $request->$reference;\n $wire->guiafios_id = $request->$guiafios;\n $wire->grams = $request->$grams ? $request->$grams : '0';\n $wire->save();\n\n //Store on SampleArticleColor Class\n //Run for the different number of colors\n for($j = 1; $j < $request->colorsCount; $j++) {\n $colorFromWarehouse = 'row-'.$i.'-color'.$j;\n $wireColor = $wire->wireColors()->get()->values()->get($j-1);\n $wireColor->warehouse_product_spec_id = $request->$colorFromWarehouse ? $request->$colorFromWarehouse : '0';\n $wireColor->save();\n }\n }\n\n\n //Atualizar valores de Armazém, no momento em que uma amostra é editada\n $sampleID = $sampleArticle->id;\n //dd($sampleID);\n //Update all OUT for gross calculations\n $orders = Order::where('sample_article_id', $sampleID)->get();\n //Ao fazer isto, estaria a atualizar sempre que entra na lista de encomendas, e isso iria afetar os resultados\n foreach($orders as $order) {\n if($order->sample_article_id) {\n $grossCalcsResults = new Order();\n $grossCalcsResults = $grossCalcsResults->addRowToStockHistory($order, $order->id);\n }\n }\n\n //Enviar email para criadores de encomendas indicando que uma amostra acabou de ser criada\n /*$users = Role::find(4)->users()->orderBy('name')->get();\n $subject = \"Nova amostra criada.\";\n $body = \"Uma amostra de produto foi terminada e pode ser utilizada nas suas encomendas:\n <br>Referência da Amostra INDMEI: \". $request->reference .\"\n <br>Descrição: \". $request->description .\"\n <br>Imagem: <br><img src='\". url('storage/'.$sampleArticle->image_url) .\"' style='width:300px'>\n <br><br>\n Para aceder à amostra, dirija-se à plataforma, ou clique\n <a href='\".url(\"/orders/list/\").\"' target='_blank'>aqui</a>.\";\n foreach($users as $user) {\n Mail::to($user->email)->send(new sendSimpleEmail($subject, $body));\n } */\n\n session_start();\n $_SESSION[\"update_warehouse\"] = true;\n\n flash('A Amostra de Artigo com a referência: '. $sampleArticle->reference . ', e a descrição: '. $sampleArticle->description .' foi atualizada com sucesso!')->success();\n\n return redirect()->action('SampleArticleController@index');\n }", "public function updateTotal() {\n //get the scans for this user\n $scans = $this->scans();\n //create running total\n $newTotal = 0; \n //for each scan, add the total pups and virus to the total\n foreach ($scans as $scan) {\n $newTotal += $scan->pups + $scan->troj_mal;\n }\n //sets and saves the new total for this user\n $this->total = $newTotal;\n $this->save();\n }", "public function update(Fund $fund, FundRequest $request)\n\t{\n //$fund = Fund::findOrFail($id);\n\n //$request['added_by'] = 1;\n\n //$request['amount'] = round($request['amount'], 2) * 100;\n\n $fund->update($request->all());\n\n $this->syncTags($fund, $request->input('category_list'));\n\n return redirect('funds');\n\n\n\n\n\n\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'storage_code' => ['required', 'max:255', 'unique:silo_actuals,storage_code,' . $id],\n 'date' => ['required'],\n 'value_actual' => ['required'],\n ]);\n\n\n SiloActual::where('id', $id)->update($request->except('_token', '_method'));\n try {\n SiloActualCloud::where('id', $id)->update($request->except('_token', '_method'));\n } catch (\\Throwable $th) {\n return redirect('setting/silo-actual')->with(['update' => 'Data updated successfully! + ' . $th->getMessage()]);\n }\n return redirect('setting/silo-actual')->with(['update' => 'Data updated successfully!']);\n }", "public function testUpdate()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('3', 'x')\n ->type('3', 'y')\n ->type('3', 'z')\n ->type('1', 'value')\n ->press('submit-update')\n ->see('updated successfully');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-update')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'x')\n ->press('submit-update')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('1000000000', 'y')\n ->press('submit-update')\n ->see('greater');\n }", "public function update(StoreUpdateEstudioRequest $request, $id)\n {\n $estudio = Estudio::findOrFail($id);\n\n $estudio->update([\n 'nome' => $request->nome,\n ]);\n\n return \"Estúdio atualizado com sucesso!\";\n }", "public function update(StoreMindoroTransactionDetailRequest $request, MindoroTransactionDetail $mindoroTransactionDetail)\n {\n //\n }", "public function updated(Bank $bank)\n {\n //\n }", "static public function update(Count $obj){\n\t\t$sql = 'CALL count_update(:count_id, :total)';\n\t\t$params = array(':count_id' => $obj->getId(), ':total' => $obj->getTotal());\n\t\tDatabaseHandler::execute($sql, $params);\n\t}", "public function dashboard_summary_metabox() {\r\n\t\t$core = WP_Smush::get_instance()->core();\r\n\r\n\t\t$resize_count = $core->get_savings( 'resize', false, false, true );\r\n\r\n\t\t// Split human size to get format and size.\r\n\t\t$human = explode( ' ', $core->stats['human'] );\r\n\r\n\t\t$resize_savings = 0;\r\n\t\t// Get current resize savings.\r\n\t\tif ( ! empty( $core->stats['resize_savings'] ) && $core->stats['resize_savings'] > 0 ) {\r\n\t\t\t$resize_savings = size_format( $core->stats['resize_savings'], 1 );\r\n\t\t}\r\n\r\n\t\t$this->view(\r\n\t\t\t'summary/meta-box',\r\n\t\t\tarray(\r\n\t\t\t\t'human_format' => empty( $human[1] ) ? 'B' : $human[1],\r\n\t\t\t\t'human_size' => empty( $human[0] ) ? '0' : $human[0],\r\n\t\t\t\t'remaining' => $this->get_total_images_to_smush(),\r\n\t\t\t\t'resize_count' => ! $resize_count ? 0 : $resize_count,\r\n\t\t\t\t'resize_enabled' => (bool) $this->settings->get( 'resize' ),\r\n\t\t\t\t'resize_savings' => $resize_savings,\r\n\t\t\t\t'stats_percent' => $core->stats['percent'] > 0 ? number_format_i18n( $core->stats['percent'], 1 ) : 0,\r\n\t\t\t\t'total_optimized' => $core->stats['total_images'],\r\n\t\t\t)\r\n\t\t);\r\n\t}", "public /* void */ function updateResourceMetadata($uri, /* Metadata */ $metadata) {\n $metadata_json = encode_metadata($uri, $metadata);\n\n $client = new Client();\n $request = $client->put($this->getServiceUrl($uri),array(\n \"User-Agent\" => \"Marmotta Client Library (PHP)\",\n \"Content-Type\" => \"application/json; rel=meta\"\n ), $metadata_json);\n // set authentication if given in configuration\n if(!_isset($this->config->getUsername())) {\n $request->setAuth($this->config->getUsername(),$this->config->getPassword());\n }\n $response = $request->send();\n\n if($response->getStatusCode() >= 400) {\n throw new Exception(\"could not update resource $uri; \".$response->getReasonPhrase());\n }\n }", "public function update(Request $request, Album $album)\n {\n // METODO 1\n // $res = Album::where('id',$album->id)\n // ->update(\n // [\n // 'album_name' => request()->input('albumname'),\n // 'album_description' => request()->input('albumdescription')\n // ]\n // );\n\n // METODO 2\n $album = Album::find($album->id);\n $album->album_name = request()->input('albumname');\n $album->album_description = request()->input('albumdescription');\n\n if($request->hasFile('album_thumb')){\n $file = $request->file('album_thumb');\n $filename = $album->id.'.'.$file->extension();\n $filename = $file->storeAs(env('ALBUM_THUMB_DIR'), $filename);\n $album->album_thumb = $filename;\n }\n $res = $album->save();\n\n\n $mess = $res ? 'Album '.$album->id.' updated' : 'Error updating album';\n\n session()->flash('message',$mess);\n return redirect()->route('albums.index');\n }", "public function testUpdateSuperfund()\n {\n }" ]
[ "0.63005435", "0.60593593", "0.60291433", "0.6005186", "0.5889169", "0.5719127", "0.56831247", "0.5624298", "0.54238397", "0.5396803", "0.523858", "0.52265847", "0.5226203", "0.5152949", "0.51264477", "0.5117411", "0.5073", "0.5053286", "0.5051876", "0.5047366", "0.50387645", "0.5012879", "0.49866003", "0.49840397", "0.4971462", "0.49660367", "0.4962163", "0.4954603", "0.49480218", "0.49095464", "0.4894594", "0.48912418", "0.48912418", "0.48869205", "0.48821986", "0.48760697", "0.48755294", "0.4863557", "0.4860399", "0.4854964", "0.48549148", "0.48533565", "0.48482412", "0.4843005", "0.48416185", "0.483194", "0.48289993", "0.48082492", "0.48078606", "0.4802871", "0.4797309", "0.47914746", "0.47859484", "0.47838515", "0.47822428", "0.4775807", "0.47721225", "0.47585258", "0.47571802", "0.47538036", "0.47504178", "0.47466168", "0.47414646", "0.47373736", "0.47338554", "0.472839", "0.47245955", "0.47235122", "0.47220364", "0.47211418", "0.47197023", "0.471742", "0.47167185", "0.47099337", "0.47097826", "0.47091246", "0.47076616", "0.46968204", "0.46942654", "0.46870095", "0.46846458", "0.46844828", "0.4677504", "0.46755046", "0.46746236", "0.4671686", "0.466406", "0.4657442", "0.46568", "0.46522775", "0.46512005", "0.4651036", "0.4650728", "0.4649992", "0.46489564", "0.46472996", "0.46363822", "0.46359313", "0.46351245", "0.4633593" ]
0.5652784
7
Remove the specified summary from storage.
public function destroy($id) { Summary::destroy($id); return Redirect::route('summaries.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(evaluationSummary $evaluationSummary)\n {\n //\n }", "public function setSummary(string $summary): void;", "public function delMetadata() {}", "public function delMetadata() {}", "public function delMetadata() {}", "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 summary($summary = null)\n {\n if(null === $summary)\n {\n return $this->child('summary');\n }\n return $this->child('summary', trim($summary));\n }", "public function clearStorage(): void\n {\n// foreach ($this->remoteFilesystems as $filesystem) {\n// $contents = $filesystem->listContents('/', true);\n// foreach ($contents as $contentItem) {\n// if ('file' !== $contentItem['type']) {\n// continue;\n// }\n// $filesystem->delete($contentItem['path']);\n// }\n// }\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function drop () {\n\t\tif ($this->oStore->isSetUp()) {\n\t\t\t$this->oStore->drop();\n\t\t}\n\t}", "public function rm($section){\n\t\t$body = $this->toArray();\n\t\tunset($body[$section]);\n\t\t$this->updateFile($body);\n\t}", "protected function deleteStore() {\n $keys = ['community', 'address', 'state', 'city', 'country','attention_to','company','promocode','is_student','payment_type','name_card','card_number'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\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 setSummary($summary)\n {\n $this->summary = $summary;\n }", "public function setSummary(string $summary): void\n {\n $this->summary = $summary;\n }", "public function deleted(Storage $storage)\n {\n //\n }", "public function remove(Article $article);", "protected function deleteStore() {\n $keys = ['entity_type', 'entity_id', 'export_type'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "public function stopMD5Sum($storage_name, $media_name){\n try {\n //$this->clients[$storage_name]->stopMD5Sum($media_name);\n $this->clients[$storage_name]->resource($this->media_type.'_md5_checker')->ids($media_name)->delete();\n }catch (Exception $exception){\n $this->parseException($exception);\n }\n }", "public function unsetFunc($name){\n $statement = $this->db->prepare('DELETE FROM storage WHERE name = :name;');\n $statement->bindValue(':name', $name);\n $statement->execute();\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n }", "function remove($name) {\n if (isset($this->data[$name])) {\n unset($this->data[$name]);\n }\n }", "public function remove() {}", "public function remove() {}", "public function delete() {\n\t\t\t$delete = $this->db->prepare(\"DELETE FROM HISTORIC WHERE nameFile = ? AND idArt = ?\");\n\t\t\treturn $delete->execute(array($this->nameFile, $this->idArt));\n\t\t}", "public function destroy(PersonalDetail $personalDetail)\n {\n //\n }", "public function delete(IModel $target, array $primaries);", "public function remove(StorableLocator $storableLocator): void;", "public function destroy(Studentadd $studentadd)\n {\n //\n }", "public function removeStream($stream);", "public function delete($metricaevotranspiracion);", "protected function deleteStore()\n {\n $keys = ['name', 'email'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function delete_storage_unit($path)\n {\n $storage_unit_name = self::parse_xml_file($path);\n \n $this->add_message(\n self::TYPE_NORMAL, \n Translation::getInstance()->getTranslation('StorageUnitRemoval', null, 'Chamilo\\Core\\Install') . ': <em>' .\n $storage_unit_name . '</em>');\n \n $data_manager = static::context() . '\\DataManager';\n \n if (! $data_manager::drop_storage_unit($storage_unit_name))\n {\n return $this->failed(\n Translation::getInstance()->getTranslation('StorageUnitRemovalFailed', null, 'Chamilo\\Core\\Install') .\n ': <em>' . $storage_unit_name . '</em>');\n }\n else\n {\n return true;\n }\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function removeProfile();", "public static function removeInstanceFromPool($value)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled() && $value !== null) {\n\t\t\tif (is_object($value) && $value instanceof RpMissionSummary) {\n\t\t\t\t$key = (string) $value->getId();\n\t\t\t} elseif (is_scalar($value)) {\n\t\t\t\t// assume we've been passed a primary key\n\t\t\t\t$key = (string) $value;\n\t\t\t} else {\n\t\t\t\t$e = new PropelException(\"Invalid value passed to removeInstanceFromPool(). Expected primary key or RpMissionSummary object; got \" . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));\n\t\t\t\tthrow $e;\n\t\t\t}\n\n\t\t\tunset(self::$instances[$key]);\n\t\t}\n\t}", "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 destroy(Education $education)\n {\n //\n }", "public function testDeleteRemovesStorages()\n {\n file_put_contents(self::$temp.DS.'file1.txt', 'Hello World');\n\n Storage::delete(self::$temp.DS.'file1.txt');\n $this->assertTrue(! is_file(self::$temp.DS.'file1.txt'));\n }", "private function removeTag($tagName)\n\t{\n\t\tif (is_null($tagName) || $tagName == '') return;\n\n $tag = Tag::where('tag', '=', $tagName)->first();\n\n\t\tif (is_object($tag))\n\t\t{\n\t\t\tif ($tag->count > 0) TagUtil::decrementCount($tagName, 1, $tag);\n\n\t\t\t// return collection object\n\t\t\t$tagPivot = $this->tags()->wherePivot('tag_id', '=', $tag->id)->get();\n\t\t\t\n\t if ($tagPivot->count()) $this->tags()->detach($tag->id);\n\t\t}\n\t}", "function removeSensSpec($biomarker_id,$organ_data_id,$study_data_id,$sensitivity_id) {\n\t\t$this->checkSession(\"/biomarkers/organs/{$biomarker_id}/{$organ_data_id}\");\n\t\t$this->StudyData->habtmDelete(\"Sensitivity\",$study_data_id,$sensitivity_id);\n\t\t$this->redirect(\"/biomarkers/organs/{$biomarker_id}/{$organ_data_id}\");\n\t}", "public function destroy(Statut $statut)\n {\n //\n }", "protected static function clear($step)\n {\n $file = static::getCacheStateIndicatorFileName($step);\n\n if ($file) {\n \\Includes\\Utils\\FileManager::deleteFile($file);\n }\n }", "public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}", "public function eliminar(){\n $dimensiones = $this->descripciones()->distinct()->get()->pluck('id')->all();\n $this->descripciones()->detach($dimensiones);\n DescripcionProducto::destroy($dimensiones);\n $this->categorias()->detach();\n $this->imagenes()->delete();\n $this->delete();\n }", "public function remove($label) {\n\t\tif ($this->_has($label)) {\n\t\t\tunset($this->_register[$label]);\n\t\t}\n\t}", "public function setRunSummary(?DeviceHealthScriptRunSummary $value): void {\n $this->getBackingStore()->set('runSummary', $value);\n }", "public function removeFirst();", "public function destroy(Study $study)\n {\n $study->delete();\n // Study::destroy($id);\n return back();\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 unsetMetadata(): void\n {\n $this->metadata = [];\n }", "public function destroy(Sample $sample)\n {\n //\n }", "public function __unset($label) {\n\t\t$this->remove($label);\n\t}", "public function remove($name) {\n unset($_SESSION[$name]);\n }", "public function testDynamicAnalysisSummaryGetsDeleted()\n {\n remove_build($this->ParentId);\n\n // Verify that the dynamicanalysisssummary rows got deleted.\n $result = pdo_query(\"\n SELECT b.id, b.parentid, das.numdefects FROM build AS b\n INNER JOIN dynamicanalysissummary AS das ON (das.buildid=b.id)\n WHERE b.name = 'cross_subproject_DA_example'\");\n $num_builds = pdo_num_rows($result);\n if ($num_builds != 0) {\n $this->fail(\"Expected 0 builds after deletion, found $num_builds\");\n }\n $this->pass('Test passed');\n }", "public function setSummary($summary, array $parameters = null) {\n \n if (!empty($summary)) {\n $this->instance->add($this->calendar->createProperty('SUMMARY', $summary, $parameters));\n }\n }", "public function destroy(schoolDetail $schoolDetail)\n {\n //\n }", "public function remove() {\n }", "function removeStudentFromAlerts($student){\r\n\t\t$user = $_SESSION['userid'];\r\n\t\t$query = \"delete from studentalert where userid='$user' and studentid='$student'\";\r\n\t\tmysql_query($query);\r\n\t}", "public function rmKey($section, $element){\n\t\t$body = $this->toArray();\n\t\tunset($body[$section][$element]);\n\t\t$this->updateFile($body);\n\t}", "function remove($name) {\n\t\t$this->_settings->remove($name);\n\t}", "public function deleteUsage($usage)\n {\n try {\n $this->app['db']->delete(self::$table_name, array('communication_usage_name' => $usage));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public function removeFromCache()\n {\n Cache::tags('file')->forget(strtolower($this->alias));\n }", "function remove($aws_data_object) {\n\t\t}", "public function removeObjectReallyRemovesTheObjectFromStorage() {\n\t\t$originalObject = new \\F3\\FLOW3\\Fixture\\DummyClass();\n\t\t$this->objectRegistry->putObject('DummyObject', $originalObject);\n\t\t$this->objectRegistry->removeObject('DummyObject');\n\t\t$this->assertFalse($this->objectRegistry->objectExists('DummyObject'), 'removeObject() did not really remove the object.');\n\t}", "public function destroy(): Store;", "public function __unset($offset)\n {\n if ($offset == 'title') {\n $offset = 'name';\n }\n\n $this->details()->offsetUnset('details.' . $offset);\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function rm($filename)\n {\n $nodes = $this->idx_tree->nodes();\n unset($nodes[$filename]);\n $this->idx_tree->nodes($nodes);\n }", "public function testRemove()\n {\n $context = $this->createPageContext();\n $storage = $this->createStorage();\n $tokenStorage = $this->createTokenStorage();\n\n $layout1 = $storage->create();\n $layout2 = $storage->create();\n $layout3 = $storage->create();\n\n $context->addLayoutList([$layout1->getId(), $layout2->getId(), $layout3->getId()]);\n $token = $context->createEditToken([$layout1->getId(), $layout3->getId()], ['user_id' => 17]);\n $tokenString = $token->getToken();\n $tokenStorage->saveToken($token);\n\n // Save our editable instances\n $tokenStorage->update($tokenString, $layout1);\n $tokenStorage->update($tokenString, $layout3);\n\n // And now remove one layout\n $tokenStorage->remove($tokenString, $layout2->getId());\n $this->assertTrue($token->contains($layout1->getId()));\n $this->assertFalse($token->contains($layout2->getId()));\n $this->assertTrue($token->contains($layout3->getId()));\n\n try {\n $tokenStorage->load($tokenString, $layout2->getId());\n $this->fail();\n } catch (InvalidTokenError $e) {\n $this->assertTrue(true);\n }\n\n // And the other two still work\n $tokenStorage->load($tokenString, $layout1->getId());\n $tokenStorage->load($tokenString, $layout3->getId());\n }", "public function removeFromIndex()\n\t{\n\t\t$params = $this->getBasicEsParams();\n\t\t// By default all writes to index will be synchronous\n\t\t$params['custom'] = ['refresh' => true];\n\n\t\ttry {\n\t\t\t$result = $this->getElasticSearchClient()->delete($params);\n\t\t}\n\t\tcatch (Missing404Exception $e) {\n\t\t\t// That will mean the document was not found in index\n\t\t}\n\n\t\tDB::table($this->getTable())\n\t\t\t->where($this->getKeyName(), '=', $this->getKeyForSaveQuery())\n\t\t\t->update(['indexed_at' => null]);\n\n\t\treturn isset($result) ? $result : null;\n\t}", "public function destroyDetail(solicitudDetail $detail){\n $previous = URL::previous();\n $last = strrpos($previous,'/');\n $dif = strlen($previous)-$last -1;\n $id_prev = substr($previous,-$dif);\n if($id_prev!=$detail->batch->id){\n return redirect()->back();\n }\n $batch = $detail->batch;\n $detail->delete();\n\n return redirect()->route('solicitude',['ESPERA',$batch->id]);\n }", "public function delete($name)\n {\n unset($this->data[$name]);\n }", "public function deleteProfile($profile);", "public function remove(string $location): void;", "public function removeStructure($url);", "public function removeAction() {\n\t\t$unitModelId = $this->getRequest()->getParam('unitModelId');\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$result = $model->delete( $unitModelId );\t\t\t\t\n\n $this->setFlashMessage('recordDeleted'); \n $this->_helper->redirector('viewallunitmodels', 'unitmodel', 'unit');\t\t\n\t}", "public function deleted(Component $component): void\n {\n $this->componentService->calculateVendorSummaryData($component);\n }", "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}", "private function deleteFileRecord($fileName) {\n /** @var URLRequest $record */\n $record = URLRequest::where('fileName', $fileName)->first();\n shell_exec('cd /Stream && sudo rm ' . $record->fileName);//Remove the file from the /Stream directory.\n $record->delete(); //Delete $record from the database.\n }", "public function remove($scheme);", "public function destroy(StockDetail $stockDetail)\n {\n //\n }", "public function clear() {\r\n\r\n \t\r\n \t\tunset ( $this->__sesionStorage->role );\r\n \t\t\r\n }", "public function unpublish( Location $location );", "protected function removeDayFromStorage(\\DateTime $day)\n {\n unset($this->dateTimeStorage[$day->format('U')]);\n }", "public function DeleteDataGroup($storageLocation, $filter = null)\r\n\t{\r\n\t\t$sql = \"delete from $storageLocation\";\r\n\t\tif ($filter)\r\n\t\t{\r\n\t\t\t$sql .= \" where $filter\";\r\n\t\t}\r\n\t\treturn $this->Execute($sql);\r\n\t}", "public function sDeleteComparison($article)\n {\n $this->productComparisons->sDeleteComparison($article);\n }", "public function uninstall_storage_units()\n {\n $dir = $this->get_path() . 'php/package/install/';\n $files = Filesystem::get_directory_content($dir, Filesystem::LIST_FILES);\n \n foreach ($files as $file)\n {\n if ((substr($file, - 3) == 'xml'))\n {\n if (! $this->delete_storage_unit($file))\n {\n return false;\n }\n }\n }\n \n return true;\n }", "public function deleteData($name) {\n if (isset($this->data[$name])) {\n unset($this->data[$name]);\n }\n }", "public function setSummary(string $summary)\n {\n $this->summary = $summary;\n\n return $this;\n }", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);" ]
[ "0.6238651", "0.54819953", "0.54771644", "0.54771644", "0.54771644", "0.53807324", "0.5191973", "0.5167672", "0.5148113", "0.5148113", "0.5148113", "0.5148113", "0.5142891", "0.51358014", "0.50743943", "0.5059085", "0.5040985", "0.50153977", "0.5014402", "0.4990574", "0.49804568", "0.49627385", "0.4961597", "0.49410054", "0.49372435", "0.49228957", "0.4921319", "0.49093664", "0.49056727", "0.48938626", "0.48890463", "0.48782778", "0.4876809", "0.48758224", "0.4856187", "0.4838316", "0.48304614", "0.4824705", "0.4822553", "0.48224923", "0.48163757", "0.47872978", "0.47794878", "0.47705993", "0.47657037", "0.4757635", "0.47539055", "0.4748216", "0.47478878", "0.4746089", "0.47452927", "0.47307208", "0.4726205", "0.47235075", "0.4722231", "0.47124118", "0.47114655", "0.4703632", "0.47025427", "0.46936446", "0.4687152", "0.4679947", "0.4672994", "0.4667976", "0.46616405", "0.46484", "0.46474606", "0.46462882", "0.46321782", "0.46320623", "0.46307674", "0.46289253", "0.46207258", "0.46180436", "0.4617724", "0.46152413", "0.46137118", "0.46100783", "0.46096787", "0.46096236", "0.4609325", "0.46083036", "0.46081746", "0.46065605", "0.45894653", "0.4584922", "0.45823038", "0.45819956", "0.45805514", "0.4579429", "0.45785993", "0.45778534", "0.45739034", "0.45736665", "0.45706737", "0.45706737", "0.45706737", "0.45706737", "0.45706737", "0.45706737" ]
0.55613863
1
Method for getting the name of the bean Is called for breadcrumb generation
public static function getLabels() { return [ 'singular' => 'Website', 'multiple' => 'Websites' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBeanClassName(): string;", "protected function getName()\r\n {\r\n return app::values()->page();\r\n }", "public function getBeanClassName(): string\n {\n return $this->namingStrategy->getBeanClassName($this->foreignKey->getLocalTableName());\n }", "public function getBaseBeanClassName(): string;", "public function getName()\n {\n return $this->_pageName;\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "function get_name()\n {\n return $this->get_default_property(self :: PROPERTY_NAME);\n }", "public function get_name();", "public function get_name();", "public function get_name();", "public function getBusinessEntityName()\n {\n return $this->getTemplate()->getBusinessEntityName();\n }", "public function getComponentName()\n {\n $component = $this->argument('component') ?: app('components')->getUsedNow();\n\n $component = app('components')->findOrFail($component);\n\n return $component->getStudlyName();\n }", "function get_name()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_NAME);\r\n }", "public function getName()\n\t{\n\t\treturn $this->pageName;\n\t}", "public function get_name()\n {\n }", "public function get_name()\n {\n }", "public function getComponentName(): string;", "function getName() {\n return $this->instance->getName();\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "function get_name () {\n return $this -> name;\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 get_name()\n {\n // TODO: Implement get_name() method.\n }", "public function getName() {\n\t\treturn $this->current_name;\n\t}", "public function display_name() {\r\n\t$class = __CLASS__;\r\n\treturn $class::_object()->display_name;\r\n }", "protected function getComponentName(): string {\n if ($this->isPageTemplate()) {\n return \"{$this->layout}-{$this->post->post_type}\";\n }\n\n if (str_contains($this->componentId, '-')) {\n return implode('', \\__::chain($this->componentId)\n ->split('-')\n ->map(fn ($string) => \\__::capitalize($string))\n ->value());\n }\n\n return \\__::chain($this->componentId)\n ->camelCase()\n ->capitalize()\n ->value();\n }", "public function getComponentName()\n {\n return $this->_componentName;\n }", "function getControllerObjectName() ;", "public function getControllerObjectName() {}", "public function getControllerObjectName() {}", "public function display_name() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn $class::_object()->display_name;\r\n }", "public static function label()\n {\n return Str::singular(class_basename(get_called_class()));\n }", "protected function getName() {}", "public function getName () {\n\treturn $this->get('name');\n }", "private function namebase() {\n return $this->module->name;\n }", "public function getPageName()\n {\n return $this->pageName;\n }", "function name()\n {\n \n return new StringWrapper(get_class($this->object).'#'.$this->id());\n \n }", "public function getName()\n {\n return 'BreadcrumbExtension';\n }", "public function getName()\n\t{\n\t\treturn isset($this->_name) ? $this->_name : spl_object_hash($this);\n\t}", "public function get_object_name() : string ;", "abstract public function get_name();", "abstract public function get_name();", "abstract public function get_name();", "function getNameHelper(){\n\treturn 'Ejercicio de aprendizaje';\n}", "public function getName()\n {\n return $this->getProperty('name');\n }", "public function get_name() {\n if(get_config(constants::M_COMPONENT,'customname')){\n return get_config(constants::M_COMPONENT,'customname');\n }else {\n return get_string('pluginname', constants::M_COMPONENT);\n }\n }", "public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}", "public function getName() {\n\n list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);\n return $name;\n\n }", "function getName(){\n\t\treturn $this->name;\n\t}", "function getName () {\n\t\treturn $this->name;\n\t}", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "function get_display_name() {\n\n $classname = get_class($this);\n $folder_name = 'rlreport_' . substr($classname, 0, strlen($classname) - strlen('_report'));\n\n //use the displayname string from the specific report instance\n return get_string('displayname', $folder_name);\n }", "protected static function _getName()\n {\n return isset(static::$_name) ? static::$_name : get_called_class();\n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getName() {\n return ($this->isInit()) ? $this->name : null;\n }", "function get_name()\n\t{\n\t\treturn $this->name;\n\t}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName() {}", "public function getName() {}", "public function getName() {\n\t}", "function getName()\n {\n return get_class($this);\n }", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "protected function getName()\n {\n return $this->getRequest()->args('name') ?: $this->profile->code . '_' . $this->tpl['name'];\n }", "public function getName()\n {\n return $this->getConfig ( 'name' );\n }", "public function getClassName() ;", "function getName() {\n\t\treturn $this->name;\n\t}", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "function get_name() {\n return $this->name;\n }", "public function getName(): string\n {\n if ($this->_name === null) {\n $endpoint = namespaceSplit(static::class);\n $endpoint = substr(end($endpoint), 0, -8);\n\n $inflectMethod = $this->getInflectionMethod();\n $this->_name = Inflector::{$inflectMethod}($endpoint);\n }\n\n return $this->_name;\n }", "public function getName() {\n\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "function\tgetName() {\n\t\treturn $this->name ;\n\t}", "public function getName(){\n\t\treturn $this->name;\n\t}", "public function getName(){\n\t\treturn $this->name;\n\t}", "public function getName(){\n\t\treturn $this->name;\n\t}", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function getName()\n {\n \treturn $this->name;\n }", "public function getListeName()\n\t{\n\t\treturn substr($this->getLogicalId(), strpos($this->getLogicalId(),\"_\")+2, 1).\" - \".parent::getName();\n\t}", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }" ]
[ "0.6848594", "0.67197895", "0.6530931", "0.64841455", "0.6447056", "0.64437115", "0.6440642", "0.64387894", "0.64387894", "0.64387894", "0.6413379", "0.63964915", "0.6387177", "0.6369975", "0.6347376", "0.6347287", "0.6330126", "0.630594", "0.6288674", "0.6279255", "0.6249693", "0.61960584", "0.61886233", "0.618727", "0.6186299", "0.617089", "0.61511743", "0.61318105", "0.61318105", "0.6131765", "0.61303663", "0.6130007", "0.612333", "0.61058235", "0.61043274", "0.6089464", "0.60818744", "0.608082", "0.60694236", "0.60646975", "0.60646975", "0.60646975", "0.60613984", "0.6053938", "0.6048932", "0.60478354", "0.60423684", "0.6035014", "0.6024639", "0.6022105", "0.6022105", "0.6021499", "0.60145354", "0.6009108", "0.60089827", "0.60043925", "0.6002397", "0.5998039", "0.59923065", "0.59923065", "0.59923065", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.5991666", "0.59915316", "0.59915316", "0.5990146", "0.5990146", "0.5985621", "0.5984721", "0.5981191", "0.5974623", "0.5957049", "0.59554774", "0.5954049", "0.59506375", "0.5950166", "0.5947154", "0.59470314", "0.59422123", "0.5928677", "0.5927223", "0.5927223", "0.5927223", "0.59212625", "0.5921027", "0.5915867", "0.5910133", "0.5910133" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\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 // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\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 isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\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 authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\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 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 = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\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 $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "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 isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "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 /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\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 isAuthorized() {\n\t\t\n\t}", "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 if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "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 if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\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 isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "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 $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\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 // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\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 isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\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 authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\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 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 = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\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 $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "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 isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "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 /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\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 isAuthorized() {\n\t\t\n\t}", "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 if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "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 if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\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 isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "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 $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'x_axis' => [ 'required', 'numeric', ], 'y_axis' => [ 'required', 'numeric', ], 'z_axis' => [ 'required', 'numeric', ], 'camera_x_axis' => [ 'required', 'numeric', ], 'camera_y_axis' => [ 'required', 'numeric', ], 'camera_z_axis' => [ 'required', 'numeric', ], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Rotate the image with Image Magick.
private function rotate_imagick($imagePath, $orientation) { $imagick = new Imagick($imagePath); $imagick->setImageOrientation(imagick::ORIENTATION_TOPLEFT); $deg = 0; switch ($orientation) { case 2: $deg = 180; $imagick->flipImage(); break; case 3: $deg = -180; break; case 4: $deg = -180; $imagick->flopImage(); break; case 5: $deg = -90; $imagick->flopImage(); break; case 6: $deg = 90; break; case 7: $deg = -90; $imagick->flipImage(); break; case 8: $deg = -90; break; } $imagick->rotateImage(new ImagickPixel('#00000000'), $deg); $imagick->writeImage($imagePath); $imagick->clear(); $imagick->destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoRotateImage($image) {\n $orientation = $image->getImageOrientation();\n\n switch($orientation) {\n case imagick::ORIENTATION_BOTTOMRIGHT:\n $image->rotateimage(\"#000\", 180); // rotate 180 degrees\n break;\n\n case imagick::ORIENTATION_RIGHTTOP:\n $image->rotateimage(\"#000\", 90); // rotate 90 degrees CW\n break;\n\n case imagick::ORIENTATION_LEFTBOTTOM:\n $image->rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n break;\n }\n\n // Now that it's auto-rotated, make sure the EXIF data is correct in case the EXIF gets saved with the image!\n $image->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n}", "function image_rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\t\n\t\n\t\t\tif ($this->rotation == '' OR ! in_array($this->rotation, $degs))\n\t\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\t\t\t\n\t\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Reassign the width and height\n\t\t/** -------------------------------------*/\n\t\n\t\tif ($this->rotation == 90 OR $this->rotation == 270)\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_height;\n\t\t\t$this->dst_height\t= $this->src_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_width;\n\t\t\t$this->dst_height\t= $this->src_height;\n\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Choose resizing function\n\t\t/** -------------------------------------*/\n\t\t\n\t\tif ($this->resize_protocol == 'imagemagick' OR $this->resize_protocol == 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\t\t\n \t\tif ($this->rotation == 'hor' OR $this->rotation == 'vrt')\n \t\t{\n\t\t\treturn $this->image_mirror_gd();\n \t\t}\n\t\telse\n\t\t{\t\t\n\t\t\treturn $this->image_rotate_gd();\n\t\t}\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "function acadp_exif_rotate( $file ){\n\n\tif( ! function_exists( 'exif_read_data' ) ) {\n\t\treturn $file;\n\t}\n\n\t$exif = @exif_read_data( $file['tmp_name'] );\n\t$exif_orient = isset( $exif['Orientation'] ) ? $exif['Orientation'] : 0;\n\t$rotate_image = 0;\n\n\tif( 6 == $exif_orient ) {\n\t\t$rotate_image = 90;\n\t} else if ( 3 == $exif_orient ) {\n\t\t$rotate_image = 180;\n\t} else if ( 8 == $exif_orient ) {\n\t\t$rotate_image = 270;\n\t}\n\n\tif( $rotate_image ) {\n\n\t\tif( class_exists( 'Imagick' ) ) {\n\n\t\t\t$imagick = new Imagick();\n\t\t\t$imagick_pixel = new ImagickPixel();\n\t\t\t$imagick->readImage( $file['tmp_name'] );\n\t\t\t$imagick->rotateImage( $imagick_pixel, $rotate_image );\n\t\t\t$imagick->setImageOrientation( 1 );\n\t\t\t$imagick->writeImage( $file['tmp_name'] );\n\t\t\t$imagick->clear();\n\t\t\t$imagick->destroy();\n\n\t\t} else {\n\n\t\t\t$rotate_image = -$rotate_image;\n\n\t\t\tswitch( $file['type'] ) {\n\t\t\t\tcase 'image/jpeg' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromjpeg' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromjpeg( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagejpeg( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png' :\n\t\t\t\t\tif( function_exists( 'imagecreatefrompng' ) ) {\n\t\t\t\t\t\t$source = imagecreatefrompng( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagepng( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromgif' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromgif( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagegif( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn $file;\n\n}", "function rotate($img_name,$rotated_image,$direction){\n\t\t$image = $img_name;\n\t\t$extParts=explode(\".\",$image);\n\t\t$ext=end($extParts);\n\t\t$filename=$rotated_image;\n\t\t//How many degrees you wish to rotate\n\t\t$degrees = 0;\n\t\tif($direction=='R'){\n\t\t\t$degrees = 90;\n\t\t}\n\t\tif($direction=='L'){\n\t\t\t$degrees = -90;\n\t\t}\n\t\t\n\t\tif($ext==\"jpg\" || $ext== \"jpeg\" || $ext==\"JPG\" || $ext== \"JPEG\"){\n\t\t\t$source = imagecreatefromjpeg($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagejpeg($rotate,$filename) ;\n\t\t}\n\t\t\n\t\t\n\t\tif($ext==\"GIF\" || $ext== \"gif\"){\n\t\t\t$source = imagecreatefromgif($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagegif($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\t\n\t\tif($ext==\"png\" || $ext== \"PNG\"){\n\t\t\t$source = imagecreatefrompng($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagepng($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\treturn $rotate;\t\n\t\t\n\t}", "public function test_rotate() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "public function test_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/one-blue-pixel-100x100.png';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 0 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "public function Rotate($angle){\n\t\t\t$rgba = \\backbone\\Color::HexToRGBA(\"#FFFFFF\", 0);\n\t\t\t$color = $this->AllocateColor($rgba[0]['r'], $rgba[0]['g'], $rgba[0]['b'], $rgba[0]['alpha']);\n\n\t\t\t$img = new \\backbone\\Image();\n\t\t\t$img->handle = imagerotate($this->handle, $angle, $color);\n\t\t\treturn $img;\n\t\t}", "function _rotate_image_resource($img, $angle)\n {\n }", "function AutoRotateImage($src_image, $ref = false) \n {\n # from a non-ingested image to properly rotate a preview image\n global $imagemagick_path, $camera_autorotation_ext, $camera_autorotation_gm;\n \n if (!isset($imagemagick_path)) \n {\n return false;\n # for the moment, this only works for imagemagick\n # note that it would be theoretically possible to implement this\n # with a combination of exiftool and GD image rotation functions.\n }\n\n # Locate imagemagick.\n $convert_fullpath = get_utility_path(\"im-convert\");\n if ($convert_fullpath == false) \n {\n return false;\n }\n \n $exploded_src = explode('.', $src_image);\n $ext = $exploded_src[count($exploded_src) - 1];\n $triml = strlen($src_image) - (strlen($ext) + 1);\n $noext = substr($src_image, 0, $triml);\n \n if (count($camera_autorotation_ext) > 0 && (!in_array(strtolower($ext), $camera_autorotation_ext))) \n {\n # if the autorotation extensions are set, make sure it is allowed for this extension\n return false;\n }\n\n $exiftool_fullpath = get_utility_path(\"exiftool\");\n $new_image = $noext . '-autorotated.' . $ext;\n \n if ($camera_autorotation_gm) \n {\n $orientation = get_image_orientation($src_image);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -rotate +' . $orientation . ' ' . escapeshellarg($new_image);\n run_command($command);\n }\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n } \n else\n {\n if ($ref != false) \n {\n # use the original file to get the orientation info\n $extension = sql_value(\"select file_extension value from resource where ref=$ref\", '');\n $file = get_resource_path($ref, true, \"\", false, $extension, -1, 1, false, \"\", -1);\n # get the orientation\n $orientation = get_image_orientation($file);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' -rotate +' . $orientation . ' ' . escapeshellarg($src_image) . ' ' . escapeshellarg($new_image);\n run_command($command);\n # change the orientation metadata\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n }\n } \n else\n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -auto-orient ' . escapeshellarg($new_image);\n run_command($command);\n }\n }\n\n if (!file_exists($new_image)) \n {\n return false;\n }\n\n if (!$ref) \n {\n # preserve custom metadata fields with exiftool \n # save the new orientation\n # $new_orientation=run_command($exiftool_fullpath.' -s -s -s -orientation -n '.$new_image);\n $old_orientation = run_command($exiftool_fullpath . ' -s -s -s -orientation -n ' . escapeshellarg($src_image));\n \n $exiftool_copy_command = $exiftool_fullpath . \" -TagsFromFile \" . escapeshellarg($src_image) . \" -all:all \" . escapeshellarg($new_image);\n run_command($exiftool_copy_command);\n \n # If orientation was empty there's no telling if rotation happened, so don't assume.\n # Also, don't go through this step if the old orientation was set to normal\n if ($old_orientation != '' && $old_orientation != 1) \n {\n $fix_orientation = $exiftool_fullpath . ' Orientation=1 -n ' . escapeshellarg($new_image);\n run_command($fix_orientation);\n }\n }\n \n unlink($src_image);\n rename($new_image, $src_image);\n return true; \n }", "public static function rotate($baseURL, $name, $image)\r\n {\r\n $exif = exif_read_data($image);\r\n\r\n if (array_key_exists('Orientation', $exif))\r\n {\r\n $jpg = imagecreatefromjpeg($image);\r\n $orientation = $exif['Orientation'];\r\n switch ($orientation)\r\n {\r\n case 3:\r\n $jpg = imagerotate($jpg, 180, 0);\r\n break;\r\n case 6:\r\n $jpg = imagerotate($jpg, -90, 0);\r\n break;\r\n case 8:\r\n $jpg = imagerotate($jpg, 90, 0);\r\n break;\r\n default: \t\r\n }\r\n imagejpeg($jpg, $baseURL.'computed/'.$name, 90);\r\n }\r\n\t\t else\r\n\t\t {\r\n\t\t\t copy($image, $baseURL.'computed/'.$name);\r\n\t\t }\r\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n\t{\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h);\n\t $this->Rotate(0);\n\t}", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n {\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n }", "private function rotate_gd($image, $orientation)\n {\n switch ($orientation) {\n case 2:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 3:\n $image = imagerotate($image, 180, 0);\n break;\n\n case 4:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 5:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 6:\n $image = imagerotate($image, -90, 0);\n break;\n\n case 7:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 8:\n $image = imagerotate($image, 90, 0);\n break;\n }\n\n return $image;\n }", "function rotateImage0($img, $imgPath, $suffix, $degrees, $quality, $save)\n{\n // Open the original image.\n $original = imagecreatefromjpeg(\"$imgPath/$img\") or die(\"Error Opening original\");\n list($width, $height, $type, $attr) = getimagesize(\"$imgPath/$img\");\n \n // Resample the image.\n $tempImg = imagecreatetruecolor($width, $height) or die(\"Cant create temp image\");\n imagecopyresized($tempImg, $original, 0, 0, 0, 0, $width, $height, $width, $height) or die(\"Cant resize copy\");\n \n // Rotate the image.\n $rotate = imagerotate($original, $degrees, 0);\n \n // Save.\n if($save)\n {\n // Create the new file name.\n $newNameE = explode(\".\", $img);\n $newName = ''. $newNameE[0] .''. $suffix .'.'. $newNameE[1] .'';\n \n // Save the image.\n imagejpeg($rotate, \"$imgPath/$newName\", $quality) or die(\"Cant save image\");\n }\n \n // Clean up.\n imagedestroy($original);\n imagedestroy($tempImg);\n return true;\n}", "function rotateImage($param=array())\r\n {\r\n $img = isset($param['src']) ? $param['src'] : false;\r\n $newname= isset($param['newname']) ? $param['newname'] : $img;\r\n $degrees= isset($param['deg']) ? $param['deg'] : false;\r\n $out = false;\r\n \r\n if($img)\r\n {\r\n \r\n switch(exif_imagetype($img)){\r\n \tcase 1:\r\n \t\t//gif\r\n \t\t$destimg = imagecreatefromgif($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagegif($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 2:\r\n \t\t//jpg\r\n \t\t$destimg = imagecreatefromjpeg($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagejpeg($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 3:\r\n \t\t//png\r\n \t\t$destimg = imagecreatefrompng($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagepng($rotatedImage, $newname);\r\n \tbreak;\r\n }\r\n \r\n $out = $img;\r\n }\r\n \r\n return $out;\r\n }", "function RotatedImage($file,$x,$y,$w,$h,$bln_rotate)\n\t{\n\t $img_size= getimagesize($file);\n\t \n\t $aspect_y=$h/$img_size[1];\n\t $aspect_x=$w/$img_size[0];\n\t \n\t if ($bln_rotate==1){\n\t\t //Check to see if the image fits better at 90 degrees\n\t\t $aspect_y2=$w/$img_size[1];\n\t\t $aspect_x2=$h/$img_size[0];\n\t\t \n\t\t if($aspect_x<$aspect_y)\n\t\t {\n\t\t \t$aspect1=$aspect_x;\n\t\t }\n\t\t else {\n\t\t \t$aspect1=$aspect_y;\n\t\t }\n\t\t \n\t\t if($aspect_x2<$aspect_y2)\n\t\t {\n\t\t \t$aspect2=$aspect_x2;\n\t\t }\n\t\t else {\n\t\t \t$aspect2=$aspect_y2;\n\t\t }\n\t\t \n\t\t if ($aspect1<$aspect2)\n\t\t {\n\t\t \t$angle=90;\n\t\t \t$y=$y+$h;\n\t\t \t$t=$h;\n\t\t \t$h=$w;\n\t\t \t$w=$t;\n\t\t \t$aspect_y=$aspect_y2;\n\t\t \t$aspect_x=$aspect_x2;\n\t\t }\n\t }\n\t \n\t \n\t \n\t \n\t \tif ($aspect_x>$aspect_y){\n\t \t\t$flt_adjust=$aspect_y;\n\t \t\t$w=$flt_adjust*$img_size[0];\n\t \t\t\n\t \t}\n\t \telse{\n\t \t\t$flt_adjust=$aspect_x;\n\t \t\t$h=$flt_adjust*$img_size[1];\n\t \t}\n\t \n\t \t\n\t \t\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h,'JPG');\n\t $this->Rotate(0);\n\t}", "public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}", "public function image_rotate_gd()\n\t{\n\t\t// Create the image handle\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Set the background color\n\t\t// This won't work with transparent PNG files so we are\n\t\t// going to have to figure out how to determine the color\n\t\t// of the alpha channel in a future release.\n\n\t\t$white = imagecolorallocate($src_img, 255, 255, 255);\n\n\t\t// Rotate it!\n\t\t$dst_img = imagerotate($src_img, $this->rotation_angle, $white);\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($dst_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($dst_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($dst_img);\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n\t\t$this->Rotate($angle, $x, $y);\n\t\t$this->Image($file, $x, $y, $w, $h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n $this->Rotate($angle, $x, $y);\n $this->Image($file, $x, $y, $w, $h);\n $this->Rotate(0);\n }", "public function rotateBy($rotation) {}", "protected function _rotateImage(&$photo, $path)\n {\n \t$exif = @exif_read_data($path);\n \t\n \tif (!empty($exif['Orientation']))\n \t\tswitch ($exif['Orientation'])\n \t\t{\n \t\t\tcase 8:\n \t\t\t\t$photo->rotateImageNDegrees(90)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\t$photo->rotateImageNDegrees(180)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 6:\n \t\t\t\t$photo->rotateImageNDegrees(-90)->save($path);\n \t\t\t\tbreak;\n \t}\n }", "function rotateImage($width, $height, $rotation, $quality = 8) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1]);\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2]);\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "public function actionRotate($imageid,$direction)\n\t{\n\t\t\n\t\t// the image object is created from the database to avoid user input\n\t\t$image = Image::model()->findByPk($imageid);\n\t\t// where to return after the operation\n\t\t$rotatedurl = Yii::app()->user->returnUrl;\n\t\t\n\t\t// temporary filename for the created rotated image\n\t\t$tempfilename = Image::FULLIMAGETEMPPATH . uniqid() . '.jpg';\n\t\t// the image variable $rotated is created based on the original JPG in the file system\n\t\t\n\t\t// if the file does not exist, the user is redirected away\n\t\tif (!file_exists($image->getImageFile('full',false,Image::FULLIMAGEPATH)))\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_file_not_found';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\t\t\t\t\n\t\t// the original full image is evaluated to determine if it's a JPG\n\t\t// should the file not be jpg, execution is terminated and user is presented\n\t\t// with an error\n\t\t$originalFullImage = $image->getImageFile('full',false,Image::FULLIMAGEPATH);\n\t\t// getimagesize returns information of image size, but also of type among other things\n\t\t$information = getimagesize($originalFullImage);\n\t\tif ($information['mime'] != 'image/jpeg')\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_not_jpg';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\n\t\t// an uncompressed image is created from the original full size image\n\t\t$rotate = imagecreatefromjpeg($originalFullImage);\n\t\t// the original full image is unset to save memory\n\t\tunset($originalFullImage);\n\t\t\n\t\t// defining the direction of the rotation\n\t\tswitch($direction) \n\t\t{\n\t\t\tcase 'clockwise':\n\t\t\t\t$angle = -90; \t\n\t\t\t\tbreak;\n\t\t\tcase 'counterclockwise':\n\t\t\t\t$angle = 90; \t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// creates the rotated image\n\t\t$rotated = imagerotate($rotate,$angle,0);\n\t\tunset($rotate);\n\t\t// saves the rotated image as a jpeg to the temporary file directory\n\t\timagejpeg($rotated,$tempfilename,100);\n\t\tunset($rotated);\n\t\t\n\t\t// the existance of the rotated image is evaluated before anything is deleted\n\t\tif(file_exists($tempfilename))\n\t\t{\n\t\t\t// deletes all the physical image files for the image object\n\t\t\t$image->deleteImage(array('small', 'light', 'medium', 'large','full'));\n\t\t\t\n\t\t\t// moving the generated image to it's desired location\n\t\t\trename($tempfilename,$image->getImageFile('full',false,Image::FULLIMAGEPATH));\n\t\t\t\n\t\t\t// generating thumbnails for the rotated image\n\t\t\t$image->generateThumbnails();\n\t\t}\n\n\t\t$rotatedurl['rotated']='true';\n\t\t$this->redirect($rotatedurl);\n\t\t\t\t\n\t}", "function rotateImage($width, $height, $rotation, $quality = 8){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = max(min($quality, 10), 0) * 10;\n\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "public function autoRotate() {\n $this->thumb->rotateJpg();\n return $this;\n }", "private function _imgRotate(){\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $webPath = WEBROOT.'/site/files/_tmp/'.basename($url);\r\n $degrees = $_POST['direction']=='CCW'?90:-90;\r\n $info = getimagesize($sourcePath);\r\n\r\n switch($info['mime']){\r\n case 'image/png':\r\n $img = imagecreatefrompng($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagesavealpha($rotate, true);\r\n imagepng($rotate, $sourcePath);\r\n break;\r\n case 'image/jpeg':\r\n $img = imagecreatefromjpeg($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagejpeg($rotate, $sourcePath);\r\n break;\r\n case 'image/gif':\r\n $img = imagecreatefromgif($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagegif($rotate, $sourcePath);\r\n break;\r\n default:\r\n $result->error = \"Only PNG, JPEG or GIF images are allowed!\";\r\n $response = 400;\r\n exit;\r\n }\r\n\r\n if(isset($img))imagedestroy($img);\r\n if(isset($rotate))imagedestroy($rotate);\r\n\r\n $info = getimagesize($sourcePath);\r\n $result->url = $webPath;\r\n $result->size = [$info[0],$info[1]];\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public function rotate()\n {\n // not possible in php?\n }", "protected function adjustImageOrientation()\n { \n $exif = @exif_read_data($this->file);\n \n if($exif && isset($exif['Orientation'])) {\n $orientation = $exif['Orientation'];\n \n if($orientation != 1){\n $img = imagecreatefromjpeg($this->file);\n \n $mirror = false;\n $deg = 0;\n \n switch ($orientation) {\n \n case 2:\n $mirror = true;\n break;\n \n case 3:\n $deg = 180;\n break;\n \n case 4:\n $deg = 180;\n $mirror = true; \n break;\n \n case 5:\n $deg = 270;\n $mirror = true; \n break;\n \n case 6:\n $deg = 270;\n break;\n \n case 7:\n $deg = 90;\n $mirror = true; \n break;\n \n case 8:\n $deg = 90;\n break;\n }\n \n if($deg) $img = imagerotate($img, $deg, 0); \n if($mirror) $img = $this->mirrorImage($img);\n \n $this->image = str_replace('.jpg', \"-O$orientation.jpg\", $this->file); \n imagejpeg($img, $this->file, $this->quality);\n }\n }\n }", "function __rotate(&$tmp, $angle, &$color) {\n\n\t\t// skip full loops\n\t\t//\n\t\tif (($angle % 360) == 0) {\n\t\t\treturn true;\n\t\t\t}\n\n\t\t// rectangular rotates are OK\n\t\t//\n\t\tif (($angle % 90) == 0) {\n\n\t\t\t// call `convert -rotate`\n\t\t\t//\n\t\t\t$cmd = $this->__command(\n\t\t\t\t'convert',\n\t\t\t\t\" -rotate {$angle} \"\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t\t\t. \" TIF:\"\n\t \t\t\t// ^ \n\t \t\t\t// GIF saving hack\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t);\n\t exec($cmd, $result, $errors);\n\t\t\tif ($errors) {\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t$w1 = $tmp->image_width;\n\t\t\t$h1 = $tmp->image_height;\n\t\t\t$tmp->image_width = ($angle % 180) ? $h1 : $w1;\n\t\t\t$tmp->image_height = ($angle % 180) ? $w1 : $h1;\n\t\t\treturn true;\n\t\t\t}\n\n\t\treturn false;\n\t\t}", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not rotate image.');\n }\n\n // The rotation routine...\n $dst_img = imagerotate($src_img, $degrees, 0);\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "function _rotateImageGD1($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($file);\r\n } else {\r\n $src_img = imagecreatefrompng($file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function _rotateImageGD2($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($file);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n } else {\r\n \t$src_img = @imagecreatefromgif($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $desfile);\r\n } else {\r\n \timagegif($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "public function test_remove_orientation_data_on_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/test-image-upside-down.jpg';\n\t\t$data = wp_read_image_metadata( $file );\n\n\t\t// The orientation value 3 is equivalent to rotated upside down (180 degrees).\n\t\t$this->assertSame( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );\n\n\t\t$temp_file = wp_tempnam( $file );\n\t\t$image = wp_get_image_editor( $file );\n\n\t\t// Test a value that would not lead back to 1, as WP is resetting the value to 1 manually.\n\t\t$image->rotate( 90 );\n\t\t$ret = $image->save( $temp_file, 'image/jpeg' );\n\n\t\t$data = wp_read_image_metadata( $ret['path'] );\n\n\t\t// Make sure the image is no longer in The Upside Down Exif orientation.\n\t\t$this->assertSame( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );\n\n\t\t// Remove both the generated file ending in .tmp and tmp.jpg due to wp_tempnam().\n\t\tunlink( $temp_file );\n\t\tunlink( $ret['path'] );\n\t}", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n $fileOut = $src_file . \".1\";\n @copy($src_file, $fileOut);\n \n $path = zmgNetpbmTool::getPath();\n if ($img_meta['extension'] == \"png\") {\n $cmd = $path . \"pngtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"pnmtopng > \" . $fileOut;\n } else if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $cmd = $path . \"jpegtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmtojpeg -quality=\" . $img_meta['jpeg_qty']\n . \" > \" . $fileOut;\n } else if ($img_meta['extension'] == \"gif\") {\n $cmd = $path . \"giftopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmquant 256 | \" . $path . \"ppmtogif > \"\n . $fileOut;\n } else {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Source file is not an image or image type is not supported.');\n }\n\n $output = $retval = null;\n exec($cmd, $output, $retval);\n if ($retval) {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Could not rotate image: ' . $output);\n }\n $erg = @rename($fileOut, $dest_file);\n\n return true;\n }", "public function getRotation() {}", "public function getRotation() {}", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "public function rotate($angle)\n {\n $this->setForceAlpha(true);\n $this\n ->addConvertOption('background', 'none')\n ->addConvertOption('alpha', 'set')\n ->addConvertOption('rotate', $angle);\n\n //an image size has changed after the rotate action, it's required to save it and reinit resource\n $this->saveIfRequired('after_rotate');\n $this->resource = null;\n $this->initResource();\n\n return $this;\n }", "public function applyFilter(Image $image)\n {\n // transparent background if possible\n\n $mirror = strpos($this->rotation, '!') === false ? false : true;\n $rotation = $mirror ? substr($this->rotation, 1) : $this->rotation;\n if ($mirror) {\n $image->flip('h');\n }\n\n return $image->rotate(-$rotation);\n }", "public function rotate(int $degrees): Image\n\t{\n\t\t$this->processor->rotate($degrees);\n\n\t\treturn $this;\n\t}", "function _rotateImageNETPBM($file, $desfile, $degrees, $imgobj) {\r\n $fileOut = \"$file.1\";\r\n $zoom->platform->copy($file, $fileOut); \r\n if (eregi(\"\\.png\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"pngtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"pnmtopng > $fileOut\" ; \r\n } elseif (eregi(\"\\.(jpg|jpeg)\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"jpegtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmtojpeg -quality=\" . $this->_JPEG_quality . \" > $fileOut\" ;\r\n } elseif (eregi(\"\\.gif\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"giftopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmquant 256 | \" . $this->_NETPBM_path . \"ppmtogif > $fileOut\" ; \r\n } else {\r\n return false;\r\n }\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if ($retval) {\r\n return false;\r\n } else {\r\n $erg = $zoom->platform->rename($fileOut, $desfile); \r\n return true;\r\n }\r\n }", "public function rotatePageImage($pageId, $rotate)\n {\n # PUT /accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/pages/{pageId}/page_image\n }", "public function ieditor_rotate ($sImagePath) {\n\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - START\n\t\t\t */\n\t\t\ttry {\n\t\t\t\t$oImagemagic = $this->getImageMagic();\n\t\t\t\tif (!$oImagemagic->rotate($sImagePath)) {\n\t\t\t\t\tthrow new Exception('Failed to rotate image by ImageMagic');\n\t\t\t\t}\n\t\t\t\t$this->deleteOriginalImages($sImagePath);\n\t\t\t\treturn str_replace(CURRENT_WORKING_DIR, '', $sImagePath);\n\t\t\t} catch (Exception $e) {}\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - END\n\t\t\t */\n\n\t\t\t$oImage = new umiImageFile($sImagePath);\n\t\t\ttry {\n\t\t\t\t$oImage->rotate();\n\t\t\t\t$this->deleteOriginalImages($sImagePath);\n\t\t\t} catch (coreException $e) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\treturn $oImage->getFilePath(true);\n\t\t}", "public function rotate($sourceImg, $angleDegrees) {\n\n $angle = (int)$angleDegrees;\n if(! $angle || ! abs($angle) % 360) {\n return $sourceImg;\n }\n $width = imagesx($sourceImg);\n $height = imagesy($sourceImg);\n \n /**\n * First create a new image that is large enough to hold the original image at any rotation angle.\n */\n $max = hypot($width, $height);\n $img = $this->_createImage($max, $max);\n if(false === $img) {\n return false;\n }\n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img);\n \n /**\n * Copy the original image centered on the new image.\n */\n if(false === $this->_copyCentered($img, $sourceImg)) {\n return false;\n }\n \n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img, $debugIndex);\n \n /**\n * Rotate the new image.\n * \n * NOTICE: negative angles to apply clock-wise rotation.\n */\n $rotatedImg = imagerotate($img, $angle, imagecolorallocatealpha($sourceImg, 0, 0, 0, 127));\n if(false === $rotatedImg) {\n return false;\n }\n \n /**\n * DEBUG\n * $debugIndex = $this->_debugWriteToFile($rotatedImg, $debugIndex);\n */\n \n /**\n * Create an image having having dimensions to fully contain the rotated image at the specified angle.\n */\n $rad = deg2rad($angle);\n $x = $height * abs(sin($rad)) + $width * abs(cos($rad));\n $y = $height * abs(cos($rad)) + $width * abs(sin($rad));\n $finalImg = $this->_createImage($x, $y);\n if(false === $finalImg) {\n return false;\n }\n $res = imagecopy(\n $finalImg, \n $rotatedImg, \n 0, \n 0, \n (imagesx($rotatedImg) - $x) / 2,\n (imagesy($rotatedImg) - $y) / 2,\n $x,\n $y);\n if(false === $res) {\n return false;\n }\n /**\n * DEBUG\n * $this->_debugWriteToFile($finalImg, $debugIndex);\n */\n return $finalImg;\n }", "public function rotate($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$angle = (float) $angle;\n\t\t$bg_color = $this->normalizeColor($bg_color);\n\n\t\tif($bg_color === false) {\n\t\t\ttrigger_error('Rotate failed because background color could not be generated. Try sending an array(RRR, GGG, BBB).', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$working_image = imagerotate($this->image, $angle, imagecolorallocate($this->image, $bg_color[0], $bg_color[1], $bg_color[2]));\n\n\t\tif($working_image) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = imagesx($this->image);\n\t\t\t$this->height = imagesy($this->image);\n\t\t\t$this->aspect = $this->width/$this->height;\n\t\t\tif($this->aspect > 1) {\n\t\t\t\t$this->orientation = 'landscape';\n\t\t\t} else if($this->aspect < 1) {\n\t\t\t\t$this->orientation = 'portrait';\n\t\t\t} else {\n\t\t\t\t$this->orientation = 'square';\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Rotate failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "private function rotate_jpg_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromjpeg($path), $orientation);\n imagejpeg($image, $path, 100);\n imagedestroy($image);\n }", "public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function fixImageOrientation($filename) \n{\n\t$exif = @exif_read_data($filename);\n\t \n\tif($exif) \n\t{ \n\t\t//fix the Orientation if EXIF data exists\n\t\tif(!empty($exif['Orientation'])) \n\t\t{\n\t\t\tswitch($exif['Orientation']) \n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t$createdImage = imagerotate($filename,180,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t$createdImage = imagerotate($filename,-90,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t$createdImage = imagerotate($filename,90,0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} \n}", "function image_fix_orientation($path){\n\t\t$exif = exif_read_data($path);\n\n\t\t//fix the Orientation if EXIF data exist\n\t\tif(!empty($exif['Orientation'])) {\n\t\t switch($exif['Orientation']) {\n\t\t case 8:\n\t\t $createdImage = imagerotate($image,90,0);\n\t\t break;\n\t\t case 3:\n\t\t $createdImage = imagerotate($image,180,0);\n\t\t break;\n\t\t case 6:\n\t\t $createdImage = imagerotate($image,-90,0);\n\t\t break;\n\t\t }\n\t\t}\n\t}", "public function rotation($value) {\n return $this->setProperty('rotation', $value);\n }", "function rotateImage($file, $desfile, $degrees, $imgobj) {\r\n $degrees = intval($degrees);\r\n switch ($this->_conversiontype){\r\n //Imagemagick\r\n case 1:\r\n if($this->_rotateImageIM($file, $desfile, $degrees))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //NetPBM\r\n case 2:\r\n if($this->_rotateImageNETPBM($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD1\r\n case 3:\r\n if($this->_rotateImageGD1($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD2\r\n case 4:\r\n if($this->_rotateImageGD2($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n }\r\n return true;\r\n }", "private function imagerotate($srcImg, $angle, $bgColor, $ignoreTransparent=0) {\n\t\tfunction rotateX($x, $y, $theta) {\n\t\t\treturn $x * cos($theta) - $y * sin($theta);\n\t\t}\n\t\tfunction rotateY($x, $y, $theta) {\n\t\t\treturn $x * sin($theta) + $y * cos($theta);\n\t\t}\n\n\t\t$srcW = imagesx($srcImg);\n\t\t$srcH = imagesy($srcImg);\n\n\t\t// Normalize angle\n\t\t$angle %= 360;\n\n\t\tif ($angle == 0) {\n\t\t\tif ($ignoreTransparent == 0) {\n\t\t\t\timagesavealpha($srcImg, true);\n\t\t\t}\n\t\t\treturn $srcImg;\n\t\t}\n\n\t\t// Convert the angle to radians\n\t\t$theta = deg2rad($angle);\n\n\t\t$minX = $maxX = $minY = $maxY = 0;\n\t\t\n\t\t// Standard case of rotate\n\t\tif ((abs($angle) == 90) || (abs($angle) == 270)) {\n\t\t\t$width = $srcH;\n\t\t\t$height = $srcW;\n\t\t\tif (($angle == 90) || ($angle == -270)) {\n\t\t\t\t$minX = 0;\n\t\t\t\t$maxX = $width;\n\t\t\t\t$minY = -$height+1;\n\t\t\t\t$maxY = 1;\n\t\t\t} else if (($angle == -90) || ($angle == 270)) {\n\t\t\t\t$minX = -$width+1;\n\t\t\t\t$maxX = 1;\n\t\t\t\t$minY = 0;\n\t\t\t\t$maxY = $height;\n\t\t\t}\n\t\t} else if (abs($angle) === 180) {\n\t\t\t$width = $srcW;\n\t\t\t$height = $srcH;\n\t\t\t$minX = -$width+1;\n\t\t\t$maxX = 1;\n\t\t\t$minY = -$height+1;\n\t\t\t$maxY = 1;\n\t\t} else {\n\t\t\t// Calculate the width of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateX(0, 0, 0-$theta),\n\t\t\t\trotateX($srcW, 0, 0-$theta),\n\t\t\t\trotateX(0, $srcH, 0-$theta),\n\t\t\t\trotateX($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minX = floor(min($temp));\n\t\t\t$maxX = ceil(max($temp));\n\t\t\t$width = $maxX - $minX;\n\n\t\t\t// Calculate the height of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateY(0, 0, 0-$theta),\n\t\t\t\trotateY($srcW, 0, 0-$theta),\n\t\t\t\trotateY(0, $srcH, 0-$theta),\n\t\t\t\trotateY($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minY = floor(min($temp));\n\t\t\t$maxY = ceil(max($temp));\n\t\t\t$height = $maxY - $minY;\n\t\t}\n\n\t\t$destImg = imagecreatetruecolor($width, $height);\n\t\tif ($ignoreTransparent == 0) {\n\t\t\timagefill($destImg, 0, 0, imagecolorallocatealpha($destImg, 255,255, 255, 127));\n\t\t\timagesavealpha($destImg, true);\n\t\t}\n\n\t\t// Sets all pixels in the new image\n\t\tfor ($x = $minX; $x < $maxX; $x++) {\n\t\t\tfor ($y = $minY; $y < $maxY; $y++) {\n\t\t\t\t// Fetch corresponding pixel from the source image\n\t\t\t\t$srcX = round(rotateX($x, $y, $theta));\n\t\t\t\t$srcY = round(rotateY($x, $y, $theta));\n\t\t\t\tif ($srcX >= 0 && $srcX < $srcW && $srcY >= 0 && $srcY < $srcH) {\n\t\t\t\t\t$color = imagecolorat($srcImg, $srcX, $srcY);\n\t\t\t\t} else {\n\t\t\t\t\t$color = $bgColor;\n\t\t\t\t}\n\t\t\t\timagesetpixel($destImg, $x-$minX, $y-$minY, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $destImg;\n\t}", "abstract public function rotate($amount);", "protected function _rotate($img, $rotateDegrees, $dstWidth = null, $dstHeight = null) {\n $degrees = is_numeric($rotateDegrees) ? intval($rotateDegrees) : null;\n if(! is_int($degrees)) {\n $var = Types::getVartype($rotateDegrees);\n throw new Exception\\InvalidArgumentException(\"Invalid overlay rotate degrees value '{$var}'\", MediaConst::E_TYPE_MISMATCH);\n }\n if(abs($degrees) > 360) {\n // $var = Types::getVartype($rotateDegrees);\n // throw new Exception\\InvalidArgumentException(\"Invalid overlay value '{$var}'\", MediaConst::E_INVALID_ROTATE_PARAM);\n }\n $obj = new Rotate();\n $finalImg = $obj->rotate($img, $degrees, $dstWidth, $dstHeight);\n if(false === $finalImg) {\n // T_PHP_FUNCTION_FAILED = image function '%s' failed\n $msg = $phpErrorHandler->getErrorMsg(sprintf(MediaConst::T_PHP_FUNCTION_FAILED, \"imagecopy\"), \"cannot copy overlay image\");\n imagedestroy($img);\n // a PHP image function has failed\n throw new Exception\\RuntimeException($msg, MediaConst::E_PHP_FUNCTION_FAILED);\n }\n return $finalImg;\n }", "public function createRotateFlippedImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "function frameImage($inside = 0, $imagesPath = array(), $imgHeight = 600, $imagesWidth = array(), $imagesAngles = array(), $poleColor = null, $poleWidth = 1, $poleHeight = 1)\n{ \n $rowImagick = new Imagick();\n \n foreach($imagesPath as $imgIndex => $imgPath) {\n $imagick = new Imagick(realpath($imgPath));\n\n $imagick->getImageGeometry();\n $imgGeo = $imagick->getImageGeometry();\n $imgOrgWidth = $imgGeo['width'];\n $imgOrgHeight = $imgGeo['height'];\n $imgWidth = $imagesWidth[$imgIndex];\n\n if(isset($imagesAngles[$imgIndex])) {\n $angleX = ($imagesAngles[$imgIndex]) == 90 ? - ($imagesAngles[$imgIndex] - 10) : - $imagesAngles[$imgIndex];\n } else {\n $angleX = -100;\n }\n $angleY = 0;\n $thetX = deg2rad ($angleX);\n $thetY = deg2rad ($angleY);\n\n $s_x1y1 = array(0, 0); // LEFT BOTTOM\n $s_x2y1 = array($imgWidth, 0); // RIGHT BOTTOM\n $s_x1y2 = array(0, $imgHeight); // LEFT TOP\n $s_x2y2 = array($imgWidth, $imgHeight); // RIGHT TOP\n\n $d_x1y1 = array(\n $s_x1y1[0] * cos($thetX) - $s_x1y1[1] * sin($thetY),\n $s_x1y1[0] * sin($thetX) + $s_x1y1[1] * cos($thetY)\n );\n $d_x2y1 = array(\n $s_x2y1[0] * cos($thetX) - $s_x2y1[1] * sin($thetY),\n $s_x2y1[0] * sin($thetX) + $s_x2y1[1] * cos($thetY)\n );\n $d_x1y2 = array(\n $s_x1y2[0] * cos($thetX) - $s_x1y2[1] * sin($thetY),\n $s_x1y2[0] * sin($thetX) + $s_x1y2[1] * cos($thetY)\n );\n $d_x2y2 = array(\n $s_x2y2[0] * cos($thetX) - $s_x2y2[1] * sin($thetY),\n $s_x2y2[0] * sin($thetX) + $s_x2y2[1] * cos($thetY)\n );\n\n $imageprops = $imagick->getImageGeometry();\n $imagick->setImageBackgroundColor(new ImagickPixel('transparent'));\n $imagick->resizeimage($imgWidth, $imgHeight, \\Imagick::FILTER_LANCZOS, 0, true); \n if($poleColor) {\n $imagick->borderImage($poleColor, $poleWidth, $poleHeight);\n }\n\n $points = array(\n $s_x1y2[0], $s_x1y2[1], # Source Top Left\n $d_x1y2[0], $d_x1y2[1], # Destination Top Left\n $s_x1y1[0], $s_x1y1[1], # Source Bottom Left \n $d_x1y1[0], $d_x1y1[1], # Destination Bottom Left \n $s_x2y1[0], $s_x2y1[1], # Source Bottom Right \n $d_x2y1[0], $d_x2y1[1], # Destination Bottom Right \n $s_x2y2[0], $s_x2y2[1], # Source Top Right \n $d_x2y2[0], $d_x2y2[1] # Destination Top Right \n );\n //echo '<pre>'; print_r($points); die;\n\n $imagick->setImageVirtualPixelMethod(\\Imagick::VIRTUALPIXELMETHOD_BACKGROUND);\n $imagick->distortImage(\\Imagick::DISTORTION_PERSPECTIVE, $points, true);\n //$imagick->scaleImage($imgWidth, $imgHeight, false);\n $rowImagick->addImage($imagick); \n }\n\n $rowImagick->resetIterator();\n $combinedRow = $rowImagick->appendImages(false);\n\n $canvas = generateFinalImage($combinedRow);\n header(\"Content-Type: image/png\");\n echo $canvas->getImageBlob();\n}", "private function rotate_png_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefrompng($path), $orientation);\n imagesavealpha($image, true);\n imagealphablending($image, true);\n imagepng($image, $path, 100);\n imagedestroy($image);\n }", "public function rotateFlipImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "public function __invoke($sourceImg = null, $angle = null) {\n if(null !== $sourceImg) {\n return $this->rotate($sourceImg, $angle);\n }\n return $this;\n }", "function _rotateImageIM($file, $desfile, $degrees) {\r\n $cmd = $this->_IM_path.\"convert -rotate $degrees \\\"$file\\\" \\\"$desfile\\\"\";\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public static function rotate($image = NULL, $degrees = NULL, $backgroundColorRed = 0, $backgroundColorGreen = 0, $backgroundColorBlue = 0, $backgroundColorAlpha = 0)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($degrees &&\n\t\t\t!is_int($degrees)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Degrees needs to be an integer, if specified.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorRed) &&\n\t\t\t($backgroundColorRed < 0 || $backgroundColorRed > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Red needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorGreen) &&\n\t\t\t($backgroundColorGreen < 0 || $backgroundColorGreen > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Green needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorBlue) &&\n\t\t\t($backgroundColorBlue < 0 || $backgroundColorBlue > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Blue needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorAlpha) &&\n\t\t\t($backgroundColorAlpha < 0 || $backgroundColorAlpha > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Alpha needs to be specified between 0 and 255.');\n\t\t}\n\n\t\t$rotatedImage = Default_Service_MediaImage::fromMediaImage($image);\n\t\t$rotatedImage->width = 0;\n\t\t$rotatedImage->height = 0;\n\t\t$rotatedImage->file_size = 0;\n\t\t$rotatedImage->role_id = $image->role_id;\n\t\tif (isset($image['entity_id'])) {\n\t\t\t$rotatedImage->entity_id = $image->entity_id;\n\t\t} else\n\t\tif (Zend_Auth::getInstance()->hasIdentity()) {\n\t\t\t$rotatedImage->entity_id = Zend_Auth::getInstance()->getIdentity()->id;\n\t\t}\n\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t$rotatedImage->save();\n\n\n\t\t/**\n\t\t * imageinstance file does not exist yet and needs to be created\n\t\t */\n\t\tif (!file_exists($rotatedImage->getStoredFilePath())) {\n\n\t\t\t/**\n\t\t\t * use Imagick for rotating the image ?\n\t\t\t */\n\t\t\tif (Zend_Registry::get('Imagick')) {\n\n\t\t\t\t/**\n\t\t\t\t * Imagick\n\t\t\t\t */\n\t\t\t\t$imagickError = NULL;\n\t\t\t\ttry {\n\t\t\t\t\t$colorStringFormat = '%1$02s%2$02s%3$02s%4$02s';\n\t\t\t\t\t$colorString = sprintf($colorStringFormat, dechex($backgroundColorRed), dechex($backgroundColorGreen), dechex($backgroundColorBlue), dechex($backgroundColorAlpha));\n\t\t\t\t\t$imagickBackgoundColor = new ImagickPixel('#' . $colorString);\n\n\t\t\t\t\t$imagickObj = new Imagick($image->getStoredFilePath());\n\t\t\t\t\t$imagickRotateResult = $imagickObj->rotateImage($imagickBackgoundColor, $degrees);\n\t\t\t\t\tif ($imagickRotateResult) {\n\t\t\t\t\t\t$imagickObj->writeimage($rotatedImage->getStoredFilePath());\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$rotatedImage->file_size = $imagickObj->getImageLength();\n\t\t\t\t\t\t$imagickDimensions = $imagickObj->getImageGeometry();\n\t\t\t\t\t\t$rotatedImage->width = $imagickDimensions['width'];\n\t\t\t\t\t\t$rotatedImage->height = $imagickDimensions['height'];\n\t\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t}\n\t\t\t\t} catch (ImagickException $imagickError) {\n\n\t\t\t\t}\n\n\t\t\t\tif ($imagickError ||\n\t\t\t\t\t!$imagickRotateResult) {\n\n\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$imageFile = L8M_Image::fromFile($image->getStoredFilePath());\n\n\t\t\t\tif ($imageFile instanceof L8M_Image_Abstract) {\n\n\t\t\t\t\t$imageFile\n\t\t\t\t\t\t->rotate($degrees, $backgroundColorRed, $backgroundColorGreen, $backgroundColorBlue, $backgroundColorAlpha)\n\t\t\t\t\t\t->save($rotatedImage->getStoredFilePath(), TRUE)\n\t\t\t\t\t;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t */\n\t\t\t\t\t$rotatedImage->file_size = $imageFile->getFilesize();\n\t\t\t\t\t$rotatedImage->width = $imageFile->getWidth();\n\t\t\t\t\t$rotatedImage->height = $imageFile->getHeight();\n\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * save\n\t\t\t\t\t */\n\t\t\t\t\tif (!$imageFile->isErrorOccured()) {\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $rotatedImage;\n\t}", "public function getRotateControl()\n {\n return $this->rotateControl;\n }", "function processImage($image, $filename, $filetype, $keywords, $name, $descr, $rotate, $degrees = 0, $ignoresizes = 0) {\r\n global $mosConfig_absolute_path, $zoom;\r\n // reset script execution time limit (as set in MAX_EXECUTION_TIME ini directive)...\r\n // requires SAFE MODE to be OFF!\r\n if (ini_get('safe_mode') != 1 ) {\r\n set_time_limit(0);\r\n }\r\n $imagepath = $zoom->_CONFIG['imagepath'];\r\n $catdir = $zoom->_gallery->getDir();\r\n $filename = urldecode($filename);\r\n\t\t// replace every space-character with a single \"_\"\r\n\t\t$filename = ereg_replace(\" \", \"_\", $filename);\r\n\t\t$filename = stripslashes($filename);\r\n $filename = ereg_replace(\"'\", \"_\", $filename);\r\n // Get rid of extra underscores\r\n $filename = ereg_replace(\"_+\", \"_\", $filename);\r\n $filename = ereg_replace(\"(^_|_$)\", \"\", $filename);\r\n $zoom->checkDuplicate($filename, 'filename');\r\n $filename = $zoom->_tempname;\r\n // replace space-characters in combination with a comma with 'air'...or nothing!\r\n $keywords = $zoom->cleanString($keywords);\r\n //$keywords = $zoom->htmlnumericentities($keywords);\r\n\t\t$name = $zoom->cleanString($name);\r\n //$name = $zoom->htmlnumericentities($name);\r\n //$descr = $zoom->cleanString($descr);\r\n //$descr = $zoom->htmlnumericentities($descr);\r\n if (empty($name)) {\r\n $name = $zoom->_CONFIG['tempName'];\r\n }\r\n $imgobj = new image(0); //create a new image object with a foo imgid\r\n $imgobj->setImgInfo($filename, $name, $keywords, $descr, $zoom->_gallery->_id, $zoom->currUID, 1, 1);\r\n $imgobj->getMimeType($filetype, $image);\r\n unset($filename, $name, $keywords, $descr); //clear memory, just in case...\r\n if (!$zoom->acceptableSize($image)) {\r\n \t// the file is simply too big, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = sprintf(_ZOOM_ALERT_TOOBIG, $zoom->_CONFIG['maxsizekb'].'kB');\r\n return false;\r\n }\r\n /* IMPORTANT CHEATSHEET:\r\n\t * If we don't get useful data from that or its a type we don't\r\n\t * recognize, take a swing at it using the file name.\r\n\t if ($mimeType == 'application/octet-stream' ||\r\n\t\t $mimeType == 'application/unknown' ||\r\n\t\t GalleryCoreApi::convertMimeToExtension($mimeType) == null) {\r\n\t\t$extension = GalleryUtilities::getFileExtension($file['name']);\r\n\t\t$mimeType = GalleryCoreApi::convertExtensionToMime($extension);\r\n\t }\r\n\t */\r\n if ($zoom->acceptableFormat($imgobj->getMimeType(), true)) {\r\n // File is an image/ movie/ document...\r\n $file = \"$mosConfig_absolute_path/$imagepath$catdir/\".$imgobj->_filename;\r\n $desfile = \"$mosConfig_absolute_path/$imagepath$catdir/thumbs/\".$imgobj->_filename;\r\n if (is_uploaded_file($image)) {\r\n if (!move_uploaded_file(\"$image\", $file)) {\r\n // some error occured while moving file, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n return false;\r\n }\r\n } elseif (!$zoom->platform->copy(\"$image\", $file) && !$zoom->platform->file_exists($file)) {\r\n // some error occured while moving file, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n return false;\r\n }\r\n @$zoom->platform->chmod($file, '0777');\r\n $viewsize = $mosConfig_absolute_path.\"/\".$imagepath.$catdir.\"/viewsize/\".$imgobj->_filename;\r\n if ($zoom->acceptableFormat($imgobj->getMimeType(), true)) {\r\n\t if ($zoom->isImage($imgobj->getMimeType(), true)) {\r\n\t\t\t\t\t$imgobj->_size = $zoom->platform->getimagesize($file);\r\n\t // get image EXIF & IPTC data from file to save it in viewsize image and get a thumbnail...\r\n\t if ($zoom->_CONFIG['readEXIF'] && ($imgobj->_type === \"jpg\" || $imgobj->_type === \"jpeg\") && !(bool)ini_get('safe_mode')) {\r\n\t // Retreive the EXIF, XMP and Photoshop IRB information from\r\n\t // the existing file, so that it can be updated later on...\r\n\t $jpeg_header_data = get_jpeg_header_data($file);\r\n\t $EXIF_data = get_EXIF_JPEG($file);\r\n\t $XMP_data = read_XMP_array_from_text( get_XMP_text( $jpeg_header_data ) );\r\n\t $IRB_data = get_Photoshop_IRB( $jpeg_header_data );\r\n\t $new_ps_file_info = get_photoshop_file_info($EXIF_data, $XMP_data, $IRB_data);\r\n\t // Check if there is a default for the date defined\r\n\t if ((!array_key_exists('date', $new_ps_file_info)) || ((array_key_exists('date', $new_ps_file_info)) && ($new_ps_file_info['date'] == ''))) {\r\n\t // No default for the date defined\r\n\t // figure out a default from the file\r\n\t // Check if there is a EXIF Tag 36867 \"Date and Time of Original\"\r\n\t if (($EXIF_data != FALSE) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(34665, $EXIF_data[0])) && (array_key_exists(0, $EXIF_data[0][34665])) && (array_key_exists(36867, $EXIF_data[0][34665][0]))) {\r\n\t // Tag \"Date and Time of Original\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][34665][0][36867]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } elseif (($EXIF_data != FALSE) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(34665, $EXIF_data[0])) && (array_key_exists(0, $EXIF_data[0][34665])) && (array_key_exists(36868, $EXIF_data[0][34665][0]))) {\r\n\t // Check if there is a EXIF Tag 36868 \"Date and Time when Digitized\"\r\n\t // Tag \"Date and Time when Digitized\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][34665][0][36868]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } else if ( ( $EXIF_data != FALSE ) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(306, $EXIF_data[0]))) {\r\n\t // Check if there is a EXIF Tag 306 \"Date and Time\"\r\n\t // Tag \"Date and Time\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][306]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } else {\r\n\t // Couldn't find an EXIF date in the image\r\n\t // Set default date as creation date of file\r\n\t $new_ps_file_info['date'] = date (\"Y-m-d\", filectime( $file ));\r\n\t }\r\n\t }\r\n\t }\r\n\t // First, rotate the image (if that's mentioned in the 'job description')...\r\n\t\t if ($rotate) {\r\n\t\t\t\t\t\t$tmpdir = $mosConfig_absolute_path.\"/\".$zoom->createTempDir();\r\n\t\t\t\t\t\t$new_source = $tmpdir.\"/\".$imgobj->_filename;\r\n\t\t\t\t\t\tif (!$this->rotateImage($file, $new_source, $degrees, $imgobj)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = \"Error rotating image\";\r\n\t return false;\r\n\t } else {\r\n\t\t\t\t\t\t\t@$zoom->platform->unlink($file);\r\n\t\t\t\t\t\t\tif ($zoom->platform->copy($new_source, $file)) {\r\n\t\t\t\t\t\t\t\t$imgobj->_size = $zoom->platform->getimagesize($file);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t }\r\n\t // resize to thumbnail...\r\n\t // 1-31-2006: fix #0000151\r\n\t if (!$zoom->platform->file_exists($desfile)) {\r\n\t \tif (!$this->resizeImage($file, $desfile, $zoom->_CONFIG['size'], $imgobj)) {\r\n\t\t $this->_err_num++;\r\n\t\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t\t return false;\r\n\t\t }\r\n\t }\r\n\t \r\n\t // if the image size is greater than the given maximum: resize it!\r\n\t if (!$zoom->platform->file_exists($viewsize)) {\r\n\t\t //If the image is larger than the max size\r\n\t\t\t\t\t\tif (($imgobj->_size[0] > $zoom->_CONFIG['maxsize'] || $imgobj->_size[1] > $zoom->_CONFIG['maxsize']) && !$ignoresizes) {\r\n\t\t //Resizes the file. If successful, continue\r\n\t\t\t\t\t\t\tif ($this->resizeImage($file, $viewsize, $zoom->_CONFIG['maxsize'], $imgobj)) {\r\n\t\t\t\t\t\t\t\t//Watermark?\r\n\t\t\t\t\t\t\t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t\t//Watermark. Return errors if not successuful\r\n\t\t\t\t\t\t\t\t\tif (!$this->watermarkImage($viewsize, $viewsize, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t } else {\r\n\t\t $this->_err_num++;\r\n\t\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t\t return false;\r\n\t\t }\r\n\t\t } else {\r\n\t\t //Watermark?\r\n\t\t\t\t\t\t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t//Watermark. Return errors if not successuful\r\n\t\t\t\t\t\t\t\tif (!$this->watermarkImage($file, $file, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t }\r\n\t }\r\n\t } elseif ($zoom->isDocument($imgobj->getMimeType(), true)) {\r\n\t if ($zoom->isIndexable($imgobj->getMimeType(), true) && $this->_use_PDF) {\r\n\t if (!$this->indexDocument($file, $imgobj->_filename)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_INDEXERROR;\r\n\t return false;\r\n\t }\r\n\t } else {\r\n\t \tif($zoom->platform->copy($file, $viewsize)) {\r\n\t \t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t// put a watermark on the source image...\r\n\t\t\t\t\t\t\t\tif (!$this->watermarkImage($viewsize, $viewsize, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t \t} else {\r\n\t\t\t\t\t\t\t// some error occured while moving file, register this...\r\n\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t \t}\r\n\t } elseif ($zoom->isMovie($imgobj->getMimeType(), true)) {\r\n\t //if movie is 'thumbnailable' -> make a thumbnail then!\r\n\t if ($zoom->isThumbnailable($imgobj->_type) && $this->_use_FFMPEG) {\r\n\t if (!$this->createMovieThumb($file, $zoom->_CONFIG['size'], $imgobj->_filename)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t return false;\r\n\t }\r\n\t }\r\n\t } elseif ($zoom->isAudio($imgobj->getMimeType(), true)) {\r\n\t // TODO: indexing audio files (mp3-files, etc.) properties, e.g. id3vX tags...\r\n\t }\r\n\t if (!$imgobj->save()) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = \"Database failure\";\r\n\t }\r\n\t }\r\n } else {\r\n //Not the right format, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_WRONGFORMAT_MULT;\r\n return false;\r\n }\r\n return true;\r\n }", "function image_process_imagemagick($action = 'resize')\n\t{\t\t\t\t\n\t\t/** ---------------------------------\n\t\t/** Do we have a vaild library path?\n\t\t/** ---------------------------------*/\n\t\t\t\t\n\t\tif ($this->libpath == '')\n\t\t{\n\t\t\t$this->set_error('imglib_libpath_invalid');\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif (substr($this->libpath, -7) != 'convert')\n\t\t{\n\t\t\t$this->libpath .= (substr($this->libpath, -1) == '/') ? 'convert' : '/convert';\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Execute the command\n\t\t/** ---------------------------------*/\n\t\t\n\t\t$cmd = $this->libpath.\" -quality \".$this->quality;\n\n\t\tif ($action == 'crop')\n\t\t{\n\t\t\t$cmd .= \" -crop \".$this->dst_width.\"x\".$this->dst_height.\"+\".$this->x_axis.\"+\".$this->y_axis.\" \\\"$this->full_src_path\\\" \\\"$this->full_dst_path\\\" 2>&1\";\n\t\t}\n\t\telseif ($action == 'rotate')\n\t\t{\n\t\t\tswitch ($this->rotation)\n\t\t\t{\n\t\t\t\tcase 'hor' \t: $angle = '-flop';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'vrt' \t: $angle = '-flip';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault\t\t: $angle = '-rotate '.$this->rotation;\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t\n\t\t\t$cmd .= \" \".$angle.\" \\\"$this->full_src_path\\\" \\\"$this->full_dst_path\\\" 2>&1\";\n\t\t}\n\t\telse // Resize\n\t\t{\n\t\t\t$cmd .= \" -resize \".$this->dst_width.\"x\".$this->dst_height.\" \\\"$this->full_src_path\\\" \\\"$this->full_dst_path\\\" 2>&1\";\n\t\t}\n\n\t\t$retval = 1;\n\n\t\t@exec($cmd, $output, $retval);\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Did it work?\n\t\t/** ---------------------------------*/\n\t\tif ($retval > 0) \n\t\t{\n\t\t\t$this->set_error('imglib_image_process_failed');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t// Set the file to 777\n\t\t\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function resize ($image, $transformations) {\n $img = Image::make($image);\n $img->backup();\n $filename_base = $img->dirname.'/'.$img->filename.'_';\n $filename_extension = '.'.$img->extension;\n $data = ['original' => $image];\n $transform = function($modify, $name, $img)\n use (&$data, $filename_base, $filename_extension) {\n $img->reset();\n $modify($img);\n $mod_file = $filename_base.$name.$filename_extension;\n $img->encode('jpg', $this->quality );\n $img->save($mod_file);\n $img->reset();\n $data[$name] = $mod_file;\n };\n\n array_walk($transformations, $transform, $img);\n\n return $data;\n }", "public function rotateLeft();", "public function rotate($value='random', $bgColor='ffffff')\n\t{\n\t\t$this->checkImage();\n\t\tif ($value == 'random') {\n\t\t\t$value = mt_rand(-6, 6);\n\t\t} else {\n\t\t\t$value = max(-360, min($value, 360));\n\t\t}\n\t\tif ($value < 0) {\n\t\t\t$value = 360 + $value;\n\t\t}\n\n\t\tif ($bgColor == 'alpha' && function_exists('imagerotate')) {\n\t\t\t// Experimental. GD2 imagerotate seems to be quite buggy with alpha transparency.\n\t\t\timagealphablending($this->imageResized, false);\n\t\t\t$color = imagecolorallocatealpha($this->imageResized, 255, 255, 255, 127);\n\t\t\timagecolortransparent($this->imageResized, $color);\n\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t} else {\n\t\t\t$bgColor = str_replace('#', '', strtoupper(trim($bgColor)));\n\t\t\t$color = hexdec($bgColor);\n\t\t\tif (function_exists('imagerotate')) {\n\t\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\t} else {\n\t\t\t\t$this->imageResized = $this->imagerotate($this->imageResized, $value, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function __rotate(&$tmp, $angle, $color) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "public function rotateRight();", "public function rotate(int $rotations);", "public function ImgCropToFile(){\r\n $imgUrl = $_POST['imgUrl'];\r\n// original sizes\r\n $imgInitW = $_POST['imgInitW'];\r\n $imgInitH = $_POST['imgInitH'];\r\n// resized sizes\r\n $imgW = $_POST['imgW'];\r\n $imgH = $_POST['imgH'];\r\n// offsets\r\n $imgY1 = $_POST['imgY1'];\r\n $imgX1 = $_POST['imgX1'];\r\n// crop box\r\n $cropW = $_POST['cropW'];\r\n $cropH = $_POST['cropH'];\r\n// rotation angle\r\n $angle = $_POST['rotation'];\r\n\r\n $jpeg_quality = 100;\r\n\r\n $what = new \\Think\\Image();\r\n $name = './'.$this::getPath($imgUrl).$this::getFileName($imgUrl);\r\n $c_name = './'.$this::getPath($imgUrl).'c_'.$this::getFileName($imgUrl);\r\n $p_name = './'.$this::getPath($imgUrl).'p_'.$this::getFileName($imgUrl);\r\n $what ->open($name);\r\n $what ->thumb($imgW, $imgH)->save($c_name);\r\n $what ->open($c_name);\r\n $what ->crop(($cropW),($cropH),$imgX1,$imgY1)->save($p_name);\r\n unlink($c_name);\r\n unlink($name);\r\n\r\n $m = M('img_mapping');\r\n $data = array();\r\n $data['user'] = $_SESSION['current_user']['id'];\r\n $data['img'] = './'.$this::getPath($p_name).$this::getFileName($p_name);\r\n $m->data($data)->add();\r\n\r\n $response = Array(\r\n \"status\" => 'success',\r\n \"url\" => __ROOT__.'/'.$this::getPath($p_name).$this::getFileName($p_name)\r\n );\r\n print json_encode($response);\r\n }", "function setRotation( $r ) {\n\n // only 0,90,180,270\n if ( $r > 270 ) return;\n if ( $r % 90 != 0 ) return;\n\n $this->rotate = $r;\n $this->vertical = ( $r == 90 or $r == 270 );\n}", "protected function fix_image_orientation( $filename, $filecontent ) {\r\n\t\t\t$data = exif_read_data( $filename );\r\n\t\t\tif ( !empty( $data['Orientation'] ) ) {\r\n\t\t\t\tswitch( $data['Orientation'] ) {\r\n\t\t\t\t\tcase 3: { $newAngle = 180; } break;\r\n\t\t\t\t\tcase 6: { $newAngle = -90; } break;\r\n\t\t\t\t\tcase 8: { $newAngle = 90; } break;\r\n\t\t\t\t\tdefault: $newAngle = false;\r\n\t\t\t\t}\r\n\t\t\t\tif ( $newAngle ) {\r\n\t\t\t\t\t$image = imagecreatefromstring( $filecontent );\r\n\t\t\t\t\t$image = imagerotate( $image, $newAngle, 0 );\r\n\t\t\t\t\t$this->save_image( $image, $filename );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function fix_orientation($fileandpath) { if(!file_exists($fileandpath))\n return false;\n try {\n @$exif = read_exif_data($fileandpath, 'IFD0');\n }\n catch (Exception $exp) {\n $exif = false;\n }\n // Get all the exif data from the file\n // If we dont get any exif data at all, then we may as well stop now\n if(!$exif || !is_array($exif))\n return false;\n\n // I hate case juggling, so we're using loweercase throughout just in case\n $exif = array_change_key_case($exif, CASE_LOWER);\n\n // If theres no orientation key, then we can give up, the camera hasn't told us the\n // orientation of itself when taking the image, and i'm not writing a script to guess at it!\n if(!array_key_exists('orientation', $exif))\n return false;\n\n // Gets the GD image resource for loaded image\n $img_res = $this->get_image_resource($fileandpath);\n\n // If it failed to load a resource, give up\n if(is_null($img_res))\n return false;\n\n // The meat of the script really, the orientation is supplied as an integer,\n // so we just rotate/flip it back to the correct orientation based on what we\n // are told it currently is\n\n switch($exif['orientation']) {\n\n // Standard/Normal Orientation (no need to do anything, we'll return true as in theory, it was successful)\n case 1: return true; break;\n\n // Correct orientation, but flipped on the horizontal axis (might do it at some point in the future)\n case 2:\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Upside-Down\n case 3:\n $final_img = $this->imageflip($img_res, IMG_FLIP_VERTICAL);\n break;\n\n // Upside-Down & Flipped along horizontal axis\n case 4:\n $final_img = $this->imageflip($img_res, IMG_FLIP_BOTH);\n break;\n\n // Turned 90 deg to the left and flipped\n case 5:\n $final_img = imagerotate($img_res, -90, 0);\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the left\n case 6:\n $final_img = imagerotate($img_res, -90, 0);\n break;\n\n // Turned 90 deg to the right and flipped\n case 7:\n $final_img = imagerotate($img_res, 90, 0);\n $final_img = $this->imageflip($img_res,IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the right\n case 8:\n $final_img = imagerotate($img_res, 90, 0);\n break;\n\n }\n if(!isset($final_img))\n return false;\n if (!is_writable($fileandpath)) {\n chmod($fileandpath, 0777);\n }\n unlink($fileandpath);\n\n // Save it and the return the result (true or false)\n $done = $this->save_image_resource($final_img,$fileandpath);\n\n return $done;\n }", "private function createImage() {\n $this->Imagick = new \\Imagick();\n\n /* Create the ImagickPixel object (used to set the background color on image) */\n $bg = new \\ImagickPixel();\n\n /* Set the pixel color to white */\n $bg->setColor( $this->bg_color );\n\n /* Create a drawing object and set the font size */\n $ImagickDraw = new \\ImagickDraw();\n\n /* Set font and font size. You can also specify /path/to/font.ttf */\n if ($this->font) $ImagickDraw->setFont($this->font);\n $ImagickDraw->setFontSize( $this->font_size );\n\n /* Create new empty image */\n $this->Imagick->newImage( $this->image_width, $this->image_height, $bg );\n\n /* Write the text on the image */\n $this->Imagick->annotateImage( $ImagickDraw, $this->text_position_left, $this->text_position_top, 0, $this->getCaptchaText() );\n\n /* Add some swirl */\n $this->Imagick->swirlImage( 20 );\n\n /* Create a few random lines */\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n $ImagickDraw->line( rand( 0, $this->image_width ), rand( 0, $this->image_height ), rand( 0, $this->image_width ), rand( 0, $this->image_height ) );\n\n /* Draw the ImagickDraw object contents to the image. */\n $this->Imagick->drawImage( $ImagickDraw );\n\n /* Give the image a format */\n $this->Imagick->setImageFormat( $this->image_format );\n }", "private function generateThumbnailImagick(){\n\t}", "private function rotate_gif_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromgif($path), $orientation);\n imagegif($image, $path, 100);\n imagedestroy($image);\n }", "public function getRotation()\n {\n return self::accessPgArray($this->rotation);\n }", "function rotate(&$tmp, $angle, $color=null) {\r\r\n\t\t\r\r\n\t\t// color ?\r\r\n\t\t//\r\r\n\t\tif (!is_a($color, 'Asido_Color')) {\r\r\n\t\t\t$color = new Asido_Color;\r\r\n\t\t\t$color->set(255, 255, 255);\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\treturn $this->__rotate($tmp, $angle, $color);\r\r\n\t\t}", "function image_scale_im_obj(\\Imagick $im, $aspect, $width, $strategy)\n{\n\n $height = round(($width/$aspect['width'])*$aspect['height']);\n\n $source_w = $im->getImageWidth();\n $source_h = $im->getImageHeight();\n $source_a = $source_h / $source_w;\n $target_a = $aspect['height'] / $aspect['width'];\n\n switch ($strategy) {\n case 'resize':\n $im->scaleImage($width, $height);\n break;\n case 'crop-top':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, 0);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, 0, 0);\n }\n break;\n case 'crop-bottom':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, $im->getImageHeight() - $height);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, $im->getImageWidth() - $width, 0);\n }\n break; \n case 'crop':\n default:\n $im->cropThumbnailImage($width, $height);\n break; \n }\n $im->setImageFormat('jpeg');\n $im->gaussianBlurImage(0.05, 0.5);\n $im->setImageCompressionQuality(75);\n $im->setInterlaceScheme(\\Imagick::INTERLACE_PLANE);\n $im->stripImage();\n return $im;\n}", "public function image();", "public function image();", "function orientation_check($file_path, $prefs)\n\t{\n\t\tif ( ! function_exists('exif_read_data'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Not all images are supported\n\t\t$exif = @exif_read_data($file_path);\n\n\t\tif ( ! $exif OR ! isset($exif['Orientation']))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$orientation = $exif['Orientation'];\n\n\t\tif ($orientation == 1)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Image is rotated, let's see by how much\n\t\t$deg = 0;\n\n\t\tswitch ($orientation) {\n\t\t\tcase 3:\n\t\t\t\t$deg = 180;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$deg = 270;\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$deg = 90;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($deg)\n\t\t{\n\t\t\tee()->load->library('image_lib');\n\n\t\t\tee()->image_lib->clear();\n\n\t\t\t// Set required memory\n\t\t\ttry\n\t\t\t{\n\t\t\t\tee('Memory')->setMemoryForImageManipulation($file_path);\n\t\t\t}\n\t\t\tcatch (\\Exception $e)\n\t\t\t{\n\t\t\t\tlog_message('error', $e->getMessage().': '.$file_path);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$config = array(\n\t\t\t\t'rotation_angle'\t=> $deg,\n\t\t\t\t'library_path'\t\t=> ee()->config->item('image_library_path'),\n\t\t\t\t'image_library'\t\t=> ee()->config->item('image_resize_protocol'),\n\t\t\t\t'source_image'\t\t=> $file_path\n\t\t\t);\n\n\t\t\tee()->image_lib->initialize($config);\n\n\t\t\tif ( ! ee()->image_lib->rotate())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$new_image = ee()->image_lib->get_image_properties('', TRUE);\n\t\t\tee()->image_lib->clear();\n\n\t\t\t// We need to reset some prefs\n\t\t\tif ($new_image)\n\t\t\t{\n\t\t\t\tee()->load->helper('number');\n\t\t\t\t$f_size = get_file_info($file_path);\n\t\t\t\t$prefs['file_height'] = $new_image['height'];\n\t\t\t\t$prefs['file_width'] = $new_image['width'];\n\t\t\t\t$prefs['file_hw_original'] = $new_image['height'].' '.$new_image['width'];\n\t\t\t\t$prefs['height'] = $new_image['height'];\n\t\t\t\t$prefs['width'] = $new_image['width'];\n\t\t\t}\n\n\t\t\treturn $prefs;\n\t\t}\n\t}", "function imageMaint() {\n\t\n //$path = realpath(APPPATH).'/libraries/IMagick_Image.php';\n//require_once($path);\n////$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/';\n//$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/LL9138TR_frisbeeRed/';\n//$util = new ImageUtil();\n////$util->imageToDir($path2);\n////$util->cleanUp($path2);\n//$util->removeDir($path2);\n//print $util->log();\n//exit;\n }", "public function fixOrientation($file, $return = 'file') {\n\t\t \t\n\t\t$mime = \\FileManager::getFileMimeType($file);\n \n\t\t$save_name = \\Tools::generateRandomString().uniqid(). $this -> getExtension($mime);\n\t \n\t if(!\\Validator::check('gif_file', $mime)) {\n\t $image = new \\Imagick($file);\n\t $orientation = $image -> getImageOrientation();\n\t \n\t switch($orientation) {\n\t case \\imagick::ORIENTATION_BOTTOMRIGHT: \n\t $image -> rotateimage(\"#000\", 180); // rotate 180 degrees\n\t break;\n\t \n\t case \\imagick::ORIENTATION_RIGHTTOP:\n\t $image -> rotateimage(\"#000\", 90); // rotate 90 degrees CW\n\t break;\n\t \n\t case \\imagick::ORIENTATION_LEFTBOTTOM: \n\t $image -> rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n\t break;\n\t }\n\t \n\t $image -> setImageOrientation (\\Imagick::ORIENTATION_TOPLEFT);\n\t \n\t $location = SITE_PATH.'tmp'.DS.$save_name;\n\t\t \n\t\t file_put_contents($location, $image -> getImageBlob());\n\t\t \n\t\t return $location;\n\t \n\t } else {\n\t \n\t \treturn $file;\n\t \n\t }\n\t}", "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}", "function print_image($path){\n $image = new Imagick();\n $image->readImage(_LOCAL_.$path);\n $height = $image->getImageHeight();\n $width = $image->getImageWidth();\n\n $canvas = new Imagick();\n $canvas->newImage($width,$height,new ImagickPixel('white'));\n $canvas->setImageFormat('png');\n $canvas->compositeImage($image,imagick::COMPOSITE_OVER, 0, 0);\n\n header('Content-type: image/png');\n echo $canvas;\n $image->destroy();\n $canvas->destroy();\n}", "public function test_flip() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->flip( true, false );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 99 )->getColor() );\n\t}", "protected function getLiipImagine_Filter_Loader_RotateService()\n {\n return $this->services['liip_imagine.filter.loader.rotate'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\RotateFilterLoader();\n }" ]
[ "0.7323277", "0.7013823", "0.6971205", "0.68941", "0.6790373", "0.66628873", "0.6656036", "0.65954405", "0.6588603", "0.6568754", "0.65577924", "0.65132767", "0.65132767", "0.6474326", "0.6440907", "0.6429413", "0.6409457", "0.6399886", "0.6396504", "0.6395086", "0.6337945", "0.62860435", "0.62540907", "0.6251969", "0.62444663", "0.62424874", "0.62409425", "0.6233741", "0.6219638", "0.6215689", "0.621336", "0.614595", "0.606181", "0.59983426", "0.5881388", "0.5864048", "0.57245463", "0.561576", "0.556309", "0.5522458", "0.5521213", "0.5495221", "0.54522586", "0.5450462", "0.5448166", "0.5439562", "0.5413726", "0.5394177", "0.53516316", "0.53418523", "0.53150886", "0.530823", "0.53007513", "0.5215522", "0.52010095", "0.51779723", "0.5162714", "0.5162681", "0.5157079", "0.5154979", "0.5154077", "0.51490396", "0.5144365", "0.5116591", "0.5106113", "0.51056963", "0.51040876", "0.5076867", "0.5067869", "0.5058843", "0.50429755", "0.5036303", "0.5016467", "0.5016467", "0.5016467", "0.5011547", "0.50089675", "0.49980617", "0.49913487", "0.49779865", "0.4977038", "0.49503207", "0.49428222", "0.49349183", "0.4920368", "0.49026728", "0.48935804", "0.488199", "0.4840286", "0.48121366", "0.47874835", "0.47836167", "0.47836167", "0.47597423", "0.47517154", "0.47401613", "0.4656065", "0.4650226", "0.46327943", "0.462524" ]
0.67551154
5
Rotate the gif with GD.
private function rotate_gif_with_gd($path, $orientation) { $image = $this->rotate_gd(imagecreatefromgif($path), $orientation); imagegif($image, $path, 100); imagedestroy($image); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "public function image_rotate_gd()\n\t{\n\t\t// Create the image handle\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Set the background color\n\t\t// This won't work with transparent PNG files so we are\n\t\t// going to have to figure out how to determine the color\n\t\t// of the alpha channel in a future release.\n\n\t\t$white = imagecolorallocate($src_img, 255, 255, 255);\n\n\t\t// Rotate it!\n\t\t$dst_img = imagerotate($src_img, $this->rotation_angle, $white);\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($dst_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($dst_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($dst_img);\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function _rotateImageGD2($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($file);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n } else {\r\n \t$src_img = @imagecreatefromgif($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $desfile);\r\n } else {\r\n \timagegif($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function rotate($img_name,$rotated_image,$direction){\n\t\t$image = $img_name;\n\t\t$extParts=explode(\".\",$image);\n\t\t$ext=end($extParts);\n\t\t$filename=$rotated_image;\n\t\t//How many degrees you wish to rotate\n\t\t$degrees = 0;\n\t\tif($direction=='R'){\n\t\t\t$degrees = 90;\n\t\t}\n\t\tif($direction=='L'){\n\t\t\t$degrees = -90;\n\t\t}\n\t\t\n\t\tif($ext==\"jpg\" || $ext== \"jpeg\" || $ext==\"JPG\" || $ext== \"JPEG\"){\n\t\t\t$source = imagecreatefromjpeg($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagejpeg($rotate,$filename) ;\n\t\t}\n\t\t\n\t\t\n\t\tif($ext==\"GIF\" || $ext== \"gif\"){\n\t\t\t$source = imagecreatefromgif($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagegif($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\t\n\t\tif($ext==\"png\" || $ext== \"PNG\"){\n\t\t\t$source = imagecreatefrompng($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagepng($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\treturn $rotate;\t\n\t\t\n\t}", "function image_rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\t\n\t\n\t\t\tif ($this->rotation == '' OR ! in_array($this->rotation, $degs))\n\t\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\t\t\t\n\t\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Reassign the width and height\n\t\t/** -------------------------------------*/\n\t\n\t\tif ($this->rotation == 90 OR $this->rotation == 270)\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_height;\n\t\t\t$this->dst_height\t= $this->src_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_width;\n\t\t\t$this->dst_height\t= $this->src_height;\n\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Choose resizing function\n\t\t/** -------------------------------------*/\n\t\t\n\t\tif ($this->resize_protocol == 'imagemagick' OR $this->resize_protocol == 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\t\t\n \t\tif ($this->rotation == 'hor' OR $this->rotation == 'vrt')\n \t\t{\n\t\t\treturn $this->image_mirror_gd();\n \t\t}\n\t\telse\n\t\t{\t\t\n\t\t\treturn $this->image_rotate_gd();\n\t\t}\n\t}", "public function rotate()\n {\n // not possible in php?\n }", "function _rotateImageGD1($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($file);\r\n } else {\r\n $src_img = imagecreatefrompng($file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function acadp_exif_rotate( $file ){\n\n\tif( ! function_exists( 'exif_read_data' ) ) {\n\t\treturn $file;\n\t}\n\n\t$exif = @exif_read_data( $file['tmp_name'] );\n\t$exif_orient = isset( $exif['Orientation'] ) ? $exif['Orientation'] : 0;\n\t$rotate_image = 0;\n\n\tif( 6 == $exif_orient ) {\n\t\t$rotate_image = 90;\n\t} else if ( 3 == $exif_orient ) {\n\t\t$rotate_image = 180;\n\t} else if ( 8 == $exif_orient ) {\n\t\t$rotate_image = 270;\n\t}\n\n\tif( $rotate_image ) {\n\n\t\tif( class_exists( 'Imagick' ) ) {\n\n\t\t\t$imagick = new Imagick();\n\t\t\t$imagick_pixel = new ImagickPixel();\n\t\t\t$imagick->readImage( $file['tmp_name'] );\n\t\t\t$imagick->rotateImage( $imagick_pixel, $rotate_image );\n\t\t\t$imagick->setImageOrientation( 1 );\n\t\t\t$imagick->writeImage( $file['tmp_name'] );\n\t\t\t$imagick->clear();\n\t\t\t$imagick->destroy();\n\n\t\t} else {\n\n\t\t\t$rotate_image = -$rotate_image;\n\n\t\t\tswitch( $file['type'] ) {\n\t\t\t\tcase 'image/jpeg' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromjpeg' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromjpeg( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagejpeg( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png' :\n\t\t\t\t\tif( function_exists( 'imagecreatefrompng' ) ) {\n\t\t\t\t\t\t$source = imagecreatefrompng( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagepng( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromgif' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromgif( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagegif( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn $file;\n\n}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n\t{\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h);\n\t $this->Rotate(0);\n\t}", "public function gifBuild() {}", "function rotateImage0($img, $imgPath, $suffix, $degrees, $quality, $save)\n{\n // Open the original image.\n $original = imagecreatefromjpeg(\"$imgPath/$img\") or die(\"Error Opening original\");\n list($width, $height, $type, $attr) = getimagesize(\"$imgPath/$img\");\n \n // Resample the image.\n $tempImg = imagecreatetruecolor($width, $height) or die(\"Cant create temp image\");\n imagecopyresized($tempImg, $original, 0, 0, 0, 0, $width, $height, $width, $height) or die(\"Cant resize copy\");\n \n // Rotate the image.\n $rotate = imagerotate($original, $degrees, 0);\n \n // Save.\n if($save)\n {\n // Create the new file name.\n $newNameE = explode(\".\", $img);\n $newName = ''. $newNameE[0] .''. $suffix .'.'. $newNameE[1] .'';\n \n // Save the image.\n imagejpeg($rotate, \"$imgPath/$newName\", $quality) or die(\"Cant save image\");\n }\n \n // Clean up.\n imagedestroy($original);\n imagedestroy($tempImg);\n return true;\n}", "private function _imgRotate(){\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $webPath = WEBROOT.'/site/files/_tmp/'.basename($url);\r\n $degrees = $_POST['direction']=='CCW'?90:-90;\r\n $info = getimagesize($sourcePath);\r\n\r\n switch($info['mime']){\r\n case 'image/png':\r\n $img = imagecreatefrompng($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagesavealpha($rotate, true);\r\n imagepng($rotate, $sourcePath);\r\n break;\r\n case 'image/jpeg':\r\n $img = imagecreatefromjpeg($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagejpeg($rotate, $sourcePath);\r\n break;\r\n case 'image/gif':\r\n $img = imagecreatefromgif($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagegif($rotate, $sourcePath);\r\n break;\r\n default:\r\n $result->error = \"Only PNG, JPEG or GIF images are allowed!\";\r\n $response = 400;\r\n exit;\r\n }\r\n\r\n if(isset($img))imagedestroy($img);\r\n if(isset($rotate))imagedestroy($rotate);\r\n\r\n $info = getimagesize($sourcePath);\r\n $result->url = $webPath;\r\n $result->size = [$info[0],$info[1]];\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public static function rotate($baseURL, $name, $image)\r\n {\r\n $exif = exif_read_data($image);\r\n\r\n if (array_key_exists('Orientation', $exif))\r\n {\r\n $jpg = imagecreatefromjpeg($image);\r\n $orientation = $exif['Orientation'];\r\n switch ($orientation)\r\n {\r\n case 3:\r\n $jpg = imagerotate($jpg, 180, 0);\r\n break;\r\n case 6:\r\n $jpg = imagerotate($jpg, -90, 0);\r\n break;\r\n case 8:\r\n $jpg = imagerotate($jpg, 90, 0);\r\n break;\r\n default: \t\r\n }\r\n imagejpeg($jpg, $baseURL.'computed/'.$name, 90);\r\n }\r\n\t\t else\r\n\t\t {\r\n\t\t\t copy($image, $baseURL.'computed/'.$name);\r\n\t\t }\r\n }", "function AutoRotateImage($src_image, $ref = false) \n {\n # from a non-ingested image to properly rotate a preview image\n global $imagemagick_path, $camera_autorotation_ext, $camera_autorotation_gm;\n \n if (!isset($imagemagick_path)) \n {\n return false;\n # for the moment, this only works for imagemagick\n # note that it would be theoretically possible to implement this\n # with a combination of exiftool and GD image rotation functions.\n }\n\n # Locate imagemagick.\n $convert_fullpath = get_utility_path(\"im-convert\");\n if ($convert_fullpath == false) \n {\n return false;\n }\n \n $exploded_src = explode('.', $src_image);\n $ext = $exploded_src[count($exploded_src) - 1];\n $triml = strlen($src_image) - (strlen($ext) + 1);\n $noext = substr($src_image, 0, $triml);\n \n if (count($camera_autorotation_ext) > 0 && (!in_array(strtolower($ext), $camera_autorotation_ext))) \n {\n # if the autorotation extensions are set, make sure it is allowed for this extension\n return false;\n }\n\n $exiftool_fullpath = get_utility_path(\"exiftool\");\n $new_image = $noext . '-autorotated.' . $ext;\n \n if ($camera_autorotation_gm) \n {\n $orientation = get_image_orientation($src_image);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -rotate +' . $orientation . ' ' . escapeshellarg($new_image);\n run_command($command);\n }\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n } \n else\n {\n if ($ref != false) \n {\n # use the original file to get the orientation info\n $extension = sql_value(\"select file_extension value from resource where ref=$ref\", '');\n $file = get_resource_path($ref, true, \"\", false, $extension, -1, 1, false, \"\", -1);\n # get the orientation\n $orientation = get_image_orientation($file);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' -rotate +' . $orientation . ' ' . escapeshellarg($src_image) . ' ' . escapeshellarg($new_image);\n run_command($command);\n # change the orientation metadata\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n }\n } \n else\n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -auto-orient ' . escapeshellarg($new_image);\n run_command($command);\n }\n }\n\n if (!file_exists($new_image)) \n {\n return false;\n }\n\n if (!$ref) \n {\n # preserve custom metadata fields with exiftool \n # save the new orientation\n # $new_orientation=run_command($exiftool_fullpath.' -s -s -s -orientation -n '.$new_image);\n $old_orientation = run_command($exiftool_fullpath . ' -s -s -s -orientation -n ' . escapeshellarg($src_image));\n \n $exiftool_copy_command = $exiftool_fullpath . \" -TagsFromFile \" . escapeshellarg($src_image) . \" -all:all \" . escapeshellarg($new_image);\n run_command($exiftool_copy_command);\n \n # If orientation was empty there's no telling if rotation happened, so don't assume.\n # Also, don't go through this step if the old orientation was set to normal\n if ($old_orientation != '' && $old_orientation != 1) \n {\n $fix_orientation = $exiftool_fullpath . ' Orientation=1 -n ' . escapeshellarg($new_image);\n run_command($fix_orientation);\n }\n }\n \n unlink($src_image);\n rename($new_image, $src_image);\n return true; \n }", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n {\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n }", "function __rotate(&$tmp, $angle, &$color) {\n\n\t\t// skip full loops\n\t\t//\n\t\tif (($angle % 360) == 0) {\n\t\t\treturn true;\n\t\t\t}\n\n\t\t// rectangular rotates are OK\n\t\t//\n\t\tif (($angle % 90) == 0) {\n\n\t\t\t// call `convert -rotate`\n\t\t\t//\n\t\t\t$cmd = $this->__command(\n\t\t\t\t'convert',\n\t\t\t\t\" -rotate {$angle} \"\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t\t\t. \" TIF:\"\n\t \t\t\t// ^ \n\t \t\t\t// GIF saving hack\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t);\n\t exec($cmd, $result, $errors);\n\t\t\tif ($errors) {\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t$w1 = $tmp->image_width;\n\t\t\t$h1 = $tmp->image_height;\n\t\t\t$tmp->image_width = ($angle % 180) ? $h1 : $w1;\n\t\t\t$tmp->image_height = ($angle % 180) ? $w1 : $h1;\n\t\t\treturn true;\n\t\t\t}\n\n\t\treturn false;\n\t\t}", "function rotateImage($param=array())\r\n {\r\n $img = isset($param['src']) ? $param['src'] : false;\r\n $newname= isset($param['newname']) ? $param['newname'] : $img;\r\n $degrees= isset($param['deg']) ? $param['deg'] : false;\r\n $out = false;\r\n \r\n if($img)\r\n {\r\n \r\n switch(exif_imagetype($img)){\r\n \tcase 1:\r\n \t\t//gif\r\n \t\t$destimg = imagecreatefromgif($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagegif($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 2:\r\n \t\t//jpg\r\n \t\t$destimg = imagecreatefromjpeg($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagejpeg($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 3:\r\n \t\t//png\r\n \t\t$destimg = imagecreatefrompng($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagepng($rotatedImage, $newname);\r\n \tbreak;\r\n }\r\n \r\n $out = $img;\r\n }\r\n \r\n return $out;\r\n }", "public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}", "public function rotateBy($rotation) {}", "function RotatedImage($file,$x,$y,$w,$h,$bln_rotate)\n\t{\n\t $img_size= getimagesize($file);\n\t \n\t $aspect_y=$h/$img_size[1];\n\t $aspect_x=$w/$img_size[0];\n\t \n\t if ($bln_rotate==1){\n\t\t //Check to see if the image fits better at 90 degrees\n\t\t $aspect_y2=$w/$img_size[1];\n\t\t $aspect_x2=$h/$img_size[0];\n\t\t \n\t\t if($aspect_x<$aspect_y)\n\t\t {\n\t\t \t$aspect1=$aspect_x;\n\t\t }\n\t\t else {\n\t\t \t$aspect1=$aspect_y;\n\t\t }\n\t\t \n\t\t if($aspect_x2<$aspect_y2)\n\t\t {\n\t\t \t$aspect2=$aspect_x2;\n\t\t }\n\t\t else {\n\t\t \t$aspect2=$aspect_y2;\n\t\t }\n\t\t \n\t\t if ($aspect1<$aspect2)\n\t\t {\n\t\t \t$angle=90;\n\t\t \t$y=$y+$h;\n\t\t \t$t=$h;\n\t\t \t$h=$w;\n\t\t \t$w=$t;\n\t\t \t$aspect_y=$aspect_y2;\n\t\t \t$aspect_x=$aspect_x2;\n\t\t }\n\t }\n\t \n\t \n\t \n\t \n\t \tif ($aspect_x>$aspect_y){\n\t \t\t$flt_adjust=$aspect_y;\n\t \t\t$w=$flt_adjust*$img_size[0];\n\t \t\t\n\t \t}\n\t \telse{\n\t \t\t$flt_adjust=$aspect_x;\n\t \t\t$h=$flt_adjust*$img_size[1];\n\t \t}\n\t \n\t \t\n\t \t\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h,'JPG');\n\t $this->Rotate(0);\n\t}", "private function rotate_gd($image, $orientation)\n {\n switch ($orientation) {\n case 2:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 3:\n $image = imagerotate($image, 180, 0);\n break;\n\n case 4:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 5:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 6:\n $image = imagerotate($image, -90, 0);\n break;\n\n case 7:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 8:\n $image = imagerotate($image, 90, 0);\n break;\n }\n\n return $image;\n }", "public function autoRotate() {\n $this->thumb->rotateJpg();\n return $this;\n }", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not rotate image.');\n }\n\n // The rotation routine...\n $dst_img = imagerotate($src_img, $degrees, 0);\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "function _rotate_image_resource($img, $angle)\n {\n }", "function autoRotateImage($image) {\n $orientation = $image->getImageOrientation();\n\n switch($orientation) {\n case imagick::ORIENTATION_BOTTOMRIGHT:\n $image->rotateimage(\"#000\", 180); // rotate 180 degrees\n break;\n\n case imagick::ORIENTATION_RIGHTTOP:\n $image->rotateimage(\"#000\", 90); // rotate 90 degrees CW\n break;\n\n case imagick::ORIENTATION_LEFTBOTTOM:\n $image->rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n break;\n }\n\n // Now that it's auto-rotated, make sure the EXIF data is correct in case the EXIF gets saved with the image!\n $image->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n}", "public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "protected function _rotateImage(&$photo, $path)\n {\n \t$exif = @exif_read_data($path);\n \t\n \tif (!empty($exif['Orientation']))\n \t\tswitch ($exif['Orientation'])\n \t\t{\n \t\t\tcase 8:\n \t\t\t\t$photo->rotateImageNDegrees(90)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\t$photo->rotateImageNDegrees(180)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 6:\n \t\t\t\t$photo->rotateImageNDegrees(-90)->save($path);\n \t\t\t\tbreak;\n \t}\n }", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n\t\t$this->Rotate($angle, $x, $y);\n\t\t$this->Image($file, $x, $y, $w, $h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n $this->Rotate($angle, $x, $y);\n $this->Image($file, $x, $y, $w, $h);\n $this->Rotate(0);\n }", "private function rotate_png_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefrompng($path), $orientation);\n imagesavealpha($image, true);\n imagealphablending($image, true);\n imagepng($image, $path, 100);\n imagedestroy($image);\n }", "public function Rotate($angle){\n\t\t\t$rgba = \\backbone\\Color::HexToRGBA(\"#FFFFFF\", 0);\n\t\t\t$color = $this->AllocateColor($rgba[0]['r'], $rgba[0]['g'], $rgba[0]['b'], $rgba[0]['alpha']);\n\n\t\t\t$img = new \\backbone\\Image();\n\t\t\t$img->handle = imagerotate($this->handle, $angle, $color);\n\t\t\treturn $img;\n\t\t}", "private function rotate_jpg_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromjpeg($path), $orientation);\n imagejpeg($image, $path, 100);\n imagedestroy($image);\n }", "public function getRotation() {}", "public function getRotation() {}", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "public function actionRotate($imageid,$direction)\n\t{\n\t\t\n\t\t// the image object is created from the database to avoid user input\n\t\t$image = Image::model()->findByPk($imageid);\n\t\t// where to return after the operation\n\t\t$rotatedurl = Yii::app()->user->returnUrl;\n\t\t\n\t\t// temporary filename for the created rotated image\n\t\t$tempfilename = Image::FULLIMAGETEMPPATH . uniqid() . '.jpg';\n\t\t// the image variable $rotated is created based on the original JPG in the file system\n\t\t\n\t\t// if the file does not exist, the user is redirected away\n\t\tif (!file_exists($image->getImageFile('full',false,Image::FULLIMAGEPATH)))\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_file_not_found';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\t\t\t\t\n\t\t// the original full image is evaluated to determine if it's a JPG\n\t\t// should the file not be jpg, execution is terminated and user is presented\n\t\t// with an error\n\t\t$originalFullImage = $image->getImageFile('full',false,Image::FULLIMAGEPATH);\n\t\t// getimagesize returns information of image size, but also of type among other things\n\t\t$information = getimagesize($originalFullImage);\n\t\tif ($information['mime'] != 'image/jpeg')\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_not_jpg';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\n\t\t// an uncompressed image is created from the original full size image\n\t\t$rotate = imagecreatefromjpeg($originalFullImage);\n\t\t// the original full image is unset to save memory\n\t\tunset($originalFullImage);\n\t\t\n\t\t// defining the direction of the rotation\n\t\tswitch($direction) \n\t\t{\n\t\t\tcase 'clockwise':\n\t\t\t\t$angle = -90; \t\n\t\t\t\tbreak;\n\t\t\tcase 'counterclockwise':\n\t\t\t\t$angle = 90; \t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// creates the rotated image\n\t\t$rotated = imagerotate($rotate,$angle,0);\n\t\tunset($rotate);\n\t\t// saves the rotated image as a jpeg to the temporary file directory\n\t\timagejpeg($rotated,$tempfilename,100);\n\t\tunset($rotated);\n\t\t\n\t\t// the existance of the rotated image is evaluated before anything is deleted\n\t\tif(file_exists($tempfilename))\n\t\t{\n\t\t\t// deletes all the physical image files for the image object\n\t\t\t$image->deleteImage(array('small', 'light', 'medium', 'large','full'));\n\t\t\t\n\t\t\t// moving the generated image to it's desired location\n\t\t\trename($tempfilename,$image->getImageFile('full',false,Image::FULLIMAGEPATH));\n\t\t\t\n\t\t\t// generating thumbnails for the rotated image\n\t\t\t$image->generateThumbnails();\n\t\t}\n\n\t\t$rotatedurl['rotated']='true';\n\t\t$this->redirect($rotatedurl);\n\t\t\t\t\n\t}", "protected function adjustImageOrientation()\n { \n $exif = @exif_read_data($this->file);\n \n if($exif && isset($exif['Orientation'])) {\n $orientation = $exif['Orientation'];\n \n if($orientation != 1){\n $img = imagecreatefromjpeg($this->file);\n \n $mirror = false;\n $deg = 0;\n \n switch ($orientation) {\n \n case 2:\n $mirror = true;\n break;\n \n case 3:\n $deg = 180;\n break;\n \n case 4:\n $deg = 180;\n $mirror = true; \n break;\n \n case 5:\n $deg = 270;\n $mirror = true; \n break;\n \n case 6:\n $deg = 270;\n break;\n \n case 7:\n $deg = 90;\n $mirror = true; \n break;\n \n case 8:\n $deg = 90;\n break;\n }\n \n if($deg) $img = imagerotate($img, $deg, 0); \n if($mirror) $img = $this->mirrorImage($img);\n \n $this->image = str_replace('.jpg', \"-O$orientation.jpg\", $this->file); \n imagejpeg($img, $this->file, $this->quality);\n }\n }\n }", "protected function writeGifAndPng() {}", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n $fileOut = $src_file . \".1\";\n @copy($src_file, $fileOut);\n \n $path = zmgNetpbmTool::getPath();\n if ($img_meta['extension'] == \"png\") {\n $cmd = $path . \"pngtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"pnmtopng > \" . $fileOut;\n } else if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $cmd = $path . \"jpegtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmtojpeg -quality=\" . $img_meta['jpeg_qty']\n . \" > \" . $fileOut;\n } else if ($img_meta['extension'] == \"gif\") {\n $cmd = $path . \"giftopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmquant 256 | \" . $path . \"ppmtogif > \"\n . $fileOut;\n } else {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Source file is not an image or image type is not supported.');\n }\n\n $output = $retval = null;\n exec($cmd, $output, $retval);\n if ($retval) {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Could not rotate image: ' . $output);\n }\n $erg = @rename($fileOut, $dest_file);\n\n return true;\n }", "function rotateImage($width, $height, $rotation, $quality = 8){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = max(min($quality, 10), 0) * 10;\n\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "public function fixOrientation($file, $return = 'file') {\n\t\t \t\n\t\t$mime = \\FileManager::getFileMimeType($file);\n \n\t\t$save_name = \\Tools::generateRandomString().uniqid(). $this -> getExtension($mime);\n\t \n\t if(!\\Validator::check('gif_file', $mime)) {\n\t $image = new \\Imagick($file);\n\t $orientation = $image -> getImageOrientation();\n\t \n\t switch($orientation) {\n\t case \\imagick::ORIENTATION_BOTTOMRIGHT: \n\t $image -> rotateimage(\"#000\", 180); // rotate 180 degrees\n\t break;\n\t \n\t case \\imagick::ORIENTATION_RIGHTTOP:\n\t $image -> rotateimage(\"#000\", 90); // rotate 90 degrees CW\n\t break;\n\t \n\t case \\imagick::ORIENTATION_LEFTBOTTOM: \n\t $image -> rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n\t break;\n\t }\n\t \n\t $image -> setImageOrientation (\\Imagick::ORIENTATION_TOPLEFT);\n\t \n\t $location = SITE_PATH.'tmp'.DS.$save_name;\n\t\t \n\t\t file_put_contents($location, $image -> getImageBlob());\n\t\t \n\t\t return $location;\n\t \n\t } else {\n\t \n\t \treturn $file;\n\t \n\t }\n\t}", "private function rotate_imagick($imagePath, $orientation)\n {\n $imagick = new Imagick($imagePath);\n $imagick->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n $deg = 0;\n\n switch ($orientation) {\n case 2:\n $deg = 180;\n $imagick->flipImage();\n break;\n\n case 3:\n $deg = -180;\n break;\n\n case 4:\n $deg = -180;\n $imagick->flopImage();\n break;\n\n case 5:\n $deg = -90;\n $imagick->flopImage();\n break;\n\n case 6:\n $deg = 90;\n break;\n\n case 7:\n $deg = -90;\n $imagick->flipImage();\n break;\n\n case 8:\n $deg = -90;\n break;\n }\n $imagick->rotateImage(new ImagickPixel('#00000000'), $deg);\n $imagick->writeImage($imagePath);\n $imagick->clear();\n $imagick->destroy();\n }", "public function test_rotate() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "public function draw(){\n\t\t$this->doOutputResource();\n\t\t$defExt=\"gif\";\n\t\t$ext = ($this->outputFilename && strtolower(substr($this->outputFilename,-3))==\"$defExt\") ? substr($this->outputFilename,-4) :\".$defExt\";\n\t\t$out = $this->outputFilename.$ext;\n\t\tif(!$this->outputFilename){\n\t\t\theader(\"Content-Type: image/gif\");\n\t\t\t$out=null;\n\t\t}\n\t\t$this->outputFilename = $out;\n\t\treturn imagegif($this->outImage,$this->outputFilename);\n\t}", "function rotateImage($width, $height, $rotation, $quality = 8) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1]);\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2]);\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "public function rotate($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$angle = (float) $angle;\n\t\t$bg_color = $this->normalizeColor($bg_color);\n\n\t\tif($bg_color === false) {\n\t\t\ttrigger_error('Rotate failed because background color could not be generated. Try sending an array(RRR, GGG, BBB).', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$working_image = imagerotate($this->image, $angle, imagecolorallocate($this->image, $bg_color[0], $bg_color[1], $bg_color[2]));\n\n\t\tif($working_image) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = imagesx($this->image);\n\t\t\t$this->height = imagesy($this->image);\n\t\t\t$this->aspect = $this->width/$this->height;\n\t\t\tif($this->aspect > 1) {\n\t\t\t\t$this->orientation = 'landscape';\n\t\t\t} else if($this->aspect < 1) {\n\t\t\t\t$this->orientation = 'portrait';\n\t\t\t} else {\n\t\t\t\t$this->orientation = 'square';\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Rotate failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "public function test_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/one-blue-pixel-100x100.png';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 0 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "abstract public function rotate($amount);", "function setRotation( $r ) {\n\n // only 0,90,180,270\n if ( $r > 270 ) return;\n if ( $r % 90 != 0 ) return;\n\n $this->rotate = $r;\n $this->vertical = ( $r == 90 or $r == 270 );\n}", "function image_fix_orientation($path){\n\t\t$exif = exif_read_data($path);\n\n\t\t//fix the Orientation if EXIF data exist\n\t\tif(!empty($exif['Orientation'])) {\n\t\t switch($exif['Orientation']) {\n\t\t case 8:\n\t\t $createdImage = imagerotate($image,90,0);\n\t\t break;\n\t\t case 3:\n\t\t $createdImage = imagerotate($image,180,0);\n\t\t break;\n\t\t case 6:\n\t\t $createdImage = imagerotate($image,-90,0);\n\t\t break;\n\t\t }\n\t\t}\n\t}", "function _rotateImageNETPBM($file, $desfile, $degrees, $imgobj) {\r\n $fileOut = \"$file.1\";\r\n $zoom->platform->copy($file, $fileOut); \r\n if (eregi(\"\\.png\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"pngtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"pnmtopng > $fileOut\" ; \r\n } elseif (eregi(\"\\.(jpg|jpeg)\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"jpegtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmtojpeg -quality=\" . $this->_JPEG_quality . \" > $fileOut\" ;\r\n } elseif (eregi(\"\\.gif\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"giftopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmquant 256 | \" . $this->_NETPBM_path . \"ppmtogif > $fileOut\" ; \r\n } else {\r\n return false;\r\n }\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if ($retval) {\r\n return false;\r\n } else {\r\n $erg = $zoom->platform->rename($fileOut, $desfile); \r\n return true;\r\n }\r\n }", "public function rotate(int $rotations);", "function __rotate(&$tmp, $angle, $color) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "function LoadGif($imgname)\n{\n $im = @imagecreatefromgif($imgname);\n\n /* See if it failed */\n if(!$im)\n {\n /* Create a blank image */\n $im = imagecreatetruecolor (96, 96);\n $bgc = imagecolorallocate ($im, 255, 255, 255);\n $tc = imagecolorallocate ($im, 0, 0, 0);\n\n imagefilledrectangle ($im, 0, 0, 96, 96, $bgc);\n\n /* Output an error message */\n imagestring ($im, 1, 5, 5, 'Mapler.me failed.', $tc);\n imagestring ($im, 1, 5, 20, $imgname, $tc);\n }\n\n return $im;\n}", "function mergereagentandarrow($filename_x, $filename_y, $filename_result) {\n\n list($width_x, $height_x) = getimagesize($filename_x);\n list($width_y, $height_y) = getimagesize($filename_y);\n\n // Create new image with desired dimensions\n\n $image = imagecreatetruecolor($width_y, $height_x + $height_y);\n$white = imagecolorallocate($image, 255, 255, 255);\nimagefill($image, 0, 0, $white);\n\n\n // Load images and then copy to destination image\n\n $image_x = imagecreatefromgif($filename_x);\n $image_y = imagecreatefromgif($filename_y);\n\n imagecopy($image, $image_x, ($width_y-$width_x)/2, 0, 0, 0, $width_x, $height_x);\n imagecopy($image, $image_y, 0, $height_x, 0, 0, $width_y, $height_y);\n\n // Save the resulting image to disk (as JPEG)\n\n imagegif($image, $filename_result);\n\n\n\n\n // Clean up\n\n imagedestroy($image);\n imagedestroy($image_x);\n imagedestroy($image_y);\n\n}", "function rotateBg() {\r\n\tglobal $backgrounds, $bgImage, $i;\r\n\t$c = count($backgrounds);\r\n\tif ($c==0) return;\r\n\t$r = random($c);\r\n\tif ($backgrounds[$r]==''&&$i<10) {\r\n\t\t$i++;\r\n\t\trotateBg();\r\n\t} elseif ($i>=10) {\r\n\t\tif (!$bgImage||$bgImage=='') {\r\n\t\t\t$bgImage='bg_lock.gif';\r\n\t\t} else {\r\n\t\t\t$bgImage=$bgImage;\r\n\t\t}\r\n\t} else {\r\n\t\t$bgImage = $backgrounds[$r];\r\n\t};\r\n\treturn $bgImage;\r\n}", "private function imagerotate($srcImg, $angle, $bgColor, $ignoreTransparent=0) {\n\t\tfunction rotateX($x, $y, $theta) {\n\t\t\treturn $x * cos($theta) - $y * sin($theta);\n\t\t}\n\t\tfunction rotateY($x, $y, $theta) {\n\t\t\treturn $x * sin($theta) + $y * cos($theta);\n\t\t}\n\n\t\t$srcW = imagesx($srcImg);\n\t\t$srcH = imagesy($srcImg);\n\n\t\t// Normalize angle\n\t\t$angle %= 360;\n\n\t\tif ($angle == 0) {\n\t\t\tif ($ignoreTransparent == 0) {\n\t\t\t\timagesavealpha($srcImg, true);\n\t\t\t}\n\t\t\treturn $srcImg;\n\t\t}\n\n\t\t// Convert the angle to radians\n\t\t$theta = deg2rad($angle);\n\n\t\t$minX = $maxX = $minY = $maxY = 0;\n\t\t\n\t\t// Standard case of rotate\n\t\tif ((abs($angle) == 90) || (abs($angle) == 270)) {\n\t\t\t$width = $srcH;\n\t\t\t$height = $srcW;\n\t\t\tif (($angle == 90) || ($angle == -270)) {\n\t\t\t\t$minX = 0;\n\t\t\t\t$maxX = $width;\n\t\t\t\t$minY = -$height+1;\n\t\t\t\t$maxY = 1;\n\t\t\t} else if (($angle == -90) || ($angle == 270)) {\n\t\t\t\t$minX = -$width+1;\n\t\t\t\t$maxX = 1;\n\t\t\t\t$minY = 0;\n\t\t\t\t$maxY = $height;\n\t\t\t}\n\t\t} else if (abs($angle) === 180) {\n\t\t\t$width = $srcW;\n\t\t\t$height = $srcH;\n\t\t\t$minX = -$width+1;\n\t\t\t$maxX = 1;\n\t\t\t$minY = -$height+1;\n\t\t\t$maxY = 1;\n\t\t} else {\n\t\t\t// Calculate the width of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateX(0, 0, 0-$theta),\n\t\t\t\trotateX($srcW, 0, 0-$theta),\n\t\t\t\trotateX(0, $srcH, 0-$theta),\n\t\t\t\trotateX($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minX = floor(min($temp));\n\t\t\t$maxX = ceil(max($temp));\n\t\t\t$width = $maxX - $minX;\n\n\t\t\t// Calculate the height of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateY(0, 0, 0-$theta),\n\t\t\t\trotateY($srcW, 0, 0-$theta),\n\t\t\t\trotateY(0, $srcH, 0-$theta),\n\t\t\t\trotateY($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minY = floor(min($temp));\n\t\t\t$maxY = ceil(max($temp));\n\t\t\t$height = $maxY - $minY;\n\t\t}\n\n\t\t$destImg = imagecreatetruecolor($width, $height);\n\t\tif ($ignoreTransparent == 0) {\n\t\t\timagefill($destImg, 0, 0, imagecolorallocatealpha($destImg, 255,255, 255, 127));\n\t\t\timagesavealpha($destImg, true);\n\t\t}\n\n\t\t// Sets all pixels in the new image\n\t\tfor ($x = $minX; $x < $maxX; $x++) {\n\t\t\tfor ($y = $minY; $y < $maxY; $y++) {\n\t\t\t\t// Fetch corresponding pixel from the source image\n\t\t\t\t$srcX = round(rotateX($x, $y, $theta));\n\t\t\t\t$srcY = round(rotateY($x, $y, $theta));\n\t\t\t\tif ($srcX >= 0 && $srcX < $srcW && $srcY >= 0 && $srcY < $srcH) {\n\t\t\t\t\t$color = imagecolorat($srcImg, $srcX, $srcY);\n\t\t\t\t} else {\n\t\t\t\t\t$color = $bgColor;\n\t\t\t\t}\n\t\t\t\timagesetpixel($destImg, $x-$minX, $y-$minY, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $destImg;\n\t}", "public function rotate($sourceImg, $angleDegrees) {\n\n $angle = (int)$angleDegrees;\n if(! $angle || ! abs($angle) % 360) {\n return $sourceImg;\n }\n $width = imagesx($sourceImg);\n $height = imagesy($sourceImg);\n \n /**\n * First create a new image that is large enough to hold the original image at any rotation angle.\n */\n $max = hypot($width, $height);\n $img = $this->_createImage($max, $max);\n if(false === $img) {\n return false;\n }\n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img);\n \n /**\n * Copy the original image centered on the new image.\n */\n if(false === $this->_copyCentered($img, $sourceImg)) {\n return false;\n }\n \n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img, $debugIndex);\n \n /**\n * Rotate the new image.\n * \n * NOTICE: negative angles to apply clock-wise rotation.\n */\n $rotatedImg = imagerotate($img, $angle, imagecolorallocatealpha($sourceImg, 0, 0, 0, 127));\n if(false === $rotatedImg) {\n return false;\n }\n \n /**\n * DEBUG\n * $debugIndex = $this->_debugWriteToFile($rotatedImg, $debugIndex);\n */\n \n /**\n * Create an image having having dimensions to fully contain the rotated image at the specified angle.\n */\n $rad = deg2rad($angle);\n $x = $height * abs(sin($rad)) + $width * abs(cos($rad));\n $y = $height * abs(cos($rad)) + $width * abs(sin($rad));\n $finalImg = $this->_createImage($x, $y);\n if(false === $finalImg) {\n return false;\n }\n $res = imagecopy(\n $finalImg, \n $rotatedImg, \n 0, \n 0, \n (imagesx($rotatedImg) - $x) / 2,\n (imagesy($rotatedImg) - $y) / 2,\n $x,\n $y);\n if(false === $res) {\n return false;\n }\n /**\n * DEBUG\n * $this->_debugWriteToFile($finalImg, $debugIndex);\n */\n return $finalImg;\n }", "public function showImage()\n {\n $gif = new AnimatedGif($this->frames, $this->delays, $this->loops);\n $gif->display();\n }", "function GetAnimation() {\n return ($this->GIF);\n }", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "function fix_orientation($fileandpath) { if(!file_exists($fileandpath))\n return false;\n try {\n @$exif = read_exif_data($fileandpath, 'IFD0');\n }\n catch (Exception $exp) {\n $exif = false;\n }\n // Get all the exif data from the file\n // If we dont get any exif data at all, then we may as well stop now\n if(!$exif || !is_array($exif))\n return false;\n\n // I hate case juggling, so we're using loweercase throughout just in case\n $exif = array_change_key_case($exif, CASE_LOWER);\n\n // If theres no orientation key, then we can give up, the camera hasn't told us the\n // orientation of itself when taking the image, and i'm not writing a script to guess at it!\n if(!array_key_exists('orientation', $exif))\n return false;\n\n // Gets the GD image resource for loaded image\n $img_res = $this->get_image_resource($fileandpath);\n\n // If it failed to load a resource, give up\n if(is_null($img_res))\n return false;\n\n // The meat of the script really, the orientation is supplied as an integer,\n // so we just rotate/flip it back to the correct orientation based on what we\n // are told it currently is\n\n switch($exif['orientation']) {\n\n // Standard/Normal Orientation (no need to do anything, we'll return true as in theory, it was successful)\n case 1: return true; break;\n\n // Correct orientation, but flipped on the horizontal axis (might do it at some point in the future)\n case 2:\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Upside-Down\n case 3:\n $final_img = $this->imageflip($img_res, IMG_FLIP_VERTICAL);\n break;\n\n // Upside-Down & Flipped along horizontal axis\n case 4:\n $final_img = $this->imageflip($img_res, IMG_FLIP_BOTH);\n break;\n\n // Turned 90 deg to the left and flipped\n case 5:\n $final_img = imagerotate($img_res, -90, 0);\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the left\n case 6:\n $final_img = imagerotate($img_res, -90, 0);\n break;\n\n // Turned 90 deg to the right and flipped\n case 7:\n $final_img = imagerotate($img_res, 90, 0);\n $final_img = $this->imageflip($img_res,IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the right\n case 8:\n $final_img = imagerotate($img_res, 90, 0);\n break;\n\n }\n if(!isset($final_img))\n return false;\n if (!is_writable($fileandpath)) {\n chmod($fileandpath, 0777);\n }\n unlink($fileandpath);\n\n // Save it and the return the result (true or false)\n $done = $this->save_image_resource($final_img,$fileandpath);\n\n return $done;\n }", "public function outputAsJPG(){\n header('Content-Type: image/jpeg');\n\t\theader (\"Cache-Control: must-revalidate\");\n\t\t$offset = 7 * 24 * 60 * 60;//expires one week\n\t\t$expire = \"Expires: \" . gmdate (\"D, d M Y H:i:s\", time() + $offset) . \" GMT\";\n\t\theader ($expire);\n imagejpeg($this->gd_image);\n }", "public function rotate($value='random', $bgColor='ffffff')\n\t{\n\t\t$this->checkImage();\n\t\tif ($value == 'random') {\n\t\t\t$value = mt_rand(-6, 6);\n\t\t} else {\n\t\t\t$value = max(-360, min($value, 360));\n\t\t}\n\t\tif ($value < 0) {\n\t\t\t$value = 360 + $value;\n\t\t}\n\n\t\tif ($bgColor == 'alpha' && function_exists('imagerotate')) {\n\t\t\t// Experimental. GD2 imagerotate seems to be quite buggy with alpha transparency.\n\t\t\timagealphablending($this->imageResized, false);\n\t\t\t$color = imagecolorallocatealpha($this->imageResized, 255, 255, 255, 127);\n\t\t\timagecolortransparent($this->imageResized, $color);\n\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t} else {\n\t\t\t$bgColor = str_replace('#', '', strtoupper(trim($bgColor)));\n\t\t\t$color = hexdec($bgColor);\n\t\t\tif (function_exists('imagerotate')) {\n\t\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\t} else {\n\t\t\t\t$this->imageResized = $this->imagerotate($this->imageResized, $value, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function GIFEncoder($GIF_src, $GIF_dly, $GIF_lop, $GIF_dis, $GIF_red, $GIF_grn, $GIF_blu, $GIF_mod) {\n if (!is_array($GIF_src) && !is_array($GIF_tim)) {\n printf(\"%s: %s\", $this->VER, $this->ERR['ERR00']);\n exit(0);\n }\n $this->LOP = ($GIF_lop > - 1) ? $GIF_lop : 0;\n $this->DIS = ($GIF_dis > - 1) ? (($GIF_dis < 3) ? $GIF_dis : 3) : 2;\n $this->COL = ($GIF_red > - 1 && $GIF_grn > - 1 && $GIF_blu > - 1) ? ($GIF_red | ($GIF_grn << 8) | ($GIF_blu << 16)) : -1;\n \n for ($i = 0;$i < count($GIF_src);$i++) {\n if (strToLower($GIF_mod) == \"url\") {\n $this->BUF[] = fread(fopen($GIF_src[$i], \"rb\") , filesize($GIF_src[$i]));\n } else if (strToLower($GIF_mod) == \"bin\") {\n $this->BUF[] = $GIF_src[$i];\n } else {\n printf(\"%s: %s ( %s )!\", $this->VER, $this->ERR['ERR02'], $GIF_mod);\n exit(0);\n }\n if (substr($this->BUF[$i], 0, 6) != \"GIF87a\" && substr($this->BUF[$i], 0, 6) != \"GIF89a\") {\n printf(\"%s: %d %s\", $this->VER, $i, $this->ERR['ERR01']);\n exit(0);\n }\n for ($j = (13 + 3 * (2 << (ord($this->BUF[$i] {\n 10\n }) & 0x07))) , $k = TRUE;$k;$j++) {\n switch ($this->BUF[$i] {\n $j\n }) {\n case \"!\":\n if ((substr($this->BUF[$i], ($j + 3) , 8)) == \"NETSCAPE\") {\n printf(\"%s: %s ( %s source )!\", $this->VER, $this->ERR['ERR03'], ($i + 1));\n exit(0);\n }\n break;\n case \";\":\n $k = FALSE;\n break;\n }\n }\n }\n GIFEncoder::GIFAddHeader();\n for ($i = 0;$i < count($this->BUF);$i++) {\n GIFEncoder::GIFAddFrames($i, $GIF_dly[$i]);\n }\n GIFEncoder::GIFAddFooter();\n }", "function fixImageOrientation($filename) \n{\n\t$exif = @exif_read_data($filename);\n\t \n\tif($exif) \n\t{ \n\t\t//fix the Orientation if EXIF data exists\n\t\tif(!empty($exif['Orientation'])) \n\t\t{\n\t\t\tswitch($exif['Orientation']) \n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t$createdImage = imagerotate($filename,180,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t$createdImage = imagerotate($filename,-90,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t$createdImage = imagerotate($filename,90,0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} \n}", "public function getRotateControl()\n {\n return $this->rotateControl;\n }", "public function rotate($degrees);", "public function rotateLeft();", "protected function fix_image_orientation( $filename, $filecontent ) {\r\n\t\t\t$data = exif_read_data( $filename );\r\n\t\t\tif ( !empty( $data['Orientation'] ) ) {\r\n\t\t\t\tswitch( $data['Orientation'] ) {\r\n\t\t\t\t\tcase 3: { $newAngle = 180; } break;\r\n\t\t\t\t\tcase 6: { $newAngle = -90; } break;\r\n\t\t\t\t\tcase 8: { $newAngle = 90; } break;\r\n\t\t\t\t\tdefault: $newAngle = false;\r\n\t\t\t\t}\r\n\t\t\t\tif ( $newAngle ) {\r\n\t\t\t\t\t$image = imagecreatefromstring( $filecontent );\r\n\t\t\t\t\t$image = imagerotate( $image, $newAngle, 0 );\r\n\t\t\t\t\t$this->save_image( $image, $filename );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function random(): GifData;", "private function get_gif_header()\n {\n $this->p_forward(10);\n if ($this->readbits($mybyte = $this->readbyte_int(), 0, 1) === 1) {\n $this->p_forward(2);\n $this->p_forward(pow(2, $this->readbits($mybyte, 5, 3) + 1) * 3);\n } else {\n $this->p_forward(2);\n }\n\n $this->imageinfo['gifheader'] = $this->datapart(0, $this->pointer);\n if ($this->decoding) {\n $this->orgvars['gifheader'] = $this->imageinfo['gifheader'];\n $this->imgWidth = ord($this->orgvars['gifheader'][7]) * 256 + ord($this->orgvars['gifheader'][6]);\n $this->imgHeight = ord($this->orgvars['gifheader'][9]) * 256 + ord($this->orgvars['gifheader'][8]);\n $this->orgvars['background_color'] = $this->orgvars['gifheader'][11];\n }\n\n }", "function GIFAddFooter() {\n $this->GIF.= \";\";\n }", "public function rotateRight();", "public function toGDImage() {}", "public function test_remove_orientation_data_on_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/test-image-upside-down.jpg';\n\t\t$data = wp_read_image_metadata( $file );\n\n\t\t// The orientation value 3 is equivalent to rotated upside down (180 degrees).\n\t\t$this->assertSame( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );\n\n\t\t$temp_file = wp_tempnam( $file );\n\t\t$image = wp_get_image_editor( $file );\n\n\t\t// Test a value that would not lead back to 1, as WP is resetting the value to 1 manually.\n\t\t$image->rotate( 90 );\n\t\t$ret = $image->save( $temp_file, 'image/jpeg' );\n\n\t\t$data = wp_read_image_metadata( $ret['path'] );\n\n\t\t// Make sure the image is no longer in The Upside Down Exif orientation.\n\t\t$this->assertSame( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );\n\n\t\t// Remove both the generated file ending in .tmp and tmp.jpg due to wp_tempnam().\n\t\tunlink( $temp_file );\n\t\tunlink( $ret['path'] );\n\t}", "public function rutaImageFly()\n {\n\n // primero vemos a que galeria pertenece\n $galeria = ORM::factory( 'Galeria', $this->galeria );\n\n return( $galeria->rutaImageFly().$this->imagen );\n\n }", "public function createImage2(){\n $this->createCircle(100, 100, 50, 50, 0, 360);\n $this->createCircle(400, 100, 50, 50, 0, 360);\n $this->createCircle(110, 200, 50, 50, 0, 360);\n $this->createCircle(250, 300, 50, 50, 0, 360);\n $this->createCircle(390, 200, 50, 50, 0, 360);\n $this->createLine(125, 100, 375, 100);\n $this->createLine(100, 125, 100, 175);\n $this->createLine(400, 125, 400, 175);\n $this->createLine(125, 220, 225, 300);\n $this->createLine(275, 300, 375, 220);\n $this->generateImage();\n }", "function playerPortraitCreate ($base, $player)\r\n{\r\n list($width_orig, $height_orig) = getimagesize($base);\r\n list($width_orig2, $height_orig2) = getimagesize($player);\r\n \r\n // Calculando a proporção\r\n $ratio_orig = $width_orig / $height_orig;\r\n $ratio_orig2 = $width_orig2 / $height_orig2;\r\n /// Largura e altura máximos (máximo, pois como é proporcional, o resultado varia)\r\n // No caso da pergunta, basta usar $_GET['width'] e $_GET['height'], ou só\r\n // $_GET['width'] e adaptar a fórmula de proporção abaixo.\r\n $width = 500;\r\n $height = 500;\r\n $width2 = 100;\r\n $height2 = 100;\r\n if ($width / $height > $ratio_orig) {\r\n $width = $height * $ratio_orig;\r\n } else {\r\n $height = $width / $ratio_orig;\r\n }\r\n if ($width2 / $height2 > $ratio_orig2) {\r\n $width2 = $height2 * $ratio_orig2;\r\n } else {\r\n $height2 = $width2 / $ratio_orig2;\r\n }\r\n // O resize propriamente dito. Na verdade, estamos gerando uma nova imagem.\r\n $extension = explode(\".\", $base);\r\n $extension = $extension[count($extension) - 1];\r\n $image_p = imagecreatetruecolor($width, $height);\r\n $image = NULL;\r\n if ($extension == \"jpg\" || $extension == \"jpeg\") {\r\n $image = imagecreatefromjpeg($base);\r\n } elseif ($extension == \"gif\") {\r\n $image = imagecreatefromgif($base);\r\n } elseif ($extension == \"png\") {\r\n $image = imagecreatefrompng($base);\r\n }\r\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\r\n \r\n $image_player = imagecreatetruecolor($width2, $height2);\r\n $marcadagua = imagecreatefromgif($player);\r\n setTransparency($image_player, $marcadagua);\r\n imagecopyresized($image_player, $marcadagua, 0, 0, 0, 0, $width2, $height2, $width_orig2, $height_orig2);\r\n// imagedestroy($marcadagua);\r\n \r\n //pega o tamanho da imagem principal\r\n $dwidth = imagesx($image_p);\r\n $dheight = imagesy($image_p);\r\n \r\n //pega o tamanho da imagem que vai ser centralizada\r\n $mwidth = imagesx($image_player);\r\n $mheight = imagesy($image_player);\r\n //Calcula a x e y posição pra colocar a imagem no centro da outra\r\n //A função round arredonda os valores\r\n $xPos = round(($dwidth - $mwidth) / 2 - 40);\r\n $yPos = round(($dheight - $mheight) / 2 - 40);\r\n imagecopymerge($image_p, $image_player, $xPos, $yPos, 0, 0, $mwidth, $mheight, 100);\r\n// imagedestroy($image_player);\r\n// imagecopyresampled($image_p, $image_player, $xPos, $yPos, 0, 0, $mwidth, $mheight, 100,100);\r\n return $image_p;\r\n}", "function loading_page_gifs_replacement_patch()\n{\n\t$opt = get_option('loading_page_options', array());\n\tif(\n\t\t!empty($opt) &&\n\t\t!empty($opt['lp_ls']) &&\n\t\t!empty($opt['lp_ls']['logo']) &&\n\t\t!empty($opt['lp_ls']['logo']['image'])\n\t)\n\t{\n\t\t$path = $opt['lp_ls']['logo']['image'];\n\t\t// Only to solve an issue with the previous version of the plugin when where used .gif\n\t\t$path = preg_replace('/\\/loading\\-screens\\/logo\\/gifs\\/(\\d+)\\.gif/i', '/loading-screens/logo/images/$1.svg', $path);\n\t\t$opt['lp_ls']['logo']['image'] = $path;\n\t\tupdate_option('loading_page_options', $opt);\n\t}\n}", "public function rotation($value) {\n return $this->setProperty('rotation', $value);\n }", "public function rotateFlipImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "function writeGifData() {\n header(\"Content-Type: image/gif\");\n header(\"Cache-Control: \" .\n \"private, no-cache, no-cache=Set-Cookie, proxy-revalidate\");\n header(\"Pragma: no-cache\");\n header(\"Expires: Wed, 17 Sep 1975 21:32:10 GMT\");\n echo join($GLOBALS['GIF_DATA']);\n }", "abstract protected function initRotues();", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "function rotateImage($file, $desfile, $degrees, $imgobj) {\r\n $degrees = intval($degrees);\r\n switch ($this->_conversiontype){\r\n //Imagemagick\r\n case 1:\r\n if($this->_rotateImageIM($file, $desfile, $degrees))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //NetPBM\r\n case 2:\r\n if($this->_rotateImageNETPBM($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD1\r\n case 3:\r\n if($this->_rotateImageGD1($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD2\r\n case 4:\r\n if($this->_rotateImageGD2($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n }\r\n return true;\r\n }", "function rotate(&$tmp, $angle, $color=null) {\r\r\n\t\t\r\r\n\t\t// color ?\r\r\n\t\t//\r\r\n\t\tif (!is_a($color, 'Asido_Color')) {\r\r\n\t\t\t$color = new Asido_Color;\r\r\n\t\t\t$color->set(255, 255, 255);\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\treturn $this->__rotate($tmp, $angle, $color);\r\r\n\t\t}", "function frameImage($inside = 0, $imagesPath = array(), $imgHeight = 600, $imagesWidth = array(), $imagesAngles = array(), $poleColor = null, $poleWidth = 1, $poleHeight = 1)\n{ \n $rowImagick = new Imagick();\n \n foreach($imagesPath as $imgIndex => $imgPath) {\n $imagick = new Imagick(realpath($imgPath));\n\n $imagick->getImageGeometry();\n $imgGeo = $imagick->getImageGeometry();\n $imgOrgWidth = $imgGeo['width'];\n $imgOrgHeight = $imgGeo['height'];\n $imgWidth = $imagesWidth[$imgIndex];\n\n if(isset($imagesAngles[$imgIndex])) {\n $angleX = ($imagesAngles[$imgIndex]) == 90 ? - ($imagesAngles[$imgIndex] - 10) : - $imagesAngles[$imgIndex];\n } else {\n $angleX = -100;\n }\n $angleY = 0;\n $thetX = deg2rad ($angleX);\n $thetY = deg2rad ($angleY);\n\n $s_x1y1 = array(0, 0); // LEFT BOTTOM\n $s_x2y1 = array($imgWidth, 0); // RIGHT BOTTOM\n $s_x1y2 = array(0, $imgHeight); // LEFT TOP\n $s_x2y2 = array($imgWidth, $imgHeight); // RIGHT TOP\n\n $d_x1y1 = array(\n $s_x1y1[0] * cos($thetX) - $s_x1y1[1] * sin($thetY),\n $s_x1y1[0] * sin($thetX) + $s_x1y1[1] * cos($thetY)\n );\n $d_x2y1 = array(\n $s_x2y1[0] * cos($thetX) - $s_x2y1[1] * sin($thetY),\n $s_x2y1[0] * sin($thetX) + $s_x2y1[1] * cos($thetY)\n );\n $d_x1y2 = array(\n $s_x1y2[0] * cos($thetX) - $s_x1y2[1] * sin($thetY),\n $s_x1y2[0] * sin($thetX) + $s_x1y2[1] * cos($thetY)\n );\n $d_x2y2 = array(\n $s_x2y2[0] * cos($thetX) - $s_x2y2[1] * sin($thetY),\n $s_x2y2[0] * sin($thetX) + $s_x2y2[1] * cos($thetY)\n );\n\n $imageprops = $imagick->getImageGeometry();\n $imagick->setImageBackgroundColor(new ImagickPixel('transparent'));\n $imagick->resizeimage($imgWidth, $imgHeight, \\Imagick::FILTER_LANCZOS, 0, true); \n if($poleColor) {\n $imagick->borderImage($poleColor, $poleWidth, $poleHeight);\n }\n\n $points = array(\n $s_x1y2[0], $s_x1y2[1], # Source Top Left\n $d_x1y2[0], $d_x1y2[1], # Destination Top Left\n $s_x1y1[0], $s_x1y1[1], # Source Bottom Left \n $d_x1y1[0], $d_x1y1[1], # Destination Bottom Left \n $s_x2y1[0], $s_x2y1[1], # Source Bottom Right \n $d_x2y1[0], $d_x2y1[1], # Destination Bottom Right \n $s_x2y2[0], $s_x2y2[1], # Source Top Right \n $d_x2y2[0], $d_x2y2[1] # Destination Top Right \n );\n //echo '<pre>'; print_r($points); die;\n\n $imagick->setImageVirtualPixelMethod(\\Imagick::VIRTUALPIXELMETHOD_BACKGROUND);\n $imagick->distortImage(\\Imagick::DISTORTION_PERSPECTIVE, $points, true);\n //$imagick->scaleImage($imgWidth, $imgHeight, false);\n $rowImagick->addImage($imagick); \n }\n\n $rowImagick->resetIterator();\n $combinedRow = $rowImagick->appendImages(false);\n\n $canvas = generateFinalImage($combinedRow);\n header(\"Content-Type: image/png\");\n echo $canvas->getImageBlob();\n}", "public function rotate($theta_)\n\t{\n\t\t$x = $this->x*cos($theta_) - $this->y*sin($theta_);\n\t\t$y = $this->x*sin($theta_) + $this->y*cos($theta_);\n\t\t\n\t\t$this->setX($x);\n\t\t$this->setY($y);\n\t}", "function GIFAddHeader() {\n $cmap = 0;\n \n if (ord($this->BUF[0] {\n 10\n }) & 0x80) {\n $cmap = 3 * (2 << (ord($this->BUF[0] {\n 10\n }) & 0x07));\n \n $this->GIF.= substr($this->BUF[0], 6, 7);\n $this->GIF.= substr($this->BUF[0], 13, $cmap);\n $this->GIF.= \"!\\377\\13NETSCAPE2.0\\3\\1\" . GIFEncoder::GIFWord($this->LOP) . \"\\0\";\n }\n }", "function imgrace($id)\n{\nif ($id == 1)\n{\necho \"<img src=\\\"images/races/1-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 2)\n{\necho \"<img src=\\\"images/races/2-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 3)\n{\necho \"<img src=\\\"images/races/3-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 4)\n{\necho \"<img src=\\\"images/races/4-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 5)\n{\necho \"<img src=\\\"images/races/5-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 6)\n{\necho \"<img src=\\\"images/races/6-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 7)\n{\necho \"<img src=\\\"images/races/7-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 8)\n{\necho \"<img src=\\\"images/races/8-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 9)\n{\necho \"<img src=\\\"images/races/9-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 10)\n{\necho \"<img src=\\\"images/races/10-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 11)\n{\necho \"<img src=\\\"images/races/11-0.gif\\\" alt=\\\"\\\">\";\n}\n}", "function _rotateImageIM($file, $desfile, $degrees) {\r\n $cmd = $this->_IM_path.\"convert -rotate $degrees \\\"$file\\\" \\\"$desfile\\\"\";\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function rotateClockwise($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\t$angle = 0 - (float) $angle;\n\t\treturn $this->rotate($angle, $bg_color);\n\t}" ]
[ "0.65460527", "0.6533886", "0.6475705", "0.6451623", "0.64404666", "0.6186443", "0.6150605", "0.61073315", "0.608577", "0.608577", "0.6081208", "0.6020371", "0.6007515", "0.5999949", "0.5995706", "0.5992648", "0.59853005", "0.5984262", "0.59477067", "0.59476906", "0.592948", "0.592208", "0.5893318", "0.58636606", "0.58195233", "0.5812594", "0.5792135", "0.57819974", "0.5748408", "0.57278043", "0.5717439", "0.5700557", "0.5661993", "0.5621222", "0.560509", "0.55927974", "0.55898386", "0.5588559", "0.5519436", "0.5516693", "0.55140704", "0.550772", "0.54718006", "0.54418486", "0.5361343", "0.5354333", "0.5351842", "0.5325103", "0.5317099", "0.52758354", "0.52743024", "0.5255329", "0.5213695", "0.52112854", "0.5151828", "0.51501775", "0.51316905", "0.51218647", "0.5121118", "0.51035297", "0.50837034", "0.50802976", "0.49918973", "0.49855575", "0.49677318", "0.4961279", "0.49390277", "0.493126", "0.4896913", "0.48819765", "0.48603526", "0.48373544", "0.4819638", "0.48114792", "0.48051226", "0.47728094", "0.47694257", "0.47693792", "0.47667512", "0.47618255", "0.47257823", "0.47094682", "0.4697867", "0.46978533", "0.4696397", "0.4694031", "0.4675389", "0.46750602", "0.46743464", "0.4667287", "0.4667287", "0.4667287", "0.46483472", "0.46467856", "0.46442962", "0.46438625", "0.46428373", "0.46355808", "0.46252692", "0.4598883" ]
0.684556
0
Rotate the jpg with GD.
private function rotate_jpg_with_gd($path, $orientation) { $image = $this->rotate_gd(imagecreatefromjpeg($path), $orientation); imagejpeg($image, $path, 100); imagedestroy($image); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function image_rotate_gd()\n\t{\n\t\t// Create the image handle\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Set the background color\n\t\t// This won't work with transparent PNG files so we are\n\t\t// going to have to figure out how to determine the color\n\t\t// of the alpha channel in a future release.\n\n\t\t$white = imagecolorallocate($src_img, 255, 255, 255);\n\n\t\t// Rotate it!\n\t\t$dst_img = imagerotate($src_img, $this->rotation_angle, $white);\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($dst_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($dst_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($dst_img);\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function _rotateImageGD2($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($file);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n } else {\r\n \t$src_img = @imagecreatefromgif($file);\r\n \t$dst_img = imagecreatetruecolor($imgobj->_size[0],$imgobj->_size[1]);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = imagefill($dst_img, 0, 0, $img_white);\r\n\t\t\timagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imgobj->_size[0], $imgobj->_size[1], $imgobj->_size[0], $imgobj->_size[1]);\r\n\t\t\t$src_img = $dst_img;\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $desfile);\r\n } else {\r\n \timagegif($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function _rotateImageGD1($file, $desfile, $degrees, $imgobj) {\r\n // GD can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($file);\r\n } else {\r\n $src_img = imagecreatefrompng($file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n // The rotation routine...\r\n $dst_img = imagerotate($src_img, $degrees, 0);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $desfile, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $desfile);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function rotate($img_name,$rotated_image,$direction){\n\t\t$image = $img_name;\n\t\t$extParts=explode(\".\",$image);\n\t\t$ext=end($extParts);\n\t\t$filename=$rotated_image;\n\t\t//How many degrees you wish to rotate\n\t\t$degrees = 0;\n\t\tif($direction=='R'){\n\t\t\t$degrees = 90;\n\t\t}\n\t\tif($direction=='L'){\n\t\t\t$degrees = -90;\n\t\t}\n\t\t\n\t\tif($ext==\"jpg\" || $ext== \"jpeg\" || $ext==\"JPG\" || $ext== \"JPEG\"){\n\t\t\t$source = imagecreatefromjpeg($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagejpeg($rotate,$filename) ;\n\t\t}\n\t\t\n\t\t\n\t\tif($ext==\"GIF\" || $ext== \"gif\"){\n\t\t\t$source = imagecreatefromgif($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagegif($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\t\n\t\tif($ext==\"png\" || $ext== \"PNG\"){\n\t\t\t$source = imagecreatefrompng($image) ;\n\t\t\t$rotate = imagerotate($source, $degrees, 0) ;\n\t\t\timagepng($rotate,$filename) ;\n\t\t\t\n\t\t}\n\t\treturn $rotate;\t\n\t\t\n\t}", "function image_rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\t\n\t\n\t\t\tif ($this->rotation == '' OR ! in_array($this->rotation, $degs))\n\t\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\t\t\t\n\t\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Reassign the width and height\n\t\t/** -------------------------------------*/\n\t\n\t\tif ($this->rotation == 90 OR $this->rotation == 270)\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_height;\n\t\t\t$this->dst_height\t= $this->src_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->dst_width\t= $this->src_width;\n\t\t\t$this->dst_height\t= $this->src_height;\n\t\t}\n\t\n\t\t/** -------------------------------------\n\t\t/** Choose resizing function\n\t\t/** -------------------------------------*/\n\t\t\n\t\tif ($this->resize_protocol == 'imagemagick' OR $this->resize_protocol == 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\t\t\n \t\tif ($this->rotation == 'hor' OR $this->rotation == 'vrt')\n \t\t{\n\t\t\treturn $this->image_mirror_gd();\n \t\t}\n\t\telse\n\t\t{\t\t\n\t\t\treturn $this->image_rotate_gd();\n\t\t}\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n{\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n}", "function rotateImage0($img, $imgPath, $suffix, $degrees, $quality, $save)\n{\n // Open the original image.\n $original = imagecreatefromjpeg(\"$imgPath/$img\") or die(\"Error Opening original\");\n list($width, $height, $type, $attr) = getimagesize(\"$imgPath/$img\");\n \n // Resample the image.\n $tempImg = imagecreatetruecolor($width, $height) or die(\"Cant create temp image\");\n imagecopyresized($tempImg, $original, 0, 0, 0, 0, $width, $height, $width, $height) or die(\"Cant resize copy\");\n \n // Rotate the image.\n $rotate = imagerotate($original, $degrees, 0);\n \n // Save.\n if($save)\n {\n // Create the new file name.\n $newNameE = explode(\".\", $img);\n $newName = ''. $newNameE[0] .''. $suffix .'.'. $newNameE[1] .'';\n \n // Save the image.\n imagejpeg($rotate, \"$imgPath/$newName\", $quality) or die(\"Cant save image\");\n }\n \n // Clean up.\n imagedestroy($original);\n imagedestroy($tempImg);\n return true;\n}", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not rotate image.');\n }\n\n // The rotation routine...\n $dst_img = imagerotate($src_img, $degrees, 0);\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "function rotateImage($param=array())\r\n {\r\n $img = isset($param['src']) ? $param['src'] : false;\r\n $newname= isset($param['newname']) ? $param['newname'] : $img;\r\n $degrees= isset($param['deg']) ? $param['deg'] : false;\r\n $out = false;\r\n \r\n if($img)\r\n {\r\n \r\n switch(exif_imagetype($img)){\r\n \tcase 1:\r\n \t\t//gif\r\n \t\t$destimg = imagecreatefromgif($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagegif($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 2:\r\n \t\t//jpg\r\n \t\t$destimg = imagecreatefromjpeg($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagejpeg($rotatedImage, $newname);\r\n \tbreak;\r\n \tcase 3:\r\n \t\t//png\r\n \t\t$destimg = imagecreatefrompng($img);\r\n \t\t$transColor = imagecolorallocatealpha($destimg, 255, 255, 255, 127);\r\n \t\t$rotatedImage = imagerotate($destimg, $degrees, $transColor);\r\n \t\timagesavealpha($rotatedImage, true);\r\n \t\timagepng($rotatedImage, $newname);\r\n \tbreak;\r\n }\r\n \r\n $out = $img;\r\n }\r\n \r\n return $out;\r\n }", "function acadp_exif_rotate( $file ){\n\n\tif( ! function_exists( 'exif_read_data' ) ) {\n\t\treturn $file;\n\t}\n\n\t$exif = @exif_read_data( $file['tmp_name'] );\n\t$exif_orient = isset( $exif['Orientation'] ) ? $exif['Orientation'] : 0;\n\t$rotate_image = 0;\n\n\tif( 6 == $exif_orient ) {\n\t\t$rotate_image = 90;\n\t} else if ( 3 == $exif_orient ) {\n\t\t$rotate_image = 180;\n\t} else if ( 8 == $exif_orient ) {\n\t\t$rotate_image = 270;\n\t}\n\n\tif( $rotate_image ) {\n\n\t\tif( class_exists( 'Imagick' ) ) {\n\n\t\t\t$imagick = new Imagick();\n\t\t\t$imagick_pixel = new ImagickPixel();\n\t\t\t$imagick->readImage( $file['tmp_name'] );\n\t\t\t$imagick->rotateImage( $imagick_pixel, $rotate_image );\n\t\t\t$imagick->setImageOrientation( 1 );\n\t\t\t$imagick->writeImage( $file['tmp_name'] );\n\t\t\t$imagick->clear();\n\t\t\t$imagick->destroy();\n\n\t\t} else {\n\n\t\t\t$rotate_image = -$rotate_image;\n\n\t\t\tswitch( $file['type'] ) {\n\t\t\t\tcase 'image/jpeg' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromjpeg' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromjpeg( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagejpeg( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png' :\n\t\t\t\t\tif( function_exists( 'imagecreatefrompng' ) ) {\n\t\t\t\t\t\t$source = imagecreatefrompng( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagepng( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif' :\n\t\t\t\t\tif( function_exists( 'imagecreatefromgif' ) ) {\n\t\t\t\t\t\t$source = imagecreatefromgif( $file['tmp_name'] );\n\t\t\t\t\t\t$rotate = imagerotate( $source, $rotate_image, 0 );\n\t\t\t\t\t\timagegif( $rotate, $file['tmp_name'] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn $file;\n\n}", "public static function rotate($baseURL, $name, $image)\r\n {\r\n $exif = exif_read_data($image);\r\n\r\n if (array_key_exists('Orientation', $exif))\r\n {\r\n $jpg = imagecreatefromjpeg($image);\r\n $orientation = $exif['Orientation'];\r\n switch ($orientation)\r\n {\r\n case 3:\r\n $jpg = imagerotate($jpg, 180, 0);\r\n break;\r\n case 6:\r\n $jpg = imagerotate($jpg, -90, 0);\r\n break;\r\n case 8:\r\n $jpg = imagerotate($jpg, 90, 0);\r\n break;\r\n default: \t\r\n }\r\n imagejpeg($jpg, $baseURL.'computed/'.$name, 90);\r\n }\r\n\t\t else\r\n\t\t {\r\n\t\t\t copy($image, $baseURL.'computed/'.$name);\r\n\t\t }\r\n }", "function RotatedImage($file,$x,$y,$w,$h,$bln_rotate)\n\t{\n\t $img_size= getimagesize($file);\n\t \n\t $aspect_y=$h/$img_size[1];\n\t $aspect_x=$w/$img_size[0];\n\t \n\t if ($bln_rotate==1){\n\t\t //Check to see if the image fits better at 90 degrees\n\t\t $aspect_y2=$w/$img_size[1];\n\t\t $aspect_x2=$h/$img_size[0];\n\t\t \n\t\t if($aspect_x<$aspect_y)\n\t\t {\n\t\t \t$aspect1=$aspect_x;\n\t\t }\n\t\t else {\n\t\t \t$aspect1=$aspect_y;\n\t\t }\n\t\t \n\t\t if($aspect_x2<$aspect_y2)\n\t\t {\n\t\t \t$aspect2=$aspect_x2;\n\t\t }\n\t\t else {\n\t\t \t$aspect2=$aspect_y2;\n\t\t }\n\t\t \n\t\t if ($aspect1<$aspect2)\n\t\t {\n\t\t \t$angle=90;\n\t\t \t$y=$y+$h;\n\t\t \t$t=$h;\n\t\t \t$h=$w;\n\t\t \t$w=$t;\n\t\t \t$aspect_y=$aspect_y2;\n\t\t \t$aspect_x=$aspect_x2;\n\t\t }\n\t }\n\t \n\t \n\t \n\t \n\t \tif ($aspect_x>$aspect_y){\n\t \t\t$flt_adjust=$aspect_y;\n\t \t\t$w=$flt_adjust*$img_size[0];\n\t \t\t\n\t \t}\n\t \telse{\n\t \t\t$flt_adjust=$aspect_x;\n\t \t\t$h=$flt_adjust*$img_size[1];\n\t \t}\n\t \n\t \t\n\t \t\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h,'JPG');\n\t $this->Rotate(0);\n\t}", "private function rotate_gd($image, $orientation)\n {\n switch ($orientation) {\n case 2:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 3:\n $image = imagerotate($image, 180, 0);\n break;\n\n case 4:\n $image = imagerotate($image, 180, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 5:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_HORIZONTAL);\n break;\n\n case 6:\n $image = imagerotate($image, -90, 0);\n break;\n\n case 7:\n $image = imagerotate($image, -90, 0);\n imageflip($image, IMG_FLIP_VERTICAL);\n break;\n\n case 8:\n $image = imagerotate($image, 90, 0);\n break;\n }\n\n return $image;\n }", "function AutoRotateImage($src_image, $ref = false) \n {\n # from a non-ingested image to properly rotate a preview image\n global $imagemagick_path, $camera_autorotation_ext, $camera_autorotation_gm;\n \n if (!isset($imagemagick_path)) \n {\n return false;\n # for the moment, this only works for imagemagick\n # note that it would be theoretically possible to implement this\n # with a combination of exiftool and GD image rotation functions.\n }\n\n # Locate imagemagick.\n $convert_fullpath = get_utility_path(\"im-convert\");\n if ($convert_fullpath == false) \n {\n return false;\n }\n \n $exploded_src = explode('.', $src_image);\n $ext = $exploded_src[count($exploded_src) - 1];\n $triml = strlen($src_image) - (strlen($ext) + 1);\n $noext = substr($src_image, 0, $triml);\n \n if (count($camera_autorotation_ext) > 0 && (!in_array(strtolower($ext), $camera_autorotation_ext))) \n {\n # if the autorotation extensions are set, make sure it is allowed for this extension\n return false;\n }\n\n $exiftool_fullpath = get_utility_path(\"exiftool\");\n $new_image = $noext . '-autorotated.' . $ext;\n \n if ($camera_autorotation_gm) \n {\n $orientation = get_image_orientation($src_image);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -rotate +' . $orientation . ' ' . escapeshellarg($new_image);\n run_command($command);\n }\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n } \n else\n {\n if ($ref != false) \n {\n # use the original file to get the orientation info\n $extension = sql_value(\"select file_extension value from resource where ref=$ref\", '');\n $file = get_resource_path($ref, true, \"\", false, $extension, -1, 1, false, \"\", -1);\n # get the orientation\n $orientation = get_image_orientation($file);\n if ($orientation != 0) \n {\n $command = $convert_fullpath . ' -rotate +' . $orientation . ' ' . escapeshellarg($src_image) . ' ' . escapeshellarg($new_image);\n run_command($command);\n # change the orientation metadata\n $command = $exiftool_fullpath . ' Orientation=1 ' . escapeshellarg($new_image);\n }\n } \n else\n {\n $command = $convert_fullpath . ' ' . escapeshellarg($src_image) . ' -auto-orient ' . escapeshellarg($new_image);\n run_command($command);\n }\n }\n\n if (!file_exists($new_image)) \n {\n return false;\n }\n\n if (!$ref) \n {\n # preserve custom metadata fields with exiftool \n # save the new orientation\n # $new_orientation=run_command($exiftool_fullpath.' -s -s -s -orientation -n '.$new_image);\n $old_orientation = run_command($exiftool_fullpath . ' -s -s -s -orientation -n ' . escapeshellarg($src_image));\n \n $exiftool_copy_command = $exiftool_fullpath . \" -TagsFromFile \" . escapeshellarg($src_image) . \" -all:all \" . escapeshellarg($new_image);\n run_command($exiftool_copy_command);\n \n # If orientation was empty there's no telling if rotation happened, so don't assume.\n # Also, don't go through this step if the old orientation was set to normal\n if ($old_orientation != '' && $old_orientation != 1) \n {\n $fix_orientation = $exiftool_fullpath . ' Orientation=1 -n ' . escapeshellarg($new_image);\n run_command($fix_orientation);\n }\n }\n \n unlink($src_image);\n rename($new_image, $src_image);\n return true; \n }", "function _rotate_image_resource($img, $angle)\n {\n }", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle) {\n\t\t$this->Rotate($angle,$x,$y);\n\t\t$this->Image($file,$x,$y,$w,$h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n\t{\n\t $this->Rotate($angle,$x,$y);\n\t $this->Image($file,$x,$y,$w,$h);\n\t $this->Rotate(0);\n\t}", "private function _imgRotate(){\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $webPath = WEBROOT.'/site/files/_tmp/'.basename($url);\r\n $degrees = $_POST['direction']=='CCW'?90:-90;\r\n $info = getimagesize($sourcePath);\r\n\r\n switch($info['mime']){\r\n case 'image/png':\r\n $img = imagecreatefrompng($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagesavealpha($rotate, true);\r\n imagepng($rotate, $sourcePath);\r\n break;\r\n case 'image/jpeg':\r\n $img = imagecreatefromjpeg($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagejpeg($rotate, $sourcePath);\r\n break;\r\n case 'image/gif':\r\n $img = imagecreatefromgif($sourcePath);\r\n $rotate = imagerotate($img, $degrees, 0);\r\n imagegif($rotate, $sourcePath);\r\n break;\r\n default:\r\n $result->error = \"Only PNG, JPEG or GIF images are allowed!\";\r\n $response = 400;\r\n exit;\r\n }\r\n\r\n if(isset($img))imagedestroy($img);\r\n if(isset($rotate))imagedestroy($rotate);\r\n\r\n $info = getimagesize($sourcePath);\r\n $result->url = $webPath;\r\n $result->size = [$info[0],$info[1]];\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "protected function adjustImageOrientation()\n { \n $exif = @exif_read_data($this->file);\n \n if($exif && isset($exif['Orientation'])) {\n $orientation = $exif['Orientation'];\n \n if($orientation != 1){\n $img = imagecreatefromjpeg($this->file);\n \n $mirror = false;\n $deg = 0;\n \n switch ($orientation) {\n \n case 2:\n $mirror = true;\n break;\n \n case 3:\n $deg = 180;\n break;\n \n case 4:\n $deg = 180;\n $mirror = true; \n break;\n \n case 5:\n $deg = 270;\n $mirror = true; \n break;\n \n case 6:\n $deg = 270;\n break;\n \n case 7:\n $deg = 90;\n $mirror = true; \n break;\n \n case 8:\n $deg = 90;\n break;\n }\n \n if($deg) $img = imagerotate($img, $deg, 0); \n if($mirror) $img = $this->mirrorImage($img);\n \n $this->image = str_replace('.jpg', \"-O$orientation.jpg\", $this->file); \n imagejpeg($img, $this->file, $this->quality);\n }\n }\n }", "public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}", "function RotatedImage($file,$x,$y,$w,$h,$angle)\n {\n $this->Rotate($angle,$x,$y);\n $this->Image($file,$x,$y,$w,$h);\n $this->Rotate(0);\n }", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "public function rotate()\n {\n // not possible in php?\n }", "public function actionRotate($imageid,$direction)\n\t{\n\t\t\n\t\t// the image object is created from the database to avoid user input\n\t\t$image = Image::model()->findByPk($imageid);\n\t\t// where to return after the operation\n\t\t$rotatedurl = Yii::app()->user->returnUrl;\n\t\t\n\t\t// temporary filename for the created rotated image\n\t\t$tempfilename = Image::FULLIMAGETEMPPATH . uniqid() . '.jpg';\n\t\t// the image variable $rotated is created based on the original JPG in the file system\n\t\t\n\t\t// if the file does not exist, the user is redirected away\n\t\tif (!file_exists($image->getImageFile('full',false,Image::FULLIMAGEPATH)))\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_file_not_found';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\t\t\t\t\n\t\t// the original full image is evaluated to determine if it's a JPG\n\t\t// should the file not be jpg, execution is terminated and user is presented\n\t\t// with an error\n\t\t$originalFullImage = $image->getImageFile('full',false,Image::FULLIMAGEPATH);\n\t\t// getimagesize returns information of image size, but also of type among other things\n\t\t$information = getimagesize($originalFullImage);\n\t\tif ($information['mime'] != 'image/jpeg')\n\t\t{\n\t\t\t$rotatedurl['rotated']='fail_not_jpg';\n\t\t\t$this->redirect($rotatedurl);\n\t\t}\n\n\t\t// an uncompressed image is created from the original full size image\n\t\t$rotate = imagecreatefromjpeg($originalFullImage);\n\t\t// the original full image is unset to save memory\n\t\tunset($originalFullImage);\n\t\t\n\t\t// defining the direction of the rotation\n\t\tswitch($direction) \n\t\t{\n\t\t\tcase 'clockwise':\n\t\t\t\t$angle = -90; \t\n\t\t\t\tbreak;\n\t\t\tcase 'counterclockwise':\n\t\t\t\t$angle = 90; \t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// creates the rotated image\n\t\t$rotated = imagerotate($rotate,$angle,0);\n\t\tunset($rotate);\n\t\t// saves the rotated image as a jpeg to the temporary file directory\n\t\timagejpeg($rotated,$tempfilename,100);\n\t\tunset($rotated);\n\t\t\n\t\t// the existance of the rotated image is evaluated before anything is deleted\n\t\tif(file_exists($tempfilename))\n\t\t{\n\t\t\t// deletes all the physical image files for the image object\n\t\t\t$image->deleteImage(array('small', 'light', 'medium', 'large','full'));\n\t\t\t\n\t\t\t// moving the generated image to it's desired location\n\t\t\trename($tempfilename,$image->getImageFile('full',false,Image::FULLIMAGEPATH));\n\t\t\t\n\t\t\t// generating thumbnails for the rotated image\n\t\t\t$image->generateThumbnails();\n\t\t}\n\n\t\t$rotatedurl['rotated']='true';\n\t\t$this->redirect($rotatedurl);\n\t\t\t\t\n\t}", "protected function _rotateImage(&$photo, $path)\n {\n \t$exif = @exif_read_data($path);\n \t\n \tif (!empty($exif['Orientation']))\n \t\tswitch ($exif['Orientation'])\n \t\t{\n \t\t\tcase 8:\n \t\t\t\t$photo->rotateImageNDegrees(90)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\t$photo->rotateImageNDegrees(180)->save($path);\n \t\t\t\tbreak;\n \t\t\tcase 6:\n \t\t\t\t$photo->rotateImageNDegrees(-90)->save($path);\n \t\t\t\tbreak;\n \t}\n }", "function __rotate(&$tmp, $angle, &$color) {\n\n\t\t// skip full loops\n\t\t//\n\t\tif (($angle % 360) == 0) {\n\t\t\treturn true;\n\t\t\t}\n\n\t\t// rectangular rotates are OK\n\t\t//\n\t\tif (($angle % 90) == 0) {\n\n\t\t\t// call `convert -rotate`\n\t\t\t//\n\t\t\t$cmd = $this->__command(\n\t\t\t\t'convert',\n\t\t\t\t\" -rotate {$angle} \"\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t\t\t. \" TIF:\"\n\t \t\t\t// ^ \n\t \t\t\t// GIF saving hack\n\t \t\t\t. escapeshellarg(realpath($tmp->target))\n\t \t);\n\t exec($cmd, $result, $errors);\n\t\t\tif ($errors) {\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t$w1 = $tmp->image_width;\n\t\t\t$h1 = $tmp->image_height;\n\t\t\t$tmp->image_width = ($angle % 180) ? $h1 : $w1;\n\t\t\t$tmp->image_height = ($angle % 180) ? $w1 : $h1;\n\t\t\treturn true;\n\t\t\t}\n\n\t\treturn false;\n\t\t}", "function rotate($src_file, $dest_file, $degrees, $img_meta) {\n $fileOut = $src_file . \".1\";\n @copy($src_file, $fileOut);\n \n $path = zmgNetpbmTool::getPath();\n if ($img_meta['extension'] == \"png\") {\n $cmd = $path . \"pngtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"pnmtopng > \" . $fileOut;\n } else if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $cmd = $path . \"jpegtopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmtojpeg -quality=\" . $img_meta['jpeg_qty']\n . \" > \" . $fileOut;\n } else if ($img_meta['extension'] == \"gif\") {\n $cmd = $path . \"giftopnm \" . $src_file . \" | \" . $path . \"pnmrotate \"\n . $degrees . \" | \" . $path . \"ppmquant 256 | \" . $path . \"ppmtogif > \"\n . $fileOut;\n } else {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Source file is not an image or image type is not supported.');\n }\n\n $output = $retval = null;\n exec($cmd, $output, $retval);\n if ($retval) {\n return zmgToolboxPlugin::registerError($src_file, 'NetPBM: Could not rotate image: ' . $output);\n }\n $erg = @rename($fileOut, $dest_file);\n\n return true;\n }", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "public function autoRotate() {\n $this->thumb->rotateJpg();\n return $this;\n }", "function autoRotateImage($image) {\n $orientation = $image->getImageOrientation();\n\n switch($orientation) {\n case imagick::ORIENTATION_BOTTOMRIGHT:\n $image->rotateimage(\"#000\", 180); // rotate 180 degrees\n break;\n\n case imagick::ORIENTATION_RIGHTTOP:\n $image->rotateimage(\"#000\", 90); // rotate 90 degrees CW\n break;\n\n case imagick::ORIENTATION_LEFTBOTTOM:\n $image->rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n break;\n }\n\n // Now that it's auto-rotated, make sure the EXIF data is correct in case the EXIF gets saved with the image!\n $image->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n}", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n\t\t$this->Rotate($angle, $x, $y);\n\t\t$this->Image($file, $x, $y, $w, $h);\n\t\t$this->Rotate(0);\n\t}", "function RotatedImage($file, $x, $y, $w, $h, $angle) {\n $this->Rotate($angle, $x, $y);\n $this->Image($file, $x, $y, $w, $h);\n $this->Rotate(0);\n }", "public function rotate($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$angle = (float) $angle;\n\t\t$bg_color = $this->normalizeColor($bg_color);\n\n\t\tif($bg_color === false) {\n\t\t\ttrigger_error('Rotate failed because background color could not be generated. Try sending an array(RRR, GGG, BBB).', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t$working_image = imagerotate($this->image, $angle, imagecolorallocate($this->image, $bg_color[0], $bg_color[1], $bg_color[2]));\n\n\t\tif($working_image) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = imagesx($this->image);\n\t\t\t$this->height = imagesy($this->image);\n\t\t\t$this->aspect = $this->width/$this->height;\n\t\t\tif($this->aspect > 1) {\n\t\t\t\t$this->orientation = 'landscape';\n\t\t\t} else if($this->aspect < 1) {\n\t\t\t\t$this->orientation = 'portrait';\n\t\t\t} else {\n\t\t\t\t$this->orientation = 'square';\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Rotate failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "private function rotate_png_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefrompng($path), $orientation);\n imagesavealpha($image, true);\n imagealphablending($image, true);\n imagepng($image, $path, 100);\n imagedestroy($image);\n }", "function rotateImage($width, $height, $rotation, $quality = 8){\n\t\tif(!is_numeric($quality)){\n\t\t\treturn false;\n\t\t}\n\t\t$quality = max(min($quality, 10), 0) * 10;\n\n\t\t$dataPath = TEMP_PATH . we_base_file::getUniqueId();\n\t\t$_resized_image = we_base_imageEdit::edit_image($this->getElement('data'), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\tif(!$_resized_image[0]){\n\t\t\treturn false;\n\t\t}\n\t\t$this->setElement('data', $dataPath);\n\n\t\t$this->setElement('width', $_resized_image[1], 'attrib');\n\t\t$this->setElement('origwidth', $_resized_image[1], 'attrib');\n\n\t\t$this->setElement('height', $_resized_image[2], 'attrib');\n\t\t$this->setElement('origheight', $_resized_image[2], 'attrib');\n\n\t\t$this->DocChanged = true;\n\t\treturn true;\n\t}", "private function rotate_gif_with_gd($path, $orientation)\n {\n $image = $this->rotate_gd(imagecreatefromgif($path), $orientation);\n imagegif($image, $path, 100);\n imagedestroy($image);\n }", "function rotateImage($width, $height, $rotation, $quality = 8) {\n\t\tif (!is_numeric($quality)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($quality > 10) {\n\t\t\t\t$quality = 10;\n\t\t\t} else if ($quality < 0) {\n\t\t\t\t$quality = 0;\n\t\t\t}\n\n\t\t\t$quality = $quality * 10;\n\n\t\t\t$dataPath = TMP_DIR.\"/\".weFile::getUniqueId();\n\t\t\t$_resized_image = we_image_edit::edit_image($this->getElement(\"data\"), $this->getGDType(), $dataPath, $quality, $width, $height, false, true, 0, 0, -1, -1, $rotation);\n\n\t\t\t$this->setElement(\"data\", $dataPath);\n\n\t\t\t$this->setElement(\"width\", $_resized_image[1]);\n\t\t\t$this->setElement(\"origwidth\", $_resized_image[1], \"attrib\");\n\n\t\t\t$this->setElement(\"height\", $_resized_image[2]);\n\t\t\t$this->setElement(\"origheight\", $_resized_image[2], \"attrib\");\n\n\t\t\t$this->DocChanged = true;\n\t\t}\n\t}", "public function Rotate($angle){\n\t\t\t$rgba = \\backbone\\Color::HexToRGBA(\"#FFFFFF\", 0);\n\t\t\t$color = $this->AllocateColor($rgba[0]['r'], $rgba[0]['g'], $rgba[0]['b'], $rgba[0]['alpha']);\n\n\t\t\t$img = new \\backbone\\Image();\n\t\t\t$img->handle = imagerotate($this->handle, $angle, $color);\n\t\t\treturn $img;\n\t\t}", "public function rotate($sourceImg, $angleDegrees) {\n\n $angle = (int)$angleDegrees;\n if(! $angle || ! abs($angle) % 360) {\n return $sourceImg;\n }\n $width = imagesx($sourceImg);\n $height = imagesy($sourceImg);\n \n /**\n * First create a new image that is large enough to hold the original image at any rotation angle.\n */\n $max = hypot($width, $height);\n $img = $this->_createImage($max, $max);\n if(false === $img) {\n return false;\n }\n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img);\n \n /**\n * Copy the original image centered on the new image.\n */\n if(false === $this->_copyCentered($img, $sourceImg)) {\n return false;\n }\n \n /**\n * DEBUG\n */\n // $debugIndex = $this->_debugWriteToFile($img, $debugIndex);\n \n /**\n * Rotate the new image.\n * \n * NOTICE: negative angles to apply clock-wise rotation.\n */\n $rotatedImg = imagerotate($img, $angle, imagecolorallocatealpha($sourceImg, 0, 0, 0, 127));\n if(false === $rotatedImg) {\n return false;\n }\n \n /**\n * DEBUG\n * $debugIndex = $this->_debugWriteToFile($rotatedImg, $debugIndex);\n */\n \n /**\n * Create an image having having dimensions to fully contain the rotated image at the specified angle.\n */\n $rad = deg2rad($angle);\n $x = $height * abs(sin($rad)) + $width * abs(cos($rad));\n $y = $height * abs(cos($rad)) + $width * abs(sin($rad));\n $finalImg = $this->_createImage($x, $y);\n if(false === $finalImg) {\n return false;\n }\n $res = imagecopy(\n $finalImg, \n $rotatedImg, \n 0, \n 0, \n (imagesx($rotatedImg) - $x) / 2,\n (imagesy($rotatedImg) - $y) / 2,\n $x,\n $y);\n if(false === $res) {\n return false;\n }\n /**\n * DEBUG\n * $this->_debugWriteToFile($finalImg, $debugIndex);\n */\n return $finalImg;\n }", "public function rotateBy($rotation) {}", "function _rotateImageNETPBM($file, $desfile, $degrees, $imgobj) {\r\n $fileOut = \"$file.1\";\r\n $zoom->platform->copy($file, $fileOut); \r\n if (eregi(\"\\.png\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"pngtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"pnmtopng > $fileOut\" ; \r\n } elseif (eregi(\"\\.(jpg|jpeg)\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"jpegtopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmtojpeg -quality=\" . $this->_JPEG_quality . \" > $fileOut\" ;\r\n } elseif (eregi(\"\\.gif\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"giftopnm $file | \" . $this->_NETPBM_path . \"pnmrotate $degrees | \" . $this->_NETPBM_path . \"ppmquant 256 | \" . $this->_NETPBM_path . \"ppmtogif > $fileOut\" ; \r\n } else {\r\n return false;\r\n }\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if ($retval) {\r\n return false;\r\n } else {\r\n $erg = $zoom->platform->rename($fileOut, $desfile); \r\n return true;\r\n }\r\n }", "private function imagerotate($srcImg, $angle, $bgColor, $ignoreTransparent=0) {\n\t\tfunction rotateX($x, $y, $theta) {\n\t\t\treturn $x * cos($theta) - $y * sin($theta);\n\t\t}\n\t\tfunction rotateY($x, $y, $theta) {\n\t\t\treturn $x * sin($theta) + $y * cos($theta);\n\t\t}\n\n\t\t$srcW = imagesx($srcImg);\n\t\t$srcH = imagesy($srcImg);\n\n\t\t// Normalize angle\n\t\t$angle %= 360;\n\n\t\tif ($angle == 0) {\n\t\t\tif ($ignoreTransparent == 0) {\n\t\t\t\timagesavealpha($srcImg, true);\n\t\t\t}\n\t\t\treturn $srcImg;\n\t\t}\n\n\t\t// Convert the angle to radians\n\t\t$theta = deg2rad($angle);\n\n\t\t$minX = $maxX = $minY = $maxY = 0;\n\t\t\n\t\t// Standard case of rotate\n\t\tif ((abs($angle) == 90) || (abs($angle) == 270)) {\n\t\t\t$width = $srcH;\n\t\t\t$height = $srcW;\n\t\t\tif (($angle == 90) || ($angle == -270)) {\n\t\t\t\t$minX = 0;\n\t\t\t\t$maxX = $width;\n\t\t\t\t$minY = -$height+1;\n\t\t\t\t$maxY = 1;\n\t\t\t} else if (($angle == -90) || ($angle == 270)) {\n\t\t\t\t$minX = -$width+1;\n\t\t\t\t$maxX = 1;\n\t\t\t\t$minY = 0;\n\t\t\t\t$maxY = $height;\n\t\t\t}\n\t\t} else if (abs($angle) === 180) {\n\t\t\t$width = $srcW;\n\t\t\t$height = $srcH;\n\t\t\t$minX = -$width+1;\n\t\t\t$maxX = 1;\n\t\t\t$minY = -$height+1;\n\t\t\t$maxY = 1;\n\t\t} else {\n\t\t\t// Calculate the width of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateX(0, 0, 0-$theta),\n\t\t\t\trotateX($srcW, 0, 0-$theta),\n\t\t\t\trotateX(0, $srcH, 0-$theta),\n\t\t\t\trotateX($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minX = floor(min($temp));\n\t\t\t$maxX = ceil(max($temp));\n\t\t\t$width = $maxX - $minX;\n\n\t\t\t// Calculate the height of the destination image\n\t\t\t$temp = array(\n\t\t\t\trotateY(0, 0, 0-$theta),\n\t\t\t\trotateY($srcW, 0, 0-$theta),\n\t\t\t\trotateY(0, $srcH, 0-$theta),\n\t\t\t\trotateY($srcW, $srcH, 0-$theta),\n\t\t\t);\n\t\t\t$minY = floor(min($temp));\n\t\t\t$maxY = ceil(max($temp));\n\t\t\t$height = $maxY - $minY;\n\t\t}\n\n\t\t$destImg = imagecreatetruecolor($width, $height);\n\t\tif ($ignoreTransparent == 0) {\n\t\t\timagefill($destImg, 0, 0, imagecolorallocatealpha($destImg, 255,255, 255, 127));\n\t\t\timagesavealpha($destImg, true);\n\t\t}\n\n\t\t// Sets all pixels in the new image\n\t\tfor ($x = $minX; $x < $maxX; $x++) {\n\t\t\tfor ($y = $minY; $y < $maxY; $y++) {\n\t\t\t\t// Fetch corresponding pixel from the source image\n\t\t\t\t$srcX = round(rotateX($x, $y, $theta));\n\t\t\t\t$srcY = round(rotateY($x, $y, $theta));\n\t\t\t\tif ($srcX >= 0 && $srcX < $srcW && $srcY >= 0 && $srcY < $srcH) {\n\t\t\t\t\t$color = imagecolorat($srcImg, $srcX, $srcY);\n\t\t\t\t} else {\n\t\t\t\t\t$color = $bgColor;\n\t\t\t\t}\n\t\t\t\timagesetpixel($destImg, $x-$minX, $y-$minY, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $destImg;\n\t}", "function fix_orientation($fileandpath) { if(!file_exists($fileandpath))\n return false;\n try {\n @$exif = read_exif_data($fileandpath, 'IFD0');\n }\n catch (Exception $exp) {\n $exif = false;\n }\n // Get all the exif data from the file\n // If we dont get any exif data at all, then we may as well stop now\n if(!$exif || !is_array($exif))\n return false;\n\n // I hate case juggling, so we're using loweercase throughout just in case\n $exif = array_change_key_case($exif, CASE_LOWER);\n\n // If theres no orientation key, then we can give up, the camera hasn't told us the\n // orientation of itself when taking the image, and i'm not writing a script to guess at it!\n if(!array_key_exists('orientation', $exif))\n return false;\n\n // Gets the GD image resource for loaded image\n $img_res = $this->get_image_resource($fileandpath);\n\n // If it failed to load a resource, give up\n if(is_null($img_res))\n return false;\n\n // The meat of the script really, the orientation is supplied as an integer,\n // so we just rotate/flip it back to the correct orientation based on what we\n // are told it currently is\n\n switch($exif['orientation']) {\n\n // Standard/Normal Orientation (no need to do anything, we'll return true as in theory, it was successful)\n case 1: return true; break;\n\n // Correct orientation, but flipped on the horizontal axis (might do it at some point in the future)\n case 2:\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Upside-Down\n case 3:\n $final_img = $this->imageflip($img_res, IMG_FLIP_VERTICAL);\n break;\n\n // Upside-Down & Flipped along horizontal axis\n case 4:\n $final_img = $this->imageflip($img_res, IMG_FLIP_BOTH);\n break;\n\n // Turned 90 deg to the left and flipped\n case 5:\n $final_img = imagerotate($img_res, -90, 0);\n $final_img = $this->imageflip($img_res, IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the left\n case 6:\n $final_img = imagerotate($img_res, -90, 0);\n break;\n\n // Turned 90 deg to the right and flipped\n case 7:\n $final_img = imagerotate($img_res, 90, 0);\n $final_img = $this->imageflip($img_res,IMG_FLIP_HORIZONTAL);\n break;\n\n // Turned 90 deg to the right\n case 8:\n $final_img = imagerotate($img_res, 90, 0);\n break;\n\n }\n if(!isset($final_img))\n return false;\n if (!is_writable($fileandpath)) {\n chmod($fileandpath, 0777);\n }\n unlink($fileandpath);\n\n // Save it and the return the result (true or false)\n $done = $this->save_image_resource($final_img,$fileandpath);\n\n return $done;\n }", "function image_fix_orientation($path){\n\t\t$exif = exif_read_data($path);\n\n\t\t//fix the Orientation if EXIF data exist\n\t\tif(!empty($exif['Orientation'])) {\n\t\t switch($exif['Orientation']) {\n\t\t case 8:\n\t\t $createdImage = imagerotate($image,90,0);\n\t\t break;\n\t\t case 3:\n\t\t $createdImage = imagerotate($image,180,0);\n\t\t break;\n\t\t case 6:\n\t\t $createdImage = imagerotate($image,-90,0);\n\t\t break;\n\t\t }\n\t\t}\n\t}", "public function test_rotate() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "private function rotate_imagick($imagePath, $orientation)\n {\n $imagick = new Imagick($imagePath);\n $imagick->setImageOrientation(imagick::ORIENTATION_TOPLEFT);\n $deg = 0;\n\n switch ($orientation) {\n case 2:\n $deg = 180;\n $imagick->flipImage();\n break;\n\n case 3:\n $deg = -180;\n break;\n\n case 4:\n $deg = -180;\n $imagick->flopImage();\n break;\n\n case 5:\n $deg = -90;\n $imagick->flopImage();\n break;\n\n case 6:\n $deg = 90;\n break;\n\n case 7:\n $deg = -90;\n $imagick->flipImage();\n break;\n\n case 8:\n $deg = -90;\n break;\n }\n $imagick->rotateImage(new ImagickPixel('#00000000'), $deg);\n $imagick->writeImage($imagePath);\n $imagick->clear();\n $imagick->destroy();\n }", "public function test_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/one-blue-pixel-100x100.png';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$property = new ReflectionProperty( $imagick_image_editor, 'image' );\n\t\t$property->setAccessible( true );\n\n\t\t$color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 0 )->getColor();\n\n\t\t$imagick_image_editor->rotate( 180 );\n\n\t\t$this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );\n\t}", "function rotateImage($file, $desfile, $degrees, $imgobj) {\r\n $degrees = intval($degrees);\r\n switch ($this->_conversiontype){\r\n //Imagemagick\r\n case 1:\r\n if($this->_rotateImageIM($file, $desfile, $degrees))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //NetPBM\r\n case 2:\r\n if($this->_rotateImageNETPBM($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD1\r\n case 3:\r\n if($this->_rotateImageGD1($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n //GD2\r\n case 4:\r\n if($this->_rotateImageGD2($file, $desfile, $degrees, $imgobj))\r\n return true;\r\n else\r\n return false;\r\n break;\r\n }\r\n return true;\r\n }", "public function getRotation() {}", "public function getRotation() {}", "function fixImageOrientation($filename) \n{\n\t$exif = @exif_read_data($filename);\n\t \n\tif($exif) \n\t{ \n\t\t//fix the Orientation if EXIF data exists\n\t\tif(!empty($exif['Orientation'])) \n\t\t{\n\t\t\tswitch($exif['Orientation']) \n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t$createdImage = imagerotate($filename,180,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t$createdImage = imagerotate($filename,-90,0);\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t$createdImage = imagerotate($filename,90,0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} \n}", "protected function fix_image_orientation( $filename, $filecontent ) {\r\n\t\t\t$data = exif_read_data( $filename );\r\n\t\t\tif ( !empty( $data['Orientation'] ) ) {\r\n\t\t\t\tswitch( $data['Orientation'] ) {\r\n\t\t\t\t\tcase 3: { $newAngle = 180; } break;\r\n\t\t\t\t\tcase 6: { $newAngle = -90; } break;\r\n\t\t\t\t\tcase 8: { $newAngle = 90; } break;\r\n\t\t\t\t\tdefault: $newAngle = false;\r\n\t\t\t\t}\r\n\t\t\t\tif ( $newAngle ) {\r\n\t\t\t\t\t$image = imagecreatefromstring( $filecontent );\r\n\t\t\t\t\t$image = imagerotate( $image, $newAngle, 0 );\r\n\t\t\t\t\t$this->save_image( $image, $filename );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "function __rotate(&$tmp, $angle, $color) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "public function outputAsJPG(){\n header('Content-Type: image/jpeg');\n\t\theader (\"Cache-Control: must-revalidate\");\n\t\t$offset = 7 * 24 * 60 * 60;//expires one week\n\t\t$expire = \"Expires: \" . gmdate (\"D, d M Y H:i:s\", time() + $offset) . \" GMT\";\n\t\theader ($expire);\n imagejpeg($this->gd_image);\n }", "protected function _rotate($img, $rotateDegrees, $dstWidth = null, $dstHeight = null) {\n $degrees = is_numeric($rotateDegrees) ? intval($rotateDegrees) : null;\n if(! is_int($degrees)) {\n $var = Types::getVartype($rotateDegrees);\n throw new Exception\\InvalidArgumentException(\"Invalid overlay rotate degrees value '{$var}'\", MediaConst::E_TYPE_MISMATCH);\n }\n if(abs($degrees) > 360) {\n // $var = Types::getVartype($rotateDegrees);\n // throw new Exception\\InvalidArgumentException(\"Invalid overlay value '{$var}'\", MediaConst::E_INVALID_ROTATE_PARAM);\n }\n $obj = new Rotate();\n $finalImg = $obj->rotate($img, $degrees, $dstWidth, $dstHeight);\n if(false === $finalImg) {\n // T_PHP_FUNCTION_FAILED = image function '%s' failed\n $msg = $phpErrorHandler->getErrorMsg(sprintf(MediaConst::T_PHP_FUNCTION_FAILED, \"imagecopy\"), \"cannot copy overlay image\");\n imagedestroy($img);\n // a PHP image function has failed\n throw new Exception\\RuntimeException($msg, MediaConst::E_PHP_FUNCTION_FAILED);\n }\n return $finalImg;\n }", "public function test_remove_orientation_data_on_rotate() {\n\t\t$file = DIR_TESTDATA . '/images/test-image-upside-down.jpg';\n\t\t$data = wp_read_image_metadata( $file );\n\n\t\t// The orientation value 3 is equivalent to rotated upside down (180 degrees).\n\t\t$this->assertSame( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );\n\n\t\t$temp_file = wp_tempnam( $file );\n\t\t$image = wp_get_image_editor( $file );\n\n\t\t// Test a value that would not lead back to 1, as WP is resetting the value to 1 manually.\n\t\t$image->rotate( 90 );\n\t\t$ret = $image->save( $temp_file, 'image/jpeg' );\n\n\t\t$data = wp_read_image_metadata( $ret['path'] );\n\n\t\t// Make sure the image is no longer in The Upside Down Exif orientation.\n\t\t$this->assertSame( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );\n\n\t\t// Remove both the generated file ending in .tmp and tmp.jpg due to wp_tempnam().\n\t\tunlink( $temp_file );\n\t\tunlink( $ret['path'] );\n\t}", "abstract public function rotate($amount);", "public function ImgCropToFile(){\r\n $imgUrl = $_POST['imgUrl'];\r\n// original sizes\r\n $imgInitW = $_POST['imgInitW'];\r\n $imgInitH = $_POST['imgInitH'];\r\n// resized sizes\r\n $imgW = $_POST['imgW'];\r\n $imgH = $_POST['imgH'];\r\n// offsets\r\n $imgY1 = $_POST['imgY1'];\r\n $imgX1 = $_POST['imgX1'];\r\n// crop box\r\n $cropW = $_POST['cropW'];\r\n $cropH = $_POST['cropH'];\r\n// rotation angle\r\n $angle = $_POST['rotation'];\r\n\r\n $jpeg_quality = 100;\r\n\r\n $what = new \\Think\\Image();\r\n $name = './'.$this::getPath($imgUrl).$this::getFileName($imgUrl);\r\n $c_name = './'.$this::getPath($imgUrl).'c_'.$this::getFileName($imgUrl);\r\n $p_name = './'.$this::getPath($imgUrl).'p_'.$this::getFileName($imgUrl);\r\n $what ->open($name);\r\n $what ->thumb($imgW, $imgH)->save($c_name);\r\n $what ->open($c_name);\r\n $what ->crop(($cropW),($cropH),$imgX1,$imgY1)->save($p_name);\r\n unlink($c_name);\r\n unlink($name);\r\n\r\n $m = M('img_mapping');\r\n $data = array();\r\n $data['user'] = $_SESSION['current_user']['id'];\r\n $data['img'] = './'.$this::getPath($p_name).$this::getFileName($p_name);\r\n $m->data($data)->add();\r\n\r\n $response = Array(\r\n \"status\" => 'success',\r\n \"url\" => __ROOT__.'/'.$this::getPath($p_name).$this::getFileName($p_name)\r\n );\r\n print json_encode($response);\r\n }", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "public function fixOrientation($file, $return = 'file') {\n\t\t \t\n\t\t$mime = \\FileManager::getFileMimeType($file);\n \n\t\t$save_name = \\Tools::generateRandomString().uniqid(). $this -> getExtension($mime);\n\t \n\t if(!\\Validator::check('gif_file', $mime)) {\n\t $image = new \\Imagick($file);\n\t $orientation = $image -> getImageOrientation();\n\t \n\t switch($orientation) {\n\t case \\imagick::ORIENTATION_BOTTOMRIGHT: \n\t $image -> rotateimage(\"#000\", 180); // rotate 180 degrees\n\t break;\n\t \n\t case \\imagick::ORIENTATION_RIGHTTOP:\n\t $image -> rotateimage(\"#000\", 90); // rotate 90 degrees CW\n\t break;\n\t \n\t case \\imagick::ORIENTATION_LEFTBOTTOM: \n\t $image -> rotateimage(\"#000\", -90); // rotate 90 degrees CCW\n\t break;\n\t }\n\t \n\t $image -> setImageOrientation (\\Imagick::ORIENTATION_TOPLEFT);\n\t \n\t $location = SITE_PATH.'tmp'.DS.$save_name;\n\t\t \n\t\t file_put_contents($location, $image -> getImageBlob());\n\t\t \n\t\t return $location;\n\t \n\t } else {\n\t \n\t \treturn $file;\n\t \n\t }\n\t}", "function _rotateImageIM($file, $desfile, $degrees) {\r\n $cmd = $this->_IM_path.\"convert -rotate $degrees \\\"$file\\\" \\\"$desfile\\\"\";\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function rotate(&$tmp, $angle, $color=null) {\r\r\n\t\t\r\r\n\t\t// color ?\r\r\n\t\t//\r\r\n\t\tif (!is_a($color, 'Asido_Color')) {\r\r\n\t\t\t$color = new Asido_Color;\r\r\n\t\t\t$color->set(255, 255, 255);\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\treturn $this->__rotate($tmp, $angle, $color);\r\r\n\t\t}", "public static function passthroughJpg($jpg)\n {\n \theader('Content-Type: image/jpg');\n \theader('Cache-Control: public, max-age=600'); // HTTP/1.1\n \theader('Pragma: public');\n \theader('Expires: ' . gmdate('D, d M Y H:i:s', time() + 600) . ' GMT'); // Date in the past\n \theader('Last-Modified: ' . gmdate('D, d M Y H:i:s', time() + 600) . ' GMT');\n \timagejpeg($jpg);\n \timagedestroy($jpg);\n }", "private function recortarImagen()\n\t{\n\t\t$ImgTemporal=\"temporal_clase_Imagen.\".strtolower($this->extencion);\n\n\t\t$CoefAncho\t\t= $this->propiedadesImagen[0]/$this->anchoDestino;\n\t\t$CoefAlto\t\t= $this->propiedadesImagen[1]/$this->altoDestino;\n\t\t$Coeficiente=0;\n\t\tif ($CoefAncho>1 && $CoefAlto>1)\n\t\t{ if($CoefAncho>$CoefAlto){ $Coeficiente=$CoefAlto; } else {$Coeficiente=$CoefAncho;} }\n\n\t\tif ($Coeficiente!=0)\n\t\t{\n\t\t\t$anchoTmp\t= ceil($this->propiedadesImagen[0]/$Coeficiente);\n\t\t\t$altoTmp\t= ceil($this->propiedadesImagen[1]/$Coeficiente);\n\n\t\t\t$ImgMediana = imagecreatetruecolor($anchoTmp,$altoTmp);\n\t\t\timagecopyresampled($ImgMediana,$this->punteroImagen,0,0,0,0,$anchoTmp,$altoTmp,$this->propiedadesImagen[0],$this->propiedadesImagen[1]);\n\t\t\t\n\t\t\t// Tengo que desagregar la funcion de image para crear para reUtilizarla\n\t\t\t//imagejpeg($ImgMediana,$ImgTemporal,97);\n\t\t\t$this->crearArchivoDeImagen($ImgMediana,$ImgTemporal);\n\t\t}\n\n\t\t$fila\t\t\t= floor($this->recorte['centrado']/$this->recorte['columnas']);\n\t\t$columna\t\t= $this->recorte['centrado'] - ($fila*$this->recorte[\"columnas\"]);\n\t\t\n\t\t$centroX \t= floor(($anchoTmp / $this->recorte[\"columnas\"])/2)+$columna*floor($anchoTmp / $this->recorte[\"columnas\"]);\n\t\t$centroY \t= floor(($altoTmp / $this->recorte[\"filas\"])/2)+$fila*floor($altoTmp / $this->recorte[\"filas\"]);\n\n\t\t$centroX\t-= floor($this->anchoDestino/2);\n\t\t$centroY \t-= floor($this->altoDestino/2);\n\n\t\tif ($centroX<0) {$centroX = 0;}\n\t\tif ($centroY<0) {$centroY = 0;}\n\n\t\tif (($centroX+$this->anchoDestino)>$anchoTmp) {$centroX = $anchoTmp-$this->anchoDestino;}\n\t\tif (($centroY+$this->altoDestino)>$altoTmp) {$centroY = $altoTmp-$this->altoDestino;}\n\n\t\t$ImgRecortada = imagecreatetruecolor($this->anchoDestino,$this->altoDestino);\n\t\timagecopymerge ( $ImgRecortada,$ImgMediana,0,0,$centroX, $centroY, $this->anchoDestino, $this->altoDestino,100);\n\n\t\t//imagejpeg($ImgRecortada,$this->imagenDestino,97);\n\t\t$this->crearArchivoDeImagen($ImgRecortada,$this->imagenDestino);\n\t\timagedestroy($ImgRecortada);\n\t\tunlink($ImgTemporal);\n\t}", "public function rotateLeft();", "public function rotate(int $rotations);", "static function save($path) {\n \t\n\t\tif(exif_imagetype($_FILES['qqfile']['tmp_name']) == IMAGETYPE_JPEG){\n\t\t\t\n $exif = exif_read_data($_FILES['qqfile']['tmp_name']);\n $ort = isset($exif['Orientation']) ? $exif['Orientation'] : null ;\n $mustRotate = 0;\n $angle = 0;\n\t\t\t\n switch($ort)\n {\n case 3: // 180 rotate left\n $angle = 180;\n $mustRotate = 1;\n break;\n case 6: // 90 rotate right\n $angle = 90;\n $mustRotate = 1;\n break;\n case 8: // 90 rotate left\n $angle = -90;\n $mustRotate = 1;\n break;\n }\n if ($mustRotate){\n $imagick = new \\Imagick();\n $imagick->readImage(realpath($_FILES['qqfile']['tmp_name']));\n $imagick->rotateimage(new \\ImagickPixel(), $angle);\n $imagick->stripImage();\n $imagick->setImageFormat (\"jpeg\");\n if (!$imagick->writeImage($path)) {\n return false;\n }\n } else {\n\t\t\t\t\n if (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path))\n return false;\n }\n } else {\n\t\t\t\n \t\tif (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path)) {\n \treturn false;\n \t\t}\n }\n return true;\n }", "public function rotate($degrees);", "function marcadeagua($img_original, $img_marcadeagua, $img_nueva, $calidad)\n{\n $info_original = getimagesize($img_original);\n $anchura_original = $info_original[0];\n $altura_original = $info_original[1];\n // obtener datos de la \"marca de agua\" \n $info_marcadeagua = getimagesize($img_marcadeagua);\n $anchura_marcadeagua = $info_marcadeagua[0];\n $altura_marcadeagua = $info_marcadeagua[1];\n // calcular la posición donde debe copiarse la \"marca de agua\" en la fotografia \n $horizmargen = ($anchura_original - $anchura_marcadeagua)/2;\n $vertmargen = ($altura_original - $altura_marcadeagua)/2;\n // crear imagen desde el original \n $original = ImageCreateFromJPEG($img_original);\n ImageAlphaBlending($original, true);\n // crear nueva imagen desde la marca de agua \n $marcadeagua = ImageCreateFromPNG($img_marcadeagua);\n // copiar la \"marca de agua\" en la fotografia \n ImageCopy($original, $marcadeagua, $horizmargen, $vertmargen, 0, 0, $anchura_marcadeagua, $altura_marcadeagua);\n // guardar la nueva imagen \n ImageJPEG($original, $img_nueva, $calidad);\n // cerrar las imágenes \n ImageDestroy($original);\n ImageDestroy($marcadeagua);\n}", "function mergereagentandarrow($filename_x, $filename_y, $filename_result) {\n\n list($width_x, $height_x) = getimagesize($filename_x);\n list($width_y, $height_y) = getimagesize($filename_y);\n\n // Create new image with desired dimensions\n\n $image = imagecreatetruecolor($width_y, $height_x + $height_y);\n$white = imagecolorallocate($image, 255, 255, 255);\nimagefill($image, 0, 0, $white);\n\n\n // Load images and then copy to destination image\n\n $image_x = imagecreatefromgif($filename_x);\n $image_y = imagecreatefromgif($filename_y);\n\n imagecopy($image, $image_x, ($width_y-$width_x)/2, 0, 0, 0, $width_x, $height_x);\n imagecopy($image, $image_y, 0, $height_x, 0, 0, $width_y, $height_y);\n\n // Save the resulting image to disk (as JPEG)\n\n imagegif($image, $filename_result);\n\n\n\n\n // Clean up\n\n imagedestroy($image);\n imagedestroy($image_x);\n imagedestroy($image_y);\n\n}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "public function rotate($x, $y, $angle) {}", "function save_img() {\n imagejpeg($this->img, 'captcha.jpg');\n\n // Libération de la mémoire\n imagedestroy($this->img);\n \n }", "public function rotate($value='random', $bgColor='ffffff')\n\t{\n\t\t$this->checkImage();\n\t\tif ($value == 'random') {\n\t\t\t$value = mt_rand(-6, 6);\n\t\t} else {\n\t\t\t$value = max(-360, min($value, 360));\n\t\t}\n\t\tif ($value < 0) {\n\t\t\t$value = 360 + $value;\n\t\t}\n\n\t\tif ($bgColor == 'alpha' && function_exists('imagerotate')) {\n\t\t\t// Experimental. GD2 imagerotate seems to be quite buggy with alpha transparency.\n\t\t\timagealphablending($this->imageResized, false);\n\t\t\t$color = imagecolorallocatealpha($this->imageResized, 255, 255, 255, 127);\n\t\t\timagecolortransparent($this->imageResized, $color);\n\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\timagesavealpha($this->imageResized, true);\n\t\t} else {\n\t\t\t$bgColor = str_replace('#', '', strtoupper(trim($bgColor)));\n\t\t\t$color = hexdec($bgColor);\n\t\t\tif (function_exists('imagerotate')) {\n\t\t\t\t$this->imageResized = imagerotate($this->imageResized, $value, $color);\n\t\t\t} else {\n\t\t\t\t$this->imageResized = $this->imagerotate($this->imageResized, $value, $color);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function rotateRight();", "public function rotateClockwise($angle = 0, $bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\t$angle = 0 - (float) $angle;\n\t\treturn $this->rotate($angle, $bg_color);\n\t}", "public static function rotate($image = NULL, $degrees = NULL, $backgroundColorRed = 0, $backgroundColorGreen = 0, $backgroundColorBlue = 0, $backgroundColorAlpha = 0)\n\t{\n\n\t\tif (!($image instanceof Default_Model_MediaImage)) {\n\t\t\tthrow new Default_Model_MediaImage_Exception('Image needs to be an instance of Default_Model_MediaImage.');\n\t\t}\n\n\t\tif ($degrees &&\n\t\t\t!is_int($degrees)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('Degrees needs to be an integer, if specified.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorRed) &&\n\t\t\t($backgroundColorRed < 0 || $backgroundColorRed > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Red needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorGreen) &&\n\t\t\t($backgroundColorGreen < 0 || $backgroundColorGreen > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Green needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorBlue) &&\n\t\t\t($backgroundColorBlue < 0 || $backgroundColorBlue > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Blue needs to be specified between 0 and 255.');\n\t\t}\n\n\t\tif (!is_int($backgroundColorAlpha) &&\n\t\t\t($backgroundColorAlpha < 0 || $backgroundColorAlpha > 255)) {\n\n\t\t\tthrow new Default_Model_MediaImage_Exception('BackgroundColor Alpha needs to be specified between 0 and 255.');\n\t\t}\n\n\t\t$rotatedImage = Default_Service_MediaImage::fromMediaImage($image);\n\t\t$rotatedImage->width = 0;\n\t\t$rotatedImage->height = 0;\n\t\t$rotatedImage->file_size = 0;\n\t\t$rotatedImage->role_id = $image->role_id;\n\t\tif (isset($image['entity_id'])) {\n\t\t\t$rotatedImage->entity_id = $image->entity_id;\n\t\t} else\n\t\tif (Zend_Auth::getInstance()->hasIdentity()) {\n\t\t\t$rotatedImage->entity_id = Zend_Auth::getInstance()->getIdentity()->id;\n\t\t}\n\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t$rotatedImage->save();\n\n\n\t\t/**\n\t\t * imageinstance file does not exist yet and needs to be created\n\t\t */\n\t\tif (!file_exists($rotatedImage->getStoredFilePath())) {\n\n\t\t\t/**\n\t\t\t * use Imagick for rotating the image ?\n\t\t\t */\n\t\t\tif (Zend_Registry::get('Imagick')) {\n\n\t\t\t\t/**\n\t\t\t\t * Imagick\n\t\t\t\t */\n\t\t\t\t$imagickError = NULL;\n\t\t\t\ttry {\n\t\t\t\t\t$colorStringFormat = '%1$02s%2$02s%3$02s%4$02s';\n\t\t\t\t\t$colorString = sprintf($colorStringFormat, dechex($backgroundColorRed), dechex($backgroundColorGreen), dechex($backgroundColorBlue), dechex($backgroundColorAlpha));\n\t\t\t\t\t$imagickBackgoundColor = new ImagickPixel('#' . $colorString);\n\n\t\t\t\t\t$imagickObj = new Imagick($image->getStoredFilePath());\n\t\t\t\t\t$imagickRotateResult = $imagickObj->rotateImage($imagickBackgoundColor, $degrees);\n\t\t\t\t\tif ($imagickRotateResult) {\n\t\t\t\t\t\t$imagickObj->writeimage($rotatedImage->getStoredFilePath());\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$rotatedImage->file_size = $imagickObj->getImageLength();\n\t\t\t\t\t\t$imagickDimensions = $imagickObj->getImageGeometry();\n\t\t\t\t\t\t$rotatedImage->width = $imagickDimensions['width'];\n\t\t\t\t\t\t$rotatedImage->height = $imagickDimensions['height'];\n\t\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t}\n\t\t\t\t} catch (ImagickException $imagickError) {\n\n\t\t\t\t}\n\n\t\t\t\tif ($imagickError ||\n\t\t\t\t\t!$imagickRotateResult) {\n\n\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$imageFile = L8M_Image::fromFile($image->getStoredFilePath());\n\n\t\t\t\tif ($imageFile instanceof L8M_Image_Abstract) {\n\n\t\t\t\t\t$imageFile\n\t\t\t\t\t\t->rotate($degrees, $backgroundColorRed, $backgroundColorGreen, $backgroundColorBlue, $backgroundColorAlpha)\n\t\t\t\t\t\t->save($rotatedImage->getStoredFilePath(), TRUE)\n\t\t\t\t\t;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * retrieve image infos\n\t\t\t\t\t */\n\t\t\t\t\t$rotatedImage->file_size = $imageFile->getFilesize();\n\t\t\t\t\t$rotatedImage->width = $imageFile->getWidth();\n\t\t\t\t\t$rotatedImage->height = $imageFile->getHeight();\n\t\t\t\t\t$rotatedImage->short = Default_Service_Media::getShort($image->short, $rotatedImage->width, $rotatedImage->height, $rotatedImage->file_size);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * save\n\t\t\t\t\t */\n\t\t\t\t\tif (!$imageFile->isErrorOccured()) {\n\t\t\t\t\t\t$rotatedImage->save();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$rotatedImage->hardDelete();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $rotatedImage;\n\t}", "function jCrop($src,$x,$y,$w,$h,$file_prefix='',$output=false,$quality=100,$fresh_name=false){\n\n\t\t$extension = strtolower($this->getExtension($src,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\tif($fresh_name == false){\n\t\t\t$newImgName = $file_prefix.$src;\n\t\t}else{\n\t\t\t$newImgName = $file_prefix; //file_prefix contains full fresh\n\t\t}\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$img_r = imagecreatefromgif($this->path.$src);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$img_r = imagecreatefromjpeg($this->path.$src);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$img_r = imagecreatefrompng($this->path.$src);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$targ_w = $w;\n\t\t$targ_h = $h;\n\t\t$dst_r = imagecreatetruecolor( $targ_w, $targ_h );\n\t if($extension == 'png'){\n imagealphablending( $dst_r, false );\n imagesavealpha( $dst_r, true );\n }\n\t\timagecopyresampled($dst_r,$img_r,0,0,$x,$y,$targ_w,$targ_h,$w,$h);\n\t\t\n\t\tif($output){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($dst_r);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($dst_r);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($dst_r);\n\t\t\t}\n\t\t}else{\n\t\t\t$return = false;\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg( $dst_r,$this->path.$newImgName, $quality );\n\t\t\t\t$return = true;\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif( $dst_r, $this->path.$newImgName );\n\t\t\t\t$return = true;\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng( $dst_r, $this->path.$newImgName, ceil( 9 ) );\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t\treturn $return;\n\t\t}\n\t}", "function orientation_check($file_path, $prefs)\n\t{\n\t\tif ( ! function_exists('exif_read_data'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Not all images are supported\n\t\t$exif = @exif_read_data($file_path);\n\n\t\tif ( ! $exif OR ! isset($exif['Orientation']))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$orientation = $exif['Orientation'];\n\n\t\tif ($orientation == 1)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Image is rotated, let's see by how much\n\t\t$deg = 0;\n\n\t\tswitch ($orientation) {\n\t\t\tcase 3:\n\t\t\t\t$deg = 180;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$deg = 270;\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$deg = 90;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($deg)\n\t\t{\n\t\t\tee()->load->library('image_lib');\n\n\t\t\tee()->image_lib->clear();\n\n\t\t\t// Set required memory\n\t\t\ttry\n\t\t\t{\n\t\t\t\tee('Memory')->setMemoryForImageManipulation($file_path);\n\t\t\t}\n\t\t\tcatch (\\Exception $e)\n\t\t\t{\n\t\t\t\tlog_message('error', $e->getMessage().': '.$file_path);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$config = array(\n\t\t\t\t'rotation_angle'\t=> $deg,\n\t\t\t\t'library_path'\t\t=> ee()->config->item('image_library_path'),\n\t\t\t\t'image_library'\t\t=> ee()->config->item('image_resize_protocol'),\n\t\t\t\t'source_image'\t\t=> $file_path\n\t\t\t);\n\n\t\t\tee()->image_lib->initialize($config);\n\n\t\t\tif ( ! ee()->image_lib->rotate())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$new_image = ee()->image_lib->get_image_properties('', TRUE);\n\t\t\tee()->image_lib->clear();\n\n\t\t\t// We need to reset some prefs\n\t\t\tif ($new_image)\n\t\t\t{\n\t\t\t\tee()->load->helper('number');\n\t\t\t\t$f_size = get_file_info($file_path);\n\t\t\t\t$prefs['file_height'] = $new_image['height'];\n\t\t\t\t$prefs['file_width'] = $new_image['width'];\n\t\t\t\t$prefs['file_hw_original'] = $new_image['height'].' '.$new_image['width'];\n\t\t\t\t$prefs['height'] = $new_image['height'];\n\t\t\t\t$prefs['width'] = $new_image['width'];\n\t\t\t}\n\n\t\t\treturn $prefs;\n\t\t}\n\t}", "public function rotate($angle)\n {\n $this->setForceAlpha(true);\n $this\n ->addConvertOption('background', 'none')\n ->addConvertOption('alpha', 'set')\n ->addConvertOption('rotate', $angle);\n\n //an image size has changed after the rotate action, it's required to save it and reinit resource\n $this->saveIfRequired('after_rotate');\n $this->resource = null;\n $this->initResource();\n\n return $this;\n }", "function pngtojpeg($orgimage, $filename = false){\n\t// take the PNG file, and return the jpeg formatted image URL \n\t// notice: this keeps a replication of the image in the folder. This may become cumbersome over time. \n\t// HOWEVER - these files can also be deleted at any time, they have no requirement of being kept. \n\t\n\tif (exif_imagetype($orgimage) == IMAGETYPE_PNG) {\n\t\t\n\t\tif(!$filename){\n\t\t\t// no file name specified\n\t\t$key = '';\n\t\t$keys = array_merge(range(0, 9), range('a', 'z'));\n\n\t\tfor ($i = 0; $i < 5; $i++) {\n\t\t\t$key .= $keys[array_rand($keys)];\n\t\t}\n\t\n\t\n\t\t$newimgpath = 'tmppng/' . $key . time() . '.jpg';\n\t\t} else {\n\t\t\t// use a predefined file name\n\t\t\t$newimgpath = 'tmppng/' . $filename . '.jpg';\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$image = imagecreatefrompng($orgimage);\n\t\t$bg = imagecreatetruecolor(imagesx($image), imagesy($image));\n\t\timagefill($bg, 0, 0, imagecolorallocate($bg, 255, 255, 255));\n\t\timagealphablending($bg, TRUE);\n\t\timagecopy($bg, $image, 0, 0, 0, 0, imagesx($image), imagesy($image));\n\t\timagedestroy($image);\n\t\t$quality = 80; // 0 = worst / smaller file, 100 = better / bigger file \n\t\timagejpeg($bg, $newimgpath, $quality);\n\t\timagedestroy($bg);\n\t\t\n\t\treturn $newimgpath;\n\t\n\t} else {\n\t\t\n\t\treturn $orgimage;\n\t\t\n\t}\n\n}", "public function toGDImage() {}", "function rotateBg() {\r\n\tglobal $backgrounds, $bgImage, $i;\r\n\t$c = count($backgrounds);\r\n\tif ($c==0) return;\r\n\t$r = random($c);\r\n\tif ($backgrounds[$r]==''&&$i<10) {\r\n\t\t$i++;\r\n\t\trotateBg();\r\n\t} elseif ($i>=10) {\r\n\t\tif (!$bgImage||$bgImage=='') {\r\n\t\t\t$bgImage='bg_lock.gif';\r\n\t\t} else {\r\n\t\t\t$bgImage=$bgImage;\r\n\t\t}\r\n\t} else {\r\n\t\t$bgImage = $backgrounds[$r];\r\n\t};\r\n\treturn $bgImage;\r\n}", "public function getRotation()\n {\n return self::accessPgArray($this->rotation);\n }", "function redim($ruta1,$ruta2,$ancho,$alto)\n {\n $datos=getimagesize ($ruta1);\n \n $ancho_orig = $datos[0]; # Anchura de la imagen original\n $alto_orig = $datos[1]; # Altura de la imagen original\n $tipo = $datos[2];\n \n if ($tipo==1){ # GIF\n if (function_exists(\"imagecreatefromgif\")){\n $img = imagecreatefromgif($ruta1);\n echo \"<script>\n\t\t\t\talert('entro a gif');\n\t\t\t\t</script>\";\n }else{\n return false;\n }\n }\n else if ($tipo==2){ # JPG\n if (function_exists(\"imagecreatefromjpeg\")){\n $img = imagecreatefromjpeg($ruta1);\n\n }else{\n return false;\n }\n }\n else if ($tipo==3){ # PNG\n if (function_exists(\"imagecreatefrompng\")){\n $img = imagecreatefrompng($ruta1);\n \n }else{\n return false;\n }\n }\n \n # Se calculan las nuevas dimensiones de la imagen\n if ($ancho_orig>$alto_orig)\n {\n $ancho_dest=$ancho;\n $alto_dest=($ancho_dest/$ancho_orig)*$alto_orig;\n }\n else\n {\n $alto_dest=$alto;\n $ancho_dest=($alto_dest/$alto_orig)*$ancho_orig;\n }\n\n // imagecreatetruecolor, solo estan en G.D. 2.0.1 con PHP 4.0.6+\n $img2=@imagecreatetruecolor($ancho_dest,$alto_dest) or $img2=imagecreate($ancho_dest,$alto_dest);\n\n // Redimensionar\n // imagecopyresampled, solo estan en G.D. 2.0.1 con PHP 4.0.6+\n @imagecopyresampled($img2,$img,0,0,0,0,$ancho_dest,$alto_dest,$ancho_orig,$alto_orig) or imagecopyresized($img2,$img,0,0,0,0,$ancho_dest,$alto_dest,$ancho_orig,$alto_orig);\n\n // Crear fichero nuevo, según extensión.\n if ($tipo==1) // GIF\n if (function_exists(\"imagegif\"))\n imagegif($img2, $ruta2);\n else\n return false;\n\n if ($tipo==2) // JPG\n if (function_exists(\"imagejpeg\"))\n imagejpeg($img2, $ruta2);\n else\n return false;\n\n if ($tipo==3) // PNG\n if (function_exists(\"imagepng\"))\n imagepng($img2, $ruta2);\n else\n return false;\n \n return true;\n }", "public function createImage2(){\n $this->createCircle(100, 100, 50, 50, 0, 360);\n $this->createCircle(400, 100, 50, 50, 0, 360);\n $this->createCircle(110, 200, 50, 50, 0, 360);\n $this->createCircle(250, 300, 50, 50, 0, 360);\n $this->createCircle(390, 200, 50, 50, 0, 360);\n $this->createLine(125, 100, 375, 100);\n $this->createLine(100, 125, 100, 175);\n $this->createLine(400, 125, 400, 175);\n $this->createLine(125, 220, 225, 300);\n $this->createLine(275, 300, 375, 220);\n $this->generateImage();\n }", "function setRotation( $r ) {\n\n // only 0,90,180,270\n if ( $r > 270 ) return;\n if ( $r % 90 != 0 ) return;\n\n $this->rotate = $r;\n $this->vertical = ( $r == 90 or $r == 270 );\n}", "function processImage($image, $filename, $filetype, $keywords, $name, $descr, $rotate, $degrees = 0, $ignoresizes = 0) {\r\n global $mosConfig_absolute_path, $zoom;\r\n // reset script execution time limit (as set in MAX_EXECUTION_TIME ini directive)...\r\n // requires SAFE MODE to be OFF!\r\n if (ini_get('safe_mode') != 1 ) {\r\n set_time_limit(0);\r\n }\r\n $imagepath = $zoom->_CONFIG['imagepath'];\r\n $catdir = $zoom->_gallery->getDir();\r\n $filename = urldecode($filename);\r\n\t\t// replace every space-character with a single \"_\"\r\n\t\t$filename = ereg_replace(\" \", \"_\", $filename);\r\n\t\t$filename = stripslashes($filename);\r\n $filename = ereg_replace(\"'\", \"_\", $filename);\r\n // Get rid of extra underscores\r\n $filename = ereg_replace(\"_+\", \"_\", $filename);\r\n $filename = ereg_replace(\"(^_|_$)\", \"\", $filename);\r\n $zoom->checkDuplicate($filename, 'filename');\r\n $filename = $zoom->_tempname;\r\n // replace space-characters in combination with a comma with 'air'...or nothing!\r\n $keywords = $zoom->cleanString($keywords);\r\n //$keywords = $zoom->htmlnumericentities($keywords);\r\n\t\t$name = $zoom->cleanString($name);\r\n //$name = $zoom->htmlnumericentities($name);\r\n //$descr = $zoom->cleanString($descr);\r\n //$descr = $zoom->htmlnumericentities($descr);\r\n if (empty($name)) {\r\n $name = $zoom->_CONFIG['tempName'];\r\n }\r\n $imgobj = new image(0); //create a new image object with a foo imgid\r\n $imgobj->setImgInfo($filename, $name, $keywords, $descr, $zoom->_gallery->_id, $zoom->currUID, 1, 1);\r\n $imgobj->getMimeType($filetype, $image);\r\n unset($filename, $name, $keywords, $descr); //clear memory, just in case...\r\n if (!$zoom->acceptableSize($image)) {\r\n \t// the file is simply too big, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = sprintf(_ZOOM_ALERT_TOOBIG, $zoom->_CONFIG['maxsizekb'].'kB');\r\n return false;\r\n }\r\n /* IMPORTANT CHEATSHEET:\r\n\t * If we don't get useful data from that or its a type we don't\r\n\t * recognize, take a swing at it using the file name.\r\n\t if ($mimeType == 'application/octet-stream' ||\r\n\t\t $mimeType == 'application/unknown' ||\r\n\t\t GalleryCoreApi::convertMimeToExtension($mimeType) == null) {\r\n\t\t$extension = GalleryUtilities::getFileExtension($file['name']);\r\n\t\t$mimeType = GalleryCoreApi::convertExtensionToMime($extension);\r\n\t }\r\n\t */\r\n if ($zoom->acceptableFormat($imgobj->getMimeType(), true)) {\r\n // File is an image/ movie/ document...\r\n $file = \"$mosConfig_absolute_path/$imagepath$catdir/\".$imgobj->_filename;\r\n $desfile = \"$mosConfig_absolute_path/$imagepath$catdir/thumbs/\".$imgobj->_filename;\r\n if (is_uploaded_file($image)) {\r\n if (!move_uploaded_file(\"$image\", $file)) {\r\n // some error occured while moving file, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n return false;\r\n }\r\n } elseif (!$zoom->platform->copy(\"$image\", $file) && !$zoom->platform->file_exists($file)) {\r\n // some error occured while moving file, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n return false;\r\n }\r\n @$zoom->platform->chmod($file, '0777');\r\n $viewsize = $mosConfig_absolute_path.\"/\".$imagepath.$catdir.\"/viewsize/\".$imgobj->_filename;\r\n if ($zoom->acceptableFormat($imgobj->getMimeType(), true)) {\r\n\t if ($zoom->isImage($imgobj->getMimeType(), true)) {\r\n\t\t\t\t\t$imgobj->_size = $zoom->platform->getimagesize($file);\r\n\t // get image EXIF & IPTC data from file to save it in viewsize image and get a thumbnail...\r\n\t if ($zoom->_CONFIG['readEXIF'] && ($imgobj->_type === \"jpg\" || $imgobj->_type === \"jpeg\") && !(bool)ini_get('safe_mode')) {\r\n\t // Retreive the EXIF, XMP and Photoshop IRB information from\r\n\t // the existing file, so that it can be updated later on...\r\n\t $jpeg_header_data = get_jpeg_header_data($file);\r\n\t $EXIF_data = get_EXIF_JPEG($file);\r\n\t $XMP_data = read_XMP_array_from_text( get_XMP_text( $jpeg_header_data ) );\r\n\t $IRB_data = get_Photoshop_IRB( $jpeg_header_data );\r\n\t $new_ps_file_info = get_photoshop_file_info($EXIF_data, $XMP_data, $IRB_data);\r\n\t // Check if there is a default for the date defined\r\n\t if ((!array_key_exists('date', $new_ps_file_info)) || ((array_key_exists('date', $new_ps_file_info)) && ($new_ps_file_info['date'] == ''))) {\r\n\t // No default for the date defined\r\n\t // figure out a default from the file\r\n\t // Check if there is a EXIF Tag 36867 \"Date and Time of Original\"\r\n\t if (($EXIF_data != FALSE) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(34665, $EXIF_data[0])) && (array_key_exists(0, $EXIF_data[0][34665])) && (array_key_exists(36867, $EXIF_data[0][34665][0]))) {\r\n\t // Tag \"Date and Time of Original\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][34665][0][36867]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } elseif (($EXIF_data != FALSE) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(34665, $EXIF_data[0])) && (array_key_exists(0, $EXIF_data[0][34665])) && (array_key_exists(36868, $EXIF_data[0][34665][0]))) {\r\n\t // Check if there is a EXIF Tag 36868 \"Date and Time when Digitized\"\r\n\t // Tag \"Date and Time when Digitized\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][34665][0][36868]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } else if ( ( $EXIF_data != FALSE ) && (array_key_exists(0, $EXIF_data)) && (array_key_exists(306, $EXIF_data[0]))) {\r\n\t // Check if there is a EXIF Tag 306 \"Date and Time\"\r\n\t // Tag \"Date and Time\" found - use it for the default date\r\n\t $new_ps_file_info['date'] = $EXIF_data[0][306]['Data'][0];\r\n\t $new_ps_file_info['date'] = preg_replace( \"/(\\d\\d\\d\\d):(\\d\\d):(\\d\\d)( \\d\\d:\\d\\d:\\d\\d)/\", \"$1-$2-$3\", $new_ps_file_info['date'] );\r\n\t } else {\r\n\t // Couldn't find an EXIF date in the image\r\n\t // Set default date as creation date of file\r\n\t $new_ps_file_info['date'] = date (\"Y-m-d\", filectime( $file ));\r\n\t }\r\n\t }\r\n\t }\r\n\t // First, rotate the image (if that's mentioned in the 'job description')...\r\n\t\t if ($rotate) {\r\n\t\t\t\t\t\t$tmpdir = $mosConfig_absolute_path.\"/\".$zoom->createTempDir();\r\n\t\t\t\t\t\t$new_source = $tmpdir.\"/\".$imgobj->_filename;\r\n\t\t\t\t\t\tif (!$this->rotateImage($file, $new_source, $degrees, $imgobj)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = \"Error rotating image\";\r\n\t return false;\r\n\t } else {\r\n\t\t\t\t\t\t\t@$zoom->platform->unlink($file);\r\n\t\t\t\t\t\t\tif ($zoom->platform->copy($new_source, $file)) {\r\n\t\t\t\t\t\t\t\t$imgobj->_size = $zoom->platform->getimagesize($file);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t }\r\n\t // resize to thumbnail...\r\n\t // 1-31-2006: fix #0000151\r\n\t if (!$zoom->platform->file_exists($desfile)) {\r\n\t \tif (!$this->resizeImage($file, $desfile, $zoom->_CONFIG['size'], $imgobj)) {\r\n\t\t $this->_err_num++;\r\n\t\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t\t return false;\r\n\t\t }\r\n\t }\r\n\t \r\n\t // if the image size is greater than the given maximum: resize it!\r\n\t if (!$zoom->platform->file_exists($viewsize)) {\r\n\t\t //If the image is larger than the max size\r\n\t\t\t\t\t\tif (($imgobj->_size[0] > $zoom->_CONFIG['maxsize'] || $imgobj->_size[1] > $zoom->_CONFIG['maxsize']) && !$ignoresizes) {\r\n\t\t //Resizes the file. If successful, continue\r\n\t\t\t\t\t\t\tif ($this->resizeImage($file, $viewsize, $zoom->_CONFIG['maxsize'], $imgobj)) {\r\n\t\t\t\t\t\t\t\t//Watermark?\r\n\t\t\t\t\t\t\t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t\t//Watermark. Return errors if not successuful\r\n\t\t\t\t\t\t\t\t\tif (!$this->watermarkImage($viewsize, $viewsize, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t } else {\r\n\t\t $this->_err_num++;\r\n\t\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t\t return false;\r\n\t\t }\r\n\t\t } else {\r\n\t\t //Watermark?\r\n\t\t\t\t\t\t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t//Watermark. Return errors if not successuful\r\n\t\t\t\t\t\t\t\tif (!$this->watermarkImage($file, $file, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t }\r\n\t }\r\n\t } elseif ($zoom->isDocument($imgobj->getMimeType(), true)) {\r\n\t if ($zoom->isIndexable($imgobj->getMimeType(), true) && $this->_use_PDF) {\r\n\t if (!$this->indexDocument($file, $imgobj->_filename)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_INDEXERROR;\r\n\t return false;\r\n\t }\r\n\t } else {\r\n\t \tif($zoom->platform->copy($file, $viewsize)) {\r\n\t \t\tif ((bool)$zoom->_CONFIG['wm_apply']) {\r\n\t\t\t\t\t\t\t\t// put a watermark on the source image...\r\n\t\t\t\t\t\t\t\tif (!$this->watermarkImage($viewsize, $viewsize, $imgobj)) {\r\n\t\t\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_WATERMARKERROR;\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t \t} else {\r\n\t\t\t\t\t\t\t// some error occured while moving file, register this...\r\n\t\t\t\t\t\t\t$this->_err_num++;\r\n\t\t\t\t\t\t\t$this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t\t\t\t\t\t\t$this->_err_types[$this->_err_num] = _ZOOM_ALERT_MOVEFAILURE;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t \t}\r\n\t } elseif ($zoom->isMovie($imgobj->getMimeType(), true)) {\r\n\t //if movie is 'thumbnailable' -> make a thumbnail then!\r\n\t if ($zoom->isThumbnailable($imgobj->_type) && $this->_use_FFMPEG) {\r\n\t if (!$this->createMovieThumb($file, $zoom->_CONFIG['size'], $imgobj->_filename)) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = _ZOOM_ALERT_IMGERROR;\r\n\t return false;\r\n\t }\r\n\t }\r\n\t } elseif ($zoom->isAudio($imgobj->getMimeType(), true)) {\r\n\t // TODO: indexing audio files (mp3-files, etc.) properties, e.g. id3vX tags...\r\n\t }\r\n\t if (!$imgobj->save()) {\r\n\t $this->_err_num++;\r\n\t $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n\t $this->_err_types[$this->_err_num] = \"Database failure\";\r\n\t }\r\n\t }\r\n } else {\r\n //Not the right format, register this...\r\n $this->_err_num++;\r\n $this->_err_names[$this->_err_num] = $imgobj->_filename;\r\n $this->_err_types[$this->_err_num] = _ZOOM_ALERT_WRONGFORMAT_MULT;\r\n return false;\r\n }\r\n return true;\r\n }", "public function rotate(int $degrees): Image\n\t{\n\t\t$this->processor->rotate($degrees);\n\n\t\treturn $this;\n\t}", "function frameImage($inside = 0, $imagesPath = array(), $imgHeight = 600, $imagesWidth = array(), $imagesAngles = array(), $poleColor = null, $poleWidth = 1, $poleHeight = 1)\n{ \n $rowImagick = new Imagick();\n \n foreach($imagesPath as $imgIndex => $imgPath) {\n $imagick = new Imagick(realpath($imgPath));\n\n $imagick->getImageGeometry();\n $imgGeo = $imagick->getImageGeometry();\n $imgOrgWidth = $imgGeo['width'];\n $imgOrgHeight = $imgGeo['height'];\n $imgWidth = $imagesWidth[$imgIndex];\n\n if(isset($imagesAngles[$imgIndex])) {\n $angleX = ($imagesAngles[$imgIndex]) == 90 ? - ($imagesAngles[$imgIndex] - 10) : - $imagesAngles[$imgIndex];\n } else {\n $angleX = -100;\n }\n $angleY = 0;\n $thetX = deg2rad ($angleX);\n $thetY = deg2rad ($angleY);\n\n $s_x1y1 = array(0, 0); // LEFT BOTTOM\n $s_x2y1 = array($imgWidth, 0); // RIGHT BOTTOM\n $s_x1y2 = array(0, $imgHeight); // LEFT TOP\n $s_x2y2 = array($imgWidth, $imgHeight); // RIGHT TOP\n\n $d_x1y1 = array(\n $s_x1y1[0] * cos($thetX) - $s_x1y1[1] * sin($thetY),\n $s_x1y1[0] * sin($thetX) + $s_x1y1[1] * cos($thetY)\n );\n $d_x2y1 = array(\n $s_x2y1[0] * cos($thetX) - $s_x2y1[1] * sin($thetY),\n $s_x2y1[0] * sin($thetX) + $s_x2y1[1] * cos($thetY)\n );\n $d_x1y2 = array(\n $s_x1y2[0] * cos($thetX) - $s_x1y2[1] * sin($thetY),\n $s_x1y2[0] * sin($thetX) + $s_x1y2[1] * cos($thetY)\n );\n $d_x2y2 = array(\n $s_x2y2[0] * cos($thetX) - $s_x2y2[1] * sin($thetY),\n $s_x2y2[0] * sin($thetX) + $s_x2y2[1] * cos($thetY)\n );\n\n $imageprops = $imagick->getImageGeometry();\n $imagick->setImageBackgroundColor(new ImagickPixel('transparent'));\n $imagick->resizeimage($imgWidth, $imgHeight, \\Imagick::FILTER_LANCZOS, 0, true); \n if($poleColor) {\n $imagick->borderImage($poleColor, $poleWidth, $poleHeight);\n }\n\n $points = array(\n $s_x1y2[0], $s_x1y2[1], # Source Top Left\n $d_x1y2[0], $d_x1y2[1], # Destination Top Left\n $s_x1y1[0], $s_x1y1[1], # Source Bottom Left \n $d_x1y1[0], $d_x1y1[1], # Destination Bottom Left \n $s_x2y1[0], $s_x2y1[1], # Source Bottom Right \n $d_x2y1[0], $d_x2y1[1], # Destination Bottom Right \n $s_x2y2[0], $s_x2y2[1], # Source Top Right \n $d_x2y2[0], $d_x2y2[1] # Destination Top Right \n );\n //echo '<pre>'; print_r($points); die;\n\n $imagick->setImageVirtualPixelMethod(\\Imagick::VIRTUALPIXELMETHOD_BACKGROUND);\n $imagick->distortImage(\\Imagick::DISTORTION_PERSPECTIVE, $points, true);\n //$imagick->scaleImage($imgWidth, $imgHeight, false);\n $rowImagick->addImage($imagick); \n }\n\n $rowImagick->resetIterator();\n $combinedRow = $rowImagick->appendImages(false);\n\n $canvas = generateFinalImage($combinedRow);\n header(\"Content-Type: image/png\");\n echo $canvas->getImageBlob();\n}", "function create($filename=\"\")\n{\nif ($filename) {\n $this->src_image_name = trim($filename);\n}\n$dirname=explode(\"/\",$this->src_image_name);\nif(!file_exists(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\")){\n\t@mkdir(\"$dirname[0]/$dirname[1]/$dirname[2]/$dirname[3]/\", 0755);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$this->src_image_name = @iconv(\"utf-8\",\"GBK\",$this->src_image_name);\n\t$this->gz_image_name = @iconv(\"utf-8\",\"GBK\",$this->gz_image_name);\n}\n$src_image_type = $this->get_type($this->src_image_name);\n$src_image = $this->createImage($src_image_type,$this->src_image_name);\nif (!$src_image) return;\n$src_image_w=ImageSX($src_image);\n$src_image_h=ImageSY($src_image);\n\n\nif ($this->gz_image_name){\n $this->gz_image_name = strtolower(trim($this->gz_image_name));\n $gz_image_type = $this->get_type($this->gz_image_name);\n $gz_image = $this->createImage($gz_image_type,$this->gz_image_name);\n $gz_image_w=ImageSX($gz_image);\n $gz_image_h=ImageSY($gz_image);\n $temp_gz_image = $this->getPos($src_image_w,$src_image_h,$this->gz_image_pos,$gz_image);\n $gz_image_x = $temp_gz_image[\"dest_x\"];\n $gz_image_y = $temp_gz_image[\"dest_y\"];\n\t if($this->get_type($this->gz_image_name)=='png'){imagecopy($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h);}\n\t else{imagecopymerge($src_image,$gz_image,$gz_image_x,$gz_image_y,0,0,$gz_image_w,$gz_image_h,$this->gz_image_transition);}\n}\nif ($this->gz_text){\n $temp_gz_text = $this->getPos($src_image_w,$src_image_h,$this->gz_text_pos);\n $gz_text_x = $temp_gz_text[\"dest_x\"];\n $gz_text_y = $temp_gz_text[\"dest_y\"];\n if(preg_match(\"/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i\", $this->gz_text_color, $color))\n {\n $red = hexdec($color[1]);\n $green = hexdec($color[2]);\n $blue = hexdec($color[3]);\n $gz_text_color = imagecolorallocate($src_image, $red,$green,$blue);\n }else{\n $gz_text_color = imagecolorallocate($src_image, 255,255,255);\n }\n imagettftext($src_image, $this->gz_text_size, $this->gz_text_angle, $gz_text_x, $gz_text_y, $gz_text_color,$this->gz_text_font, $this->gz_text);\n}\nif(stristr(PHP_OS,\"WIN\")){\n\t$save_files=explode('/',$this->save_file);\n\t$save_files[count($save_files)-1]=@iconv(\"utf-8\",\"GBK\",$save_files[count($save_files)-1]);\n\t$this->save_file=implode('/',$save_files);\n}\nif ($this->save_file)\n{\n switch ($this->get_type($this->save_file)){\n case 'gif':$src_img=ImagePNG($src_image, $this->save_file); break;\n case 'jpeg':$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n case 'png':$src_img=ImagePNG($src_image, $this->save_file); break;\n default:$src_img=ImageJPEG($src_image, $this->save_file, $this->jpeg_quality); break;\n }\n}\nelse\n{\nif ($src_image_type = \"jpg\") $src_image_type=\"jpeg\";\n header(\"Content-type: image/{$src_image_type}\");\n switch ($src_image_type){\n case 'gif':$src_img=ImagePNG($src_image); break;\n case 'jpg':$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n case 'png':$src_img=ImagePNG($src_image);break;\n default:$src_img=ImageJPEG($src_image, \"\", $this->jpeg_quality);break;\n }\n}\nimagedestroy($src_image);\n}", "public function createRotateFlippedImage($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "public function ieditor_rotate ($sImagePath) {\n\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - START\n\t\t\t */\n\t\t\ttry {\n\t\t\t\t$oImagemagic = $this->getImageMagic();\n\t\t\t\tif (!$oImagemagic->rotate($sImagePath)) {\n\t\t\t\t\tthrow new Exception('Failed to rotate image by ImageMagic');\n\t\t\t\t}\n\t\t\t\t$this->deleteOriginalImages($sImagePath);\n\t\t\t\treturn str_replace(CURRENT_WORKING_DIR, '', $sImagePath);\n\t\t\t} catch (Exception $e) {}\n\t\t\t/**\n\t\t\t * UMIRU CUSTOM - END\n\t\t\t */\n\n\t\t\t$oImage = new umiImageFile($sImagePath);\n\t\t\ttry {\n\t\t\t\t$oImage->rotate();\n\t\t\t\t$this->deleteOriginalImages($sImagePath);\n\t\t\t} catch (coreException $e) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\treturn $oImage->getFilePath(true);\n\t\t}", "function change_picture($data, $pic) {\n $data = str_replace('data:image/png;base64', '', $data);\n $data = str_replace(' ', '+', $data);\n $data = base64_decode($data);\n $source_img = imagecreatefromstring($data);\n $file = '../users/'.$_SESSION['username'].'/'.$pic.'.jpg';\n imagejpeg($source_img, $file,75);\n imagedestroy($source_img);\n http_response_code(200);\n}", "public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }" ]
[ "0.73732585", "0.73423475", "0.73134047", "0.7132019", "0.7039652", "0.703506", "0.701727", "0.69531566", "0.6896156", "0.67415434", "0.67370105", "0.66659", "0.66573334", "0.6621482", "0.65659106", "0.65589774", "0.65589774", "0.6542442", "0.65270835", "0.6525392", "0.6482377", "0.64785707", "0.64509773", "0.6448236", "0.64184487", "0.63918334", "0.63638854", "0.6363316", "0.63170326", "0.63161606", "0.6251895", "0.62424535", "0.6237774", "0.62075996", "0.6161625", "0.61036795", "0.60843766", "0.60774434", "0.60635155", "0.60574836", "0.59775925", "0.5960403", "0.58719087", "0.5804417", "0.57306045", "0.5679714", "0.56691027", "0.56580704", "0.5627213", "0.5617199", "0.55936414", "0.5593304", "0.5560232", "0.5471632", "0.54640114", "0.54623383", "0.5447417", "0.5441024", "0.5439644", "0.5431975", "0.5402744", "0.53834254", "0.538093", "0.5326654", "0.5317648", "0.5316592", "0.5301851", "0.5296471", "0.528436", "0.52522635", "0.5233321", "0.5192242", "0.5151414", "0.5141127", "0.51256603", "0.51256603", "0.51256603", "0.5078893", "0.5073868", "0.50710607", "0.5062612", "0.5062113", "0.5045429", "0.5044429", "0.5041503", "0.49931327", "0.49848992", "0.49532056", "0.49376914", "0.49371314", "0.49272424", "0.49224862", "0.48957282", "0.48947084", "0.4877565", "0.48760965", "0.48718578", "0.48618037", "0.4861445", "0.4855262" ]
0.65913707
14